aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/ARGV.rb4
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb2
-rw-r--r--Library/Homebrew/extend/ENV/std.rb15
-rw-r--r--Library/Homebrew/extend/ENV/super.rb22
-rw-r--r--Library/Homebrew/extend/fileutils.rb2
-rw-r--r--Library/Homebrew/extend/os/linux/hardware/cpu.rb2
-rw-r--r--Library/Homebrew/extend/os/mac/development_tools.rb11
-rw-r--r--Library/Homebrew/extend/os/mac/extend/ENV/super.rb7
-rw-r--r--Library/Homebrew/extend/os/mac/formula_cellar_checks.rb2
-rw-r--r--Library/Homebrew/extend/os/mac/keg_relocate.rb4
-rw-r--r--Library/Homebrew/extend/os/mac/utils/bottles.rb2
-rw-r--r--Library/Homebrew/extend/pathname.rb12
12 files changed, 34 insertions, 51 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb
index d361a99a8..767ddc6e3 100644
--- a/Library/Homebrew/extend/ARGV.rb
+++ b/Library/Homebrew/extend/ARGV.rb
@@ -44,7 +44,7 @@ module HomebrewArgvExtension
else
Formulary.find_with_priority(name, spec)
end
- end
+ end.uniq(&:name)
end
def resolved_formulae
@@ -79,7 +79,7 @@ module HomebrewArgvExtension
f.follow_installed_alias = false
f
- end
+ end.uniq(&:name)
end
def casks
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index a93c1ee1f..7b468574a 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -17,7 +17,7 @@ module SharedEnvExtension
FC_FLAG_VARS = %w[FCFLAGS FFLAGS].freeze
# @private
SANITIZED_VARS = %w[
- CDPATH GREP_OPTIONS CLICOLOR_FORCE
+ CDPATH CLICOLOR_FORCE
CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH
CC CXX OBJC OBJCXX CPP MAKE LD LDSHARED
CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS
diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb
index 14f9b81b8..403ea1978 100644
--- a/Library/Homebrew/extend/ENV/std.rb
+++ b/Library/Homebrew/extend/ENV/std.rb
@@ -82,10 +82,6 @@ module Stdenv
old
end
- alias j1 deparallelize
-
- # These methods are no-ops for compatibility.
- %w[fast O4 Og].each { |opt| define_method(opt) {} }
%w[O3 O2 O1 O0 Os].each do |opt|
define_method opt do
@@ -110,13 +106,11 @@ module Stdenv
super
set_cpu_cflags "-march=nocona -mssse3"
end
- alias gcc_4_0_1 gcc_4_0
- def gcc
+ def gcc_4_2
super
set_cpu_cflags
end
- alias gcc_4_2 gcc
GNU_GCC_VERSIONS.each do |n|
define_method(:"gcc-#{n}") do
@@ -144,13 +138,6 @@ module Stdenv
end
alias generic_no_optimization no_optimization
- def libxml2
- end
-
- def x11
- end
- alias libpng x11
-
# we've seen some packages fail to build when warnings are disabled!
def enable_warnings
remove_from_cflags "-w"
diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb
index a75cba406..39ddb6681 100644
--- a/Library/Homebrew/extend/ENV/super.rb
+++ b/Library/Homebrew/extend/ENV/super.rb
@@ -16,9 +16,7 @@ module Superenv
# @private
attr_accessor :keg_only_deps, :deps
-
attr_accessor :x11
- alias x11? x11
def self.extended(base)
base.keg_only_deps = []
@@ -263,7 +261,6 @@ module Superenv
old
end
- alias j1 deparallelize
def make_jobs
self["MAKEFLAGS"] =~ /-\w*j(\d+)/
@@ -329,23 +326,10 @@ module Superenv
def set_x11_env_if_installed
end
+ # This method does nothing in superenv since there's no custom CFLAGS API
# @private
- def noop(*_args); end
-
- # These methods are no longer necessary under superenv, but are needed to
- # maintain an interface compatible with stdenv.
- alias fast noop
- alias O4 noop
- alias Og noop
- alias libxml2 noop
- alias set_cpu_flags noop
-
- # These methods provide functionality that has not yet been ported to
- # superenv.
- alias gcc_4_0_1 noop
- alias minimal_optimization noop
- alias no_optimization noop
- alias enable_warnings noop
+ def set_cpu_flags(*_args)
+ end
end
class Array
diff --git a/Library/Homebrew/extend/fileutils.rb b/Library/Homebrew/extend/fileutils.rb
index 4f20d36a3..287a1408f 100644
--- a/Library/Homebrew/extend/fileutils.rb
+++ b/Library/Homebrew/extend/fileutils.rb
@@ -3,7 +3,7 @@ require "tmpdir"
require "etc"
# Homebrew extends Ruby's `FileUtils` to make our code more readable.
-# @see http://ruby-doc.org/stdlib-1.8.7/libdoc/fileutils/rdoc/FileUtils.html Ruby's FileUtils API
+# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/fileutils/rdoc/FileUtils.html Ruby's FileUtils API
module FileUtils
# Create a temporary directory then yield. When the block returns,
# recursively delete the temporary directory. Passing opts[:retain]
diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb
index 2472c60ed..9d779f789 100644
--- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb
+++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb
@@ -47,6 +47,8 @@ module Hardware
:haswell
when 0x3d, 0x47, 0x4f, 0x56
:broadwell
+ when 0x8e
+ :kabylake
else
cpu_family_model
end
diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb
index 7c97b9d69..1bb12a3d1 100644
--- a/Library/Homebrew/extend/os/mac/development_tools.rb
+++ b/Library/Homebrew/extend/os/mac/development_tools.rb
@@ -64,21 +64,22 @@ class DevelopmentTools
case default_cc
# if GCC 4.2 is installed, e.g. via Tigerbrew, prefer it
# over the system's GCC 4.0
- when /^gcc-4\.0/ then gcc_42_build_version ? :gcc : :gcc_4_0
- when /^gcc/ then :gcc
+ when /^gcc-4\.0/ then gcc_4_2_build_version ? :gcc_4_2 : :gcc_4_0
+ when /^gcc/ then :gcc_4_2
when "clang" then :clang
else
# guess :(
if MacOS::Xcode.version >= "4.3"
:clang
else
- :gcc
+ :gcc_4_2
end
end
end
- def tar_supports_xz?
- false
+ def curl_handles_most_https_homepages?
+ # The system Curl is too old for some modern HTTPS homepages on Yosemite.
+ MacOS.version >= :el_capitan
end
end
end
diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb
index 5f4a3e4aa..f97a2dbbb 100644
--- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb
+++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb
@@ -1,4 +1,6 @@
module Superenv
+ alias x11? x11
+
# @private
def self.bin
return unless DevelopmentTools.installed?
@@ -120,9 +122,4 @@ module Superenv
def no_weak_imports
append "HOMEBREW_CCCFG", "w" if no_weak_imports_support?
end
-
- # These methods are no longer necessary under superenv, but are needed to
- # maintain an interface compatible with stdenv.
- alias macosxsdk noop
- alias remove_macosxsdk noop
end
diff --git a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
index 8bc42ad35..5b1c648bf 100644
--- a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
+++ b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
@@ -6,6 +6,8 @@ module FormulaCellarChecks
formula.name.start_with?(formula_name)
end
+ return if formula.name =~ /^php\d+$/
+
return if MacOS.version < :mavericks && formula.name.start_with?("postgresql")
return if MacOS.version < :yosemite && formula.name.start_with?("memcached")
diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb
index 8f73daba5..f44a97b31 100644
--- a/Library/Homebrew/extend/os/mac/keg_relocate.rb
+++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb
@@ -6,7 +6,9 @@ class Keg
each_install_name_for(file) do |bad_name|
# Don't fix absolute paths unless they are rooted in the build directory
- next if bad_name.start_with?("/") && !bad_name.start_with?(HOMEBREW_TEMP.to_s)
+ next if bad_name.start_with?("/") &&
+ !bad_name.start_with?(HOMEBREW_TEMP.to_s) &&
+ !bad_name.start_with?(HOMEBREW_TEMP.realpath.to_s)
new_name = fixed_name(file, bad_name)
change_install_name(bad_name, new_name, file) unless new_name == bad_name
diff --git a/Library/Homebrew/extend/os/mac/utils/bottles.rb b/Library/Homebrew/extend/os/mac/utils/bottles.rb
index 18312c9fa..c54e4e5b7 100644
--- a/Library/Homebrew/extend/os/mac/utils/bottles.rb
+++ b/Library/Homebrew/extend/os/mac/utils/bottles.rb
@@ -49,6 +49,8 @@ module Utils
if key.to_s.end_with?("_or_later")
later_tag = key.to_s[/(\w+)_or_later$/, 1].to_sym
MacOS::Version.from_symbol(later_tag) <= tag_version
+ elsif ARGV.force_bottle?
+ true
end
end
end
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 976ea7dd8..cfb028704 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -26,11 +26,17 @@ module DiskUsageExtension
private
def compute_disk_usage
- if directory?
+ path = if symlink?
+ resolved_path
+ else
+ self
+ end
+
+ if path.directory?
scanned_files = Set.new
@file_count = 0
@disk_usage = 0
- find do |f|
+ path.find do |f|
if f.directory?
@disk_usage += f.lstat.size
else
@@ -47,7 +53,7 @@ module DiskUsageExtension
end
else
@file_count = 1
- @disk_usage = lstat.size
+ @disk_usage = path.lstat.size
end
end
end