win/mac build: strip parts of pyqt5 from binaries to reduce size (#4901)
When bumping pyinstaller to 3.4, binary sizes had increased drastically. The main reason seems to be that pyinstaller is pulling in "all" of qt. based on Electron-Cash/Electron-Cash@4b09969594
This commit is contained in:
@@ -81,6 +81,15 @@ for d in a.datas:
|
||||
a.datas.remove(d)
|
||||
break
|
||||
|
||||
# Strip out parts of Qt that we never use. Reduces binary size by tens of MBs. see #4815
|
||||
qt_bins2remove=('qtweb', 'qt3d', 'qtgame', 'qtdesigner', 'qtquick', 'qtlocation', 'qttest', 'qtxml')
|
||||
print("Removing Qt binaries:", *qt_bins2remove)
|
||||
for x in a.binaries.copy():
|
||||
for r in qt_bins2remove:
|
||||
if x[0].lower().startswith(r):
|
||||
a.binaries.remove(x)
|
||||
print('----> Removed x =', x)
|
||||
|
||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||
|
||||
exe = EXE(pyz,
|
||||
|
||||
Reference in New Issue
Block a user