summaryrefslogtreecommitdiff
blob: e1d225ca5e673cffbaa6379c798c6da2bb67f17f (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
56
57
58
59
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="A source-based package manager for OCaml"
HOMEPAGE="http://opam.ocaml.org/"
if [[ ${PV} != 9999 ]] ; then
	SRC_URI="https://github.com/ocaml/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
else
	inherit git-r3
	EGIT_REPO_URI="https://github.com/ocaml/opam.git"
fi

LICENSE="LGPL-3-with-linking-exception"
SLOT="0/${PV}"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
IUSE="test"
RESTRICT="!test? ( test )"

RDEPEND="dev-lang/ocaml:=
	|| ( net-misc/wget net-misc/curl )
	dev-ml/extlib:=
	dev-ml/re:=
	dev-ml/ocamlgraph:=
	dev-ml/cmdliner:=
	dev-ml/cudf:=
	>=dev-ml/dose3-5:=
	dev-ml/uutf:=
	dev-ml/jsonm:=
"
DEPEND="${RDEPEND}
	dev-ml/findlib
	test? ( dev-vcs/git )
"

PATCHES=(
	"${FILESDIR}"/stublibs.patch
)

src_compile() {
	emake -j1

	cd doc || die
	emake man
}

src_test() {
	EMAIL=foo@bar.com emake -j1 tests
}

src_install() {
	default

	emake \
		DESTDIR="${D}" \
		OPAMINSTALLER_FLAGS="--prefix=\"${ED}/usr\" --libdir=\"${D}/$(ocamlc -where)\"" \
		libinstall
}