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;
fi
- 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
artifacts:
expose_as: 'Linux appimage'

View file

@ -36,70 +36,17 @@ done
## Rebuild GIMP
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
mkdir -p build/linux/appimage/_Output
cd _build
ninja &> ../build/linux/appimage/_Output/ninja.log
if [ $? -ne 0 ]; then
cat ../build/linux/appimage/_Output/ninja.log
else
rm ../build/linux/appimage/_Output/ninja.log
fi
ninja &> ninja.log | rm ninja.log || cat ninja.log
ninja install >/dev/null 2>&1
ccache --show-stats
cd ..
# AGNOSTIC VARIABLES (only touch them to make even more portable, without casuistry)
## 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
# INSTALL GO-APPIMAGETOOL
echo '(INFO): downloading go-appimagetool'
apt-get install -y --no-install-recommends wget >/dev/null 2>&1
## For now, we always use the latest version of go-appimagetool
@ -115,121 +62,218 @@ chmod +x "$legacy_appimagetool"
# 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)
conf_app LD_LINUX "/usr" "lib64/ld-*.so.*"
### Glib needed files
find_dat "/usr/share/glib-*/schemas" "*"
prep_pkg ()
{
apt-get install -y --no-install-recommends $1 >/dev/null 2>&1
}
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
prep_pkg "gvfs"
find_lib "gvfs*"
find_lib "gio*"
conf_app GIO_MODULE_DIR "/usr" "${LIB_DIR}/${LIB_SUBDIR}gio"
### GTK needed files
prep_pkg "gnome-icon-theme"
find_dat "/usr/share/icons/gnome" "*"
find_dat "/usr/share/mime" "*"
conf_app GDK_PIXBUF_MODULEDIR "/usr" "${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/*.*.*"
conf_app GDK_PIXBUF_MODULE_FILE "/usr" "${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/*.*.*"
bund_usr "$UNIX_PREFIX" "lib/gvfs*"
bund_usr "$UNIX_PREFIX" "lib/gio*"
conf_app GIO_MODULE_DIR "${LIB_DIR}/${LIB_SUBDIR}gio"
### GTK needed files (to be able to load icons)
bund_usr "$UNIX_PREFIX" "share/icons/Adwaita"
bund_usr "$GIMP_PREFIX" "share/icons/hicolor"
bund_usr "$UNIX_PREFIX" "share/mime"
bund_usr "$UNIX_PREFIX" "lib/gdk-pixbuf-*" --go
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
prep_pkg "libibus-1.0-5"
find_lib "libibus*"
bund_usr "$UNIX_PREFIX" "lib/libibus*"
prep_pkg "ibus-gtk3"
prep_pkg "libcanberra-gtk3-module"
prep_pkg "libxapp-gtk3-module"
conf_app GTK_PATH "/usr" "${LIB_DIR}/${LIB_SUBDIR}gtk-3.0"
conf_app GTK_IM_MODULE_FILE "/usr" "${LIB_DIR}/${LIB_SUBDIR}gtk-3.0/*.*.*"
bund_usr "$UNIX_PREFIX" "lib/gtk-*" --go
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
cp -r _install/* $OPT_PREFIX
conf_app BABL_PATH "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}babl-*"
conf_app GEGL_PATH "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}gegl-*"
conf_app GIMP3_SYSCONFDIR "$OPT_PREFIX" "etc/gimp/*"
conf_app GIMP3_DATADIR "$OPT_PREFIX" "share/gimp/*"
### Copy system theme support
find_bin "gsettings*"
find_bin "sed*"
### Copy GTK inspector support
find_lib "libEGL*"
find_lib "libGL*"
find_lib "dri*"
conf_app LIBGL_DRIVERS_PATH "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}dri"
bund_usr "$GIMP_PREFIX" "lib/libbabl*"
bund_usr "$GIMP_PREFIX" "lib/babl-*"
conf_app BABL_PATH "${LIB_DIR}/${LIB_SUBDIR}babl-*"
bund_usr "$GIMP_PREFIX" "lib/libgegl*"
bund_usr "$GIMP_PREFIX" "lib/gegl-*"
conf_app GEGL_PATH "${LIB_DIR}/${LIB_SUBDIR}gegl-*"
bund_usr "$GIMP_PREFIX" "lib/libgimp*"
bund_usr "$GIMP_PREFIX" "lib/gimp"
conf_app GIMP3_PLUGINDIR "${LIB_DIR}/${LIB_SUBDIR}gimp/*"
bund_usr "$GIMP_PREFIX" "share/gimp"
conf_app GIMP3_DATADIR "share/gimp/*"
lang_array=($(echo $(ls po/*.po |
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
find_bin "uname*"
conf_app GIMP3_PLUGINDIR "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}gimp/*"
conf_app GI_TYPELIB_PATH "$OPT_PREFIX" "${LIB_DIR}/${LIB_SUBDIR}girepository-*"
### Copy JavaScript plug-ins support
find_bin "gjs*"
### Copy Lua plug-ins support (NOT WORKING)
#find_bin "lua*"
#find_lib "liblua*"
### Copy Python plug-ins support
find_bin "python*"
find_lib "python*.*"
conf_app PYTHONPATH "/usr" "${LIB_DIR}/${LIB_SUBDIR}python3.11"
## Other features and plug-ins
### Needed for welcome page
bund_usr "$GIMP_PREFIX" "share/metainfo/org.gimp*.xml"
sed -i '/kudo/d' $USR_DIR/share/metainfo/org.gimp.GIMP.appdata.xml
sed -i "s/date=\"TODO\"/date=\"`date --iso-8601`\"/" $USR_DIR/share/metainfo/org.gimp.GIMP.appdata.xml
### mypaint brushes
bund_usr "$UNIX_PREFIX" "share/mypaint-data/1.0"
### Needed for full CJK and Cyrillic support in file-pdf
bund_usr "$UNIX_PREFIX" "share/poppler"
### FIXME: file-wmf (NOT WORKING for exporting)
#bund_usr "$UNIX_PREFIX" "share/libwmf"
### FIXME: Image graph support (NOT WORKING)
#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
### Auto detect and copy deps of binaries copied above
"./$go_appimagetool" --appimage-extract-and-run -s deploy $OPT_PREFIX/share/applications/org.gimp.GIMP.desktop >/dev/null 2>&1
### Rearranje babl, GEGL and GIMP (only the needed files)
if [ -z "$2" ] || [ "$2" = "usr" ]; then
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
## Other binaries and deps
bund_usr "$GIMP_PREFIX" 'bin/gimp*'
bund_usr "$GIMP_PREFIX" "bin/gegl"
bund_usr "$GIMP_PREFIX" "share/applications/org.gimp.GIMP.desktop"
"./$go_appimagetool" --appimage-extract-and-run -s deploy $USR_DIR/share/applications/org.gimp.GIMP.desktop &> appimagetool.log
## Sad adjustments (appimagetool don't handle this gracefully when done before deploy)
### https://github.com/probonopd/go-appimage/issues/284
sed -i "s|\"/usr/|\"|g" "$OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-2.0/2.10.0/loaders.cache"
### https://github.com/probonopd/go-appimage/issues/282
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"
sed -i "s|\"/usr/|\"|g" "$OPT_PREFIX/${LIB_DIR}/${LIB_SUBDIR}gtk-3.0/3.0.0/immodules.cache"
## Manual adjustments (go-appimagetool don't handle these things gracefully)
### Undo the mess that go-appimagetool makes on the prefix which breaks babl and gegl)
cp -r $APP_DIR/lib64 $USR_DIR
rm -r $APP_DIR/lib64
cp -r $APP_DIR/lib/* $USR_DIR/${LIB_DIR}
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
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
# FINISH APPIMAGE
## Configure AppRun
echo '(INFO): configuring AppRun'
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
sed -i '/kudo/d' $OPT_PREFIX/share/metainfo/org.gimp.GIMP.appdata.xml
sed -i "s/date=\"TODO\"/date=\"`date --iso-8601`\"/" $OPT_PREFIX/share/metainfo/org.gimp.GIMP.appdata.xml
if [ "$2" = "AppDir" ]; then
mkdir -p $GIMP_PREFIX/share
cp -r $GIMP_DISTRIB/share/metainfo $GIMP_PREFIX/share
cp -r $GIMP_DISTRIB/share/applications $GIMP_PREFIX/share
## Construct .appimage
gimp_version=$(grep GIMP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
appimage="GIMP-${gimp_version}-$(uname -m).AppImage"
echo "(INFO): making $appimage"
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"
mv GNU*.AppImage $appimage
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
# 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
HERE="$(dirname "$(readlink -f "${0}")")"
## General paths
export PATH="$HERE"/OPT_PREFIX_WILDbin/:"$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 GI_TYPELIB_PATH="$HERE"/GI_TYPELIB_PATH_WILD:"$GI_TYPELIB_PATH"
export XDG_DATA_DIRS="$HERE"/OPT_PREFIX_WILDshare/:"$XDG_DATA_DIRS"
## Minimum runtime paths
export PATH="$HERE"/usr/bin/:"$PATH"
export LD_LIBRARY_PATH="$HERE"/usr/lib/:"$HERE"/usr/lib/x86_64-linux-gnu/:"$HERE"/usr/lib64/:"$LD_LIBRARY_PATH"
export XDG_DATA_DIRS="$HERE"/usr/share/:"$XDG_DATA_DIRS"
LD_LINUX="$HERE/LD_LINUX_WILD --inhibit-cache"
## Compatibility layer
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)
## GTK-related paths
export GIO_MODULE_DIR="$HERE"/GIO_MODULE_DIR_WILD/modules
export GDK_PIXBUF_MODULEDIR="$HERE"/GDK_PIXBUF_MODULEDIR_WILD/loaders
export GDK_PIXBUF_MODULE_FILE="$HERE"/GDK_PIXBUF_MODULE_FILE_WILD/loaders.cache
export GTK_PATH="$HERE"/GTK_PATH_WILD
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
export BABL_PATH="$HERE"/BABL_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_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
export GIMP3_DIRECTORY="$HOME/.config/GIMP/GIMP_APP_VERSION"
else
export GIMP3_DIRECTORY="$XDG_CONFIG_HOME/GIMP/GIMP_APP_VERSION"
fi
## Other paths (GIMP related)
## Other paths (feature-related)
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
cd "$HERE"/OPT_PREFIX_WILD
LD_PRELOAD=/OPT_PREFIX_WILDlib/x86_64-linux-gnu/libc.so.6 "$HERE"/OPT_PREFIX_WILDbin/gimp-GIMP_APP_VERSION "$@"
echo "This is a CI build of GIMP compatible with Debian DEBIAN_VERSION. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/7661"
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 "$@"