forked from tlecomte/friture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfriture.spec
151 lines (133 loc) · 4.44 KB
/
friture.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
# -*- mode: python -*-
import os
import platform
from PyInstaller.utils.hooks import collect_data_files
block_cipher = None
# pyinstaller is conservative: it includes all Qt5 modules by default
# to reduce our frozen image size, we exclude unused modules
excludes = [
'PyQt5.QtDeclarative',
'PyQt5.QtHelp',
'PyQt5.QtMultimedia',
'PyQt5.QtNetwork',
'PyQt5.QtScript',
'PyQt5.QtScriptTools',
'PyQt5.QtSql',
'PyQt5.QtDesigner',
'PyQt5.QtTest',
'PyQt5.QtWebKit',
'PyQt5.QtXMLPatterns',
'PyQt5.QtCLucene',
'PyQt5.QtBluetooth',
'PyQt5.QtConcurrent',
'PyQt5.QtMultimediaWidgets',
'PyQt5.QtPositioning',
'PyQt5.QtQml',
'PyQt5.QtQuick',
'PyQt5.QtQuickWidgets',
'PyQt5.QtSensors',
'PyQt5.QtSerialPort',
'PyQt5.QtWebChannel',
'PyQt5.QtWebEngine',
'PyQt5.QtWebEngineCore',
'PyQt5.QtWebEngineWidgets',
'PyQt5.QtWebKitWidgets',
'PyQt5.QtWebSockets']
excluded_binaries = [
'Qt5DBus.dll',
'Qt5Location.dll',
'Qt5Network.dll',
'Qt5NetworkAuth.dll',
'Qt5Nfc.dll',
'Qt5Positioning.dll',
'Qt5PositioningQuick.dll',
'Qt5PrintSupport.dll',
'Qt5Qml.dll',
'Qt5Quick.dll',
'Qt5RemoteObjects.dll',
'Qt5WebSockets.dll',
'Qt5WinExtras.dll',
'Qt5Xml.dll',
'Qt5XmlPatterns.dll',
# macos
'QtDeclarative.framework',
'QtHelp.framework',
'QtMultimedia.framework',
'QtNetwork.framework',
'QtScript.framework',
'QtScriptTools.framework',
'QtSql.framework',
'QtDesigner.framework',
'QtTest.framework',
'QtWebKit.framework',
'QtXMLPatterns.framework',
'QtCLucene.framework',
'QtBluetooth.framework',
'QtConcurrent.framework',
'QtMultimediaWidgets.framework',
'QtPositioning.framework',
'QtQml.framework',
'QtQuick.framework',
'QtQuickWidgets.framework',
'QtSensors.framework',
'QtSerialPort.framework',
'QtWebChannel.framework',
'QtWebEngine.framework',
'QtWebEngineCore.framework',
'QtWebEngineWidgets.framework',
'QtWebKitWidgets.framework',
'QtWebSockets.framework']
# the manual bundling of libportaudio can be removed once the following PyInstaller MR is released:
# https://github.com/pyinstaller/pyinstaller/pull/4498
# (pyinstaller>3.5)
if platform.system() == "Windows" or platform.system() == "Darwin":
sounddevice_data = collect_data_files("sounddevice", subdir="_sounddevice_data")
libportaudio = [(f[0], os.path.join("_sounddevice_data", "portaudio-binaries")) for f in sounddevice_data if "libportaudio" in f[0]]
print(libportaudio)
if len(libportaudio) != 1:
raise ValueError('libportaudio could not be found')
else:
libportaudio = []
if platform.system() == "Windows":
# workaround for PyInstaller that does not look where the new PyQt5 official wheels put the Qt dlls
from PyInstaller.compat import getsitepackages
pathex = [os.path.join(x, 'PyQt5', 'Qt', 'bin') for x in getsitepackages()]
# add vcruntime140.dll - PyInstaller excludes it by default because it thinks it comes from c:\Windows
binaries = [('vcruntime140.dll', 'C:\\Python36\\vcruntime140.dll', 'BINARY')]
else:
pathex = []
binaries = []
a = Analysis(['main.py'],
pathex=pathex,
binaries=None,
datas=libportaudio,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=excludes,
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
a.binaries = TOC([x for x in a.binaries if x[0] not in excluded_binaries])
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='friture',
debug=False,
strip=False,
upx=False,
console=False,
icon="resources/images/friture.ico")
coll = COLLECT(exe,
a.binaries + binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name='friture')
app = BUNDLE(coll,
name='friture.app',
icon='resources/images/friture.icns',
bundle_identifier=None)