Module: OS::Mac::DevelopmentTools::ClassMethods Private
- Extended by:
- T::Helpers
- Defined in:
- extend/os/mac/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
- #curl_handles_most_https_certificates? ⇒ Boolean private
- #custom_installation_instructions ⇒ String private
- #default_compiler ⇒ Symbol private
- #installation_instructions ⇒ String private
-
#installed? ⇒ Boolean
private
Checks if the user has any developer tools installed, either via Xcode or the CLT.
- #ld64_version ⇒ Version private
- #locate(tool) ⇒ Pathname? private
- #subversion_handles_most_https_certificates? ⇒ 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.
80 81 82 83 84 85 86 87 |
# File 'extend/os/mac/development_tools.rb', line 80 def build_system_info build_info = { "xcode" => MacOS::Xcode.version.to_s.presence, "clt" => MacOS::CLT.version.to_s.presence, "preferred_perl" => MacOS.preferred_perl_version, } super.merge build_info end |
#curl_handles_most_https_certificates? ⇒ 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.
53 54 55 56 57 |
# File 'extend/os/mac/development_tools.rb', line 53 def curl_handles_most_https_certificates? # The system Curl is too old for some modern HTTPS certificates on # older macOS versions. ENV["HOMEBREW_SYSTEM_CURL_TOO_OLD"].nil? 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.
72 73 74 75 76 77 |
# File 'extend/os/mac/development_tools.rb', line 72 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.
36 37 38 |
# File 'extend/os/mac/development_tools.rb', line 36 def default_compiler :clang 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.
67 68 69 |
# File 'extend/os/mac/development_tools.rb', line 67 def installation_instructions MacOS::CLT.installation_instructions end |
#installed? ⇒ 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.
Checks if the user has any developer tools installed, either via Xcode or the CLT. Convenient for guarding against formula builds when building is impossible.
31 32 33 |
# File 'extend/os/mac/development_tools.rb', line 31 def installed? MacOS::Xcode.installed? || MacOS::CLT.installed? end |
#ld64_version ⇒ Version
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.
41 42 43 44 45 46 47 48 49 50 |
# File 'extend/os/mac/development_tools.rb', line 41 def ld64_version @ld64_version ||= T.let(begin json = Utils.popen_read("/usr/bin/ld", "-version_details") if $CHILD_STATUS.success? Version.parse(JSON.parse(json)["version"]) else Version::NULL end end, T.nilable(Version)) 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.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'extend/os/mac/development_tools.rb', line 15 def locate(tool) @locate ||= T.let({}, T.nilable(T::Hash[T.any(String, Symbol), Pathname])) @locate.fetch(tool) do |key| @locate[key] = if (located_tool = super(tool)) located_tool else path = Utils.popen_read("/usr/bin/xcrun", "-no-cache", "-find", tool, err: :close).chomp Pathname.new(path) if File.executable?(path) end end end |
#subversion_handles_most_https_certificates? ⇒ 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.
60 61 62 63 64 |
# File 'extend/os/mac/development_tools.rb', line 60 def subversion_handles_most_https_certificates? # The system Subversion is too old for some HTTPS certificates on # older macOS versions. MacOS.version >= :sierra end |