diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-13 22:21:26 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-13 22:21:26 -0500 |
| commit | f997c3ee588099e4f43e9ec845935868e3e60b8e (patch) | |
| tree | 07f0967cda575ee2edf2d62ed8c0f67855ae6bd3 /dev-lang/ruby | |
| parent | b589bc93e15b300c3e5318fe97241d57e464bea1 (diff) | |
| download | baldeagleos-repo-f997c3ee588099e4f43e9ec845935868e3e60b8e.tar.gz baldeagleos-repo-f997c3ee588099e4f43e9ec845935868e3e60b8e.tar.xz baldeagleos-repo-f997c3ee588099e4f43e9ec845935868e3e60b8e.zip | |
Adding metadata
Diffstat (limited to 'dev-lang/ruby')
32 files changed, 443 insertions, 3084 deletions
diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest index a1392a0847e1..fe8e5c46bccf 100644 --- a/dev-lang/ruby/Manifest +++ b/dev-lang/ruby/Manifest @@ -1,6 +1,4 @@ -DIST ruby-3.2.10.tar.xz 14696548 BLAKE2B 3102628b113097334343f6f5c317febe4516bf42dfe7c0851107cbf7e5d9b24e1c2199542d0e6b6412176f3c10ec8609a342078d8351ccea955540ff62a05a08 SHA512 a89044db8a55bd990d3756e212f2966b62b903eefc96c7e0af89aa4580ff7253d2f64c6c25fc04f2031b959e614bae84b86db36cfdec3a3e8afb5c3026426687 -DIST ruby-3.2.11.tar.xz 14695828 BLAKE2B 5e18849e183441d999643aaf344e85e27f20d0824a214c9e8c2c442d24b85fca7abdcac95d581576b7c029049acf0eaebf36cfee4a134508487374d5d4922381 SHA512 418739d476d34e2467e7f1ee60ff63a1969a362b49871bdc488676c1ac7d28b198deee85e2bd951a23f5b0e8425bc89ca59d5c8cb8415fa5ed835555e3d3af8d DIST ruby-3.3.11.tar.xz 15879844 BLAKE2B 6568f8a571151fc98713fe29ec0ba70bffe2ab5cde7ce30848feea7981b680c633394e9534c472403ef298520346ff51a0771cba69ba55e00e9b82c6aa4aac8a SHA512 1f8eb206a90121015b294dada7ea61ebd136e7e7dbb1c4bb7df21b85f359a2e733f438153bf07c57815a963e4ef3f766081fd4226caa6547f4c263b33ed7726e DIST ruby-3.4.9.tar.xz 16682004 BLAKE2B 0f127653cf05f26fca41e804a7720f962a9f652bd9d04893c1d05bcfea5c3b2dbfa676407600e98b6f7ae04bfd514a531781fe2408a0d46378a1efa07c9e147a SHA512 356fb47cc56f2d25198cb95253fc20ff7d9a6fd1fa53bc475e5c440012aebe27562537c399d271357235114ade263fd625029b66cb0f9b526f9c04f169fb9580 -DIST ruby-4.0.3.tar.xz 17878572 BLAKE2B 33bb0a19c28b36b8469f785177c8cd832e0c720d443ccc819a135f535ced393af04d711cce24ec0f47acd6425a0518a1fe6328d25384cddc605364c8201e60f4 SHA512 5816fb264ce76df59f4bfe0cadceb45025fada2e61f2c14024d6b03f63d304820cddf94afcf82a4951fd12f3b0d9148683f856f3f2245d56042fc8407b6cbff5 DIST ruby-4.0.4.tar.xz 17899740 BLAKE2B cd8828bb14011a19bad226328e1b9e5f1e5c8c194e5b614cab077cda2727e2e8cdbac2f1457d00e89619cfca5ba85d06b1bcb62f59fdd8afee2eea298aee3b07 SHA512 cccc041379fd4e46a736a5c10ccf81627766a7175113c34754797b915bebcd0ce821d9cd7b42cc616b0a1f9ee38eee5ab7560c1840fa6672819c293e498a3f6f +DIST ruby-4.0.5.tar.xz 17893756 BLAKE2B 1b962d15daa9be4fc0ea8e90728b30b0d486e0ec35fe3d9a582bf56a61bfc6d571324d7fb5560d225cab44c9468687e201bb50d1301c4ca710d9fc26e265b4b4 SHA512 379d78a6d1af0455df60da46551f43438ad3ee81f83787554fc34cb1c8febb1bd363e3dc1a057b34a69f96526efc308d3dccc4b87d368897c2d1ccf179096463 diff --git a/dev-lang/ruby/files/3.2/001-socksocket-fix.patch b/dev-lang/ruby/files/3.2/001-socksocket-fix.patch new file mode 100644 index 000000000000..1a79e25491cc --- /dev/null +++ b/dev-lang/ruby/files/3.2/001-socksocket-fix.patch @@ -0,0 +1,15 @@ +Fix compilation with socks5 USE flag. + +Patch by Phobos Kappa in https://bugs.gentoo.org/762253 + +--- a/ext/socket/sockssocket.c 2020-12-25 05:33:01.000000000 +0200 ++++ b/ext/socket/sockssocket.c 2020-12-28 15:42:50.310029778 +0200 +@@ -34,7 +34,7 @@ + init = 1; + } + +- return rsock_init_inetsock(sock, host, port, Qnil, Qnil, INET_SOCKS, Qnil); ++ return rsock_init_inetsock(sock, host, port, Qnil, Qnil, INET_SOCKS, Qnil, Qnil); + } + + #ifdef SOCKS5 diff --git a/dev-lang/ruby/files/3.2/010-default-gem-location.patch b/dev-lang/ruby/files/3.2/010-default-gem-location.patch index 36009ad66f61..039a44b0530b 100644 --- a/dev-lang/ruby/files/3.2/010-default-gem-location.patch +++ b/dev-lang/ruby/files/3.2/010-default-gem-location.patch @@ -1,9 +1,18 @@ ---- a/tool/rbinstall.rb 2022-11-13 08:12:27.373041649 +0100 -+++ b/tool/rbinstall.rb 2022-11-13 08:16:09.110406705 +0100 -@@ -994,7 +994,7 @@ +--- a/tool/rbinstall.rb.~1~ 2020-12-25 04:33:01.000000000 +0100 ++++ b/tool/rbinstall.rb 2020-12-25 10:05:34.629096405 +0100 +@@ -897,7 +897,7 @@ end - install?(:ext, :comm, :gem, :'bundled-gems') do + def install_default_gem(dir, srcdir, bindir) +- gem_dir = Gem.default_dir ++ gem_dir = ENV['GEM_DESTDIR'] + install_dir = with_destdir(gem_dir) + prepare "default gems from #{dir}", gem_dir + makedirs(Gem.ensure_default_gem_subdirectories(install_dir, $dir_mode).map {|d| File.join(gem_dir, d)}) +@@ -1018,7 +1018,7 @@ + end + Gem.instance_variable_set(:@ruby, ruby_path) if Gem.ruby != ruby_path + - gem_dir = Gem.default_dir + gem_dir = ENV['GEM_DESTDIR'] install_dir = with_destdir(gem_dir) diff --git a/dev-lang/ruby/files/3.2/011-arm64-branch-protection.patch b/dev-lang/ruby/files/3.2/011-arm64-branch-protection.patch deleted file mode 100644 index 14d2c00837a7..000000000000 --- a/dev-lang/ruby/files/3.2/011-arm64-branch-protection.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a8af871e29c6c922c4c3aeb94697ab958fc12e9b Mon Sep 17 00:00:00 2001 -From: Yuta Saito <kateinoigakukun@gmail.com> -Date: Wed, 27 Dec 2023 06:22:45 +0000 -Subject: [PATCH] [Bug #20085] Use consistent default options for - `-mbranch-protection` - -We need to use the same options for both C compiler and assembler -when `-mbranch-protection` is guessed by configure. Otherwise, -`coroutine/arm64/Context.{h,S}` will use incompatible PAC strategies. ---- - configure.ac | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 9286946fc15f4..18b4247991d42 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -830,7 +830,10 @@ AS_IF([test "$GCC" = yes], [ - AS_FOR(option, opt, [-mbranch-protection=pac-ret -msign-return-address=all], [ - RUBY_TRY_CFLAGS(option, [branch_protection=yes], [branch_protection=no]) - AS_IF([test "x$branch_protection" = xyes], [ -+ # C compiler and assembler must be consistent for -mbranch-protection -+ # since they both check `__ARM_FEATURE_PAC_DEFAULT` definition. - RUBY_APPEND_OPTION(XCFLAGS, option) -+ RUBY_APPEND_OPTION(ASFLAGS, option) - break - ]) - ]) diff --git a/dev-lang/ruby/files/3.2/011-default-gem-location.patch b/dev-lang/ruby/files/3.2/011-default-gem-location.patch new file mode 100644 index 000000000000..fe5d33d69c01 --- /dev/null +++ b/dev-lang/ruby/files/3.2/011-default-gem-location.patch @@ -0,0 +1,20 @@ +--- a/tool/rbinstall.rb.~1~ 2020-12-25 04:33:01.000000000 +0100 ++++ b/tool/rbinstall.rb 2020-12-25 10:05:34.629096405 +0100 +@@ -897,7 +897,7 @@ + end + + def install_default_gem(dir, srcdir, bindir) +- gem_dir = Gem.default_dir ++ gem_dir = ENV['GEM_DESTDIR'] + install_dir = with_destdir(gem_dir) + prepare "default gems from #{dir}", gem_dir + makedirs(Gem.ensure_default_gem_subdirectories(install_dir, $dir_mode).map {|d| File.join(gem_dir, d)}) +@@ -1010,7 +1010,7 @@ + end + + install?(:ext, :comm, :gem, :'bundled-gems') do +- gem_dir = Gem.default_dir ++ gem_dir = ENV['GEM_DESTDIR'] + install_dir = with_destdir(gem_dir) + prepare "bundled gems", gem_dir + RbInstall.no_write do diff --git a/dev-lang/ruby/files/3.2/013-test-rlimit-constants.patch b/dev-lang/ruby/files/3.2/013-test-rlimit-constants.patch deleted file mode 100644 index 998c839808aa..000000000000 --- a/dev-lang/ruby/files/3.2/013-test-rlimit-constants.patch +++ /dev/null @@ -1,147 +0,0 @@ -From bea20365f43ee115ea6219c7113647eed3d9e342 Mon Sep 17 00:00:00 2001 -From: matoro <matoro@users.noreply.github.com> -Date: Wed, 7 Aug 2024 13:15:00 -0400 -Subject: [PATCH] Replace specific constant tests with just type checks - -As detailed in the attached issue, these constants can and do vary e.g. -between architectures on Linux. Hardcoding and asserting that they are -equal to specific values pretty much defeats the purpose of building -these in at compile time. Instead, simply assert that they exist and -are integers. - -Fixes: https://github.com/ruby/spec/issues/1150 ---- - core/process/constants_spec.rb | 116 ++++++++++++++++++++------------- - 1 file changed, 69 insertions(+), 47 deletions(-) - -diff --git a/core/process/constants_spec.rb b/core/process/constants_spec.rb -index 616c54b8e..57cacadef 100644 ---- a/spec/ruby/core/process/constants_spec.rb -+++ b/spec/ruby/core/process/constants_spec.rb -@@ -2,64 +2,81 @@ - - describe "Process::Constants" do - platform_is :darwin, :netbsd, :freebsd do -- it "has the correct constant values on BSD-like systems" do -- Process::WNOHANG.should == 1 -- Process::WUNTRACED.should == 2 -- Process::PRIO_PROCESS.should == 0 -- Process::PRIO_PGRP.should == 1 -- Process::PRIO_USER.should == 2 -- Process::RLIM_INFINITY.should == 9223372036854775807 -- Process::RLIMIT_CPU.should == 0 -- Process::RLIMIT_FSIZE.should == 1 -- Process::RLIMIT_DATA.should == 2 -- Process::RLIMIT_STACK.should == 3 -- Process::RLIMIT_CORE.should == 4 -- Process::RLIMIT_RSS.should == 5 -- Process::RLIMIT_MEMLOCK.should == 6 -- Process::RLIMIT_NPROC.should == 7 -- Process::RLIMIT_NOFILE.should == 8 -+ it "are all present on BSD-like systems" do -+ %i[ -+ WNOHANG -+ WUNTRACED -+ PRIO_PROCESS -+ PRIO_PGRP -+ PRIO_USER -+ RLIM_INFINITY -+ RLIMIT_CPU -+ RLIMIT_FSIZE -+ RLIMIT_DATA -+ RLIMIT_STACK -+ RLIMIT_CORE -+ RLIMIT_RSS -+ RLIMIT_MEMLOCK -+ RLIMIT_NPROC -+ RLIMIT_NOFILE -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - - platform_is :darwin do -- it "has the correct constant values on Darwin" do -- Process::RLIM_SAVED_MAX.should == 9223372036854775807 -- Process::RLIM_SAVED_CUR.should == 9223372036854775807 -- Process::RLIMIT_AS.should == 5 -+ it "are all present on Darwin" do -+ %i[ -+ RLIM_SAVED_MAX -+ RLIM_SAVED_CUR -+ RLIMIT_AS -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - - platform_is :linux do -- it "has the correct constant values on Linux" do -- Process::WNOHANG.should == 1 -- Process::WUNTRACED.should == 2 -- Process::PRIO_PROCESS.should == 0 -- Process::PRIO_PGRP.should == 1 -- Process::PRIO_USER.should == 2 -- Process::RLIMIT_CPU.should == 0 -- Process::RLIMIT_FSIZE.should == 1 -- Process::RLIMIT_DATA.should == 2 -- Process::RLIMIT_STACK.should == 3 -- Process::RLIMIT_CORE.should == 4 -- Process::RLIMIT_RSS.should == 5 -- Process::RLIMIT_NPROC.should == 6 -- Process::RLIMIT_NOFILE.should == 7 -- Process::RLIMIT_MEMLOCK.should == 8 -- Process::RLIMIT_AS.should == 9 -- -- # These values appear to change according to the platform. -- values = [4294967295, 9223372036854775807, 18446744073709551615] -- values.include?(Process::RLIM_INFINITY).should be_true -- values.include?(Process::RLIM_SAVED_MAX).should be_true -- values.include?(Process::RLIM_SAVED_CUR).should be_true -+ it "are all present on Linux" do -+ %i[ -+ WNOHANG -+ WUNTRACED -+ PRIO_PROCESS -+ PRIO_PGRP -+ PRIO_USER -+ RLIMIT_CPU -+ RLIMIT_FSIZE -+ RLIMIT_DATA -+ RLIMIT_STACK -+ RLIMIT_CORE -+ RLIMIT_RSS -+ RLIMIT_NPROC -+ RLIMIT_NOFILE -+ RLIMIT_MEMLOCK -+ RLIMIT_AS -+ RLIM_INFINITY -+ RLIM_SAVED_MAX -+ RLIM_SAVED_CUR -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - - platform_is :netbsd, :freebsd do -- it "Process::RLIMIT_SBSIZE" do -- Process::RLIMIT_SBSIZE.should == 9 # FIXME: what's it equal? -- Process::RLIMIT_AS.should == 10 -+ it "are all present on NetBSD and FreeBSD" do -+ %i[ -+ RLIMIT_SBSIZE -+ RLIMIT_AS -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - - diff --git a/dev-lang/ruby/files/3.2/014-time-pointer-incompatibility.patch b/dev-lang/ruby/files/3.2/014-time-pointer-incompatibility.patch deleted file mode 100644 index 5363049b72aa..000000000000 --- a/dev-lang/ruby/files/3.2/014-time-pointer-incompatibility.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 59254caff0f39c87370d0c11793e3aae5c38d6e1 Mon Sep 17 00:00:00 2001 -From: nagachika <nagachika@ruby-lang.org> -Date: Sun, 15 Dec 2024 15:31:58 +0900 -Subject: [PATCH] merge revision(s) 055613fd868a8c94e43893f8c58a00cdd2a81f6d: - [Backport #20447] - - Fix pointer incompatiblity - - Since the subsecond part is discarded, WIDEVAL to VALUE conversion is - needed. ---- - time.c | 2 +- - version.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/time.c b/time.c -index 7f859d5eb40acc..04f6f2afc5f28c 100644 ---- a/time.c -+++ b/time.c -@@ -2322,7 +2322,7 @@ zone_timelocal(VALUE zone, VALUE time) - struct time_object *tobj = DATA_PTR(time); - wideval_t t, s; - -- split_second(tobj->timew, &t, &s); -+ wdivmod(tobj->timew, WINT2FIXWV(TIME_SCALE), &t, &s); - tm = tm_from_time(rb_cTimeTM, time); - utc = rb_check_funcall(zone, id_local_to_utc, 1, &tm); - if (UNDEF_P(utc)) return 0; diff --git a/dev-lang/ruby/files/3.2/017-socket-add-full-prototype.patch b/dev-lang/ruby/files/3.2/017-socket-add-full-prototype.patch deleted file mode 100644 index a61a2d5aa0fb..000000000000 --- a/dev-lang/ruby/files/3.2/017-socket-add-full-prototype.patch +++ /dev/null @@ -1,48 +0,0 @@ -https://github.com/ruby/ruby/commit/d77e02bd85ab7f841df8d473bac214b9a92a3506 - -From d77e02bd85ab7f841df8d473bac214b9a92a3506 Mon Sep 17 00:00:00 2001 -From: "Z. Liu" <zhixu.liu@gmail.com> -Date: Wed, 2 Jul 2025 09:09:52 +0800 -Subject: [PATCH] [Bug #21497] [ruby/socket]: add full prototype -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -otherwise, gcc 15 will complain: - -> init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 -> 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); -> | ^~~~~~~~ ~~~~~~~ -> In file included from init.c:11: -> rubysocket.h:294:5: note: declared here -> 294 | int Rconnect(); -> | ^~~~~~~~ - -> sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 -> 33 | SOCKSinit("ruby"); -> | ^~~~~~~~~ ~~~~~~ -> In file included from sockssocket.c:11: -> rubysocket.h:293:6: note: declared here -> 293 | void SOCKSinit(); -> | ^~~~~~~~~ - -Signed-off-by: Z. Liu <zhixu.liu@gmail.com> - -diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h -index 54a5381da4..dcafbe24e3 100644 ---- a/ext/socket/rubysocket.h -+++ b/ext/socket/rubysocket.h -@@ -292,8 +292,8 @@ extern VALUE rb_eResolution; - #ifdef SOCKS - extern VALUE rb_cSOCKSSocket; - # ifndef SOCKS5 --void SOCKSinit(); --int Rconnect(); -+void SOCKSinit(char *); -+int Rconnect(int, const struct sockaddr *, socklen_t); - # endif - #endif - --- -2.49.1 - diff --git a/dev-lang/ruby/files/3.2/020-arm-readline-test.patch b/dev-lang/ruby/files/3.2/020-arm-readline-test.patch deleted file mode 100644 index 4edbc7b2b0c5..000000000000 --- a/dev-lang/ruby/files/3.2/020-arm-readline-test.patch +++ /dev/null @@ -1,32 +0,0 @@ -From dd77934ca6e2e8b2b894f2460017323b33b619b6 Mon Sep 17 00:00:00 2001 -From: matoro <matoro@users.noreply.github.com> -Date: Thu, 23 May 2024 16:10:32 -0400 -Subject: [PATCH] [ruby/readline-ext] Skip test_interrupt_in_other_thread on - arm32-linux - -This is a combination of main Ruby commit -https://github.com/ruby/ruby/commit/aefc98891c42024039f19ef45bdfe93fbc590b7c -and my PR correcting the regex https://github.com/ruby/ruby/pull/10819. -Upstream Ruby requests that changes to this test go to readline-ext repo -before being backported to 3.2 branch. - -https://github.com/ruby/readline-ext/commit/868f873a78 ---- - test/readline/test_readline.rb | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb -index 7838f4f52e864e..ab70e4371122f0 100644 ---- a/test/readline/test_readline.rb -+++ b/test/readline/test_readline.rb -@@ -496,8 +496,8 @@ def test_interrupt_in_other_thread - # Maybe the same issue: https://github.com/facebookresearch/nle/issues/120 - omit if /i[3-6]86-linux/ =~ RUBY_PLATFORM - -- # Skip arm32-linux (Travis CI). -- omit "Skip arm32-linux" if /armv.+l-linux/ =~ RUBY_PLATFORM -+ # Skip arm32-linux (Travis CI). See aefc988 in main ruby repo. -+ omit "Skip arm32-linux" if /armv[0-9+][a-z]-linux/ =~ RUBY_PLATFORM - - if defined?(TestReadline) && self.class == TestReadline - use = "use_ext_readline" diff --git a/dev-lang/ruby/files/3.2/021-round-test-glibc-2.42.patch b/dev-lang/ruby/files/3.2/021-round-test-glibc-2.42.patch deleted file mode 100644 index b5b49d02ea5b..000000000000 --- a/dev-lang/ruby/files/3.2/021-round-test-glibc-2.42.patch +++ /dev/null @@ -1,78 +0,0 @@ -https://bugs.ruby-lang.org/issues/21666 -https://github.com/ruby/ruby/commit/c5bd4acd30320a8e180ce9fcb24acdab4e10c73a - -From 9bd3e3a2597b40237957e7fa67f666725b6b470c Mon Sep 17 00:00:00 2001 -Message-ID: <9bd3e3a2597b40237957e7fa67f666725b6b470c.1775890716.git.sam@gentoo.org> -From: nagachika <nagachika@ruby-lang.org> -Date: Sat, 29 Nov 2025 12:31:08 +0900 -Subject: [PATCH] merge revision(s) c5bd4acd30320a8e180ce9fcb24acdab4e10c73a: - [Backport #21666] - - [PATCH] [Bug #21666] Get rid of use of unspecified values ---- - spec/ruby/core/math/lgamma_spec.rb | 11 ++++------- - test/ruby/test_math.rb | 12 +++++++++++- - 2 files changed, 15 insertions(+), 8 deletions(-) - -diff --git a/spec/ruby/core/math/lgamma_spec.rb b/spec/ruby/core/math/lgamma_spec.rb -index 33e7836448..2bf350993e 100644 ---- a/spec/ruby/core/math/lgamma_spec.rb -+++ b/spec/ruby/core/math/lgamma_spec.rb -@@ -5,10 +5,8 @@ - Math.lgamma(0).should == [infinity_value, 1] - end - -- platform_is_not :windows do -- it "returns [Infinity, 1] when passed -1" do -- Math.lgamma(-1).should == [infinity_value, 1] -- end -+ it "returns [Infinity, ...] when passed -1" do -+ Math.lgamma(-1)[0].should == infinity_value - end - - it "returns [Infinity, -1] when passed -0.0" do -@@ -47,8 +45,7 @@ - Math.lgamma(infinity_value).should == [infinity_value, 1] - end - -- it "returns [NaN, 1] when passed NaN" do -- Math.lgamma(nan_value)[0].nan?.should be_true -- Math.lgamma(nan_value)[1].should == 1 -+ it "returns [NaN, ...] when passed NaN" do -+ Math.lgamma(nan_value)[0].should.nan? - end - end -diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb -index 73f44c6ae3..ae3d1be959 100644 ---- a/test/ruby/test_math.rb -+++ b/test/ruby/test_math.rb -@@ -296,12 +296,22 @@ def test_lgamma - assert_float_and_int([Math.log(6), 1], Math.lgamma(4)) - - assert_raise_with_message(Math::DomainError, /\blgamma\b/) { Math.lgamma(-Float::INFINITY) } -+ -+ x, sign = Math.lgamma(+0.0) -+ mesg = "Math.lgamma(+0.0) should be [INF, +1]" -+ assert_infinity(x, mesg) -+ assert_equal(+1, sign, mesg) -+ - x, sign = Math.lgamma(-0.0) - mesg = "Math.lgamma(-0.0) should be [INF, -1]" - assert_infinity(x, mesg) - assert_predicate(x, :positive?, mesg) - assert_equal(-1, sign, mesg) -- x, sign = Math.lgamma(Float::NAN) -+ -+ x, = Math.lgamma(-1) -+ assert_infinity(x, "Math.lgamma(-1) should be +INF") -+ -+ x, = Math.lgamma(Float::NAN) - assert_nan(x) - end - - -base-commit: 5483bfc1ae5725e871cbbddf313626fbb0f2dbb8 -prerequisite-patch-id: e1e341a29d6cceed0666bbaead934a8704d7be33 --- -2.53.0 - diff --git a/dev-lang/ruby/files/3.2/901-musl-stacksize.patch b/dev-lang/ruby/files/3.2/901-musl-stacksize.patch index f18aa271ea65..e5fcfce2195e 100644 --- a/dev-lang/ruby/files/3.2/901-musl-stacksize.patch +++ b/dev-lang/ruby/files/3.2/901-musl-stacksize.patch @@ -1,6 +1,11 @@ ---- a/thread_pthread.c 2023-02-08 05:02:20.000000000 +0100 -+++ b/thread_pthread.c 2023-03-10 17:46:25.694739053 +0100 -@@ -1033,7 +1033,7 @@ +musl has a conservative stacksize, as compared to glibc, so treat it +like other systems with such stacksize + +diff --git a/thread_pthread.c b/thread_pthread.c +index 951885ffa0..e2d662143b 100644 +--- a/thread_pthread.c ++++ b/thread_pthread.c +@@ -721,7 +721,7 @@ ruby_init_stack(volatile VALUE *addr { native_main_thread.id = pthread_self(); @@ -8,13 +13,14 @@ +#if MAINSTACKADDR_AVAILABLE && !(defined(__linux__) && !defined(__GLIBC__)) if (native_main_thread.stack_maxsize) return; { - void* stackaddr; -@@ -2090,7 +2090,7 @@ - + void* stackaddr; +@@ -1680,7 +1680,7 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr) + #ifdef STACKADDR_AVAILABLE if (get_stack(&base, &size) == 0) { -# ifdef __APPLE__ +# if defined(__APPLE__) || (defined(__linux__) && !defined(__GLIBC__)) - if (pthread_equal(th->nt->thread_id, native_main_thread.id)) { - struct rlimit rlim; - if (getrlimit(RLIMIT_STACK, &rlim) == 0 && rlim.rlim_cur > size) { + if (pthread_equal(th->thread_id, native_main_thread.id)) { + struct rlimit rlim; + if (getrlimit(RLIMIT_STACK, &rlim) == 0 && rlim.rlim_cur > size) { + diff --git a/dev-lang/ruby/files/3.2/902-hppa-pthread-stack-size.patch b/dev-lang/ruby/files/3.2/902-hppa-pthread-stack-size.patch deleted file mode 100644 index 96e24a340ad9..000000000000 --- a/dev-lang/ruby/files/3.2/902-hppa-pthread-stack-size.patch +++ /dev/null @@ -1,54 +0,0 @@ -https://bugs.gentoo.org/701494 - -From 40ccf3b91071d3603335b0b7095613ef1843f9e1 Mon Sep 17 00:00:00 2001 -From: Sam James <sam@gentoo.org> -Date: Fri, 7 Apr 2023 11:46:12 +0100 -Subject: [PATCH] thread_pthread: Grow main_stack if required (fixes tests on - HPPA) - -On HPPA, test_insns.rb fails (along with various Ruby gems) with -'stack level too deep (SystemStackError)'. This turns out to be because HPPA -defaults to a small(er) stack. - -With this change, most of Ruby's test suite now passes on HPPA. - -Thanks to both Dave and Helge for the investigation and coming up with the -patch. - -Bug: https://bugs.gentoo.org/701494 -Bug: https://bugs.debian.org/881773 -Bug: https://bugs.debian.org/881772 (for PPC64) -Bug: https://github.com/rack/rack/issues/1640 -Thanks-to: John David Anglin <dave.anglin@bell.net> -Thanks-to: Helge Deller <deller@gmx.de> -Signed-off-by: Sam James <sam@gentoo.org> ---- a/thread_pthread.c -+++ b/thread_pthread.c -@@ -858,8 +858,22 @@ size_t pthread_get_stacksize_np(pthread_t); - # define MAINSTACKADDR_AVAILABLE 0 - # endif - #endif --#if MAINSTACKADDR_AVAILABLE && !defined(get_main_stack) --# define get_main_stack(addr, size) get_stack(addr, size) -+#if MAINSTACKADDR_AVAILABLE -+static int get_stack(void **, size_t *); -+static int -+get_main_stack(void **addr, size_t *size) -+{ -+ int ret = get_stack(addr, size); -+ -+#ifdef __hppa__ -+ /* On some architectures, the initial stack size may be too small, but fortunately, -+ it's growable. Bump it up to the minimum needed if it is too small. */ -+ if (*size < RUBY_VM_THREAD_VM_STACK_SIZE) -+ *size = RUBY_VM_THREAD_VM_STACK_SIZE; -+#endif -+ -+ return ret; -+} - #endif - - #ifdef STACKADDR_AVAILABLE --- -2.40.0 - diff --git a/dev-lang/ruby/files/3.3/011-arm64-branch-protection.patch b/dev-lang/ruby/files/3.3/011-arm64-branch-protection.patch deleted file mode 100644 index 14d2c00837a7..000000000000 --- a/dev-lang/ruby/files/3.3/011-arm64-branch-protection.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a8af871e29c6c922c4c3aeb94697ab958fc12e9b Mon Sep 17 00:00:00 2001 -From: Yuta Saito <kateinoigakukun@gmail.com> -Date: Wed, 27 Dec 2023 06:22:45 +0000 -Subject: [PATCH] [Bug #20085] Use consistent default options for - `-mbranch-protection` - -We need to use the same options for both C compiler and assembler -when `-mbranch-protection` is guessed by configure. Otherwise, -`coroutine/arm64/Context.{h,S}` will use incompatible PAC strategies. ---- - configure.ac | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 9286946fc15f4..18b4247991d42 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -830,7 +830,10 @@ AS_IF([test "$GCC" = yes], [ - AS_FOR(option, opt, [-mbranch-protection=pac-ret -msign-return-address=all], [ - RUBY_TRY_CFLAGS(option, [branch_protection=yes], [branch_protection=no]) - AS_IF([test "x$branch_protection" = xyes], [ -+ # C compiler and assembler must be consistent for -mbranch-protection -+ # since they both check `__ARM_FEATURE_PAC_DEFAULT` definition. - RUBY_APPEND_OPTION(XCFLAGS, option) -+ RUBY_APPEND_OPTION(ASFLAGS, option) - break - ]) - ]) diff --git a/dev-lang/ruby/files/3.3/012-mkdir-path.patch b/dev-lang/ruby/files/3.3/012-mkdir-path.patch deleted file mode 100644 index 6fd28e01bd76..000000000000 --- a/dev-lang/ruby/files/3.3/012-mkdir-path.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/configure.ac 2024-05-30 02:23:11.000000000 +0200 -+++ b/configure.ac 2024-06-01 10:10:07.602924940 +0200 -@@ -519,6 +519,10 @@ - ac_cv_path_mkdir="mkdir" - ]) - -+AS_CASE(["$target_os"],[*],[ -+ ac_cv_path_mkdir="mkdir" -+]) -+ - RUBY_PROG_MAKEDIRS - - AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace]) diff --git a/dev-lang/ruby/files/3.3/013-test-rlimit-constants.patch b/dev-lang/ruby/files/3.3/013-test-rlimit-constants.patch deleted file mode 100644 index c3790b13152b..000000000000 --- a/dev-lang/ruby/files/3.3/013-test-rlimit-constants.patch +++ /dev/null @@ -1,159 +0,0 @@ -From bea20365f43ee115ea6219c7113647eed3d9e342 Mon Sep 17 00:00:00 2001 -From: matoro <matoro@users.noreply.github.com> -Date: Wed, 7 Aug 2024 13:15:00 -0400 -Subject: [PATCH] Replace specific constant tests with just type checks - -As detailed in the attached issue, these constants can and do vary e.g. -between architectures on Linux. Hardcoding and asserting that they are -equal to specific values pretty much defeats the purpose of building -these in at compile time. Instead, simply assert that they exist and -are integers. - -Fixes: https://github.com/ruby/spec/issues/1150 ---- - core/process/constants_spec.rb | 116 ++++++++++++++++++++------------- - 1 file changed, 69 insertions(+), 47 deletions(-) - -diff --git a/core/process/constants_spec.rb b/core/process/constants_spec.rb -index 616c54b8e..57cacadef 100644 ---- a/spec/ruby/core/process/constants_spec.rb -+++ b/spec/ruby/core/process/constants_spec.rb -@@ -2,69 +2,91 @@ - - describe "Process::Constants" do - platform_is :darwin, :netbsd, :freebsd do -- it "has the correct constant values on BSD-like systems" do -- Process::WNOHANG.should == 1 -- Process::WUNTRACED.should == 2 -- Process::PRIO_PROCESS.should == 0 -- Process::PRIO_PGRP.should == 1 -- Process::PRIO_USER.should == 2 -- Process::RLIM_INFINITY.should == 9223372036854775807 -- Process::RLIMIT_CPU.should == 0 -- Process::RLIMIT_FSIZE.should == 1 -- Process::RLIMIT_DATA.should == 2 -- Process::RLIMIT_STACK.should == 3 -- Process::RLIMIT_CORE.should == 4 -- Process::RLIMIT_RSS.should == 5 -- Process::RLIMIT_MEMLOCK.should == 6 -- Process::RLIMIT_NPROC.should == 7 -- Process::RLIMIT_NOFILE.should == 8 -+ it "are all present on BSD-like systems" do -+ %i[ -+ WNOHANG -+ WUNTRACED -+ PRIO_PROCESS -+ PRIO_PGRP -+ PRIO_USER -+ RLIM_INFINITY -+ RLIMIT_CPU -+ RLIMIT_FSIZE -+ RLIMIT_DATA -+ RLIMIT_STACK -+ RLIMIT_CORE -+ RLIMIT_RSS -+ RLIMIT_MEMLOCK -+ RLIMIT_NPROC -+ RLIMIT_NOFILE -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - - platform_is :darwin do -- it "has the correct constant values on Darwin" do -- Process::RLIM_SAVED_MAX.should == 9223372036854775807 -- Process::RLIM_SAVED_CUR.should == 9223372036854775807 -- Process::RLIMIT_AS.should == 5 -+ it "are all present on Darwin" do -+ %i[ -+ RLIM_SAVED_MAX -+ RLIM_SAVED_CUR -+ RLIMIT_AS -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - - platform_is :linux do -- it "has the correct constant values on Linux" do -- Process::WNOHANG.should == 1 -- Process::WUNTRACED.should == 2 -- Process::PRIO_PROCESS.should == 0 -- Process::PRIO_PGRP.should == 1 -- Process::PRIO_USER.should == 2 -- Process::RLIMIT_CPU.should == 0 -- Process::RLIMIT_FSIZE.should == 1 -- Process::RLIMIT_DATA.should == 2 -- Process::RLIMIT_STACK.should == 3 -- Process::RLIMIT_CORE.should == 4 -- Process::RLIMIT_RSS.should == 5 -- Process::RLIMIT_NPROC.should == 6 -- Process::RLIMIT_NOFILE.should == 7 -- Process::RLIMIT_MEMLOCK.should == 8 -- Process::RLIMIT_AS.should == 9 -- -- # These values appear to change according to the platform. -- values = [4294967295, 9223372036854775807, 18446744073709551615] -- values.include?(Process::RLIM_INFINITY).should be_true -- values.include?(Process::RLIM_SAVED_MAX).should be_true -- values.include?(Process::RLIM_SAVED_CUR).should be_true -+ it "are all present on Linux" do -+ %i[ -+ WNOHANG -+ WUNTRACED -+ PRIO_PROCESS -+ PRIO_PGRP -+ PRIO_USER -+ RLIMIT_CPU -+ RLIMIT_FSIZE -+ RLIMIT_DATA -+ RLIMIT_STACK -+ RLIMIT_CORE -+ RLIMIT_RSS -+ RLIMIT_NPROC -+ RLIMIT_NOFILE -+ RLIMIT_MEMLOCK -+ RLIMIT_AS -+ RLIM_INFINITY -+ RLIM_SAVED_MAX -+ RLIM_SAVED_CUR -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - - platform_is :netbsd, :freebsd do -- it "has the correct constant values on NetBSD and FreeBSD" do -- Process::RLIMIT_SBSIZE.should == 9 # FIXME: what's it equal? -- Process::RLIMIT_AS.should == 10 -+ it "are all present on NetBSD and FreeBSD" do -+ %i[ -+ RLIMIT_SBSIZE -+ RLIMIT_AS -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - - platform_is :freebsd do -- it "has the correct constant values on FreeBSD" do -- Process::RLIMIT_NPTS.should == 11 -+ it "are all present on FreeBSD" do -+ %i[ -+ RLIMIT_NPTS -+ ].each do |const| -+ Process.const_defined?(const).should be_true -+ Process.const_get(const).should be_an_instance_of(Integer) -+ end - end - end - diff --git a/dev-lang/ruby/files/3.3/015-strscan-update-extconf.rb.patch b/dev-lang/ruby/files/3.3/015-strscan-update-extconf.rb.patch deleted file mode 100644 index ebf2791f540b..000000000000 --- a/dev-lang/ruby/files/3.3/015-strscan-update-extconf.rb.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4585ccd90f4251f4d42bfc338a5e14100236fa15 Mon Sep 17 00:00:00 2001 -From: Nobuyoshi Nakada <nobu@ruby-lang.org> -Date: Thu, 12 Jun 2025 10:32:49 +0900 -Subject: [PATCH] [ruby/strscan] Update extconf.rb - (https://github.com/ruby/strscan/pull/158) - -- `have_func` includes "ruby.h" by default. -- include "ruby/re.h" where `rb_reg_onig_match` is declared. - -https://github.com/ruby/strscan/commit/1ac96f47e9 - -diff --git a/ext/strscan/extconf.rb b/ext/strscan/extconf.rb -index bd65606a4e..abcbdb3ad2 100644 ---- a/ext/strscan/extconf.rb -+++ b/ext/strscan/extconf.rb -@@ -2,8 +2,8 @@ - require 'mkmf' - if RUBY_ENGINE == 'ruby' - $INCFLAGS << " -I$(top_srcdir)" if $extmk -- have_func("onig_region_memsize", "ruby.h") -- have_func("rb_reg_onig_match", "ruby.h") -+ have_func("onig_region_memsize") -+ have_func("rb_reg_onig_match", "ruby/re.h") - create_makefile 'strscan' - else - File.write('Makefile', dummy_makefile("").join) --- -2.45.2 - diff --git a/dev-lang/ruby/files/3.3/016-io-console-add-header-ruby-io.h.patch b/dev-lang/ruby/files/3.3/016-io-console-add-header-ruby-io.h.patch deleted file mode 100644 index 11cc02934441..000000000000 --- a/dev-lang/ruby/files/3.3/016-io-console-add-header-ruby-io.h.patch +++ /dev/null @@ -1,58 +0,0 @@ -had been fixed by upstream in commit - -https://github.com/ruby/io-console/commit/dd013030dd276a7372df34cf43ada1c14d0cbc21 - -This patch is a cherry picked version. - -From 3226f1e3cc4787d4a00e639ff763a8b4cfcd5cdd Mon Sep 17 00:00:00 2001 -From: "Z. Liu" <zhixu.liu@gmail.com> -Date: Sun, 29 Jun 2025 21:41:42 +0800 -Subject: [PATCH 1/2] [ruby/io-console]: add header "ruby/io.h" for rb_io_* -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -otherwise, when compiling using gcc 15 with "-flto --Werror=lto-type-mismatch", ext/io/console/extconf.h will have: - -> #define HAVE_RB_IO_PATH 1 -> #define HAVE_RB_IO_DESCRIPTOR 1 -> #define HAVE_RB_IO_GET_WRITE_IO 1 -> #define HAVE_RB_IO_CLOSED_P 1 -> #define HAVE_RB_IO_OPEN_DESCRIPTOR 1 - -the build is failed with: - -> console.c:1417:1: error: static declaration of ‘rb_io_closed_p’ follows non-static declaration -> 1417 | rb_io_closed_p(VALUE io) -> | ^~~~~~~~~~~~~~ -> ../../.././include/ruby/io.h:385:7: note: previous declaration of ‘rb_io_closed_p’ with type ‘VALUE(VALUE)’ {aka ‘long unsigned int(long unsigned int)’} -> 385 | VALUE rb_io_closed_p(VALUE io); -> | ^~~~~~~~~~~~~~ - -Signed-off-by: Z. Liu <zhixu.liu@gmail.com> - -diff --git a/ext/io/console/extconf.rb b/ext/io/console/extconf.rb -index 4ad7ed6996..dd3d221ae5 100644 ---- a/ext/io/console/extconf.rb -+++ b/ext/io/console/extconf.rb -@@ -6,11 +6,11 @@ - rescue - end - --have_func("rb_io_path") --have_func("rb_io_descriptor") --have_func("rb_io_get_write_io") --have_func("rb_io_closed_p") --have_func("rb_io_open_descriptor") -+have_func("rb_io_path", "ruby/io.h") -+have_func("rb_io_descriptor", "ruby/io.h") -+have_func("rb_io_get_write_io", "ruby/io.h") -+have_func("rb_io_closed_p", "ruby/io.h") -+have_func("rb_io_open_descriptor", "ruby/io.h") - - ok = true if RUBY_ENGINE == "ruby" || RUBY_ENGINE == "truffleruby" - hdr = nil --- -2.45.2 - diff --git a/dev-lang/ruby/files/3.3/017-socket-add-full-prototype.patch b/dev-lang/ruby/files/3.3/017-socket-add-full-prototype.patch deleted file mode 100644 index a61a2d5aa0fb..000000000000 --- a/dev-lang/ruby/files/3.3/017-socket-add-full-prototype.patch +++ /dev/null @@ -1,48 +0,0 @@ -https://github.com/ruby/ruby/commit/d77e02bd85ab7f841df8d473bac214b9a92a3506 - -From d77e02bd85ab7f841df8d473bac214b9a92a3506 Mon Sep 17 00:00:00 2001 -From: "Z. Liu" <zhixu.liu@gmail.com> -Date: Wed, 2 Jul 2025 09:09:52 +0800 -Subject: [PATCH] [Bug #21497] [ruby/socket]: add full prototype -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -otherwise, gcc 15 will complain: - -> init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 -> 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); -> | ^~~~~~~~ ~~~~~~~ -> In file included from init.c:11: -> rubysocket.h:294:5: note: declared here -> 294 | int Rconnect(); -> | ^~~~~~~~ - -> sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 -> 33 | SOCKSinit("ruby"); -> | ^~~~~~~~~ ~~~~~~ -> In file included from sockssocket.c:11: -> rubysocket.h:293:6: note: declared here -> 293 | void SOCKSinit(); -> | ^~~~~~~~~ - -Signed-off-by: Z. Liu <zhixu.liu@gmail.com> - -diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h -index 54a5381da4..dcafbe24e3 100644 ---- a/ext/socket/rubysocket.h -+++ b/ext/socket/rubysocket.h -@@ -292,8 +292,8 @@ extern VALUE rb_eResolution; - #ifdef SOCKS - extern VALUE rb_cSOCKSSocket; - # ifndef SOCKS5 --void SOCKSinit(); --int Rconnect(); -+void SOCKSinit(char *); -+int Rconnect(int, const struct sockaddr *, socklen_t); - # endif - #endif - --- -2.49.1 - diff --git a/dev-lang/ruby/files/3.4/015-strscan-update-extconf.rb.patch b/dev-lang/ruby/files/3.4/015-strscan-update-extconf.rb.patch deleted file mode 100644 index ebf2791f540b..000000000000 --- a/dev-lang/ruby/files/3.4/015-strscan-update-extconf.rb.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4585ccd90f4251f4d42bfc338a5e14100236fa15 Mon Sep 17 00:00:00 2001 -From: Nobuyoshi Nakada <nobu@ruby-lang.org> -Date: Thu, 12 Jun 2025 10:32:49 +0900 -Subject: [PATCH] [ruby/strscan] Update extconf.rb - (https://github.com/ruby/strscan/pull/158) - -- `have_func` includes "ruby.h" by default. -- include "ruby/re.h" where `rb_reg_onig_match` is declared. - -https://github.com/ruby/strscan/commit/1ac96f47e9 - -diff --git a/ext/strscan/extconf.rb b/ext/strscan/extconf.rb -index bd65606a4e..abcbdb3ad2 100644 ---- a/ext/strscan/extconf.rb -+++ b/ext/strscan/extconf.rb -@@ -2,8 +2,8 @@ - require 'mkmf' - if RUBY_ENGINE == 'ruby' - $INCFLAGS << " -I$(top_srcdir)" if $extmk -- have_func("onig_region_memsize", "ruby.h") -- have_func("rb_reg_onig_match", "ruby.h") -+ have_func("onig_region_memsize") -+ have_func("rb_reg_onig_match", "ruby/re.h") - create_makefile 'strscan' - else - File.write('Makefile', dummy_makefile("").join) --- -2.45.2 - diff --git a/dev-lang/ruby/files/3.4/016-io-console-add-header-ruby-io.h.patch b/dev-lang/ruby/files/3.4/016-io-console-add-header-ruby-io.h.patch deleted file mode 100644 index 2dd2846fd161..000000000000 --- a/dev-lang/ruby/files/3.4/016-io-console-add-header-ruby-io.h.patch +++ /dev/null @@ -1,58 +0,0 @@ -had been fixed by upstream in commit - -https://github.com/ruby/io-console/commit/dd013030dd276a7372df34cf43ada1c14d0cbc21 - -This patch is a cherry picked version. - -From 3226f1e3cc4787d4a00e639ff763a8b4cfcd5cdd Mon Sep 17 00:00:00 2001 -From: "Z. Liu" <zhixu.liu@gmail.com> -Date: Sun, 29 Jun 2025 21:41:42 +0800 -Subject: [PATCH 1/2] [ruby/io-console]: add header "ruby/io.h" for rb_io_* -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -otherwise, when compiling using gcc 15 with "-flto --Werror=lto-type-mismatch", ext/io/console/extconf.h will have: - -> #define HAVE_RB_IO_PATH 1 -> #define HAVE_RB_IO_DESCRIPTOR 1 -> #define HAVE_RB_IO_GET_WRITE_IO 1 -> #define HAVE_RB_IO_CLOSED_P 1 -> #define HAVE_RB_IO_OPEN_DESCRIPTOR 1 - -the build is failed with: - -> console.c:1417:1: error: static declaration of ‘rb_io_closed_p’ follows non-static declaration -> 1417 | rb_io_closed_p(VALUE io) -> | ^~~~~~~~~~~~~~ -> ../../.././include/ruby/io.h:385:7: note: previous declaration of ‘rb_io_closed_p’ with type ‘VALUE(VALUE)’ {aka ‘long unsigned int(long unsigned int)’} -> 385 | VALUE rb_io_closed_p(VALUE io); -> | ^~~~~~~~~~~~~~ - -Signed-off-by: Z. Liu <zhixu.liu@gmail.com> - -diff --git a/ext/io/console/extconf.rb b/ext/io/console/extconf.rb -index 4ad7ed6996..dd3d221ae5 100644 ---- a/ext/io/console/extconf.rb -+++ b/ext/io/console/extconf.rb -@@ -10,11 +10,11 @@ - abort - - have_func("rb_interned_str_cstr") --have_func("rb_io_path") --have_func("rb_io_descriptor") --have_func("rb_io_get_write_io") --have_func("rb_io_closed_p") --have_func("rb_io_open_descriptor") -+have_func("rb_io_path", "ruby/io.h") -+have_func("rb_io_descriptor", "ruby/io.h") -+have_func("rb_io_get_write_io", "ruby/io.h") -+have_func("rb_io_closed_p", "ruby/io.h") -+have_func("rb_io_open_descriptor", "ruby/io.h") - have_func("rb_ractor_local_storage_value_newkey") - - is_wasi = /wasi/ =~ MakeMakefile::RbConfig::CONFIG["platform"] --- -2.45.2 - diff --git a/dev-lang/ruby/files/3.4/017-socket-add-full-prototype.patch b/dev-lang/ruby/files/3.4/017-socket-add-full-prototype.patch deleted file mode 100644 index a61a2d5aa0fb..000000000000 --- a/dev-lang/ruby/files/3.4/017-socket-add-full-prototype.patch +++ /dev/null @@ -1,48 +0,0 @@ -https://github.com/ruby/ruby/commit/d77e02bd85ab7f841df8d473bac214b9a92a3506 - -From d77e02bd85ab7f841df8d473bac214b9a92a3506 Mon Sep 17 00:00:00 2001 -From: "Z. Liu" <zhixu.liu@gmail.com> -Date: Wed, 2 Jul 2025 09:09:52 +0800 -Subject: [PATCH] [Bug #21497] [ruby/socket]: add full prototype -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -otherwise, gcc 15 will complain: - -> init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 -> 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); -> | ^~~~~~~~ ~~~~~~~ -> In file included from init.c:11: -> rubysocket.h:294:5: note: declared here -> 294 | int Rconnect(); -> | ^~~~~~~~ - -> sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 -> 33 | SOCKSinit("ruby"); -> | ^~~~~~~~~ ~~~~~~ -> In file included from sockssocket.c:11: -> rubysocket.h:293:6: note: declared here -> 293 | void SOCKSinit(); -> | ^~~~~~~~~ - -Signed-off-by: Z. Liu <zhixu.liu@gmail.com> - -diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h -index 54a5381da4..dcafbe24e3 100644 ---- a/ext/socket/rubysocket.h -+++ b/ext/socket/rubysocket.h -@@ -292,8 +292,8 @@ extern VALUE rb_eResolution; - #ifdef SOCKS - extern VALUE rb_cSOCKSSocket; - # ifndef SOCKS5 --void SOCKSinit(); --int Rconnect(); -+void SOCKSinit(char *); -+int Rconnect(int, const struct sockaddr *, socklen_t); - # endif - #endif - --- -2.49.1 - diff --git a/dev-lang/ruby/files/4.0/901-musl-stacksize.patch b/dev-lang/ruby/files/4.0/901-musl-stacksize.patch index ab9308d0e7b6..f18aa271ea65 100644 --- a/dev-lang/ruby/files/4.0/901-musl-stacksize.patch +++ b/dev-lang/ruby/files/4.0/901-musl-stacksize.patch @@ -1,31 +1,20 @@ -https://github.com/ruby/ruby/pull/10633 - -From 605f55ebd7e94d56c3ef86635b413f30cfc33b46 Mon Sep 17 00:00:00 2001 -From: Nobuyoshi Nakada <nobu@ruby-lang.org> -Date: Thu, 25 Apr 2024 21:00:37 +0900 -Subject: [PATCH] [Bug #20452] Take main thread address/size with rlimit if - musl libc - -Musl libc defines `pthread_getattr_np` but it can not get the correct -value of the main thread. ---- - thread_pthread.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/thread_pthread.c b/thread_pthread.c -index 493350b52055af..9199edc3543e59 100644 ---- a/thread_pthread.c -+++ b/thread_pthread.c -@@ -1791,6 +1791,11 @@ native_thread_destroy(struct rb_native_thread *nt) +--- a/thread_pthread.c 2023-02-08 05:02:20.000000000 +0100 ++++ b/thread_pthread.c 2023-03-10 17:46:25.694739053 +0100 +@@ -1033,7 +1033,7 @@ + { + native_main_thread.id = pthread_self(); - #if defined HAVE_PTHREAD_GETATTR_NP || defined HAVE_PTHREAD_ATTR_GET_NP - #define STACKADDR_AVAILABLE 1 -+# if defined(__linux__) && !defined __GLIBC__ -+ /* Musl libc defines `pthread_getattr_np` but it can not get the -+ * correct value of the main thread. */ -+# define MAINSTACKADDR_AVAILABLE 0 -+# endif - #elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP - #define STACKADDR_AVAILABLE 1 - #undef MAINSTACKADDR_AVAILABLE - +-#if MAINSTACKADDR_AVAILABLE ++#if MAINSTACKADDR_AVAILABLE && !(defined(__linux__) && !defined(__GLIBC__)) + if (native_main_thread.stack_maxsize) return; + { + void* stackaddr; +@@ -2090,7 +2090,7 @@ + + #ifdef STACKADDR_AVAILABLE + if (get_stack(&base, &size) == 0) { +-# ifdef __APPLE__ ++# if defined(__APPLE__) || (defined(__linux__) && !defined(__GLIBC__)) + if (pthread_equal(th->nt->thread_id, native_main_thread.id)) { + struct rlimit rlim; + if (getrlimit(RLIMIT_STACK, &rlim) == 0 && rlim.rlim_cur > size) { diff --git a/dev-lang/ruby/metadata.xml b/dev-lang/ruby/metadata.xml index 0fa5db0d774a..a983a824bf80 100644 --- a/dev-lang/ruby/metadata.xml +++ b/dev-lang/ruby/metadata.xml @@ -2,11 +2,20 @@ <!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="project"> + <email>dev@liguros.net</email> + <name>Development</name> + </maintainer> + <maintainer type="project"> <email>ruby@gentoo.org</email> <name>Gentoo Ruby Project</name> </maintainer> + <upstream> + <remote-id type="cpe">cpe:/a:ruby-lang:ruby</remote-id> + </upstream> <use> - <flag name="systemtap">Enable SystemTap/DTrace tracing</flag> + <flag name="rubytests">Install ruby tests that can only be run after ruby is installed</flag> + <flag name="rdoc">Install <pkg>dev-ruby/rdoc</pkg> after installing Ruby.</flag> + <flag name="systemtap">Enable SystemTAP/DTrace tracing</flag> </use> <origin>baldeagleos-repo</origin> </pkgmetadata> diff --git a/dev-lang/ruby/ruby-3.2.11.ebuild b/dev-lang/ruby/ruby-3.2.11.ebuild deleted file mode 100644 index f7c220cf954a..000000000000 --- a/dev-lang/ruby/ruby-3.2.11.ebuild +++ /dev/null @@ -1,315 +0,0 @@ -# Copyright 1999-2026 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 ~arm64-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= - virtual/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.4.4[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}"/017*.patch - eapply "${FILESDIR}"/"${SLOT}"/021*.patch - eapply "${FILESDIR}"/"${SLOT}"/902*.patch - - if use elibc_musl ; then - eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch - fi - - einfo "Unbundling gems..." - cd "${S}" || die - # 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/rubygems/test_bundled_ca.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 - - # Doesn't play well with PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY - rm -f spec/ruby/core/process/setpriority_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 and user names - # that most likely are not available - sed -e '/def blockdev/a@blockdev = nil' \ - -e '/test_expand_path_for_existent_username/aomit "Checks USER"' \ - -i 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 -e '/test_gem_exec_gem_uninstall/aomit "Fails intermittently"' \ - -i test/rubygems/test_gem_commands_exec_command.rb || die - - # Avoid test that can easily timeout - sed -e '/test_getch_timeout/aomit "Times out easily"' \ - -i test/io/console/test_io_console.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" - - # 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 - [[ ${CHOST} == *-darwin* ]] || export LIBPATHENV="" - - local myeconfargs=( - --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 for bug #949016 - --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) - $(use_with valgrind) - --enable-option-checking=no - ) - - # Fix co-routine selection for x32, bug 933070 - [[ ${CHOST} == *gnux32 ]] && myeconfargs+=( --with-coroutine=amd64 ) - - INSTALL="${EPREFIX}/usr/bin/install -c" econf "${myeconfargs[@]}" - - # 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 USER=$(whoami) - 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.11.ebuild b/dev-lang/ruby/ruby-3.3.11.ebuild index f5f5ba1d757f..574dae6f4786 100644 --- a/dev-lang/ruby/ruby-3.3.11.ebuild +++ b/dev-lang/ruby/ruby-3.3.11.ebuild @@ -1,6 +1,5 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2021-2026 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 RUST_OPTIONAL="yes" @@ -8,19 +7,19 @@ 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 ~arm64-macos ~x64-macos ~x64-solaris" -IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs" +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:= ) @@ -29,6 +28,7 @@ RDEPEND=" jit? ( ${RUST_DEPEND} ) ssl? ( dev-libs/openssl:0= + ) socks5? ( >=net-proxy/dante-1.1.13 ) systemtap? ( dev-debug/systemtap ) @@ -38,7 +38,7 @@ RDEPEND=" ) dev-libs/libyaml dev-libs/libffi:= - virtual/zlib:= + sys-libs/zlib virtual/libcrypt:= >=app-eselect/eselect-ruby-20231226 " @@ -49,21 +49,21 @@ DEPEND=" " BUNDLED_GEMS=" - >=dev-ruby/debug-1.9.2[ruby_targets_ruby33(-)] + >=dev-ruby/debug-1.9.1[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.21[ruby_targets_ruby33(-)] + >=dev-ruby/net-ftp-0.3.3[ruby_targets_ruby33(-)] + >=dev-ruby/net-imap-0.4.9[ruby_targets_ruby33(-)] >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby33(-)] - >=dev-ruby/net-smtp-0.5.1[ruby_targets_ruby33(-)] + >=dev-ruby/net-smtp-0.4.0[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.4.4[ruby_targets_ruby33(-)] - >=dev-ruby/rss-0.3.1[ruby_targets_ruby33(-)] + >=dev-ruby/rexml-3.2.6[ruby_targets_ruby33(-)] + >=dev-ruby/rss-0.3.0[ruby_targets_ruby33(-)] >=dev-ruby/test-unit-3.6.1[ruby_targets_ruby33(-)] >=dev-ruby/typeprof-0.21.9[ruby_targets_ruby33(-)] " @@ -71,9 +71,9 @@ BUNDLED_GEMS=" PDEPEND=" ${BUNDLED_GEMS} virtual/rubygems[ruby_targets_ruby33(-)] - >=dev-ruby/bundler-2.5.11[ruby_targets_ruby33(-)] + >=dev-ruby/bundler-2.5.3[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/json-2.7.1[ruby_targets_ruby33(-)] >=dev-ruby/rdoc-6.6.2[ruby_targets_ruby33(-)] xemacs? ( app-xemacs/ruby-modes ) " @@ -84,7 +84,6 @@ pkg_setup() { src_prepare() { eapply "${FILESDIR}"/"${SLOT}"/010*.patch - eapply "${FILESDIR}"/"${SLOT}"/013*.patch eapply "${FILESDIR}"/"${SLOT}"/902*.patch if use elibc_musl ; then @@ -92,7 +91,7 @@ src_prepare() { fi einfo "Unbundling gems..." - cd "${S}" || die + cd "$S" # Remove bundled gems that we will install via PDEPEND, bug # 539700. rm -fr gems/* || die @@ -104,13 +103,9 @@ src_prepare() { # 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/rubygems/test_bundled_ca.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 - # Doesn't play well with PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY - rm -f spec/ruby/core/process/setpriority_spec.rb || die - # Remove webrick tests because setting LD_LIBRARY_PATH does not work for them. rm -rf tool/test/webrick || die @@ -121,20 +116,29 @@ src_prepare() { 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,specific_file}.rb || die + 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 if use prefix ; then # Fix hardcoded SHELL var in mkmf library sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die + + if [[ ${CHOST} == *darwin* ]] ; then + # avoid symlink loop on Darwin (?!) + sed -i \ + -e '/LIBRUBY_ALIASES=/s/lib$(RUBY_INSTALL_NAME).$(SOEXT)//' \ + configure.ac || die + + # make ar/libtool hack for Darwin work + sed -i \ + -e "s/ac_cv_prog_ac_ct_AR='libtool/ac_cv_prog_AR='${CHOST}-libtool/" \ + configure.ac || die + + # disable using security framework (GCC barfs on those headers) + sed -i \ + -e 's/MAC_OS_X_VERSION_MIN_REQUIRED/_DISABLED_/' \ + random.c || die + fi fi eapply_user @@ -143,7 +147,7 @@ src_prepare() { } src_configure() { - local modules="win32,win32ole" + 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 @@ -154,22 +158,12 @@ src_configure() { 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 @@ -179,10 +173,13 @@ src_configure() { fi # Increase GC_MALLOC_LIMIT if set (default is 8000000) - if [[ -n "${RUBY_GC_MALLOC_LIMIT}" ]] ; then + 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" @@ -200,53 +197,42 @@ src_configure() { # 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 - [[ ${CHOST} == *-darwin* ]] || export LIBPATHENV="" - - local myeconfargs=( - --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 for bug #949016 - --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) - $(use_with valgrind) + INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \ + --program-suffix=${MY_SUFFIX} \ + --with-soname=ruby${MY_SUFFIX} \ + --enable-shared \ + --enable-pthread \ + --disable-rpath \ + --without-baseruby \ + --with-compress-debug-sections=no \ + --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) \ + --enable-ipv6 \ + $(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 - ) - - # Fix co-routine selection for x32, bug 933070 - [[ ${CHOST} == *gnux32 ]] && myeconfargs+=( --with-coroutine=amd64 ) - - INSTALL="${EPREFIX}/usr/bin/install -c" econf "${myeconfargs[@]}" # Makefile is broken because it lacks -ldl rm -rf ext/-test-/popen_deadlock || die } src_compile() { - local -x USER=$(whoami) - local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + export LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${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}" + export LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" emake V=1 check } @@ -262,12 +248,18 @@ src_install() { 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}" + LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + + if [[ ${CHOST} == *darwin* ]] ; then + DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + export DYLD_LIBRARY_PATH + fi - local -x RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" + RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" for d in $(find "${S}/ext" -type d) ; do RUBYLIB="${RUBYLIB}:$d" done + export LD_LIBRARY_PATH RUBYLIB # Create directory for the default gems local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}" diff --git a/dev-lang/ruby/ruby-3.3.9999.ebuild b/dev-lang/ruby/ruby-3.3.9999.ebuild deleted file mode 100644 index ca861cb66724..000000000000 --- a/dev-lang/ruby/ruby-3.3.9999.ebuild +++ /dev/null @@ -1,333 +0,0 @@ -# Copyright 1999-2026 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)" -MY_PV="${PV%.*}" -MY_SLOT=$(ver_cut 1-2) - -DESCRIPTION="An object-oriented scripting language" -HOMEPAGE="https://www.ruby-lang.org/" -if [[ ${PV} == *9999* ]]; then - inherit git-r3 - EGIT_BRANCH="ruby_${MY_PV/./_}" - EGIT_REPO_URI="https://github.com/ruby/ruby.git" - - # Self-depend is necessary because ruby from git depends on building some pre-requisite gems. - BDEPEND=" - dev-lang/ruby:${MY_SLOT} - " -else - SRC_URI="https://cache.ruby-lang.org/pub/ruby/$(ver_cut 1-2)/${MY_P}.tar.xz" - S=${WORKDIR}/${MY_P} - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris" -fi - -LICENSE="|| ( Ruby-BSD BSD-2 )" -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" - -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:= - virtual/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.21[ruby_targets_ruby33(-)] - >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby33(-)] - >=dev-ruby/net-smtp-0.5.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.4.4[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}" || die - # 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/rubygems/test_bundled_ca.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 - - # Doesn't play well with PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY - rm -f spec/ruby/core/process/setpriority_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,specific_file}.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 - - # Have ruby --version print out ${PV} - if [[ ${PV} == *9999* ]]; then - sed -i "s/#define RUBY_VERSION_TEENY.*/#define RUBY_VERSION_TEENY 9999/" version.h || die - - cp "${BROOT}"/usr/share/gnuconfig/config.guess "${S}"/tool/config.guess || die - cp "${BROOT}"/usr/share/gnuconfig/config.sub "${S}"/tool/config.sub || die - fi - - eapply_user - - eautoreconf -} - -src_configure() { - local modules="win32,win32ole" - - # 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 - [[ ${CHOST} == *-darwin* ]] || export LIBPATHENV="" - - local myeconfargs=( - --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 for bug #949016 - --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) - $(use_with valgrind) - --enable-option-checking=no - ) - - # Fix co-routine selection for x32, bug 933070 - [[ ${CHOST} == *gnux32 ]] && myeconfargs+=( --with-coroutine=amd64 ) - - # Live ebuilds require a Ruby version to build with. - [[ ${PV} == *9999* ]] && myeconfargs+=( --with-baseruby="${BROOT}"/usr/bin/ruby$(ver_rs 1 "" "${MY_PV}") ) - - INSTALL="${EPREFIX}/usr/bin/install -c" econf "${myeconfargs[@]}" - - # Makefile is broken because it lacks -ldl - rm -rf ext/-test-/popen_deadlock || die -} - -src_compile() { - local -x USER=$(whoami) - 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}" - local d - 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 - - [[ ${PV} != *9999* ]] && dodoc ChangeLog - dodoc 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.2.10.ebuild b/dev-lang/ruby/ruby-3.4.9.1.ebuild index dda1b58f7458..55922adab219 100644 --- a/dev-lang/ruby/ruby-3.2.10.ebuild +++ b/dev-lang/ruby/ruby-3.4.9.1.ebuild @@ -1,26 +1,25 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2021-2026 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 RUST_OPTIONAL="yes" -inherit autotools flag-o-matic multiprocessing toolchain-funcs rust +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 ~arm64-macos ~x64-macos ~x64-solaris" -IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs" +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:= ) @@ -29,6 +28,7 @@ RDEPEND=" jit? ( ${RUST_DEPEND} ) ssl? ( dev-libs/openssl:0= + ) socks5? ( >=net-proxy/dante-1.1.13 ) systemtap? ( dev-debug/systemtap ) @@ -38,10 +38,9 @@ RDEPEND=" ) dev-libs/libyaml dev-libs/libffi:= - sys-libs/readline:0= - virtual/zlib:= + sys-libs/zlib virtual/libcrypt:= - >=app-eselect/eselect-ruby-20231008 + >=app-eselect/eselect-ruby-20231226 " DEPEND=" @@ -50,31 +49,32 @@ DEPEND=" " 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.4.4[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(-)] + >=dev-ruby/debug-1.9.1[ruby_targets_ruby34(-)] + >=dev-ruby/irb-1.11.0[ruby_targets_ruby34(-)] + >=dev-ruby/matrix-0.4.2[ruby_targets_ruby34(-)] + >=dev-ruby/minitest-5.20.0[ruby_targets_ruby34(-)] + >=dev-ruby/net-ftp-0.3.3[ruby_targets_ruby34(-)] + >=dev-ruby/net-imap-0.4.9[ruby_targets_ruby34(-)] + >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby34(-)] + >=dev-ruby/net-smtp-0.4.0[ruby_targets_ruby34(-)] + >=dev-ruby/power_assert-2.0.3[ruby_targets_ruby34(-)] + >=dev-ruby/prime-0.1.2[ruby_targets_ruby34(-)] + >=dev-ruby/racc-1.7.3[ruby_targets_ruby34(-)] + >=dev-ruby/rake-13.1.0[ruby_targets_ruby34(-)] + >=dev-ruby/rbs-3.4.0[ruby_targets_ruby34(-)] + >=dev-ruby/rexml-3.2.6[ruby_targets_ruby34(-)] + >=dev-ruby/rss-0.3.0[ruby_targets_ruby34(-)] + >=dev-ruby/test-unit-3.6.1[ruby_targets_ruby34(-)] + >=dev-ruby/typeprof-0.21.9[ruby_targets_ruby34(-)] " 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(-)] + virtual/rubygems[ruby_targets_ruby34(-)] + >=dev-ruby/bundler-2.5.3[ruby_targets_ruby34(-)] + >=dev-ruby/did_you_mean-1.6.3[ruby_targets_ruby34(-)] + >=dev-ruby/json-2.7.1[ruby_targets_ruby34(-)] + >=dev-ruby/rdoc-6.6.2[ruby_targets_ruby34(-)] xemacs? ( app-xemacs/ruby-modes ) " @@ -84,9 +84,6 @@ pkg_setup() { src_prepare() { eapply "${FILESDIR}"/"${SLOT}"/010*.patch - eapply "${FILESDIR}"/"${SLOT}"/011*.patch - eapply "${FILESDIR}"/"${SLOT}"/013*.patch - eapply "${FILESDIR}"/"${SLOT}"/017*.patch eapply "${FILESDIR}"/"${SLOT}"/902*.patch if use elibc_musl ; then @@ -99,15 +96,15 @@ src_prepare() { # 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 + + # 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/rubygems/test_bundled_ca.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 + 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 @@ -115,27 +112,33 @@ src_prepare() { # 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 and user names - # that most likely are not available - sed -e '/def blockdev/a@blockdev = nil' \ - -e '/test_expand_path_for_existent_username/aomit "Checks USER"' \ - -i test/ruby/test_file_exhaustive.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 -e '/test_gem_exec_gem_uninstall/aomit "Fails intermittently"' \ - -i test/rubygems/test_gem_commands_exec_command.rb || die - - # Avoid test that can easily timeout - sed -e '/test_getch_timeout/aomit "Times out easily"' \ - -i test/io/console/test_io_console.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 + + if [[ ${CHOST} == *darwin* ]] ; then + # avoid symlink loop on Darwin (?!) + sed -i \ + -e '/LIBRUBY_ALIASES=/s/lib$(RUBY_INSTALL_NAME).$(SOEXT)//' \ + configure.ac || die + + # make ar/libtool hack for Darwin work + sed -i \ + -e "s/ac_cv_prog_ac_ct_AR='libtool/ac_cv_prog_AR='${CHOST}-libtool/" \ + configure.ac || die + + # disable using security framework (GCC barfs on those headers) + sed -i \ + -e 's/MAC_OS_X_VERSION_MIN_REQUIRED/_DISABLED_/' \ + random.c || die + fi fi eapply_user @@ -155,23 +158,11 @@ src_configure() { 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 #965095 (gcc PR122610) - tc-is-gcc && append-flags -fno-ipa-modref - - # 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 @@ -186,6 +177,9 @@ src_configure() { 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" @@ -203,21 +197,14 @@ src_configure() { # 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 \ + INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" 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) \ @@ -226,6 +213,7 @@ src_configure() { $(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) \ @@ -239,13 +227,12 @@ src_configure() { } src_compile() { - local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + export LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS="" } src_test() { - local -x USER=$(whoami) - local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + export LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" emake V=1 check } @@ -261,12 +248,18 @@ src_install() { 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}" + LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + + if [[ ${CHOST} == *darwin* ]] ; then + DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + export DYLD_LIBRARY_PATH + fi - local -x RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" + RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" for d in $(find "${S}/ext" -type d) ; do RUBYLIB="${RUBYLIB}:$d" done + export LD_LIBRARY_PATH RUBYLIB # Create directory for the default gems local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}" diff --git a/dev-lang/ruby/ruby-3.4.9999.ebuild b/dev-lang/ruby/ruby-3.4.9999.ebuild deleted file mode 100644 index 838d18c92feb..000000000000 --- a/dev-lang/ruby/ruby-3.4.9999.ebuild +++ /dev/null @@ -1,347 +0,0 @@ -# Copyright 1999-2026 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)" -MY_PV="${PV%.*}" -MY_SLOT=$(ver_cut 1-2) - -DESCRIPTION="An object-oriented scripting language" -HOMEPAGE="https://www.ruby-lang.org/" -if [[ ${PV} == *9999* ]]; then - inherit git-r3 - EGIT_BRANCH="ruby_${MY_PV/./_}" - EGIT_REPO_URI="https://github.com/ruby/ruby.git" - - # Self-depend is necessary because ruby from git depends on building some pre-requisite gems. - BDEPEND=" - dev-lang/ruby:${MY_SLOT} - " -else - SRC_URI="https://cache.ruby-lang.org/pub/ruby/$(ver_cut 1-2)/${MY_P}.tar.xz" - S=${WORKDIR}/${MY_P} - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris" -fi - -LICENSE="|| ( Ruby-BSD BSD-2 )" -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" - -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:= - virtual/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}" || die - # 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/rubygems/test_bundled_ca.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 - - # Doesn't play well with PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY - rm -f spec/ruby/core/process/setpriority_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 - - # Have ruby --version print out ${PV} - if [[ ${PV} == *9999* ]]; then - sed -i "s/#define RUBY_VERSION_TEENY.*/#define RUBY_VERSION_TEENY 9999/" version.h || die - - cp "${BROOT}"/usr/share/gnuconfig/config.guess "${S}"/tool/config.guess || die - cp "${BROOT}"/usr/share/gnuconfig/config.sub "${S}"/tool/config.sub || die - fi - - eapply_user - - eautoreconf -} - -src_configure() { - local modules="win32,win32ole" - - # 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="" - - local myeconfargs=( - --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) - $(use_with valgrind) - --enable-option-checking=no - ) - - # Fix co-routine selection for x32, bug 933070 - [[ ${CHOST} == *gnux32 ]] && myeconfargs+=( --with-coroutine=amd64 ) - - # Live ebuilds require a Ruby version to build with. - [[ ${PV} == *9999* ]] && myeconfargs+=( --with-baseruby="${BROOT}"/usr/bin/ruby$(ver_rs 1 "" "${MY_PV}") ) - - INSTALL="${EPREFIX}/usr/bin/install -c" econf "${myeconfargs[@]}" - - # 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}" - local d - 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 - - [[ ${PV} != *9999* ]] && dodoc ChangeLog - dodoc 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-4.0.3-r1.ebuild b/dev-lang/ruby/ruby-4.0.3-r1.ebuild deleted file mode 100644 index 3adfb863e1d1..000000000000 --- a/dev-lang/ruby/ruby-4.0.3-r1.ebuild +++ /dev/null @@ -1,359 +0,0 @@ -# Copyright 1999-2026 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -RUST_MIN_VER="1.85.0" -RUST_OPTIONAL="yes" - -inherit autotools flag-o-matic multiprocessing rust - -MY_P="${PN}-$(ver_cut 1-3)" -MY_PV="${PV%.*}" -MY_SLOT=$(ver_cut 1-2) - -DESCRIPTION="An object-oriented scripting language" -HOMEPAGE="https://www.ruby-lang.org/" -if [[ ${PV} == *9999* ]]; then - inherit git-r3 - EGIT_BRANCH="ruby_${MY_PV/./_}" - EGIT_REPO_URI="https://github.com/ruby/ruby.git" - - # Self-depend is necessary because ruby from git depends on building some pre-requisite gems. - BDEPEND=" - dev-lang/ruby:${MY_SLOT} - " -else - SRC_URI="https://cache.ruby-lang.org/pub/ruby/$(ver_cut 1-2)/${MY_P}.tar.xz" - S=${WORKDIR}/${MY_P} - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris" -fi - -LICENSE="|| ( Ruby-BSD BSD-2 )" -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" - -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:= - virtual/zlib:= - virtual/libcrypt:= - >=app-eselect/eselect-ruby-20251225 -" - -DEPEND=" - ${RDEPEND} - valgrind? ( dev-debug/valgrind ) -" - -BUNDLED_GEMS=" - >=dev-ruby/minitest-6.0.0[ruby_targets_ruby40(-)] - >=dev-ruby/power_assert-3.0.1[ruby_targets_ruby40(-)] - >=dev-ruby/rake-13.3.1[ruby_targets_ruby40(-)] - >=dev-ruby/test-unit-3.7.5[ruby_targets_ruby40(-)] - >=dev-ruby/rexml-3.4.4[ruby_targets_ruby40(-)] - >=dev-ruby/rss-0.3.2[ruby_targets_ruby40(-)] - >=dev-ruby/net-ftp-0.3.9[ruby_targets_ruby40(-)] - >=dev-ruby/net-imap-0.6.2[ruby_targets_ruby40(-)] - >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/net-smtp-0.5.1[ruby_targets_ruby40(-)] - >=dev-ruby/matrix-0.4.3[ruby_targets_ruby40(-)] - >=dev-ruby/prime-0.1.4[ruby_targets_ruby40(-)] - >=dev-ruby/rbs-3.10.0[ruby_targets_ruby40(-)] - >=dev-ruby/typeprof-0.31.1[ruby_targets_ruby40(-)] - >=dev-ruby/debug-1.11.1[ruby_targets_ruby40(-)] - >=dev-ruby/racc-1.8.1[ruby_targets_ruby40(-)] - - >=dev-ruby/mutex_m-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/getoptlong-0.2.1[ruby_targets_ruby40(-)] - >=dev-ruby/base64-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/bigdecimal-4.0.1[ruby_targets_ruby40(-)] - >=dev-ruby/observer-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/abbrev-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/resolv-replace-0.1.1[ruby_targets_ruby40(-)] - >=dev-ruby/rinda-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/drb-2.2.3[ruby_targets_ruby40(-)] - >=dev-ruby/nkf-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/syslog-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/csv-3.3.5[ruby_targets_ruby40(-)] - >=dev-ruby/repl_type_completor-0.1.12[ruby_targets_ruby40(-)] - >=dev-ruby/ostruct-0.6.3[ruby_targets_ruby40(-)] - >=dev-ruby/pstore-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/benchmark-0.5.0[ruby_targets_ruby40(-)] - >=dev-ruby/logger-1.7.0[ruby_targets_ruby40(-)] - >=dev-ruby/reline-0.6.3[ruby_targets_ruby40(-)] - >=dev-ruby/readline-0.0.4[ruby_targets_ruby40(-)] - >=dev-ruby/fiddle-1.1.8[ruby_targets_ruby40(-)] -" - -PDEPEND=" - ${BUNDLED_GEMS} - virtual/rubygems[ruby_targets_ruby40(-)] - >=dev-ruby/bundler-4.0.3[ruby_targets_ruby40(-)] - >=dev-ruby/did_you_mean-2.0.0[ruby_targets_ruby40(-)] - >=dev-ruby/irb-1.16.0[ruby_targets_ruby40(-)] - >=dev-ruby/json-2.18.0[ruby_targets_ruby40(-)] - >=dev-ruby/rdoc-7.0.2[ruby_targets_ruby40(-)] - 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}" || die - # Remove bundled gems that we will install via PDEPEND, bug - # 539700. - rm -fr gems/* || die - touch gems/bundled_gems || die - - # Doesn't play well with PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY - rm -f spec/ruby/core/process/setpriority_spec.rb || 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/rubygems/test_bundled_ca.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 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 - - # Avoid tests that don't expect our ruby40 executable name. - sed -e '/test_prelude_gems_and_loaded_features/aomit "Does not match ruby40"' \ - -i test/ruby/test_box.rb - - # Have ruby --version print out ${PV} - if [[ ${PV} == *9999* ]]; then - sed -i "s/#define RUBY_VERSION_TEENY.*/#define RUBY_VERSION_TEENY 9999/" version.h || die - - cp "${BROOT}"/usr/share/gnuconfig/config.guess "${S}"/tool/config.guess || die - cp "${BROOT}"/usr/share/gnuconfig/config.sub "${S}"/tool/config.sub || die - fi - - # Avoid specs that require gems to be installed already due to our unbundling. - rm -rf spec/ruby/library/irb || 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" - - # 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 - # Fails to link (gcc PR124865, gcc PR50676) - filter-flags -flto-partition=cache - # bug #972696 - append-cppflags -DRB_THREAD_CURRENT_EC_NOINLINE - - # 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 - [[ ${CHOST} == *-darwin* ]] || export LIBPATHENV="" - - local myeconfargs=( - --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 for bug #949016 - --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 jit zjit) - $(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) - $(use_with valgrind) - --enable-option-checking=no - ) - - # Fix co-routine selection for x32, bug 933070 - [[ ${CHOST} == *gnux32 ]] && myeconfargs+=( --with-coroutine=amd64 ) - - # Live ebuilds require a Ruby version to build with. - [[ ${PV} == *9999* ]] && myeconfargs+=( --with-baseruby="${BROOT}"/usr/bin/ruby$(ver_rs 1 "" "${MY_PV}") ) - - INSTALL="${EPREFIX}/usr/bin/install -c" econf "${myeconfargs[@]}" - - # 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 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-4.0.4.ebuild b/dev-lang/ruby/ruby-4.0.4.ebuild index caa2b9f363a5..190395dbad53 100644 --- a/dev-lang/ruby/ruby-4.0.4.ebuild +++ b/dev-lang/ruby/ruby-4.0.4.ebuild @@ -1,40 +1,25 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2021-2026 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 -RUST_MIN_VER="1.85.0" RUST_OPTIONAL="yes" inherit autotools flag-o-matic multiprocessing rust MY_P="${PN}-$(ver_cut 1-3)" -MY_PV="${PV%.*}" -MY_SLOT=$(ver_cut 1-2) +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/" -if [[ ${PV} == *9999* ]]; then - inherit git-r3 - EGIT_BRANCH="ruby_${MY_PV/./_}" - EGIT_REPO_URI="https://github.com/ruby/ruby.git" - - # Self-depend is necessary because ruby from git depends on building some pre-requisite gems. - BDEPEND=" - dev-lang/ruby:${MY_SLOT} - " -else - SRC_URI="https://cache.ruby-lang.org/pub/ruby/$(ver_cut 1-2)/${MY_P}.tar.xz" - S=${WORKDIR}/${MY_P} - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris" -fi +SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" LICENSE="|| ( Ruby-BSD BSD-2 )" -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" +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 psych socks5 +ssl static-libs systemtap tk valgrind xemacs" RDEPEND=" berkdb? ( sys-libs/db:= ) @@ -43,6 +28,7 @@ RDEPEND=" jit? ( ${RUST_DEPEND} ) ssl? ( dev-libs/openssl:0= + ) socks5? ( >=net-proxy/dante-1.1.13 ) systemtap? ( dev-debug/systemtap ) @@ -52,9 +38,9 @@ RDEPEND=" ) dev-libs/libyaml dev-libs/libffi:= - virtual/zlib:= + sys-libs/zlib virtual/libcrypt:= - >=app-eselect/eselect-ruby-20251225 + >=app-eselect/eselect-ruby-20231226 " DEPEND=" @@ -63,53 +49,33 @@ DEPEND=" " BUNDLED_GEMS=" - >=dev-ruby/minitest-6.0.0[ruby_targets_ruby40(-)] - >=dev-ruby/power_assert-3.0.1[ruby_targets_ruby40(-)] - >=dev-ruby/rake-13.3.1[ruby_targets_ruby40(-)] - >=dev-ruby/test-unit-3.7.5[ruby_targets_ruby40(-)] - >=dev-ruby/rexml-3.4.4[ruby_targets_ruby40(-)] - >=dev-ruby/rss-0.3.2[ruby_targets_ruby40(-)] - >=dev-ruby/net-ftp-0.3.9[ruby_targets_ruby40(-)] - >=dev-ruby/net-imap-0.6.2[ruby_targets_ruby40(-)] + >=dev-ruby/debug-1.9.1[ruby_targets_ruby40(-)] + >=dev-ruby/irb-1.11.0[ruby_targets_ruby40(-)] + >=dev-ruby/matrix-0.4.2[ruby_targets_ruby40(-)] + >=dev-ruby/minitest-5.20.0[ruby_targets_ruby40(-)] + >=dev-ruby/net-ftp-0.3.3[ruby_targets_ruby40(-)] + >=dev-ruby/net-imap-0.4.9[ruby_targets_ruby40(-)] >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/net-smtp-0.5.1[ruby_targets_ruby40(-)] - >=dev-ruby/matrix-0.4.3[ruby_targets_ruby40(-)] - >=dev-ruby/prime-0.1.4[ruby_targets_ruby40(-)] - >=dev-ruby/rbs-3.10.0[ruby_targets_ruby40(-)] - >=dev-ruby/typeprof-0.31.1[ruby_targets_ruby40(-)] - >=dev-ruby/debug-1.11.1[ruby_targets_ruby40(-)] - >=dev-ruby/racc-1.8.1[ruby_targets_ruby40(-)] - - >=dev-ruby/mutex_m-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/getoptlong-0.2.1[ruby_targets_ruby40(-)] - >=dev-ruby/base64-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/bigdecimal-4.0.1[ruby_targets_ruby40(-)] - >=dev-ruby/observer-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/abbrev-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/resolv-replace-0.1.1[ruby_targets_ruby40(-)] - >=dev-ruby/rinda-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/drb-2.2.3[ruby_targets_ruby40(-)] - >=dev-ruby/nkf-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/syslog-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/csv-3.3.5[ruby_targets_ruby40(-)] - >=dev-ruby/repl_type_completor-0.1.12[ruby_targets_ruby40(-)] - >=dev-ruby/ostruct-0.6.3[ruby_targets_ruby40(-)] - >=dev-ruby/pstore-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/benchmark-0.5.0[ruby_targets_ruby40(-)] - >=dev-ruby/logger-1.7.0[ruby_targets_ruby40(-)] - >=dev-ruby/reline-0.6.3[ruby_targets_ruby40(-)] - >=dev-ruby/readline-0.0.4[ruby_targets_ruby40(-)] - >=dev-ruby/fiddle-1.1.8[ruby_targets_ruby40(-)] + >=dev-ruby/net-smtp-0.4.0[ruby_targets_ruby40(-)] + >=dev-ruby/power_assert-2.0.3[ruby_targets_ruby40(-)] + >=dev-ruby/prime-0.1.2[ruby_targets_ruby40(-)] + >=dev-ruby/psych-5.3.1[ruby_targets_ruby40(-)] + >=dev-ruby/racc-1.7.3[ruby_targets_ruby40(-)] + >=dev-ruby/rake-13.1.0[ruby_targets_ruby40(-)] + >=dev-ruby/rbs-3.4.0[ruby_targets_ruby40(-)] + >=dev-ruby/rexml-3.2.6[ruby_targets_ruby40(-)] + >=dev-ruby/rss-0.3.0[ruby_targets_ruby40(-)] + >=dev-ruby/test-unit-3.6.1[ruby_targets_ruby40(-)] + >=dev-ruby/typeprof-0.21.9[ruby_targets_ruby40(-)] " PDEPEND=" ${BUNDLED_GEMS} virtual/rubygems[ruby_targets_ruby40(-)] - >=dev-ruby/bundler-4.0.3[ruby_targets_ruby40(-)] - >=dev-ruby/did_you_mean-2.0.0[ruby_targets_ruby40(-)] - >=dev-ruby/irb-1.16.0[ruby_targets_ruby40(-)] - >=dev-ruby/json-2.18.0[ruby_targets_ruby40(-)] - >=dev-ruby/rdoc-7.0.2[ruby_targets_ruby40(-)] + >=dev-ruby/bundler-2.5.3[ruby_targets_ruby40(-)] + >=dev-ruby/did_you_mean-1.6.3[ruby_targets_ruby40(-)] + >=dev-ruby/json-2.7.1[ruby_targets_ruby40(-)] + >=dev-ruby/rdoc-6.6.2[ruby_targets_ruby40(-)] xemacs? ( app-xemacs/ruby-modes ) " @@ -126,58 +92,54 @@ src_prepare() { fi einfo "Unbundling gems..." - cd "${S}" || die + cd "$S" # Remove bundled gems that we will install via PDEPEND, bug # 539700. rm -fr gems/* || die touch gems/bundled_gems || die - # Doesn't play well with PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY - rm -f spec/ruby/core/process/setpriority_spec.rb || 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/rubygems/test_bundled_ca.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 + 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 '/^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 - - # Avoid tests that don't expect our ruby40 executable name. - sed -e '/test_prelude_gems_and_loaded_features/aomit "Does not match ruby40"' \ - -i test/ruby/test_box.rb - - # Have ruby --version print out ${PV} - if [[ ${PV} == *9999* ]]; then - sed -i "s/#define RUBY_VERSION_TEENY.*/#define RUBY_VERSION_TEENY 9999/" version.h || die - - cp "${BROOT}"/usr/share/gnuconfig/config.guess "${S}"/tool/config.guess || die - cp "${BROOT}"/usr/share/gnuconfig/config.sub "${S}"/tool/config.sub || die - fi - - # Avoid specs that require gems to be installed already due to our unbundling. - rm -rf spec/ruby/library/irb || die + 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 if use prefix ; then # Fix hardcoded SHELL var in mkmf library sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die + + if [[ ${CHOST} == *darwin* ]] ; then + # avoid symlink loop on Darwin (?!) + sed -i \ + -e '/LIBRUBY_ALIASES=/s/lib$(RUBY_INSTALL_NAME).$(SOEXT)//' \ + configure.ac || die + + # make ar/libtool hack for Darwin work + sed -i \ + -e "s/ac_cv_prog_ac_ct_AR='libtool/ac_cv_prog_AR='${CHOST}-libtool/" \ + configure.ac || die + + # disable using security framework (GCC barfs on those headers) + sed -i \ + -e 's/MAC_OS_X_VERSION_MIN_REQUIRED/_DISABLED_/' \ + random.c || die + fi fi eapply_user @@ -186,7 +148,7 @@ src_prepare() { } src_configure() { - local modules="win32,win32ole" + 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 @@ -197,25 +159,11 @@ src_configure() { 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 - # Fails to link (gcc PR124865, gcc PR50676) - filter-flags -flto-partition=cache - # bug #972696 - append-cppflags -DRB_THREAD_CURRENT_EC_NOINLINE - - # 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 @@ -226,10 +174,13 @@ src_configure() { fi # Increase GC_MALLOC_LIMIT if set (default is 8000000) - if [[ -n "${RUBY_GC_MALLOC_LIMIT}" ]] ; then + 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" @@ -247,56 +198,43 @@ src_configure() { # 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 - [[ ${CHOST} == *-darwin* ]] || export LIBPATHENV="" - - local myeconfargs=( - --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 for bug #949016 - --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 jit zjit) - $(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) - $(use_with valgrind) + INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \ + --program-suffix=${MY_SUFFIX} \ + --with-soname=ruby${MY_SUFFIX} \ + --enable-shared \ + --enable-pthread \ + --disable-rpath \ + --without-baseruby \ + --with-compress-debug-sections=no \ + --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) \ + --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_enable psych) \ + ${myconf} \ + $(use_with valgrind) \ --enable-option-checking=no - ) - - # Fix co-routine selection for x32, bug 933070 - [[ ${CHOST} == *gnux32 ]] && myeconfargs+=( --with-coroutine=amd64 ) - - # Live ebuilds require a Ruby version to build with. - [[ ${PV} == *9999* ]] && myeconfargs+=( --with-baseruby="${BROOT}"/usr/bin/ruby$(ver_rs 1 "" "${MY_PV}") ) - - INSTALL="${EPREFIX}/usr/bin/install -c" econf "${myeconfargs[@]}" # 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}" + export LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${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}" + export LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" emake V=1 check } @@ -310,13 +248,20 @@ src_install() { # 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}" - local d + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby) + + LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + + if [[ ${CHOST} == *darwin* ]] ; then + DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + export DYLD_LIBRARY_PATH + fi + + RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" for d in $(find "${S}/ext" -type d) ; do - RUBYLIB="${RUBYLIB}:${d}" + RUBYLIB="${RUBYLIB}:$d" done + export LD_LIBRARY_PATH RUBYLIB # Create directory for the default gems local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}" diff --git a/dev-lang/ruby/ruby-3.4.9.ebuild b/dev-lang/ruby/ruby-4.0.5.ebuild index 6d7d47f1b165..190395dbad53 100644 --- a/dev-lang/ruby/ruby-3.4.9.ebuild +++ b/dev-lang/ruby/ruby-4.0.5.ebuild @@ -1,6 +1,5 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2021-2026 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 RUST_OPTIONAL="yes" @@ -8,19 +7,19 @@ 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 ~arm64-macos ~x64-macos ~x64-solaris" -IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs" +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 psych socks5 +ssl static-libs systemtap tk valgrind xemacs" RDEPEND=" berkdb? ( sys-libs/db:= ) @@ -29,6 +28,7 @@ RDEPEND=" jit? ( ${RUST_DEPEND} ) ssl? ( dev-libs/openssl:0= + ) socks5? ( >=net-proxy/dante-1.1.13 ) systemtap? ( dev-debug/systemtap ) @@ -38,9 +38,9 @@ RDEPEND=" ) dev-libs/libyaml dev-libs/libffi:= - virtual/zlib:= + sys-libs/zlib virtual/libcrypt:= - >=app-eselect/eselect-ruby-20241225 + >=app-eselect/eselect-ruby-20231226 " DEPEND=" @@ -49,46 +49,33 @@ DEPEND=" " 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(-)] + >=dev-ruby/debug-1.9.1[ruby_targets_ruby40(-)] + >=dev-ruby/irb-1.11.0[ruby_targets_ruby40(-)] + >=dev-ruby/matrix-0.4.2[ruby_targets_ruby40(-)] + >=dev-ruby/minitest-5.20.0[ruby_targets_ruby40(-)] + >=dev-ruby/net-ftp-0.3.3[ruby_targets_ruby40(-)] + >=dev-ruby/net-imap-0.4.9[ruby_targets_ruby40(-)] + >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby40(-)] + >=dev-ruby/net-smtp-0.4.0[ruby_targets_ruby40(-)] + >=dev-ruby/power_assert-2.0.3[ruby_targets_ruby40(-)] + >=dev-ruby/prime-0.1.2[ruby_targets_ruby40(-)] + >=dev-ruby/psych-5.3.1[ruby_targets_ruby40(-)] + >=dev-ruby/racc-1.7.3[ruby_targets_ruby40(-)] + >=dev-ruby/rake-13.1.0[ruby_targets_ruby40(-)] + >=dev-ruby/rbs-3.4.0[ruby_targets_ruby40(-)] + >=dev-ruby/rexml-3.2.6[ruby_targets_ruby40(-)] + >=dev-ruby/rss-0.3.0[ruby_targets_ruby40(-)] + >=dev-ruby/test-unit-3.6.1[ruby_targets_ruby40(-)] + >=dev-ruby/typeprof-0.21.9[ruby_targets_ruby40(-)] " 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(-)] + virtual/rubygems[ruby_targets_ruby40(-)] + >=dev-ruby/bundler-2.5.3[ruby_targets_ruby40(-)] + >=dev-ruby/did_you_mean-1.6.3[ruby_targets_ruby40(-)] + >=dev-ruby/json-2.7.1[ruby_targets_ruby40(-)] + >=dev-ruby/rdoc-6.6.2[ruby_targets_ruby40(-)] xemacs? ( app-xemacs/ruby-modes ) " @@ -105,7 +92,7 @@ src_prepare() { fi einfo "Unbundling gems..." - cd "${S}" || die + cd "$S" # Remove bundled gems that we will install via PDEPEND, bug # 539700. rm -fr gems/* || die @@ -113,42 +100,46 @@ src_prepare() { # 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 +# 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/rubygems/test_bundled_ca.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 - - # Doesn't play well with PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY - rm -f spec/ruby/core/process/setpriority_spec.rb || die + 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 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 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 '/^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 + 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 if use prefix ; then # Fix hardcoded SHELL var in mkmf library sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die + + if [[ ${CHOST} == *darwin* ]] ; then + # avoid symlink loop on Darwin (?!) + sed -i \ + -e '/LIBRUBY_ALIASES=/s/lib$(RUBY_INSTALL_NAME).$(SOEXT)//' \ + configure.ac || die + + # make ar/libtool hack for Darwin work + sed -i \ + -e "s/ac_cv_prog_ac_ct_AR='libtool/ac_cv_prog_AR='${CHOST}-libtool/" \ + configure.ac || die + + # disable using security framework (GCC barfs on those headers) + sed -i \ + -e 's/MAC_OS_X_VERSION_MIN_REQUIRED/_DISABLED_/' \ + random.c || die + fi fi eapply_user @@ -157,7 +148,7 @@ src_prepare() { } src_configure() { - local modules="win32,win32ole" + 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 @@ -168,22 +159,12 @@ src_configure() { 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 @@ -197,6 +178,9 @@ src_configure() { 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" @@ -214,53 +198,43 @@ src_configure() { # 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="" - - local myeconfargs=( - --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) - $(use_with valgrind) + INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \ + --program-suffix=${MY_SUFFIX} \ + --with-soname=ruby${MY_SUFFIX} \ + --enable-shared \ + --enable-pthread \ + --disable-rpath \ + --without-baseruby \ + --with-compress-debug-sections=no \ + --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) \ + --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_enable psych) \ + ${myconf} \ + $(use_with valgrind) \ --enable-option-checking=no - ) - - # Fix co-routine selection for x32, bug 933070 - [[ ${CHOST} == *gnux32 ]] && myeconfargs+=( --with-coroutine=amd64 ) - - INSTALL="${EPREFIX}/usr/bin/install -c" econf "${myeconfargs[@]}" # 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}" + export LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${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}" + export LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" emake V=1 check } @@ -276,12 +250,18 @@ src_install() { 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}" + LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + + if [[ ${CHOST} == *darwin* ]] ; then + DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + export DYLD_LIBRARY_PATH + fi - local -x RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" + RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" for d in $(find "${S}/ext" -type d) ; do RUBYLIB="${RUBYLIB}:$d" done + export LD_LIBRARY_PATH RUBYLIB # Create directory for the default gems local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}" @@ -303,7 +283,7 @@ src_install() { dodoc -r sample fi - dodoc ChangeLog NEWS.md README* + dodoc NEWS.md README* dodoc -r doc } diff --git a/dev-lang/ruby/ruby-4.0.9999.ebuild b/dev-lang/ruby/ruby-4.0.9999.ebuild deleted file mode 100644 index caa2b9f363a5..000000000000 --- a/dev-lang/ruby/ruby-4.0.9999.ebuild +++ /dev/null @@ -1,358 +0,0 @@ -# Copyright 1999-2026 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -RUST_MIN_VER="1.85.0" -RUST_OPTIONAL="yes" - -inherit autotools flag-o-matic multiprocessing rust - -MY_P="${PN}-$(ver_cut 1-3)" -MY_PV="${PV%.*}" -MY_SLOT=$(ver_cut 1-2) - -DESCRIPTION="An object-oriented scripting language" -HOMEPAGE="https://www.ruby-lang.org/" -if [[ ${PV} == *9999* ]]; then - inherit git-r3 - EGIT_BRANCH="ruby_${MY_PV/./_}" - EGIT_REPO_URI="https://github.com/ruby/ruby.git" - - # Self-depend is necessary because ruby from git depends on building some pre-requisite gems. - BDEPEND=" - dev-lang/ruby:${MY_SLOT} - " -else - SRC_URI="https://cache.ruby-lang.org/pub/ruby/$(ver_cut 1-2)/${MY_P}.tar.xz" - S=${WORKDIR}/${MY_P} - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris" -fi - -LICENSE="|| ( Ruby-BSD BSD-2 )" -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" - -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:= - virtual/zlib:= - virtual/libcrypt:= - >=app-eselect/eselect-ruby-20251225 -" - -DEPEND=" - ${RDEPEND} - valgrind? ( dev-debug/valgrind ) -" - -BUNDLED_GEMS=" - >=dev-ruby/minitest-6.0.0[ruby_targets_ruby40(-)] - >=dev-ruby/power_assert-3.0.1[ruby_targets_ruby40(-)] - >=dev-ruby/rake-13.3.1[ruby_targets_ruby40(-)] - >=dev-ruby/test-unit-3.7.5[ruby_targets_ruby40(-)] - >=dev-ruby/rexml-3.4.4[ruby_targets_ruby40(-)] - >=dev-ruby/rss-0.3.2[ruby_targets_ruby40(-)] - >=dev-ruby/net-ftp-0.3.9[ruby_targets_ruby40(-)] - >=dev-ruby/net-imap-0.6.2[ruby_targets_ruby40(-)] - >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/net-smtp-0.5.1[ruby_targets_ruby40(-)] - >=dev-ruby/matrix-0.4.3[ruby_targets_ruby40(-)] - >=dev-ruby/prime-0.1.4[ruby_targets_ruby40(-)] - >=dev-ruby/rbs-3.10.0[ruby_targets_ruby40(-)] - >=dev-ruby/typeprof-0.31.1[ruby_targets_ruby40(-)] - >=dev-ruby/debug-1.11.1[ruby_targets_ruby40(-)] - >=dev-ruby/racc-1.8.1[ruby_targets_ruby40(-)] - - >=dev-ruby/mutex_m-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/getoptlong-0.2.1[ruby_targets_ruby40(-)] - >=dev-ruby/base64-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/bigdecimal-4.0.1[ruby_targets_ruby40(-)] - >=dev-ruby/observer-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/abbrev-0.1.2[ruby_targets_ruby40(-)] - >=dev-ruby/resolv-replace-0.1.1[ruby_targets_ruby40(-)] - >=dev-ruby/rinda-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/drb-2.2.3[ruby_targets_ruby40(-)] - >=dev-ruby/nkf-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/syslog-0.3.0[ruby_targets_ruby40(-)] - >=dev-ruby/csv-3.3.5[ruby_targets_ruby40(-)] - >=dev-ruby/repl_type_completor-0.1.12[ruby_targets_ruby40(-)] - >=dev-ruby/ostruct-0.6.3[ruby_targets_ruby40(-)] - >=dev-ruby/pstore-0.2.0[ruby_targets_ruby40(-)] - >=dev-ruby/benchmark-0.5.0[ruby_targets_ruby40(-)] - >=dev-ruby/logger-1.7.0[ruby_targets_ruby40(-)] - >=dev-ruby/reline-0.6.3[ruby_targets_ruby40(-)] - >=dev-ruby/readline-0.0.4[ruby_targets_ruby40(-)] - >=dev-ruby/fiddle-1.1.8[ruby_targets_ruby40(-)] -" - -PDEPEND=" - ${BUNDLED_GEMS} - virtual/rubygems[ruby_targets_ruby40(-)] - >=dev-ruby/bundler-4.0.3[ruby_targets_ruby40(-)] - >=dev-ruby/did_you_mean-2.0.0[ruby_targets_ruby40(-)] - >=dev-ruby/irb-1.16.0[ruby_targets_ruby40(-)] - >=dev-ruby/json-2.18.0[ruby_targets_ruby40(-)] - >=dev-ruby/rdoc-7.0.2[ruby_targets_ruby40(-)] - 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}" || die - # Remove bundled gems that we will install via PDEPEND, bug - # 539700. - rm -fr gems/* || die - touch gems/bundled_gems || die - - # Doesn't play well with PORTAGE_NICENESS/PORTAGE_SCHEDULING_POLICY - rm -f spec/ruby/core/process/setpriority_spec.rb || 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/rubygems/test_bundled_ca.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 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 - - # Avoid tests that don't expect our ruby40 executable name. - sed -e '/test_prelude_gems_and_loaded_features/aomit "Does not match ruby40"' \ - -i test/ruby/test_box.rb - - # Have ruby --version print out ${PV} - if [[ ${PV} == *9999* ]]; then - sed -i "s/#define RUBY_VERSION_TEENY.*/#define RUBY_VERSION_TEENY 9999/" version.h || die - - cp "${BROOT}"/usr/share/gnuconfig/config.guess "${S}"/tool/config.guess || die - cp "${BROOT}"/usr/share/gnuconfig/config.sub "${S}"/tool/config.sub || die - fi - - # Avoid specs that require gems to be installed already due to our unbundling. - rm -rf spec/ruby/library/irb || 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" - - # 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 - # Fails to link (gcc PR124865, gcc PR50676) - filter-flags -flto-partition=cache - # bug #972696 - append-cppflags -DRB_THREAD_CURRENT_EC_NOINLINE - - # 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 - [[ ${CHOST} == *-darwin* ]] || export LIBPATHENV="" - - local myeconfargs=( - --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 for bug #949016 - --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 jit zjit) - $(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) - $(use_with valgrind) - --enable-option-checking=no - ) - - # Fix co-routine selection for x32, bug 933070 - [[ ${CHOST} == *gnux32 ]] && myeconfargs+=( --with-coroutine=amd64 ) - - # Live ebuilds require a Ruby version to build with. - [[ ${PV} == *9999* ]] && myeconfargs+=( --with-baseruby="${BROOT}"/usr/bin/ruby$(ver_rs 1 "" "${MY_PV}") ) - - INSTALL="${EPREFIX}/usr/bin/install -c" econf "${myeconfargs[@]}" - - # 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}" - local d - 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 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 -} |
