summaryrefslogtreecommitdiff
blob: e4f11a7d55b3b867601da37c771441dacf136499 (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
46
47
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ml/tyxml/tyxml-2.2.0.ebuild,v 1.3 2013/07/23 17:47:39 aballier Exp $

EAPI=5

inherit eutils findlib

DESCRIPTION="A libary to build xml trees typechecked by OCaml"
HOMEPAGE="http://ocsigen.org/tyxml/"
SRC_URI="http://www.ocsigen.org/download/${P}.tar.gz"

LICENSE="LGPL-2.1-with-linking-exception"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="doc ocamlduce +ocamlopt"

DEPEND="
	>=dev-lang/ocaml-3.12:=[ocamlopt?]
	>=dev-ml/ocamlnet-3.6:=[pcre]
	ocamlduce? ( dev-ml/ocamlduce:= )"
RDEPEND="${DEPEND}"

src_prepare() {
	epatch "${FILESDIR}/pcre.patch"
	export myopts="OCAMLDUCE=$(usex ocamlduce yes no)"
}

src_compile() {
	if use ocamlopt; then
		emake "$myopts"
	else
		emake "$myopts" byte
	fi
	use doc && emake doc "$myopts"
}

src_install() {
	findlib_src_preinst
	if use ocamlopt; then
		emake DESTIR="${D}" "$myopts" install
	else
		emake DESTIR="${D}" "$myopts" install-byte
	fi
	dodoc CHANGES README
	use doc && dohtml -r doc/api-html
}