commit: a8fd775af60e46ebff8af33d233a211d36f7c194 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org> AuthorDate: Thu Mar 3 18:16:36 2022 +0000 Commit: 罗百科 <patrick <AT> gentoo <DOT> org> CommitDate: Thu Mar 3 18:16:36 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8fd775a
dev-lang/nqp: Bump to 2022.02 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org> dev-lang/nqp/Manifest | 1 + dev-lang/nqp/nqp-2022.02.ebuild | 147 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+) diff --git a/dev-lang/nqp/Manifest b/dev-lang/nqp/Manifest index 0a23db8e033a..fa55375efff7 100644 --- a/dev-lang/nqp/Manifest +++ b/dev-lang/nqp/Manifest @@ -1,3 +1,4 @@ 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 +DIST nqp-2022.02.tar.gz 5220819 BLAKE2B eba57834cc883e5bab26d0496df5bb059cc31f893e25833ada26cfa4796b9f822d1bb17e6ac0eb2474238e78565cf1da3be6f82d34a82bb4ac70cc19e03e11aa SHA512 0a51eb96486a254543ffbc2dac5d32a2b218a7fd774ccd3c8d4ba23f33dacbebdc0190e7cc919103f57573ea74ff8592200759c9768485044a4433647958ba8f diff --git a/dev-lang/nqp/nqp-2022.02.ebuild b/dev-lang/nqp/nqp-2022.02.ebuild new file mode 100644 index 000000000000..6b6f6e70f126 --- /dev/null +++ b/dev-lang/nqp/nqp-2022.02.ebuild @@ -0,0 +1,147 @@ +# Copyright 1999-2022 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/* +}