diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index 41e5eb14b7..d880c76eb7 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -1,6 +1,4 @@ class BuildOptions - attr_accessor :universal - def initialize(args, options) @args = args @options = options @@ -48,7 +46,7 @@ class BuildOptions # True if the user requested a universal build. def universal? - universal || include?("universal") && option_defined?("universal") + include?("universal") && option_defined?("universal") end # True if the user requested to enable C++11 mode. diff --git a/Library/Homebrew/compat/formula.rb b/Library/Homebrew/compat/formula.rb index 9a3e950658..11f65e36d1 100644 --- a/Library/Homebrew/compat/formula.rb +++ b/Library/Homebrew/compat/formula.rb @@ -43,4 +43,8 @@ class Formula def self.factory(name) Formulary.factory(name) end + + def self.require_universal_deps + define_method(:require_universal_deps?) { true } + end end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 35b0f60a9b..2774f23ca3 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -248,6 +248,10 @@ class Formula self.class.cxxstdlib.include?(:skip) end + def require_universal_deps? + false + end + # yields self with current working directory set to the uncompressed tarball def brew validate_attributes :name, :version @@ -759,10 +763,6 @@ class Formula end end - def require_universal_deps - specs.each { |spec| spec.build.universal = true } - end - def test &block return @test unless block_given? @test_defined = true diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 98711719a0..2e7286404b 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -310,7 +310,7 @@ class FormulaInstaller def inherited_options_for(dep) inherited_options = Options.new u = Option.new("universal") - if (options.include?(u) || f.build.universal?) && !dep.build? && dep.to_formula.option_defined?(u) + if (options.include?(u) || f.require_universal_deps?) && !dep.build? && dep.to_formula.option_defined?(u) inherited_options << u end inherited_options