diff options
author | Patrick Lauer <patrick@gentoo.org> | 2023-02-27 16:33:21 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2023-02-27 16:43:46 +0000 |
commit | 6b25ed3b13b387cb4331f77ca14250105480f8fa (patch) | |
tree | 92852104e2cdbddbf8094a64c292dee9f76ce64c /dev-lang/nqp | |
parent | dev-lang/moarvm: add 2023.02 (diff) | |
download | gentoo-6b25ed3b13b387cb4331f77ca14250105480f8fa.tar.gz gentoo-6b25ed3b13b387cb4331f77ca14250105480f8fa.tar.bz2 gentoo-6b25ed3b13b387cb4331f77ca14250105480f8fa.zip |
dev-lang/nqp: add 2023.02
Signed-off-by: Patrick Lauer <patrick@gentoo.org>
Diffstat (limited to 'dev-lang/nqp')
-rw-r--r-- | dev-lang/nqp/Manifest | 1 | ||||
-rw-r--r-- | dev-lang/nqp/nqp-2023.02.ebuild | 147 |
2 files changed, 148 insertions, 0 deletions
diff --git a/dev-lang/nqp/Manifest b/dev-lang/nqp/Manifest index e3376e5fab95..114da09c5336 100644 --- a/dev-lang/nqp/Manifest +++ b/dev-lang/nqp/Manifest @@ -3,3 +3,4 @@ DIST nqp-2021.08.tar.gz 5208527 BLAKE2B 1f2e454e63484a8a636f61c9110b4a20775ec59d DIST nqp-2021.10.tar.gz 5207621 BLAKE2B 85b6627bc843d211ef8c296e63a97b0f80e019f89080f7c94b1e55767e4fab430c426c77aea741d601e75f6fb354a1f8b6c6077c70ab5cbfd2edef1621137af3 SHA512 d308045cc8a01298bcc544e8fd27752d1fc28e421b1cd24f1d5675333ba8cd71cb946e760ba485710456aebf21eeab1d2f85abffe49336471f1148071df6aa98 DIST nqp-2022.02.tar.gz 5220819 BLAKE2B eba57834cc883e5bab26d0496df5bb059cc31f893e25833ada26cfa4796b9f822d1bb17e6ac0eb2474238e78565cf1da3be6f82d34a82bb4ac70cc19e03e11aa SHA512 0a51eb96486a254543ffbc2dac5d32a2b218a7fd774ccd3c8d4ba23f33dacbebdc0190e7cc919103f57573ea74ff8592200759c9768485044a4433647958ba8f DIST nqp-2022.06.tar.gz 5222082 BLAKE2B bf5f3e98ad40d76ca45887ed1d64d3a5d11b91493f5af7324c5ebe62c3c34c9ababaf64e4083c30a4f4a16db46710b28054e423bd84aa259e8b293330265e2c7 SHA512 e044701d77ea6baeb51202a808a86a46e99cae1db03888cd2848424e9dfbb318a82ccf21476050f26e388f3c5137e4389626d52a7434d0ffb1d2c97501e23407 +DIST nqp-2023.02.tar.gz 6023282 BLAKE2B 546ef7c0039857a2be07b2a0601c32f5f8719674a64f599dc1c6faa34dcc12bf7b205da9356c3c2632e01eb3cdc22a8c6bbb7d70180773d58c7a6989c56df2b7 SHA512 c71b7d5b0237501a10b30985dcd48f17f9741dc09360b2a98c24134cd1dde8fbb868eef39d97aba2ba031b52e06b5220095792c834d5d154218e45dd1af87cdd diff --git a/dev-lang/nqp/nqp-2023.02.ebuild b/dev-lang/nqp/nqp-2023.02.ebuild new file mode 100644 index 000000000000..601224b3ca76 --- /dev/null +++ b/dev-lang/nqp/nqp-2023.02.ebuild @@ -0,0 +1,147 @@ +# Copyright 1999-2023 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 +else + SRC_URI="https://github.com/perl6/${PN}/releases/download/${PV}/${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="Not Quite Perl, a Raku 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/jna:4 + ) + moar? ( ~dev-lang/moarvm-${PV}[clang=] )" +RDEPEND="${CDEPEND} + java? ( >=virtual/jre-1.9 )" +DEPEND="${CDEPEND}" +BDEPEND="${CDEPEND} + clang? ( sys-devel/clang ) + java? ( >=virtual/jdk-1.9 ) + 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 +} + +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}" \ + 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/* +} |