diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index b69055e1e7..0aa8099345 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -36,13 +36,6 @@ class Build end end - def pre_superenv_hacks - # Allow a formula to opt-in to the std environment. - if (formula.env.std? || deps.any? { |d| d.name == "scons" }) && ARGV.env != "super" - ARGV.unshift "--env=std" - end - end - def effective_build_options_for(dependent) args = dependent.build.used_options args |= Tab.for_formula(dependent).used_options @@ -83,7 +76,6 @@ class Build fixopt(dep) unless dep.opt_prefix.directory? end - pre_superenv_hacks ENV.activate_extensions! if superenv? diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index efd15d47db..3113810af2 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -435,7 +435,12 @@ class FormulaInstaller args << "--verbose" if verbose? args << "--debug" if debug? args << "--cc=#{ARGV.cc}" if ARGV.cc - args << "--env=#{ARGV.env}" if ARGV.env + + if ARGV.env + args << "--env=#{ARGV.env}" + elsif formula.env.std? || formula.recursive_dependencies.any? { |d| d.name == "scons" } + args << "--env=std" + end if formula.head? args << "--HEAD"