brew/Library/Homebrew/extend/os/linux/development_tools.rb

34 lines
784 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: true
# 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
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
def build_system_info
brewed_glibc_version = begin
Formula["glibc"].any_installed_version
rescue FormulaUnavailableError
nil
end
glibc_version = brewed_glibc_version || OS::Linux::Glibc.system_version
generic_build_system_info.merge "glibc_version" => glibc_version
end
2018-09-27 18:26:03 -07:00
end
end