diff options
author | Patrick Lauer <patrick@gentoo.org> | 2021-11-25 13:50:56 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2021-11-25 13:51:37 +0000 |
commit | f63399afe020efbfee76a9a65fdbb193b854eac8 (patch) | |
tree | ad54dec338e39c5c08edd57a1203331680613aec /dev-lang/nqp | |
parent | dev-lang/moarvm: Bump to 2021.10 (diff) | |
download | gentoo-f63399afe020efbfee76a9a65fdbb193b854eac8.tar.gz gentoo-f63399afe020efbfee76a9a65fdbb193b854eac8.tar.bz2 gentoo-f63399afe020efbfee76a9a65fdbb193b854eac8.zip |
dev-lang/nqp: Bump to 2021.10
Package-Manager: Portage-3.0.28, Repoman-3.0.3
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-2021.10.ebuild | 159 |
2 files changed, 160 insertions, 0 deletions
diff --git a/dev-lang/nqp/Manifest b/dev-lang/nqp/Manifest index a4de935697d5..0a23db8e033a 100644 --- a/dev-lang/nqp/Manifest +++ b/dev-lang/nqp/Manifest @@ -1,2 +1,3 @@ DIST nqp-2021.06.tar.gz 5208065 BLAKE2B 7314f425e418161befc55f9490453a3a4c3caa0ddf13e2b3bbcc9a20a6204aba9517885b6ecccddbbaf078b60c74be90fe556bf99dcc6014e57a7c873e96381d SHA512 482ec4a99d09b3660f03fd3c822a2f8c72dbdfeda1bcfdac0b4bcfa364ec57cbfdebf3b2872f8649c86d3d2d7603961d75e00d73dc417e5ac2a32f643bcfcabe DIST nqp-2021.08.tar.gz 5208527 BLAKE2B 1f2e454e63484a8a636f61c9110b4a20775ec59dd7734fe32a93b01aaad5ea977ea74678085a66d9f072234de5768d8023182d6df56a448f2a0aa0fd3c1c76c3 SHA512 fca1dc8c36f914304f97330cb33be3a94c539f3cb6cc80d898c734dcf04b12b8be30ffce358a0a5320c6ea56afd627f792b4a8fa3f94134776922ae088b92814 +DIST nqp-2021.10.tar.gz 5207621 BLAKE2B 85b6627bc843d211ef8c296e63a97b0f80e019f89080f7c94b1e55767e4fab430c426c77aea741d601e75f6fb354a1f8b6c6077c70ab5cbfd2edef1621137af3 SHA512 d308045cc8a01298bcc544e8fd27752d1fc28e421b1cd24f1d5675333ba8cd71cb946e760ba485710456aebf21eeab1d2f85abffe49336471f1148071df6aa98 diff --git a/dev-lang/nqp/nqp-2021.10.ebuild b/dev-lang/nqp/nqp-2021.10.ebuild new file mode 100644 index 000000000000..81e93919b90b --- /dev/null +++ b/dev-lang/nqp/nqp-2021.10.ebuild @@ -0,0 +1,159 @@ +# Copyright 1999-2021 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 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/* +} |