Skip to content

Commit 7fe26c8

Browse files
cho-mbotantony
authored andcommitted
math-comp 2.4.0
1 parent cc33557 commit 7fe26c8

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.3.0.tar.gz"
5+
sha256 "19e13c8765007f95b4656d8902bc66e10b072ab94ab51031c5efb860827d05ec"
66
license "CECILL-B"
7-
revision 6
87
head "https://github.com/math-comp/math-comp.git", branch: "master"
98

109
no_autobump! because: :requires_manual_review
@@ -21,37 +20,28 @@ class MathComp < Formula
2120

2221
depends_on "ocaml" => :build
2322
depends_on "ocaml-findlib" => :build
24-
depends_on "coq"
23+
depends_on "coq-hierarchy-builder"
24+
depends_on "rocq"
25+
depends_on "rocq-elpi"
2526

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

46-
doc.install Dir["docs/*"]
40+
system "make", *args
41+
system "make", *args, "install"
4742
end
4843

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

65-
coqc = Formula["coq"].opt_bin/"coqc"
66-
cmd = "#{coqc} -R #{lib}/coq/user-contrib/mathcomp mathcomp testing.v"
67-
assert_match(/\Atest\s+: forall/, shell_output(cmd))
55+
ENV["OCAMLFIND_CONF"] = Formula["rocq-elpi"].libexec/"lib/findlib.conf"
56+
assert_match(/\Atest\s+: forall/, shell_output("#{Formula["rocq"].bin}/rocq compile testing.v"))
6857
end
6958
end

0 commit comments

Comments
 (0)