File: AppRun.in

package info (click to toggle)
imagemagick 8%3A7.1.1.43%2Bdfsg1-1%2Bdeb13u3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 96,160 kB
  • sloc: ansic: 370,601; cpp: 22,835; xml: 11,549; perl: 6,280; sh: 6,203; makefile: 3,484; tcl: 459
file content (31 lines) | stat: -rw-r--r-- 1,396 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

# The purpose of this custom AppRun script is
# to allow symlinking the AppImage and invoking
# the corresponding binary depending on which
# symlink was used to invoke the AppImage

HERE="$(dirname "$(readlink -f "${0}")")"

export MAGICK_HOME="$HERE/usr${MAGICK_HOME:+:$MAGICK_HOME}" # https://imagemagick.org/QuickStart.txt
export MAGICK_CONFIGURE_PATH=$(readlink -f "$HERE/usr/lib/ImageMagick-@PACKAGE_BASE_VERSION@/config-Q16"):$(readlink -f "$HERE/usr/lib/ImageMagick-@PACKAGE_BASE_VERSION@/config-Q16HDRI"):$(readlink -f "$HERE/usr/share/ImageMagick-7"):$(readlink -f "$HERE/usr/etc/ImageMagick-7")${MAGICK_CONFIGURE_PATH:+:$MAGICK_CONFIGURE_PATH} # Wildcards don't work

export LD_LIBRARY_PATH=$(readlink -f "$HERE/usr/lib")${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=${HERE}/usr/lib/ImageMagick-@PACKAGE_BASE_VERSION@/modules-Q16HDRI/coders${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

if [ "$1" == "man" ] ; then
  export MANPATH="$HERE/usr/share/man${MANPATH:+:$MANPATH}" ; exec "$@" ; exit $?
elif [ "$1" == "info" ] ; then
  export INFOPATH="$HERE/usr/share/info${INFOPATH:+:$INFOPATH}" ; exec "$@" ; exit $?
fi

if [ -n "$APPIMAGE" ] ; then
  BINARY_NAME=$(basename "$ARGV0")
  if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
    exec "$HERE/usr/bin/$BINARY_NAME" "$@"
  else
    exec "$HERE/usr/bin/magick" "$@"
  fi
else
  exec "$HERE/usr/bin/magick" "$@"
fi