dev-db/mysql-connector-c: ppc64 stable wrt bug #709620
[gentoo.git] / dev-ml / camlp5 / camlp5-7.03.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 multilib findlib eutils versionator
7
8 MY_P=${P%_p*}
9 DESCRIPTION="A preprocessor-pretty-printer of ocaml"
10 HOMEPAGE="https://camlp5.github.io/"
11 SRC_URI="https://github.com/camlp5/camlp5/archive/rel$(replace_all_version_separators '').tar.gz -> ${P}.tar.gz"
12 S="${WORKDIR}/${PN}-rel$(replace_all_version_separators '')"
13
14 LICENSE="BSD"
15 SLOT="0/${PV}"
16 KEYWORDS="~alpha ~amd64 ~ppc ~x86"
17 IUSE="doc +ocamlopt"
18
19 DEPEND="
20         >=dev-lang/ocaml-3.10:=[ocamlopt?]
21         <=dev-lang/ocaml-4.6.0
22 "
23 RDEPEND="${DEPEND}"
24
25 PATCHLEVEL=${PV#*_p}
26 PATCHLIST=""
27
28 if [ "${PATCHLEVEL}" != "${PV}" ] ; then
29         for (( i=1; i<=PATCHLEVEL; i++ )) ; do
30                 SRC_URI="${SRC_URI}
31                         http://pauillac.inria.fr/~ddr/camlp5/distrib/src/patch-${PV%_p*}-${i} -> ${MY_P}-patch-${i}.patch"
32                 PATCHLIST="${PATCHLIST} ${MY_P}-patch-${i}.patch"
33         done
34 fi
35
36 src_prepare() {
37         for i in ${PATCHLIST} ; do
38                 epatch "${DISTDIR}/${i}"
39         done
40 }
41
42 src_configure() {
43         ./configure \
44                 --strict \
45                 -prefix /usr \
46                 -bindir /usr/bin \
47                 -libdir /usr/$(get_libdir)/ocaml \
48                 -mandir /usr/share/man || die "configure failed"
49 }
50
51 src_compile(){
52         emake out
53         if use ocamlopt; then
54                 emake  opt
55                 emake  opt.opt
56         fi
57 }
58
59 src_install() {
60         emake DESTDIR="${D}" install
61         # findlib support
62         insinto "$(ocamlfind printconf destdir)/${PN}"
63         doins etc/META
64
65         use doc && dohtml -r doc/*
66
67         dodoc CHANGES DEVEL ICHANGES README UPGRADING MODE
68 }