Skip to content

Commit f666ad2

Browse files
cho-mbotantony
authored andcommitted
math-comp 2.4.0
1 parent d197027 commit f666ad2

File tree

1 file changed

+18
-29
lines changed

1 file changed

+18
-29
lines changed

Formula/m/math-comp.rb

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
class MathComp < Formula
22
desc "Mathematical Components for the Coq proof assistant"
33
homepage "https://math-comp.github.io/math-comp/"
4-
url "https://github.com/math-comp/math-comp/archive/refs/tags/mathcomp-1.19.0.tar.gz"
5-
sha256 "786db902d904347f2108ffceae15ba29037ff8e63a6c58b87928f08671456394"
4+
url "https://github.com/math-comp/math-comp/archive/refs/tags/mathcomp-2.4.0.tar.gz"
5+
sha256 "6307218d7e434fb6ffc81b9275c673d3f7f1f4884ad59b904abd205c437021a0"
66
license "CECILL-B"
7-
revision 6
87
head "https://github.com/math-comp/math-comp.git", branch: "master"
98

109
bottle do
@@ -19,37 +18,28 @@ class MathComp < Formula
1918

2019
depends_on "ocaml" => :build
2120
depends_on "ocaml-findlib" => :build
22-
depends_on "coq"
21+
depends_on "coq-hierarchy-builder"
22+
depends_on "rocq"
23+
depends_on "rocq-elpi"
2324

2425
def install
25-
# Work around for https://github.com/Homebrew/homebrew-test-bot/issues/805
26-
if ENV["HOMEBREW_GITHUB_ACTIONS"] && !(Formula["ocaml-findlib"].etc/"findlib.conf").exist?
27-
ENV["OCAMLFIND_CONF"] = Formula["ocaml-findlib"].opt_libexec/"findlib.conf"
28-
end
29-
30-
coqlib = "#{lib}/coq/"
31-
32-
(buildpath/"mathcomp/Makefile.coq.local").write <<~EOS
33-
COQLIB=#{coqlib}
34-
EOS
35-
36-
cd "mathcomp" do
37-
system "make", "Makefile.coq"
38-
system "make", "-f", "Makefile.coq", "MAKEFLAGS=#{ENV["MAKEFLAGS"]}"
39-
system "make", "install", "MAKEFLAGS=#{ENV["MAKEFLAGS"]}"
40-
26+
ENV["OCAMLFIND_CONF"] = Formula["rocq-elpi"].libexec/"lib/findlib.conf"
27+
28+
args = []
29+
if build.stable?
30+
args += %w[-C mathcomp]
31+
(buildpath/"mathcomp/Makefile.coq.local").write "COQLIB=#{lib}/ocaml/coq\n"
32+
elisp.install "mathcomp/ssreflect/pg-ssr.el"
33+
else
34+
(buildpath/"Makefile.coq.local").append_lines "COQLIB=#{lib}/ocaml/coq\n"
4135
elisp.install "ssreflect/pg-ssr.el"
4236
end
4337

44-
doc.install Dir["docs/*"]
38+
system "make", *args
39+
system "make", *args, "install"
4540
end
4641

4742
test do
48-
# Work around for https://github.com/Homebrew/homebrew-test-bot/issues/805
49-
if ENV["HOMEBREW_GITHUB_ACTIONS"] && !(Formula["ocaml-findlib"].etc/"findlib.conf").exist?
50-
ENV["OCAMLFIND_CONF"] = Formula["ocaml-findlib"].opt_libexec/"findlib.conf"
51-
end
52-
5343
(testpath/"testing.v").write <<~EOS
5444
From mathcomp Require Import ssreflect seq.
5545
@@ -60,8 +50,7 @@ def install
6050
Check test.
6151
EOS
6252

63-
coqc = Formula["coq"].opt_bin/"coqc"
64-
cmd = "#{coqc} -R #{lib}/coq/user-contrib/mathcomp mathcomp testing.v"
65-
assert_match(/\Atest\s+: forall/, shell_output(cmd))
53+
ENV["OCAMLFIND_CONF"] = Formula["rocq-elpi"].libexec/"lib/findlib.conf"
54+
assert_match(/\Atest\s+: forall/, shell_output("#{Formula["rocq"].bin}/rocq compile testing.v"))
6655
end
6756
end

0 commit comments

Comments
 (0)