forked from ZclassicCommunity/electrum-zclassic
-
Notifications
You must be signed in to change notification settings - Fork 1
/
deterministic.spec
160 lines (141 loc) · 4.57 KB
/
deterministic.spec
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# -*- mode: python -*-
import sys
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
for i, x in enumerate(sys.argv):
if x == '--name':
cmdline_name = sys.argv[i+1]
break
else:
raise Exception('no name')
hiddenimports = collect_submodules('trezorlib')
hiddenimports += collect_submodules('btchip')
hiddenimports += collect_submodules('keepkeylib')
hiddenimports += collect_submodules('websocket')
hiddenimports += [
'lib',
'lib.base_wizard',
'lib.plot',
'lib.qrscanner',
'lib.websockets',
'gui.qt',
'plugins',
'plugins.hw_wallet.qt',
'plugins.audio_modem.qt',
'plugins.cosigner_pool.qt',
'plugins.digitalbitbox.qt',
'plugins.email_requests.qt',
'plugins.keepkey.qt',
'plugins.labels.qt',
'plugins.trezor.qt',
'plugins.ledger.qt',
'plugins.virtualkeyboard.qt',
]
datas = [
('lib/servers.json', 'electrum_bitcoinprivate'),
('lib/servers_testnet.json', 'electrum_bitcoinprivate'),
('lib/servers_regtest.json', 'electrum_bitcoinprivate'),
('lib/currencies.json', 'electrum_bitcoinprivate'),
('lib/locale', 'electrum_bitcoinprivate/locale'),
('lib/wordlist', 'electrum_bitcoinprivate/wordlist'),
('C:\\zbarw', '.'),
]
datas += collect_data_files('trezorlib')
datas += collect_data_files('btchip')
datas += collect_data_files('keepkeylib')
binaries = [('C:/Python36/libusb-1.0.dll', '.')]
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-remove-tkinter-tcl
sys.modules['FixTk'] = None
excludes = ['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter']
excludes += [
'PyQt5.QtCLucene',
'PyQt5.Qt5CLucene',
'PyQt5.QtDesigner',
'PyQt5.QtDesignerComponents',
'PyQt5.QtHelp',
'PyQt5.QtLocation',
'PyQt5.QtMultimedia',
'PyQt5.QtMultimediaQuick_p',
'PyQt5.QtMultimediaWidgets',
'PyQt5.QtNetwork',
'PyQt5.QtOpenGL',
'PyQt5.QtPositioning',
'PyQt5.QtPrintSupport',
'PyQt5.QtQml',
'PyQt5.QtQuick',
'PyQt5.QtQuickParticles',
'PyQt5.QtQuickWidgets',
'PyQt5.QtSensors',
'PyQt5.QtSerialPort',
'PyQt5.QtSql',
'PyQt5.Qt5Sql',
'PyQt5.QtTest',
'PyQt5.QtWebChannel',
'PyQt5.QtWebKit',
'PyQt5.QtWebKitWidgets',
'PyQt5.QtWebSockets',
'PyQt5.QtXml',
'PyQt5.QtXmlPatterns',
'PyQt5.QtWebProcess',
'PyQt5.QtWinExtras',
]
a = Analysis(['electrum-bitcoinprivate'],
pathex=['plugins'],
hiddenimports=hiddenimports,
datas=datas,
binaries=binaries,
excludes=excludes,
runtime_hooks=['pyi_runtimehook.py'])
# http://stackoverflow.com/questions/19055089/
for d in a.datas:
if 'pyconfig' in d[0]:
a.datas.remove(d)
break
# Add TOC to electrum_bitcoinprivate, electrum_bitcoinprivate_gui, electrum_bitcoinprivate_plugins
for p in sorted(a.pure):
if p[0].startswith('lib') and p[2] == 'PYMODULE':
a.pure += [('electrum_bitcoinprivate%s' % p[0][3:] , p[1], p[2])]
if p[0].startswith('gui') and p[2] == 'PYMODULE':
a.pure += [('electrum_bitcoinprivate_gui%s' % p[0][3:] , p[1], p[2])]
if p[0].startswith('plugins') and p[2] == 'PYMODULE':
a.pure += [('electrum_bitcoinprivate_plugins%s' % p[0][7:] , p[1], p[2])]
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
debug=False,
strip=False,
upx=False,
console=False,
icon='icons/electrum-bitcoinprivate.ico',
name=os.path.join('build\\pyi.win32\\electrum', cmdline_name))
# exe with console output
conexe = EXE(pyz,
a.scripts,
exclude_binaries=True,
debug=False,
strip=False,
upx=False,
console=True,
icon='icons/electrum-bitcoinprivate.ico',
name=os.path.join('build\\pyi.win32\\electrum',
'console-%s' % cmdline_name))
# trezorctl separate executable
tctl_a = Analysis(['C:/Python36/Scripts/trezorctl'],
hiddenimports=['pkgutil'],
excludes=excludes,
runtime_hooks=['pyi_tctl_runtimehook.py'])
tctl_pyz = PYZ(tctl_a.pure)
tctl_exe = EXE(tctl_pyz,
tctl_a.scripts,
exclude_binaries=True,
debug=False,
strip=False,
upx=False,
console=True,
name=os.path.join('build\\pyi.win32\\electrum', 'trezorctl.exe'))
coll = COLLECT(exe, conexe, tctl_exe,
a.binaries,
a.datas,
strip=False,
upx=False,
name=os.path.join('dist', 'electrum-bitcoinprivate'))