summaryrefslogtreecommitdiff
blob: b2a094a5eb2a0c0ae473b8d555b96303e524bad8 (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
48
49
50
51
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ml/core/core-0.6.0.ebuild,v 1.2 2010/11/11 20:09:18 aballier Exp $

EAPI="2"
inherit findlib eutils

DESCRIPTION="Jane Street's alternative to the standard library"
HOMEPAGE="http://www.janestreet.com/ocaml"
SRC_URI="http://www.janestreet.com/ocaml/${P}.tgz"

LICENSE="LGPL-2.1-linking-exception"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"

RDEPEND=">=dev-lang/ocaml-3.11[ocamlopt]
	dev-ml/res
	dev-ml/sexplib
	dev-ml/bin-prot
	dev-ml/fieldslib
	dev-ml/pcre-ocaml"
DEPEND="${RDEPEND}
	test? (
		dev-ml/ounit
		dev-ml/type-conv
	)"

src_prepare() {
	has_version '>=dev-lang/ocaml-3.12' && epatch "${FILESDIR}/${P}-ocaml312.patch"
}

src_compile() {
	emake -j1 || die
}

src_test() {
	cd "${S}/extended_test"
	ocamlfind ocamlc -package bigarray,oUnit,type-conv,sexplib,bin_prot,res,fieldslib,pcre,threads -thread -dtypes -I ../extended -I ../lib yes.ml -o yes.exe || die
	for i in lib extended ; do
		cd "${S}/${i}_test"
		emake || die
		./test_runner.exe || die
	done
}

src_install() {
	findlib_src_preinst
	emake install || die "make install failed"
	dodoc README
}