Changes for PyInstaller to build with qtpy and PyQt4

This commit is contained in:
Dmitri Bogomolov 2020-10-20 14:42:58 +03:00
parent f12022614c
commit 4ac97393c2
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
2 changed files with 20 additions and 6 deletions

View File

@ -32,9 +32,14 @@ a = Analysis(
'bitmessageqt.languagebox', 'pyopencl', 'numpy', 'win32com',
'setuptools.msvc', '_cffi_backend'
],
hookspath=None,
runtime_hooks=None,
excludes=['bsddb', 'bz2', 'tcl', 'tk', 'Tkinter']
hookspath=None, # this feature has undocumented syntax
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-PyQt4-API-Version
runtime_hooks=['pyinstaller_rthook_pyqt4.py'],
excludes=[
'bsddb', 'bz2',
'PyQt4.QtOpenGL', 'PyQt4.QtOpenGL', 'PyQt4.QtSql',
'PyQt4.QtSvg', 'PyQt4.QtTest', 'PyQt4.QtWebKit', 'PyQt4.QtXml',
'tcl', 'tk', 'Tkinter', 'win32ui']
)
os.rename(
@ -77,9 +82,8 @@ a.datas += addTranslations()
excluded_binaries = [
'QtOpenGL4.dll',
'QtSvg4.dll',
'QtXml4.dll',
'QtOpenGL4.dll', 'QtSql4.dll', 'QtSvg4.dll', 'QtTest4.dll',
'QtWebKit4.dll', 'QtXml4.dll'
]
a.binaries = TOC([x for x in a.binaries if x[0] not in excluded_binaries])

View File

@ -0,0 +1,10 @@
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-PyQt4-API-Version
import sip
sip.setapi(u'QDate', 2)
sip.setapi(u'QDateTime', 2)
sip.setapi(u'QString', 2)
sip.setapi(u'QTextStream', 2)
sip.setapi(u'QTime', 2)
sip.setapi(u'QUrl', 2)
sip.setapi(u'QVariant', 2)