lyx_mirror/development/MacOSX/inkscape
Stephan Witt 350ef993e5 add inkscape wrapper script for Mac OS
The wrapper script is placed in the binary directory of the LyX bundle.
It tries to find the real inkscape command line converter in the
Inkscape.app bundle and starts it or reports an error.
The configure.py is changed for Mac OS to check the presence of
the real inkscape binary in the Inkscape.app bundle.
2017-09-24 11:55:20 +02:00

16 lines
636 B
Bash
Executable File

#!/bin/bash
unset DISPLAY
# at first try the well known location
RESDIR="/Applications/Inkscape.app/Contents/Resources"
test -f "${RESDIR}"/bin/inkscape -a -x "${RESDIR}"/bin/inkscape && exec "${RESDIR}"/bin/inkscape --without-gui "$@"
# this failed... so try PATH expansion to start the inkscape shell wrapper
IFS=":" read -ra DIRLIST <<< "${PATH}"
for BINDIR in "${DIRLIST[@]}" ; do
RESDIR=$(dirname "${BINDIR}")
test -f "${RESDIR}"/bin/inkscape -a -x "${RESDIR}"/bin/inkscape && exec "${RESDIR}"/bin/inkscape --without-gui "$@"
done
# report error and exit with failure status
exec 1>&2
echo Could not find Inkscape binary.
exit 1