Skip to content

Commit bb347eb

Browse files
committed
Begin work toward better macOS .pkg
1 parent 676e342 commit bb347eb

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

GNUmakefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,14 @@ dist/SLIP-39.app-checkids: SLIP-39.spec
599599
# - Find each dependent key, and look at its SHA fingerprint, and then see if you have
600600
# that one in your System keychain, downloading all the named keys from apple 'til
601601
# you find the one with the matching fingerprint. Grr... Repeat 'til check-signature works.
602+
# * To be accepted by the Mac App Store, your App must be signed, and have an entitlements.plist
603+
# containing:
604+
# <key>com.apple.security.app-sandbox</key> <true/>
605+
# - This causes PyInstaller created apps to crash, because they can't execute the Python interpreter
606+
# recursively (?) https://github.com/pyinstaller/pyinstaller/issues/2198
607+
# - Here is an up-to-date diary of the woes encountered: https://github.com/pyinstaller/pyinstaller/issues/7123
608+
# - A summary of the solutions is here: https://github.com/nyavramov/python_app_mac_app_store
609+
#
602610
dist/SLIP-39.app: SLIP-39-macOS.spec \
603611
SLIP-39.metadata/entitlements.plist \
604612
images/SLIP-39.icns
@@ -650,7 +658,6 @@ SLIP-39-macOS.spec: SLIP-39.py
650658
pyinstaller --noconfirm --windowed --onefile \
651659
--codesign-identity "$(DEVID)" \
652660
--osx-bundle-identifier "$(BUNDLEID)" \
653-
--osx-entitlements-file ./SLIP-39.metadata/entitlements.plist \
654661
--collect-data shamir_mnemonic \
655662
--hidden-import slip39 \
656663
--collect-data slip39 \

SLIP-39-macOS.spec

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ datas = []
55
datas += collect_data_files('shamir_mnemonic')
66
datas += collect_data_files('slip39')
77

8+
block_cipher = None
89

910
a = Analysis(
1011
['SLIP-39.py'],
@@ -16,9 +17,17 @@ a = Analysis(
1617
hooksconfig={},
1718
runtime_hooks=[],
1819
excludes=[],
20+
win_no_prefer_redirects=False,
21+
win_private_assemblies=False,
22+
cipher=block_cipher,
1923
noarchive=False,
2024
)
21-
pyz = PYZ(a.pure)
25+
26+
pyz = PYZ(
27+
a.pure,
28+
a.zipped_data,
29+
cipher=block_cipher,
30+
)
2231

2332
exe = EXE(
2433
pyz,
@@ -38,19 +47,28 @@ exe = EXE(
3847
argv_emulation=False,
3948
target_arch=None,
4049
codesign_identity='DDB5489E29389E9081E0A2FD83B6555D1B101829',
41-
entitlements_file='./SLIP-39.metadata/entitlements.plist',
50+
entitlements_file=None,
51+
icon='images/SLIP-39.icns',
4252
)
53+
4354
app = BUNDLE(
4455
exe,
4556
name='SLIP-39.app',
4657
icon='images/SLIP-39.icns',
4758
version='11.1.1',
4859
info_plist={
60+
'NSPrincipalClass': 'NSApplication',
61+
'NSAppleScriptEnabled': False,
62+
'LSBackgroundOnly': False,
63+
'NSRequiresAquaSystemAppearance': 'No',
64+
'CFBundleSupportedPlatforms': ['MacOSX'],
65+
'CFBundleIdentifier': 'ca.kundert.perry.SLIP39',
4966
'CFBundleVersion':'11.1.1',
5067
'CFBundlePackageType':'APPL',
5168
'LSApplicationCategoryType':'public.app-category.utilities',
52-
'LSMinimumSystemVersion':'10.15.0',
69+
'LSMinimumSystemVersion':'10.15',
5370
'NSHumanReadableCopyright':"Copyright © 2023 Perry Kundert.",
71+
'ITSAppUsesNonExemptEncryption': False,
5472
},
5573
bundle_identifier='ca.kundert.perry.SLIP39',
5674
)

SLIP-39.metadata/entitlements.plist

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<!--
6-
<key>com.apple.security.app-sandbox</key> <true/>
7-
-->
85
<key>com.apple.security.files.user-selected.read-write</key> <true/>
96
<!-- These are required for binaries built by PyInstaller -->
7+
<key>com.apple.security.app-sandbox</key> <true/>
108
<key>com.apple.security.cs.allow-jit</key> <true/>
119
<key>com.apple.security.cs.allow-unsigned-executable-memory</key> <true/>
1210
<key>com.apple.security.cs.disable-library-validation</key> <true/>

0 commit comments

Comments
 (0)