diff --git a/contrib/build-wine/deterministic.spec b/contrib/build-wine/deterministic.spec index dafda1c99..b208ee169 100644 --- a/contrib/build-wine/deterministic.spec +++ b/contrib/build-wine/deterministic.spec @@ -78,6 +78,24 @@ 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=('qt5web', 'qt53d', 'qt5game', 'qt5designer', 'qt5quick', + 'qt5location', 'qt5test', 'qt5xml', r'pyqt5\qt\qml\qtquick') +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) + +qt_data2remove=(r'pyqt5\qt\translations\qtwebengine_locales', ) +print("Removing Qt datas:", *qt_data2remove) +for x in a.datas.copy(): + for r in qt_data2remove: + if x[0].lower().startswith(r): + a.datas.remove(x) + print('----> Removed x =', x) + # hotfix for #3171 (pre-Win10 binaries) a.binaries = [x for x in a.binaries if not x[1].lower().startswith(r'c:\windows')] diff --git a/contrib/osx/osx.spec b/contrib/osx/osx.spec index ac9c07a0e..7b56d6f46 100644 --- a/contrib/osx/osx.spec +++ b/contrib/osx/osx.spec @@ -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,