From d39e7be4510767e47ce66bdaa1cb74bb686eedf1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 16 Oct 2021 16:39:36 +1000 Subject: [PATCH] fix qtwebengineprocess failing to load on darwin-aarch64 --- pip/pyqt6/install_pyqt6.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pip/pyqt6/install_pyqt6.py b/pip/pyqt6/install_pyqt6.py index 4b9761eb2..de7a841e4 100644 --- a/pip/pyqt6/install_pyqt6.py +++ b/pip/pyqt6/install_pyqt6.py @@ -72,6 +72,10 @@ def merge_files(root, source): else: shutil.copy2(source_path, target_path) +def fix_webengine_codesigning(base: str): + "Fix a codesigning issue in the 6.2.0 release." + path = os.path.join(base, "PyQt6/Qt6/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess") + subprocess.run(["codesign", "-s", "-", path], check=True) def main(): base = sys.argv[1] @@ -101,11 +105,13 @@ def main(): ("pyqt6-sip", "pyqt6_sip==13.1.0"), ] + arm_darwin = sys.platform.startswith("darwin") and platform.machine() == "arm64" + for (name, with_version) in packages: # install package in subfolder folder = os.path.join(base, "temp") pip_args = [] - if sys.platform.startswith("darwin") and platform.machine() == "arm64": + if arm_darwin: if name in ("pyqt6-qt6", "pyqt6-webengine-qt6"): # pyqt messed up the architecture tags pip_args.extend( @@ -121,6 +127,9 @@ def main(): with open(os.path.join(base, "__init__.py"), "w") as file: file.write("__path__ = __import__('pkgutil').extend_path(__path__, __name__)") + if arm_darwin: + fix_webengine_codesigning(base) + # add missing py.typed file with open(os.path.join(base, "py.typed"), "w") as file: pass