blob: cd5142be047febd2d844d5f9b455f52e9082343b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#!/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/usr/bin/$1" ] ; then
MAIN="$HERE/usr/bin/$1" ; shift
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:${PATH}"
############################################################################################
# Make sure commands launch Inkscape through this file to correctly set environment
############################################################################################
export INKSCAPE_COMMAND="${HERE}/AppRun"
############################################################################################
# Run experimental bundle that bundles everything if a private ld-linux-x86-64.so.2 is there
############################################################################################
PLATFORM=x86_64-linux-gnu
# Glib/Gtk environment
export GCONV_PATH="$HERE/usr/lib/$PLATFORM/gconv"
export FONTCONFIG_FILE="$HERE/etc/fonts/fonts.conf"
export GTK_EXE_PREFIX="$HERE/usr"
export GDK_PIXBUF_MODULEDIR=$(readlink -f "$HERE"/usr/lib/$PLATFORM/gdk-pixbuf-*/*/loaders/ )
export GDK_PIXBUF_MODULE_FILE=$(readlink -f "$HERE"/usr/lib/$PLATFORM/gdk-pixbuf-*/*/loaders.cache ) # Patched to contain no paths
export GI_TYPELIB_PATH="$HERE/usr/lib/$PLATFORM/girepository-1.0"
# For bundled themes
export XDG_DATA_DIRS="$HERE/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
# Shared library path
LIBRARY_PATH="$HERE/lib/$PLATFORM"
LIBRARY_PATH+=":$HERE/usr/lib/$PLATFORM"
LIBRARY_PATH+=":$HERE/usr/lib"
LIBRARY_PATH+=":$GDK_PIXBUF_MODULEDIR" # Otherwise getting "Unable to load image-loading module"
# Otherwise getting "Unable to load image-loading module" when opening extension manager
export LD_LIBRARY_PATH="$GDK_PIXBUF_MODULEDIR"
if [[ "$( dirname "$0"; )" == *"tmp/.mount_"* ]] ; then
echo "You should not use AppImage in production, but you can speedup the AppImage by following this guide: https://inkscape.org/learn/appimage/"
fi
exec "$HERE/lib/$PLATFORM/ld-linux-x86-64.so.2" --inhibit-cache --library-path "$LIBRARY_PATH" "$MAIN" "$@"
|