From 02216eedaf7fc359fb9e67753abafb569159b4c8 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Mon, 11 Mar 2019 20:58:04 -0400 Subject: [PATCH] mac/keg_relocate: Don't relocate loader_paths --- Library/Homebrew/extend/os/mac/keg_relocate.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 43a4717326..5139d2494a 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -95,14 +95,6 @@ class Keg bad_name end - def expand_loader_path(file, bad_name) - suffix = bad_name.sub(/^@loader_path/, "") - - # Note: Weak dylibs are allowed to not exist on disk, so - # we don't check for existence & complain here. - file.parent/suffix - end - # If file is a dylib or bundle itself, look for the dylib named by # bad_name relative to the lib directory, so that we can skip the more # expensive recursive search if possible. @@ -112,13 +104,11 @@ class Keg elsif bad_name.start_with? CELLAR_PLACEHOLDER bad_name.sub(CELLAR_PLACEHOLDER, HOMEBREW_CELLAR) elsif (file.dylib? || file.mach_o_bundle?) && (file.parent + bad_name).exist? - file.parent/bad_name + "@loader_path/#{bad_name}" elsif file.mach_o_executable? && (lib + bad_name).exist? "#{lib}/#{bad_name}" elsif bad_name.start_with?("@rpath") && ENV["HOMEBREW_RELOCATE_METAVARS"] expand_rpath file, bad_name - elsif bad_name.start_with?("@loader_path") && ENV["HOMEBREW_RELOCATE_METAVARS"] - expand_loader_path file, bad_name elsif (abs_name = find_dylib(bad_name)) && abs_name.exist? abs_name.to_s else @@ -129,7 +119,7 @@ class Keg def each_install_name_for(file, &block) dylibs = file.dynamically_linked_libraries - dylibs.reject! { |fn| fn =~ /^@executable_path/ } + dylibs.reject! { |fn| fn =~ /^@(loader|executable)_path/ } dylibs.each(&block) end