Repository navigation
Expand file tree
/
Copy pathnative_host.spec
More file actions
120 lines (114 loc) · 3.14 KB
/
Copy pathnative_host.spec
File metadata and controls
120 lines (114 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# -*- mode: python ; coding: utf-8 -*-
#
# PyInstaller spec for the SoloKeys Secrets native messaging host.
#
# Produces a native messaging host called 'solokeys-secrets-host' (or .exe on
# Windows). Windows keeps the single-file binary. macOS uses onedir because the
# onefile bootloader extracts Python.framework at runtime, which Gatekeeper can
# block when Chrome launches the host.
#
# Build:
# pyinstaller native_host.spec
#
# The output lands in dist/solokeys-secrets-host[.exe] on Windows/Linux and
# dist/solokeys-secrets-host/solokeys-secrets-host on macOS.
import sys
a = Analysis(
['src/solo_gui/native_host.py'],
pathex=['src'], # so PyInstaller can resolve the solo_gui package
binaries=[],
datas=[],
hiddenimports=[
'hid',
# Our own modules (lazy-imported inside _handle_direct)
'solo2',
'solo2.admin',
'solo2.clients',
'solo2.device',
'solo2.discovery',
'solo2.errors',
'solo2.fido2',
'solo2.hid_backend',
'solo2.pcsc',
'solo2.provisioner',
'solo2.secrets',
'solo2.transport',
'solo_gui.device_transport',
'solo_gui.hid_backend',
'solo_gui.oath_bridge',
'smartcard',
'smartcard.System',
'smartcard.Exceptions',
'smartcard.CardConnection',
# fido2 core
'fido2',
'fido2.cbor',
'fido2.ctap2',
'fido2.ctap2.base',
'fido2.ctap2.pin',
# fido2 HID — platform backends are conditionally imported;
# list all so the binary works on each target OS.
'fido2.hid',
'fido2.hid.base',
'fido2.hid.linux',
'fido2.hid.macos',
'fido2.hid.windows',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Exclude heavy GUI dependencies; fido2 IS required for direct HID path.
'PySide6', 'pyusb', 'requests',
],
noarchive=False,
)
pyz = PYZ(a.pure)
if sys.platform == 'darwin':
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='solokeys-secrets-host',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=True, # must be console — Chrome reads stdout/stdin
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name='solokeys-secrets-host',
)
else:
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='solokeys-secrets-host',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=True, # must be console — Chrome reads stdout/stdin
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)