From a2064ed16bcbc73031d95de3eea4d4a1cc2a231a Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 3 Aug 2020 00:14:17 +0200 Subject: [PATCH] Always bundle libraries provided by homebrew Fixes #343 --- dist/macos/macdeploy.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dist/macos/macdeploy.py b/dist/macos/macdeploy.py index a3e3c09b4..1a2ee2976 100755 --- a/dist/macos/macdeploy.py +++ b/dist/macos/macdeploy.py @@ -267,14 +267,21 @@ def FixFramework(path): def FixLibrary(path): - if path in fixed_libraries or FindSystemLibrary(os.path.basename(path)) is not None: + + if path in fixed_libraries: return - else: - fixed_libraries.add(path) + + # Always bundle libraries provided by homebrew (/usr/local). + if not re.match(r'^\s*/usr/local', path) and FindSystemLibrary(os.path.basename(path)) is not None: + return + + fixed_libraries.add(path) + abs_path = FindLibrary(path) if abs_path == "": print "Could not resolve %s, not fixing!" % path return + broken_libs = GetBrokenLibraries(abs_path) FixAllLibraries(broken_libs) @@ -422,7 +429,7 @@ def FindSystemLibrary(library_name): def FixLibraryInstallPath(library_path, library): system_library = FindSystemLibrary(os.path.basename(library_path)) - if system_library is None: + if system_library is None or re.match(r'^\s*/usr/local', library_path): new_path = '@executable_path/../Frameworks/%s' % os.path.basename(library_path) FixInstallPath(library_path, library, new_path) else: