From 4856d9d89d9f533d36c415521ddc9c23be3c6033 Mon Sep 17 00:00:00 2001
From: V3n3RiX <venerix@koprulu.sector>
Date: Thu, 30 Jan 2025 22:43:19 +0000
Subject: gentoo auto-resync : 30:01:2025 - 22:43:19

---
 dev-lang/Manifest.gz                               | Bin 22318 -> 22309 bytes
 dev-lang/crystal/Manifest                          |   3 +-
 dev-lang/crystal/crystal-1.15.0-r1.ebuild          | 126 ++++++++
 dev-lang/crystal/crystal-1.15.0.ebuild             | 115 --------
 ...l-1.15.0-remove-enviroment-clearing-tests.patch |  28 ++
 dev-lang/go-bootstrap/files/make-go-bootstraps     |   0
 dev-lang/nprolog/Manifest                          |   2 +
 dev-lang/nprolog/nprolog-3.89.ebuild               |  59 ++++
 dev-lang/ruby/Manifest                             |   4 +
 dev-lang/ruby/ruby-3.1.6-r3.ebuild                 | 289 +++++++++++++++++++
 dev-lang/ruby/ruby-3.2.6-r4.ebuild                 | 295 +++++++++++++++++++
 dev-lang/ruby/ruby-3.3.7-r1.ebuild                 | 302 ++++++++++++++++++++
 dev-lang/ruby/ruby-3.4.1-r1.ebuild                 | 316 +++++++++++++++++++++
 13 files changed, 1423 insertions(+), 116 deletions(-)
 create mode 100644 dev-lang/crystal/crystal-1.15.0-r1.ebuild
 delete mode 100644 dev-lang/crystal/crystal-1.15.0.ebuild
 create mode 100644 dev-lang/crystal/files/crystal-1.15.0-remove-enviroment-clearing-tests.patch
 mode change 100644 => 100755 dev-lang/go-bootstrap/files/make-go-bootstraps
 create mode 100644 dev-lang/nprolog/nprolog-3.89.ebuild
 create mode 100644 dev-lang/ruby/ruby-3.1.6-r3.ebuild
 create mode 100644 dev-lang/ruby/ruby-3.2.6-r4.ebuild
 create mode 100644 dev-lang/ruby/ruby-3.3.7-r1.ebuild
 create mode 100644 dev-lang/ruby/ruby-3.4.1-r1.ebuild

(limited to 'dev-lang')

diff --git a/dev-lang/Manifest.gz b/dev-lang/Manifest.gz
index 80e996c54c7b..6ac654d2866d 100644
Binary files a/dev-lang/Manifest.gz and b/dev-lang/Manifest.gz differ
diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 89bb01f53e4f..a107aa8cf01a 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -1,5 +1,6 @@
 AUX crystal-0.27.0-gentoo-tests-long-unix-2.patch 469 BLAKE2B 66bcc1d0dd9582cac4ba89a2ccc2c7a2ac3ff4994cd687191470f2d481f9a6e3a91aaaf705f92f7600118a9cda015a9554056520502df7ae6462e111665c7330 SHA512 d840ac343ef566e404dc84e908bead5a020dfd88b8c0432f17bceea8d710d435626dc72b4be6622dbcd683a149bca16e781320cf74fc3f2598f84d169c6f7faa
 AUX crystal-0.27.0-gentoo-tests-long-unix.patch 3317 BLAKE2B df1040abdb587ac3fffb8129d4f1bafc492e38ad5dcfdea5cfbf4426849b099c4d94dac61c93ae7fcae46b60dea1809f52ad373efcd89796a3c1f119614063c1 SHA512 a9ed819a864465e062b4d6a568f14fbb8adc1db01071c79164dede8b2b8d83e07b785cd8196826097de5119e0bdc7d6e194cf4e10cc677bd2bdf158d124c2ad2
+AUX crystal-1.15.0-remove-enviroment-clearing-tests.patch 936 BLAKE2B e9d3f2384c79eb17a52b71636147ac97aada9a7ddccc619fd0a5ccd2c89d3e7f135d9526931557f4bd15eef5232e0cb469715568d8d07b7e5530947720f67921 SHA512 e0e48d65098d07511238b4be0c1daa8c8d9aec42148a5115526431f1f507425160324e98d2ca647fb135b3a0b534cf0b376ae7563bd6c9046ea1264b860f44ad
 AUX crystal-1.7.2-extra-spec-flags.patch 1080 BLAKE2B 3054e38d4e7d114f1b0a08b367f9a5b366bbe269c75b9195abf9dc39231b32428a108c4254abd0bdb29b2ac6a94d6d256eccc68ca69f80a273cd17e0c0115fc7 SHA512 3c3fd6a42b291a42f76ec76101d669011eb02d4d17f35c8ad31c5a49aa3655a2315999e2401af7f3bc26445f74f432430a44b021846238d345d9c14b1009fdc5
 DIST crystal-1.14.0-1-linux-x86_64.tar.gz 51712092 BLAKE2B 25281d0488ce84b278005e918fd7ae893ec690d50b01c65f06370e24d3ef6548a3ff823c0ce1903fc3d6d0c4108ab8c72365ce51f1ebb64519e0076cc5df9dff SHA512 ff7839166ebe0217149d0185c27fa0d48cd7322ddca3492e3bbbfaf505696994ce04a86eb1f51f6c0633892ebc4b82bac53ec9cb26c0a9c588c5002a984f0038
 DIST crystal-1.14.0.tar.gz 3726474 BLAKE2B 97efe777790b4d2330f6891bbe91a709fb0aacf7989a60b70c3d22c2735e83b9315899ad529f4605eed7dc4b4eed14f4d51ccd8a47dfc55057f15acd62c8c10d SHA512 561e14212b8f3e2841739408870e70a79cbc11097070760e75e4013a030082db050f6615453da54adceae3f0de12af43498f33fab9b7f4ecfa6860d582dec095
@@ -9,5 +10,5 @@ DIST crystal-1.15.0-1-linux-x86_64.tar.gz 51497623 BLAKE2B 03059b38b1df3a035c824
 DIST crystal-1.15.0.gh.tar.gz 3812860 BLAKE2B a6b52007d6a4975d2011104f65cec932300bb6f84f497bfda138d987e844cb025d4690b0f74335aff42295c5d355ac73371cab86db87ca9819c1885d98f76bd8 SHA512 ea07de4b9c6c46e96f05d816d0504f8b0206e89fe7e4236038dc3b0875e52e89c711cc798b8fc30f66b02dd48cec70e0ea76160f14447577761411a41f1b28fa
 EBUILD crystal-1.14.0.ebuild 2632 BLAKE2B 6284e97c98096fd14101a4308d2db3eb265d26241f181658ee24615622ef3686c4a79b47d58536b127c035dece0e63f1ae35f6605af7b73f362a166307810f80 SHA512 e27bb51f2dd874cb8633ed0ad594aaa512676d841a9d1fd991169a54595c73ee4ff40f665df0b5d4a012a43f85ad5a90480e59b547ae42a77a204be545716579
 EBUILD crystal-1.14.1.ebuild 2633 BLAKE2B 1945457158a0d549f5be113342d47b3919af5bd80030f8ac3b4a0279a1054c11b440aa130e616eb6fde27b9217dc453623d2b1e32f2e0abe0997a15564dd3a6f SHA512 61d9dba45711ccbadf279d53923c6c543d01ca6d2d3c5fa13cf105d16ab9d67e64a44fc9f609106eac0b470dd0ff263ad8eff1b90f30e4de2e7d354ead4ceb20
-EBUILD crystal-1.15.0.ebuild 2389 BLAKE2B 493df7328e2f107412bcc932ef210c3c0899eed1031b44ed7689e92405387a5231637ef0213c9278606664163a6f2bb70b02b60526e3dd3ee72d260e618fc0d3 SHA512 6ed6a62688fb0244d3f41dd225e61e079770af2ea2396bbf1db8e5dd35aa3d867560a00b4c076fbc6bd19d337b6f1dc56ff1c94eb886a2f70a5b6cdeb3a66dae
+EBUILD crystal-1.15.0-r1.ebuild 2785 BLAKE2B cf0495de84b1af4d292bd05c153db8a1412dcfed2a4bef00abd4c6b984d368b822f162c09ab0177f0b070e39aae2cbfc3582630c51f6f7bfe4a9c6efa83b406e SHA512 5333b4f5456ab7a58c3df1669627dae50e9a82ab71c77ddf564fba73e3d182c29721a7ac624b3e1ab0584f79097d6ca37f0c313b420d29507aedafb4c1de7b94
 MISC metadata.xml 762 BLAKE2B 591f38c882318a6564501cc61abe6222264b65adeaffaf3b23d959ee86b83bae33eaf99029229705f92070fa539fd6d63d8242afc38475904483a9a0b997effd SHA512 ea223d568a3c336a43b183efc61bd1f1a9d1e5e0e8d963275e0b23ee879551bc7d8aae797b1e2edba49d119ad306692599eb535c5d164ebee0c6721dfeab78dc
diff --git a/dev-lang/crystal/crystal-1.15.0-r1.ebuild b/dev-lang/crystal/crystal-1.15.0-r1.ebuild
new file mode 100644
index 000000000000..573dc999fa39
--- /dev/null
+++ b/dev-lang/crystal/crystal-1.15.0-r1.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+BV="${PV}-1"
+BV_AMD64="${BV}-linux-x86_64"
+
+LLVM_COMPAT=( {18..19} )
+
+inherit llvm-r1 multiprocessing shell-completion toolchain-funcs
+
+DESCRIPTION="The Crystal Programming Language"
+HOMEPAGE="https://crystal-lang.org/
+	https://github.com/crystal-lang/crystal/"
+SRC_URI="
+	https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz
+		-> ${P}.gh.tar.gz
+	amd64? (
+		https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_AMD64}.tar.gz
+	)
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc debug llvm-libunwind"
+RESTRICT="test"  # Upstream test suite not reliable.
+
+DEPEND="
+	dev-libs/boehm-gc:=[threads]
+	dev-libs/gmp:=
+	dev-libs/libatomic_ops:=
+	dev-libs/libevent:=
+	dev-libs/libpcre2:=[unicode]
+	dev-libs/pcl:=
+	$(llvm_gen_dep '
+		llvm-core/llvm:${LLVM_SLOT}=
+	')
+	llvm-libunwind? (
+		llvm-runtimes/libunwind:=
+	)
+	!llvm-libunwind? (
+		sys-libs/libunwind:=
+	)
+"
+RDEPEND="
+	${DEPEND}
+	dev-libs/libxml2
+	dev-libs/libyaml
+"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.27.0-gentoo-tests-long-unix.patch"
+	"${FILESDIR}/${PN}-0.27.0-gentoo-tests-long-unix-2.patch"
+	"${FILESDIR}/${PN}-1.15.0-remove-enviroment-clearing-tests.patch"
+)
+
+src_prepare() {
+	default
+
+	# Link against system boehm-gc instead of upstream prebuilt static library
+	# bug #929123, #929989 and #931100
+	# https://github.com/crystal-lang/crystal/issues/12035#issuecomment-2522606612
+	rm "${WORKDIR}/crystal-${BV}"/lib/crystal/libgc.a || die
+}
+
+src_configure() {
+	local bootstrap_path="${WORKDIR}/${PN}-${BV}/bin"
+	if [[ ! -d "${bootstrap_path}" ]] ; then
+		eerror "Binary tarball does not contain expected directory:"
+		die "'${bootstrap_path}' path does not exist."
+	fi
+
+	# crystal uses 'LLVM_TARGETS' to override default list of targets
+	unset LLVM_TARGETS
+
+	MY_EMAKE_COMMON_ARGS=(
+		PATH="${bootstrap_path}:${PATH}"
+
+		CRYSTAL_CONFIG_VERSION="${PV}"
+		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
+
+		$(usex debug "" release=1)
+		progress=true
+		stats=1
+		threads="$(makeopts_jobs)"
+		verbose=1
+		check_lld= # disable opportunistic lld
+
+		AR="$(tc-getAR)"
+		CC="$(tc-getCC)"
+		CXX="$(tc-getCXX)"
+		LLVM_CONFIG="$(get_llvm_prefix -d)/bin/llvm-config"
+	)
+}
+
+src_compile() {
+	emake "${MY_EMAKE_COMMON_ARGS[@]}"
+
+	use doc && emake docs "${MY_EMAKE_COMMON_ARGS[@]}"
+}
+
+src_test() {
+	emake std_spec "${MY_EMAKE_COMMON_ARGS[@]}"
+}
+
+src_install() {
+	insinto "/usr/$(get_libdir)/crystal"
+	doins -r src/.
+
+	exeinto /usr/bin
+	doexe .build/crystal
+
+	newzshcomp etc/completion.zsh _crystal
+	newfishcomp etc/completion.fish crystal.fish
+
+	dodoc -r samples
+	doman "man/${PN}.1"
+	newbashcomp etc/completion.bash "${PN}"
+
+	if use doc ; then
+		docinto api
+		dodoc -r docs/.
+	fi
+}
diff --git a/dev-lang/crystal/crystal-1.15.0.ebuild b/dev-lang/crystal/crystal-1.15.0.ebuild
deleted file mode 100644
index 4ceb85f7e207..000000000000
--- a/dev-lang/crystal/crystal-1.15.0.ebuild
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-BV="${PV}-1"
-BV_AMD64="${BV}-linux-x86_64"
-
-LLVM_COMPAT=( {18..19} )
-
-inherit bash-completion-r1 llvm-r1 multiprocessing toolchain-funcs
-
-DESCRIPTION="The Crystal Programming Language"
-HOMEPAGE="https://crystal-lang.org/
-	https://github.com/crystal-lang/crystal/"
-SRC_URI="
-	https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz
-		-> ${P}.gh.tar.gz
-	amd64? (
-		https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_AMD64}.tar.gz
-	)
-"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="doc debug llvm-libunwind"
-RESTRICT="test"  # Upstream test suite not reliable.
-
-DEPEND="
-	dev-libs/boehm-gc:=[threads]
-	dev-libs/gmp:=
-	dev-libs/libatomic_ops:=
-	dev-libs/libevent:=
-	dev-libs/libpcre2:=[unicode]
-	dev-libs/pcl:=
-	$(llvm_gen_dep '
-		llvm-core/llvm:${LLVM_SLOT}=
-	')
-	llvm-libunwind? (
-		llvm-runtimes/libunwind:=
-	)
-	!llvm-libunwind? (
-		sys-libs/libunwind:=
-	)
-"
-RDEPEND="
-	${DEPEND}
-	dev-libs/libxml2
-	dev-libs/libyaml
-"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-0.27.0-gentoo-tests-long-unix.patch"
-	"${FILESDIR}/${PN}-0.27.0-gentoo-tests-long-unix-2.patch"
-)
-
-src_configure() {
-	local bootstrap_path="${WORKDIR}/${PN}-${BV}/bin"
-	if [[ ! -d "${bootstrap_path}" ]] ; then
-		eerror "Binary tarball does not contain expected directory:"
-		die "'${bootstrap_path}' path does not exist."
-	fi
-
-	# crystal uses 'LLVM_TARGETS' to override default list of targets
-	unset LLVM_TARGETS
-
-	MY_EMAKE_COMMON_ARGS=(
-		PATH="${bootstrap_path}:${PATH}"
-
-		CRYSTAL_CONFIG_VERSION="${PV}"
-		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
-
-		$(usex debug "" release=1)
-		progress=true
-		stats=1
-		threads="$(makeopts_jobs)"
-		verbose=1
-
-		AR="$(tc-getAR)"
-		CC="$(tc-getCC)"
-		CXX="$(tc-getCXX)"
-		LLVM_CONFIG="$(get_llvm_prefix -d)/bin/llvm-config"
-	)
-}
-
-src_compile() {
-	emake "${MY_EMAKE_COMMON_ARGS[@]}"
-
-	use doc && emake docs "${MY_EMAKE_COMMON_ARGS[@]}"
-}
-
-src_test() {
-	emake std_spec "${MY_EMAKE_COMMON_ARGS[@]}"
-}
-
-src_install() {
-	insinto "/usr/$(get_libdir)/crystal"
-	doins -r src/.
-
-	exeinto /usr/bin
-	doexe .build/crystal
-
-	insinto /usr/share/zsh/site-functions
-	newins etc/completion.zsh _crystal
-
-	dodoc -r samples
-	doman "man/${PN}.1"
-	newbashcomp etc/completion.bash "${PN}"
-
-	if use doc ; then
-		docinto api
-		dodoc -r docs/.
-	fi
-}
diff --git a/dev-lang/crystal/files/crystal-1.15.0-remove-enviroment-clearing-tests.patch b/dev-lang/crystal/files/crystal-1.15.0-remove-enviroment-clearing-tests.patch
new file mode 100644
index 000000000000..11667b0da28a
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-1.15.0-remove-enviroment-clearing-tests.patch
@@ -0,0 +1,28 @@
+Sandbox won't allow removing sandbox related environment variables.
+
+diff --git a/spec/std/process_spec.cr b/spec/std/process_spec.cr
+index 965ed1431..c32b00537 100644
+--- a/spec/std/process_spec.cr
++++ b/spec/std/process_spec.cr
+@@ -281,20 +281,6 @@ describe Process do
+     end
+ 
+     describe "environ" do
+-      it "clears the environment" do
+-        value = Process.run(*print_env_command, clear_env: true) do |proc|
+-          proc.output.gets_to_end
+-        end
+-        value.should eq("")
+-      end
+-
+-      it "clears and sets an environment variable" do
+-        value = Process.run(*print_env_command, clear_env: true, env: {"FOO" => "bar"}) do |proc|
+-          proc.output.gets_to_end
+-        end
+-        value.should eq("FOO=bar#{newline}")
+-      end
+-
+       it "sets an environment variable" do
+         value = Process.run(*print_env_command, env: {"FOO" => "bar"}) do |proc|
+           proc.output.gets_to_end
+
diff --git a/dev-lang/go-bootstrap/files/make-go-bootstraps b/dev-lang/go-bootstrap/files/make-go-bootstraps
old mode 100644
new mode 100755
diff --git a/dev-lang/nprolog/Manifest b/dev-lang/nprolog/Manifest
index 3a4be26e947a..80fe0a114354 100644
--- a/dev-lang/nprolog/Manifest
+++ b/dev-lang/nprolog/Manifest
@@ -2,6 +2,8 @@ AUX nprolog-3.22-ncursesw.patch 270 BLAKE2B 4e412a1b42bea3e797ddb0f17a5d22bd0f22
 AUX nprolog-3.88-makefile-CURSES_CFLAGS-edlog-rule.patch 780 BLAKE2B 95e6e7a10af3ac3debcec909debef34c28c360e15b48082b5eadd0f8530a633cd9028a0238152d27762db5c1d57ab1ca4b3f2ac10bb9b5756f078433b362afd5 SHA512 87b54236f9aee8fa7f69925765e33efe096a0fa47761faf05adf8335671b1730085311e1b7fe0f9983f12d9e710ce25c0663897ca6e9ecb0d3a5f2cb776f8fe6
 DIST nprolog-3.53.tar.gz 682333 BLAKE2B 827e6ff1b066e42fd10df8788a6752ef4df7692cc3d11ad6b1bb001b72d2e916997abae21e182c161ac1a1098362a2e8430a1b1500b4ad97ca74a00db19e70d2 SHA512 10de04a1737999203d23911b3c36ce506b112476238ec1c28bcade2a459cec6d8ac2310dd8ba3bd1af82aa390444ff5c37536585429faa7c12fa9ee154243087
 DIST nprolog-3.88.gh.tar.gz 1337137 BLAKE2B 0d8f8d5e8242e3ab172f0a1256252ef99b6daf76a77fb75710c0286d55aa02e79e78601ec4347e42d88411cc7528d4e3b041496df04335496b71fc41cb3573c6 SHA512 12ef940792a6c9cd44cafad5440829d43b0c4736732341172255733f163d48b189233b62288e4fd59d36e5a378742f783a0400c2c4dc3d6b06570143b06685db
+DIST nprolog-3.89.gh.tar.gz 1286015 BLAKE2B 006e9ecfc541cc57cd67454ce3c10e6f8c9fce63695a4395d1b1d3db82aa30483d78503544d5b4ffbe2e87902fa05fe39fd2c6ad2fe4d3e54d54e96901a6e69f SHA512 9df70ec2c37861a6374fd0093b426cc0ba55138680e164f9d84ed830470cc955c2da7a24ba3fb517b4dbf5c0154062f9431905d9d326db6f7a7ddccee250a7ea
 EBUILD nprolog-3.53.ebuild 888 BLAKE2B 1a70453da30466404a14daa097c7df96cd95bcf759becad989cd538e6b17739f86a06301950ed1913314b750955c3c8f3a07f650ce41a3fab431102f414deaaf SHA512 8fc94200ca57c0a592500c1f10a8b58fafb41c8ee28f5dcfea20327784a1221a5440bf72f6a53e1c365dd3bc1006da99d8aa2e8b541d07956a8502f9187c68e5
 EBUILD nprolog-3.88.ebuild 1100 BLAKE2B 7f056d2d92d21e2d343f65f8aebee3934d7badd69aefe5fdeaf1230fb54cd13e09bee73c89f51c78fd2accbe9c91a8b2e2890133a567d8d9cd9a525c8eb79f64 SHA512 b697953177b8f268da8bdfa308750fa67be3b9b079c8ce2d1d01cc82db21771cd29daac509a8aed2013c24c2902e8c03acd9b415f40925010fb92e210583c811
+EBUILD nprolog-3.89.ebuild 1032 BLAKE2B e39dc2dd493eebcdd307a5453f9e312c01848280a042ace8eb4255e78a35379d8829581c8635740da506419af011e0f9daa7f2a17ef966b6ff36b93108dd96fa SHA512 e1d11da019820e23d60ccbea7cfa3deabd1466112aeeb7ef4942f624860553d9736cfad4329439e04f0a9ee7ee5d200b972391e38249d28567926098e56e9b3f
 MISC metadata.xml 657 BLAKE2B 9331358542d57958385bc1218b4a1c5d38185ab0822d0cc68e51bcc5f8b00645a523a1a4f60d30188efc3ed7cb934f0a6a964d27bf0915c5956c69774c734590 SHA512 972ae4d1f2179887f77d8805f2e5482c17767e38b078fa9d9ee65a2f43e0b56b76fccd0166f4c5121de9a7cead4faa7683bd8e9076c257ffb2d1deb673eb276e
diff --git a/dev-lang/nprolog/nprolog-3.89.ebuild b/dev-lang/nprolog/nprolog-3.89.ebuild
new file mode 100644
index 000000000000..66c38c72e940
--- /dev/null
+++ b/dev-lang/nprolog/nprolog-3.89.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Interpreter and compiler to be compatible with Arity/Prolog32"
+HOMEPAGE="https://github.com/sasagawa888/nprolog/"
+
+if [[ "${PV}" == *9999* ]] ; then
+	inherit git-r3
+
+	EGIT_REPO_URI="https://github.com/sasagawa888/${PN}"
+else
+	SRC_URI="https://github.com/sasagawa888/${PN}/archive/refs/tags/%EF%BD%96${PV}.tar.gz
+		-> ${P}.gh.tar.gz"
+	S="${WORKDIR}/${PN}--${PV}"
+
+	KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="doc"
+
+PATCHES=(
+	"${FILESDIR}/nprolog-3.22-ncursesw.patch"
+)
+
+DOCS=( README{,-ja}.md )
+
+src_prepare() {
+	if [[ -f edlog ]] ; then
+		rm edlog || die
+	fi
+
+	default
+}
+
+src_compile() {
+	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+	exeinto /usr/bin
+	doexe npl
+
+	insinto "/usr/share/${PN}"
+	doins -r example library
+
+	if use doc ; then
+		DOCS+=( document )
+
+		docompress -x "/usr/share/doc/${PF}/document"
+	fi
+
+	einstalldocs
+}
diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest
index 59622dcf3565..10b651738105 100644
--- a/dev-lang/ruby/Manifest
+++ b/dev-lang/ruby/Manifest
@@ -37,14 +37,18 @@ EBUILD ruby-3.1.4-r3.ebuild 8517 BLAKE2B d5d65a391f344b5bafbab680e9104ed214249c9
 EBUILD ruby-3.1.5.ebuild 8842 BLAKE2B 31e5da6ecdb45602037d5a1bce209844060271528b39139a3f8c9421c3ffea747fb6602702ee989a12ff08f999586841b24d6e7f05e0fdd2b6ecb5860c866b2b SHA512 3b5deeb36ea66a58907a89c637f8f3a0354ea861a4bab159f211cedef3a48cf3b6f5609d441c9516ea81ab4f032111370ff3da37395f30ca28428aeb0286fffc
 EBUILD ruby-3.1.6-r1.ebuild 8913 BLAKE2B 8286499d12dbc8d3936d75235b93d153b16e8a03b92a32277ce430417e1d95fadb2d92e969e6ec3c0b183fd1eb68feecf917897f6af8d784ff426674b3ef0ff9 SHA512 702dee12eab7ac6f6cb990903fbe3a517e1fedecef74b8ec57893c567eeae454d516ee787360291305c00bea1853ec96824420eb005afeb086f489a4d3f8feaa
 EBUILD ruby-3.1.6-r2.ebuild 9094 BLAKE2B 9546b202b1a0714b3f20c22736eb6fb9d39b298950a4e2121a6c2950508e01ddbbf5fd8198e5ae2d4bfbb77327bbc9c5e3a241eacc363f7e14d0874bc6c9b208 SHA512 cb315b25f3cbc1f322bd5bd0018466a05575aac7c097a0aff90d0cab14d0ad11e613436ecead1fd2d4379ee0ba10b0a0d1edf4be63debf4676574098e96ffb3b
+EBUILD ruby-3.1.6-r3.ebuild 9210 BLAKE2B 1b25f201f7fa919a4794a6403ba10482db6ba99d35c68bab32a639608e38c4442dec7334775ea4fbd3fdb84fe41c4479fbedd15938e33ea1cc0a55d0a4fe01e9 SHA512 706be9348a076548cd216c6607c9896ef3ed916e32520bee467d52d3224fcf1b49351a9d88b084bda52227036b3b639990dd9b9ef61b8846f835d11bef872b1b
 EBUILD ruby-3.2.4-r2.ebuild 9788 BLAKE2B 073e9cbcef0904b9a0b02036da3b9df8f98b9033d759116939e47625f14ee8ef27da0c9f4122a596eaded97114a168750a5a2c7ae72b27612852e9fe31879ea2 SHA512 0c5bb6a2072b22c654c1274752dce31541c81fddd7bdc5674e0e05271c69891540310d2d2ddfcb8fc64fbba6b712e9d5f932fc8e1cf4793555e4f41cc6e5ee61
 EBUILD ruby-3.2.4-r3.ebuild 9938 BLAKE2B 415b6ecd80cc7a1714bafba54bed731a454bbdb03ceeb1fff73f52989282e1a56eb826cdc069019889cc4056ceebc20d40951279d1feb20b00088ee9f4dc21b3 SHA512 7402f3660abdf40c2b2329421ec959ba3da50f9a495a7de524e2d8412d20a866dfe82694cf46d19be41e74e60c52ebe754b355ccf79b1fd618f4195038a593cf
 EBUILD ruby-3.2.5-r2.ebuild 9353 BLAKE2B 6f4b528a55d584feb489bd24bc425666900e79f5777807cc915a9cebe47533bc729c9834867e73c433cab379967d052d3ad02822694e1af01ad3cdb8317b622c SHA512 106b9dd2b11ea6759e98379190242aa721027ba0cbae77c4eb5e9f6abd609a8e85671d7b46203fdb6c6517183f4630f6f6ca7ae31772a0990aaa063117d0b1fe
 EBUILD ruby-3.2.6-r2.ebuild 9359 BLAKE2B 6b5a6f999bee0c942be5fcaaa374c18b1439f525ae456842eaae249cb77f9a5cd5041b3388d49be9dc21f887363e4f98cb9d05a5113e66e5ac0ecc37d8eb5835 SHA512 bec99bddb97c6bb8e475ce16d98b322cac79e0232c5d642cbe71c8d57b784a2d8b902d6af976a0628390187060ad36f580dae6e4d6f12e188f5a7f01d610e645
 EBUILD ruby-3.2.6-r3.ebuild 9402 BLAKE2B 1b3abb683a2012d32908bb0b9b65ea5eea3af0de710ad8f52e10d4aae903aa1f6008da21990faeb666b11baa5e7ee0cd1b907a3c4c92d7a01f4f72fe1bc7b3b4 SHA512 9cebd301ab2f29ef7ee0cec101fb1031767224a06465237099f68f01f8baa18a3f21dca97309b069e1f91c94f4c93ebc806f67d6667f4fe17363a1b42b77039b
+EBUILD ruby-3.2.6-r4.ebuild 9518 BLAKE2B f1835631f045120e282ec2a77de5c432cb6d3f2cbe5be1713067c85b5275f2ea15709284418ec7b25164fc617f0e9cdc57845600c37cf787f546b403d6456bc6 SHA512 77057b210a90e99e0c81c0d07d61c34601e9c08ce75a9c6e6e58acfd19f0e8addbf8a56c61cd978511a3b14c20199bd3650ab73d13a7feec534f7d74adabc159
 EBUILD ruby-3.3.4-r2.ebuild 9342 BLAKE2B 1fb9189635dda8aeec17105c784b4fa5b4158853c2d4a51a02f640067b9d6b5ed9e268a99df931f197bb877c6c38b5eea7975775235d3b19909a74ab36339844 SHA512 019a14c2ba878385d12ef1fcfa00c4dcb09c504c5d36817822989b883eb76eca17558cd78548c3777b740346c0db570c1b8c1cc77c593d557685ff1f60fbf19a
 EBUILD ruby-3.3.5-r1.ebuild 9342 BLAKE2B 1fb9189635dda8aeec17105c784b4fa5b4158853c2d4a51a02f640067b9d6b5ed9e268a99df931f197bb877c6c38b5eea7975775235d3b19909a74ab36339844 SHA512 019a14c2ba878385d12ef1fcfa00c4dcb09c504c5d36817822989b883eb76eca17558cd78548c3777b740346c0db570c1b8c1cc77c593d557685ff1f60fbf19a
 EBUILD ruby-3.3.6-r1.ebuild 9538 BLAKE2B 3033453c764967229bc140d0851881a471c6fb02a8366657787b4b9cb139777443ca9fd50392ffca90b3ff1b91f51ba526bd1a58d4fcd2b471c297fe201ea252 SHA512 d979cd2df7949b4fe22bb5ca28c9a39e6256df024dab2c906d9abb1dec7e843b2c0150d875b27ac07936239a9583cb0b8429105a3436be8f4858a6fecd6789cd
+EBUILD ruby-3.3.7-r1.ebuild 9661 BLAKE2B 2305b59565f7cd0d0e67e1a284c44eb23904f36de489e135651d9bc377ab6da60d2b3b00ba9d74fbdaf913fa19528cd12c4d78d673aad2fd9d3f1666053fb6e8 SHA512 1162ed37339f0ccb0883da63cc569a7754f5af801f9661ebe0f15f24541cbc0f904306380dc4f4d1c93b74989b16b94850d13f7277632e2a2c604c46f5aaa789
 EBUILD ruby-3.3.7.ebuild 9545 BLAKE2B 5b39ee480f314d821f2de3af5992db6a9b313f396804d9d9af26602cd135cd731a0a3536ff37c0e500e80eba32ef7659826c88584b683a27cb5b8f127260e132 SHA512 eec3947cbce0bf57c2aa140c2a19c1a13c68e0befe872321c00fbe9e32665da059a23f3c6db4e48b6ac68cd62a143ab1220feec3d7729c0fa4835b50e22b8680
+EBUILD ruby-3.4.1-r1.ebuild 10351 BLAKE2B 4210db7fecb64e268ca407b623e83260e280be15d1be7ac0c0bcb42e265fc9cb03c5971609ce74ab4f133bb4a8475fb4a65dd8ce56b699df9ebf02aea9614efb SHA512 98e763e3ad4c44e57764412015e0e97c02b9fb64ac4270985a29b1242e3d57f3e48dd15791b4ab1b38fadae07df6cbb0085b49c78a6d8d890de027e20cef58d2
 EBUILD ruby-3.4.1.ebuild 10235 BLAKE2B 29946e6df5b2a6b7f981399d0c49e81fc212cd19a67c2ea59b355c4a52a016ab3e2a244592ad5766e8846407f925e62a23124aedef53e5c01ec66116a760736d SHA512 191b74008848bb2b46e008448d093b92ce1a0b98d2bab8b4eba7856b7f5f226806f2c20a022b6dea9b7bd76928fb1f39ff7171141605aa276e69b2bfc2d7bbde
 MISC metadata.xml 504 BLAKE2B 49be2bb1dba034b23a8294cca0e5419099b487973a43db31c0edc4b9a2a08eb1b54437b0c7e6a9e6d8a5c0145cd73464f830ec04ca62540416c32b2d094cdd63 SHA512 e9991c588874e36f6a0abb12125bcd3f2b1e787df62d9f7089053959286b56676a9f35c7e82116274f169bfa22359be8df59fca6454be559e7669d2e78dc4c22
diff --git a/dev-lang/ruby/ruby-3.1.6-r3.ebuild b/dev-lang/ruby/ruby-3.1.6-r3.ebuild
new file mode 100644
index 000000000000..0071dfc446b3
--- /dev/null
+++ b/dev-lang/ruby/ruby-3.1.6-r3.ebuild
@@ -0,0 +1,289 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic multiprocessing
+
+MY_P="${PN}-$(ver_cut 1-3)"
+S=${WORKDIR}/${MY_P}
+
+SLOT=$(ver_cut 1-2)
+MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
+RUBYVERSION=${SLOT}.0
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="https://www.ruby-lang.org/"
+SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz"
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+
+RDEPEND="
+	berkdb? ( sys-libs/db:= )
+	gdbm? ( sys-libs/gdbm:= )
+	jemalloc? ( dev-libs/jemalloc:= )
+	jit? ( || ( sys-devel/gcc:* llvm-core/clang:* ) )
+	ssl? (
+		dev-libs/openssl:0=
+	)
+	socks5? ( >=net-proxy/dante-1.1.13 )
+	systemtap? ( dev-debug/systemtap )
+	tk? (
+		dev-lang/tcl:0=[threads]
+		dev-lang/tk:0=[threads]
+	)
+	dev-libs/libyaml
+	dev-libs/libffi:=
+	sys-libs/readline:0=
+	sys-libs/zlib
+	virtual/libcrypt:=
+	>=app-eselect/eselect-ruby-20231008
+"
+
+DEPEND="
+	${RDEPEND}
+	valgrind? ( dev-debug/valgrind )
+"
+
+BUNDLED_GEMS="
+	>=dev-ruby/irb-1.4.1[ruby_targets_ruby31(-)]
+	>=dev-ruby/minitest-5.15.0[ruby_targets_ruby31(-)]
+	>=dev-ruby/power_assert-2.0.1[ruby_targets_ruby31(-)]
+	>=dev-ruby/rake-13.0.6-r2[ruby_targets_ruby31(-)]
+	>=dev-ruby/rbs-2.1.0[ruby_targets_ruby31(-)]
+	>=dev-ruby/rexml-3.2.5[ruby_targets_ruby31(-)]
+	>=dev-ruby/rss-0.2.9[ruby_targets_ruby31(-)]
+	>=dev-ruby/test-unit-3.5.3[ruby_targets_ruby31(-)]
+	>=dev-ruby/typeprof-0.12.2[ruby_targets_ruby31(-)]
+"
+
+PDEPEND="
+	${BUNDLED_GEMS}
+	virtual/rubygems[ruby_targets_ruby31(-)]
+	>=dev-ruby/bundler-2.3.3[ruby_targets_ruby31(-)]
+	>=dev-ruby/did_you_mean-1.6.1[ruby_targets_ruby31(-)]
+	>=dev-ruby/json-2.6.1[ruby_targets_ruby31(-)]
+	>=dev-ruby/rdoc-6.3.3[ruby_targets_ruby31(-)]
+	xemacs? ( app-xemacs/ruby-modes )
+"
+
+src_prepare() {
+	eapply "${FILESDIR}"/"${SLOT}"/011*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/012*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/013*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/020*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/902*.patch
+
+	if use elibc_musl ; then
+		eapply "${FILESDIR}"/3.1/901-musl-*.patch
+	fi
+
+	einfo "Unbundling gems..."
+	cd "$S"
+	# Remove bundled gems that we will install via PDEPEND, bug
+	# 539700.
+	rm -fr gems/* || die
+	touch gems/bundled_gems || die
+	# Don't install CLI tools since they will clash with the gem
+	rm -f bin/{racc,racc2y,y2racc} || die
+	sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die
+
+	einfo "Removing bundled libraries..."
+	rm -fr ext/fiddle/libffi-3.2.1 || die
+
+	# Remove webrick tests because setting LD_LIBRARY_PATH does not work for them.
+	rm -rf tool/test/webrick || die
+
+	# Remove tests that are known to fail or require a network connection
+	rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die
+	rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb test/resolv/test_addr.rb \
+	   spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die
+	sed -i -e '/def test_test/askip "Depends on system setup"' test/ruby/test_file_exhaustive.rb || die
+
+	# MJIT is broken and removed in later ruby versions.
+	rm -f test/ruby/test_jit.rb || die
+
+	# This test calls out to the system ruby which is not being tested
+	# and may not be the same version.
+	sed -e '/test_without_tty/aomit "Calls system ruby"' \
+		-i test/readline/test_readline.rb || die
+
+	if use prefix ; then
+		# Fix hardcoded SHELL var in mkmf library
+		sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die
+	fi
+
+	eapply_user
+
+	eautoreconf
+}
+
+src_configure() {
+	local modules="win32,win32ole" myconf=
+
+	# Ruby's build system does interesting things with MAKEOPTS and doesn't
+	# handle MAKEOPTS="-Oline" or similar well. Just filter it all out
+	# and use -j/-l parsed out from the original MAKEOPTS, then use that.
+	# Newer Portage sets this option by default in GNUMAKEFLAGS if nothing
+	# is set by the user in MAKEOPTS. See bug #900929 and bug #728424.
+	local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)"
+	unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS
+	export MAKEOPTS="${makeopts_tmp}"
+
+	# Avoid a hardcoded path to mkdir to avoid issues with mixed
+	# usr-merge and normal binary packages, bug #932386.
+	export ac_cv_path_mkdir=mkdir
+
+	# -fomit-frame-pointer makes ruby segfault, see bug #150413.
+	filter-flags -fomit-frame-pointer
+	append-flags -fno-omit-frame-pointer
+	# In many places aliasing rules are broken; play it safe
+	# as it's risky with newer compilers to leave it as it is.
+	append-flags -fno-strict-aliasing
+
+	# Ruby 3.1 does not compile against the gnu23 standard, bug
+	# #943767. Given that Ruby 3.1 is EOL in March 2025 just opt to use
+	# the older standard.
+	append-flags -std=gnu17
+
+	# Workaround for bug #938302
+	if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then
+		export DTRACE="${BROOT}"/usr/bin/stap-dtrace
+	fi
+
+	# Socks support via dante
+	if use socks5 ; then
+		# Socks support can't be disabled as long as SOCKS_SERVER is
+		# set and socks library is present, so need to unset
+		# SOCKS_SERVER in that case.
+		unset SOCKS_SERVER
+	fi
+
+	# Increase GC_MALLOC_LIMIT if set (default is 8000000)
+	if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+		append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+	fi
+
+	# ipv6 hack, bug 168939. Needs --enable-ipv6.
+	use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
+
+	# Determine which modules *not* to build depending in the USE flags.
+	if ! use berkdb ; then
+		modules="${modules},dbm"
+	fi
+	if ! use gdbm ; then
+		modules="${modules},gdbm"
+	fi
+	if ! use ssl ; then
+		modules="${modules},openssl"
+	fi
+	if ! use tk ; then
+		modules="${modules},tk"
+	fi
+
+	# Provide an empty LIBPATHENV because we disable rpath but we do not
+	# need LD_LIBRARY_PATH by default since that breaks USE=multitarget
+	# #564272
+	# except on Darwin, where we really need LIBPATHENV to set the right
+	# DYLD_ stuff during the invocation of miniruby for it to work
+	#
+	# --with-setjmp-type=setjmp for bug #949016
+	[[ ${CHOST} == *-darwin* ]] || export LIBPATHENV=""
+	INSTALL="${EPREFIX}/usr/bin/install -c" econf \
+		--program-suffix=${MY_SUFFIX} \
+		--with-soname=ruby${MY_SUFFIX} \
+		--with-readline-dir="${EPREFIX}"/usr \
+		--enable-shared \
+		--enable-pthread \
+		--disable-rpath \
+		--without-baseruby \
+		--with-compress-debug-sections=no \
+		--with-setjmp-type=setjmp \
+		--enable-mkmf-verbose \
+		--with-out-ext="${modules}" \
+		$(use_with jemalloc jemalloc) \
+		$(use_enable jit jit-support ) \
+		$(use_enable socks5 socks) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable doc install-doc) \
+		--enable-ipv6 \
+		$(use_enable static-libs static) \
+		$(use_enable static-libs install-static-library) \
+		$(use_with static-libs static-linked-ext) \
+		$(use_enable debug) \
+		$(use_with valgrind) \
+		${myconf} \
+		--enable-option-checking=no
+
+	# Makefile is broken because it lacks -ldl
+	rm -rf ext/-test-/popen_deadlock || die
+}
+
+src_compile() {
+	local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+	emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS=""
+}
+
+src_test() {
+	local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+	emake V=1 check
+}
+
+src_install() {
+	# Remove the remaining bundled gems. We do this late in the process
+	# since they are used during the build to e.g. create the
+	# documentation.
+	einfo "Removing default gems before installation"
+	rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die
+
+	# Ruby is involved in the install process, we don't want interference here.
+	unset RUBYOPT
+
+	local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+	local -x LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+
+	local -x RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+	for d in $(find "${S}/ext" -type d) ; do
+		RUBYLIB="${RUBYLIB}:$d"
+	done
+
+	# Create directory for the default gems
+	local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}"
+	mkdir -p "${D}/${gem_home}" || die "mkdir gem home failed"
+
+	emake V=1 DESTDIR="${D}" GEM_DESTDIR=${gem_home} install
+
+	# Remove installed rubygems and rdoc copy
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+	rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+	rm -rf "${ED}/usr/bin/"{bundle,bundler,ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+	if use doc; then
+		emake DESTDIR="${D}" GEM_DESTDIR=${gem_home} install-doc
+	fi
+
+	if use examples; then
+		dodoc -r sample
+	fi
+
+	dodoc ChangeLog NEWS.md doc/NEWS* README*
+}
+
+pkg_postinst() {
+	if [[ ! -n $(readlink "${EROOT}"/usr/bin/ruby) ]] ; then
+		eselect ruby set ruby${MY_SUFFIX}
+	fi
+
+	elog
+	elog "To switch between available Ruby profiles, execute as root:"
+	elog "\teselect ruby set ruby(30|31|...)"
+	elog
+}
+
+pkg_postrm() {
+	eselect ruby cleanup
+}
diff --git a/dev-lang/ruby/ruby-3.2.6-r4.ebuild b/dev-lang/ruby/ruby-3.2.6-r4.ebuild
new file mode 100644
index 000000000000..d08d1ea44138
--- /dev/null
+++ b/dev-lang/ruby/ruby-3.2.6-r4.ebuild
@@ -0,0 +1,295 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+RUST_OPTIONAL="yes"
+
+inherit autotools flag-o-matic multiprocessing rust
+
+MY_P="${PN}-$(ver_cut 1-3)"
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="https://www.ruby-lang.org/"
+SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+SLOT=$(ver_cut 1-2)
+MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
+RUBYVERSION=${SLOT}.0
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+
+RDEPEND="
+	berkdb? ( sys-libs/db:= )
+	gdbm? ( sys-libs/gdbm:= )
+	jemalloc? ( dev-libs/jemalloc:= )
+	jit? ( ${RUST_DEPEND} )
+	ssl? (
+		dev-libs/openssl:0=
+	)
+	socks5? ( >=net-proxy/dante-1.1.13 )
+	systemtap? ( dev-debug/systemtap )
+	tk? (
+		dev-lang/tcl:0=[threads]
+		dev-lang/tk:0=[threads]
+	)
+	dev-libs/libyaml
+	dev-libs/libffi:=
+	sys-libs/readline:0=
+	sys-libs/zlib
+	virtual/libcrypt:=
+	>=app-eselect/eselect-ruby-20231008
+"
+
+DEPEND="
+	${RDEPEND}
+	valgrind? ( dev-debug/valgrind )
+"
+
+BUNDLED_GEMS="
+	>=dev-ruby/debug-1.7.1[ruby_targets_ruby32(-)]
+	>=dev-ruby/irb-1.6.2[ruby_targets_ruby32(-)]
+	>=dev-ruby/matrix-0.4.2[ruby_targets_ruby32(-)]
+	>=dev-ruby/minitest-5.16.3[ruby_targets_ruby32(-)]
+	>=dev-ruby/net-ftp-0.2.1[ruby_targets_ruby32(-)]
+	>=dev-ruby/net-imap-0.3.4.1[ruby_targets_ruby32(-)]
+	>=dev-ruby/net-pop-0.1.2[ruby_targets_ruby32(-)]
+	>=dev-ruby/net-smtp-0.3.4[ruby_targets_ruby32(-)]
+	>=dev-ruby/power_assert-2.0.3[ruby_targets_ruby32(-)]
+	>=dev-ruby/prime-0.1.2[ruby_targets_ruby32(-)]
+	>=dev-ruby/rake-13.0.6-r2[ruby_targets_ruby32(-)]
+	>=dev-ruby/rbs-2.8.2[ruby_targets_ruby32(-)]
+	>=dev-ruby/rexml-3.3.9[ruby_targets_ruby32(-)]
+	>=dev-ruby/rss-0.3.1[ruby_targets_ruby32(-)]
+	>=dev-ruby/test-unit-3.5.7[ruby_targets_ruby32(-)]
+	>=dev-ruby/typeprof-0.21.3[ruby_targets_ruby32(-)]
+"
+
+PDEPEND="
+	${BUNDLED_GEMS}
+	virtual/rubygems[ruby_targets_ruby32(-)]
+	>=dev-ruby/bundler-2.3.3[ruby_targets_ruby32(-)]
+	>=dev-ruby/did_you_mean-1.6.1[ruby_targets_ruby32(-)]
+	>=dev-ruby/json-2.6.1[ruby_targets_ruby32(-)]
+	>=dev-ruby/rdoc-6.3.3[ruby_targets_ruby32(-)]
+	xemacs? ( app-xemacs/ruby-modes )
+"
+
+pkg_setup() {
+	use jit && rust_pkg_setup
+}
+
+src_prepare() {
+	eapply "${FILESDIR}"/"${SLOT}"/010*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/011*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/013*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/014*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/902*.patch
+
+	if use elibc_musl ; then
+		eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch
+	fi
+
+	einfo "Unbundling gems..."
+	cd "$S"
+	# Remove bundled gems that we will install via PDEPEND, bug
+	# 539700.
+	rm -fr gems/* || die
+	touch gems/bundled_gems || die
+	# Don't install CLI tools since they will clash with the gem
+	rm -f bin/{racc,racc2y,y2racc} || die
+	sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die
+
+	# Remove tests that are known to fail or require a network connection
+	rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die
+	rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die
+
+	# Remove webrick tests because setting LD_LIBRARY_PATH does not work for them.
+	rm -rf tool/test/webrick || die
+
+	# Avoid test using the system ruby
+	sed -i -e '/test_dumb_terminal/aomit "Uses system ruby"' test/reline/test_reline.rb || die
+
+	# Avoid testing against hard-coded blockdev devices that most likely are not available
+	sed -i -e '/def blockdev/a@blockdev = nil' test/ruby/test_file_exhaustive.rb || die
+
+	# Avoid tests that require gem downloads
+	sed -i -e '/^test-syntax-suggest/ s/\$(TEST_RUNNABLE)/no/' common.mk || die
+	sed -i -e '/^check:/ s/\$(TEST_RUNNABLE)-\$(PREPARE_SYNTAX_SUGGEST) test-syntax-suggest//' common.mk || die
+
+	# Avoid test that fails intermittently
+	sed -i -e '/test_gem_exec_gem_uninstall/aomit "Fails intermittently"' test/rubygems/test_gem_commands_exec_command.rb || die
+
+	if use prefix ; then
+		# Fix hardcoded SHELL var in mkmf library
+		sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die
+	fi
+
+	eapply_user
+
+	eautoreconf
+}
+
+src_configure() {
+	local modules="win32,win32ole" myconf=
+
+	# Ruby's build system does interesting things with MAKEOPTS and doesn't
+	# handle MAKEOPTS="-Oline" or similar well. Just filter it all out
+	# and use -j/-l parsed out from the original MAKEOPTS, then use that.
+	# Newer Portage sets this option by default in GNUMAKEFLAGS if nothing
+	# is set by the user in MAKEOPTS. See bug #900929 and bug #728424.
+	local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)"
+	unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS
+	export MAKEOPTS="${makeopts_tmp}"
+
+	# Avoid a hardcoded path to mkdir to avoid issues with mixed
+	# usr-merge and normal binary packages, bug #932386.
+	export ac_cv_path_mkdir=mkdir
+
+	# -fomit-frame-pointer makes ruby segfault, see bug #150413.
+	filter-flags -fomit-frame-pointer
+	append-flags -fno-omit-frame-pointer
+	# In many places aliasing rules are broken; play it safe
+	# as it's risky with newer compilers to leave it as it is.
+	append-flags -fno-strict-aliasing
+
+	# Workaround for bug #938302
+	if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then
+		export DTRACE="${BROOT}"/usr/bin/stap-dtrace
+	fi
+
+	# Socks support via dante
+	if use socks5 ; then
+		# Socks support can't be disabled as long as SOCKS_SERVER is
+		# set and socks library is present, so need to unset
+		# SOCKS_SERVER in that case.
+		unset SOCKS_SERVER
+	fi
+
+	# Increase GC_MALLOC_LIMIT if set (default is 8000000)
+	if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+		append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+	fi
+
+	# Determine which modules *not* to build depending in the USE flags.
+	if ! use berkdb ; then
+		modules="${modules},dbm"
+	fi
+	if ! use gdbm ; then
+		modules="${modules},gdbm"
+	fi
+	if ! use ssl ; then
+		modules="${modules},openssl"
+	fi
+	if ! use tk ; then
+		modules="${modules},tk"
+	fi
+
+	# Provide an empty LIBPATHENV because we disable rpath but we do not
+	# need LD_LIBRARY_PATH by default since that breaks USE=multitarget
+	# #564272
+	# except on Darwin, where we really need LIBPATHENV to set the right
+	# DYLD_ stuff during the invocation of miniruby for it to work
+	#
+	# --with-setjmp-type=setjmp for bug #949016
+	[[ ${CHOST} == *-darwin* ]] || export LIBPATHENV=""
+	INSTALL="${EPREFIX}/usr/bin/install -c" econf \
+		--program-suffix=${MY_SUFFIX} \
+		--with-soname=ruby${MY_SUFFIX} \
+		--with-readline-dir="${EPREFIX}"/usr \
+		--enable-shared \
+		--enable-pthread \
+		--disable-rpath \
+		--without-baseruby \
+		--with-compress-debug-sections=no \
+		--with-setjmp-type=setjmp \
+		--enable-mkmf-verbose \
+		--with-out-ext="${modules}" \
+		$(use_with jemalloc jemalloc) \
+		$(use_enable jit jit-support) \
+		$(use_enable jit yjit) \
+		$(use_enable socks5 socks) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable doc install-doc) \
+		$(use_enable static-libs static) \
+		$(use_enable static-libs install-static-library) \
+		$(use_with static-libs static-linked-ext) \
+		$(use_enable debug) \
+		${myconf} \
+		$(use_with valgrind) \
+		--enable-option-checking=no
+
+	# Makefile is broken because it lacks -ldl
+	rm -rf ext/-test-/popen_deadlock || die
+}
+
+src_compile() {
+	local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+	emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS=""
+}
+
+src_test() {
+	local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+	emake V=1 check
+}
+
+src_install() {
+	# Remove the remaining bundled gems. We do this late in the process
+	# since they are used during the build to e.g. create the
+	# documentation.
+	einfo "Removing default gems before installation"
+	rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die
+
+	# Ruby is involved in the install process, we don't want interference here.
+	unset RUBYOPT
+
+	local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+	local -x LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+
+	local -x RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+	for d in $(find "${S}/ext" -type d) ; do
+		RUBYLIB="${RUBYLIB}:$d"
+	done
+
+	# Create directory for the default gems
+	local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}"
+	mkdir -p "${D}/${gem_home}" || die "mkdir gem home failed"
+
+	emake V=1 DESTDIR="${D}" GEM_DESTDIR=${gem_home} install
+
+	# Remove installed rubygems and rdoc copy
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+	rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+	rm -rf "${ED}/usr/bin/"{bundle,bundler,ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+	if use doc; then
+		emake DESTDIR="${D}" GEM_DESTDIR=${gem_home} install-doc
+	fi
+
+	if use examples; then
+		dodoc -r sample
+	fi
+
+	dodoc ChangeLog NEWS.md README*
+	dodoc -r doc
+}
+
+pkg_postinst() {
+	if [[ ! -n $(readlink "${EROOT}"/usr/bin/ruby) ]] ; then
+		eselect ruby set ruby${MY_SUFFIX}
+	fi
+
+	elog
+	elog "To switch between available Ruby profiles, execute as root:"
+	elog "\teselect ruby set ruby(30|31|...)"
+	elog
+}
+
+pkg_postrm() {
+	eselect ruby cleanup
+}
diff --git a/dev-lang/ruby/ruby-3.3.7-r1.ebuild b/dev-lang/ruby/ruby-3.3.7-r1.ebuild
new file mode 100644
index 000000000000..7c460afeeb23
--- /dev/null
+++ b/dev-lang/ruby/ruby-3.3.7-r1.ebuild
@@ -0,0 +1,302 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+RUST_OPTIONAL="yes"
+
+inherit autotools flag-o-matic multiprocessing rust
+
+MY_P="${PN}-$(ver_cut 1-3)"
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="https://www.ruby-lang.org/"
+SRC_URI="https://cache.ruby-lang.org/pub/ruby/$(ver_cut 1-2)/${MY_P}.tar.xz"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+SLOT=$(ver_cut 1-2)
+MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
+RUBYVERSION=${SLOT}.0
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+
+RDEPEND="
+	berkdb? ( sys-libs/db:= )
+	gdbm? ( sys-libs/gdbm:= )
+	jemalloc? ( dev-libs/jemalloc:= )
+	jit? ( ${RUST_DEPEND} )
+	ssl? (
+		dev-libs/openssl:0=
+	)
+	socks5? ( >=net-proxy/dante-1.1.13 )
+	systemtap? ( dev-debug/systemtap )
+	tk? (
+		dev-lang/tcl:0=[threads]
+		dev-lang/tk:0=[threads]
+	)
+	dev-libs/libyaml
+	dev-libs/libffi:=
+	sys-libs/zlib
+	virtual/libcrypt:=
+	>=app-eselect/eselect-ruby-20231226
+"
+
+DEPEND="
+	${RDEPEND}
+	valgrind? ( dev-debug/valgrind )
+"
+
+BUNDLED_GEMS="
+	>=dev-ruby/debug-1.9.2[ruby_targets_ruby33(-)]
+	>=dev-ruby/irb-1.11.0[ruby_targets_ruby33(-)]
+	>=dev-ruby/matrix-0.4.2[ruby_targets_ruby33(-)]
+	>=dev-ruby/minitest-5.20.0[ruby_targets_ruby33(-)]
+	>=dev-ruby/net-ftp-0.3.4[ruby_targets_ruby33(-)]
+	>=dev-ruby/net-imap-0.4.9.1[ruby_targets_ruby33(-)]
+	>=dev-ruby/net-pop-0.1.2[ruby_targets_ruby33(-)]
+	>=dev-ruby/net-smtp-0.4.0.1[ruby_targets_ruby33(-)]
+	>=dev-ruby/power_assert-2.0.3[ruby_targets_ruby33(-)]
+	>=dev-ruby/prime-0.1.2[ruby_targets_ruby33(-)]
+	>=dev-ruby/racc-1.7.3[ruby_targets_ruby33(-)]
+	>=dev-ruby/rake-13.1.0[ruby_targets_ruby33(-)]
+	>=dev-ruby/rbs-3.4.0[ruby_targets_ruby33(-)]
+	>=dev-ruby/rexml-3.3.9[ruby_targets_ruby33(-)]
+	>=dev-ruby/rss-0.3.1[ruby_targets_ruby33(-)]
+	>=dev-ruby/test-unit-3.6.1[ruby_targets_ruby33(-)]
+	>=dev-ruby/typeprof-0.21.9[ruby_targets_ruby33(-)]
+"
+
+PDEPEND="
+	${BUNDLED_GEMS}
+	virtual/rubygems[ruby_targets_ruby33(-)]
+	>=dev-ruby/bundler-2.5.11[ruby_targets_ruby33(-)]
+	>=dev-ruby/did_you_mean-1.6.3[ruby_targets_ruby33(-)]
+	>=dev-ruby/json-2.7.2[ruby_targets_ruby33(-)]
+	>=dev-ruby/rdoc-6.6.2[ruby_targets_ruby33(-)]
+	xemacs? ( app-xemacs/ruby-modes )
+"
+
+pkg_setup() {
+	use jit && rust_pkg_setup
+}
+
+src_prepare() {
+	eapply "${FILESDIR}"/"${SLOT}"/010*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/013*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/902*.patch
+
+	if use elibc_musl ; then
+		eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch
+	fi
+
+	einfo "Unbundling gems..."
+	cd "$S"
+	# Remove bundled gems that we will install via PDEPEND, bug
+	# 539700.
+	rm -fr gems/* || die
+	touch gems/bundled_gems || die
+
+	# Avoid the irb default gemspec since we will install the normal gem
+	# instead. This avoids a file collision with dev-ruby/irb.
+	rm lib/irb/irb.gemspec || die
+
+	# Remove tests that are known to fail or require a network connection
+	rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die
+	rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb \
+	   spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die
+
+	# Remove webrick tests because setting LD_LIBRARY_PATH does not work for them.
+	rm -rf tool/test/webrick || die
+
+	# Avoid test using the system ruby
+	sed -i -e '/test_dumb_terminal/aomit "Uses system ruby"' test/reline/test_reline.rb || die
+
+	# Avoid testing against hard-coded blockdev devices that most likely are not available
+	sed -i -e '/def blockdev/a@blockdev = nil' test/ruby/test_file_exhaustive.rb || die
+
+	# Avoid tests that require gem downloads
+	sed -e '/^\(test-syntax-suggest\|PREPARE_SYNTAX_SUGGEST\)/ s/\$(TEST_RUNNABLE)/no/' \
+		-i common.mk
+
+	# Avoid test that fails intermittently
+	sed -e '/test_gem_exec_gem_uninstall/aomit "Fails intermittently"' \
+		-i test/rubygems/test_gem_commands_exec_command.rb || die
+
+	# Avoid test fragile for git command output not matching on whitespace
+	sed -e '/test_pretty_print/aomit "Fragile for output differences"' \
+		-i test/rubygems/test_gem_source_git.rb || die
+
+	if use prefix ; then
+		# Fix hardcoded SHELL var in mkmf library
+		sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die
+	fi
+
+	eapply_user
+
+	eautoreconf
+}
+
+src_configure() {
+	local modules="win32,win32ole" myconf=
+
+	# Ruby's build system does interesting things with MAKEOPTS and doesn't
+	# handle MAKEOPTS="-Oline" or similar well. Just filter it all out
+	# and use -j/-l parsed out from the original MAKEOPTS, then use that.
+	# Newer Portage sets this option by default in GNUMAKEFLAGS if nothing
+	# is set by the user in MAKEOPTS. See bug #900929 and bug #728424.
+	local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)"
+	unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS
+	export MAKEOPTS="${makeopts_tmp}"
+
+	# Avoid a hardcoded path to mkdir to avoid issues with mixed
+	# usr-merge and normal binary packages, bug #932386.
+	export ac_cv_path_mkdir=mkdir
+
+	# -fomit-frame-pointer makes ruby segfault, see bug #150413.
+	filter-flags -fomit-frame-pointer
+	append-flags -fno-omit-frame-pointer
+	# In many places aliasing rules are broken; play it safe
+	# as it's risky with newer compilers to leave it as it is.
+	append-flags -fno-strict-aliasing
+
+	# Workaround for bug #938302
+	if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then
+		export DTRACE="${BROOT}"/usr/bin/stap-dtrace
+	fi
+
+	# Socks support via dante
+	if use socks5 ; then
+		# Socks support can't be disabled as long as SOCKS_SERVER is
+		# set and socks library is present, so need to unset
+		# SOCKS_SERVER in that case.
+		unset SOCKS_SERVER
+	fi
+
+	# Increase GC_MALLOC_LIMIT if set (default is 8000000)
+	if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+		append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+	fi
+
+	# Determine which modules *not* to build depending in the USE flags.
+	if ! use berkdb ; then
+		modules="${modules},dbm"
+	fi
+	if ! use gdbm ; then
+		modules="${modules},gdbm"
+	fi
+	if ! use ssl ; then
+		modules="${modules},openssl"
+	fi
+	if ! use tk ; then
+		modules="${modules},tk"
+	fi
+
+	# Fix co-routine selection for x32, bug 933070
+	[[ ${CHOST} == *gnux32 ]] && myconf="${myconf} --with-coroutine=amd64"
+
+	# Provide an empty LIBPATHENV because we disable rpath but we do not
+	# need LD_LIBRARY_PATH by default since that breaks USE=multitarget
+	# #564272
+	# except on Darwin, where we really need LIBPATHENV to set the right
+	# DYLD_ stuff during the invocation of miniruby for it to work
+	#
+	# --with-setjmp-type=setjmp for bug #949016
+	[[ ${CHOST} == *-darwin* ]] || export LIBPATHENV=""
+	INSTALL="${EPREFIX}/usr/bin/install -c" econf \
+		--program-suffix=${MY_SUFFIX} \
+		--with-soname=ruby${MY_SUFFIX} \
+		--enable-shared \
+		--enable-pthread \
+		--disable-rpath \
+		--without-baseruby \
+		--with-compress-debug-sections=no \
+		--with-setjmp-type=setjmp \
+		--enable-mkmf-verbose \
+		--with-out-ext="${modules}" \
+		$(use_with jemalloc jemalloc) \
+		$(use_enable jit jit-support) \
+		$(use_enable jit yjit) \
+		$(use_enable socks5 socks) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable doc install-doc) \
+		$(use_enable static-libs static) \
+		$(use_enable static-libs install-static-library) \
+		$(use_with static-libs static-linked-ext) \
+		$(use_enable debug) \
+		${myconf} \
+		$(use_with valgrind) \
+		--enable-option-checking=no
+
+	# Makefile is broken because it lacks -ldl
+	rm -rf ext/-test-/popen_deadlock || die
+}
+
+src_compile() {
+	local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+	emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS=""
+}
+
+src_test() {
+	local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+	emake V=1 check
+}
+
+src_install() {
+	# Remove the remaining bundled gems. We do this late in the process
+	# since they are used during the build to e.g. create the
+	# documentation.
+	einfo "Removing default gems before installation"
+	rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die
+
+	# Ruby is involved in the install process, we don't want interference here.
+	unset RUBYOPT
+
+	local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+	local -x LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+
+	local -x RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+	for d in $(find "${S}/ext" -type d) ; do
+		RUBYLIB="${RUBYLIB}:$d"
+	done
+
+	# Create directory for the default gems
+	local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}"
+	mkdir -p "${D}/${gem_home}" || die "mkdir gem home failed"
+
+	emake V=1 DESTDIR="${D}" GEM_DESTDIR=${gem_home} install
+
+	# Remove installed rubygems and rdoc copy
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+	rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+	rm -rf "${ED}/usr/bin/"{bundle,bundler,ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+	if use doc; then
+		emake DESTDIR="${D}" GEM_DESTDIR=${gem_home} install-doc
+	fi
+
+	if use examples; then
+		dodoc -r sample
+	fi
+
+	dodoc ChangeLog NEWS.md README*
+	dodoc -r doc
+}
+
+pkg_postinst() {
+	if [[ ! -n $(readlink "${EROOT}"/usr/bin/ruby) ]] ; then
+		eselect ruby set ruby${MY_SUFFIX}
+	fi
+
+	elog
+	elog "To switch between available Ruby profiles, execute as root:"
+	elog "\teselect ruby set ruby(30|31|...)"
+	elog
+}
+
+pkg_postrm() {
+	eselect ruby cleanup
+}
diff --git a/dev-lang/ruby/ruby-3.4.1-r1.ebuild b/dev-lang/ruby/ruby-3.4.1-r1.ebuild
new file mode 100644
index 000000000000..3f9f07ce7cb7
--- /dev/null
+++ b/dev-lang/ruby/ruby-3.4.1-r1.ebuild
@@ -0,0 +1,316 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+RUST_OPTIONAL="yes"
+
+inherit autotools flag-o-matic multiprocessing rust
+
+MY_P="${PN}-$(ver_cut 1-3)"
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="https://www.ruby-lang.org/"
+SRC_URI="https://cache.ruby-lang.org/pub/ruby/$(ver_cut 1-2)/${MY_P}.tar.xz"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+SLOT=$(ver_cut 1-2)
+MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
+RUBYVERSION=${SLOT}.0
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+
+RDEPEND="
+	berkdb? ( sys-libs/db:= )
+	gdbm? ( sys-libs/gdbm:= )
+	jemalloc? ( dev-libs/jemalloc:= )
+	jit? ( ${RUST_DEPEND} )
+	ssl? (
+		dev-libs/openssl:0=
+	)
+	socks5? ( >=net-proxy/dante-1.1.13 )
+	systemtap? ( dev-debug/systemtap )
+	tk? (
+		dev-lang/tcl:0=[threads]
+		dev-lang/tk:0=[threads]
+	)
+	dev-libs/libyaml
+	dev-libs/libffi:=
+	sys-libs/zlib
+	virtual/libcrypt:=
+	>=app-eselect/eselect-ruby-20241225
+"
+
+DEPEND="
+	${RDEPEND}
+	valgrind? ( dev-debug/valgrind )
+"
+
+BUNDLED_GEMS="
+	>=dev-ruby/minitest-5.25.4[ruby_targets_ruby34(-)]
+	>=dev-ruby/power_assert-2.0.5[ruby_targets_ruby34(-)]
+	>=dev-ruby/rake-13.2.1[ruby_targets_ruby34(-)]
+	>=dev-ruby/test-unit-3.6.7[ruby_targets_ruby34(-)]
+	>=dev-ruby/rexml-3.4.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/rss-0.3.1[ruby_targets_ruby34(-)]
+	>=dev-ruby/net-ftp-0.3.8[ruby_targets_ruby34(-)]
+	>=dev-ruby/net-imap-0.5.4[ruby_targets_ruby34(-)]
+	>=dev-ruby/net-pop-0.1.2[ruby_targets_ruby34(-)]
+	>=dev-ruby/net-smtp-0.5.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/matrix-0.4.2[ruby_targets_ruby34(-)]
+	>=dev-ruby/prime-0.1.3[ruby_targets_ruby34(-)]
+	>=dev-ruby/rbs-3.8.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/typeprof-0.30.1[ruby_targets_ruby34(-)]
+	>=dev-ruby/debug-1.10.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/racc-1.8.1[ruby_targets_ruby34(-)]
+
+	>=dev-ruby/mutex_m-0.3.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/getoptlong-0.2.1[ruby_targets_ruby34(-)]
+	>=dev-ruby/base64-0.2.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/bigdecimal-3.1.8[ruby_targets_ruby34(-)]
+	>=dev-ruby/observer-0.1.2[ruby_targets_ruby34(-)]
+	>=dev-ruby/abbrev-0.1.2[ruby_targets_ruby34(-)]
+	>=dev-ruby/resolv-replace-0.1.1[ruby_targets_ruby34(-)]
+	>=dev-ruby/rinda-0.2.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/drb-2.2.1[ruby_targets_ruby34(-)]
+	>=dev-ruby/nkf-0.2.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/syslog-0.2.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/csv-3.3.2[ruby_targets_ruby34(-)]
+	>=dev-ruby/repl_type_completor-0.1.9[ruby_targets_ruby34(-)]
+"
+
+PDEPEND="
+	${BUNDLED_GEMS}
+	virtual/rubygems[ruby_targets_ruby34(-)]
+	>=dev-ruby/bundler-2.5.11[ruby_targets_ruby34(-)]
+	>=dev-ruby/did_you_mean-1.6.3[ruby_targets_ruby34(-)]
+	>=dev-ruby/irb-1.11.0[ruby_targets_ruby34(-)]
+	>=dev-ruby/json-2.7.2[ruby_targets_ruby34(-)]
+	>=dev-ruby/rdoc-6.6.2[ruby_targets_ruby34(-)]
+	xemacs? ( app-xemacs/ruby-modes )
+"
+
+pkg_setup() {
+	use jit && rust_pkg_setup
+}
+
+src_prepare() {
+	eapply "${FILESDIR}"/"${SLOT}"/010*.patch
+	eapply "${FILESDIR}"/"${SLOT}"/902*.patch
+
+	if use elibc_musl ; then
+		eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch
+	fi
+
+	einfo "Unbundling gems..."
+	cd "$S"
+	# Remove bundled gems that we will install via PDEPEND, bug
+	# 539700.
+	rm -fr gems/* || die
+	touch gems/bundled_gems || die
+
+	# Avoid the irb default gemspec since we will install the normal gem
+	# instead. This avoids a file collision with dev-ruby/irb.
+	rm lib/irb/irb.gemspec || die
+
+	# Remove tests that are known to fail or require a network connection
+	rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die
+	rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb \
+	   spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb \
+		spec/ruby/library/socket/socket/connect_spec.rb || die
+
+	# Remove webrick tests because setting LD_LIBRARY_PATH does not work for them.
+	rm -rf tool/test/webrick || die
+
+	# Avoid tests using the system ruby
+	sed -i -e '/test_\(dumb_terminal\|tty_amibuous_width\)/aomit "Uses system ruby"' test/reline/test_reline.rb || die
+
+	# Avoid testing against hard-coded blockdev devices that most likely are not available
+	sed -i -e '/def blockdev/a@blockdev = nil' test/ruby/test_file_exhaustive.rb || die
+
+	# Avoid tests that require gem downloads
+	sed -e '/^check/ s/\(test-syntax-suggest\|\$(PREPARE_SYNTAX_SUGGEST)\)//g' \
+		-i common.mk || die
+
+	# Avoid test that fails intermittently
+	sed -e '/test_gem_exec_gem_uninstall/aomit "Fails intermittently"' \
+		-i test/rubygems/test_gem_commands_exec_command.rb || die
+
+	# Avoid test fragile for git command output not matching on whitespace
+	sed -e '/test_pretty_print/aomit "Fragile for output differences"' \
+		-i test/rubygems/test_gem_source_git.rb || die
+
+	if use prefix ; then
+		# Fix hardcoded SHELL var in mkmf library
+		sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die
+	fi
+
+	eapply_user
+
+	eautoreconf
+}
+
+src_configure() {
+	local modules="win32,win32ole" myconf=
+
+	# Ruby's build system does interesting things with MAKEOPTS and doesn't
+	# handle MAKEOPTS="-Oline" or similar well. Just filter it all out
+	# and use -j/-l parsed out from the original MAKEOPTS, then use that.
+	# Newer Portage sets this option by default in GNUMAKEFLAGS if nothing
+	# is set by the user in MAKEOPTS. See bug #900929 and bug #728424.
+	local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)"
+	unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS
+	export MAKEOPTS="${makeopts_tmp}"
+
+	# Avoid a hardcoded path to mkdir to avoid issues with mixed
+	# usr-merge and normal binary packages, bug #932386.
+	export ac_cv_path_mkdir=mkdir
+
+	# -fomit-frame-pointer makes ruby segfault, see bug #150413.
+	filter-flags -fomit-frame-pointer
+	append-flags -fno-omit-frame-pointer
+	# In many places aliasing rules are broken; play it safe
+	# as it's risky with newer compilers to leave it as it is.
+	append-flags -fno-strict-aliasing
+
+	# Workaround for bug #938302
+	if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then
+		export DTRACE="${BROOT}"/usr/bin/stap-dtrace
+	fi
+
+	# Socks support via dante
+	if use socks5 ; then
+		# Socks support can't be disabled as long as SOCKS_SERVER is
+		# set and socks library is present, so need to unset
+		# SOCKS_SERVER in that case.
+		unset SOCKS_SERVER
+	fi
+
+	# Increase GC_MALLOC_LIMIT if set (default is 8000000)
+	if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+		append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+	fi
+
+	# Determine which modules *not* to build depending in the USE flags.
+	if ! use berkdb ; then
+		modules="${modules},dbm"
+	fi
+	if ! use gdbm ; then
+		modules="${modules},gdbm"
+	fi
+	if ! use ssl ; then
+		modules="${modules},openssl"
+	fi
+	if ! use tk ; then
+		modules="${modules},tk"
+	fi
+
+	# Fix co-routine selection for x32, bug 933070
+	[[ ${CHOST} == *gnux32 ]] && myconf="${myconf} --with-coroutine=amd64"
+
+	# Provide an empty LIBPATHENV because we disable rpath but we do not
+	# need LD_LIBRARY_PATH by default since that breaks USE=multitarget
+	# #564272
+	# except on Darwin, where we really need LIBPATHENV to set the right
+	# DYLD_ stuff during the invocation of miniruby for it to work
+	#
+	# --with-setjmp-type=setjmp for bug #949016
+	[[ ${CHOST} == *-darwin* ]] || export LIBPATHENV=""
+	INSTALL="${EPREFIX}/usr/bin/install -c" econf \
+		--program-suffix=${MY_SUFFIX} \
+		--with-soname=ruby${MY_SUFFIX} \
+		--enable-shared \
+		--enable-pthread \
+		--disable-rpath \
+		--without-baseruby \
+		--with-compress-debug-sections=no \
+		--with-setjmp-type=setjmp \
+		--enable-mkmf-verbose \
+		--with-out-ext="${modules}" \
+		$(use_with jemalloc jemalloc) \
+		$(use_enable jit jit-support) \
+		$(use_enable jit yjit) \
+		$(use_enable socks5 socks) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable doc install-doc) \
+		$(use_enable static-libs static) \
+		$(use_enable static-libs install-static-library) \
+		$(use_with static-libs static-linked-ext) \
+		$(use_enable debug) \
+		${myconf} \
+		$(use_with valgrind) \
+		--enable-option-checking=no
+
+	# Makefile is broken because it lacks -ldl
+	rm -rf ext/-test-/popen_deadlock || die
+}
+
+src_compile() {
+	local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+	emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS=""
+}
+
+src_test() {
+	local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+	emake V=1 check
+}
+
+src_install() {
+	# Remove the remaining bundled gems. We do this late in the process
+	# since they are used during the build to e.g. create the
+	# documentation.
+	einfo "Removing default gems before installation"
+	rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die
+
+	# Ruby is involved in the install process, we don't want interference here.
+	unset RUBYOPT
+
+	local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+	local -x LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+
+	local -x RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+	for d in $(find "${S}/ext" -type d) ; do
+		RUBYLIB="${RUBYLIB}:$d"
+	done
+
+	# Create directory for the default gems
+	local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}"
+	mkdir -p "${D}/${gem_home}" || die "mkdir gem home failed"
+
+	emake V=1 DESTDIR="${D}" GEM_DESTDIR=${gem_home} install
+
+	# Remove installed rubygems and rdoc copy
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+	rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+	rm -rf "${ED}/usr/bin/"{bundle,bundler,ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+	if use doc; then
+		emake DESTDIR="${D}" GEM_DESTDIR=${gem_home} install-doc
+	fi
+
+	if use examples; then
+		dodoc -r sample
+	fi
+
+	dodoc ChangeLog NEWS.md README*
+	dodoc -r doc
+}
+
+pkg_postinst() {
+	if [[ ! -n $(readlink "${EROOT}"/usr/bin/ruby) ]] ; then
+		eselect ruby set ruby${MY_SUFFIX}
+	fi
+
+	elog
+	elog "To switch between available Ruby profiles, execute as root:"
+	elog "\teselect ruby set ruby(30|31|...)"
+	elog
+}
+
+pkg_postrm() {
+	eselect ruby cleanup
+}
-- 
cgit v1.2.3