summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2020-12-31 07:21:36 +0000
committerPatrick Lauer <patrick@gentoo.org>2020-12-31 07:22:51 +0000
commit812a9ac8d2114d3c2780f971833e642712b801a3 (patch)
treed7b1759f518e925c57e4f3b0282f87fc695ea26c /dev-lang
parentdev-lang/moarvm: Bump (diff)
downloadgentoo-812a9ac8d2114d3c2780f971833e642712b801a3.tar.gz
gentoo-812a9ac8d2114d3c2780f971833e642712b801a3.tar.bz2
gentoo-812a9ac8d2114d3c2780f971833e642712b801a3.zip
dev-lang/nqp: Bump
Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Patrick Lauer <patrick@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/nqp/Manifest1
-rw-r--r--dev-lang/nqp/nqp-2020.12.ebuild160
2 files changed, 161 insertions, 0 deletions
diff --git a/dev-lang/nqp/Manifest b/dev-lang/nqp/Manifest
index f4b18b2cb7a0..13900a24a5df 100644
--- a/dev-lang/nqp/Manifest
+++ b/dev-lang/nqp/Manifest
@@ -5,3 +5,4 @@ DIST nqp-2020.08.tar.gz 3951313 BLAKE2B 0eda6b50268cd4faf49a7311e4d94d9846e22307
DIST nqp-2020.09.tar.gz 3951646 BLAKE2B 9ec1d121f9dc276ad52ea22d43fb24fefeda009f648b64f330669d7f9aaaef599522cca708b3671f982969cba0a1346cc078c55c98247545408b3a929899edd1 SHA512 dcebf63ea062c0fec95d701b1f20c492c845060599f4524fa87758ce5f8e52f6eae9a409c31b238783285f30a497acffd97242dc2ca7fbe4b8dd20291104b261
DIST nqp-2020.10.tar.gz 3954398 BLAKE2B 5c44a20c3696bb596bd1d3088fba8db8c63ce6e612f00c2d24456dc7d908b12a214b4bde7e4e79505c39f6237a6f91578de47778185fa6cc3b6287c90e6c370e SHA512 279715fa0b2012852cc31b9e7898092510a1ba76005576a3ffe38f9dc8e9c002a4161be8f0b66e38c501e656a8124a320dbf2c90c89f53e57d0950e1baa1ea2b
DIST nqp-2020.11.tar.gz 3954688 BLAKE2B d273c78c8f2083908b2815dc10787fec31404eb13c1e64253e7e5ae896d27a3755cf5c8045d47c4f465178568731e0d74951db6e45d103cf3ee18470124e97e0 SHA512 51b5e7f9d290bca7ada24cf9c12c61608be92269fc848976cada49f7445694e0f26929b5f9e90a9153eb379f0d74a6bb8068cd5ebf383d4501f75535b70e7605
+DIST nqp-2020.12.tar.gz 3957981 BLAKE2B d45ad66ebb0788db6e7191b4b7af4093b73e63e5f66ab4ccab62163b0285adb7d4e18a7c906c34f99dd63e0920f4d6e16e11005eb5df1d726796e9f106f9c4f8 SHA512 4ce87dc868c91565ebe896db766403bb018b2f5ea919bd0fb5b173498ba124712ffa795ec4e219240e5aabb59c55285bee5e46d3ac3d5869fc445b0ab3ea8485
diff --git a/dev-lang/nqp/nqp-2020.12.ebuild b/dev-lang/nqp/nqp-2020.12.ebuild
new file mode 100644
index 000000000000..c41412d388c5
--- /dev/null
+++ b/dev-lang/nqp/nqp-2020.12.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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}/releases/download/${PV}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Not Quite Perl, a Perl 6 bootstrapping compiler"
+HOMEPAGE="https://rakudo.org"
+
+LICENSE="Artistic-2"
+SLOT="0"
+IUSE="doc clang java +moar test"
+RESTRICT="!test? ( 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.8 )"
+DEPEND="${CDEPEND}"
+BDEPEND="${CDEPEND}
+ clang? ( sys-devel/clang )
+ java? ( >=virtual/jdk-1.8 )
+ 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=${EPREFIX}/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/*
+}