dev-ml/lablgtk: version bump to 2.18.10
[gentoo.git] / dev-ml / ppx_deriving / ppx_deriving-4.2-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit findlib eutils opam
7
8 DESCRIPTION="Type-driven code generation for OCaml"
9 HOMEPAGE="https://github.com/ocaml-ppx/ppx_deriving"
10 SRC_URI="https://github.com/ocaml-ppx/ppx_deriving/archive/v${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="MIT"
13 SLOT="0/${PV}"
14 KEYWORDS="~amd64 ~ppc ~x86"
15 IUSE="doc +ocamlopt test"
16 RESTRICT="!test? ( test )"
17
18 DEPEND="
19         dev-ml/ppx_tools:=
20         dev-ml/ocaml-migrate-parsetree:=
21         dev-ml/ppx_derivers:=
22         dev-ml/result:=
23 "
24 RDEPEND="${DEPEND}"
25 DEPEND="${RDEPEND}
26         dev-ml/cppo
27         test? ( dev-ml/ounit )"
28
29 src_compile() {
30         cp pkg/META.in pkg/META || die
31         ocaml pkg/build.ml \
32                 native=$(usex ocamlopt true false) \
33                 native-dynlink=$(usex ocamlopt true false) \
34                 || die
35         use doc && emake doc
36 }
37
38 src_test() {
39         ocamlbuild -j 0 -use-ocamlfind -classic-display \
40                         src_test/test_ppx_deriving.byte -- || die
41         if use ocamlopt;  then
42                 ocamlbuild -j 0 -use-ocamlfind -classic-display \
43                         src_test/test_ppx_deriving.native -- || die
44         fi
45 }
46
47 src_install() {
48         opam_src_install
49         mv "${ED}/usr/lib/ppx_deriving/ppx_deriving" "${D}/$(ocamlc -where)/ppx_deriving/" || die
50
51         use doc && dohtml api.docdir/*
52 }