aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2010-01-13 11:53:57 +0000
committerMax Howell2010-01-13 11:56:23 +0000
commit1958bd9df656d0a33d035a95a433589ec0c0b713 (patch)
tree731397b4d9fd5284282029508ca3ac5de9d6622d /Library
parentc4c4642bf8ab3c6c5942598ebd4dc1ed35e4c0bd (diff)
downloadhomebrew-1958bd9df656d0a33d035a95a433589ec0c0b713.tar.bz2
Support Perl/CPAN external dependencies
WhoHas requires LWP::UserAgent.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/whohas.rb2
-rw-r--r--Library/Homebrew/formula_installer.rb16
2 files changed, 17 insertions, 1 deletions
diff --git a/Library/Formula/whohas.rb b/Library/Formula/whohas.rb
index 2749555da..336f944a1 100644
--- a/Library/Formula/whohas.rb
+++ b/Library/Formula/whohas.rb
@@ -4,6 +4,8 @@ class Whohas <Formula
url 'http://www.philippwesche.org/200811/whohas/whohas-0.23.tar.gz'
homepage 'http://www.philippwesche.org/200811/whohas/intro.html'
md5 '0895fb6353950fe2e686fa867aaf0416'
+
+ depends_on 'LWP::UserAgent' => :perl
def install
bin.install 'program/whohas'
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index efa84e0ff..3c94602e2 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -20,6 +20,7 @@ class FormulaInstaller
end
deps
end
+
def pyerr dep
brew_pip = ' brew install pip &&' unless Formula.factory('pip').installed?
<<-EOS
@@ -30,11 +31,24 @@ Homebrew does not provide formula for Python dependencies, pip does:
EOS
end
+ def plerr dep; <<-EOS
+Unsatisfied dependency, #{dep}
+Homebrew does not provide formula for Perl dependencies, cpan does:
+
+ cpan -i #{dep}
+
+ EOS
+ end
def check_external_deps f
+ return unless f.external_deps
+
f.external_deps[:python].each do |dep|
raise pyerr(dep) unless quiet_system "/usr/bin/python", "-c", "import #{dep}"
- end if f.external_deps
+ end
+ f.external_deps[:perl].each do |dep|
+ raise plerr(dep) unless quiet_system "/usr/bin/perl", "-e", "use #{dep}"
+ end
end
def install f