diff options
author | Florian Bruhin <me@the-compiler.org> | 2022-05-19 12:07:27 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2022-06-22 17:41:12 +0200 |
commit | c2d9fe0d73a167b7bb3bd11948610fea73d348b5 (patch) | |
tree | 42219ec3e99006da8bcf12307ad96313865b9dc6 | |
parent | 7efed1021c6dd76aca9a8918a22ab3627c3ab9eb (diff) | |
download | qutebrowser-c2d9fe0d73a167b7bb3bd11948610fea73d348b5.tar.gz qutebrowser-c2d9fe0d73a167b7bb3bd11948610fea73d348b5.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 f7ce81226..a0280605d 100644 --- a/misc/qutebrowser.spec +++ b/misc/qutebrowser.spec @@ -77,7 +77,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 b7fe7e03e..6d0c1ee14 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -324,7 +324,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") @@ -393,6 +393,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]: @@ -406,7 +407,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) @@ -458,12 +462,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 |