From fbf56e27a02e37b017654a2065d06211e030df0f Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Tue, 23 Jun 2020 16:51:16 +0100 Subject: [PATCH 1/2] os/mac: fix for major versions other than 10 --- Library/Homebrew/os/mac.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 654f2d5c04..f559bfacf9 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -21,7 +21,7 @@ module OS # This can be compared to numerics, strings, or symbols # using the standard Ruby Comparable methods. def version - @version ||= Version.new(full_version.to_s[/10\.\d+/]) + @version ||= Version.new(full_version.to_s[/^\d+\.\d+/]) end # This can be compared to numerics, strings, or symbols From 6f1970fd24611e89bdbf71ddc78221678be1bfda Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 23 Jun 2020 17:10:07 +0100 Subject: [PATCH 2/2] Fix more 10.x hardcodings. --- Library/Homebrew/extend/os/mac/extend/ENV/std.rb | 2 +- Library/Homebrew/shims/super/cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb index ae04e62a8d..11287c3167 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb @@ -52,7 +52,7 @@ module Stdenv def remove_macosxsdk(version = nil) # Clear all lib and include dirs from CFLAGS, CPPFLAGS, LDFLAGS that were # previously added by macosxsdk - remove_from_cflags(/ ?-mmacosx-version-min=10\.\d+/) + remove_from_cflags(/ ?-mmacosx-version-min=\d+\.\d+/) delete("CPATH") remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" diff --git a/Library/Homebrew/shims/super/cc b/Library/Homebrew/shims/super/cc index b6249a04f4..4462deae26 100755 --- a/Library/Homebrew/shims/super/cc +++ b/Library/Homebrew/shims/super/cc @@ -188,8 +188,8 @@ class Cmd when "-Xpreprocessor", "-Xclang" # used for -Xpreprocessor -fopenmp args << arg << enum.next - when /-mmacosx-version-min=10\.(\d+)/ - arg = "-mmacosx-version-min=10.9" if high_sierra_or_later? && $1.to_i < 9 + when /-mmacosx-version-min=(\d+)\.(\d+)/ + arg = "-mmacosx-version-min=10.9" if high_sierra_or_later? && $1 == "10" && $2.to_i < 9 args << arg when "--fast-math" arg = "-ffast-math" if tool =~ /^clang/