dev-lang/rakudo: revbump 2016.04-r2
authorMarshall Brewer <tomboy64@sina.cn>
Thu, 26 May 2016 15:56:10 +0000 (17:56 +0200)
committerAmy Winston <amynka@gentoo.org>
Thu, 2 Jun 2016 12:52:37 +0000 (14:52 +0200)
- switched to java-pkg-opt-2
- removed unnecessary DESTDIR hack
- not requiring nqp to have USE=-java/-moar, if it's not set for
  rakudo
- enable usage of nqp with system jna (patch and mechanics contributed
  by Chewi)

dev-lang/rakudo/files/rakudo-2016.04-jna-lib.patch [new file with mode: 0644]
dev-lang/rakudo/rakudo-2016.04-r1.ebuild [deleted file]
dev-lang/rakudo/rakudo-2016.04-r2.ebuild [new file with mode: 0644]

diff --git a/dev-lang/rakudo/files/rakudo-2016.04-jna-lib.patch b/dev-lang/rakudo/files/rakudo-2016.04-jna-lib.patch
new file mode 100644 (file)
index 0000000..3f4532f
--- /dev/null
@@ -0,0 +1,21 @@
+Upstream uses -Xbootclasspath, which prevents us from using
+LD_LIBRARY_PATH, thefore we need to set jna.boot.library.path.
+See http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4285197.
+
+Chewi
+2016/05/15
+
+diff -Naur rakudo-2016.04.orig/tools/build/create-jvm-runner.pl rakudo-2016.04/tools/build/create-jvm-runner.pl
+--- rakudo-2016.04.orig/tools/build/create-jvm-runner.pl       2015-12-25 19:23:19.000000000 +0000
++++ rakudo-2016.04/tools/build/create-jvm-runner.pl    2016-05-15 11:30:37.488085661 +0100
+@@ -60,7 +60,10 @@
+ }
+ my $classpath = join($cpsep, ($jardir, $libdir, $nqplibdir));
++my $jna_lib = `java-config --query LIBRARY_PATH --package jna-4`;
++chomp $jna_lib;
+ my $jopts = '-noverify -Xms100m -Xbootclasspath/a:' . $perl6jars 
++          . ' -Djna.boot.library.path=' . $jna_lib
+           . ' -cp ' . ($^O eq 'MSWin32' ? '"%CLASSPATH%";' : '$CLASSPATH:') . $classpath
+           . ' -Dperl6.prefix=' . $prefix
+           . ' -Djna.library.path=' . $sharedir
diff --git a/dev-lang/rakudo/rakudo-2016.04-r1.ebuild b/dev-lang/rakudo/rakudo-2016.04-r1.ebuild
deleted file mode 100644 (file)
index e677758..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=6
-
-inherit java-pkg-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"
-
-RDEPEND="~dev-lang/nqp-${PV}:=[java=,moar=,clang=]"
-DEPEND="${RDEPEND}
-       clang? ( sys-devel/clang )
-       >=dev-lang/perl-5.10"
-
-REQUIRED_USE="|| ( java moar )"
-PATCHES=( "${FILESDIR}/${PN}-2016.04-Makefile.in.patch" )
-
-pkg_pretend() {
-       if has_version dev-lang/rakudo && use java; then
-               die "Rakudo is known to fail compilation with the jvm backend if it's already installed."
-       fi
-}
-
-pkg_setup() {
-       use java && java-pkg-2_pkg_setup
-}
-
-src_prepare() {
-       eapply "${PATCHES[@]}"
-
-       # yup, this is ugly. but emake doesn't respect DESTDIR.
-       for i in Moar JVM; do
-               echo "DESTDIR   = ${D}" > "${T}/Makefile-${i}.in" || die
-               cat "${S}/tools/build/Makefile-${i}.in" >> "${T}/Makefile-${i}.in" || die
-               mv "${T}/Makefile-${i}.in" "${S}/tools/build/Makefile-${i}.in" || die
-       done
-
-       eapply_user
-       use java && java-pkg-2_src_prepare
-}
-
-src_configure() {
-       local backends
-       use java && backends+="jvm,"
-       use moar && backends+="moar,"
-       local myargs=( "--prefix=/usr"
-               "--sysroot=/"
-               "--sdkroot=/"
-               "--make-install"
-               "--sdkroot=/"
-               "--backends=${backends}"
-       )
-       perl Configure.pl "${myargs[@]}"
-}
-
-src_compile() {
-       emake DESTDIR="${D}"
-}
-
-src_test() {
-       export RAKUDO_PRECOMP_PREFIX=$(mktemp -d)
-       default
-}
-
-src_install() {
-       emake DESTDIR="${D}" install
-}
diff --git a/dev-lang/rakudo/rakudo-2016.04-r2.ebuild b/dev-lang/rakudo/rakudo-2016.04-r2.ebuild
new file mode 100644 (file)
index 0000000..18eb631
--- /dev/null
@@ -0,0 +1,84 @@
+# 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"
+)
+
+pkg_pretend() {
+       if has_version dev-lang/rakudo; then
+               ewarn "Rakudo is known to fail compilation/installation with Rakudo"
+               ewarn "already being installed. So if it fails, try unmerging dev-lang/rakudo,"
+               ewarn "then do a new installation."
+               ewarn "(see Bug #584394)"
+       fi
+}
+
+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
+}