diff options
author | Florian Bruhin <me@the-compiler.org> | 2022-05-19 12:07:27 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2022-08-23 18:31:41 +0200 |
commit | c0ffd6d327968fe92f50d66375cca59c02deeb6a (patch) | |
tree | a83512f3e74f5d1677b1f5d2bf27df67b947b57f | |
parent | a5a824f2345c25a74b2425c9ea7ce249ae1e74c7 (diff) | |
download | qutebrowser-c0ffd6d327968fe92f50d66375cca59c02deeb6a.tar.gz qutebrowser-c0ffd6d327968fe92f50d66375cca59c02deeb6a.zip |
scripts: Pass through Qt 6 to PyInstaller
-rw-r--r-- | misc/qutebrowser.spec | 4 | ||||
-rwxr-xr-x | scripts/dev/build_release.py | 10 | ||||
-rw-r--r-- | tox.ini | 7 |
3 files changed, 16 insertions, 5 deletions
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 @@ -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 |