From 431eb90c90721d84d1ae79bf9b5ed8e8a3d7d69e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Feb 2025 19:26:23 +0100 Subject: [PATCH 1/2] fixup_bundle.apple: remove code signatures from edited binaries --- cmake/scripts/fixup_bundle.apple.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/scripts/fixup_bundle.apple.py b/cmake/scripts/fixup_bundle.apple.py index df354ba6f..734c3e528 100755 --- a/cmake/scripts/fixup_bundle.apple.py +++ b/cmake/scripts/fixup_bundle.apple.py @@ -746,6 +746,7 @@ def _fix_installed_binaries(installed, dry_run=False): # Go through all of the binaries installed and fix up references to other things. for binary_info in installed.values(): binary, installed_path = binary_info + print('Fixing binary references in %s' % binary.path) if not dry_run and binary.installed_id: @@ -772,6 +773,15 @@ def _fix_installed_binaries(installed, dry_run=False): ]) install_name_tool() + print('Removing signatures from %s' % binary.path) + if not dry_run: + codesign = Pipeline([ + 'codesign', + '--remove-signature', + installed_path, + ]) + codesign() + def _update_manifest(manifest, installed, path): '''Update the manifest file with a set of newly installed binaries.''' -- GitLab From cbcef1341a0b38fa9506b71873ab450d29fcad4a Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Feb 2025 19:26:37 +0100 Subject: [PATCH 2/2] fixup_bundle.apple: skip over `_CodeSignature` directories --- cmake/scripts/fixup_bundle.apple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/scripts/fixup_bundle.apple.py b/cmake/scripts/fixup_bundle.apple.py index 734c3e528..909756eb9 100755 --- a/cmake/scripts/fixup_bundle.apple.py +++ b/cmake/scripts/fixup_bundle.apple.py @@ -581,7 +581,7 @@ def copy_library(destination, library, dry_run=False, library_dest='Libraries', if os.path.exists(destination): shutil.rmtree(destination) _os_makedirs(app_dest) - shutil.copytree(os.path.join(library.framework_path, library.framework_name), destination, symlinks=True) + shutil.copytree(os.path.join(library.framework_path, library.framework_name), destination, ignore=shutil.ignore_patterns('_CodeSignature'), symlinks=True) # We need to make sure the copied libraries are writable. chmod = Pipeline([ -- GitLab