2016-02-01 14:19:29 -05:00
|
|
|
require "vendor/macho/macho"
|
|
|
|
|
|
|
|
module RubyKeg
|
|
|
|
def change_dylib_id(id, file)
|
|
|
|
@require_install_name_tool = true
|
|
|
|
puts "Changing dylib ID of #{file}\n from #{file.dylib_id}\n to #{id}" if ARGV.debug?
|
2016-09-17 15:32:44 +01:00
|
|
|
MachO::Tools.change_dylib_id(file, id, strict: false)
|
2016-08-10 17:56:46 +02:00
|
|
|
rescue MachO::MachOError
|
|
|
|
onoe <<-EOS.undent
|
|
|
|
Failed changing dylib ID of #{file}
|
|
|
|
from #{file.dylib_id}
|
|
|
|
to #{id}
|
|
|
|
EOS
|
|
|
|
raise
|
2016-02-01 14:19:29 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def change_install_name(old, new, file)
|
|
|
|
@require_install_name_tool = true
|
|
|
|
puts "Changing install name in #{file}\n from #{old}\n to #{new}" if ARGV.debug?
|
2016-09-17 15:32:44 +01:00
|
|
|
MachO::Tools.change_install_name(file, old, new, strict: false)
|
2016-08-10 17:56:46 +02:00
|
|
|
rescue MachO::MachOError
|
|
|
|
onoe <<-EOS.undent
|
|
|
|
Failed changing install name in #{file}
|
|
|
|
from #{old}
|
|
|
|
to #{new}
|
|
|
|
EOS
|
|
|
|
raise
|
2016-02-01 14:19:29 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def require_install_name_tool?
|
|
|
|
!!@require_install_name_tool
|
|
|
|
end
|
|
|
|
end
|