From a7714a804b028523d3c213ae9cf2cb150876bec4 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 17 Apr 2013 10:01:38 -0700 Subject: [PATCH] Add :hg build requirement. Closes Homebrew/homebrew#19074. --- Library/Homebrew/dependency_collector.rb | 1 + Library/Homebrew/requirements.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 22f690a8c1..bf5c014f34 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -91,6 +91,7 @@ class DependencyCollector when :tex then TeXDependency.new(tag) when :clt then CLTDependency.new(tag) when :arch then ArchRequirement.new(tag) + when :hg then MercurialDependency.new(tag) else raise "Unsupported special dependency #{spec}" end diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb index f226db8394..6ebf3f6a49 100644 --- a/Library/Homebrew/requirements.rb +++ b/Library/Homebrew/requirements.rb @@ -107,3 +107,17 @@ class ArchRequirement < Requirement "This formula requires an #{@arch} architecture." end end + +class MercurialDependency < Requirement + fatal true + + satisfy { which('hg') } + + def message; <<-EOS.undent + Mercurial is needed to install this software. + + You can install this with Homebrew using: + brew install mercurial + EOS + end +end