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.4 .0.tar.gz"
5
+ sha256 "6307218d7e434fb6ffc81b9275c673d3f7f1f4884ad59b904abd205c437021a0 "
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
bottle do
@@ -19,37 +18,28 @@ class MathComp < Formula
19
18
20
19
depends_on "ocaml" => :build
21
20
depends_on "ocaml-findlib" => :build
22
- depends_on "coq"
21
+ depends_on "coq-hierarchy-builder"
22
+ depends_on "rocq"
23
+ depends_on "rocq-elpi"
23
24
24
25
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 "
41
35
elisp . install "ssreflect/pg-ssr.el"
42
36
end
43
37
44
- doc . install Dir [ "docs/*" ]
38
+ system "make" , *args
39
+ system "make" , *args , "install"
45
40
end
46
41
47
42
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
-
53
43
( testpath /"testing.v" ) . write <<~EOS
54
44
From mathcomp Require Import ssreflect seq.
55
45
@@ -60,8 +50,7 @@ def install
60
50
Check test.
61
51
EOS
62
52
63
- coqc = Formula [ "coq" ] . opt_bin /"coqc"
64
- cmd = "#{ coqc } -R #{ lib } /coq/user-contrib/mathcomp mathcomp testing.v"
65
- assert_match ( /\A test\s +: forall/ , shell_output ( cmd ) )
53
+ ENV [ "OCAMLFIND_CONF" ] = Formula [ "rocq-elpi" ] . libexec /"lib/findlib.conf"
54
+ assert_match ( /\A test\s +: forall/ , shell_output ( "#{ Formula [ "rocq" ] . bin } /rocq compile testing.v" ) )
66
55
end
67
56
end
0 commit comments