forked from den4uk/andriller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyinst.spec
95 lines (83 loc) · 2.15 KB
/
pyinst.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
# -*- mode: python -*-
import os
import sys
block_cipher = None
ONE_FILE = False if sys.platform == 'win32' else True
def get_binaries():
if sys.platform == 'darwin':
return [
('/Library/Frameworks/Python.framework/Versions/3.7/lib/libtk8.6.dylib', 'tk'),
('/Library/Frameworks/Python.framework/Versions/3.7/lib/libtcl8.6.dylib', 'tcl')]
return []
a = Analysis(
['andriller-gui.py'],
pathex=[os.path.abspath(os.getcwd())],
binaries=get_binaries(),
datas=[
('andriller/bin/*', 'bin'),
('andriller/res/*', 'res'),
('andriller/templates/*', 'templates'),
],
hiddenimports=[
# 'packaging',
# 'packaging.specifiers',
# 'packaging.requirements',
],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
def get_icon():
return {
'linux': 'icon3.xbm',
'linux2': 'icon3.xbm',
'win32': 'icon3.ico',
'darwin': 'icon3.icns',
}.get(sys.platform, 'icon3.ico')
if ONE_FILE:
# One file
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='andriller',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False,
icon=os.path.join('andriller', 'res', get_icon()),
)
if sys.platform == 'darwin':
app = BUNDLE(
exe,
name='Andriller.app',
icon='andriller/res/icon3.icns',
bundle_identifier=None)
else:
# Many files
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='andriller',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
icon=os.path.join('andriller', 'res', get_icon()),
)
coll = COLLECT(
exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=True, name='andriller'
)