diff --git a/dev-lang/ruby/metadata.xml b/dev-lang/ruby/metadata.xml
index 26b6eb68d5bd1..f6f8841c163dd 100644
--- a/dev-lang/ruby/metadata.xml
+++ b/dev-lang/ruby/metadata.xml
@@ -6,6 +6,7 @@
Gentoo Ruby Project
diff --git a/dev-lang/ruby/ruby-3.3.12.ebuild b/dev-lang/ruby/ruby-3.3.12.ebuild
index 3389516b8ff9c..80bd6ab7e838e 100644
--- a/dev-lang/ruby/ruby-3.3.12.ebuild
+++ b/dev-lang/ruby/ruby-3.3.12.ebuild
@@ -20,11 +20,12 @@ MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
RUBYVERSION=${SLOT}.0
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
-IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+IUSE="berkdb debug doc examples gdbm gmp jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
RDEPEND="
berkdb? ( sys-libs/db:= )
gdbm? ( sys-libs/gdbm:= )
+ gmp? ( dev-libs/gmp:= )
jemalloc? ( dev-libs/jemalloc:= )
jit? ( ${RUST_DEPEND} )
ssl? (
@@ -231,6 +232,7 @@ src_configure() {
--with-setjmp-type=setjmp
--enable-mkmf-verbose
--with-out-ext="${modules}"
+ $(use_with gmp)
$(use_with jemalloc jemalloc)
$(use_enable jit jit-support)
$(use_enable jit yjit)
diff --git a/dev-lang/ruby/ruby-3.3.9999.ebuild b/dev-lang/ruby/ruby-3.3.9999.ebuild
index c924efe914697..2b3a3ad028803 100644
--- a/dev-lang/ruby/ruby-3.3.9999.ebuild
+++ b/dev-lang/ruby/ruby-3.3.9999.ebuild
@@ -33,11 +33,12 @@ SLOT=${MY_SLOT}
MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
RUBYVERSION=${SLOT}.0
-IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+IUSE="berkdb debug doc examples gdbm gmp jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
RDEPEND="
berkdb? ( sys-libs/db:= )
gdbm? ( sys-libs/gdbm:= )
+ gmp? ( dev-libs/gmp:= )
jemalloc? ( dev-libs/jemalloc:= )
jit? ( ${RUST_DEPEND} )
ssl? (
@@ -252,6 +253,7 @@ src_configure() {
--with-setjmp-type=setjmp
--enable-mkmf-verbose
--with-out-ext="${modules}"
+ $(use_with gmp)
$(use_with jemalloc jemalloc)
$(use_enable jit jit-support)
$(use_enable jit yjit)
diff --git a/dev-lang/ruby/ruby-3.4.10.ebuild b/dev-lang/ruby/ruby-3.4.10.ebuild
index 110f672b31f8c..140dbbf8b26da 100644
--- a/dev-lang/ruby/ruby-3.4.10.ebuild
+++ b/dev-lang/ruby/ruby-3.4.10.ebuild
@@ -20,11 +20,12 @@ MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
RUBYVERSION=${SLOT}.0
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
-IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+IUSE="berkdb debug doc examples gdbm gmp jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
RDEPEND="
berkdb? ( sys-libs/db:= )
gdbm? ( sys-libs/gdbm:= )
+ gmp? ( dev-libs/gmp:= )
jemalloc? ( dev-libs/jemalloc:= )
jit? ( ${RUST_DEPEND} )
ssl? (
@@ -246,6 +247,7 @@ src_configure() {
--with-setjmp-type=setjmp
--enable-mkmf-verbose
--with-out-ext="${modules}"
+ $(use_with gmp)
$(use_with jemalloc jemalloc)
$(use_enable jit jit-support)
$(use_enable jit yjit)
diff --git a/dev-lang/ruby/ruby-3.4.9999.ebuild b/dev-lang/ruby/ruby-3.4.9999.ebuild
index 5fd683f90d569..0cbacf40776f0 100644
--- a/dev-lang/ruby/ruby-3.4.9999.ebuild
+++ b/dev-lang/ruby/ruby-3.4.9999.ebuild
@@ -33,11 +33,12 @@ SLOT=${MY_SLOT}
MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
RUBYVERSION=${SLOT}.0
-IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+IUSE="berkdb debug doc examples gdbm gmp jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
RDEPEND="
berkdb? ( sys-libs/db:= )
gdbm? ( sys-libs/gdbm:= )
+ gmp? ( dev-libs/gmp:= )
jemalloc? ( dev-libs/jemalloc:= )
jit? ( ${RUST_DEPEND} )
ssl? (
@@ -267,6 +268,7 @@ src_configure() {
--with-setjmp-type=setjmp
--enable-mkmf-verbose
--with-out-ext="${modules}"
+ $(use_with gmp)
$(use_with jemalloc jemalloc)
$(use_enable jit jit-support)
$(use_enable jit yjit)
diff --git a/dev-lang/ruby/ruby-4.0.6.ebuild b/dev-lang/ruby/ruby-4.0.6.ebuild
index 3185348c37787..6d009cfcbe6e9 100644
--- a/dev-lang/ruby/ruby-4.0.6.ebuild
+++ b/dev-lang/ruby/ruby-4.0.6.ebuild
@@ -34,11 +34,12 @@ SLOT=${MY_SLOT}
MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
RUBYVERSION=${SLOT}.0
-IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+IUSE="berkdb debug doc examples gdbm gmp jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
RDEPEND="
berkdb? ( sys-libs/db:= )
gdbm? ( sys-libs/gdbm:= )
+ gmp? ( dev-libs/gmp:= )
jemalloc? ( dev-libs/jemalloc:= )
jit? ( ${RUST_DEPEND} )
ssl? (
@@ -276,6 +277,7 @@ src_configure() {
--with-setjmp-type=setjmp
--enable-mkmf-verbose
--with-out-ext="${modules}"
+ $(use_with gmp)
$(use_with jemalloc jemalloc)
$(use_enable jit jit-support)
$(use_enable jit yjit)
diff --git a/dev-lang/ruby/ruby-4.0.9999.ebuild b/dev-lang/ruby/ruby-4.0.9999.ebuild
index 3185348c37787..6d009cfcbe6e9 100644
--- a/dev-lang/ruby/ruby-4.0.9999.ebuild
+++ b/dev-lang/ruby/ruby-4.0.9999.ebuild
@@ -34,11 +34,12 @@ SLOT=${MY_SLOT}
MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
RUBYVERSION=${SLOT}.0
-IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
+IUSE="berkdb debug doc examples gdbm gmp jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs"
RDEPEND="
berkdb? ( sys-libs/db:= )
gdbm? ( sys-libs/gdbm:= )
+ gmp? ( dev-libs/gmp:= )
jemalloc? ( dev-libs/jemalloc:= )
jit? ( ${RUST_DEPEND} )
ssl? (
@@ -276,6 +277,7 @@ src_configure() {
--with-setjmp-type=setjmp
--enable-mkmf-verbose
--with-out-ext="${modules}"
+ $(use_with gmp)
$(use_with jemalloc jemalloc)
$(use_enable jit jit-support)
$(use_enable jit yjit)