aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-01-23 00:26:30 -0600
committerJack Nagel2013-01-26 12:14:50 -0600
commite05a509fb6c7c69003a1af58ec24bf0be55dd8b0 (patch)
treef9f160b1c156ce9f3fe87dd5b844b7fd2f65efcd /Library
parent620c063f8c5f8e07e4a1949ed1770fe57aac270b (diff)
downloadbrew-e05a509fb6c7c69003a1af58ec24bf0be55dd8b0.tar.bz2
Tag Xcode and CLT requirements as build-time
This way they can be skipped when installing bottles.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dependencies.rb5
-rw-r--r--Library/Homebrew/requirements.rb2
-rw-r--r--Library/Homebrew/test/test_requirement.rb5
3 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb
index 35c411cfa..c9ec0af94 100644
--- a/Library/Homebrew/dependencies.rb
+++ b/Library/Homebrew/dependencies.rb
@@ -229,6 +229,7 @@ class Requirement
def initialize(*tags)
@tags = tags.flatten.compact
+ @tags << :build if self.class.build
end
# The message to show when the requirement is not met.
@@ -287,6 +288,10 @@ class Requirement
val.nil? ? @fatal : @fatal = val
end
+ def build(val=nil)
+ val.nil? ? @build : @build = val
+ end
+
def satisfy(options={}, &block)
@satisfied ||= Requirement::Satisfier.new(options, &block)
end
diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb
index ab7b82603..b1f708c0c 100644
--- a/Library/Homebrew/requirements.rb
+++ b/Library/Homebrew/requirements.rb
@@ -204,6 +204,7 @@ end
class XcodeDependency < Requirement
fatal true
+ build true
satisfy(:build_env => false) { MacOS::Xcode.installed? }
@@ -274,6 +275,7 @@ end
class CLTDependency < Requirement
fatal true
+ build true
def satisfied?
MacOS::CLT.installed?
diff --git a/Library/Homebrew/test/test_requirement.rb b/Library/Homebrew/test/test_requirement.rb
index e8803ed92..172f0bdef 100644
--- a/Library/Homebrew/test/test_requirement.rb
+++ b/Library/Homebrew/test/test_requirement.rb
@@ -87,4 +87,9 @@ class RequirementTests < Test::Unit::TestCase
req.modify_build_environment
end
+
+ def test_dsl_build
+ req = Class.new(Requirement) { build true }.new
+ assert req.build?
+ end
end