diff --git a/Library/Homebrew/os/mac/keg.rb b/Library/Homebrew/os/mac/keg.rb index ef4395bb66..ead4ad6d71 100644 --- a/Library/Homebrew/os/mac/keg.rb +++ b/Library/Homebrew/os/mac/keg.rb @@ -7,7 +7,7 @@ class Keg @require_relocation = true odebug "Changing dylib ID of #{file}\n from #{file.dylib_id}\n to #{id}" - MachO::Tools.change_dylib_id(file, id, strict: false) + file.change_dylib_id(id, strict: false) apply_ad_hoc_signature(file) rescue MachO::MachOError onoe <<~EOS @@ -23,7 +23,7 @@ class Keg @require_relocation = true odebug "Changing install name in #{file}\n from #{old}\n to #{new}" - MachO::Tools.change_install_name(file, old, new, strict: false) + file.change_install_name(old, new, strict: false) apply_ad_hoc_signature(file) rescue MachO::MachOError onoe <<~EOS @@ -39,7 +39,7 @@ class Keg @require_relocation = true odebug "Changing rpath in #{file}\n from #{old}\n to #{new}" - MachO::Tools.change_rpath(file, old, new, strict: false) + file.change_rpath(old, new, strict: false) apply_ad_hoc_signature(file) rescue MachO::MachOError onoe <<~EOS diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index bd636ffba9..abadcf8fd6 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -64,6 +64,21 @@ module MachOShim macho.write! end + def change_rpath(old, new, **options) + macho.change_rpath(old, new, options) + macho.write! + end + + def change_dylib_id(id, **options) + macho.change_dylib_id(id, options) + macho.write! + end + + def change_install_name(old, new, **options) + macho.change_install_name(old, new, options) + macho.write! + end + def dynamically_linked_libraries(except: :none) lcs = macho.dylib_load_commands.reject { |lc| lc.type == except }