Rev 22823 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
22823 | jghali | 1 | #!/bin/sh |
2 | |||
3 | HERE="$(dirname "$(readlink -f "${0}")")" |
||
4 | |||
5 | ############################################################################################ |
||
6 | # Allow AppRun or the AppImage to be symlinked to, e.g., |
||
7 | # /usr/local/bin/scribus |
||
8 | # or to be called with ./Scribus*.AppImage scribus |
||
9 | ############################################################################################ |
||
10 | |||
11 | if [ ! -z $APPIMAGE ] ; then |
||
12 | BINARY_NAME=$(basename "$ARGV0") |
||
13 | else |
||
14 | BINARY_NAME=$(basename "$0") |
||
15 | fi |
||
16 | if [ ! -z "$1" ] && [ -e "$HERE/bin/$1" ] ; then |
||
17 | MAIN="$HERE/bin/$1" ; shift |
||
18 | elif [ ! -z "$1" ] && [ -e "$HERE/usr/bin/$1" ] ; then |
||
19 | MAIN="$HERE/usr/bin/$1" ; shift |
||
20 | elif [ -e "$HERE/bin/$BINARY_NAME" ] ; then |
||
21 | MAIN="$HERE/bin/$BINARY_NAME" |
||
22 | elif [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then |
||
23 | MAIN="$HERE/usr/bin/$BINARY_NAME" |
||
24 | else |
||
25 | MAIN="$HERE/usr/bin/scribus" |
||
26 | fi |
||
27 | |||
28 | ############################################################################################ |
||
29 | # Use bundled paths |
||
30 | ############################################################################################ |
||
31 | |||
32 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" |
||
33 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" |
||
34 | |||
35 | ############################################################################################ |
||
36 | # Change into bundled usr/ directory |
||
37 | ############################################################################################ |
||
38 | |||
39 | cd "${HERE}"/usr # Because Scribus has some hardcoded paths that we patch away; FIXME |
||
40 | |||
41 | ############################################################################################ |
||
42 | # Use bundled Python |
||
43 | ############################################################################################ |
||
44 | |||
45 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}" |
||
46 | export PYTHONHOME="${HERE}"/usr/ |
||
47 | |||
48 | ############################################################################################ |
||
49 | # Use bundled Tcl/Tk |
||
50 | ############################################################################################ |
||
51 | |||
52 | export TCL_LIBRARY="${HERE}"/usr/share/tcltk/tcl8.6:$TCL_LIBRARY:$TK_LIBRARY |
||
53 | export TK_LIBRARY="${HERE}"/usr/share/tcltk/tk8.6:$TK_LIBRARY:$TCL_LIBRARY |
||
54 | |||
55 | ############################################################################################ |
||
56 | # Make it look more native on Gtk+ based systems |
||
57 | ############################################################################################ |
||
58 | |||
23028 | jghali | 59 | case "${XDG_CURRENT_DESKTOP}" in |
60 | *GNOME*|*gnome*) |
||
61 | export QT_QPA_PLATFORMTHEME=gtk2 |
||
62 | esac |
||
22823 | jghali | 63 | |
64 | ############################################################################################ |
||
65 | # Run experimental bundle that bundles everything if a private ld-linux-x86-64.so.2 is there |
||
66 | # This allows the bundle to run even on older systems than the one it was built on |
||
67 | ############################################################################################ |
||
68 | |||
69 | if [ -e "$HERE/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" ] ; then |
||
70 | echo "Run experimental bundle that bundles everything" |
||
71 | export GCONV_PATH="$HERE/usr/lib/x86_64-linux-gnu/gconv" |
||
72 | export FONTCONFIG_FILE="$HERE/etc/fonts/fonts.conf" |
||
73 | export LIBRARY_PATH="$HERE/usr/lib":$LIBRARY_PATH |
||
74 | export LIBRARY_PATH="$HERE/lib":$LIBRARY_PATH |
||
75 | export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu":$LIBRARY_PATH |
||
76 | export LIBRARY_PATH="$HERE/lib/i386-linux-gnu":$LIBRARY_PATH |
||
77 | export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/pulseaudio":$LIBRARY_PATH |
||
78 | export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/alsa-lib":$LIBRARY_PATH |
||
79 | export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu":$LIBRARY_PATH |
||
80 | export LIBRARY_PATH="$HERE/lib/x86_64-linux-gnu":$LIBRARY_PATH |
||
81 | export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu/pulseaudio":$LIBRARY_PATH |
||
82 | export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu/alsa-lib":$LIBRARY_PATH |
||
83 | export LIBRARY_PATH=$GDK_PIXBUF_MODULEDIR:$LIBRARY_PATH # Otherwise getting "Unable to load image-loading module" |
||
84 | exec "${HERE}/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" --inhibit-cache --library-path "${LIBRARY_PATH}" "${MAIN}" "$@" |
||
85 | else |
||
86 | exec "${MAIN}" "$@" |
||
87 | fi |