@@ -26,6 +26,8 @@ PKGID ?= Developer ID Installer: Perry Kundert ($(TEAMID))
2626BUNDLEID ?= ca.kundert.perry.SLIP39
2727APIISSUER ?= 5f3b4519-83ae-4e01-8d31-f7db26f68290
2828APIKEY ?= 5H98J7LKPC
29+ APICREDENTIALS ?= ~/.private_keys/AuthKey_$(APIKEY ) .p8
30+
2931# PROVISION ?= ~/Documents/Apple/Certificates/SLIP39_Mac_App_Store_Provisioning.provisionprofile
3032PROVISION ?= ~/Documents/Apple/Certificates/SLIP39_Mac_General_Provisioning.provisionprofile
3133
@@ -38,12 +40,12 @@ CXFREEZE_EXT ?= win-$(CXFREEZE_ARCH)-$(CXFREEZE_VER)
3840SIGNTOOL ?= "c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe"
3941
4042
41- # PY[3] is the target Python interpreter; require 3.9 +. Detect if it is named python3 or python.
43+ # PY[3] is the target Python interpreter; require 3.11 +. Detect if it is named python3 or python.
4244PY3 ?= $(shell python3 --version >/dev/null 2>&1 && echo python3 || echo python )
4345VERSION = $(shell $(PY3 ) -c 'exec(open("slip39/version.py") .read()); print( __version__ )')
4446PLATFORM ?= $(shell $(PY3 ) -c "import sys; print( sys.platform ) " )
4547ifeq ($(PLATFORM ) ,darwin)
46- INSTALLER := dmg
48+ INSTALLER := pkg
4749else ifeq ($(PLATFORM),win32)
4850 INSTALLER := msi
4951else
@@ -210,7 +212,7 @@ $(VENV_LOCAL)/$(VENV_NAME):
210212 @rm -rf $@ && $(PY3 ) -m venv $(VENV_OPTS ) $@ \
211213 && cd $@ && git clone $(GHUB_REPO ) -b $(GHUB_BRCH ) \
212214 && . ./bin/activate \
213- && make -C $(GHUB_NAME ) install-dev install
215+ && make -C $(GHUB_NAME ) install-tests install
214216
215217# Activate a given VirtualEnv, and go to its python-slip39 installation
216218# o Creates a custom venv-activate.sh script in the venv, and uses it start
@@ -237,8 +239,8 @@ dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE
237239install : dist/slip39-$(VERSION ) -py3-none-any.whl FORCE
238240 $(PY3 ) -m pip install --force-reinstall $< [all]
239241
240- install-dev :
241- $(PY3 ) -m pip install --upgrade -r requirements-dev .txt
242+ install-tests :
243+ $(PY3 ) -m pip install --upgrade -r requirements-tests .txt
242244
243245# Building / Signing / Notarizing and Uploading the macOS or win32 App
244246# o TODO: no signed and notarized package yet accepted for upload by macOS App Store
@@ -303,7 +305,7 @@ dist/slip39-$(VERSION)-win64.msi: build/exe.$(CXFREEZE_EXT)/SLIP-39.exe # signin
303305#
304306dist/SLIP-39-$(VERSION ) .dmg : dist/SLIP-39.app
305307 @echo -e " \n\n*** Creating and signing DMG $@ ..."
306- npx create-dmg -- overwrite $<
308+ npx create-dmg -v -- overwrite --identity " $( PKGID ) " $< dist/
307309 mv " SLIP-39 $( VERSION) .dmg" " $@ "
308310 @echo " Checking signature..." ; ./SLIP-39.metadata/check-signature $@
309311
@@ -428,27 +430,34 @@ dist/SLIP-39-$(VERSION).pkg-verify: dist/SLIP-39-$(VERSION).pkg
428430#
429431# macOS Package Notarization
430432# See: https://oozou.com/blog/scripting-notarization-for-macos-app-distribution-38
433+ # https://developer.apple.com/documentation/technotes/tn3147-migrating-to-the-latest-notarization-tool
431434# o The .pkg version doesn't work due to incorrect signing keys for the .pkg (unknown reason)
435+ #
436+ # Submits the version's .pkg for notariation, and waits for completion (success or failure).
437+ # - The output contains the Submission ID, required to obtain the JSON notary log
432438dist/SLIP-39-$(VERSION ) .pkg.notarization : dist/SLIP-39-$(VERSION ) .pkg dist/SLIP-39-$(VERSION ) .pkg-verify
433- jq -r ' .["notarization-upload"]["RequestUUID"]' $@ 2> /dev/null \
434- || xcrun altool --notarize-app -f $< \
435- --primary-bundle-id $(BUNDLEID ) \
436- --team-id $(TEAMID ) \
437- --apiKey $(APIKEY ) --apiIssuer $(APIISSUER ) \
438- --output-format json \
439+ grep " Submission ID" $@ 2> /dev/null \
440+ || xcrun notarytool submit \
441+ --issuer $(APIISSUER ) \
442+ --key-id $(APIKEY ) \
443+ --key $(APICREDENTIALS ) \
444+ --wait \
445+ $< \
439446 > $@
440447
441448dist/SLIP-39-$(VERSION ) .pkg.notarization-status : dist/SLIP-39-$(VERSION ) .pkg.notarization FORCE
442449 [ -s $@ ] && grep " Status: success" $@ \
443- || xcrun altool \
444- --apiKey $(APIKEY ) --apiIssuer $(APIISSUER ) \
445- --notarization-info $$( jq -r '.["notarization-upload"]["RequestUUID"]' $< ) \
446- | tee -a $@
450+ || xcrun notarytool log \
451+ --issuer $(APIISSUER ) \
452+ --key-id $(APIKEY ) \
453+ --key $(APICREDENTIALS ) \
454+ $$( grep -A1 "Submission ID" < $< | grep "id:" | awk '{print $$2}' ) \
455+ > $@
447456
448457# Check notarization status 'til Status: success, then staple it to ...pkg, and create ...pkg.valid marker file
449458dist/SLIP-39-$(VERSION ) .pkg.valid : dist/SLIP-39-$(VERSION ) .pkg.notarization-status FORCE
450- @grep " Status: success " $< || \
451- ( tail -10 $< ; echo -e " \n\n!!! App not yet notarized; try again in a few seconds ..." ; false )
459+ @grep " Ready for distribution " $< || \
460+ ( tail -10 $< ; echo -e " \n\n!!! App not yet notarized..." ; false )
452461 ( [ -r $@ ] ) \
453462 && ( echo -e " \n\n*** Notarization complete; refreshing $@ " && touch $@ ) \
454463 || ( \
0 commit comments