aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiyue Deng2012-12-13 22:23:06 -0800
committerAdam Vandenberg2013-01-13 18:25:35 -0800
commitf104952349a23f9920ef1c64c5359d2494eaffb4 (patch)
tree70c48db4efe95da8d86850b46ef5984af301f7ba
parenta6e4ca1469af81d711c6656cb1dd016f36cfef77 (diff)
downloadhomebrew-f104952349a23f9920ef1c64c5359d2494eaffb4.tar.bz2
Add tex requirement
* Detect `latex' and `bibtex' commands. * Recommend installing MacTeX when no LaTeX installation is found. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
-rw-r--r--Library/Homebrew/dependencies.rb2
-rw-r--r--Library/Homebrew/requirements.rb24
2 files changed, 26 insertions, 0 deletions
diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb
index 1c95e9613..8b4916279 100644
--- a/Library/Homebrew/dependencies.rb
+++ b/Library/Homebrew/dependencies.rb
@@ -78,6 +78,8 @@ private
MysqlInstalled.new(tag)
when :postgresql
PostgresqlInstalled.new(tag)
+ when :tex
+ TeXInstalled.new(tag)
else
raise "Unsupported special dependency #{spec}"
end
diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb
index d452ae452..5ac7e4e4b 100644
--- a/Library/Homebrew/requirements.rb
+++ b/Library/Homebrew/requirements.rb
@@ -271,3 +271,27 @@ class PostgresqlInstalled < Requirement
EOS
end
end
+
+class TeXInstalled < Requirement
+ fatal true
+ env :userpaths
+
+ def satisfied?
+ tex = which 'tex'
+ latex = which 'latex'
+ not tex.nil? and not latex.nil?
+ end
+
+ def message; <<-EOS.undent
+ A LaTeX distribution is required to install.
+
+ You can install MacTeX distribution from:
+ http://www.tug.org/mactex/
+
+ Make sure that its bin directory is in your PATH before proceed.
+
+ You may also need to restore the ownership of Homebrew install:
+ sudo chown -R $USER `brew --prefix`
+ EOS
+ end
+end