diff options
| author | Xiyue Deng | 2012-12-13 22:23:06 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2013-01-13 18:25:35 -0800 |
| commit | f104952349a23f9920ef1c64c5359d2494eaffb4 (patch) | |
| tree | 70c48db4efe95da8d86850b46ef5984af301f7ba /Library | |
| parent | a6e4ca1469af81d711c6656cb1dd016f36cfef77 (diff) | |
| download | homebrew-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>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/dependencies.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/requirements.rb | 24 |
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 |
