dev-ml/{camlimages,js_of_ocaml,labltk}: Dependency default
[gentoo.git] / dev-ml / ocamlgraph / ocamlgraph-1.8.8.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit findlib
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_compile() {
21         emake byte
22         use ocamlopt && emake opt
23
24         if use doc;     then
25                 emake doc
26         fi
27
28         if use gtk; then
29                 emake OCAMLBEST=$(usex ocamlopt opt byte) viewer dgraph editor
30         fi
31 }
32
33 src_install() {
34         findlib_src_preinst
35         use ocamlopt || export WANT_OCAMLOPT=no
36         use gtk && export WANT_GTK=yes
37         emake install-findlib
38
39         if use gtk ; then
40                 local ext=byte
41                 use ocamlopt && ext=opt
42                 newbin dgraph/dgraph.${ext} ${PN}-dgraph
43                 newbin editor/editor.${ext} ${PN}-editor
44                 newbin view_graph/viewgraph.${ext} ${PN}-viewgraph
45         fi
46
47         dodoc README.adoc CREDITS FAQ CHANGES
48         if use doc; then
49                 dohtml doc/*
50         fi
51
52         if use examples; then
53                 insinto /usr/share/doc/${PF}
54                 doins -r examples
55                 docompress -x /usr/share/doc/${PF}/examples
56         fi
57 }