commit b37d6c9e941068bbf29281ca854687c7717e0d4d
Author: Stephan Witt <[email protected]>
Date:   Thu Oct 20 06:35:13 2016 +0200

    Add shell wrapper for Maxima on MacOSX
    The command line utility of Maxima is inside the Maxima.app bundle and 
isn't named "maxima"
---
 development/MacOSX/Makefile.am |    2 +-
 development/MacOSX/maxima      |   13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/development/MacOSX/Makefile.am b/development/MacOSX/Makefile.am
index 579c928..b9cdfa6 100644
--- a/development/MacOSX/Makefile.am
+++ b/development/MacOSX/Makefile.am
@@ -8,7 +8,7 @@ bundledir = ${prefix}/Contents
 dist_bundle_DATA = PkgInfo
 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
 nodist_pkgdata_DATA = lyxrc.dist
diff --git a/development/MacOSX/maxima b/development/MacOSX/maxima
new file mode 100755
index 0000000..a36f8f8
--- /dev/null
+++ b/development/MacOSX/maxima
@@ -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

Reply via email to