 afe0fde49c
			
		
	
	
		afe0fde49c
		
	
	
	
	
		
			
			- and branch for dylib_id_and_dylibs
- add branches for dylib id changing and change_install_name
- rename MachO module to HomebrewMachO to prevent namespace clashes
  with MachO in ruby-macho. this will eventually be replaced entirely
  with direct calls to ruby-macho methods
- break ruby-macho implementation out into separate RubyMachO module,
  and include either RubyMachO or CctoolsMachO (the original
  implementation) based on the HOMEBREW_RUBY_MACHO env var
- move ArchitectureListExtension and RubyMachO into separate files
- create {ruby_,cctools_,,}relocate.rb for isolation of different
  methods of mach-o relocation (ruby-macho vs. cctools)
- fill in require_install_name_tool? for ruby_relocate.rb
- rename {ruby_,cctools_,,}relocate.rb to keg, isolate requires in
  os/mac
Closes Homebrew/homebrew#45001.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
		
	
			
		
			
				
	
	
		
			22 lines
		
	
	
		
			635 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			635 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| module CctoolsKeg
 | |
|   def install_name_tool(*args)
 | |
|     @require_install_name_tool = true
 | |
|     tool = MacOS.install_name_tool
 | |
|     system(tool, *args) || raise(ErrorDuringExecution.new(tool, args))
 | |
|   end
 | |
| 
 | |
|   def require_install_name_tool?
 | |
|     !!@require_install_name_tool
 | |
|   end
 | |
| 
 | |
|   def change_dylib_id(id, file)
 | |
|     puts "Changing dylib ID of #{file}\n  from #{file.dylib_id}\n    to #{id}" if ARGV.debug?
 | |
|     install_name_tool("-id", id, file)
 | |
|   end
 | |
| 
 | |
|   def change_install_name(old, new, file)
 | |
|     puts "Changing install name in #{file}\n  from #{old}\n    to #{new}" if ARGV.debug?
 | |
|     install_name_tool("-change", old, new, file)
 | |
|   end
 | |
| end
 |