Skip to content

Commit

Permalink
Merge pull request #7806 from MikeMcQuaid/big_sur_tweaks
Browse files Browse the repository at this point in the history
macOS Big Sur tweaks
  • Loading branch information
MikeMcQuaid committed Jun 23, 2020
2 parents dd26ada + 11c875d commit d6cc5ff
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Library/Homebrew/extend/os/linux/install.rb
Expand Up @@ -16,7 +16,8 @@ module Install
].freeze

def check_cpu
return if (Hardware::CPU.intel? && Hardware::CPU.is_64_bit?) || Hardware::CPU.arm?
return if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
return if Hardware::CPU.arm?

message = "Sorry, Homebrew does not support your computer's CPU architecture!"
if Hardware::CPU.ppc64le?
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/extend/os/mac/hardware/cpu.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "macho"

module Hardware
class CPU
class << self
Expand Down
7 changes: 5 additions & 2 deletions Library/Homebrew/install.rb
Expand Up @@ -10,10 +10,13 @@ module Install
module_function

def check_cpu
return if (Hardware::CPU.intel? && Hardware::CPU.is_64_bit?) || Hardware::CPU.arm?
return if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?

message = "Sorry, Homebrew does not support your computer's CPU architecture!"
if Hardware::CPU.ppc?
if Hardware::CPU.arm?
opoo message
return
elsif Hardware::CPU.ppc?
message += <<~EOS
For PowerPC Mac (PPC32/PPC64BE) support, see:
#{Formatter.url("https://github.com/mistydemeo/tigerbrew")}
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/os/mac/version.rb
@@ -1,12 +1,13 @@
# frozen_string_literal: true

require "hardware"
require "version"

module OS
module Mac
class Version < ::Version
SYMBOLS = {
big_sur: "10.16",
big_sur: Hardware::CPU.arm? ? "11.00" : "10.16",
catalina: "10.15",
mojave: "10.14",
high_sierra: "10.13",
Expand Down
15 changes: 9 additions & 6 deletions Library/Homebrew/os/mac/xcode.rb
Expand Up @@ -13,9 +13,10 @@ module Xcode
# CI systems have been updated.
# This may be a beta version for a beta macOS.
def latest_version
latest = "11.5"
latest_stable = "11.5"
case MacOS.version
when "10.15" then latest
when "11.0", "10.16" then "12.0"
when "10.15" then latest_stable
when "10.14" then "11.3.1"
when "10.13" then "10.1"
when "10.12" then "9.2"
Expand All @@ -26,7 +27,7 @@ def latest_version
raise "macOS '#{MacOS.version}' is invalid" unless OS::Mac.prerelease?

# Default to newest known version of Xcode for unreleased macOS versions.
latest
latest_stable
end
end

Expand All @@ -36,6 +37,7 @@ def latest_version
# also in beta).
def minimum_version
case MacOS.version
when "11.0", "10.16" then "12.0"
when "10.15" then "11.0"
when "10.14" then "10.2"
when "10.13" then "9.0"
Expand Down Expand Up @@ -173,9 +175,10 @@ def detect_version_from_clang_version
# installed CLT version. This is useful as they are packaged
# simultaneously so workarounds need to apply to both based on their
# comparable version.
latest = "11.5"
latest_stable = "11.5"
case (DevelopmentTools.clang_version.to_f * 10).to_i
when 110 then latest
when 120 then "12.0"
when 110 then latest_stable
when 100 then "10.3"
when 91 then "9.4"
when 90 then "9.2"
Expand All @@ -186,7 +189,7 @@ def detect_version_from_clang_version
when 61 then "6.1"
when 60 then "6.0"
when 0 then "dunno"
else latest
else latest_stable
end
end

Expand Down

0 comments on commit d6cc5ff

Please sign in to comment.