From e3bd9b26073a27fded49117aea13dec25c771d99 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 4 Dec 2013 22:37:57 -0600 Subject: [PATCH] Let fix_install_names fix up placeholders too --- Library/Homebrew/keg_fix_install_names.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb index 716fcf8742..1c25c7efe0 100644 --- a/Library/Homebrew/keg_fix_install_names.rb +++ b/Library/Homebrew/keg_fix_install_names.rb @@ -104,15 +104,16 @@ class Keg # bad_name relative to the lib directory, so that we can skip the more # expensive recursive search if possible. def fixed_name(file, bad_name) - if (file.dylib? || file.mach_o_bundle?) && (file.parent + bad_name).exist? + if bad_name.start_with? PREFIX_PLACEHOLDER + bad_name.sub(PREFIX_PLACEHOLDER, HOMEBREW_PREFIX.to_s) + elsif bad_name.start_with? CELLAR_PLACEHOLDER + bad_name.sub(CELLAR_PLACEHOLDER, HOMEBREW_CELLAR.to_s) + elsif (file.dylib? || file.mach_o_bundle?) && (file.parent + bad_name).exist? "@loader_path/#{bad_name}" elsif file.mach_o_executable? && (lib + bad_name).exist? "#{lib}/#{bad_name}" elsif (abs_name = find_dylib(Pathname.new(bad_name).basename)) && abs_name.exist? abs_name.to_s - elsif bad_name.start_with? PREFIX_PLACEHOLDER, CELLAR_PLACEHOLDER - # Skip these, relocate_install_names will fix them - bad_name else opoo "Could not fix #{bad_name} in #{file}" bad_name