blob: 16d940346887fec1432cb4beda45d5aea3762b86 [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
10export MAGICK_HOME="$HERE/usr" # http://www.imagemagick.org/QuickStart.txt
probonopde8e4b182017-11-12 17:42:57 +010011export MAGICK_CONFIGURE_PATH=$(readlink -f "$HERE/usr/lib/ImageMagick-*/config-*/") # Undocumented?
probonopd50710d72017-11-09 21:14:19 +010012
probonopd4b458302017-11-09 19:32:56 +010013if [ "$1" == "man" ] ; then
probonopd50710d72017-11-09 21:14:19 +010014 export MANPATH="$HERE/usr/share/man:$MANPATH" ; exec "$@" ; exit $?
probonopd4b458302017-11-09 19:32:56 +010015elif [ "$1" == "info" ] ; then
probonopd50710d72017-11-09 21:14:19 +010016 export INFOPATH="$HERE/usr/share/info:$INFOPATH" ; exec "$@" ; exit $?
probonopd4b458302017-11-09 19:32:56 +010017fi
18
19if [ ! -z $APPIMAGE ] ; then
20 BINARY_NAME=$(basename "$ARGV0")
21 if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
22 exec "$HERE/usr/bin/$BINARY_NAME" "$@"
23 else
24 exec "$HERE/usr/bin/magick" "$@"
25 fi
26else
27 exec "$HERE/usr/bin/magick" "$@"
28fi