blob: 4c597fa99afe796d0a353eae7296bbb5c48f6874 [file] [log] [blame]
probonopd4b458302017-11-09 19:32:56 +01001#!/bin/bash
2
3# The purpose of this custom AppRun script is
4# to allow symlinking the AppImage and invoking
5# the corresponding binary depending on which
6# symlink was used to invoke the AppImage
7
8HERE="$(dirname "$(readlink -f "${0}")")"
9
Cristybc8825e2018-10-13 10:53:04 -040010export MAGICK_HOME="$HERE/usr:$MAGICK_HOME" # https://imagemagick.org/QuickStart.txt
Cristy733475d2020-07-04 17:13:54 -040011export MAGICK_CONFIGURE_PATH=$(readlink -f "$HERE/usr/lib/ImageMagick-7.0.9/config-Q16"):$(readlink -f "$HERE/usr/lib/ImageMagick-7.0.9/config-Q16HDRI"):$(readlink -f "$HERE/usr/share/ImageMagick-7"):$(readlink -f "$HERE/usr/etc/ImageMagick-7"):$MAGICK_CONFIGURE_PATH #Wildcards don't work
Kurt Pfeifle7bfea7e2018-04-01 23:30:41 +020012
13export LD_LIBRARY_PATH=$(readlink -f "$HERE/usr/lib"):$LD_LIBRARY_PATH
Cristy733475d2020-07-04 17:13:54 -040014export LD_LIBRARY_PATH=${HERE}/usr/lib/ImageMagick-7.0.9/modules-Q16HDRI/coders:$LD_LIBRARY_PATH
Kurt Pfeifle7bfea7e2018-04-01 23:30:41 +020015
probonopd4b458302017-11-09 19:32:56 +010016if [ "$1" == "man" ] ; then
probonopd50710d72017-11-09 21:14:19 +010017 export MANPATH="$HERE/usr/share/man:$MANPATH" ; exec "$@" ; exit $?
probonopd4b458302017-11-09 19:32:56 +010018elif [ "$1" == "info" ] ; then
probonopd50710d72017-11-09 21:14:19 +010019 export INFOPATH="$HERE/usr/share/info:$INFOPATH" ; exec "$@" ; exit $?
probonopd4b458302017-11-09 19:32:56 +010020fi
21
22if [ ! -z $APPIMAGE ] ; then
23 BINARY_NAME=$(basename "$ARGV0")
24 if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
25 exec "$HERE/usr/bin/$BINARY_NAME" "$@"
26 else
27 exec "$HERE/usr/bin/magick" "$@"
28 fi
29else
30 exec "$HERE/usr/bin/magick" "$@"
31fi