blob: bb05cdaec5f3ab12b7bf6976e852baa56d6c9f1c [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
Kurt Pfeifle2964aa92018-04-02 10:55:50 +020011export MAGICK_CONFIGURE_PATH=$(readlink -f "$HERE/usr/lib/ImageMagick-7.0.7/config-Q16"):$(readlink -f "$HERE/usr/lib/ImageMagick-7.0.7/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
14export LD_LIBRARY_PATH=${HERE}/usr/lib/ImageMagick-7.0.7/modules-Q16HDRI/coders:$LD_LIBRARY_PATH
15
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