 d271614872
			
		
	
	
		d271614872
		
			
		
	
	
	
	
		
			
			Right now this is done through the gcc@5 formula.
See 9692318ca6/Formula/gcc%405.rb (L33)
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from one gcc formula to another..
Also, not having the right glibc version results in a non-functional brew
installation on an older Linux: the glibc installation needs
to be done by brew, and not by a workaround in a specific formula
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Co-Authored-By: Bo Anderson <mail@boanderson.me>
Co-Authored-By: Shaun Jackman <sjackman@gmail.com>
		
	
			
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # typed: true
 | |
| # frozen_string_literal: true
 | |
| 
 | |
| class Formula
 | |
|   undef shared_library
 | |
|   undef loader_path
 | |
|   undef deuniversalize_machos
 | |
|   undef add_global_deps_to_spec
 | |
| 
 | |
|   sig { params(name: String, version: T.nilable(T.any(String, Integer))).returns(String) }
 | |
|   def shared_library(name, version = nil)
 | |
|     suffix = if version == "*" || (name == "*" && version.blank?)
 | |
|       "{,.*}"
 | |
|     elsif version.present?
 | |
|       ".#{version}"
 | |
|     end
 | |
|     "#{name}.so#{suffix}"
 | |
|   end
 | |
| 
 | |
|   sig { returns(String) }
 | |
|   def loader_path
 | |
|     "$ORIGIN"
 | |
|   end
 | |
| 
 | |
|   sig { params(targets: T.nilable(T.any(Pathname, String))).void }
 | |
|   def deuniversalize_machos(*targets); end
 | |
| 
 | |
|   sig { params(spec: SoftwareSpec).void }
 | |
|   def add_global_deps_to_spec(spec)
 | |
|     @global_deps ||= begin
 | |
|       dependency_collector = spec.dependency_collector
 | |
|       related_formula_names = Set.new([
 | |
|         name,
 | |
|         *versioned_formulae_names,
 | |
|       ])
 | |
|       [
 | |
|         dependency_collector.gcc_dep_if_needed(related_formula_names),
 | |
|         dependency_collector.glibc_dep_if_needed(related_formula_names),
 | |
|       ].compact.freeze
 | |
|     end
 | |
|     @global_deps.each { |dep| spec.dependency_collector.add(dep) }
 | |
|   end
 | |
| end
 |