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>
This commit is contained in:
Xiyue Deng 2012-12-13 22:23:06 -08:00 committed by Adam Vandenberg
parent 8f88850cdb
commit 2d445d54b5
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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