Skip to content

Commit

Permalink
Make fix_install_names more robust
Browse files Browse the repository at this point in the history
fixes a problem with the opencv formula

Closes Homebrew#10291.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information
camillol authored and jacknagel committed Feb 22, 2012
1 parent e452ed4 commit 4d52a9e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Library/Homebrew/keg_fix_install_names.rb
Expand Up @@ -5,8 +5,15 @@ def fix_install_names
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
Expand Down

0 comments on commit 4d52a9e

Please sign in to comment.