From f13d07248a747ef15661bbca4f9376f68f76f42a Mon Sep 17 00:00:00 2001 From: Nicolas ELIE Date: Tue, 6 Feb 2024 14:18:06 +0100 Subject: [PATCH] Attempt to fix custom auditwheel script --- scripts/custom-auditwheel.py | 62 ++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/scripts/custom-auditwheel.py b/scripts/custom-auditwheel.py index 2d157f6..bab2d53 100644 --- a/scripts/custom-auditwheel.py +++ b/scripts/custom-auditwheel.py @@ -1,32 +1,40 @@ #!/usr/bin/env python3 -import sys - +from pathlib import Path +import tempfile +import json from auditwheel.main import main -from auditwheel.policy import _POLICIES as POLICIES - - -for p in POLICIES: - p['lib_whitelist'].extend([ - 'libpyside6.abi3.so.6.6', - 'libpyside6.abi3.so.6.5', - 'libpyside6.abi3.so.6.4', - 'libpyside6.abi3.so.6.3', - 'libshiboken6.abi3.so.6.6', - 'libshiboken6.abi3.so.6.5', - 'libshiboken6.abi3.so.6.4', - 'libshiboken6.abi3.so.6.3', - 'libQt6Widgets.so.6', - 'libQt6Gui.so.6', - 'libpyside6qml.abi3.so.6.6', - 'libpyside6qml.abi3.so.6.5', - 'libpyside6qml.abi3.so.6.4', - 'libpyside6qml.abi3.so.6.3', - 'libGLX.so.0', - 'libOpenGL.so.0', - 'libQt6Core.so.6', - 'libxcb.so.1', - ]) +from auditwheel.policy import _POLICY_JSON_MAP as POLICY_JSON_MAP if __name__ == "__main__": - sys.exit(main()) + tmpdir = tempfile.TemporaryDirectory() + tmppath = pathlib.Path(tmpdir.name) + for libc in POLICY_JSON_MAP: + p = json.loads(POLICY_JSON_MAP[libc].read_text()) + p['lib_whitelist'].extend([ + 'libpyside6.abi3.so.6.6', + 'libpyside6.abi3.so.6.5', + 'libpyside6.abi3.so.6.4', + 'libpyside6.abi3.so.6.3', + 'libshiboken6.abi3.so.6.6', + 'libshiboken6.abi3.so.6.5', + 'libshiboken6.abi3.so.6.4', + 'libshiboken6.abi3.so.6.3', + 'libQt6Widgets.so.6', + 'libQt6Gui.so.6', + 'libpyside6qml.abi3.so.6.6', + 'libpyside6qml.abi3.so.6.5', + 'libpyside6qml.abi3.so.6.4', + 'libpyside6qml.abi3.so.6.3', + 'libGLX.so.0', + 'libOpenGL.so.0', + 'libQt6Core.so.6', + 'libxcb.so.1', + ]) + fname = tmppath / libc.name + "-policy.json" + with open(fname, "w") as f: + json.dump(p, f) + POLICY_JSON_MAP[libc] = fname + + main() + tmpdir.cleanup()