1
1
class MathComp < Formula
2
2
desc "Mathematical Components for the Coq proof assistant"
3
3
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 "
6
6
license "CECILL-B"
7
- revision 6
8
7
head "https://github.com/math-comp/math-comp.git" , branch : "master"
9
8
10
9
no_autobump! because : :requires_manual_review
@@ -21,37 +20,28 @@ class MathComp < Formula
21
20
22
21
depends_on "ocaml" => :build
23
22
depends_on "ocaml-findlib" => :build
24
- depends_on "coq"
23
+ depends_on "coq-hierarchy-builder"
24
+ depends_on "rocq"
25
+ depends_on "rocq-elpi"
25
26
26
27
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 "
43
37
elisp . install "ssreflect/pg-ssr.el"
44
38
end
45
39
46
- doc . install Dir [ "docs/*" ]
40
+ system "make" , *args
41
+ system "make" , *args , "install"
47
42
end
48
43
49
44
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
-
55
45
( testpath /"testing.v" ) . write <<~EOS
56
46
From mathcomp Require Import ssreflect seq.
57
47
@@ -62,8 +52,7 @@ def install
62
52
Check test.
63
53
EOS
64
54
65
- coqc = Formula [ "coq" ] . opt_bin /"coqc"
66
- cmd = "#{ coqc } -R #{ lib } /coq/user-contrib/mathcomp mathcomp testing.v"
67
- assert_match ( /\A test\s +: forall/ , shell_output ( cmd ) )
55
+ ENV [ "OCAMLFIND_CONF" ] = Formula [ "rocq-elpi" ] . libexec /"lib/findlib.conf"
56
+ assert_match ( /\A test\s +: forall/ , shell_output ( "#{ Formula [ "rocq" ] . bin } /rocq compile testing.v" ) )
68
57
end
69
58
end
0 commit comments