homebrew-core/Formula/coq.rb

61 lines
1.9 KiB
Ruby
Raw Normal View History

2015-04-11 18:10:29 +00:00
class Camlp5TransitionalModeRequirement < Requirement
2013-01-19 01:30:43 +00:00
fatal true
satisfy(:build_env => false) { !Tab.for_name("camlp5").with?("strict") }
2013-01-20 02:45:59 +00:00
2012-03-13 03:26:25 +00:00
def message; <<-EOS.undent
camlp5 must be compiled in transitional mode (instead of --strict mode):
brew install camlp5
EOS
end
end
class Coq < Formula
desc "Proof assistant for higher-order logic"
homepage "https://coq.inria.fr/"
url "https://coq.inria.fr/distrib/8.5pl2/files/coq-8.5pl2.tar.gz"
version "8.5pl2"
sha256 "83239d1251bf6c54a9ca5045d738e469019b93ca601756bf982aab0654e4de73"
head "git://scm.gforge.inria.fr/coq/coq.git", :branch => "trunk"
2015-05-15 22:19:04 +00:00
bottle do
2016-07-08 14:11:07 +00:00
sha256 "6bca59c08a4ec3b0633621332d9e66eb252c652d3efbce51f039ff8e6b7fe28f" => :el_capitan
sha256 "a61a407c55cde0cd9a68e2995af1af227b5dfc66060438254b3f4d76baa4dc1d" => :yosemite
sha256 "12444450f927ce6ebe0ff4dbbde42530edc57ee2e3a1baa5748cd987bf9750d8" => :mavericks
2015-05-15 22:19:04 +00:00
end
2015-04-11 18:10:29 +00:00
depends_on Camlp5TransitionalModeRequirement
2014-05-25 14:50:13 +00:00
depends_on "camlp5"
depends_on "ocaml"
def install
camlp5_lib = Formula["camlp5"].opt_lib/"ocaml/camlp5"
system "./configure", "-prefix", prefix,
"-mandir", man,
"-camlp5dir", camlp5_lib,
2016-07-22 03:24:22 +00:00
"-emacslib", elisp,
"-coqdocdir", "#{pkgshare}/latex",
"-coqide", "no",
"-with-doc", "no"
2014-05-25 14:50:13 +00:00
system "make", "world"
ENV.deparallelize { system "make", "install" }
end
test do
(testpath/"testing.v").write <<-EOS.undent
Inductive nat : Set :=
| O : nat
| S : nat -> nat.
Fixpoint add (n m: nat) : nat :=
match n with
| O => m
| S n' => S (add n' m)
end.
Lemma add_O_r : forall (n: nat), add n O = n.
intros n; induction n; simpl; auto; rewrite IHn; auto.
Qed.
EOS
system("#{bin}/coqc", "#{testpath}/testing.v")
end
end