Skip to content

Commit

Permalink
dev-lang/nqp: Bump
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.4, Repoman-2.3.2
  • Loading branch information
patricklauer committed Mar 10, 2017
1 parent 318ee81 commit 50f4fc5
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-lang/nqp/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ DIST nqp-2016.10.tar.gz 3943840 SHA256 d66905006e74b6d55f7abd3fba051fdf9a2583879
DIST nqp-2016.11.tar.gz 3946759 SHA256 08d3eb664ad049e72bd9821755564ee7cbbf0da4833f1bcc9441e970c5f73ccd SHA512 bd99e286dc09fa5096429cc35847e43893d30a9ce9efdfb55346c04eeeda0c44307fd39217107a2210040b7a4dcc900f69279e19d1cc54a469ab286377e28f6a WHIRLPOOL 373fe379cf8fe965d9c1097042a55472d69322c08e613a9d55749bbb4da084b84adee5c5dfe93c4f9bf81298e28308d697f66482b80a16ada3ea9ea81754f54b
DIST nqp-2016.12.tar.gz 3643470 SHA256 3dfd71f7f51b78a8266d159a41a4b9d0a3fff1b93b7366054c2daf14ec5df981 SHA512 5967029227b6f527f25cfdc0f27e5466cbff4286e2ef7252b3767fe5f752210d5637d634c4e946f32797e4e380f2f937523a325497214767fae3fa39764eecb2 WHIRLPOOL 67e7138d8d7bd428f77d37721f206a613498cabb07ea0cdfa9afa730505e303709f86373dc36d0ac149f35e08193e85621e41131832e5bafbd5765d1b0d8ed51
DIST nqp-2017.01.tar.gz 3654574 SHA256 6b407aa2a908cc66dc60b8a1b5a7a76990afcecd25cafd3ecf2ef4c7e8804f62 SHA512 4c32a80df0c982700a2efad8c614efd8595a7dc67ad431fec05e83619e986c9cc8810a8ab80356892e6f42b8c421b38f11a147a3216b7011eb837158b08fdaea WHIRLPOOL b9e5ea5ae91e2964255f6caa9c4aaccc4463cc0427a8056b304e8dcc8b42b143c19840d4dbf77882bf1db0f7e691c91be51e0568034e370778b0e63dc350bbae
DIST nqp-2017.02.tar.gz 3657637 SHA256 cf2f094296fc7706b2c2f0037331dd624dcdcb2cb41239883c8297b3b1fd38ce SHA512 4781fccfbe0bbcbb4529c8ed540263fc620bfcff2923c39dabd437824353caba6d2627082312bb7841b40b01caaf39282d6af9fcaa18601f9647e769e220d369 WHIRLPOOL d97b5aa9e119bf85fbc8c8da5954466455ff5b26580e61f668ae539ccf6ec4284cdd5be3afa2da053df9459903a3fbe6f0bebc9a47213e9e1e46ecfec943c1ef
159 changes: 159 additions & 0 deletions dev-lang/nqp/nqp-2017.02.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit java-pkg-opt-2 multibuild

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

DESCRIPTION="Not Quite Perl, a Perl 6 bootstrapping compiler"
HOMEPAGE="http://rakudo.org/"

LICENSE="Artistic-2"
SLOT="0"
IUSE="doc clang java +moar test"
REQUIRED_USE="|| ( java moar )"

CDEPEND="java? (
dev-java/asm:4
dev-java/jline:0
dev-java/jna:4
)
moar? ( ~dev-lang/moarvm-${PV}[clang=] )"
RDEPEND="${CDEPEND}
java? ( >=virtual/jre-1.7 )"
DEPEND="${CDEPEND}
clang? ( sys-devel/clang )
java? ( >=virtual/jdk-1.7 )
dev-lang/perl"

pkg_pretend() {
if has_version dev-lang/rakudo || has_version dev-lang/nqp; then
ewarn "NQP is known to fail compilation/installation with Rakudo and/or NQP"
ewarn "already being installed. So if it fails, try uninstalling both"
ewarn "dev-lang/nqp and dev-lang/rakudo, then do a new installation."
ewarn "(see Bug #584394)"
fi
}

java_prepare() {
# Don't clean stage0 jars.
einfo "Cleaning upstream jars"
java-pkg_clean 3rdparty/

# Don't use jars we just deleted.
sed -i -r 's/(:3rdparty[^:]*)+/:${THIRDPARTY_JARS}/g' \
src/vm/jvm/runners/nqp-j || die
}

src_prepare() {
MULTIBUILD_VARIANTS=()
use moar && MULTIBUILD_VARIANTS+=( moar )
use java && MULTIBUILD_VARIANTS+=( jvm )

multibuild_copy_sources

# This will pull in conditional java_prepare
default
}

nqp_configure() {
pushd "${BUILD_DIR}" > /dev/null || die
local myconfargs=(
"--backend=${MULTIBUILD_VARIANT}"
"--prefix=/usr" )

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

nqp_compile() {
if [[ "${MULTIBUILD_VARIANT}" = jvm ]]; then
emake -j1 \
-C "${BUILD_DIR}" \
THIRDPARTY_JARS=$(java-pkg_getjars --with-dependencies asm-4,jline,jna-4) \
JAVAC="$(java-pkg_get-javac) $(java-pkg_javac-args)"
elif [[ "${MULTIBUILD_VARIANT}" = moar ]]; then
emake -j1 \
-C "${BUILD_DIR}"
fi
}

nqp_test() {
emake -j1 \
-C "${BUILD_DIR}" \
test
}

nqp_install() {
# This is the actual reason we need multibuild.eclass.
# We need to distinguish the install procedure for MoarVM and JVM backends.
case "${MULTIBUILD_VARIANT}" in
moar)
emake \
DESTDIR="${ED}" \
-C "${BUILD_DIR}" \
install
;;
jvm)
pushd "${BUILD_DIR}" > /dev/null || die
# Set JAVA_PKG_JARDEST early.
java-pkg_init_paths_

# Upstream sets the classpath to this location. Perhaps it's
# used to locate the additional libraries?
java-pkg_addcp "${JAVA_PKG_JARDEST}"

insinto "${JAVA_PKG_JARDEST}"
local jar

for jar in *.jar; do
if has ${jar} ${PN}.jar ${PN}-runtime.jar; then
# jars for NQP itself.
java-pkg_dojar ${jar}
else
# jars used by NQP.
doins ${jar}
fi
done

# Upstream uses -Xbootclasspath/a, which is faster due to lack
# of verification, but gjl isn't flexible enough yet. :(
java-pkg_dolauncher ${PN}-j --main ${PN}
dosym ${PN}-j /usr/bin/${PN}
dobin tools/jvm/eval-client.pl
popd > /dev/null || die
;;
*)
die "Unknown MULTIBUILD_VARIANT ${MULTIBUILD_VARIANT}."
;;
esac
}

src_configure() {
multibuild_foreach_variant nqp_configure
}

src_compile() {
multibuild_foreach_variant nqp_compile
}

src_test() {
multibuild_foreach_variant nqp_test
}

src_install() {
multibuild_foreach_variant nqp_install

dodoc CREDITS README.pod
use doc && dodoc -r docs/*
}

0 comments on commit 50f4fc5

Please sign in to comment.