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.
This commit is contained in:
parent
5511a8b3f5
commit
7531dfc219
@ -3,9 +3,10 @@ require 'options'
|
|||||||
# This class holds the build-time options defined for a Formula,
|
# This class holds the build-time options defined for a Formula,
|
||||||
# and provides named access to those options during install.
|
# and provides named access to those options during install.
|
||||||
class BuildOptions
|
class BuildOptions
|
||||||
attr_accessor :args
|
|
||||||
include Enumerable
|
include Enumerable
|
||||||
|
|
||||||
|
attr_accessor :args
|
||||||
|
attr_accessor :universal
|
||||||
attr_reader :options
|
attr_reader :options
|
||||||
protected :options
|
protected :options
|
||||||
|
|
||||||
@ -86,7 +87,7 @@ class BuildOptions
|
|||||||
|
|
||||||
# True if the user requested a universal build.
|
# True if the user requested a universal build.
|
||||||
def universal?
|
def universal?
|
||||||
args.include?('--universal') && has_option?('universal')
|
universal || args.include?('--universal') && has_option?('universal')
|
||||||
end
|
end
|
||||||
|
|
||||||
# Request a 32-bit only build.
|
# Request a 32-bit only build.
|
||||||
|
@ -777,6 +777,10 @@ class Formula
|
|||||||
@cc_failures << CompilerFailure.new(compiler, &block)
|
@cc_failures << CompilerFailure.new(compiler, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def require_universal_deps
|
||||||
|
specs.each { |spec| spec.build.universal = true }
|
||||||
|
end
|
||||||
|
|
||||||
def test &block
|
def test &block
|
||||||
return @test unless block_given?
|
return @test unless block_given?
|
||||||
@test_defined = true
|
@test_defined = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user