aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCamillo Lugaresi2012-02-17 19:19:08 -0600
committerJack Nagel2012-02-21 19:39:37 -0600
commitcdb406fe2f25833202b74e3dad8467b67c7e8fe8 (patch)
treeaba396dc5bca524cbb702f97d0cc81cbe7483eba /Library
parentf8e8159eccefe87426ad1ba7824e947f51380023 (diff)
downloadhomebrew-cdb406fe2f25833202b74e3dad8467b67c7e8fe8.tar.bz2
Make fix_install_names more robust
fixes a problem with the opencv formula Closes #10291. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg_fix_install_names.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb
index d3117b6f3..e0b9259c4 100644
--- a/Library/Homebrew/keg_fix_install_names.rb
+++ b/Library/Homebrew/keg_fix_install_names.rb
@@ -5,8 +5,15 @@ class Keg
dylib.ensure_writable do
system "install_name_tool", "-id", id, dylib
bad_names.each do |bad_name|
- # we should be more careful here, check the path we point to exists etc.
- system "install_name_tool", "-change", bad_name, "@loader_path/#{bad_name}", dylib
+ new_name = bad_name
+ new_name = Pathname.new(bad_name).basename unless (dylib.parent + new_name).exist?
+ # this fixes some problems, maybe not all. opencv seems to have badnames of the type
+ # "lib/libblah.dylib"
+ if (dylib.parent + new_name).exist?
+ system "install_name_tool", "-change", bad_name, "@loader_path/#{new_name}", dylib
+ else
+ opoo "Could not fix install names for #{dylib}"
+ end
end
end
end