Merge remote-tracking branch 'github/pr/703'. Fixes bug 560362.
[gentoo.git] / dev-lang / nqp / nqp-2015.07.2.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 # still not working
8 RESTRICT="test"
9
10 inherit eutils multilib versionator
11
12 GITCRAP=2d22571
13 PARROT_VERSION="6.7.0"
14
15 DESCRIPTION="Not Quite Perl, a Perl 6 bootstrapping compiler"
16 HOMEPAGE="http://rakudo.org/"
17 SRC_URI="https://github.com/perl6/${PN}/tarball/${PV} -> ${P}.tar.gz"
18
19 LICENSE="Artistic-2"
20 SLOT="0"
21 KEYWORDS="~x86 ~amd64"
22 IUSE="doc parrot java +moar"
23 REQUIRED_USE="|| ( parrot java moar )"
24
25 RDEPEND="parrot? ( >=dev-lang/parrot-${PARROT_VERSION}:=[unicode] )
26         java? ( >=virtual/jre-1.7 )
27         moar? ( =dev-lang/moarvm-2015.07 )
28         dev-libs/libffi"
29 DEPEND="${RDEPEND}
30         java? ( >=virtual/jdk-1.7 )
31         dev-lang/perl"
32
33 S=${WORKDIR}/perl6-nqp-${GITCRAP}
34
35 src_configure() {
36         use java && myconf+="jvm,"
37         use parrot && myconf+="parrot,"
38         use moar && myconf+="moar,"
39         perl Configure.pl --backend=${myconf} --prefix=/usr || die
40         # dirty hack to make dyncall not fail
41         sed -i -e 's/-Werror=missing-prototypes//' Makefile || die
42         sed -i -e 's/-Werror=missing-declarations//' Makefile || die
43         sed -i -e 's/-Werror=strict-prototypes//' Makefile || die
44
45         # more dirty hack to allow building with newer gcc
46         sed -i -e 's/-Werror=implicit-function-declaration//' Makefile || die
47         sed -i -e 's/-Werror=nested-externs//' Makefile || die
48 }
49
50 src_compile() {
51         emake -j1 || die
52 }
53
54 src_test() {
55         emake -j1 test || die
56 }
57
58 src_install() {
59         emake DESTDIR="${ED}" install || die
60
61         dodoc CREDITS README.pod || die
62
63         if use doc; then
64                 dodoc -r docs/* || die
65         fi
66 }