Restore support for catalina
Some checks failed
actionlint / workflow_syntax (push) Has been cancelled
Build Homebrew installer pkg / build (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Documentation CI / linting (push) Has been cancelled
Documentation CI / rubydoc (push) Has been cancelled
Update sponsors, maintainers, manpage and completions / updates (push) Has been cancelled
CI / syntax (push) Has been cancelled
Triage issues / stale (push) Has been cancelled
Triage issues / bump-pr-stale (push) Has been cancelled
Triage issues / lock-threads (push) Has been cancelled
CI / tap syntax (push) Has been cancelled
CI / formula audit (push) Has been cancelled
CI / cask audit (push) Has been cancelled
CI / vendored gems (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / update-test (Ubuntu 22.04) (push) Has been cancelled
CI / update-test (macOS 13) (push) Has been cancelled
CI / tests (Ubuntu 20.04) (push) Has been cancelled
CI / tests (Ubuntu 22.04) (push) Has been cancelled
CI / tests (generic OS) (push) Has been cancelled
CI / tests (macOS 13) (push) Has been cancelled
CI / tests (online) (push) Has been cancelled
CI / test default formula (Ubuntu 20.04) (push) Has been cancelled
CI / test default formula (Ubuntu 22.04) (push) Has been cancelled
CI / test default formula (macOS 13) (push) Has been cancelled
Some checks failed
actionlint / workflow_syntax (push) Has been cancelled
Build Homebrew installer pkg / build (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Documentation CI / linting (push) Has been cancelled
Documentation CI / rubydoc (push) Has been cancelled
Update sponsors, maintainers, manpage and completions / updates (push) Has been cancelled
CI / syntax (push) Has been cancelled
Triage issues / stale (push) Has been cancelled
Triage issues / bump-pr-stale (push) Has been cancelled
Triage issues / lock-threads (push) Has been cancelled
CI / tap syntax (push) Has been cancelled
CI / formula audit (push) Has been cancelled
CI / cask audit (push) Has been cancelled
CI / vendored gems (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / update-test (Ubuntu 22.04) (push) Has been cancelled
CI / update-test (macOS 13) (push) Has been cancelled
CI / tests (Ubuntu 20.04) (push) Has been cancelled
CI / tests (Ubuntu 22.04) (push) Has been cancelled
CI / tests (generic OS) (push) Has been cancelled
CI / tests (macOS 13) (push) Has been cancelled
CI / tests (online) (push) Has been cancelled
CI / test default formula (Ubuntu 20.04) (push) Has been cancelled
CI / test default formula (Ubuntu 22.04) (push) Has been cancelled
CI / test default formula (macOS 13) (push) Has been cancelled
Fix typo
This commit is contained in:
107
Library/Homebrew/os/mac/version.rb
Normal file
107
Library/Homebrew/os/mac/version.rb
Normal file
@@ -0,0 +1,107 @@
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "exceptions"
|
||||
require "hardware"
|
||||
require "version"
|
||||
|
||||
module OS
|
||||
module Mac
|
||||
# A macOS version.
|
||||
#
|
||||
# @api private
|
||||
class Version < ::Version
|
||||
extend T::Sig
|
||||
|
||||
# TODO: bump version when new macOS is released or announced
|
||||
# and also update references in docs/Installation.md,
|
||||
# https://github.com/Homebrew/install/blob/HEAD/install.sh and
|
||||
# MacOSVersions::SYMBOLS
|
||||
NEWEST_UNSUPPORTED = "14"
|
||||
private_constant :NEWEST_UNSUPPORTED
|
||||
|
||||
# TODO: bump version when new macOS is released and also update
|
||||
# references in docs/Installation.md and
|
||||
# https://github.com/Homebrew/install/blob/HEAD/install.sh
|
||||
OLDEST_SUPPORTED = "10.15"
|
||||
private_constant :OLDEST_SUPPORTED
|
||||
|
||||
OLDEST_ALLOWED = "10.11"
|
||||
|
||||
sig { params(version: Symbol).returns(T.attached_class) }
|
||||
def self.from_symbol(version)
|
||||
str = MacOSVersions::SYMBOLS.fetch(version) { raise MacOSVersionError, version }
|
||||
new(str)
|
||||
end
|
||||
|
||||
sig { params(value: T.nilable(String)).void }
|
||||
def initialize(value)
|
||||
version ||= value
|
||||
|
||||
raise MacOSVersionError, version unless /\A1\d+(?:\.\d+){0,2}\Z/.match?(version)
|
||||
|
||||
super(version)
|
||||
|
||||
@comparison_cache = {}
|
||||
end
|
||||
|
||||
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
|
||||
def <=>(other)
|
||||
@comparison_cache.fetch(other) do
|
||||
if MacOSVersions::SYMBOLS.key?(other) && to_sym == other
|
||||
0
|
||||
else
|
||||
v = MacOSVersions::SYMBOLS.fetch(other) { other.to_s }
|
||||
@comparison_cache[other] = super(::Version.new(v))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
sig { returns(T.self_type) }
|
||||
def strip_patch
|
||||
# Big Sur is 11.x but Catalina is 10.15.x.
|
||||
if major >= 11
|
||||
self.class.new(major.to_s)
|
||||
else
|
||||
major_minor
|
||||
end
|
||||
end
|
||||
|
||||
sig { returns(Symbol) }
|
||||
def to_sym
|
||||
@to_sym ||= MacOSVersions::SYMBOLS.invert.fetch(strip_patch.to_s, :dunno)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
def pretty_name
|
||||
@pretty_name ||= to_sym.to_s.split("_").map(&:capitalize).join(" ").freeze
|
||||
end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def outdated_release?
|
||||
self < OLDEST_SUPPORTED
|
||||
end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def prerelease?
|
||||
self >= NEWEST_UNSUPPORTED
|
||||
end
|
||||
|
||||
# For {OS::Mac::Version} compatibility.
|
||||
sig { returns(T::Boolean) }
|
||||
def requires_nehalem_cpu?
|
||||
unless Hardware::CPU.intel?
|
||||
raise "Unexpected architecture: #{Hardware::CPU.arch}. This only works with Intel architecture."
|
||||
end
|
||||
|
||||
Hardware.oldest_cpu(self) == :nehalem
|
||||
end
|
||||
# https://en.wikipedia.org/wiki/Nehalem_(microarchitecture)
|
||||
# Ensure any extra methods are also added to version/null.rb
|
||||
alias requires_sse4? requires_nehalem_cpu?
|
||||
alias requires_sse41? requires_nehalem_cpu?
|
||||
alias requires_sse42? requires_nehalem_cpu?
|
||||
alias requires_popcnt? requires_nehalem_cpu?
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -9,7 +9,7 @@ The macOS `.pkg` installer also installs Homebrew to its default prefix (`/opt/h
|
||||
## macOS Requirements
|
||||
|
||||
* A 64-bit Intel CPU or Apple Silicon CPU <sup>[1](#1)</sup>
|
||||
* macOS Big Sur (11) (or higher) <sup>[2](#2)</sup>
|
||||
* macOS Catalina (10.5) (or higher) <sup>[2](#2)</sup>
|
||||
* Command Line Tools (CLT) for Xcode (from `xcode-select --install` or
|
||||
[https://developer.apple.com/download/all/](https://developer.apple.com/download/all/)) or
|
||||
[Xcode](https://itunes.apple.com/us/app/xcode/id497799835) <sup>[3](#3)</sup>
|
||||
@@ -90,7 +90,7 @@ Uninstallation is documented in the [FAQ](FAQ.md).
|
||||
|
||||
<a name="1"><sup>1</sup></a> For 32-bit or PPC support see [Tigerbrew](https://github.com/mistydemeo/tigerbrew).
|
||||
|
||||
<a name="2"><sup>2</sup></a> macOS 11 (Big Sur) or higher is best and supported, 10.11 (El Capitan) – 10.15 (Catalina) are unsupported but may work and 10.10 (Yosemite) and older will not run Homebrew at all. For 10.4 (Tiger) – 10.6 (Snow Leopard) see [Tigerbrew](https://github.com/mistydemeo/tigerbrew).
|
||||
<a name="2"><sup>2</sup></a> macOS 10.5 (Catalina) or higher is best and supported, 10.11 (El Capitan) – 10.15 (Catalina) are unsupported but may work and 10.10 (Yosemite) and older will not run Homebrew at all. For 10.4 (Tiger) – 10.6 (Snow Leopard) see [Tigerbrew](https://github.com/mistydemeo/tigerbrew).
|
||||
|
||||
<a name="3"><sup>3</sup></a> You may need to install Xcode, the CLT, or both depending on the formula, to install a bottle (binary package) which is the only supported configuration. Downloading Xcode may require an Apple Developer account on older versions of Mac OS X. Sign up for free at [Apple's website](https://developer.apple.com/account/).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user