aboutsummaryrefslogtreecommitdiff
blob: 478cb0831a217ebfb609d7f77941607700c8f00c (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit java-pkg-opt-2

DESCRIPTION="A compiler for the Perl 6 programming language"
HOMEPAGE="http://rakudo.org"

if [[ ${PV} == "9999" ]]; then
	EGIT_REPO_URI="https://github.com/rakudo/${PN}.git"
	inherit git-r3
	KEYWORDS=""
else
	SRC_URI="${HOMEPAGE}/downloads/${PN}/${P}.tar.gz"
	KEYWORDS="~amd64 ~x86"
fi

LICENSE="Artistic-2"
SLOT="0"
# TODO: add USE="javascript" once that's usable in nqp
IUSE="clang java +moar test"
REQUIRED_USE="|| ( java moar )"

CDEPEND="~dev-lang/nqp-${PV}:${SLOT}=[java?,moar?,clang=]
	>=dev-lang/nqp-2016.04-r3"
RDEPEND="${CDEPEND}
	java? ( >=virtual/jre-1.7 )"
DEPEND="${CDEPEND}
	clang? ( sys-devel/clang )
	java? ( >=virtual/jdk-1.7 )
	>=dev-lang/perl-5.10"

PATCHES=(
	"${FILESDIR}/${PN}-2016.04-Makefile.in.patch"
	"${FILESDIR}/${P}-jna-lib.patch"
)

src_prepare() {
	epatch "${PATCHES[@]}"
	epatch_user
}

src_configure() {
	local backends
	use moar && backends+="moar,"
	use java && backends+="jvm"

	local myargs=(
		"--prefix=/usr"
		"--sysroot=/"
		"--sdkroot=/"
		"--backends=${backends}"
	)

	perl Configure.pl "${myargs[@]}" || die

	if use java; then
		NQP=$(java-pkg_getjars --with-dependencies nqp)
	fi
}

src_compile() {
	emake DESTDIR="${D}" NQP_JARS="${NQP}" BLD_NQP_JARS="${NQP}"
}

src_install() {
	emake DESTDIR="${D}" NQP_JARS="${NQP}" BLD_NQP_JARS="${NQP}" install
}

src_test() {
	RAKUDO_PRECOMP_PREFIX=$(mktemp -d) default
}