sci-mathematics/coq: Remove := from || dep, #586304
[gentoo.git] / sci-mathematics / coq / coq-8.4_p5.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit eutils multilib
8
9 MY_PV=${PV/_p/pl}
10 MY_P=${PN}-${MY_PV}
11
12 DESCRIPTION="Proof assistant written in O'Caml"
13 HOMEPAGE="http://coq.inria.fr/"
14 SRC_URI="http://${PN}.inria.fr/distrib/V${MY_PV}/files/${MY_P}.tar.gz"
15
16 LICENSE="LGPL-2.1"
17 SLOT="0"
18 KEYWORDS="amd64 ppc x86"
19 IUSE="gtk debug +ocamlopt doc camlp5"
20
21 RDEPEND="
22         >=dev-lang/ocaml-3.11.2:=[ocamlopt?]
23         camlp5? ( >=dev-ml/camlp5-6.02.3:=[ocamlopt?] )
24         !camlp5? ( || ( dev-ml/camlp4 <dev-lang/ocaml-4.02.0 ) )
25         gtk? ( >=dev-ml/lablgtk-2.10.1:=[ocamlopt?] )"
26 DEPEND="${RDEPEND}
27         doc? (
28                 media-libs/netpbm[png,zlib]
29                 virtual/latex-base
30                 dev-tex/hevea
31                 dev-tex/xcolor
32                 dev-texlive/texlive-pictures
33                 dev-texlive/texlive-mathextra
34                 dev-texlive/texlive-latexextra
35                 )"
36
37 S=${WORKDIR}/${MY_P}
38
39 src_prepare() {
40         epatch "${FILESDIR}/${PN}-8.4_p5-do-not-install-revision.patch"
41         # Fix generation of the index_urls.txt file with Gentoo dev-tex/hevea versions.
42         # http://lists.gforge.inria.fr/pipermail/coq-commits/2014-October/013582.html
43         epatch "${FILESDIR}/${P}-hevea.patch"
44         epatch "${FILESDIR}/${PN}-8.4_p5-no-clean-before-test.patch"
45 }
46
47 src_configure() {
48         ocaml_lib=$(ocamlc -where)
49         local myconf=(
50                 --prefix /usr
51                 --bindir /usr/bin
52                 --libdir /usr/$(get_libdir)/coq
53                 --mandir /usr/share/man
54                 --emacslib /usr/share/emacs/site-lisp
55                 --coqdocdir /usr/$(get_libdir)/coq/coqdoc
56                 --docdir /usr/share/doc/${PF}
57                 --configdir /etc/xdg/${PN}
58                 --lablgtkdir ${ocaml_lib}/lablgtk2
59                 )
60
61         use debug && myconf+=( --debug )
62         use doc || myconf+=( --with-doc no )
63
64         if use gtk; then
65                 if use ocamlopt; then
66                         myconf+=( --coqide opt )
67                 else
68                         myconf+=( --coqide byte )
69                 fi
70         else
71                 myconf+=( --coqide no )
72         fi
73
74         if use ocamlopt; then
75                 myconf+=( --opt )
76         else
77                 myconf+=( -byte-only )
78         fi
79
80         if use camlp5; then
81                 myconf+=( --camlp5dir ${ocaml_lib}/camlp5 )
82         else
83                 myconf+=( --usecamlp4 )
84         fi
85
86         export CAML_LD_LIBRARY_PATH="${S}/kernel/byterun/"
87         ./configure ${myconf[@]} || die "configure failed"
88 }
89
90 src_compile() {
91         emake STRIP="true" -j1 world VERBOSE=1
92 }
93
94 src_test() {
95         emake STRIP="true" check VERBOSE=1
96 }
97
98 src_install() {
99         emake STRIP="true" COQINSTALLPREFIX="${D}" install VERBOSE=1
100         dodoc README CREDITS CHANGES
101
102         use gtk && make_desktop_entry "coqide" "Coq IDE" "${EPREFIX}/usr/share/coq/coq.png"
103 }