Class: UsesFromMacOSDependency Private
- Inherits:
-
Dependency
- Object
- Dependency
- UsesFromMacOSDependency
- Defined in:
- dependency.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
A dependency that's marked as "installed" on macOS
Constant Summary
Constants included from Dependable
Instance Attribute Summary collapse
- #bounds ⇒ Object readonly private
Attributes inherited from Dependency
Attributes included from Dependable
Instance Method Summary collapse
- #dup_with_formula_name(formula) ⇒ T.self_type private
- #initialize(name, tags = [], bounds:) ⇒ void constructor private
- #installed?(minimum_version: nil, minimum_revision: nil, minimum_compatibility_version: nil, bottle_os_version: nil) ⇒ Boolean private
- #use_macos_install?(bottle_os_version: nil) ⇒ Boolean private
- #uses_from_macos? ⇒ Boolean private
Methods inherited from Dependency
action, cache, clear_cache, delete_timestamped_cache_entry, expand, keep_but_prune_recursive_deps, merge_repeats, #missing_options, #option_names, prune, #satisfied?, skip, #to_formula, #to_installed_formula
Methods included from Dependable
#build?, #implicit?, #no_linkage?, #option_names, #option_tags, #optional?, #options, #prune_from_option?, #prune_if_build_and_not_dependent?, #recommended?, #required?, #test?
Constructor Details
#initialize(name, tags = [], bounds:) ⇒ void
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.
305 306 307 308 309 |
# File 'dependency.rb', line 305 def initialize(name, = [], bounds:) super(name, ) @bounds = bounds end |
Instance Attribute Details
#bounds ⇒ Object (readonly)
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.
302 303 304 |
# File 'dependency.rb', line 302 def bounds @bounds end |
Instance Method Details
#dup_with_formula_name(formula) ⇒ T.self_type
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.
368 369 370 |
# File 'dependency.rb', line 368 def dup_with_formula_name(formula) self.class.new(formula.full_name.to_s, , bounds:) end |
#installed?(minimum_version: nil, minimum_revision: nil, minimum_compatibility_version: nil, bottle_os_version: nil) ⇒ 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.
327 328 329 330 |
# File 'dependency.rb', line 327 def installed?(minimum_version: nil, minimum_revision: nil, minimum_compatibility_version: nil, bottle_os_version: nil) use_macos_install?(bottle_os_version:) || super end |
#use_macos_install?(bottle_os_version: nil) ⇒ 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.
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'dependency.rb', line 333 def use_macos_install?(bottle_os_version: nil) # Check whether macOS is new enough for dependency to not be required. if Homebrew::SimulateSystem.simulating_or_running_on_macos? # If there's no since bound, the dependency is always available from macOS since_os_bounds = bounds[:since] return true if since_os_bounds.blank? # When installing a bottle built on an older macOS version, use that version # to determine if the dependency should come from macOS or Homebrew effective_os = if bottle_os_version.present? && bottle_os_version.start_with?("macOS ") # bottle_os_version is a string like "14" for Sonoma, "15" for Sequoia # Convert it to a MacOS version symbol for comparison MacOSVersion.new(bottle_os_version.delete_prefix("macOS ")) elsif Homebrew::SimulateSystem.current_os == :macos # Assume the oldest macOS version when simulating a generic macOS version # Version::NULL is always treated as less than any other version. Version::NULL else MacOSVersion.from_symbol(Homebrew::SimulateSystem.current_os) end since_os = MacOSVersion.from_symbol(since_os_bounds) return true if effective_os >= since_os end false end |
#uses_from_macos? ⇒ 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.
363 364 365 |
# File 'dependency.rb', line 363 def uses_from_macos? true end |