summaryrefslogtreecommitdiffstats
path: root/packaging/appimage/AppRun
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /packaging/appimage/AppRun
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/appimage/AppRun')
-rw-r--r--packaging/appimage/AppRun75
1 files changed, 75 insertions, 0 deletions
diff --git a/packaging/appimage/AppRun b/packaging/appimage/AppRun
new file mode 100644
index 0000000..696ef23
--- /dev/null
+++ b/packaging/appimage/AppRun
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+HERE="$(dirname "$(readlink -f "${0}")")"
+
+# Temporary workaround for broken libgc
+if [ -z "$_INKSCAPE_GC" ] ; then
+ echo "Setting _INKSCAPE_GC=disable as a workaround for broken libgc" >&2
+ export _INKSCAPE_GC=disable
+fi
+
+# Custom AppRun script for Inkscape
+# by Simon Peter
+
+############################################################################################
+# Allow AppRun or the AppImage to be symlinked to, e.g.,
+# /usr/local/bin/inkview
+# or to be called with ./Inkscape*.AppImage inkview
+############################################################################################
+
+if [ ! -z $APPIMAGE ] ; then
+ BINARY_NAME=$(basename "$ARGV0")
+else
+ BINARY_NAME=$(basename "$0")
+fi
+if [ ! -z "$1" ] && [ -e "$HERE/bin/$1" ] ; then
+ MAIN="$HERE/bin/$1" ; shift
+elif [ ! -z "$1" ] && [ -e "$HERE/usr/bin/$1" ] ; then
+ MAIN="$HERE/usr/bin/$1" ; shift
+elif [ -e "$HERE/bin/$BINARY_NAME" ] ; then
+ MAIN="$HERE/bin/$BINARY_NAME"
+elif [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
+ MAIN="$HERE/usr/bin/$BINARY_NAME"
+else
+ MAIN="$HERE/usr/bin/inkscape"
+fi
+
+############################################################################################
+# Prefer to run the bundled executables (e.g., Python)
+############################################################################################
+
+export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
+
+############################################################################################
+# Use bundled Python
+############################################################################################
+
+export PYTHONHOME="$HERE/usr/"
+
+############################################################################################
+# Run experimental bundle that bundles everything if a private ld-linux-x86-64.so.2 is there
+############################################################################################
+
+if [ -e "$HERE/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" ] ; then
+ echo "Run experimental bundle that bundles everything"
+ export GCONV_PATH="$HERE/usr/lib/x86_64-linux-gnu/gconv"
+ export FONTCONFIG_FILE="$HERE/etc/fonts/fonts.conf"
+ export LIBRARY_PATH="$HERE/usr/lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib/i386-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/pulseaudio":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/alsa-lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib/x86_64-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu/pulseaudio":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu/alsa-lib":$LIBRARY_PATH
+ export GTK_EXE_PREFIX="$HERE/usr"
+ export GDK_PIXBUF_MODULEDIR=$(readlink -f "$HERE"/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/ )
+ export GDK_PIXBUF_MODULE_FILE=$(readlink -f "$HERE"/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache ) # Patched to contain no paths
+ export LIBRARY_PATH=$GDK_PIXBUF_MODULEDIR:$LIBRARY_PATH # Otherwise getting "Unable to load image-loading module"
+ export INKSCAPE_DATADIR=${XDG_CONFIG_HOME:-~/.config}/inkscape-1.0
+ exec "${HERE}/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" --inhibit-cache --library-path "${LIBRARY_PATH}" "${MAIN}" "$@"
+else
+ exec "${MAIN}" "$@"
+fi