From 783c721cefa32d56b440605f776678634a013a28 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 29 Mar 2020 15:34:01 +0200 Subject: [PATCH] makewheel: strip codesign signature on macOS from libpython3.x.dylib This is necessary because install_name_tool invalidates the signature, which causes the whole app to fail validation and refuse to open. --- makepanda/makewheel.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/makepanda/makewheel.py b/makepanda/makewheel.py index e69f8a3db8..0aa37e2b8e 100644 --- a/makepanda/makewheel.py +++ b/makepanda/makewheel.py @@ -407,6 +407,7 @@ class WheelFile(object): deps_path = '@executable_path/../Frameworks' else: deps_path = '@loader_path' + remove_signature = False loader_path = [os.path.dirname(source_path)] for dep in deps: if dep.endswith('/Python'): @@ -439,6 +440,11 @@ class WheelFile(object): continue subprocess.call(["install_name_tool", "-change", dep, new_dep, temp.name]) + remove_signature = True + + # Remove the codesign signature if we modified the library. + if remove_signature: + subprocess.call(["codesign", "--remove-signature", temp.name]) else: # On other unixes, we just add dependencies normally. for dep in deps: