From ab10ab42fa2f85f5b7abce733a02ea7a47e98683 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Mon, 25 May 2015 23:32:55 -0400 Subject: BottleSpecification: add does_not_need_relocation field Toggled with does_not_need_relocation method in bottle block. Also declare needs_relocation? accessors in software/bottle specs. --- Library/Homebrew/software_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Library') diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index f7e2ff113..8f1e14c09 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -245,6 +245,10 @@ class Bottle @spec.compatible_cellar? end + def needs_relocation? + @spec.needs_relocation? + end + def stage resource.downloader.stage end @@ -270,6 +274,7 @@ class BottleSpecification @prefix = DEFAULT_PREFIX @cellar = DEFAULT_CELLAR @collector = BottleCollector.new + @does_not_need_relocation = false end def root_url(var = nil) @@ -284,6 +289,14 @@ class BottleSpecification cellar == :any || cellar == HOMEBREW_CELLAR.to_s end + def does_not_need_relocation + @does_not_need_relocation = true + end + + def needs_relocation? + !@does_not_need_relocation + end + def tag?(tag) !!checksum_for(tag) end -- cgit v1.2.3 From dcfac4f5714c8d37e38b62b2c735b29d3805c28e Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 27 May 2015 23:05:16 -0400 Subject: add install_relocation_tools stub --- Library/Homebrew/formula_installer.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Library') diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 9ea9b31ae..ed02abb9a 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -166,6 +166,7 @@ class FormulaInstaller if pour_bottle?(:warn => true) begin + install_relocation_tools if formula.bottle.needs_relocation? pour rescue => e raise if ARGV.homebrew_developer? @@ -326,6 +327,11 @@ class FormulaInstaller @show_header = true unless deps.empty? end + def install_relocation_tools + ohai "placeholder" + true + end + class DependencyInstaller < FormulaInstaller def initialize(*) super -- cgit v1.2.3 From dcc394c3f748946eefd9b80da003cd5f1abb5fb7 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 29 May 2015 20:07:33 -0400 Subject: add cctools requirement --- Library/Homebrew/requirements/cctools_requirement.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Library/Homebrew/requirements/cctools_requirement.rb (limited to 'Library') diff --git a/Library/Homebrew/requirements/cctools_requirement.rb b/Library/Homebrew/requirements/cctools_requirement.rb new file mode 100644 index 000000000..a9f807d74 --- /dev/null +++ b/Library/Homebrew/requirements/cctools_requirement.rb @@ -0,0 +1,8 @@ +class CctoolsRequirement < Requirement + fatal true + default_formula 'cctools' + + satisfy do + MacOS::XCode.installed? || MacOS::CLT.installed? + end +end -- cgit v1.2.3 From 4d65b817ec04e8e216f6d371a6f5d691f5677dca Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 2 Jun 2015 13:07:05 -0400 Subject: Install: remove check_for_bad_install_name_tool Until it can be adapted to not call otool on systems w/o XCode/CLT --- Library/Homebrew/cmd/install.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 7091b9bfc..b2f1f195d 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -122,13 +122,15 @@ module Homebrew end def check_xcode + # TODO: reinstate check_for_bad_install_name_tool + # currently check_for_bad_install_name_tool fails because it tries to call + # the /usr/bin/otool stub program on systems without XCode/CLT checks = Checks.new %w[ check_for_unsupported_osx check_for_installed_developer_tools check_xcode_license_approved check_for_osx_gcc_installer - check_for_bad_install_name_tool ].each do |check| out = checks.send(check) opoo out unless out.nil? -- cgit v1.2.3 From b46d5de49233fde8a89891053a089f96a8749c15 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 2 Jun 2015 15:47:08 -0400 Subject: Requirements: add CctoolsRequirement Install it as a dependency unless already satisfied by Xcode. require cctools_requirement cctools_requirement should be satisfied by cctools present in opt add build_env => false to the satify block options in CctoolsRequirement --- Library/Homebrew/cmd/install.rb | 6 +++--- Library/Homebrew/formula_installer.rb | 7 +++++-- Library/Homebrew/requirements/cctools_requirement.rb | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index b2f1f195d..fa9507fb3 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -122,13 +122,13 @@ module Homebrew end def check_xcode - # TODO: reinstate check_for_bad_install_name_tool + # TODO: reinstate check_for_bad_install_name_tool and check_for_installed_developer_tools # currently check_for_bad_install_name_tool fails because it tries to call # the /usr/bin/otool stub program on systems without XCode/CLT + # check_for_installed_developer_tools doesn't fail, but produces a warning + # when one is no longer required checks = Checks.new %w[ - check_for_unsupported_osx - check_for_installed_developer_tools check_xcode_license_approved check_for_osx_gcc_installer ].each do |check| diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index ed02abb9a..8377e25f6 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -13,6 +13,7 @@ require "cmd/postinstall" require "hooks/bottles" require "debrew" require "sandbox" +require "requirements/cctools_requirement" class FormulaInstaller include FormulaCellarChecks @@ -328,8 +329,10 @@ class FormulaInstaller end def install_relocation_tools - ohai "placeholder" - true + cctools = CctoolsRequirement.new + return if cctools.satisfied? + + install_dependency(cctools.to_dependency, inherited_options_for(cctools)) end class DependencyInstaller < FormulaInstaller diff --git a/Library/Homebrew/requirements/cctools_requirement.rb b/Library/Homebrew/requirements/cctools_requirement.rb index a9f807d74..37be3207b 100644 --- a/Library/Homebrew/requirements/cctools_requirement.rb +++ b/Library/Homebrew/requirements/cctools_requirement.rb @@ -2,7 +2,7 @@ class CctoolsRequirement < Requirement fatal true default_formula 'cctools' - satisfy do - MacOS::XCode.installed? || MacOS::CLT.installed? + satisfy(:build_env => false) do + MacOS::Xcode.installed? || MacOS::CLT.installed? || Formula['cctools'].installed? end end -- cgit v1.2.3 From 8aad5230630c04c231c2d90406780deeb7a65109 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 5 Jun 2015 22:42:56 -0400 Subject: Formula_installer: only attempt relocation install once Check @@attempted for cctools so that we only attempt the relocation install once, skip cxxstdlib check in cctools to prevent otool execution prior to installation, skip fixing install names if relocation is not required --- Library/Homebrew/formula_installer.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 8377e25f6..5855297ee 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -330,9 +330,11 @@ class FormulaInstaller def install_relocation_tools cctools = CctoolsRequirement.new - return if cctools.satisfied? + dependency = cctools.to_dependency + formula = dependency.to_formula + return if cctools.satisfied? || @@attempted.include?(formula) - install_dependency(cctools.to_dependency, inherited_options_for(cctools)) + install_dependency(dependency, inherited_options_for(cctools)) end class DependencyInstaller < FormulaInstaller @@ -407,7 +409,10 @@ class FormulaInstaller keg = Keg.new(formula.prefix) link(keg) - fix_install_names(keg) + + # this needs to be changed to a test against build_bottle? and + # formula.bottle.needs_relocation? + fix_install_names(keg) unless formula.name == 'cctools' if build_bottle? && formula.post_install_defined? ohai "Not running post_install as we're building a bottle" -- cgit v1.2.3 From 85187bf6d3779692c77b5ef8a256f16b3048294a Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sat, 13 Jun 2015 20:32:04 -0400 Subject: MacOS: update locate_cctool This becomes MacOS.{install_name_tool,otool}, only do check_xcode if xcode is installed, otherwise emit a warning --- Library/Homebrew/cmd/install.rb | 7 ++++++- Library/Homebrew/keg_relocate.rb | 4 ++-- Library/Homebrew/mach.rb | 4 ++-- Library/Homebrew/os/mac.rb | 16 ++++++++++++++++ 4 files changed, 26 insertions(+), 5 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index fa9507fb3..1ef1ca61a 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -157,7 +157,12 @@ module Homebrew def perform_preinstall_checks check_ppc check_writable_install_location - check_xcode + if MacOS::Xcode.installed? + check_xcode + else + opoo "You have not installed Xcode." + puts "Bottles may install correctly, but builds will fail!" + end check_cellar end diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index eceef192f..59ff1c9d7 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -98,8 +98,8 @@ class Keg end def install_name_tool(*args) - tool = MacOS.locate("install_name_tool") - system(tool, *args) || raise(ErrorDuringExecution.new(tool, args)) + tool = MacOS.install_name_tool + system(tool, *args) || raise ErrorDuringExecution.new(tool, args) end # If file is a dylib or bundle itself, look for the dylib named by diff --git a/Library/Homebrew/mach.rb b/Library/Homebrew/mach.rb index c15399cbf..f7ca428e6 100644 --- a/Library/Homebrew/mach.rb +++ b/Library/Homebrew/mach.rb @@ -154,9 +154,9 @@ module MachO def parse_otool_L_output ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s - libs = `#{MacOS.locate("otool")} -L "$HOMEBREW_MACH_O_FILE"`.split("\n") + libs = `#{MacOS.otool} -L "$HOMEBREW_MACH_O_FILE"`.split("\n") unless $?.success? - raise ErrorDuringExecution.new(MacOS.locate("otool"), + raise ErrorDuringExecution.new(MacOS.otool, ["-L", ENV["HOMEBREW_MACH_O_FILE"]]) end diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index ffab00b00..185126548 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -36,6 +36,22 @@ module OS end end + def install_name_tool + if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/install_name_tool") + Pathname.new(path) + else + locate("install_name_tool") + end + end + + def otool + if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/otool") + Pathname.new(path) + else + locate("otool") + end + end + def active_developer_dir @active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip end -- cgit v1.2.3 From 76dcad7c82247e1c342cecda67fda11555788f0d Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 23 Jun 2015 19:21:55 -0400 Subject: Split compute_and_install_dependencies This is so so that check_dependencies_bottled can be called when bottles are being poured; implement check_dependencies_bottled --- Library/Homebrew/formula_installer.rb | 37 ++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 5855297ee..bb1ed74f7 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -147,7 +147,11 @@ class FormulaInstaller check_conflicts - compute_and_install_dependencies unless ignore_deps? + if !ignore_deps? + deps = compute_dependencies + check_dependencies_bottled(deps) if pour_bottle? + install_dependencies(deps) + end return if only_deps? @@ -217,18 +221,28 @@ class FormulaInstaller raise FormulaConflictError.new(formula, conflicts) unless conflicts.empty? end - def compute_and_install_dependencies + def compute_dependencies req_map, req_deps = expand_requirements - check_requirements(req_map) - deps = expand_dependencies(req_deps + formula.deps) - if deps.empty? && only_deps? - puts "All dependencies for #{formula.full_name} are satisfied." - else - install_dependencies(deps) + deps + end + + def check_dependencies_bottled(deps) + unbottled = [] + + unbottled = deps.select do |dep, _| + formula = dep.to_formula + !formula.pour_bottle? && !MacOS.can_build? end + + raise BuildToolsError.new(unbottled) unless unbottled.empty? + end + + def compute_and_install_dependencies + deps = compute_dependencies + install_dependencies(deps) end def check_requirements(req_map) @@ -319,12 +333,13 @@ class FormulaInstaller end def install_dependencies(deps) - if deps.length > 1 + if deps.empty? && only_deps? + puts "All dependencies for #{formula.full_name} are satisfied." + else oh1 "Installing dependencies for #{formula.full_name}: #{Tty.green}#{deps.map(&:first)*", "}#{Tty.reset}" + deps.each { |dep, options| install_dependency(dep, options) } end - deps.each { |dep, options| install_dependency(dep, options) } - @show_header = true unless deps.empty? end -- cgit v1.2.3 From 91e598cf3f88591f2146218eaa2ecc2a3a261e31 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Mon, 29 Jun 2015 14:09:57 -0400 Subject: Install: add BuildToolsError and BuildFlagsError Add these new errors, and guards in formula installation and cmd/{,un,re}install to match, move can_build? to the MacOS module, flatten conditions, remove redundant can_build? check reinstate removed (doctor) check --- Library/Homebrew/cmd/install.rb | 18 ++++--- Library/Homebrew/cmd/reinstall.rb | 8 +++ Library/Homebrew/cmd/upgrade.rb | 8 +++ Library/Homebrew/exceptions.rb | 94 +++++++++++++++++++++++++++++++++++ Library/Homebrew/extend/ARGV.rb | 13 +++++ Library/Homebrew/formula_installer.rb | 4 ++ Library/Homebrew/os/mac.rb | 4 ++ 7 files changed, 143 insertions(+), 6 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 1ef1ca61a..ce9bf5291 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -38,6 +38,14 @@ module Homebrew end end + # if the user's flags will prevent bottle only-installations when no + # developer tools are available, we need to stop them early on + if !MacOS.can_build? + bf = ARGV.collect_build_flags + + raise BuildFlagsError.new(bf) if !bf.empty? + end + ARGV.formulae.each do |f| # head-only without --HEAD is an error if !ARGV.build_head? && f.stable.nil? && f.devel.nil? @@ -129,6 +137,9 @@ module Homebrew # when one is no longer required checks = Checks.new %w[ + check_for_unsupported_osx + check_for_bad_install_name_tool + check_for_installed_developer_tools check_xcode_license_approved check_for_osx_gcc_installer ].each do |check| @@ -157,12 +168,7 @@ module Homebrew def perform_preinstall_checks check_ppc check_writable_install_location - if MacOS::Xcode.installed? - check_xcode - else - opoo "You have not installed Xcode." - puts "Bottles may install correctly, but builds will fail!" - end + check_xcode if MacOS::Xcode.installed? check_cellar end diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index bf49282ae..98941698a 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -2,6 +2,14 @@ require "formula_installer" module Homebrew def reinstall + if !MacOS.can_build? + bf = ARGV.collect_build_flags + + if !bf.empty? + raise BuildFlagsError.new(bf) + end + end + ARGV.resolved_formulae.each { |f| reinstall_formula(f) } end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 8ae231002..e8fc9c0f8 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -3,6 +3,14 @@ require "cmd/outdated" module Homebrew def upgrade + if !MacOS.can_build? + bf = ARGV.collect_build_flags + + if !bf.empty? + raise BuildFlagsError.new(bf) + end + end + Homebrew.perform_preinstall_checks if ARGV.named.empty? diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 841cc8b39..585ca7e60 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -226,6 +226,100 @@ class BuildError < RuntimeError end end +# raised by FormulaInstaller.check_dependencies_bottled and +# FormulaInstaller.install if the formula or its dependencies are not bottled +# and are being installed on a system without necessary build tools +class BuildToolsError < RuntimeError + def initialize(formulae) + if formulae.length > 1 + formula_text = "formulae" + package_text = "binary packages" + else + formula_text = "formula" + package_text = "a binary package" + end + + if MacOS.version >= "10.10" + xcode_text = <<-EOS.undent + To continue, you must install Xcode from the App Store, + or the CLT by running: + xcode-select --install + EOS + elsif MacOS.version == "10.9" + xcode_text = <<-EOS.undent + To continue, you must install Xcode from: + https://developer.apple.com/downloads/ + or the CLT by running: + xcode-select --install + EOS + elsif MacOS.version >= "10.7" + xcode_text = <<-EOS.undent + To continue, you must install Xcode or the CLT from: + https://developer.apple.com/downloads/ + EOS + else + xcode_text = <<-EOS.undent + To continue, you must install Xcode from: + https://developer.apple.com/downloads/ + EOS + end + + super <<-EOS.undent + The following #{formula_text}: + #{formulae.join(', ')} + cannot be installed as a #{package_text} and must be built from source. + #{xcode_text} + EOS + end +end + +# raised by Homebrew.install, Homebrew.reinstall, and Homebrew.upgrade +# if the user passes any flags/environment that would case a bottle-only +# installation on a system without build tools to fail +class BuildFlagsError < RuntimeError + def initialize(flags) + if flags.length > 1 + flag_text = "flags" + require_text = "require" + else + flag_text = "flag" + require_text = "requires" + end + + if MacOS.version >= "10.10" + xcode_text = <<-EOS.undent + or install Xcode from the App Store, or the CLT by running: + xcode-select --install + EOS + elsif MacOS.version == "10.9" + xcode_text = <<-EOS.undent + or install Xcode from: + https://developer.apple.com/downloads/ + or the CLT by running: + xcode-select --install + EOS + elsif MacOS.version >= "10.7" + xcode_text = <<-EOS.undent + or install Xcode or the CLT from: + https://developer.apple.com/downloads/ + EOS + else + xcode_text = <<-EOS.undent + or install Xcode from: + https://developer.apple.com/downloads/ + EOS + end + + super <<-EOS.undent + The following #{flag_text}: + #{flags.join(', ')} + #{require_text} building tools, but none are installed. + Either remove the #{flag_text} to attempt bottle installation, + #{xcode_text} + EOS + end +end + # raised by CompilerSelector if the formula fails with all of # the compilers available on the user's system class CompilerSelectionError < RuntimeError diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index a8eb9a5d2..706b62568 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -200,6 +200,19 @@ module HomebrewArgvExtension value "env" end + # collect any supplied build flags into an array for reporting + def collect_build_flags + build_flags = [] + + build_flags << '--HEAD' if build_head? + build_flags << '--universal' if build_universal? + build_flags << '--32-bit' if build_32_bit? + build_flags << '--build-bottle' if build_bottle? + build_flags << '--build-from-source' if build_from_source? + + build_flags + end + private def spec(default = :stable) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index bb1ed74f7..45bbd60d1 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -147,6 +147,10 @@ class FormulaInstaller check_conflicts + if !pour_bottle? && !MacOS.can_build? + raise BuildToolsError.new([formula]) + end + if !ignore_deps? deps = compute_dependencies check_dependencies_bottled(deps) if pour_bottle? diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 185126548..4e69a6035 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -52,6 +52,10 @@ module OS end end + def can_build? + Xcode.installed? || CLT.installed? + end + def active_developer_dir @active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip end -- cgit v1.2.3 From f58506ea6f7000e7e6d3f6538dc5ff2c43ea7926 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 23 Jul 2015 00:34:57 -0400 Subject: FormulaInstaller: add prevent_build_flags to eliminate code repetition remove unneeded definition change variable in FormulaInstaller.check_build_flags from bf to build_flags --- Library/Homebrew/cmd/install.rb | 6 +----- Library/Homebrew/cmd/reinstall.rb | 8 +------- Library/Homebrew/cmd/upgrade.rb | 8 +------- Library/Homebrew/formula_installer.rb | 9 +++++++-- 4 files changed, 10 insertions(+), 21 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index ce9bf5291..f41450be1 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -40,11 +40,7 @@ module Homebrew # if the user's flags will prevent bottle only-installations when no # developer tools are available, we need to stop them early on - if !MacOS.can_build? - bf = ARGV.collect_build_flags - - raise BuildFlagsError.new(bf) if !bf.empty? - end + FormulaInstaller.prevent_build_flags unless MacOS.can_build? ARGV.formulae.each do |f| # head-only without --HEAD is an error diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 98941698a..4de1ad9c2 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -2,13 +2,7 @@ require "formula_installer" module Homebrew def reinstall - if !MacOS.can_build? - bf = ARGV.collect_build_flags - - if !bf.empty? - raise BuildFlagsError.new(bf) - end - end + FormulaInstaller.prevent_build_flags unless MacOS.can_build? ARGV.resolved_formulae.each { |f| reinstall_formula(f) } end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index e8fc9c0f8..9bb5d46ad 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -3,13 +3,7 @@ require "cmd/outdated" module Homebrew def upgrade - if !MacOS.can_build? - bf = ARGV.collect_build_flags - - if !bf.empty? - raise BuildFlagsError.new(bf) - end - end + FormulaInstaller.prevent_build_flags unless MacOS.can_build? Homebrew.perform_preinstall_checks diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 45bbd60d1..cb2b4923b 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -56,6 +56,13 @@ class FormulaInstaller @pour_failed = false end + # called by install/reinstall/upgrade when no build tools are available + def self.prevent_build_flags + build_flags = ARGV.collect_build_flags + + raise BuildFlagsError.new(build_flags) unless build_flags.empty? + end + def pour_bottle?(install_bottle_options = { :warn=>false }) return true if Homebrew::Hooks::Bottles.formula_has_bottle?(formula) @@ -234,8 +241,6 @@ class FormulaInstaller end def check_dependencies_bottled(deps) - unbottled = [] - unbottled = deps.select do |dep, _| formula = dep.to_formula !formula.pour_bottle? && !MacOS.can_build? -- cgit v1.2.3 From 1face808f5f1dc43c887cab421b5c01f7e20fdf7 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sun, 26 Jul 2015 16:49:16 -0400 Subject: Add guards to calls that would trigger Xcode install requests add guard in Formula#file_modified? to prevent git popup add guard in Superenv.bin before calling MacOS::Xcode.version add guard against missing Xcode/CLT in Xcode.uncached_version return nil instread of 0 in uncached_version when Xcode/CLT are not present, to distinguish from linuxbrew behavior checks against pour_bottle? and needs_relocation?, add guard around keg.relocate_install_names to check pour_bottle?/needs_relocation? as well needs_relocation? becomes skip_relocation?, use cellar attr to indicate relocation instead of does_not_need_relocation MacOS.can_build? becomes MacOS.has_apple_developer_tools? --- Library/Homebrew/cmd/config.rb | 10 +++++----- Library/Homebrew/cmd/install.rb | 7 +------ Library/Homebrew/cmd/reinstall.rb | 2 +- Library/Homebrew/cmd/upgrade.rb | 2 +- Library/Homebrew/extend/ENV/std.rb | 2 +- Library/Homebrew/extend/ENV/super.rb | 2 ++ Library/Homebrew/formula.rb | 6 +++++- Library/Homebrew/formula_installer.rb | 16 ++++++++-------- Library/Homebrew/keg_relocate.rb | 2 +- Library/Homebrew/os/mac.rb | 2 +- Library/Homebrew/os/mac/xcode.rb | 2 ++ Library/Homebrew/software_spec.rb | 15 +++++---------- 12 files changed, 33 insertions(+), 35 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb index 7627d6e97..74b4f436e 100644 --- a/Library/Homebrew/cmd/config.rb +++ b/Library/Homebrew/cmd/config.rb @@ -7,23 +7,23 @@ module Homebrew end def llvm - @llvm ||= MacOS.llvm_build_version + @llvm ||= MacOS.llvm_build_version if MacOS.has_apple_developer_tools? end def gcc_42 - @gcc_42 ||= MacOS.gcc_42_build_version + @gcc_42 ||= MacOS.gcc_42_build_version if MacOS.has_apple_developer_tools? end def gcc_40 - @gcc_40 ||= MacOS.gcc_40_build_version + @gcc_40 ||= MacOS.gcc_40_build_version if MacOS.has_apple_developer_tools? end def clang - @clang ||= MacOS.clang_version + @clang ||= MacOS.clang_version if MacOS.has_apple_developer_tools? end def clang_build - @clang_build ||= MacOS.clang_build_version + @clang_build ||= MacOS.clang_build_version if MacOS.has_apple_developer_tools? end def xcode diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index f41450be1..41628b435 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -40,7 +40,7 @@ module Homebrew # if the user's flags will prevent bottle only-installations when no # developer tools are available, we need to stop them early on - FormulaInstaller.prevent_build_flags unless MacOS.can_build? + FormulaInstaller.prevent_build_flags unless MacOS.has_apple_developer_tools? ARGV.formulae.each do |f| # head-only without --HEAD is an error @@ -126,11 +126,6 @@ module Homebrew end def check_xcode - # TODO: reinstate check_for_bad_install_name_tool and check_for_installed_developer_tools - # currently check_for_bad_install_name_tool fails because it tries to call - # the /usr/bin/otool stub program on systems without XCode/CLT - # check_for_installed_developer_tools doesn't fail, but produces a warning - # when one is no longer required checks = Checks.new %w[ check_for_unsupported_osx diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 4de1ad9c2..3c6f9ac20 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -2,7 +2,7 @@ require "formula_installer" module Homebrew def reinstall - FormulaInstaller.prevent_build_flags unless MacOS.can_build? + FormulaInstaller.prevent_build_flags unless MacOS.has_apple_developer_tools? ARGV.resolved_formulae.each { |f| reinstall_formula(f) } end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 9bb5d46ad..fb122a659 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -3,7 +3,7 @@ require "cmd/outdated" module Homebrew def upgrade - FormulaInstaller.prevent_build_flags unless MacOS.can_build? + FormulaInstaller.prevent_build_flags unless MacOS.has_apple_developer_tools? Homebrew.perform_preinstall_checks diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 6798e6cd3..d05ccf1a3 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -29,7 +29,7 @@ module Stdenv self["PKG_CONFIG_LIBDIR"] = determine_pkg_config_libdir # make any aclocal stuff installed in Homebrew available - self["ACLOCAL_PATH"] = "#{HOMEBREW_PREFIX}/share/aclocal" if MacOS::Xcode.provides_autotools? + self["ACLOCAL_PATH"] = "#{HOMEBREW_PREFIX}/share/aclocal" if MacOS.has_apple_developer_tools? && MacOS::Xcode.provides_autotools? self["MAKEFLAGS"] = "-j#{make_jobs}" diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index 911602919..bcfcd2f0f 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -23,6 +23,8 @@ module Superenv end def self.bin + return unless MacOS.has_apple_developer_tools? + bin = (HOMEBREW_REPOSITORY/"Library/ENV").subdirs.reject { |d| d.basename.to_s > MacOS::Xcode.version }.max bin.realpath unless bin.nil? end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 87746eada..915db64bb 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -720,7 +720,11 @@ class Formula end def file_modified? - return false unless which("git") + git_dir = MacOS.locate("git").dirname.to_s + + # /usr/bin/git is a popup stub when Xcode/CLT aren't installed, so bail out + return false if git_dir == "/usr/bin" && !MacOS.has_apple_developer_tools? + path.parent.cd do diff = Utils.popen_read("git", "diff", "origin/master", "--", "#{path}") !diff.empty? && $?.exitstatus == 0 diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index cb2b4923b..99d6c786a 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -154,7 +154,7 @@ class FormulaInstaller check_conflicts - if !pour_bottle? && !MacOS.can_build? + if !pour_bottle? && !MacOS.has_apple_developer_tools? raise BuildToolsError.new([formula]) end @@ -182,7 +182,7 @@ class FormulaInstaller if pour_bottle?(:warn => true) begin - install_relocation_tools if formula.bottle.needs_relocation? + install_relocation_tools unless formula.bottle.skip_relocation? pour rescue => e raise if ARGV.homebrew_developer? @@ -243,7 +243,7 @@ class FormulaInstaller def check_dependencies_bottled(deps) unbottled = deps.select do |dep, _| formula = dep.to_formula - !formula.pour_bottle? && !MacOS.can_build? + !formula.pour_bottle? && !MacOS.has_apple_developer_tools? end raise BuildToolsError.new(unbottled) unless unbottled.empty? @@ -434,9 +434,7 @@ class FormulaInstaller keg = Keg.new(formula.prefix) link(keg) - # this needs to be changed to a test against build_bottle? and - # formula.bottle.needs_relocation? - fix_install_names(keg) unless formula.name == 'cctools' + fix_install_names(keg) unless @poured_bottle && formula.bottle.skip_relocation? if build_bottle? && formula.post_install_defined? ohai "Not running post_install as we're building a bottle" @@ -668,8 +666,10 @@ class FormulaInstaller end keg = Keg.new(formula.prefix) - keg.relocate_install_names Keg::PREFIX_PLACEHOLDER, HOMEBREW_PREFIX.to_s, - Keg::CELLAR_PLACEHOLDER, HOMEBREW_CELLAR.to_s, :keg_only => formula.keg_only? + unless formula.bottle.skip_relocation? + keg.relocate_install_names Keg::PREFIX_PLACEHOLDER, HOMEBREW_PREFIX.to_s, + Keg::CELLAR_PLACEHOLDER, HOMEBREW_CELLAR.to_s, :keg_only => formula.keg_only? + end Pathname.glob("#{formula.bottle_prefix}/{etc,var}/**/*") do |path| path.extend(InstallRenamed) diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 59ff1c9d7..05d19db4d 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -99,7 +99,7 @@ class Keg def install_name_tool(*args) tool = MacOS.install_name_tool - system(tool, *args) || raise ErrorDuringExecution.new(tool, args) + system(tool, *args) or raise ErrorDuringExecution.new(tool, args) end # If file is a dylib or bundle itself, look for the dylib named by diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 4e69a6035..814ef70a2 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -52,7 +52,7 @@ module OS end end - def can_build? + def has_apple_developer_tools? Xcode.installed? || CLT.installed? end diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 83ba84ff8..40446a8ad 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -76,6 +76,8 @@ module OS return "0" unless OS.mac? + return nil if !MacOS::Xcode.installed? && !MacOS::CLT.installed? + %W[#{prefix}/usr/bin/xcodebuild #{which("xcodebuild")}].uniq.each do |path| if File.file? path Utils.popen_read(path, "-version") =~ /Xcode (\d(\.\d)*)/ diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 8f1e14c09..edc5f7645 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -245,8 +245,8 @@ class Bottle @spec.compatible_cellar? end - def needs_relocation? - @spec.needs_relocation? + def skip_relocation? + @spec.skip_relocation? end def stage @@ -274,7 +274,6 @@ class BottleSpecification @prefix = DEFAULT_PREFIX @cellar = DEFAULT_CELLAR @collector = BottleCollector.new - @does_not_need_relocation = false end def root_url(var = nil) @@ -286,15 +285,11 @@ class BottleSpecification end def compatible_cellar? - cellar == :any || cellar == HOMEBREW_CELLAR.to_s + cellar == :any || cellar == :any_skip_relocation || cellar == HOMEBREW_CELLAR.to_s end - def does_not_need_relocation - @does_not_need_relocation = true - end - - def needs_relocation? - !@does_not_need_relocation + def skip_relocation? + cellar == :any_skip_relocation end def tag?(tag) -- cgit v1.2.3 From 8793a68ee422a2cee7035c1d564fbd81d0c72dc4 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 12 Aug 2015 14:57:54 -0400 Subject: Add no-Xcode documentation for all classes, methods --- Library/Homebrew/extend/ARGV.rb | 3 ++- Library/Homebrew/formula_installer.rb | 13 ++++++++++++- Library/Homebrew/os/mac.rb | 7 +++++++ Library/Homebrew/requirements/cctools_requirement.rb | 5 +++++ Library/Homebrew/software_spec.rb | 2 ++ 5 files changed, 28 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 706b62568..3e464bd06 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -200,7 +200,8 @@ module HomebrewArgvExtension value "env" end - # collect any supplied build flags into an array for reporting + # If the user passes any flags that trigger building over installing from + # a bottle, they are collected here and returned as an Array for checking. def collect_build_flags build_flags = [] diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 99d6c786a..7bed505b7 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -56,7 +56,9 @@ class FormulaInstaller @pour_failed = false end - # called by install/reinstall/upgrade when no build tools are available + # When no build tools are available and build flags are passed through ARGV, + # it's necessary to interrupt the user before any sort of installation + # can proceed. Only invoked when the user has no developer tools. def self.prevent_build_flags build_flags = ARGV.collect_build_flags @@ -232,6 +234,8 @@ class FormulaInstaller raise FormulaConflictError.new(formula, conflicts) unless conflicts.empty? end + # Compute and collect the dependencies needed by the formula currently + # being installed. def compute_dependencies req_map, req_deps = expand_requirements check_requirements(req_map) @@ -240,6 +244,9 @@ class FormulaInstaller deps end + # Check that each dependency in deps has a bottle available, terminating + # abnormally with a BuildToolsError if one or more don't. + # Only invoked when the user has no developer tools. def check_dependencies_bottled(deps) unbottled = deps.select do |dep, _| formula = dep.to_formula @@ -352,6 +359,10 @@ class FormulaInstaller @show_header = true unless deps.empty? end + # Installs the relocation tools (as provided by the cctools formula) as a hard + # dependency for every formula installed from a bottle when the user has no + # developer tools. Invoked unless the formula explicitly sets + # :any_skip_relocation in its bottle DSL. def install_relocation_tools cctools = CctoolsRequirement.new dependency = cctools.to_dependency diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 814ef70a2..c2c909d76 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -36,6 +36,8 @@ module OS end end + # Locates a (working) copy of install_name_tool, guaranteed to function + # whether the user has developer tools installed or not. def install_name_tool if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/install_name_tool") Pathname.new(path) @@ -44,6 +46,8 @@ module OS end end + # Locates a (working) copy of otool, guaranteed to function whether the user + # has developer tools installed or not. def otool if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/otool") Pathname.new(path) @@ -52,6 +56,9 @@ module OS end end + # Checks if the user has any developer tools installed, either via Xcode + # or the CLT. Convenient for guarding against formula builds when building + # is impossible. def has_apple_developer_tools? Xcode.installed? || CLT.installed? end diff --git a/Library/Homebrew/requirements/cctools_requirement.rb b/Library/Homebrew/requirements/cctools_requirement.rb index 37be3207b..ab7f8cb59 100644 --- a/Library/Homebrew/requirements/cctools_requirement.rb +++ b/Library/Homebrew/requirements/cctools_requirement.rb @@ -1,3 +1,8 @@ +# Represents a general requirement for utilities normally installed by Xcode, +# the CLT, or provided by the cctools formula. In particular, this requirement +# allows Homebrew to pull in the cctools formula and use its utilities to +# perform relocation operations on systems that do not have either Xcode or the +# CLT installed (but still want to install bottled formulae). class CctoolsRequirement < Requirement fatal true default_formula 'cctools' diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index edc5f7645..e8148322e 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -245,6 +245,7 @@ class Bottle @spec.compatible_cellar? end + # Does the bottle need to be relocated? def skip_relocation? @spec.skip_relocation? end @@ -288,6 +289,7 @@ class BottleSpecification cellar == :any || cellar == :any_skip_relocation || cellar == HOMEBREW_CELLAR.to_s end + # Does the Bottle this BottleSpecification belongs to need to be relocated? def skip_relocation? cellar == :any_skip_relocation end -- cgit v1.2.3 From f108d204f7e43cfd7db5c109f961a89f79efc289 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 14 Aug 2015 14:21:39 -0400 Subject: Add tests for pouring bottle without Xcode add testball_bottle formula for upcoming bottle unit testing, as well as bottles directory containing test bottle (and symlinks) --- .../testball_bottle-0.1.mavericks.bottle.tar.gz | 1 + ...testball_bottle-0.1.mountain_lion.bottle.tar.gz | 1 + .../testball_bottle-0.1.yosemite.bottle.tar.gz | Bin 0 -> 1379 bytes .../Homebrew/test/test_formula_installer_bottle.rb | 78 +++++++++++++++++++++ Library/Homebrew/test/testball_bottle.rb | 17 +++++ 5 files changed, 97 insertions(+) create mode 120000 Library/Homebrew/test/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz create mode 120000 Library/Homebrew/test/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz create mode 100644 Library/Homebrew/test/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz create mode 100644 Library/Homebrew/test/test_formula_installer_bottle.rb create mode 100644 Library/Homebrew/test/testball_bottle.rb (limited to 'Library') diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz b/Library/Homebrew/test/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz new file mode 120000 index 000000000..3e989830b --- /dev/null +++ b/Library/Homebrew/test/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz @@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz b/Library/Homebrew/test/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz new file mode 120000 index 000000000..3e989830b --- /dev/null +++ b/Library/Homebrew/test/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz @@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz b/Library/Homebrew/test/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz new file mode 100644 index 000000000..d88838a94 Binary files /dev/null and b/Library/Homebrew/test/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz differ diff --git a/Library/Homebrew/test/test_formula_installer_bottle.rb b/Library/Homebrew/test/test_formula_installer_bottle.rb new file mode 100644 index 000000000..4d2d1676f --- /dev/null +++ b/Library/Homebrew/test/test_formula_installer_bottle.rb @@ -0,0 +1,78 @@ +require "testing_env" +require "formula" +require "compat/formula_specialties" +require "formula_installer" +require "keg" +require "testball_bottle" +require "testball" + +class InstallBottleTests < Homebrew::TestCase + def temporary_bottle_install(formula) + refute_predicate formula, :installed? + assert_predicate formula, :bottled? + assert_predicate formula, :pour_bottle? + + installer = FormulaInstaller.new(formula) + + shutup { installer.install } + + keg = Keg.new(formula.prefix) + + assert_predicate formula, :installed? + + begin + yield formula + ensure + keg.unlink + keg.uninstall + formula.clear_cache + Dir["#{HOMEBREW_CACHE}/testball_bottle*"].each { |f| File.delete(f) } + # there will be log files when sandbox is enable. + formula.logs.rmtree if formula.logs.directory? + end + + refute_predicate keg, :exist? + refute_predicate formula, :installed? + end + + def test_a_basic_bottle_install + MacOS.stubs(:has_apple_developer_tools?).returns(false) + + temporary_bottle_install(TestballBottle.new) do |f| + # Copied directly from test_formula_installer.rb as we expect + # the same behavior + + # Test that things made it into the Keg + assert_predicate f.bin, :directory? + + assert_predicate f.libexec, :directory? + + refute_predicate f.prefix+"main.c", :exist? + + # Test that things make it into the Cellar + keg = Keg.new f.prefix + keg.link + + bin = HOMEBREW_PREFIX+"bin" + assert_predicate bin, :directory? + end + end + + def test_build_tools_error + MacOS.stubs(:has_apple_developer_tools?).returns(false) + + # Testball doesn't have a bottle block, so use it to test this behavior + formula = Testball.new + + refute_predicate formula, :installed? + refute_predicate formula, :bottled? + + installer = FormulaInstaller.new(formula) + + assert_raises(BuildToolsError) do + installer.install + end + + refute_predicate formula, :installed? + end +end diff --git a/Library/Homebrew/test/testball_bottle.rb b/Library/Homebrew/test/testball_bottle.rb new file mode 100644 index 000000000..27ffd972a --- /dev/null +++ b/Library/Homebrew/test/testball_bottle.rb @@ -0,0 +1,17 @@ +class TestballBottle < Formula + def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable) + self.class.instance_eval do + stable.url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz" + stable.sha256 "1dfb13ce0f6143fe675b525fc9e168adb2215c5d5965c9f57306bb993170914f" + stable.bottle do + cellar :any_skip_relocation + root_url "file://#{File.expand_path("..", __FILE__)}/bottles" + sha256 "9abc8ce779067e26556002c4ca6b9427b9874d25f0cafa7028e05b5c5c410cb4" => :yosemite + sha256 "9abc8ce779067e26556002c4ca6b9427b9874d25f0cafa7028e05b5c5c410cb4" => :mavericks + sha256 "9abc8ce779067e26556002c4ca6b9427b9874d25f0cafa7028e05b5c5c410cb4" => :mountain_lion + end + cxxstdlib_check :skip + end + super + end +end -- cgit v1.2.3 From 56795ec1ed4f32d770afb50f65fc7e4e007e42f9 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sun, 16 Aug 2015 23:41:28 -0400 Subject: Call check_xcode check for CLT, too --- Library/Homebrew/cmd/install.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 41628b435..28db34daf 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -159,7 +159,7 @@ module Homebrew def perform_preinstall_checks check_ppc check_writable_install_location - check_xcode if MacOS::Xcode.installed? + check_xcode if MacOS.has_apple_developer_tools? check_cellar end -- cgit v1.2.3 From 12b25f59cc1532690e8069efaadf35b0384dade3 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Mon, 17 Aug 2015 00:39:25 -0400 Subject: Only print dep installation notice when deps will be installed --- Library/Homebrew/formula_installer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 7bed505b7..1198e3f06 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -352,7 +352,7 @@ class FormulaInstaller if deps.empty? && only_deps? puts "All dependencies for #{formula.full_name} are satisfied." else - oh1 "Installing dependencies for #{formula.full_name}: #{Tty.green}#{deps.map(&:first)*", "}#{Tty.reset}" + oh1 "Installing dependencies for #{formula.full_name}: #{Tty.green}#{deps.map(&:first)*", "}#{Tty.reset}" unless deps.empty? deps.each { |dep, options| install_dependency(dep, options) } end -- cgit v1.2.3 From 04a0b2aafe2062701be4028f408d0bee15f3815d Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 20 Aug 2015 16:34:39 -0400 Subject: Mark TODO in brew doctor (future PR) --- Library/Homebrew/cmd/doctor.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'Library') diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 2a7c7abb1..102c9c2ea 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -257,6 +257,7 @@ class Checks end end + # TODO: distill down into single method definition a la BuildToolsError if MacOS.version >= "10.9" def check_for_installed_developer_tools unless MacOS::Xcode.installed? || MacOS::CLT.installed? then <<-EOS.undent -- cgit v1.2.3