1
0

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:
ghost43
2018-12-09 05:09:28 +01:00
committed by GitHub
parent 6c20340338
commit f59a4f85db
2 changed files with 27 additions and 0 deletions

View File

@@ -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,