-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proprietary codec support with alternative macOS/Linux PyQt packages #4127
Comments
Additionally, I wonder if we could use pyqt-bundle to build a Linux wheel which contains a Qt build from e.g. Debian sid packages. That'd allow for proprietary codec support but still be installable easily on older Ubuntu/Debian versions. Unlikely to actually work though, as probably some other libraries (ICU?) had an incompatible upgrade in the meantime... |
Is there a licensing problem with just shipping bundled Qt with the codecs? That seems to be the most straightforward option. |
Qt itself doesn't ship them - and as far as I can tell, yes, there's probably a reason why they are called proprietary. |
Here's what I have currently working on this. diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py
index c175c68a7..1a7d7114c 100755
--- a/scripts/dev/build_release.py
+++ b/scripts/dev/build_release.py
@@ -328,10 +328,10 @@ def build_mac(
utils.print_title("Building .app via pyinstaller")
call_tox('pyinstaller-64', '-r', debug=debug)
- utils.print_title("Patching .app")
- patch_mac_app()
- utils.print_title("Re-signing .app")
- sign_mac_app()
+ #utils.print_title("Patching .app")
+ #patch_mac_app()
+ #utils.print_title("Re-signing .app")
+ #sign_mac_app()
dist_path = pathlib.Path("dist")
diff --git a/tox.ini b/tox.ini
index 8d33750f3..5baf104a0 100644
--- a/tox.ini
+++ b/tox.ini
@@ -158,8 +158,8 @@ passenv = APPDATA HOME PYINSTALLER_DEBUG
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
- -r{toxinidir}/misc/requirements/requirements-pyqt.txt
commands =
+ {envpython} {toxinidir}/scripts/link_pyqt.py --tox {envdir}
{envbindir}/pyinstaller --noconfirm misc/qutebrowser.spec
[testenv:eslint]
@@ -231,3 +231,16 @@ deps =
-r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
commands =
{envpython} {toxinidir}/scripts/dev/build_release.py {posargs}
+
+[testenv:build-release-pyqtlink]
+basepython = {env:PYTHON:python3}
+passenv = *
+usedevelop = true
+deps =
+ -r{toxinidir}/requirements.txt
+ -r{toxinidir}/misc/requirements/requirements-tox.txt
+ -r{toxinidir}/misc/requirements/requirements-dev.txt
+ -r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
+commands =
+ {envpython} {toxinidir}/scripts/link_pyqt.py --tox {envdir}
+ {envpython} {toxinidir}/scripts/dev/build_release.py {posargs} It builds (with qutebrowser/qutebrowser/misc/elf.py Line 317 in 47ef2ca
|
macOS crash log:
|
I got something working! 🎉 Here's the diff: diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py
index c175c68a7..23efe2348 100755
--- a/scripts/dev/build_release.py
+++ b/scripts/dev/build_release.py
@@ -278,6 +278,20 @@ def patch_mac_app() -> None:
link_path.symlink_to(target_path)
+def the_patch() -> None:
+ """HACK the symlinks"""
+ macos_path = pathlib.Path('dist/qutebrowser.app/Contents/MacOS')
+ for qt in macos_path.glob('Qt*'):
+ brew_path = pathlib.Path(f'/opt/homebrew/Cellar/qt@5/5.15.5_2/lib/{qt.name}.framework/{qt.name}')
+ qt.unlink()
+ qt.symlink_to(brew_path)
+ pyqt_path = macos_path / 'PyQt5'
+ for abi3so in pyqt_path.glob("*.abi3.so"):
+ brew_path = pathlib.Path('/opt/homebrew/Cellar/pyqt@5/5.15.7_1/lib/python3.10/site-packages/PyQt5')
+ abi3so.unlink()
+ abi3so.symlink_to(brew_path / abi3so.name)
+
+
def sign_mac_app() -> None:
"""Re-sign and verify the Mac .app."""
app_path = pathlib.Path('dist') / 'qutebrowser.app'
@@ -329,9 +343,10 @@ def build_mac(
utils.print_title("Building .app via pyinstaller")
call_tox('pyinstaller-64', '-r', debug=debug)
utils.print_title("Patching .app")
- patch_mac_app()
- utils.print_title("Re-signing .app")
- sign_mac_app()
+ the_patch()
+ #patch_mac_app()
+ #utils.print_title("Re-signing .app")
+ #sign_mac_app()
dist_path = pathlib.Path("dist")
diff --git a/tox.ini b/tox.ini
index 8d33750f3..5baf104a0 100644
--- a/tox.ini
+++ b/tox.ini
@@ -158,8 +158,8 @@ passenv = APPDATA HOME PYINSTALLER_DEBUG
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
- -r{toxinidir}/misc/requirements/requirements-pyqt.txt
commands =
+ {envpython} {toxinidir}/scripts/link_pyqt.py --tox {envdir}
{envbindir}/pyinstaller --noconfirm misc/qutebrowser.spec
[testenv:eslint]
@@ -231,3 +231,16 @@ deps =
-r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
commands =
{envpython} {toxinidir}/scripts/dev/build_release.py {posargs}
+
+[testenv:build-release-pyqtlink]
+basepython = {env:PYTHON:python3}
+passenv = *
+usedevelop = true
+deps =
+ -r{toxinidir}/requirements.txt
+ -r{toxinidir}/misc/requirements/requirements-tox.txt
+ -r{toxinidir}/misc/requirements/requirements-dev.txt
+ -r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
+commands =
+ {envpython} {toxinidir}/scripts/link_pyqt.py --tox {envdir}
+ {envpython} {toxinidir}/scripts/dev/build_release.py {posargs} It needs to be run as |
Update: Got codesigning to work. Here's the new diff: diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py
index c175c68a7..faaa771a2 100755
--- a/scripts/dev/build_release.py
+++ b/scripts/dev/build_release.py
@@ -278,6 +278,36 @@ def patch_mac_app() -> None:
link_path.symlink_to(target_path)
+def the_patch() -> None:
+ """HACK the symlinks"""
+ contents_path = pathlib.Path('dist/qutebrowser.app/Contents')
+ macos_path = contents_path / 'MacOS'
+ resources_path = contents_path / 'Resources'
+ pyqt_path = macos_path / 'PyQt5'
+
+ for path in macos_path.glob('Qt*'):
+ brew_path = pathlib.Path(f'/opt/homebrew/Cellar/qt@5/5.15.5_2/lib/{path.name}.framework/{path.name}')
+ path.unlink()
+ path.symlink_to(brew_path)
+ for abi3so in pyqt_path.glob("*.abi3.so"):
+ brew_path = pathlib.Path('/opt/homebrew/Cellar/pyqt@5/5.15.7_1/lib/python3.10/site-packages/PyQt5')
+ abi3so.unlink()
+ abi3so.symlink_to(brew_path / abi3so.name)
+
+ # Move stuff around to make things signable on macOS
+ pyqt_path_dest = resources_path / pyqt_path.name
+ shutil.move(pyqt_path, pyqt_path_dest)
+ pyqt_path_target = pathlib.Path('..') / pyqt_path_dest.relative_to(contents_path)
+ pyqt_path.symlink_to(pyqt_path_target)
+
+ for path in macos_path.glob('Qt*'):
+ if path.name == 'QtWebEngineCore.prl':
+ continue
+ link_path = resources_path / path.name
+ target_path = pathlib.Path('..') / path.relative_to(contents_path)
+ link_path.symlink_to(target_path)
+
+
def sign_mac_app() -> None:
"""Re-sign and verify the Mac .app."""
app_path = pathlib.Path('dist') / 'qutebrowser.app'
@@ -293,7 +323,7 @@ def sign_mac_app() -> None:
subprocess.run([
'codesign',
'--verify',
- '--strict',
+ #'--strict', See manpage, don't error on symlinks
'--deep',
'--verbose',
app_path,
@@ -329,7 +359,8 @@ def build_mac(
utils.print_title("Building .app via pyinstaller")
call_tox('pyinstaller-64', '-r', debug=debug)
utils.print_title("Patching .app")
- patch_mac_app()
+ the_patch()
+ #patch_mac_app()
utils.print_title("Re-signing .app")
sign_mac_app()
diff --git a/tox.ini b/tox.ini
index 8d33750f3..5baf104a0 100644
--- a/tox.ini
+++ b/tox.ini
@@ -158,8 +158,8 @@ passenv = APPDATA HOME PYINSTALLER_DEBUG
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
- -r{toxinidir}/misc/requirements/requirements-pyqt.txt
commands =
+ {envpython} {toxinidir}/scripts/link_pyqt.py --tox {envdir}
{envbindir}/pyinstaller --noconfirm misc/qutebrowser.spec
[testenv:eslint]
@@ -231,3 +231,16 @@ deps =
-r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
commands =
{envpython} {toxinidir}/scripts/dev/build_release.py {posargs}
+
+[testenv:build-release-pyqtlink]
+basepython = {env:PYTHON:python3}
+passenv = *
+usedevelop = true
+deps =
+ -r{toxinidir}/requirements.txt
+ -r{toxinidir}/misc/requirements/requirements-tox.txt
+ -r{toxinidir}/misc/requirements/requirements-dev.txt
+ -r{toxinidir}/misc/requirements/requirements-pyinstaller.txt
+commands =
+ {envpython} {toxinidir}/scripts/link_pyqt.py --tox {envdir}
+ {envpython} {toxinidir}/scripts/dev/build_release.py {posargs} This actually shows how broken this is currently, since it doesn't find This can be ran with |
build_release.py
should have the possibility to use Homebrew's (or possibly another system-wide) PyQt instead of the one from PyPI.At least when the stars align properly during a release*, this would allow to release builds with proprietary codec supports for macOS.
* meaning Homebrew does have everything in the proper versions
The text was updated successfully, but these errors were encountered: