aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-09-21 19:27:24 -0500
committerJack Nagel2013-09-21 19:27:24 -0500
commitb8b210b91f93992eab317b07f8b8b1c37cf2648b (patch)
tree32281b169a77b556ecbd15013e1019b7783fbedf /Library
parent0af7d5611e09d88dbcec602bd523d8a72a81c57b (diff)
downloadhomebrew-b8b210b91f93992eab317b07f8b8b1c37cf2648b.tar.bz2
Allow explicitly requiring universal deps
Previously, instructing Homebrew that all dependencies should be built universal could be accomplished by redefining BuildOptions#universal? in the class body: def build.universal? true end However, the build object is no longer shared by all specs, so this is insufficient. Instead, a new DSL method, "require_universal_deps", can be used. This feature is almost exclusively for wine, which requires universal deps but does not itself have a universal option, since it is always built 32-bit.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/build_options.rb5
-rw-r--r--Library/Homebrew/formula.rb4
2 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb
index a1069694e..3bd78c864 100644
--- a/Library/Homebrew/build_options.rb
+++ b/Library/Homebrew/build_options.rb
@@ -3,9 +3,10 @@ require 'options'
# This class holds the build-time options defined for a Formula,
# and provides named access to those options during install.
class BuildOptions
- attr_accessor :args
include Enumerable
+ attr_accessor :args
+ attr_accessor :universal
attr_reader :options
protected :options
@@ -86,7 +87,7 @@ class BuildOptions
# True if the user requested a universal build.
def universal?
- args.include?('--universal') && has_option?('universal')
+ universal || args.include?('--universal') && has_option?('universal')
end
# Request a 32-bit only build.
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 35dc9a08d..90ab6e66e 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -777,6 +777,10 @@ class Formula
@cc_failures << CompilerFailure.new(compiler, &block)
end
+ def require_universal_deps
+ specs.each { |spec| spec.build.universal = true }
+ end
+
def test &block
return @test unless block_given?
@test_defined = true