diff --git a/misc/qutebrowser.spec b/misc/qutebrowser.spec index e12e9a9b0..d8e1dbd25 100644 --- a/misc/qutebrowser.spec +++ b/misc/qutebrowser.spec @@ -82,7 +82,9 @@ def get_data_files(): def get_hidden_imports(): - imports = ['PyQt5.QtOpenGL', 'PyQt5._QOpenGLFunctions_2_0'] + # FIXME:qt6 double check if those are needed + ver = "6" if "PYINSTALLER_QT6" in os.environ else "5" + imports = [f'PyQt{ver}.QtOpenGL', f'PyQt{ver}._QOpenGLFunctions_2_0'] for info in loader.walk_components(): imports.append(info.name) return imports diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index eb8a24249..3cf074086 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -330,7 +330,7 @@ def build_mac( gh_token=gh_token) utils.print_title("Building .app via pyinstaller") - call_tox('pyinstaller-64', '-r', debug=debug) + call_tox(f'pyinstaller-64{"-qt6" if qt6 else ""}', '-r', debug=debug) utils.print_title("Patching .app") patch_mac_app(qt6=qt6) utils.print_title("Re-signing .app") @@ -399,6 +399,7 @@ def _get_windows_python_path(x64: bool) -> pathlib.Path: def _build_windows_single( *, x64: bool, + qt6: bool, skip_packaging: bool, debug: bool, ) -> List[Artifact]: @@ -412,7 +413,10 @@ def _build_windows_single( _maybe_remove(out_path) python = _get_windows_python_path(x64=x64) - call_tox(f'pyinstaller-{"64" if x64 else "32"}', '-r', python=python, debug=debug) + suffix = "64" if x64 else "32" + if qt6: + suffix += "-qt6" + call_tox(f'pyinstaller-{suffix}', '-r', python=python, debug=debug) out_pyinstaller = dist_path / "qutebrowser" shutil.move(out_pyinstaller, out_path) @@ -464,12 +468,14 @@ def build_windows( x64=True, skip_packaging=skip_packaging, debug=debug, + qt6=qt6, ) if not only_64bit and not qt6: artifacts += _build_windows_single( x64=False, skip_packaging=skip_packaging, debug=debug, + qt6=qt6, ) return artifacts diff --git a/tox.ini b/tox.ini index fb66a7308..2f9b198e5 100644 --- a/tox.ini +++ b/tox.ini @@ -156,13 +156,16 @@ commands = {envpython} scripts/dev/check_doc_changes.py {posargs} {envpython} scripts/asciidoc2html.py {posargs} -[testenv:pyinstaller-{64,32}] +[testenv:pyinstaller-{64,32}{,-qt6}] basepython = {env:PYTHON:python3} passenv = APPDATA HOME PYINSTALLER_DEBUG +setenv = + qt6: PYINSTALLER_QT6=true deps = -r{toxinidir}/requirements.txt -r{toxinidir}/misc/requirements/requirements-pyinstaller.txt - -r{toxinidir}/misc/requirements/requirements-pyqt.txt + !qt6: -r{toxinidir}/misc/requirements/requirements-pyqt.txt + qt6: -r{toxinidir}/misc/requirements/requirements-pyqt-6.txt commands = {envbindir}/pyinstaller --noconfirm misc/qutebrowser.spec