[LyX/master] Add support for lilypond with LyX on Mac

Stephan Witt switt at lyx.org
Mon Aug 3 15:30:05 UTC 2020


commit 5e6dccfb132866d4a2afbaba536c5d32d90ceaf7
Author: Stephan Witt <switt at lyx.org>
Date:   Mon Aug 3 17:44:01 2020 +0200

    Add support for lilypond with LyX on Mac
---
 development/LyX-Mac-binary-release.sh |    2 ++
 development/MacOSX/Makefile.am        |    2 +-
 development/MacOSX/lilypond           |   28 ++++++++++++++++++++++++++++
 development/MacOSX/lilypond-book      |   28 ++++++++++++++++++++++++++++
 4 files changed, 59 insertions(+), 1 deletions(-)

diff --git a/development/LyX-Mac-binary-release.sh b/development/LyX-Mac-binary-release.sh
index 606440d..f918bca 100644
--- a/development/LyX-Mac-binary-release.sh
+++ b/development/LyX-Mac-binary-release.sh
@@ -900,6 +900,8 @@ code_sign() {
 		"${condir}"/PlugIns/*/lib*.dylib \
 		"${condir}"/Library/Spotlight/* \
 		"${target}"/inkscape \
+		"${target}"/lilypond \
+		"${target}"/lilypond-book \
 		"${target}"/maxima \
 		"${target}"/tex2lyx \
 		"${target}"/lyxeditor \
diff --git a/development/MacOSX/Makefile.am b/development/MacOSX/Makefile.am
index 9ca0c22..2dfb970 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 maxima inkscape
+dist_bin_SCRIPTS = lyxeditor maxima inkscape lilypond lilypond-book
 
 dist_pkgdata_DATA = COPYING LyXapp.icns LyX.icns LyX.sdef dmg-background.png
 nodist_pkgdata_DATA = lyxrc.dist
diff --git a/development/MacOSX/lilypond b/development/MacOSX/lilypond
new file mode 100755
index 0000000..0d3a40c
--- /dev/null
+++ b/development/MacOSX/lilypond
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# \file lilypond
+# wrapper start script for LilyPond.app on Mac
+#
+# This file is part of LyX, the document processor.
+# Licence details can be found in the file COPYING.
+#
+# \author Stephan Witt
+# Full author contact details are available in file CREDITS.
+
+unset DISPLAY
+
+LYXDIR=$(dirname "${0}")
+# try to find the lilypond installation...
+# at first try the well known location for LilyPond 2.x
+# in case this failes try PATH expansion to start the lilypond shell wrapper
+IFS=":" read -ra DIRLIST <<< "${PATH}"
+for BINDIR in "/Applications/LilyPond.app/Contents/Resources/bin" "${DIRLIST[@]}" ; do
+	BDIR=$(dirname "${BINDIR}/x")
+	if [ "${BDIR}" != "${LYXDIR}" -a -x "${BINDIR}"/lilypond ]; then
+		exec "${BINDIR}"/lilypond "$@"
+		exit 0
+	fi
+done
+# report error and exit with failure status
+echo Could not find lilypond binary.
+exit 1
diff --git a/development/MacOSX/lilypond-book b/development/MacOSX/lilypond-book
new file mode 100755
index 0000000..8c4b420
--- /dev/null
+++ b/development/MacOSX/lilypond-book
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# \file lilypond-book
+# wrapper start script for LilyPond.app on Mac
+#
+# This file is part of LyX, the document processor.
+# Licence details can be found in the file COPYING.
+#
+# \author Stephan Witt
+# Full author contact details are available in file CREDITS.
+
+unset DISPLAY
+
+LYXDIR=$(dirname "${0}")
+# try to find the lilypond-book installation...
+# at first try the well known location for LilyPond 2.x
+# in case this failes try PATH expansion to start the lilypond-book shell wrapper
+IFS=":" read -ra DIRLIST <<< "${PATH}"
+for BINDIR in "/Applications/LilyPond.app/Contents/Resources/bin" "${DIRLIST[@]}" ; do
+	BDIR=$(dirname "${BINDIR}/x")
+	if [ "${BDIR}" != "${LYXDIR}" -a -x "${BINDIR}"/lilypond-book ]; then
+		exec "${BINDIR}"/lilypond-book "$@"
+		exit 0
+	fi
+done
+# report error and exit with failure status
+echo Could not find LilyPond binary.
+exit 1


More information about the lyx-cvs mailing list