1010TEAMID ?= ZD8TVTCXDS
1111# The unique App ID assigned by App Store Connect, under App Information (NOT your Apple ID!!)
1212APPID ?= 1608360813
13- # DEVID ?= 3rd Party Mac Developer Application: Perry Kundert ($(TEAMID))
1413# DEVID ?= Developer ID Application: Perry Kundert ($(TEAMID))
15- DEVID ?= DDB5489E29389E9081E0A2FD83B6555D1B101829
14+ # DEVID ?= DDB5489E29389E9081E0A2FD83B6555D1B101829
15+ # DEVID ?= 3rd Party Mac Developer Application: Perry Kundert ($(TEAMID))
16+ # DEVID ?= A5DE932A0649AE3B6F06A8134F3E19D2E19A8196
17+ # Developer ID Application (not for Mac App Store)
18+ DEVID ?= EAA134BE299C43D27E33E2B8645FF4CF55DE8A92
19+
1620# PKGID ?= 3rd Party Mac Developer Installer: Perry Kundert ($(TEAMID))
21+ # PKGID ?= 1B482CEB543825C33C366A5665B935D3CEC9FD05
22+
1723PKGID ?= Developer ID Installer: Perry Kundert ($(TEAMID ) )
18- DSTID ?= Apple Distribution: Perry Kundert ($(TEAMID ) )
24+
25+
1926BUNDLEID ?= ca.kundert.perry.SLIP39
2027APIISSUER ?= 5f3b4519-83ae-4e01-8d31-f7db26f68290
2128APIKEY ?= 5H98J7LKPC
29+ # PROVISION ?= ~/Documents/Apple/Certificates/SLIP39_Mac_App_Store_Provisioning.provisionprofile
30+ PROVISION ?= ~/Documents/Apple/Certificates/SLIP39_Mac_General_Provisioning.provisionprofile
2231
2332# Various cx_Freeze targets are at paths with computed extensions, eg: build/exe.win-amd64-3.10/
2433CXFREEZE_VER ?= 3.10
@@ -385,12 +394,15 @@ dist/SLIP-39-$(VERSION).dmg.upload-app: dist/SLIP-39-$(VERSION).dmg dist/SLIP-39
385394# Must copy the app w/ ditto, into a target dir structure including the destination location, eg. /Applications/SLIP-39.app/...
386395#
387396dist/SLIP-39-$(VERSION ) .pkg : dist/SLIP-39.app
388- rm -rf /tmp/SLIP-39
389- ditto $< /tmp/SLIP-39/Applications/SLIP-39.app
390- productbuild --sign " $( PKGID) " --timestamp \
397+ # rm -rf /tmp/SLIP-39-pkg
398+ # ditto $< /tmp/SLIP-39-pkg/SLIP-39.app
399+ productbuild \
400+ --sign " $( PKGID) " \
401+ --timestamp \
391402 --identifier " $( BUNDLEID) .pkg" \
392403 --version $(VERSION ) \
393- --root /tmp/SLIP-39/Applications/ / $@
404+ --root " $<" " /Applications/SLIP-39.app/" \
405+ $@
394406
395407
396408# Confirm that the .pkg is signed w/ the correct certificates.
@@ -599,32 +611,46 @@ dist/SLIP-39.app-checkids: SLIP-39.spec
599611# - Find each dependent key, and look at its SHA fingerprint, and then see if you have
600612# that one in your System keychain, downloading all the named keys from apple 'til
601613# you find the one with the matching fingerprint. Grr... Repeat 'til check-signature works.
614+ # * To be accepted by the Mac App Store, your App must be signed, and have an entitlements.plist
615+ # containing:
616+ # <key>com.apple.security.app-sandbox</key> <true/>
617+ # - This causes PyInstaller created apps to crash, because they can't execute the Python interpreter
618+ # recursively (?) https://github.com/pyinstaller/pyinstaller/issues/2198
619+ # - Here is an up-to-date diary of the woes encountered: https://github.com/pyinstaller/pyinstaller/issues/7123
620+ # - A summary of the solutions is here: https://github.com/nyavramov/python_app_mac_app_store
621+ #
602622dist/SLIP-39.app : SLIP-39-macOS.spec \
603623 SLIP-39.metadata/entitlements.plist \
604- images/SLIP-39.icns
624+ images/SLIP-39.icns \
625+ $(PROVISION )
605626 @echo -e " \n\n*** Rebuilding $@ , version $( VERSION) ..."
606627 rm -rf build $@ *
607628 sed -I " " -E " s/version=.*/version='$( VERSION) ',/" $<
608629 sed -I " " -E " s/'CFBundleVersion':.*/'CFBundleVersion':'$( VERSION) ',/" $<
609630 sed -I " " -E " s/codesign_identity=.*/codesign_identity='$( DEVID) ',/" $<
610631 pyinstaller --noconfirm $<
632+ # echo "Copying Provisioning Profile..."; rsync -va $(PROVISION) $@/Contents/embedded.provisionprofile
611633 echo " Checking signature (pyinstaller signed)..." ; ./SLIP-39.metadata/check-signature $@ || true
612- codesign --verify $@
634+ codesign --verify --verbose $@
613635 # codesign --deep --force \
614636 # --all-architectures --options=runtime --timestamp \
615637 # --sign "$(DEVID)" \
616638 # $@
617639 # echo "Checking signature (app code signed)..."; ./SLIP-39.metadata/check-signature $@ || true
618640 # codesign --verify $@
619- codesign --deep --force \
620- --all-architectures --options=runtime --timestamp \
641+ codesign --deep --force --timestamp --verbose --options runtime \
642+ --all-architectures \
621643 --entitlements ./SLIP-39.metadata/entitlements.plist \
622644 --sign " $( DEVID) " \
623645 $@
624646 echo " Checking signature (app code + entitlements signed w/ $( DEVID) )..." ; ./SLIP-39.metadata/check-signature $@ || true
625- codesign --verify $@
647+ codesign --verify --verbose $@
626648 touch $@ # try to avoid unnecessary rebuilding
627649
650+ app-assess : dist/SLIP-39.app
651+ spctl --assess --type execute --context context:primary-signature -vvv $<
652+
653+
628654#
629655# Only used for initial creation of SLIP-39.spec; it must be customized, so this target cannot be
630656# used to achieve a complete, operational SLIP-39.spec file!
@@ -650,7 +676,6 @@ SLIP-39-macOS.spec: SLIP-39.py
650676 pyinstaller --noconfirm --windowed --onefile \
651677 --codesign-identity " $( DEVID) " \
652678 --osx-bundle-identifier " $( BUNDLEID) " \
653- --osx-entitlements-file ./SLIP-39.metadata/entitlements.plist \
654679 --collect-data shamir_mnemonic \
655680 --hidden-import slip39 \
656681 --collect-data slip39 \
0 commit comments