build/linux: Refactor AppImage bundling script to easier maintenance

- Simplify three functions into 'bund_usr' (similar to 'bundle' in Win script)
- Add 'wipe_usr' function (similar to 'clean' in Win script)
- Verbose the steps of AppImage making
- Log (go)appimagetool bundling of deps (not only the the .appimage making)
- Change AppRun to be more clear about our .appimage compatibility

This refactoring is not perfect but is good enough to anyone understand
how our AppImage is made just reading the script.
This commit is contained in:
Bruno 2024-08-31 10:58:01 -03:00
parent c1f6a8f217
commit a988084a97
3 changed files with 221 additions and 182 deletions

View file

@ -293,7 +293,7 @@ gimp-debian-x64:
ninja dist; ninja dist;
fi fi
- cd .. - cd ..
# Make sure that any Debian pipeline is easily testable locally on Debian # Make sure that any Debian pipeline is easily testable relocatable on local Debian
- bash build/linux/appimage/2_bundle-gimp-appimage.sh - bash build/linux/appimage/2_bundle-gimp-appimage.sh
artifacts: artifacts:
expose_as: 'Linux appimage' expose_as: 'Linux appimage'

View file

@ -36,70 +36,17 @@ done
## Rebuild GIMP ## Rebuild GIMP
echo '(INFO): rebuilding GIMP as relocatable' echo '(INFO): rebuilding GIMP as relocatable'
### FIXME: GIMP tests fails with raster icons in relocatable mode
meson configure _build -Drelocatable-bundle=yes -Dvector-icons=true >/dev/null 2>&1 meson configure _build -Drelocatable-bundle=yes -Dvector-icons=true >/dev/null 2>&1
mkdir -p build/linux/appimage/_Output
cd _build cd _build
ninja &> ../build/linux/appimage/_Output/ninja.log ninja &> ninja.log | rm ninja.log || cat ninja.log
if [ $? -ne 0 ]; then
cat ../build/linux/appimage/_Output/ninja.log
else
rm ../build/linux/appimage/_Output/ninja.log
fi
ninja install >/dev/null 2>&1 ninja install >/dev/null 2>&1
ccache --show-stats ccache --show-stats
cd .. cd ..
# AGNOSTIC VARIABLES (only touch them to make even more portable, without casuistry) # INSTALL GO-APPIMAGETOOL
echo '(INFO): downloading go-appimagetool'
## This script is "filesystem-agnostic". The packager can quickly choose either
## putting everything in /usr or in AppDir(root) just specifying the 2nd parameter.
GIMP_DISTRIB="$CI_PROJECT_DIR/build/linux/appimage/AppDir"
if [ "$GITLAB_CI" ] || [ -z "$GIMP_PREFIX" ]; then
GIMP_PREFIX="$GIMP_DISTRIB/usr"
fi
if [ -z "$1" ] || [ "$1" = "usr" ]; then
OPT_PREFIX="${GIMP_PREFIX}"
elif [ "$1" = "AppDir" ]; then
OPT_PREFIX="${GIMP_DISTRIB}"
fi
#(MOSTLY) AGNOSTIC FUNCTIONS
prep_pkg ()
{
apt-get install -y --no-install-recommends $1 >/dev/null 2>&1
}
find_bin ()
{
find /usr/bin -name ${1} -execdir cp -r '{}' $OPT_PREFIX/bin \;
find /bin -name ${1} -execdir cp -r '{}' $OPT_PREFIX/bin \;
}
find_lib ()
{
mkdir -p $OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR}
find /usr/${LIB_DIR}/${LIB_SUBDIR} -maxdepth 1 -name ${1} -execdir cp -r '{}' $OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR} \;
find /usr/${LIB_DIR} -maxdepth 1 -name ${1} -execdir cp -r '{}' $OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR} \;
find /${LIB_DIR}/${LIB_SUBDIR} -maxdepth 1 -name ${1} -execdir cp -r '{}' $OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR} \;
find /${LIB_DIR} -maxdepth 1 -name ${1} -execdir cp -r '{}' $OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR} \;
}
find_dat ()
{
DAT_PATH=$(echo $1 | sed 's|/usr/||g')
mkdir -p $OPT_PREFIX/$DAT_PATH
cp -r $1/$2 $OPT_PREFIX/$DAT_PATH/$3
}
conf_app ()
{
VAR_PATH=$(echo $2/$3 | sed "s|${2}/||g")
sed -i "s|${1}_WILD|OPT_PREFIX_WILD${VAR_PATH}|" build/linux/appimage/AppRun
}
# PREPARE ENVIRONMENT
apt-get install -y --no-install-recommends wget >/dev/null 2>&1 apt-get install -y --no-install-recommends wget >/dev/null 2>&1
## For now, we always use the latest version of go-appimagetool ## For now, we always use the latest version of go-appimagetool
@ -115,121 +62,218 @@ chmod +x "$legacy_appimagetool"
# BUNDLE FILES # BUNDLE FILES
echo '(INFO): making .appimage bundle' echo '(INFO): copying files to AppDir'
UNIX_PREFIX='/usr'
if [ "$GITLAB_CI" ]; then
export GIMP_PREFIX="$PWD/_install"
elif [ -z "$GITLAB_CI" ] && [ -z "$GIMP_PREFIX" ]; then
export GIMP_PREFIX="$PWD/../_install"
fi
APP_DIR="$PWD/AppDir"
USR_DIR="$APP_DIR/usr"
## System base (needed to use GIMP or to avoid polluting the terminal output) prep_pkg ()
conf_app LD_LINUX "/usr" "lib64/ld-*.so.*" {
### Glib needed files apt-get install -y --no-install-recommends $1 >/dev/null 2>&1
find_dat "/usr/share/glib-*/schemas" "*" }
bund_usr ()
{
if [ -z "$3" ]; then
cd $APP_DIR
case $2 in
bin*)
mkdir -p $USR_DIR/bin
find $1/bin -name ${2##*/} -execdir cp -r '{}' $USR_DIR/bin \;
find /bin -name ${2##*/} -execdir cp -r '{}' $USR_DIR/bin \;
;;
lib*)
mkdir -p $USR_DIR/${LIB_DIR}/${LIB_SUBDIR}
find $1/${LIB_DIR}/${LIB_SUBDIR} -maxdepth 1 -name ${2##*/} -execdir cp -r '{}' $USR_DIR/${LIB_DIR}/${LIB_SUBDIR} \;
find /usr/${LIB_DIR} -maxdepth 1 -name ${2##*/} -execdir cp -r '{}' $USR_DIR/${LIB_DIR}/${LIB_SUBDIR} \;
;;
libexec|share*|etc*)
dat_path=$(echo $1/$2 | sed "s|$1/||g")
dat_path_parent=$(echo $dat_path | sed "s|${dat_path##*/}||g")
if [ -d "$1/$dat_path" ] || [ -f "$1/$dat_path" ]; then
mkdir -p $USR_DIR/$dat_path_parent
cp -r $1/$dat_path $USR_DIR/$dat_path_parent
fi
;;
esac
cd ..
fi
}
conf_app ()
{
prefix=$UNIX_PREFIX
case $1 in
*BABL*|*GEGL*|*GIMP*)
prefix=$GIMP_PREFIX
esac
var_path=$(echo $prefix/$2 | sed "s|${prefix}/||g")
sed -i "s|${1}_WILD|usr/${var_path}|" build/linux/appimage/AppRun
}
wipe_usr ()
{
if [[ ! "$1" =~ '*' ]]; then
rm -r $USR_DIR/$1
else
cleanedArray=($(find $USR_DIR -iname ${1##*/}))
for path_dest_full in "${cleanedArray[@]}"; do
rm -r -f $path_dest_full
done
fi
}
## Prepare AppDir
if [ ! -f 'build/linux/appimage/AppRun.bak' ]; then
cp build/linux/appimage/AppRun build/linux/appimage/AppRun.bak
fi
mkdir $APP_DIR
bund_usr "$UNIX_PREFIX" "lib64/ld-*.so.*" --go
conf_app LD_LINUX "lib64/ld-*.so.*"
## Bundle base (bare minimum to run GTK apps)
### Glib needed files (to be able to use file dialogs)
bund_usr "$UNIX_PREFIX" "share/glib-*/schemas"
### Glib commonly required modules ### Glib commonly required modules
prep_pkg "gvfs" prep_pkg "gvfs"
find_lib "gvfs*" bund_usr "$UNIX_PREFIX" "lib/gvfs*"
find_lib "gio*" bund_usr "$UNIX_PREFIX" "lib/gio*"
conf_app GIO_MODULE_DIR "/usr" "${LIB_DIR}/${LIB_SUBDIR}gio" conf_app GIO_MODULE_DIR "${LIB_DIR}/${LIB_SUBDIR}gio"
### GTK needed files ### GTK needed files (to be able to load icons)
prep_pkg "gnome-icon-theme" bund_usr "$UNIX_PREFIX" "share/icons/Adwaita"
find_dat "/usr/share/icons/gnome" "*" bund_usr "$GIMP_PREFIX" "share/icons/hicolor"
find_dat "/usr/share/mime" "*" bund_usr "$UNIX_PREFIX" "share/mime"
conf_app GDK_PIXBUF_MODULEDIR "/usr" "${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/*.*.*" bund_usr "$UNIX_PREFIX" "lib/gdk-pixbuf-*" --go
conf_app GDK_PIXBUF_MODULE_FILE "/usr" "${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/*.*.*" conf_app GDK_PIXBUF_MODULEDIR "${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/*.*.*"
conf_app GDK_PIXBUF_MODULE_FILE "${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/*.*.*"
### GTK commonly required modules ### GTK commonly required modules
prep_pkg "libibus-1.0-5" prep_pkg "libibus-1.0-5"
find_lib "libibus*" bund_usr "$UNIX_PREFIX" "lib/libibus*"
prep_pkg "ibus-gtk3" prep_pkg "ibus-gtk3"
prep_pkg "libcanberra-gtk3-module" prep_pkg "libcanberra-gtk3-module"
prep_pkg "libxapp-gtk3-module" prep_pkg "libxapp-gtk3-module"
conf_app GTK_PATH "/usr" "${LIB_DIR}/${LIB_SUBDIR}gtk-3.0" bund_usr "$UNIX_PREFIX" "lib/gtk-*" --go
conf_app GTK_IM_MODULE_FILE "/usr" "${LIB_DIR}/${LIB_SUBDIR}gtk-3.0/*.*.*" conf_app GTK_PATH "${LIB_DIR}/${LIB_SUBDIR}gtk-3.0"
conf_app GTK_IM_MODULE_FILE "${LIB_DIR}/${LIB_SUBDIR}gtk-3.0/*.*.*"
### FIXME: GTK theming support (NOT WORKING)
#bund_usr "$UNIX_PREFIX" "bin/gsettings"
## Core features ## Core features
cp -r _install/* $OPT_PREFIX bund_usr "$GIMP_PREFIX" "lib/libbabl*"
conf_app BABL_PATH "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}babl-*" bund_usr "$GIMP_PREFIX" "lib/babl-*"
conf_app GEGL_PATH "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}gegl-*" conf_app BABL_PATH "${LIB_DIR}/${LIB_SUBDIR}babl-*"
conf_app GIMP3_SYSCONFDIR "$OPT_PREFIX" "etc/gimp/*" bund_usr "$GIMP_PREFIX" "lib/libgegl*"
conf_app GIMP3_DATADIR "$OPT_PREFIX" "share/gimp/*" bund_usr "$GIMP_PREFIX" "lib/gegl-*"
### Copy system theme support conf_app GEGL_PATH "${LIB_DIR}/${LIB_SUBDIR}gegl-*"
find_bin "gsettings*" bund_usr "$GIMP_PREFIX" "lib/libgimp*"
find_bin "sed*" bund_usr "$GIMP_PREFIX" "lib/gimp"
### Copy GTK inspector support conf_app GIMP3_PLUGINDIR "${LIB_DIR}/${LIB_SUBDIR}gimp/*"
find_lib "libEGL*" bund_usr "$GIMP_PREFIX" "share/gimp"
find_lib "libGL*" conf_app GIMP3_DATADIR "share/gimp/*"
find_lib "dri*" lang_array=($(echo $(ls po/*.po |
conf_app LIBGL_DRIVERS_PATH "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}dri" sed -e 's|po/||g' -e 's|.po||g' | sort) |
tr '\n\r' ' '))
for lang in "${lang_array[@]}"; do
bund_usr "$GIMP_PREFIX" share/locale/$lang/LC_MESSAGES
#bund_usr "$UNIX_PREFIX" share/locale/$lang/LC_MESSAGES/gtk*.mo
# For language list in text tool options
bund_usr "$UNIX_PREFIX" share/locale/$lang/LC_MESSAGES/iso_639_3.mo
done
conf_app GIMP3_LOCALEDIR "share/locale"
bund_usr "$GIMP_PREFIX" "etc/gimp"
conf_app GIMP3_SYSCONFDIR "etc/gimp/*"
## Plug-ins ## Other features and plug-ins
find_bin "uname*" ### Needed for welcome page
conf_app GIMP3_PLUGINDIR "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}gimp/*" bund_usr "$GIMP_PREFIX" "share/metainfo/org.gimp*.xml"
conf_app GI_TYPELIB_PATH "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}girepository-*" sed -i '/kudo/d' $USR_DIR/share/metainfo/org.gimp.GIMP.appdata.xml
### Copy JavaScript plug-ins support sed -i "s/date=\"TODO\"/date=\"`date --iso-8601`\"/" $USR_DIR/share/metainfo/org.gimp.GIMP.appdata.xml
find_bin "gjs*" ### mypaint brushes
### Copy Lua plug-ins support (NOT WORKING) bund_usr "$UNIX_PREFIX" "share/mypaint-data/1.0"
#find_bin "lua*" ### Needed for full CJK and Cyrillic support in file-pdf
#find_lib "liblua*" bund_usr "$UNIX_PREFIX" "share/poppler"
### Copy Python plug-ins support ### FIXME: file-wmf (NOT WORKING for exporting)
find_bin "python*" #bund_usr "$UNIX_PREFIX" "share/libwmf"
find_lib "python*.*" ### FIXME: Image graph support (NOT WORKING)
conf_app PYTHONPATH "/usr" "${LIB_DIR}/${LIB_SUBDIR}python3.11" #bund_usr "$UNIX_PREFIX" "bin/dot"
#bund_usr "$UNIX_PREFIX" "lib/graphviz"
### Needed for GTK inspector
bund_usr "$UNIX_PREFIX" "lib/libEGL*"
bund_usr "$UNIX_PREFIX" "lib/libGL*"
bund_usr "$UNIX_PREFIX" "lib/dri*"
conf_app LIBGL_DRIVERS_PATH "${LIB_DIR}/${LIB_SUBDIR}dri"
### FIXME: Debug dialog (NOT WORKING)
#bund_usr "$UNIX_PREFIX" "bin/lldb*"
#bund_usr "$GIMP_PREFIX" "libexec/gimp-debug-tool*"
### Introspected plug-ins
bund_usr "$GIMP_PREFIX" "lib/girepository-*"
bund_usr "$UNIX_PREFIX" "lib/girepository-*"
conf_app GI_TYPELIB_PATH "${LIB_DIR}/${LIB_SUBDIR}girepository-*"
#### JavaScript plug-ins support
bund_usr "$UNIX_PREFIX" "bin/gjs"
#### Python plug-ins support
bund_usr "$UNIX_PREFIX" "bin/python*"
bund_usr "$UNIX_PREFIX" "lib/python*"
mv "$USR_DIR/${LIB_DIR}/${LIB_SUBDIR}python3.11" "$USR_DIR/${LIB_DIR}"
mv "$USR_DIR/${LIB_DIR}/${LIB_SUBDIR}python3" "$USR_DIR/${LIB_DIR}"
wipe_usr ${LIB_DIR}/*.pyc
#### FIXME: Lua plug-ins support (NOT WORKING)
#bund_usr "$UNIX_PREFIX" "bin/luajit*"
#bund_usr "$UNIX_PREFIX" "lib/lua"
#bund_usr "$UNIX_PREFIX" "share/lua"
## Final adjustments ## Other binaries and deps
### Auto detect and copy deps of binaries copied above bund_usr "$GIMP_PREFIX" 'bin/gimp*'
"./$go_appimagetool" --appimage-extract-and-run -s deploy $OPT_PREFIX/share/applications/org.gimp.GIMP.desktop >/dev/null 2>&1 bund_usr "$GIMP_PREFIX" "bin/gegl"
### Rearranje babl, GEGL and GIMP (only the needed files) bund_usr "$GIMP_PREFIX" "share/applications/org.gimp.GIMP.desktop"
if [ -z "$2" ] || [ "$2" = "usr" ]; then "./$go_appimagetool" --appimage-extract-and-run -s deploy $USR_DIR/share/applications/org.gimp.GIMP.desktop &> appimagetool.log
cp -r $GIMP_DISTRIB/etc $GIMP_PREFIX
rm -r $GIMP_DISTRIB/etc
cp -r $GIMP_DISTRIB/lib $GIMP_PREFIX
rm -r $GIMP_DISTRIB/lib
cp -r $GIMP_DISTRIB/lib64 $GIMP_PREFIX
rm -r $GIMP_DISTRIB/lib64
elif [ "$2" = "AppDir" ]; then
cp -r $GIMP_PREFIX/* $GIMP_DISTRIB
rm -r $GIMP_PREFIX
fi
### Remove unnecessary files
rm -r $OPT_PREFIX/include
rm -r $OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR}pkgconfig
rm -r $OPT_PREFIX/share/doc
rm -r $OPT_PREFIX/share/man
## Sad adjustments (appimagetool don't handle this gracefully when done before deploy) ## Manual adjustments (go-appimagetool don't handle these things gracefully)
### https://github.com/probonopd/go-appimage/issues/284 ### Undo the mess that go-appimagetool makes on the prefix which breaks babl and gegl)
sed -i "s|\"/usr/|\"|g" "$OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-2.0/2.10.0/loaders.cache" cp -r $APP_DIR/lib64 $USR_DIR
### https://github.com/probonopd/go-appimage/issues/282 rm -r $APP_DIR/lib64
cp -r "/usr/${LIB_DIR}/${LIB_SUBDIR}gtk-3.0/3.0.0/immodules.cache" "$OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR}gtk-3.0/3.0.0" cp -r $APP_DIR/lib/* $USR_DIR/${LIB_DIR}
sed -i "s|\"/usr/|\"|g" "$OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR}gtk-3.0/3.0.0/immodules.cache" rm -r $APP_DIR/lib
### Remove unnecessary files bunbled by go-appimagetool
wipe_usr ${LIB_DIR}/${LIB_SUBDIR}gconv
wipe_usr ${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/gdk-pixbuf-query-loaders
wipe_usr share/doc
wipe_usr share/themes
rm -r $APP_DIR/etc
# CONFIGURE APPRUN # FINISH APPIMAGE
cp build/linux/appimage/AppRun $GIMP_DISTRIB
if [ -z "$2" ] || [ "$2" = "usr" ]; then
sed -i "s|OPT_PREFIX_WILD|usr/|g" $GIMP_DISTRIB/AppRun
elif [ "$2" = "AppDir" ]; then
sed -i "s|OPT_PREFIX_WILD||g" $GIMP_DISTRIB/AppRun
fi
## Configure AppRun
echo '(INFO): configuring AppRun'
GIMP_APP_VERSION=$(grep GIMP_APP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') GIMP_APP_VERSION=$(grep GIMP_APP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
sed -i "s|GIMP_APP_VERSION|${GIMP_APP_VERSION}|" $GIMP_DISTRIB/AppRun sed -i "s|GIMP_APP_VERSION|${GIMP_APP_VERSION}|" build/linux/appimage/AppRun
sed -i "s|DEBIAN_VERSION|$(cat /etc/debian_version)|" build/linux/appimage/AppRun
mv build/linux/appimage/AppRun $APP_DIR
chmod +x $APP_DIR/AppRun
mv build/linux/appimage/AppRun.bak build/linux/appimage/AppRun
## Copy icon to proper place
echo "(INFO): copying org.gimp.GIMP.svg asset to AppDir"
cp $GIMP_PREFIX/share/icons/hicolor/scalable/apps/org.gimp.GIMP.svg $APP_DIR/org.gimp.GIMP.svg
# CONFIGURE METADATA ## Construct .appimage
sed -i '/kudo/d' $OPT_PREFIX/share/metainfo/org.gimp.GIMP.appdata.xml gimp_version=$(grep GIMP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
sed -i "s/date=\"TODO\"/date=\"`date --iso-8601`\"/" $OPT_PREFIX/share/metainfo/org.gimp.GIMP.appdata.xml appimage="GIMP-${gimp_version}-$(uname -m).AppImage"
if [ "$2" = "AppDir" ]; then echo "(INFO): making $appimage"
mkdir -p $GIMP_PREFIX/share ARCH=$(uname -m) "./$legacy_appimagetool" --appimage-extract-and-run $APP_DIR &>> appimagetool.log # -u "zsync|https://download.gimp.org/gimp/v${GIMP_APP_VERSION}/GIMP-latest-$(uname -m).AppImage.zsync"
cp -r $GIMP_DISTRIB/share/metainfo $GIMP_PREFIX/share mv GNU*.AppImage $appimage
cp -r $GIMP_DISTRIB/share/applications $GIMP_PREFIX/share rm -r $APP_DIR
if [ "$GITLAB_CI" ]; then
mkdir -p build/linux/appimage/_Output/
mv GIMP*.AppImage build/linux/appimage/_Output/
mv *.log build/linux/appimage/_Output/
fi fi
# CONFIGURE ICON
cp $OPT_PREFIX/share/icons/hicolor/scalable/apps/org.gimp.GIMP.svg $GIMP_DISTRIB/org.gimp.GIMP.svg
if [ "$2" = "AppDir" ]; then
cp -r $GIMP_DISTRIB/share/icons/ $GIMP_PREFIX/share
fi
# MAKE APPIMAGE
"./$legacy_appimagetool" --appimage-extract-and-run $GIMP_DISTRIB &> build/linux/appimage/_Output/appimagetool.log # -u "zsync|https://download.gimp.org/gimp/v${GIMP_APP_VERSION}/GIMP-latest-$(uname -m).AppImage.zsync"
GIMP_VERSION=$(grep GIMP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
mv GNU*.AppImage build/linux/appimage/_Output/GIMP-${GIMP_VERSION}-$(uname -m).AppImage

View file

@ -12,51 +12,46 @@ set -e
# PATHS MAPPING # PATHS MAPPING
HERE="$(dirname "$(readlink -f "${0}")")" HERE="$(dirname "$(readlink -f "${0}")")"
## General paths ## Minimum runtime paths
export PATH="$HERE"/OPT_PREFIX_WILDbin/:"$PATH" export PATH="$HERE"/usr/bin/:"$PATH"
export LD_LIBRARY_PATH="$HERE"/OPT_PREFIX_WILDlib/:"$HERE"/OPT_PREFIX_WILDlib/x86_64-linux-gnu/:"$HERE"/OPT_PREFIX_WILDlib64/:"$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="$HERE"/usr/lib/:"$HERE"/usr/lib/x86_64-linux-gnu/:"$HERE"/usr/lib64/:"$LD_LIBRARY_PATH"
export GI_TYPELIB_PATH="$HERE"/GI_TYPELIB_PATH_WILD:"$GI_TYPELIB_PATH" export XDG_DATA_DIRS="$HERE"/usr/share/:"$XDG_DATA_DIRS"
export XDG_DATA_DIRS="$HERE"/OPT_PREFIX_WILDshare/:"$XDG_DATA_DIRS" LD_LINUX="$HERE/LD_LINUX_WILD --inhibit-cache"
## Compatibility layer ## GTK-related paths
LD_LINUX="$HERE/LD_LINUX_WILD --inhibit-cache --library-path $LD_LIBRARY_PATH"
DISTRO=$(eval "$LD_LINUX" "$HERE"/OPT_PREFIX_WILDbin/uname -a)
echo "This is a CI native build of GIMP (please see devel-docs/os-support.txt)."
case "$DISTRO" in
*Debian*|*debian*)
echo '.js (JavaScript) plug-ins | supported.'
echo '.lua (Lua) plug-ins | NOT supported!'
echo '.py (Python) plug-ins | supported.'
echo '.scm (ScriptFu) plug-ins | supported.'
echo '.vala (Vala) plug-ins | supported.'
esac
## Other paths (base)
export GIO_MODULE_DIR="$HERE"/GIO_MODULE_DIR_WILD/modules export GIO_MODULE_DIR="$HERE"/GIO_MODULE_DIR_WILD/modules
export GDK_PIXBUF_MODULEDIR="$HERE"/GDK_PIXBUF_MODULEDIR_WILD/loaders export GDK_PIXBUF_MODULEDIR="$HERE"/GDK_PIXBUF_MODULEDIR_WILD/loaders
export GDK_PIXBUF_MODULE_FILE="$HERE"/GDK_PIXBUF_MODULE_FILE_WILD/loaders.cache export GDK_PIXBUF_MODULE_FILE="$HERE"/GDK_PIXBUF_MODULE_FILE_WILD/loaders.cache
export GTK_PATH="$HERE"/GTK_PATH_WILD export GTK_PATH="$HERE"/GTK_PATH_WILD
export GTK_IM_MODULE_FILE="$HERE"/GTK_IM_MODULE_FILE_WILD/immodules.cache export GTK_IM_MODULE_FILE="$HERE"/GTK_IM_MODULE_FILE_WILD/immodules.cache
export GTK_THEME=$(eval "$LD_LINUX" "$HERE"/OPT_PREFIX_WILDbin/gsettings get org.gnome.desktop.interface gtk-theme | "$HERE"/OPT_PREFIX_WILDbin/sed "s/'//g" || echo 'Default') #export GTK_THEME=$(eval "$LD_LINUX" "$HERE"/usr/bin/gsettings get org.gnome.desktop.interface gtk-theme)
## GIMP-specific paths ## GIMP-specific paths
export BABL_PATH="$HERE"/BABL_PATH_WILD export BABL_PATH="$HERE"/BABL_PATH_WILD
export GEGL_PATH="$HERE"/GEGL_PATH_WILD export GEGL_PATH="$HERE"/GEGL_PATH_WILD
export GIMP3_SYSCONFDIR="$HERE"/GIMP3_SYSCONFDIR_WILD
export GIMP3_PLUGINDIR="$HERE"/GIMP3_PLUGINDIR_WILD export GIMP3_PLUGINDIR="$HERE"/GIMP3_PLUGINDIR_WILD
export GIMP3_DATADIR="$HERE"/GIMP3_DATADIR_WILD export GIMP3_DATADIR="$HERE"/GIMP3_DATADIR_WILD
export GIMP3_LOCALEDIR="$HERE"/OPT_PREFIX_WILDshare/locale export GIMP3_LOCALEDIR="$HERE"/GIMP3_LOCALEDIR_WILD
export GIMP3_SYSCONFDIR="$HERE"/GIMP3_SYSCONFDIR_WILD
if [ -z ${XDG_CONFIG_HOME} ]; then if [ -z ${XDG_CONFIG_HOME} ]; then
export GIMP3_DIRECTORY="$HOME/.config/GIMP/GIMP_APP_VERSION" export GIMP3_DIRECTORY="$HOME/.config/GIMP/GIMP_APP_VERSION"
else else
export GIMP3_DIRECTORY="$XDG_CONFIG_HOME/GIMP/GIMP_APP_VERSION" export GIMP3_DIRECTORY="$XDG_CONFIG_HOME/GIMP/GIMP_APP_VERSION"
fi fi
## Other paths (GIMP related) ## Other paths (feature-related)
export LIBGL_DRIVERS_PATH="$HERE"/LIBGL_DRIVERS_PATH_WILD export LIBGL_DRIVERS_PATH="$HERE"/LIBGL_DRIVERS_PATH_WILD
export PYTHONPATH="$HERE"/PYTHONPATH_WILD export GI_TYPELIB_PATH="$HERE"/GI_TYPELIB_PATH_WILD:"$GI_TYPELIB_PATH"
export PYTHONHOME="$HERE"/usr
export PYTHONDONTWRITEBYTECODE=1
# RUN MAIN_BIN # RUN MAIN_BIN
cd "$HERE"/OPT_PREFIX_WILD echo "This is a CI build of GIMP compatible with Debian DEBIAN_VERSION. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/7661"
LD_PRELOAD=/OPT_PREFIX_WILDlib/x86_64-linux-gnu/libc.so.6 "$HERE"/OPT_PREFIX_WILDbin/gimp-GIMP_APP_VERSION "$@" echo '.js (JavaScript) plug-ins | supported.'
echo '.lua (Lua) plug-ins | NOT supported!'
echo '.py (Python) plug-ins | supported.'
echo '.scm (ScriptFu) plug-ins | supported.'
echo '.vala (Vala) plug-ins | supported.'
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libc.so.6 "$HERE"/usr/bin/gimp-GIMP_APP_VERSION "$@"