diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index 1c95e9613c..8b4916279b 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 d452ae452b..5ac7e4e4bd 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