Skip to content
Snippets Groups Projects
Commit e32e2475 authored by Camillo Lugaresi's avatar Camillo Lugaresi Committed by Jack Nagel
Browse files

Make fix_install_names more robust


fixes a problem with the opencv formula

Closes Homebrew/homebrew#10291.

Signed-off-by: default avatarJack Nagel <jacknagel@gmail.com>
parent 8cbaca5b
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment