dev-ml/dune: x86 stable wrt bug #710374
[gentoo.git] / dev-ml / ocamlgraph / ocamlgraph-1.8.7.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit findlib eutils
7
8 DESCRIPTION="O'Caml Graph library"
9 HOMEPAGE="http://ocamlgraph.lri.fr/index.en.html"
10 SRC_URI="http://ocamlgraph.lri.fr/download/${P}.tar.gz"
11 LICENSE="LGPL-2.1"
12 SLOT="0/${PV}"
13 KEYWORDS="~amd64 ~arm ~arm64 ppc x86"
14 RDEPEND=">=dev-lang/ocaml-3.10.2:=[ocamlopt?]
15         gtk? ( dev-ml/lablgtk:=[gnomecanvas,ocamlopt?] )"
16 DEPEND="${RDEPEND}
17         doc? ( dev-tex/hevea dev-ml/ocamlweb )"
18 IUSE="doc examples gtk +ocamlopt"
19
20 src_prepare() {
21         epatch "${FILESDIR}/${PN}-1.8.6-installfindlib.patch"
22         epatch "${FILESDIR}/${P}-test.patch"
23 }
24
25 src_compile() {
26         emake byte
27         use ocamlopt && emake opt
28
29         if use doc;     then
30                 emake doc
31         fi
32
33         if use gtk; then
34                 emake OCAMLBEST=$(usex ocamlopt opt byte) viewer dgraph editor
35         fi
36 }
37
38 src_install() {
39         findlib_src_preinst
40         use ocamlopt || export WANT_OCAMLOPT=no
41         use gtk && export WANT_GTK=yes
42         emake install-findlib
43
44         if use gtk ; then
45                 local ext=byte
46                 use ocamlopt && ext=opt
47                 newbin dgraph/dgraph.${ext} ${PN}-dgraph
48                 newbin editor/editor.${ext} ${PN}-editor
49                 newbin view_graph/viewgraph.${ext} ${PN}-viewgraph
50         fi
51
52         dodoc README.adoc CREDITS FAQ CHANGES
53         if use doc; then
54                 dohtml doc/*
55         fi
56
57         if use examples; then
58                 insinto /usr/share/doc/${PF}
59                 doins -r examples
60                 docompress -x /usr/share/doc/${PF}/examples
61         fi
62 }