-
Notifications
You must be signed in to change notification settings - Fork 2
/
umatracker-win.spec
125 lines (110 loc) · 3.7 KB
/
umatracker-win.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
import os
from distutils.sysconfig import get_python_lib
import platform
DEBUG_FLAG = False
if os.getenv('UMA_DEBUG') == 'true':
DEBUG_FLAG = True
datas = [('./data', 'data'), ('./lib/html', 'lib/html'), ('./qt/win/qt.conf', '.')]
a = Analysis(['./main.py'],
pathex=['./'],
binaries=None,
datas=datas,
hiddenimports=[],
hookspath=['./hooks',],
runtime_hooks=None,
excludes=None,
win_no_prefer_redirects=None,
win_private_assemblies=None,
cipher=None)
# Additional DLLs
tmp = []
arch = platform.architecture()[0]
if arch=='32bit':
dll_path = os.path.join('dll', 'x86')
else:
dll_path = os.path.join('dll', 'x64')
for dir_path, dir_names, file_names in os.walk(dll_path):
for file_name in file_names:
tmp.append(
(
file_name,
os.path.join(os.getcwd(), dir_path, file_name),
'BINARY'
)
)
# For conda
conda_dll_path = os.path.join(os.environ.get('CONDA_PREFIX'), 'Library', 'bin')
for dir_path, dir_names, file_names in os.walk(conda_dll_path):
for file_name in file_names:
if os.path.splitext(file_name)[1]=='.dll':
tmp.append(
(
file_name,
os.path.join(dir_path, file_name),
'BINARY'
)
)
# TODO: Check if needed
# For Numpy MKL
# blacklist = ['mkl_rt.dll', 'tbb.dll', 'libmmd.dll', 'libifcoremd.dll']
# a.binaries = list(filter(lambda t:t[0] not in blacklist, a.binaries))
# numpy_dll_path = os.path.join(get_python_lib(), 'numpy', 'core')
# for dir_path, dir_names, file_names in os.walk(numpy_dll_path):
# for file_name in file_names:
# if os.path.splitext(file_name)[1]=='.dll':
# tmp.append(
# (
# file_name,
# os.path.join(dir_path, file_name),
# 'BINARY'
# )
# )
# TODO: Check if needed
# For Numpy OpenBLAS
# numpy_dll_path = os.path.join(get_python_lib(), 'numpy', '.libs')
# for dir_path, dir_names, file_names in os.walk(numpy_dll_path):
# for file_name in file_names:
# if os.path.splitext(file_name)[1]=='.dll':
# tmp.append(
# (
# file_name,
# os.path.join(dir_path, file_name),
# 'BINARY'
# )
# )
# For Scipy
scipy_dll_path = os.path.join(get_python_lib(), 'scipy', 'extra-dll')
for dir_path, dir_names, file_names in os.walk(scipy_dll_path):
for file_name in file_names:
if os.path.splitext(file_name)[1]=='.dll':
tmp.append(
(
file_name,
os.path.join(dir_path, file_name),
'BINARY'
)
)
a.binaries += tmp
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
# Override QtWebEngineProcess.exe
for i, binary in enumerate(a.binaries):
if r'QtWebEngineProcess.exe' in binary[1]:
a.binaries[i] = (r'QtWebEngineProcess.exe', binary[1], 'BINARY')
exe = EXE(pyz,
a.scripts,
name='UMATracker-Area51',
debug=DEBUG_FLAG,
strip=None,
upx=True,
exclude_binaries=True,
console=DEBUG_FLAG, icon='./icon/icon.ico')
coll = COLLECT(exe,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='UMATracker-Area51',
debug=DEBUG_FLAG,
strip=None,
upx=True,
console=DEBUG_FLAG, icon='./icon/icon.ico')