Merge pull request #5894 from sjackman/macos-rpath
fix_dynamic_linkage: Check HOMEBREW_RELOCATE_METAVARS
This commit is contained in:
commit
15495f0bde
@ -72,7 +72,8 @@ class Keg
|
||||
|
||||
# If none of the install names reference RPATH(s), then we can safely
|
||||
# remove all RPATHs from the file.
|
||||
if file.dynamically_linked_libraries.none? { |lib| lib.start_with?("@rpath") }
|
||||
if ENV["HOMEBREW_RELOCATE_METAVARS"] &&
|
||||
file.dynamically_linked_libraries.none? { |lib| lib.start_with?("@rpath") }
|
||||
# Note: This could probably be made more efficient by reverse-sorting
|
||||
# the RPATHs by offset and calling MachOFile#delete_command
|
||||
# with repopulate: false.
|
||||
@ -120,6 +121,7 @@ class Keg
|
||||
def each_install_name_for(file, &block)
|
||||
dylibs = file.dynamically_linked_libraries
|
||||
dylibs.reject! { |fn| fn =~ /^@(loader|executable)_path/ }
|
||||
dylibs.reject! { |fn| fn =~ /^@rpath/ } unless ENV["HOMEBREW_RELOCATE_METAVARS"]
|
||||
dylibs.each(&block)
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user