Module: OS::Linux::DevelopmentTools::ClassMethods Private
- Extended by:
- T::Helpers
- Defined in:
- extend/os/linux/development_tools.rb
This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.
Instance Method Summary collapse
- #build_system_info ⇒ Hash{String => String, nil} private
- #custom_installation_instructions ⇒ String private
- #default_compiler ⇒ Symbol private
- #host_gcc_path ⇒ ::Pathname private
- #installation_instructions ⇒ String private
- #locate(tool) ⇒ ::Pathname? private
- #needs_compiler_formula? ⇒ Boolean private
- #needs_libc_formula? ⇒ Boolean private
Instance Method Details
#build_system_info ⇒ Hash{String => String, nil}
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
84 85 86 87 88 89 |
# File 'extend/os/linux/development_tools.rb', line 84 def build_system_info super.merge({ "glibc_version" => OS::Linux::Glibc.version.to_s.presence, "oldest_cpu_family" => ::Hardware.oldest_cpu.to_s, }) end |
#custom_installation_instructions ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
43 44 45 46 47 48 |
# File 'extend/os/linux/development_tools.rb', line 43 def custom_installation_instructions <<~EOS Install GNU's GCC: brew install gcc EOS end |
#default_compiler ⇒ Symbol
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
31 |
# File 'extend/os/linux/development_tools.rb', line 31 def default_compiler = :gcc |
#host_gcc_path ⇒ ::Pathname
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
63 64 65 66 67 68 69 |
# File 'extend/os/linux/development_tools.rb', line 63 def host_gcc_path # Prioritise versioned path if installed path = ::Pathname.new("/usr/bin/#{OS::LINUX_PREFERRED_GCC_COMPILER_FORMULA.tr("@", "-")}") return path if path.exist? super end |
#installation_instructions ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
34 35 36 37 38 39 40 |
# File 'extend/os/linux/development_tools.rb', line 34 def installation_instructions <<~EOS Install a system C compiler and the standard development tools for your Linux distribution. See: https://docs.brew.sh/Homebrew-on-Linux#requirements EOS end |
#locate(tool) ⇒ ::Pathname?
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'extend/os/linux/development_tools.rb', line 13 def locate(tool) @locate ||= T.let({}, T.nilable(T::Hash[T.any(String, Symbol), ::Pathname])) @locate.fetch(tool) do |key| @locate[key] = if ::DevelopmentTools.needs_build_formulae? && (binutils_path = HOMEBREW_PREFIX/"opt/binutils/bin/#{tool}").executable? binutils_path elsif ::DevelopmentTools.needs_build_formulae? && (glibc_path = HOMEBREW_PREFIX/"opt/glibc/bin/#{tool}").executable? glibc_path elsif (homebrew_path = HOMEBREW_PREFIX/"bin/#{tool}").executable? homebrew_path elsif File.executable?(system_path = "/usr/bin/#{tool}") ::Pathname.new system_path end end end |
#needs_compiler_formula? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
72 73 74 75 76 77 78 79 80 81 |
# File 'extend/os/linux/development_tools.rb', line 72 def needs_compiler_formula? return @needs_compiler_formula unless @needs_compiler_formula.nil? @needs_compiler_formula = T.let(nil, T.nilable(T::Boolean)) # Undocumented environment variable to make it easier to test compiler # formula automatic installation. @needs_compiler_formula = true if ENV["HOMEBREW_FORCE_COMPILER_FORMULA"] @needs_compiler_formula ||= OS::Linux::Libstdcxx.below_ci_version? end |
#needs_libc_formula? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
51 52 53 54 55 56 57 58 59 60 |
# File 'extend/os/linux/development_tools.rb', line 51 def needs_libc_formula? return @needs_libc_formula unless @needs_libc_formula.nil? @needs_libc_formula = T.let(nil, T.nilable(T::Boolean)) # Undocumented environment variable to make it easier to test libc # formula automatic installation. @needs_libc_formula = true if ENV["HOMEBREW_FORCE_LIBC_FORMULA"] @needs_libc_formula ||= OS::Linux::Glibc.below_ci_version? end |