Skip to content

Commit

Permalink
Allow NOTARYTOOL path to be set
Browse files Browse the repository at this point in the history
Apple has decided that copying notarytool from new macOS
to old macOS instead of supporting altool.
But sadly "xcrun" will not run it as expected, so
we allow NOTARYTOOL env var to be set to a path to use.

Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed Dec 7, 2023
1 parent 4c607f0 commit 1576e0e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/pkg_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@ if [ -f "${BASE_DIR}/../config.status" ]; then
prefix=$(grep 'S\["prefix"\]' "${BASE_DIR}/../config.status" | tr '=' ' ' | awk '{print $2;}' | tr -d '"')
fi

xcrun notarytool > /dev/null 2>&1
if [ $? != 0 ]; then
use_altool=1
if [ -z "$NOTARYTOOL" ]; then
xcrun notarytool > /dev/null 2>&1
if [ $? != 0 ]; then
use_altool=1
else
NOTARYTOOL="$(xcrun -f notarytool)"
fi
fi

echo "Version is $version"
Expand All @@ -132,7 +136,7 @@ echo "OS name: $friendly"
if [ -n "$use_altool" ]; then
echo "notarize: altool"
else
echo "notarize: notarytool"
echo "notarize: notarytool ($NOTARYTOOL)"
fi
echo ""

Expand Down Expand Up @@ -396,7 +400,7 @@ function do_notarize_notarytool
TFILE="out-altool.xml"
RFILE="req-altool.xml"
# xcrun altool --notarize-app -f my_package_new.pkg --primary-bundle-id org.openzfsonosx.zfs -u lundman@lundman.net -p "$PKG_NOTARIZE_KEY" --output-format xml > ${TFILE}
xcrun notarytool submit --wait --apple-id lundman@lundman.net --team-id "735AM5QEU3" --password "$PKG_NOTARIZE_KEY" my_package_new.pkg
$NOTARYTOOL submit --wait --apple-id lundman@lundman.net --team-id "735AM5QEU3" --password "$PKG_NOTARIZE_KEY" my_package_new.pkg

echo "Stapling PKG ..."
xcrun stapler staple my_package_new.pkg
Expand Down

0 comments on commit 1576e0e

Please sign in to comment.