From: Carl Hetherington Date: Wed, 29 Dec 2021 22:16:00 +0000 (+0100) Subject: Fix AppImage on systems with glib version > 2.68 (#2129). X-Git-Tag: checked-for-v2.16.x~114 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=83ae14f5eed0dd9c4fe5d539e18e8cdfdd0ec8bc Fix AppImage on systems with glib version > 2.68 (#2129). The approach here is to bundle more stuff, and most of the details are taken from the Inkscape packaging/appimage/generate.sh script. --- diff --git a/cscript b/cscript index 69feeae14..7a76e133b 100644 --- a/cscript +++ b/cscript @@ -709,6 +709,14 @@ def make_appimage(target, nice_name, internal_name, version): lib = 'usr/lib/x86_64-linux-gnu' target.command(f'mkdir -p build/{nice_filename}.AppDir/{lib}/gdk-pixbuf-2.0/2.10.0') target.command(f'cp -a /{lib}/gdk-pixbuf-2.0 build/{nice_filename}.AppDir/usr/lib/x86_64-linux-gnu/') + for package in ['libc6', 'libglib2.0-0', 'gnome-settings-daemon-schemas', 'librsvg2-common', 'libgdk-pixbuf2.0-0', 'libpango-1.0-0', 'libpangoft2-1.0-0', 'libpangocairo-1.0-0']: + target.command(f'apt download {package}') + target.command(f'dpkg-deb -x {package}*.deb {appdir}') + target.command(f'glib-compile-schemas {appdir}/usr/share/glib-2.0/schemas') + target.command(f'sed -i -e "s|/usr/lib/x86_64-linux-gnu/gdk-pixbuf-.*/.*/loaders/||g" {appdir}/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache') + # Stop anything loading from outside the AppImage + target.command(f'sed -i -e "s|/usr|/xxx|g" {appdir}/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2') + if internal_name == 'dcpomatic2_disk': target.command(f'mkdir -p {appdir}/usr/share/polkit-1/actions') target.command(f'cp {target.directory}/share/polkit-1/actions/com.dcpomatic.write-drive.policy {appdir}/usr/share/polkit-1/actions') @@ -717,7 +725,9 @@ def make_appimage(target, nice_name, internal_name, version): print('#!/bin/bash', file=f) print('export PATH=$APPDIR/usr/bin:$PATH', file=f) print('export XDG_DATA_DIRS="$APPDIR/usr/share/:/usr/share/:$XDG_DATA_DIRS"', file=f) - print('export LD_LIBRARY_PATH=$APPDIR/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}', file=f) + print('export GDK_PIXBUF_MODULEDIR=$(readlink -f "$APPDIR"/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/ )', file=f) + print('export GDK_PIXBUF_MODULE_FILE=$(readlink -f "$APPDIR"/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache )', file=f) + print('export LD_LIBRARY_PATH=$GDK_PIXBUF_MODULEDIR:$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu', file=f) print(f'"$APPDIR"/usr/bin/{internal_name} $@', file=f) target.command(f'chmod a+rx {appdir}/AppRun') with open(f'{appdir}/{internal_name}.desktop', 'w') as f: