Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate macOS versions below Mavericks #5599

Merged
merged 1 commit into from
Jan 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,30 +93,30 @@ then
# Don't change this from Mac OS X to match what macOS itself does in Safari on 10.12
HOMEBREW_OS_USER_AGENT_VERSION="Mac OS X $HOMEBREW_MACOS_VERSION"

# The system Curl is too old for some modern HTTPS certificates on
# older macOS versions.
#
# Intentionally set this variable by exploding another.
# shellcheck disable=SC2086,SC2183
printf -v HOMEBREW_MACOS_VERSION_NUMERIC "%02d%02d%02d" ${HOMEBREW_MACOS_VERSION//./ }
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101000" ]]
then
HOMEBREW_SYSTEM_CURL_TOO_OLD="1"
HOMEBREW_FORCE_BREWED_CURL="1"
fi

# Announce pre-Mavericks deprecation now
# Refuse to run on pre-Mavericks
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100900" ]]
then
printf "WARNING: Your version of macOS (%s) will not be able to run Homebrew when\n" "$HOMEBREW_MACOS_VERSION" >&2
printf " version 2.0.0 is released (Q1 2019)!\n" >&2
printf "ERROR: Your version of macOS (%s) is too old to run Homebrew!" "$HOMEBREW_MACOS_VERSION" >&2
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100700" ]]
then
printf " For 10.4 - 10.6 support see: https://github.com/mistydemeo/tigerbrew\n" >&2
fi
printf "\n" >&2
fi

# The system Curl is too old for some modern HTTPS certificates on
# older macOS versions.
#
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101000" ]]
then
HOMEBREW_SYSTEM_CURL_TOO_OLD="1"
HOMEBREW_FORCE_BREWED_CURL="1"
fi

# The system Git on macOS versions before Sierra is too old for some Homebrew functionality we rely on.
HOMEBREW_MINIMUM_GIT_VERSION="2.14.3"
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101200" ]]
Expand Down
20 changes: 6 additions & 14 deletions Library/Homebrew/compilers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module CompilerConstants
GNU_GCC_REGEXP = /^gcc-(4\.9|[5-8])$/.freeze
COMPILER_SYMBOL_MAP = {
"gcc" => :gcc,
"gcc-4.2" => :gcc_4_2,
"clang" => :clang,
"llvm_clang" => :llvm_clang,
}.freeze
Expand All @@ -19,9 +18,11 @@ class CompilerFailure
def version(val = nil)
if val
@version = Version.parse(val.to_s)
else
@version
if name.to_s == "clang" && val.to_i < 600
odisabled "'fails_with :clang' with 'build' < 600"
end
end
@version
end

# Allows Apple compiler `fails_with` statements to keep using `build`
Expand Down Expand Up @@ -66,14 +67,6 @@ def inspect
end

COLLECTIONS = {
cxx11: [
create(:gcc_4_2),
create(:clang) { build 425 },
],
cxx14: [
create(:clang) { build 600 },
create(:gcc_4_2),
],
openmp: [
create(:clang),
],
Expand All @@ -86,9 +79,8 @@ class CompilerSelector
Compiler = Struct.new(:name, :version)

COMPILER_PRIORITY = {
clang: [:clang, :gcc_4_2, :gnu, :llvm_clang],
gcc_4_2: [:gcc_4_2, :gnu, :clang],
gcc: [:gnu, :gcc, :llvm_clang, :clang, :gcc_4_2],
clang: [:clang, :gnu, :llvm_clang],
gcc: [:gnu, :gcc, :llvm_clang, :clang],
}.freeze

def self.select_for(formula, compilers = self.compilers)
Expand Down
13 changes: 0 additions & 13 deletions Library/Homebrew/development_tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ def default_compiler
:clang
end

def gcc_4_2_build_version
@gcc_4_2_build_version ||= begin
if (gcc = locate("gcc-4.2")) &&
!gcc.realpath.basename.to_s.start_with?("llvm") &&
build_version = `#{gcc} --version 2>/dev/null`[/build (\d{4,})/, 1]
Version.new build_version
else
Version::NULL
end
end
end

def clang_version
@clang_version ||= begin
if (path = locate("clang")) &&
Expand Down Expand Up @@ -98,7 +86,6 @@ def non_apple_gcc_version(cc)
end

def clear_version_cache
@gcc_4_2_build_version = nil
@clang_version = @clang_build_version = nil
@non_apple_gcc_version = {}
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ def check_for_stray_static_libs
# Static libs which are generally OK should be added to this list,
# with a short description of the software they come with.
white_list = [
"libsecurity_agent_client.a", # OS X 10.8.2 Supplemental Update
"libsecurity_agent_server.a", # OS X 10.8.2 Supplemental Update
"libntfs-3g.a", # NTFS-3G
"libntfs.a", # NTFS-3G
"libublio.a", # NTFS-3G
Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/emoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ def install_badge
def enabled?
!ENV["HOMEBREW_NO_EMOJI"]
end
alias generic_enabled? enabled?
end
end

require "extend/os/emoji"
12 changes: 0 additions & 12 deletions Library/Homebrew/extend/ENV/shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,6 @@ def compiler_any_clang?(cc = compiler)
%w[clang llvm_clang].include?(cc.to_s)
end

# @private
def compiler_with_cxx11_support?(cc)
return if compiler_any_clang?(cc)

version = if cc == :gcc
DevelopmentTools.non_apple_gcc_version "gcc"
else
cc[/^gcc-(\d+(?:\.\d+)?)$/, 1]
end
version && Version.create(version) >= Version.create("4.8")
end

private

def cc=(val)
Expand Down
15 changes: 2 additions & 13 deletions Library/Homebrew/extend/ENV/std.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ def determine_cxx
dir/base.to_s.sub("gcc", "g++").sub("clang", "clang++")
end

def gcc_4_2
super
set_cpu_cflags
end

GNU_GCC_VERSIONS.each do |n|
define_method(:"gcc-#{n}") do
super()
Expand Down Expand Up @@ -145,14 +140,8 @@ def universal_binary
end

def cxx11
if compiler == :clang
append "CXX", "-std=c++11"
append "CXX", "-stdlib=libc++"
elsif compiler_with_cxx11_support?(compiler)
append "CXX", "-std=c++11"
else
raise "The selected compiler doesn't support C++11: #{compiler}"
end
append "CXX", "-std=c++11"
libcxx
end

def libcxx
Expand Down
19 changes: 4 additions & 15 deletions Library/Homebrew/extend/ENV/super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def setup_build_environment(formula = nil)
# K - Don't strip -arch <arch>, -m32, or -m64
# w - Pass -no_weak_imports to the linker
#
# On 10.8 and newer, these flags will also be present:
# These flags will also be present:
# s - apply fix for sed's Unicode support
# a - apply fix for apr-1-config path
end
Expand Down Expand Up @@ -109,13 +109,8 @@ def determine_path
path.append(homebrew_extra_paths)
path.append("/usr/bin", "/bin", "/usr/sbin", "/sbin")

# Homebrew's apple-gcc42 will be outside the PATH in superenv,
# so xcrun may not be able to find it
begin
case homebrew_cc
when "gcc-4.2"
path.append(Formulary.factory("apple-gcc42").opt_bin)
when GNU_GCC_REGEXP
if homebrew_cc =~ GNU_GCC_REGEXP
path.append(gcc_version_formula($&).opt_bin)
end
rescue FormulaUnavailableError
Expand Down Expand Up @@ -279,14 +274,8 @@ def m64
end

def cxx11
if homebrew_cc == "clang"
append_to_cccfg "x"
append_to_cccfg "g"
elsif compiler_with_cxx11_support?(homebrew_cc)
append_to_cccfg "x"
else
raise "The selected compiler doesn't support C++11: #{homebrew_cc}"
end
append_to_cccfg "x"
append_to_cccfg "g" if homebrew_cc == "clang"
end

def libcxx
Expand Down
1 change: 0 additions & 1 deletion Library/Homebrew/extend/os/emoji.rb

This file was deleted.

14 changes: 2 additions & 12 deletions Library/Homebrew/extend/os/mac/dependency_collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,15 @@ class DependencyCollector
undef git_dep_if_needed, subversion_dep_if_needed, cvs_dep_if_needed,
xz_dep_if_needed, unzip_dep_if_needed, bzip2_dep_if_needed

def git_dep_if_needed(tags)
return if MacOS.version >= :lion

Dependency.new("git", tags)
end
def git_dep_if_needed(tags); end

def subversion_dep_if_needed(tags); end

def cvs_dep_if_needed(tags)
return if MacOS.version < :lion

Dependency.new("cvs", tags)
end

def xz_dep_if_needed(tags)
return if MacOS.version >= :mavericks

Dependency.new("xz", tags)
end
def xz_dep_if_needed(tags); end

def unzip_dep_if_needed(tags); end

Expand Down
33 changes: 5 additions & 28 deletions Library/Homebrew/extend/os/mac/development_tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,7 @@ def installed?
end

def default_compiler
case default_cc
when /^gcc/ then :gcc_4_2
when "clang" then :clang
else
# guess :(
if MacOS::Xcode.version >= "4.3"
:clang
else
:gcc_4_2
end
end
:clang
end

def curl_handles_most_https_certificates?
Expand All @@ -52,23 +42,10 @@ def subversion_handles_most_https_certificates?
end

def installation_instructions
if MacOS.version >= "10.9"
<<~EOS
Install the Command Line Tools:
xcode-select --install
EOS
elsif MacOS.version == "10.8" || MacOS.version == "10.7"
<<~EOS
Install the Command Line Tools from
https://developer.apple.com/download/more/
or via Xcode's preferences.
EOS
else
<<~EOS
Install Xcode from
https://developer.apple.com/download/more/
EOS
end
<<~EOS
Install the Command Line Tools:
xcode-select --install
EOS
end

def custom_installation_instructions
Expand Down
7 changes: 0 additions & 7 deletions Library/Homebrew/extend/os/mac/emoji.rb

This file was deleted.

26 changes: 7 additions & 19 deletions Library/Homebrew/extend/os/mac/extend/ENV/std.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,24 @@ def x11

append_path "ACLOCAL_PATH", "#{MacOS::X11.share}/aclocal"

if MacOS::XQuartz.provided_by_apple? && MacOS.sdk_path_if_needed
append_path "CMAKE_PREFIX_PATH", "#{MacOS.sdk_path_if_needed}/usr/X11"
end

append "CFLAGS", "-I#{MacOS::X11.include}" unless MacOS::CLT.installed?
end

def setup_build_environment(formula = nil)
generic_setup_build_environment formula

if MacOS.version >= :mountain_lion
# Mountain Lion's sed is stricter, and errors out when
# it encounters files with mixed character sets
delete("LC_ALL")
self["LC_CTYPE"] = "C"
end
# sed is strict, and errors out when it encounters files with
# mixed character sets
delete("LC_ALL")
self["LC_CTYPE"] = "C"

# Add lib and include etc. from the current macosxsdk to compiler flags:
macosxsdk MacOS.version

if MacOS::Xcode.without_clt?
append_path "PATH", "#{MacOS::Xcode.prefix}/usr/bin"
append_path "PATH", "#{MacOS::Xcode.toolchain_path}/usr/bin"
end

# Leopard's ld needs some convincing that it's building 64-bit
# See: https://github.com/mistydemeo/tigerbrew/issues/59
return unless MacOS.version == :leopard
return unless MacOS::Xcode.without_clt?

append "LDFLAGS", "-arch #{Hardware::CPU.arch_64_bit}"
append_path "PATH", "#{MacOS::Xcode.prefix}/usr/bin"
append_path "PATH", "#{MacOS::Xcode.toolchain_path}/usr/bin"
end

def remove_macosxsdk(version = MacOS.version)
Expand Down
17 changes: 5 additions & 12 deletions Library/Homebrew/extend/os/mac/extend/ENV/super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ def bin

def homebrew_extra_paths
paths = []
# On 10.9, there are shims for all tools in /usr/bin.
# On 10.7 and 10.8 we need to add these directories ourselves.
if MacOS::Xcode.without_clt? && MacOS.version <= "10.8"
paths << "#{MacOS::Xcode.prefix}/usr/bin"
paths << "#{MacOS::Xcode.toolchain_path}/usr/bin"
end

paths << MacOS::X11.bin.to_s if x11?
paths
end
Expand Down Expand Up @@ -96,9 +89,9 @@ def homebrew_extra_cmake_frameworks_paths
def determine_cccfg
s = ""
# Fix issue with sed barfing on unicode characters on Mountain Lion
s << "s" if MacOS.version >= :mountain_lion
# Fix issue with >= 10.8 apr-1-config having broken paths
s << "a" if MacOS.version >= :mountain_lion
s << "s"
# Fix issue with >= Mountain Lion apr-1-config having broken paths
s << "a"
s
end

Expand Down Expand Up @@ -133,9 +126,9 @@ def setup_build_environment(formula = nil)
ENV["ac_have_clock_syscall"] = "no"
end

# On 10.9, the tools in /usr/bin proxy to the active developer directory.
# The tools in /usr/bin proxy to the active developer directory.
# This means we can use them for any combination of CLT and Xcode.
self["HOMEBREW_PREFER_CLT_PROXIES"] = "1" if MacOS.version >= "10.9"
self["HOMEBREW_PREFER_CLT_PROXIES"] = "1"
end

def no_weak_imports
Expand Down