annotate deploy/osx/sign.sh @ 2265:d33dff02b39b sandbox-notarize

Work on sandboxing (possibly) and using the hardened runtime for notarization. Supply appropriate bundle ID for helpers as well as main application, and request inherited sandbox entitlements. Currently works with sandboxing (apparently) but not yet with the hardened runtime, where we can't load plugins signed by third parties even with the com.apple.security.cs.disable-library-validation entitlement because their team IDs don't match the host. Possibly that exception is supposed to be requested some other way?
author Chris Cannam
date Thu, 25 Apr 2019 16:46:02 +0100
parents 4f4eb416fcb4
children
rev   line source
Chris@2265 1 #!/bin/bash -x
Chris@514 2
cannam@1286 3 set -eu
cannam@1286 4
Chris@514 5 # Execute this from the top-level directory of the project (the one
Chris@514 6 # that contains the .app bundle). Supply the name of the .app bundle
Chris@514 7 # as argument
Chris@514 8 dir="$1"
Chris@514 9 if [ -z "$dir" ] || [ ! -d "$dir" ]; then
Chris@514 10 echo "Usage: $0 <pkgdir>"
Chris@514 11 echo "Where pkgdir is the directory containing <MyApplication>.app"
Chris@514 12 echo "All .app bundles in pkgdir will be signed"
Chris@514 13 exit 2
Chris@514 14 fi
Chris@2068 15
Chris@2068 16 # NB at some point we are going to have to include "--options runtime"
Chris@2068 17 # in all of these codesign invocations, and figure out what to do
Chris@2068 18 # about signing plugins...
Chris@2068 19
Chris@2265 20 id="Developer ID Application: Chris Cannam"
Chris@2265 21 opts="-fv --deep --options runtime -i org.sonicvisualiser.SonicVisualiser"
Chris@2265 22 eopts="--entitlements deploy/osx/Entitlements.plist"
Chris@2265 23 hopts="--entitlements deploy/osx/Entitlements-helpers.plist"
Chris@2265 24
Chris@514 25 for app in "$dir"/*.app; do
Chris@2068 26 find "$app" -name \*.dylib -print | while read fr; do
Chris@2265 27 codesign -s "$id" $opts "$fr"
Chris@2068 28 done
Chris@2265 29 codesign -s "$id" $opts $hopts "$app/Contents/Resources/vamp-plugin-load-checker"
Chris@2265 30 codesign -s "$id" $opts $hopts "$app/Contents/Resources/piper-vamp-simple-server"
Chris@2265 31 codesign -s "$id" $opts $eopts "$app/Contents/MacOS/Sonic Visualiser"
Chris@516 32 done
Chris@516 33