c19c5780ccad5730c8afc92f4a561cb80c6d8a87
[gentoo.git] / dev-ml / camlp4 / camlp4-4.04_p1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 MY_PV=${PV/_p/+}
7 MY_P=${PN}-${MY_PV}
8
9 DESCRIPTION="System for writing extensible parsers for programming languages"
10 HOMEPAGE="https://github.com/ocaml/camlp4"
11 SRC_URI="https://github.com/ocaml/camlp4/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="LGPL-2-with-linking-exception"
14 SLOT="0/${PV}"
15 KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
16 IUSE="+ocamlopt"
17
18 DEPEND="=dev-lang/ocaml-4.04*:=[ocamlopt?]"
19 RDEPEND="${DEPEND}
20         !<dev-lang/ocaml-4.02
21         !<dev-ml/findlib-1.5.5-r1"
22 DEPEND="${DEPEND}
23         dev-ml/ocamlbuild"
24
25 S=${WORKDIR}/${P/_p/-}
26
27 src_configure() {
28         ./configure \
29                 --bindir="${EPREFIX}/usr/bin" \
30                 --libdir="$(ocamlc -where)" \
31                 --pkgdir="$(ocamlc -where)" \
32                 || die
33 }
34
35 src_compile() {
36         emake byte
37         use ocamlopt && emake native
38 }
39
40 src_install() {
41         emake DESTDIR="${D}" install install-META
42         dodoc CHANGES.md README.md
43 }