diff --git a/make-appimage.sh b/make-appimage.sh index 69312cf..a58fe0b 100644 --- a/make-appimage.sh +++ b/make-appimage.sh @@ -84,12 +84,19 @@ if [ -d "$gtk_libdir/gtk-4.0" ]; then cp -r "$gtk_libdir/gtk-4.0" "$appdir/usr/lib/gtk-4.0" fi +# The pixbuf loaders and their cache. gdk-pixbuf 2.44 on plain Arch builds image +# loading into glycin and ships no loaders at all, so this is skipped there and +# the AppRun below leaves the module file unset. pixbuf_binarydir=$(pkg-config --variable=gdk_pixbuf_binarydir gdk-pixbuf-2.0) -mkdir -p "$appdir/usr/lib/gdk-pixbuf-2.0" -pixbuf_dir="$appdir/usr/lib/gdk-pixbuf-2.0/${pixbuf_binarydir##*gdk-pixbuf-2.0/}" -cp -r "$pixbuf_binarydir" "$pixbuf_dir" -gdk-pixbuf-query-loaders > "$pixbuf_dir/loaders.cache" -sed -i "s|$(pkg-config --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0)/||g" "$pixbuf_dir/loaders.cache" +pixbuf_moduledir=$(pkg-config --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0) +pixbuf_dir= +if [ -d "$pixbuf_binarydir" ] && [ -d "$pixbuf_moduledir" ]; then + mkdir -p "$appdir/usr/lib/gdk-pixbuf-2.0" + pixbuf_dir="$appdir/usr/lib/gdk-pixbuf-2.0/${pixbuf_binarydir##*gdk-pixbuf-2.0/}" + cp -r "$pixbuf_binarydir" "$pixbuf_dir" + gdk-pixbuf-query-loaders "$pixbuf_dir/loaders"/*.so > "$pixbuf_dir/loaders.cache" + sed -i "s|$pixbuf_dir/loaders/||g" "$pixbuf_dir/loaders.cache" +fi mkdir -p "$appdir/usr/lib/gio" cp -r "$(pkg-config --variable=giomoduledir gio-2.0)" "$appdir/usr/lib/gio/modules" @@ -115,7 +122,6 @@ export LD_LIBRARY_PATH="$APPDIR/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" export XDG_DATA_DIRS="$APPDIR/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" export GTK_PATH="$APPDIR/usr/lib/gtk-4.0" export GTK_EXE_PREFIX="$APPDIR/usr" -export GDK_PIXBUF_MODULE_FILE="$APPDIR/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" export GIO_MODULE_DIR="$APPDIR/usr/lib/gio/modules" # The app looks beside the executable and in system folders for libmpv. export AIOSTREAMS_LIBMPV="${AIOSTREAMS_LIBMPV:-$APPDIR/usr/lib/libmpv.so.2}" @@ -125,8 +131,12 @@ export AIOSTREAMS_WEB_DIR="${AIOSTREAMS_WEB_DIR:-$APPDIR/usr/lib/aiostreams-desk export WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 # VA-API drivers sit wherever the host puts them, not always on the build host's path. export LIBVA_DRIVERS_PATH="${LIBVA_DRIVERS_PATH:+$LIBVA_DRIVERS_PATH:}/usr/lib/x86_64-linux-gnu/dri:/usr/lib64/dri:/usr/lib/dri" -exec "$APPDIR/usr/bin/aiostreams-desktop" "$@" EOF +# Point the module file at the bundled loaders where they were bundled. +if [ -n "$pixbuf_dir" ]; then + echo "export GDK_PIXBUF_MODULE_FILE=\"\$APPDIR/${pixbuf_dir#"$appdir/"}/loaders.cache\"" >> "$appdir/AppRun" +fi +echo 'exec "$APPDIR/usr/bin/aiostreams-desktop" "$@"' >> "$appdir/AppRun" chmod +x "$appdir/AppRun" linuxdeploy="$tools/linuxdeploy-$image_arch"