From 3663e9d5d14afe63f48c4b773d5feb8b45c35b11 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 2 Jun 2020 16:35:36 +0100 Subject: [PATCH] os/mac/keg_relocate: handle libexec/lib. We can fix up libraries in `lib` not `libexec/lib` so add an extra check for that case. Inspired by https://github.com/Homebrew/homebrew-core/pull/53790#issuecomment-637622329 --- Library/Homebrew/extend/os/mac/keg_relocate.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 170b828a7c..d9a88c6584 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -106,10 +106,12 @@ class Keg bad_name.sub(PREFIX_PLACEHOLDER, HOMEBREW_PREFIX) 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? + elsif (file.dylib? || file.mach_o_bundle?) && (file.dirname/bad_name).exist? "@loader_path/#{bad_name}" - elsif file.mach_o_executable? && (lib + bad_name).exist? + elsif file.mach_o_executable? && (lib/bad_name).exist? "#{lib}/#{bad_name}" + elsif file.mach_o_executable? && (libexec/"lib"/bad_name).exist? + "#{libexec}/lib/#{bad_name}" elsif bad_name.start_with?("@rpath") && ENV["HOMEBREW_RELOCATE_METAVARS"] expand_rpath file, bad_name elsif (abs_name = find_dylib(bad_name)) && abs_name.exist?