aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-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