Add shell wrapper for Maxima on MacOSX

The command line utility of Maxima is inside the Maxima.app bundle and isn't named "maxima"
This commit is contained in:
Stephan Witt 2016-10-20 06:35:13 +02:00
parent 21a7386315
commit b37d6c9e94
2 changed files with 14 additions and 1 deletions

View File

@ -8,7 +8,7 @@ bundledir = ${prefix}/Contents
dist_bundle_DATA = PkgInfo dist_bundle_DATA = PkgInfo
nodist_bundle_DATA = Info.plist nodist_bundle_DATA = Info.plist
dist_bin_SCRIPTS = lyxeditor dist_bin_SCRIPTS = lyxeditor maxima
dist_pkgdata_DATA = COPYING LyXapp.icns LyX.icns LyX.sdef dmg-background.png dist_pkgdata_DATA = COPYING LyXapp.icns LyX.icns LyX.sdef dmg-background.png
nodist_pkgdata_DATA = lyxrc.dist nodist_pkgdata_DATA = lyxrc.dist

13
development/MacOSX/maxima Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# at first try the well known location
DIR="/Applications/Maxima.app/Contents/Resources"
test -f "${DIR}"/maxima.sh -a -x "${DIR}"/maxima.sh && exec "${DIR}"/maxima.sh "$@"
# this failed... so try PATH expansion to start the maxima shell wrapper
IFS=":" read -ra DIRLIST <<< "${PATH}"
for DIR in "${DIRLIST[@]}" ; do
test -f "${DIR}"/maxima.sh -a -x "${DIR}"/maxima.sh && exec "${DIR}"/maxima.sh "$@"
done
# report error and exit with failure status
exec 1>&2
echo Maxima shell wrapper not found.
exit 1