aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramano.kenji <amano.kenji@proton.me>2023-02-02 12:16:53 +0000
committeramano.kenji <amano.kenji@proton.me>2023-02-02 12:16:53 +0000
commit78362dcc305297b6b7be0f32c664775bcbb10398 (patch)
tree909b892c088e831dbdb1c920a949b0d6fc7e664f /dev-lang
parentapp-doc/ford: disable py3.11 (diff)
downloadguru-78362dcc305297b6b7be0f32c664775bcbb10398.tar.gz
guru-78362dcc305297b6b7be0f32c664775bcbb10398.tar.bz2
guru-78362dcc305297b6b7be0f32c664775bcbb10398.zip
Add rakudo.eclass and dev-raku/*
rakudo.eclass requires install-dist.raku installed by a modified version of dev-lang/rakudo. Gentoo overlay's dev-lang/rakudo doesn't install install-dist.raku. rakudo.eclass is minimal and elegant. dev-raku/* packages depend on rakudo.eclass. Signed-off-by: amano.kenji <amano.kenji@proton.me>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/moarvm/Manifest1
-rw-r--r--dev-lang/moarvm/metadata.xml18
-rw-r--r--dev-lang/moarvm/moarvm-2022.12.ebuild58
-rw-r--r--dev-lang/nqp/Manifest1
-rw-r--r--dev-lang/nqp/metadata.xml15
-rw-r--r--dev-lang/nqp/nqp-2022.12.ebuild148
-rw-r--r--dev-lang/rakudo/Manifest1
-rw-r--r--dev-lang/rakudo/metadata.xml8
-rw-r--r--dev-lang/rakudo/rakudo-2022.12.ebuild86
9 files changed, 336 insertions, 0 deletions
diff --git a/dev-lang/moarvm/Manifest b/dev-lang/moarvm/Manifest
new file mode 100644
index 000000000..4685c677f
--- /dev/null
+++ b/dev-lang/moarvm/Manifest
@@ -0,0 +1 @@
+DIST MoarVM-2022.12.tar.gz 14865827 BLAKE2B dbc4682885ce1ffb7ea2515fbbd6b9fe458cb27845aff67d10da8243b754e5d67afbe392ab98a96295e666ee3d74677e1982795e0edd3fe51149087e9a30dcf5 SHA512 875d2e6f604470e5ccdc8456891e36b9945c3b42da9459a2989a9695e2b3a66b819542c5846a16cc5c27025b0bfd7b8bc2c9a662e82ce8a44293e0c61291cd5e
diff --git a/dev-lang/moarvm/metadata.xml b/dev-lang/moarvm/metadata.xml
new file mode 100644
index 000000000..bb2a82182
--- /dev/null
+++ b/dev-lang/moarvm/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <use>
+ <flag name="asan">Enable clang's Address Sanitizer functionality. Expect longer compile time.</flag>
+ <flag name="clang">Use clang compiler instead of GCC</flag>
+ <flag name="jit">Enable Just-In-Time-Compiler. Has no effect except on AMD64 and Darwin.</flag>
+ <flag name="optimize">Enable optimization via CFLAGS</flag>
+ <flag name="ubsan">Enable clang's Undefined Behavior Sanitizer functionality. Expect longer compile time.</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">MoarVM/MoarVM</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-lang/moarvm/moarvm-2022.12.ebuild b/dev-lang/moarvm/moarvm-2022.12.ebuild
new file mode 100644
index 000000000..90a6b59ba
--- /dev/null
+++ b/dev-lang/moarvm/moarvm-2022.12.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_PN="MoarVM"
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git"
+ inherit git-r3
+ S="${WORKDIR}/${P}"
+else
+ SRC_URI="http://moarvm.org/releases/${MY_PN}-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/${MY_PN}-${PV}"
+fi
+
+DESCRIPTION="A 6model-based VM for NQP and Raku"
+HOMEPAGE="http://moarvm.org"
+LICENSE="Artistic-2"
+SLOT="0"
+
+IUSE="asan clang debug doc +jit optimize static-libs ubsan"
+
+RDEPEND="dev-libs/libatomic_ops
+ >=dev-libs/libuv-1.26:=
+ dev-libs/libffi:="
+DEPEND="${RDEPEND}"
+BDEPEND="clang? ( >=sys-devel/clang-3.1 )
+ dev-lang/perl"
+
+DOCS=( CREDITS README.markdown )
+
+# Tests are conducted via nqp
+RESTRICT="test primaryuri"
+
+src_configure() {
+ MAKEOPTS+=" NOISY=1"
+ use doc && DOCS+=( docs/* )
+ local prefix="${EPREFIX}/usr"
+ local libdir="${EPREFIX}/usr/$(get_libdir)"
+ einfo "--prefix '${prefix}'"
+ einfo "--libdir '${libdir}'"
+ local myconfigargs=(
+ "--prefix" "${prefix}"
+ "--has-libuv"
+ "--has-libatomic_ops"
+ "--has-libffi"
+ "--libdir" "${libdir}"
+ "--compiler" "$(usex clang clang gcc)"
+ "$(usex asan --asan)"
+ "$(usex debug --debug --no-debug)"
+ "$(usex optimize --optimize= --no-optimize)"
+ "$(usex static-libs --static)"
+ "$(usex ubsan --ubsan)"
+ )
+
+ perl Configure.pl "${myconfigargs[@]}" moarshared || die
+}
diff --git a/dev-lang/nqp/Manifest b/dev-lang/nqp/Manifest
new file mode 100644
index 000000000..fc51da90f
--- /dev/null
+++ b/dev-lang/nqp/Manifest
@@ -0,0 +1 @@
+DIST nqp-2022.12.tar.gz 5893490 BLAKE2B 0b465fbe6b740f511f40db4df4a67e61e3d205b6652ac557c1338be9cf15dfd52fbc14fe4d0524ab2d20f5d9eb0b555f6db7d6da59e3e45806c93e8a619bfb27 SHA512 5813d51f4a8aa719ea471e026c752b6492adc96a4325c546f87d5b190aec75b69727cf7ad421390398535eec0cfc7691420a51f8f1a2d2c25a92215b2a0becc8
diff --git a/dev-lang/nqp/metadata.xml b/dev-lang/nqp/metadata.xml
new file mode 100644
index 000000000..d8098a08f
--- /dev/null
+++ b/dev-lang/nqp/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <use>
+ <flag name="clang">Toggle usage of the clang compiler in conjunction with MoarVM</flag>
+ <flag name="moar">Build the MoarVM backend (experimental/broken)</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">perl6/nqp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-lang/nqp/nqp-2022.12.ebuild b/dev-lang/nqp/nqp-2022.12.ebuild
new file mode 100644
index 000000000..20a62cc8a
--- /dev/null
+++ b/dev-lang/nqp/nqp-2022.12.ebuild
@@ -0,0 +1,148 @@
+# 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 )
+ primaryuri"
+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/*
+}
diff --git a/dev-lang/rakudo/Manifest b/dev-lang/rakudo/Manifest
new file mode 100644
index 000000000..64b619141
--- /dev/null
+++ b/dev-lang/rakudo/Manifest
@@ -0,0 +1 @@
+DIST rakudo-2022.12.tar.gz 6026527 BLAKE2B d867614310e455ed0453ca41e8320b837839defab8169a70a5866ef530992ef1bdb33c16f6d4c9e5081ea51283803d4d362600e889bb3eb4a0eae658a4f7e1ef SHA512 7df9712f9035c5ead4e9aeb0164dcdfff7ba1ec175cabe192eed084d7d79a848ccfde8d9713b04d684b19e3b0685f784753956cf21e99437ae78bfeaa071eac1
diff --git a/dev-lang/rakudo/metadata.xml b/dev-lang/rakudo/metadata.xml
new file mode 100644
index 000000000..25a60dfe4
--- /dev/null
+++ b/dev-lang/rakudo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name="clang">Use Clang to compile the MoarVM backend</flag>
+ <flag name="moar">Use the MoarVM as backend</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-lang/rakudo/rakudo-2022.12.ebuild b/dev-lang/rakudo/rakudo-2022.12.ebuild
new file mode 100644
index 000000000..b23d3ceac
--- /dev/null
+++ b/dev-lang/rakudo/rakudo-2022.12.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit java-pkg-opt-2
+
+DESCRIPTION="A compiler for the Raku programming language"
+HOMEPAGE="https://rakudo.org"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="https://github.com/rakudo/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="https://rakudo.org/dl/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="Artistic-2"
+SLOT="0"
+# TODO: add USE="javascript" once that's usable in nqp
+IUSE="clang java +moar test"
+RESTRICT="!test? ( test )
+ primaryuri"
+REQUIRED_USE="|| ( java moar )"
+
+CDEPEND="~dev-lang/nqp-${PV}:${SLOT}=[java?,moar?,clang=]"
+RDEPEND="${CDEPEND}
+ java? ( >=virtual/jre-1.9 )"
+DEPEND="${CDEPEND}
+ clang? ( sys-devel/clang )
+ java? ( >=virtual/jdk-1.9 )
+ >=dev-lang/perl-5.10"
+
+pkg_pretend() {
+ if has_version dev-lang/rakudo; then
+ ewarn "Rakudo is known to fail compilation/installation with Rakudo"
+ ewarn "already being installed. So if it fails, try unmerging dev-lang/rakudo,"
+ ewarn "then do a new installation."
+ ewarn "(see Bug #584394)"
+ fi
+}
+
+src_configure() {
+ local backends
+ use moar && backends+="moar,"
+ use java && backends+="jvm"
+
+ local myargs=(
+ "--prefix=/usr"
+ "--sysroot=/"
+ "--sdkroot=/"
+ "--backends=${backends}"
+ )
+
+ perl Configure.pl "${myargs[@]}" || die
+
+ if use java; then
+ NQP=$(java-pkg_getjars --with-dependencies nqp)
+ fi
+}
+
+src_compile() {
+ emake NQP_JARS="${NQP}" BLD_NQP_JARS="${NQP}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" NQP_JARS="${NQP}" BLD_NQP_JARS="${NQP}" install
+ # install-dist.raku is required for installing raku modules
+ exeinto "/usr/share/perl6/core/tools"
+ doexe tools/install-dist.raku
+ # Protect important directories from removal
+ for repo in site vendor
+ do
+ keepdir /usr/share/perl6/$repo/bin
+ keepdir /usr/share/perl6/$repo/dist
+ keepdir /usr/share/perl6/$repo/precomp
+ keepdir /usr/share/perl6/$repo/resources
+ keepdir /usr/share/perl6/$repo/short
+ keepdir /usr/share/perl6/$repo/sources
+ done
+}
+
+src_test() {
+ RAKUDO_PRECOMP_PREFIX=$(mktemp -d) default
+}