| 
									
										
										
										
											2020-10-10 14:16:11 +02:00
										 |  |  | # typed: true | 
					
						
							| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-27 18:26:03 -07:00
										 |  |  | class DevelopmentTools | 
					
						
							|  |  |  |   class << self | 
					
						
							| 
									
										
										
										
											2020-10-20 12:03:48 +02:00
										 |  |  |     extend T::Sig | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-29 15:12:53 -07:00
										 |  |  |     sig { params(tool: String).returns(T.nilable(Pathname)) } | 
					
						
							| 
									
										
										
										
											2018-10-01 15:34:47 -07:00
										 |  |  |     def locate(tool) | 
					
						
							|  |  |  |       (@locate ||= {}).fetch(tool) do |key| | 
					
						
							|  |  |  |         @locate[key] = if (path = HOMEBREW_PREFIX/"bin/#{tool}").executable? | 
					
						
							|  |  |  |           path | 
					
						
							|  |  |  |         elsif File.executable?(path = "/usr/bin/#{tool}") | 
					
						
							|  |  |  |           Pathname.new path | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-20 12:03:48 +02:00
										 |  |  |     sig { returns(Symbol) } | 
					
						
							| 
									
										
										
										
											2018-09-27 18:26:03 -07:00
										 |  |  |     def default_compiler | 
					
						
							|  |  |  |       :gcc | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2021-03-31 17:01:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-29 17:43:47 -07:00
										 |  |  |     sig { returns(T::Hash[String, T.nilable(String)]) } | 
					
						
							| 
									
										
										
										
											2021-03-31 17:01:36 -07:00
										 |  |  |     def build_system_info | 
					
						
							| 
									
										
										
										
											2021-04-02 18:31:42 -07:00
										 |  |  |       generic_build_system_info.merge({ | 
					
						
							| 
									
										
										
										
											2021-09-29 17:43:47 -07:00
										 |  |  |         "glibc_version"     => OS::Linux::Glibc.version.to_s.presence, | 
					
						
							|  |  |  |         "oldest_cpu_family" => Hardware.oldest_cpu.to_s, | 
					
						
							| 
									
										
										
										
											2021-04-02 18:31:42 -07:00
										 |  |  |       }) | 
					
						
							| 
									
										
										
										
											2021-03-31 17:01:36 -07:00
										 |  |  |     end | 
					
						
							| 
									
										
										
										
											2018-09-27 18:26:03 -07:00
										 |  |  |   end | 
					
						
							|  |  |  | end |