changeset 567:dd344309667f

Some work on macOS deployment - trying to get this one working with sandboxing. File saving is currently not working (temporary file write failing perhaps?)
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 19 Feb 2019 17:46:01 +0000
parents dfd28360f600
children 21c4b4c4963b
files .hgignore deploy/osx/Entitlements.plist deploy/osx/deploy.sh deploy/osx/sign.sh src/main.cpp version.h
diffstat 6 files changed, 26 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Mon Feb 18 20:26:36 2019 +0000
+++ b/.hgignore	Tue Feb 19 17:46:01 2019 +0000
@@ -44,3 +44,9 @@
 *.AppDir
 Dockerfile*.gen
 squashfs-root
+*.app
+Makefile.*
+.qmake.stash
+*.dylib
+test-svcore-*
+*.dmg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/osx/Entitlements.plist	Tue Feb 19 17:46:01 2019 +0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<plist version="1.0">
+    <dict>
+        <key>com.apple.security.app-sandbox</key>
+        <true/>
+        <key>com.apple.security.files.user-selected.read-write</key>
+        <true/>
+        <key>com.apple.security.device.audio-input</key>
+        <true/>
+    </dict>
+</plist>
--- a/deploy/osx/deploy.sh	Mon Feb 18 20:26:36 2019 +0000
+++ b/deploy/osx/deploy.sh	Tue Feb 19 17:46:01 2019 +0000
@@ -28,21 +28,8 @@
     *) echo "Error: Version stem $stem (of version $version) is neither two- nor three-part number"; exit 1 ;;
 esac
 
-if file "$source/Contents/MacOS/$app" | grep -q script; then
-    echo
-    echo "Executable is already a script, leaving it alone."
-else
-    echo
-    echo "Moving aside executable, adding script."
-
-    mv "$source/Contents/MacOS/$app" "$source/Contents/MacOS/$app.bin" || exit 1
-    cp "deploy/osx/$app.sh" "$source/Contents/MacOS/$app" || exit 1
-    chmod +x "$source/Contents/MacOS/$app"
-fi
-
 echo
-echo "Copying in plugins from pyin/pyin.dylib and chp/chp.dylib."
-echo "(make sure they're present, up-to-date and compiled with optimisation!)"
+echo "Copying in plugins from libpyin.dylib and libchp.dylib."
 
 cp libpyin.dylib "$source/Contents/Resources/pyin.dylib"
 cp libchp.dylib "$source/Contents/Resources/chp.dylib"
@@ -83,7 +70,6 @@
 
 ln -s /Applications "$volume"/Applications
 cp README.md "$volume/README.txt"
-cp README.OSC "$volume/README-OSC.txt"
 cp COPYING "$volume/COPYING.txt"
 cp CHANGELOG "$volume/CHANGELOG.txt"
 cp CITATION "$volume/CITATION.txt"
--- a/deploy/osx/sign.sh	Mon Feb 18 20:26:36 2019 +0000
+++ b/deploy/osx/sign.sh	Tue Feb 19 17:46:01 2019 +0000
@@ -13,11 +13,13 @@
 	exit 2
 fi
 
+entitlements=deploy/osx/Entitlements.plist
+
 for app in "$dir"/*.app; do
     find "$app" -name \*.dylib -print | while read fr; do
 	codesign -s "Developer ID Application: Chris Cannam" -fv --deep --options runtime "$fr"
     done
-    codesign -s "Developer ID Application: Chris Cannam" -fv --deep --options runtime "$app/Contents/MacOS/Sonic Visualiser"
-    codesign -s "Developer ID Application: Chris Cannam" -fv --deep --options runtime "$app"
+    codesign -s "Developer ID Application: Chris Cannam" -fv --deep --options runtime --entitlements "$entitlements" "$app/Contents/MacOS/Tony"
+    codesign -s "Developer ID Application: Chris Cannam" -fv --deep --options runtime --entitlements "$entitlements" "$app"
 done
 
--- a/src/main.cpp	Mon Feb 18 20:26:36 2019 +0000
+++ b/src/main.cpp	Tue Feb 19 17:46:01 2019 +0000
@@ -166,7 +166,9 @@
         QString defaultTonyPath(programFiles + "\\Tony");
         tonyVampPath = tonyVampPath + sep + defaultTonyPath;
 #else
-#ifndef Q_OS_MAC
+#ifdef Q_OS_MAC
+        tonyVampPath = tonyVampPath + "/../Resources:" + tonyVampPath;
+#else
         QString defaultTonyPath("/usr/local/lib/tony:/usr/lib/tony");
         tonyVampPath = tonyVampPath + sep + defaultTonyPath;
 #endif
--- a/version.h	Mon Feb 18 20:26:36 2019 +0000
+++ b/version.h	Tue Feb 19 17:46:01 2019 +0000
@@ -1,1 +1,1 @@
-#define TONY_VERSION "2.0"
+#define TONY_VERSION "2.1"