Requirement: add modify_build_environment method

Rather than doing type introspection in build.rb, just define a method
to perform the necessary environment setup for Requirements.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-07-09 11:33:43 -05:00
parent 4dde88b6d3
commit 5a62582b39
2 changed files with 6 additions and 1 deletions

View File

@ -56,7 +56,7 @@ at_exit do
end
def install f
ENV.x11 if f.external_deps.any? { |dep| dep.is_a? X11Dependency }
f.external_deps.each { |dep| dep.modify_build_environment }
f.recursive_deps.uniq.each do |dep|
dep = Formula.factory dep

View File

@ -118,6 +118,7 @@ class Requirement
def satisfied?; false; end
def fatal?; false; end
def message; ""; end
def modify_build_environment; nil end
end
@ -188,4 +189,8 @@ class X11Dependency < Requirement
EOS
end
def modify_build_environment
ENV.x11
end
end