From b37d6c9e941068bbf29281ca854687c7717e0d4d Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Thu, 20 Oct 2016 06:35:13 +0200 Subject: [PATCH] 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 deletion(-) create mode 100755 development/MacOSX/maxima diff --git a/development/MacOSX/Makefile.am b/development/MacOSX/Makefile.am index 579c9287bf..b9cdfa6575 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 0000000000..a36f8f85f9 --- /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