1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit check-reqs desktop dune edo
8 DESCRIPTION="Proof assistant written in O'Caml"
9 HOMEPAGE="https://coq.inria.fr/
10 https://github.com/coq/coq/"
12 if [[ "${PV}" == *9999* ]] ; then
15 EGIT_REPO_URI="https://github.com/coq/coq.git"
17 SRC_URI="https://github.com/coq/coq/archive/V${PV}.tar.gz
25 IUSE="debug doc gui +ocamlopt test"
27 # TODO: Lots of failing tests. Maybe investigate later.
28 # RESTRICT="!test? ( test )"
35 >=dev-ml/lablgtk-3.1.2:3=[sourceview,ocamlopt?]
36 >=dev-ml/lablgtk-sourceview-3.1.2:3=[ocamlopt?]
45 >=dev-java/antlr-4.7:4
46 dev-python/antlr4-python3-runtime
47 dev-python/beautifulsoup4
49 dev-python/sphinx-rtd-theme
50 dev-python/sphinxcontrib-bibtex
52 dev-texlive/texlive-fontsextra
53 dev-texlive/texlive-latexextra
54 dev-texlive/texlive-xetex
62 CHECKREQS_DISK_BUILD="2G"
64 DOCS=( CODE_OF_CONDUCT.md CONTRIBUTING.md CREDITS INSTALL.md README.md )
68 # Remove bad tests (recursive).
70 coq-makefile/timing-aggregate
71 coq-makefile/timing-error
72 coq-makefile/timing-per-file
73 coq-makefile/timing-per-line
74 coq-makefile/timing-template
77 for bad_test in "${bad_tests[@]}" ; do
78 if [[ -e "test-suite/${bad_test}" ]] ; then
79 rm -r "test-suite/${bad_test}" || die "failed to remove test ${bad_test}"
81 ewarn "Test file ${bad_test} does not exist"
89 export CAML_LD_LIBRARY_PATH="${S}/kernel/byterun/"
97 use gui && DUNE_PACKAGES+=( coqide )
103 -libdir "/usr/$(get_libdir)/coq"
104 -mandir /usr/share/man
105 -docdir "/usr/share/doc/${PF}"
106 -datadir /usr/share/coq
107 -configdir "/etc/xdg/${PN}"
108 -native-compiler "$(usex ocamlopt yes no)"
110 use debug && myconf+=( -debug )
111 edo sh ./configure "${myconf[@]}"
115 emake DUNEOPT="--display=short --profile release" VERBOSE="1" dunestrap
117 dune-compile "${DUNE_PACKAGES[@]}"
119 use doc && emake refman-html
123 dune-install "${DUNE_PACKAGES[@]}"
126 make_desktop_entry coqide "Coq IDE" "${EPREFIX}/usr/share/coq/coq.png"
129 local ocamlc_where="$(ocamlc -where)"
131 # Dune installs into /usr/<libdir>/ocaml/<coq> but
132 # Coq wants /usr/<libdir>/<coq> ; symlink those directories
134 for sym in "${DUNE_PACKAGES[@]}" ; do
135 dosym "${ocamlc_where}/${sym}" "/usr/$(get_libdir)/${sym}"