aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAdam Vandenberg2012-03-12 20:26:25 -0700
committerAdam Vandenberg2012-03-12 20:26:25 -0700
commitd312e37d192ad2a4717c942015b42129533116dc (patch)
tree0480ecf047ce0ee3ed33e46a8e56191732d70772 /Library/Formula
parent229c5c3e2079a334577b586092002cbb6ed484a8 (diff)
downloadhomebrew-d312e37d192ad2a4717c942015b42129533116dc.tar.bz2
coq: use a Requirement
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/coq.rb31
1 files changed, 22 insertions, 9 deletions
diff --git a/Library/Formula/coq.rb b/Library/Formula/coq.rb
index 78e272877..88e45c927 100644
--- a/Library/Formula/coq.rb
+++ b/Library/Formula/coq.rb
@@ -1,22 +1,36 @@
require 'formula'
+class TransitionalMode < Requirement
+ def message; <<-EOS.undent
+ camlp5 must be compiled in transitional mode (instead of --strict mode):
+ brew install camlp5
+ EOS
+ end
+ def satisfied?
+ # If not installed, it will install in the correct mode.
+ return true if not which('camlp5')
+ # If installed, make sure it is transitional instead of strict.
+ `camlp5 -pmode 2>&1`.chomp == 'transitional'
+ end
+ def fatal?
+ true
+ end
+end
+
class Coq < Formula
+ homepage 'http://coq.inria.fr/'
url 'http://coq.inria.fr/distrib/V8.3pl3/files/coq-8.3pl3.tar.gz'
version '8.3pl3'
- head 'svn://scm.gforge.inria.fr/svn/coq/trunk'
- homepage 'http://coq.inria.fr/'
md5 '37e9a52110a025128667c03fed75f9c2'
+ head 'svn://scm.gforge.inria.fr/svn/coq/trunk'
skip_clean :all
+ depends_on TransitionalMode.new
depends_on 'objective-caml'
depends_on 'camlp5'
def install
- unless `camlp5 -pmode 2>&1`.chomp == 'transitional'
- onoe 'camlp5 must be compiled in transitional mode (--transitional option)'
- exit 1
- end
arch = Hardware.is_64_bit? ? "x86_64" : "i386"
camlp5_lib = Formula.factory('camlp5').lib+'ocaml/camlp5'
system "./configure", "-prefix", prefix,
@@ -32,13 +46,12 @@ class Coq < Formula
system "make install"
end
- def caveats
- <<-EOS.undent
+ def caveats; <<-EOS.undent
Coq's Emacs mode is installed into
#{lib}/emacs/site-lisp
+
To use the Coq Emacs mode, you need to put the following lines in
your .emacs file:
-
(setq auto-mode-alist (cons '("\\.v$" . coq-mode) auto-mode-alist))
(autoload 'coq-mode "coq" "Major mode for editing Coq vernacular." t)
EOS