aboutsummaryrefslogtreecommitdiff
blob: 90b5183419a39473277e4cbfe70bf70c9d40d8d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

inherit eutils findlib multilib

DESCRIPTION="The Zarith library implements arithmetic and logical operations over arbitrary-precision integers"
HOMEPAGE="http://forge.ocamlcore.org/projects/zarith"
SRC_URI="http://forge.ocamlcore.org/frs/download.php/1199/${P}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+ocamlopt doc mpir"

DEPEND=">=dev-lang/ocaml-3.12.1[ocamlopt?]
		!mpir? ( dev-libs/gmp )
		mpir? ( sci-libs/mpir )"
RDEPEND="${DEPEND}"

src_prepare(){
	sed -i ${S}/project.mak -e "s:(OCAMLFIND) install:(OCAMLFIND) install -ldconf \$(INSTALLDIR)/ld.conf:g"
}

src_configure(){
	MY_OPTS="-ocamllibdir /usr/$(get_libdir) -installdir ${D}/usr/$(get_libdir)/ocaml"
	use mpir && MY_OPTS="${MY_OPTS} -mpir"
	./configure ${MY_OPTS}|| die || die "configure failed"
}

src_compile(){
	emake || die "emake failed"
	use doc && emake doc || die "emake doc failed"
}

src_install(){
	findlib_src_preinst
	cp /usr/$(get_libdir)/ocaml/ld.conf ${D}/usr/$(get_libdir)/ocaml/ld.conf
	emake install || die "emake install failed"
	rm -f ${D}/usr/$(get_libdir)/ocaml/ld.conf
	dodoc Changes README
	use doc && dodoc -r html/
}