summaryrefslogtreecommitdiff
blob: 98584bf66213b89bac5800a80c52b7a1295f9241 (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
52
53
54
55
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

DESCRIPTION="Cooperative light-weight thread library for OCaml"
SRC_URI="https://github.com/ocsigen/lwt/archive/${PV}.tar.gz -> ${P}.tar.gz"
HOMEPAGE="http://ocsigen.org/lwt"

IUSE="+camlp4 +libev"

DEPEND="
	>=dev-lang/ocaml-4.02:=
	dev-ml/result:=
	dev-ml/ocaml-migrate-parsetree:=
	dev-ml/ppx_tools_versioned:=
	libev? ( dev-libs/libev )
	camlp4? ( dev-ml/camlp4:= )"

RDEPEND="${DEPEND}
	!<www-servers/ocsigen-1.1"
DEPEND="${DEPEND}
	dev-ml/cppo
	dev-ml/findlib
	dev-ml/jbuilder
	dev-ml/opam"

SLOT="0/${PV}"
LICENSE="LGPL-2.1-with-linking-exception"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd"

src_configure() {
	ocaml src/util/configure.ml \
		-use-libev $(usex libev true false) \
		-use-camlp4 $(usex camlp4 true false) \
		|| die
}

src_compile() {
	jbuilder  build -p lwt || die
	ocaml src/util/install_filter.ml || die
}

src_test() {
	jbuilder runtest -p lwt || die
}

src_install() {
	opam-installer -i \
		--prefix="${ED}/usr" \
		--libdir="${D}/$(ocamlc -where)" \
		--docdir="${ED}/usr/share/doc/${PF}" \
		--mandir="${ED}/usr/share/man" \
		${PN}.install || die
}