diff options
Diffstat (limited to 'dev-lang/ruby')
47 files changed, 2246 insertions, 1821 deletions
diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest index a474614b3776..b690e7d8e06d 100644 --- a/dev-lang/ruby/Manifest +++ b/dev-lang/ruby/Manifest @@ -1,4 +1,8 @@ -DIST ruby-2.5.8.tar.xz 11298404 BLAKE2B 3256c0448e72b63c0bd89f89a27fa9c09c8feed54d42cd79899b7d5cfe9dbc29ca708d12c630b3f52ff85b0c6a4011ae7ff0483d64b2fd445700a72a91028035 SHA512 2886be764a454425c5beef2777c64a70ee0d048b07896b327633d904f5077fea4299526689f9e2ac4dcd2fc4811cf9a6c8ce75367ed35d29dfe1a54222872e0d -DIST ruby-2.6.6.tar.xz 11567284 BLAKE2B 45e910dd9b128c46bff3003834c4fdcbbc2e2e4d3e44f298ff4356a285de2c375d6b6021a3aa28d89336b32a1655fa4a7c086d07f4a0f6bcd578a11dd4a894da SHA512 86caf93dbf61d03781767ab5375a7edf4761f13ba08ccfefe16c0a7550499237e7390c2f72a95d42670d4fe76b2401b4218936187c62ec1572799e9e04c50d62 -DIST ruby-2.7.2.tar.xz 12037052 BLAKE2B a4ad22295b3fed4e8064fc6e77adb8642d1fa7ae1f4ef912d7bde19c735cb25b1a3e3aefba53dad944046d844d608bcefba61c314cf1e52747f50d7d91f4c436 SHA512 7972278b096aa768c7adf2befd26003e18781a29ca317640317d30d93d6e963ded197724c8e2f1dfe1e838c5647176d414a74732a62e931fb50d6f2e0f777349 -DIST ruby-3.0.0.tar.xz 14374176 BLAKE2B 9e7520e0b1ae6644285449c4ae92983d306772b3dd5366a17da709a55797c798d099424a5628c78c842b825fb336c6a769ac9c371ef276f42bf3550fd0761ebe SHA512 2a23c2894e62e24bb20cec6b2a016b66d7df05083668726b6f70af8338211cfec417aa3624290d1f5ccd130f65ee7b52b5db7d428abc4a9460459c9a5dd1a450 +DIST ruby-3.1.4.tar.xz 15316604 BLAKE2B 5d771c267451c05ae192991976957d43d1131e652ac5a90a8dfff9deba97cf6b139d0113f5d2ed44225a545aa79a1c732555de1efc83d1010d097ec35f7e92dd SHA512 a627bb629a10750b8b2081ad451a41faea0fc85d95aa1e267e3d2a0f56a35bb58195d4a8d13bbdbd82f4197a96dae22b1cee1dfc83861ec33a67ece07aef5633 +DIST ruby-3.1.5.tar.xz 15293020 BLAKE2B 5d886f45f2a27dbe7682f5afc234d4992ffc5006cfaa98f23c29e1fff0323c277ffec827c71ee75885b4f2cf0bf7baed4ea239ae32283578213821e597bf51da SHA512 a9883f4d074825bb1f54ef3429a9a71341274bd2de1aa8ea32bce19b6b9c1bac5e5dc4c34a92b8e7caa73ba71d7ed7c546a6fec6f1fd3d8986974dce214f6d49 +DIST ruby-3.1.6.tar.xz 15273916 BLAKE2B feb697b8d01ebde0042e679b814c4c95481c6afa607db46ad1511fb0d1a555d7800725e847e90dd9944ef42575c5205cf711025a165a65b6070743701631929c SHA512 a3159648706d6d11ce9613201141e884b3accc69bf928c756de8a8f2b71d219886e91435d30cf2c30e85af31f87801138e10106344766100f1b80662c7244652 +DIST ruby-3.2.3.tar.xz 15163960 BLAKE2B e2cfa215b2cb910bac5f3b58edcdece91b21ffcfb6b4c183eec0c8502c320b78e7a8732c393b6e6a38dc9cfd81e129c00562d9be45f0deb36306ac81f96dcdc1 SHA512 d2a1897c2f4e801a28acb869322abfee76775115016252cecad90639485ed51deda1446cb16edb387f10a2e188602d646ef9b008b57f27bd745071277c535f3b +DIST ruby-3.2.4.tar.xz 15175656 BLAKE2B 9c2300a958b03528d51f0d74a069c8c538ca4009835d55377509a000bcfb43893a8a80d8fda57011e77c72e6283cb259281d5ba7b37444546e49f2a9ad515cf3 SHA512 fb0af37be4b6ad7b98ab9f8a508952238ee68b5828e3926331e4db52e2ebc1e6046f31114069322db0cd3bea7c9b82ace91c8564573ddcfa1f960877b237dbff +DIST ruby-3.3.0.tar.xz 16345456 BLAKE2B 09ef6fb4b2768118207e7a9ece17c5c62c9f596b1c13ac6199245889fcc5d25f03336831ec3bf1367a460a8a26c4426c32bcd576b0da8bdafc90301032b4d2f0 SHA512 7959c5753bfa0bfc4d6d74060869aabbe9815c1c97930659da11b917ee0803ddbbd80e869e00c48b8694b4ba48709c3b6493fd045568e36e902616c35ababf01 +DIST ruby-3.3.1.tar.xz 16350792 BLAKE2B f3591d2420edd8c1d5b365d1442fcc07c014e402478dce01a80b81c16c3c7083bcd3e9e9aa0f8d586cd482f0f18eb64ad813ea31755f5d12b137ce03b1a0fa4c SHA512 c58e9be9b5ab48191fbf7d67e13f0ec42ee71ed338170e0f7b246708e9cfc617ce65098f5ce7ab32d4305e785642d3e44253462104d5b9c4abcb1a4113f48347 +DIST ruby-3.3.2.tar.xz 16349500 BLAKE2B 2a474df10363555e8f0b9ad73bb854ad34f3d1485b8bdde833c999b20bc2c17282d2097d887d10f454bbd4dfdf08f04bb644a7e41d0b4a0ff0e9eb144339b5e8 SHA512 70dd8eb933956f894c52a8ede42e8ee74ff0e062bd8134a0bfb6bffc83a2848a658b62c8df5530b4dd64087b2d5373909c48917528facb1e6f4e99e79b6ad449 diff --git a/dev-lang/ruby/files/2.4/002_windows_crossdev.patch b/dev-lang/ruby/files/2.4/002_windows_crossdev.patch deleted file mode 100644 index 7e290d434f03..000000000000 --- a/dev-lang/ruby/files/2.4/002_windows_crossdev.patch +++ /dev/null @@ -1,64 +0,0 @@ -Bug: https://bugs.gentoo.org/show_bug.cgi?id=618878 - -A few patches to make crossdev for mingw-w64 play nice with ruby's ebuilds. -Basic gist is that without the following patch to configure.in ruby-2.4.1 -hardcodes 240 into the shared, static, and import library names, which when -built with the current ruby ebuilds results in names like libx64-msvcrt-ruby24240.dll and so on. The patch is in ruby-trunk[1], but may take a while -to hit the tarballs that gentoo uses. - -Index: configure.in -=================================================================== ---- a/configure.in (revision 57824) -+++ b/configure.in (revision 57825) -@@ -3825,7 +3825,23 @@ - - AC_ARG_WITH(soname, - AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]), -- [RUBY_SO_NAME=$withval], [RUBY_SO_NAME='$(RUBY_BASE_NAME)']) -+ [RUBY_SO_NAME=$withval], -+ [ -+ AS_CASE(["$target_os"], -+ [darwin*], [ -+ RUBY_SO_NAME='$(RUBY_BASE_NAME).$(RUBY_PROGRAM_VERSION)' -+ ], -+ [cygwin*], [ -+ RUBY_SO_NAME='$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0' -+ ], -+ [mingw*], [ -+ RUBY_SO_NAME="${rb_cv_msvcrt}"'-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0' -+ AS_IF([test x"${target_cpu}" != xi386], [ -+ RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}" -+ ]) -+ ], -+ [RUBY_SO_NAME='$(RUBY_BASE_NAME)']) -+ ]) - - LIBRUBY_LDSHARED=$LDSHARED - LIBRUBY_DLDFLAGS=$DLDFLAGS -@@ -3925,7 +3941,6 @@ - SOLIBS='-lm -lc' - ], - [darwin*], [ -- RUBY_SO_NAME="$RUBY_SO_NAME"'.$(RUBY_PROGRAM_VERSION)' - LIBRUBY_LDSHARED='$(CC) -dynamiclib' - if test "$load_relative" = yes; then - libprefix="@executable_path/../${libdir_basename}" -@@ -4157,7 +4172,6 @@ - fi - ], - [cygwin*|mingw*], [ -- RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)0' - LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)' - AS_CASE(["$target_os"], - [cygwin*], [ -@@ -4167,10 +4181,6 @@ - fi - ], - [mingw*], [ -- RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}" -- if test x"${target_cpu}" != xi386; then -- RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}" -- fi - if test x"$enable_shared" = xyes; then - LIBRUBY_SO='$(RUBY_SO_NAME)'.dll - LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)' diff --git a/dev-lang/ruby/files/2.4/005_no-undefined-ext.patch b/dev-lang/ruby/files/2.4/005_no-undefined-ext.patch deleted file mode 100644 index f27993240128..000000000000 --- a/dev-lang/ruby/files/2.4/005_no-undefined-ext.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ruby-1.9.3-preview1.orig/configure.in -+++ ruby-1.9.3-preview1/configure.in -@@ -2038,7 +2038,7 @@ if test "$with_dln_a_out" != yes; then - [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu], [ - : ${LDSHARED='$(CC) -shared'} - if test "$rb_cv_binary_elf" = yes; then -- LDFLAGS="$LDFLAGS -Wl,-export-dynamic" -+ LDFLAGS="$LDFLAGS -Wl,-export-dynamic -Wl,--no-undefined" - fi - rb_cv_dlopen=yes], - [interix*], [ : ${LDSHARED='$(CC) -shared'} diff --git a/dev-lang/ruby/files/2.4/009_no-gems.patch b/dev-lang/ruby/files/2.4/009_no-gems.patch deleted file mode 100644 index 6e4e2643d4c0..000000000000 --- a/dev-lang/ruby/files/2.4/009_no-gems.patch +++ /dev/null @@ -1,112 +0,0 @@ ---- a/tool/rbinstall.rb.~1~ 2016-10-17 09:17:07.000000000 +0200 -+++ b/tool/rbinstall.rb 2016-12-25 08:20:07.873491045 +0100 -@@ -695,107 +695,11 @@ - # :startdoc: - - install?(:ext, :comm, :gem) do -- gem_dir = Gem.default_dir -- directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) -- prepare "default gems", gem_dir, directories -- -- spec_dir = File.join(gem_dir, directories.grep(/^spec/)[0]) -- default_spec_dir = "#{spec_dir}/default" -- makedirs(default_spec_dir) -- -- gems = Dir.glob(srcdir+"/{lib,ext}/**/*.gemspec").map {|src| -- spec = Gem::Specification.load(src) || raise("invalid spec in #{src}") -- file_collector = RbInstall::Specs::FileCollector.new(File.dirname(src)) -- files = file_collector.collect -- next if files.empty? -- spec.files = files -- spec -- } -- gems.compact.sort_by(&:name).each do |gemspec| -- full_name = "#{gemspec.name}-#{gemspec.version}" -- -- puts "#{" "*30}#{gemspec.name} #{gemspec.version}" -- gemspec_path = File.join(default_spec_dir, "#{full_name}.gemspec") -- open_for_install(gemspec_path, $data_mode) do -- gemspec.to_ruby -- end -- -- unless gemspec.executables.empty? then -- bin_dir = File.join(gem_dir, 'gems', full_name, gemspec.bindir) -- makedirs(bin_dir) -- -- execs = gemspec.executables.map {|exec| File.join(srcdir, 'bin', exec)} -- install(execs, bin_dir, :mode => $script_mode) -- end -- end -+ # gems are unbundled in Gentoo - end - - install?(:ext, :comm, :gem) do -- gem_dir = Gem.default_dir -- directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) -- prepare "bundle gems", gem_dir, directories -- install_dir = with_destdir(gem_dir) -- installed_gems = {} -- options = { -- :install_dir => install_dir, -- :bin_dir => with_destdir(bindir), -- :domain => :local, -- :ignore_dependencies => true, -- :dir_mode => $dir_mode, -- :data_mode => $data_mode, -- :prog_mode => $prog_mode, -- :wrappers => true, -- :format_executable => true, -- } -- gem_ext_dir = "#$extout/gems/#{CONFIG['arch']}" -- extensions_dir = Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir -- Gem::Specification.each_gemspec([srcdir+'/gems/*']) do |path| -- dir = File.dirname(path) -- spec = Dir.chdir(dir) { -- Gem::Specification.load(File.basename(path)) -- } -- next unless spec.platform == Gem::Platform::RUBY -- next unless spec.full_name == path[srcdir.size..-1][/\A\/gems\/([^\/]+)/, 1] -- spec.extension_dir = "#{extensions_dir}/#{spec.full_name}" -- if File.directory?(ext = "#{gem_ext_dir}/#{spec.full_name}") -- spec.extensions[0] ||= "-" -- end -- ins = RbInstall::UnpackedInstaller.new(spec, options) -- puts "#{" "*30}#{spec.name} #{spec.version}" -- ins.install -- File.chmod($data_mode, File.join(install_dir, "specifications", "#{spec.full_name}.gemspec")) -- unless spec.extensions.empty? -- install_recursive(ext, spec.extension_dir) -- end -- installed_gems[spec.full_name] = true -- end -- installed_gems, gems = Dir.glob(srcdir+'/gems/*.gem').partition {|gem| installed_gems.key?(File.basename(gem, '.gem'))} -- unless installed_gems.empty? -- install installed_gems, gem_dir+"/cache" -- end -- next if gems.empty? -- if defined?(Zlib) -- Gem.instance_variable_set(:@ruby, with_destdir(File.join(bindir, ruby_install_name))) -- silent = Gem::SilentUI.new -- gems.each do |gem| -- inst = Gem::Installer.new(gem, options) -- inst.spec.extension_dir = with_destdir(inst.spec.extension_dir) -- begin -- Gem::DefaultUserInteraction.use_ui(silent) {inst.install} -- rescue Gem::InstallError => e -- next -- end -- gemname = File.basename(gem) -- puts "#{" "*30}#{gemname}" -- end -- # fix directory permissions -- # TODO: Gem.install should accept :dir_mode option or something -- File.chmod($dir_mode, *Dir.glob(install_dir+"/**/")) -- # fix .gemspec permissions -- File.chmod($data_mode, *Dir.glob(install_dir+"/specifications/*.gemspec")) -- else -- puts "skip installing bundle gems because of lacking zlib" -- end -+ # gems are unbundled in Gentoo - end - - parse_args() diff --git a/dev-lang/ruby/files/2.4/010-libressl_2.7.patch b/dev-lang/ruby/files/2.4/010-libressl_2.7.patch deleted file mode 100644 index 2e25ab095858..000000000000 --- a/dev-lang/ruby/files/2.4/010-libressl_2.7.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/ext/openssl/extconf.rb.orig 2017-09-08 14:38:12 UTC -+++ b/ext/openssl/extconf.rb -@@ -157,8 +157,11 @@ OpenSSL.check_func_or_macro("SSL_get_ser - have_func("SSL_is_server") - - # added in 1.1.0 -+if !have_struct_member("SSL", "ctx", "openssl/ssl.h") || -+ try_static_assert("LIBRESSL_VERSION_NUMBER >= 0x2070000fL", "openssl/opensslv.h") -+ $defs.push("-DHAVE_OPAQUE_OPENSSL") -+end - have_func("CRYPTO_lock") || $defs.push("-DHAVE_OPENSSL_110_THREADING_API") --have_struct_member("SSL", "ctx", "openssl/ssl.h") || $defs.push("-DHAVE_OPAQUE_OPENSSL") - have_func("BN_GENCB_new") - have_func("BN_GENCB_free") - have_func("BN_GENCB_get_arg") diff --git a/dev-lang/ruby/files/2.4/011-gcc8.patch b/dev-lang/ruby/files/2.4/011-gcc8.patch deleted file mode 100644 index cb2443631dd8..000000000000 --- a/dev-lang/ruby/files/2.4/011-gcc8.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 027b576b31cd12bad575b3a39476726273f58c41 Mon Sep 17 00:00:00 2001 -From: naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> -Date: Mon, 18 Dec 2017 09:03:59 +0000 -Subject: [PATCH] suppress warning: 'const' attribute on function returning - 'void' - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - include/ruby/intern.h | 4 ++-- - include/ruby/ruby.h | 2 +- - internal.h | 4 ++-- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/include/ruby/intern.h b/include/ruby/intern.h -index 5684b3230a67..a711b861159f 100644 ---- a/include/ruby/intern.h -+++ b/include/ruby/intern.h -@@ -249,9 +249,9 @@ PRINTF_ARGS(NORETURN(void rb_name_error_str(VALUE, const char*, ...)), 2, 3); - NORETURN(void rb_invalid_str(const char*, const char*)); - NORETURN(void rb_error_frozen(const char*)); - NORETURN(void rb_error_frozen_object(VALUE)); --CONSTFUNC(void rb_error_untrusted(VALUE)); -+void rb_error_untrusted(VALUE); - void rb_check_frozen(VALUE); --CONSTFUNC(void rb_check_trusted(VALUE)); -+void rb_check_trusted(VALUE); - #define rb_check_frozen_internal(obj) do { \ - VALUE frozen_obj = (obj); \ - if (OBJ_FROZEN(frozen_obj)) { \ -diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h -index 9c7d2fb68439..3210103c648a 100644 ---- a/include/ruby/ruby.h -+++ b/include/ruby/ruby.h -@@ -628,7 +628,7 @@ int ruby_safe_level_2_warning(void) __attribute__((const,warning("$SAFE=2 to 4 a - # define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level, error)) - #endif - void rb_set_safe_level_force(int); --CONSTFUNC(void rb_secure_update(VALUE)); -+void rb_secure_update(VALUE); - NORETURN(void rb_insecure_operation(void)); - - VALUE rb_errinfo(void); -diff --git a/internal.h b/internal.h -index d0257a8d8ba0..4ccf3218c6ca 100644 ---- a/internal.h -+++ b/internal.h -@@ -1110,7 +1110,7 @@ VALUE rb_invcmp(VALUE, VALUE); - struct rb_block; - int rb_dvar_defined(ID, const struct rb_block *); - int rb_local_defined(ID, const struct rb_block *); --CONSTFUNC(const char * rb_insns_name(int i)); -+const char * rb_insns_name(int i); - VALUE rb_insns_name_array(void); - - /* complex.c */ -@@ -1136,7 +1136,7 @@ void Init_ext(void); - - /* encoding.c */ - ID rb_id_encoding(void); --CONSTFUNC(void rb_gc_mark_encodings(void)); -+void rb_gc_mark_encodings(void); - rb_encoding *rb_enc_get_from_index(int index); - rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2); - int rb_encdb_replicate(const char *alias, const char *orig); diff --git a/dev-lang/ruby/files/2.4/012-openssl_1.1.patch b/dev-lang/ruby/files/2.4/012-openssl_1.1.patch deleted file mode 100644 index edf344bedc8c..000000000000 --- a/dev-lang/ruby/files/2.4/012-openssl_1.1.patch +++ /dev/null @@ -1,339 +0,0 @@ -From 7af808153dd34a980e027a04d4490ae38019b3ed Mon Sep 17 00:00:00 2001 -From: Mark Wright <gienah@gentoo.org> -Date: Sun, 15 Oct 2017 01:24:12 +1100 -Subject: [PATCH] Fix build failure against OpenSSL 1.1 built with - no-deprecated Thanks rhenium for the code review and fixes. - ---- - ext/openssl/openssl_missing.h | 4 +++ - ext/openssl/ossl.c | 23 ++++++--------- - ext/openssl/ossl.h | 5 ++++ - ext/openssl/ossl_cipher.c | 14 ++++----- - ext/openssl/ossl_engine.c | 54 ++++++++++++++++++++++------------- - ext/openssl/ossl_ssl.c | 2 +- - ext/openssl/ossl_x509cert.c | 4 +-- - ext/openssl/ossl_x509crl.c | 4 +-- - 8 files changed, 63 insertions(+), 47 deletions(-) - -diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h -index cc31f6ac..debd25ad 100644 ---- a/ext/openssl/openssl_missing.h -+++ b/ext/openssl/openssl_missing.h -@@ -209,6 +209,10 @@ IMPL_PKEY_GETTER(EC_KEY, ec) - # define X509_get0_notAfter(x) X509_get_notAfter(x) - # define X509_CRL_get0_lastUpdate(x) X509_CRL_get_lastUpdate(x) - # define X509_CRL_get0_nextUpdate(x) X509_CRL_get_nextUpdate(x) -+# define X509_set1_notBefore(x, t) X509_set_notBefore(x, t) -+# define X509_set1_notAfter(x, t) X509_set_notAfter(x, t) -+# define X509_CRL_set1_lastUpdate(x, t) X509_CRL_set_lastUpdate(x, t) -+# define X509_CRL_set1_nextUpdate(x, t) X509_CRL_set_nextUpdate(x, t) - #endif - - #if !defined(HAVE_SSL_SESSION_GET_PROTOCOL_VERSION) -diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c -index 93ecc7d4..245385e7 100644 ---- a/ext/openssl/ossl.c -+++ b/ext/openssl/ossl.c -@@ -1109,25 +1109,14 @@ Init_openssl(void) - /* - * Init all digests, ciphers - */ -- /* CRYPTO_malloc_init(); */ -- /* ENGINE_load_builtin_engines(); */ -+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000 -+ if (!OPENSSL_init_ssl(0, NULL)) -+ rb_raise(rb_eRuntimeError, "OPENSSL_init_ssl"); -+#else - OpenSSL_add_ssl_algorithms(); - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - SSL_load_error_strings(); -- -- /* -- * FIXME: -- * On unload do: -- */ --#if 0 -- CONF_modules_unload(1); -- destroy_ui_method(); -- EVP_cleanup(); -- ENGINE_cleanup(); -- CRYPTO_cleanup_all_ex_data(); -- ERR_remove_state(0); -- ERR_free_strings(); - #endif - - /* -@@ -1149,7 +1138,11 @@ Init_openssl(void) - /* - * Version of OpenSSL the ruby OpenSSL extension is running with - */ -+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000 -+ rb_define_const(mOSSL, "OPENSSL_LIBRARY_VERSION", rb_str_new2(OpenSSL_version(OPENSSL_VERSION))); -+#else - rb_define_const(mOSSL, "OPENSSL_LIBRARY_VERSION", rb_str_new2(SSLeay_version(SSLEAY_VERSION))); -+#endif - - /* - * Version number of OpenSSL the ruby OpenSSL extension was built with -diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h -index f08889b2..5a15839c 100644 ---- a/ext/openssl/ossl.h -+++ b/ext/openssl/ossl.h -@@ -35,6 +35,11 @@ - #if !defined(OPENSSL_NO_OCSP) - # include <openssl/ocsp.h> - #endif -+#include <openssl/bn.h> -+#include <openssl/rsa.h> -+#include <openssl/dsa.h> -+#include <openssl/evp.h> -+#include <openssl/dh.h> - - /* - * Common Module -diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c -index bfa76c1a..e6179733 100644 ---- a/ext/openssl/ossl_cipher.c -+++ b/ext/openssl/ossl_cipher.c -@@ -508,9 +508,9 @@ ossl_cipher_set_iv(VALUE self, VALUE iv) - StringValue(iv); - GetCipher(self, ctx); - - #if defined(HAVE_AUTHENTICATED_ENCRYPTION) -- if (EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_FLAG_AEAD_CIPHER) -+ if (EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER) - iv_len = (int)(VALUE)EVP_CIPHER_CTX_get_app_data(ctx); - #endif - if (!iv_len) - iv_len = EVP_CIPHER_CTX_iv_length(ctx); -@@ -535,7 +535,7 @@ ossl_cipher_is_authenticated(VALUE self) - - GetCipher(self, ctx); - - #if defined(HAVE_AUTHENTICATED_ENCRYPTION) -- return (EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_FLAG_AEAD_CIPHER) ? Qtrue : Qfalse; -+ return (EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER) ? Qtrue : Qfalse; - #else - return Qfalse; - #endif -@@ -606,7 +606,7 @@ ossl_cipher_get_auth_tag(int argc, VALUE *argv, VALUE self) - - GetCipher(self, ctx); - -- if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_FLAG_AEAD_CIPHER)) -+ if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER)) - ossl_raise(eCipherError, "authentication tag not supported by this cipher"); - - ret = rb_str_new(NULL, tag_len); -@@ -641,7 +641,7 @@ ossl_cipher_set_auth_tag(VALUE self, VALUE vtag) - tag_len = RSTRING_LENINT(vtag); - - GetCipher(self, ctx); -- if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_FLAG_AEAD_CIPHER)) -+ if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER)) - ossl_raise(eCipherError, "authentication tag not supported by this cipher"); - - if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, tag_len, tag)) -@@ -668,7 +668,7 @@ ossl_cipher_set_auth_tag_len(VALUE self, VALUE vlen) - EVP_CIPHER_CTX *ctx; - - GetCipher(self, ctx); -- if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_FLAG_AEAD_CIPHER)) -+ if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER)) - ossl_raise(eCipherError, "AEAD not supported by this cipher"); - - if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, tag_len, NULL)) -@@ -695,7 +695,7 @@ ossl_cipher_set_iv_length(VALUE self, VALUE iv_length) - EVP_CIPHER_CTX *ctx; - - GetCipher(self, ctx); -- if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_FLAG_AEAD_CIPHER)) -+ if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER)) - ossl_raise(eCipherError, "cipher does not support AEAD"); - - if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, len, NULL)) -@@ -786,9 +786,9 @@ ossl_cipher_iv_length(VALUE self) - int len = 0; - - GetCipher(self, ctx); - #if defined(HAVE_AUTHENTICATED_ENCRYPTION) -- if (EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_FLAG_AEAD_CIPHER) -+ if (EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER) - len = (int)(VALUE)EVP_CIPHER_CTX_get_app_data(ctx); - #endif - if (!len) - len = EVP_CIPHER_CTX_iv_length(ctx); -diff --git a/ext/openssl/ossl_engine.c b/ext/openssl/ossl_engine.c -index d69b5dca..5ca0d4ca 100644 ---- a/ext/openssl/ossl_engine.c -+++ b/ext/openssl/ossl_engine.c -@@ -46,13 +46,25 @@ VALUE eEngineError; - /* - * Private - */ --#define OSSL_ENGINE_LOAD_IF_MATCH(x) \ -+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000 -+#define OSSL_ENGINE_LOAD_IF_MATCH(engine_name, x) \ - do{\ -- if(!strcmp(#x, RSTRING_PTR(name))){\ -- ENGINE_load_##x();\ -+ if(!strcmp(#engine_name, RSTRING_PTR(name))){\ -+ if (OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_##x, NULL))\ -+ return Qtrue;\ -+ else\ -+ ossl_raise(eEngineError, "OPENSSL_init_crypto"); \ -+ }\ -+}while(0) -+#else -+#define OSSL_ENGINE_LOAD_IF_MATCH(engine_name, x) \ -+do{\ -+ if(!strcmp(#engine_name, RSTRING_PTR(name))){\ -+ ENGINE_load_##engine_name();\ - return Qtrue;\ - }\ - }while(0) -+#endif - - static void - ossl_engine_free(void *engine) -@@ -94,55 +106,55 @@ ossl_engine_s_load(int argc, VALUE *argv, VALUE klass) - StringValueCStr(name); - #ifndef OPENSSL_NO_STATIC_ENGINE - #if HAVE_ENGINE_LOAD_DYNAMIC -- OSSL_ENGINE_LOAD_IF_MATCH(dynamic); -+ OSSL_ENGINE_LOAD_IF_MATCH(dynamic, DYNAMIC); - #endif - #if HAVE_ENGINE_LOAD_4758CCA -- OSSL_ENGINE_LOAD_IF_MATCH(4758cca); -+ OSSL_ENGINE_LOAD_IF_MATCH(4758cca, 4758CCA); - #endif - #if HAVE_ENGINE_LOAD_AEP -- OSSL_ENGINE_LOAD_IF_MATCH(aep); -+ OSSL_ENGINE_LOAD_IF_MATCH(aep, AEP); - #endif - #if HAVE_ENGINE_LOAD_ATALLA -- OSSL_ENGINE_LOAD_IF_MATCH(atalla); -+ OSSL_ENGINE_LOAD_IF_MATCH(atalla, ATALLA); - #endif - #if HAVE_ENGINE_LOAD_CHIL -- OSSL_ENGINE_LOAD_IF_MATCH(chil); -+ OSSL_ENGINE_LOAD_IF_MATCH(chil, CHIL); - #endif - #if HAVE_ENGINE_LOAD_CSWIFT -- OSSL_ENGINE_LOAD_IF_MATCH(cswift); -+ OSSL_ENGINE_LOAD_IF_MATCH(cswift, CSWIFT); - #endif - #if HAVE_ENGINE_LOAD_NURON -- OSSL_ENGINE_LOAD_IF_MATCH(nuron); -+ OSSL_ENGINE_LOAD_IF_MATCH(nuron, NURON); - #endif - #if HAVE_ENGINE_LOAD_SUREWARE -- OSSL_ENGINE_LOAD_IF_MATCH(sureware); -+ OSSL_ENGINE_LOAD_IF_MATCH(sureware, SUREWARE); - #endif - #if HAVE_ENGINE_LOAD_UBSEC -- OSSL_ENGINE_LOAD_IF_MATCH(ubsec); -+ OSSL_ENGINE_LOAD_IF_MATCH(ubsec, UBSEC); - #endif - #if HAVE_ENGINE_LOAD_PADLOCK -- OSSL_ENGINE_LOAD_IF_MATCH(padlock); -+ OSSL_ENGINE_LOAD_IF_MATCH(padlock, PADLOCK); - #endif - #if HAVE_ENGINE_LOAD_CAPI -- OSSL_ENGINE_LOAD_IF_MATCH(capi); -+ OSSL_ENGINE_LOAD_IF_MATCH(capi, CAPI); - #endif - #if HAVE_ENGINE_LOAD_GMP -- OSSL_ENGINE_LOAD_IF_MATCH(gmp); -+ OSSL_ENGINE_LOAD_IF_MATCH(gmp, GMP); - #endif - #if HAVE_ENGINE_LOAD_GOST -- OSSL_ENGINE_LOAD_IF_MATCH(gost); -+ OSSL_ENGINE_LOAD_IF_MATCH(gost, GOST); - #endif - #if HAVE_ENGINE_LOAD_CRYPTODEV -- OSSL_ENGINE_LOAD_IF_MATCH(cryptodev); -+ OSSL_ENGINE_LOAD_IF_MATCH(cryptodev, CRYPTODEV); - #endif - #if HAVE_ENGINE_LOAD_AESNI -- OSSL_ENGINE_LOAD_IF_MATCH(aesni); -+ OSSL_ENGINE_LOAD_IF_MATCH(aesni, AESNI); - #endif - #endif - #ifdef HAVE_ENGINE_LOAD_OPENBSD_DEV_CRYPTO -- OSSL_ENGINE_LOAD_IF_MATCH(openbsd_dev_crypto); -+ OSSL_ENGINE_LOAD_IF_MATCH(openbsd_dev_crypto, OPENBSD_DEV_CRYPTO); - #endif -- OSSL_ENGINE_LOAD_IF_MATCH(openssl); -+ OSSL_ENGINE_LOAD_IF_MATCH(openssl, OPENSSL); - rb_warning("no such builtin loader for `%"PRIsVALUE"'", name); - return Qnil; - #endif /* HAVE_ENGINE_LOAD_BUILTIN_ENGINES */ -@@ -160,7 +172,9 @@ ossl_engine_s_load(int argc, VALUE *argv, VALUE klass) - static VALUE - ossl_engine_s_cleanup(VALUE self) - { -+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000 - ENGINE_cleanup(); -+#endif - return Qnil; - } - -diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c -index 8e3c0c42..d32a299c 100644 ---- a/ext/openssl/ossl_ssl.c -+++ b/ext/openssl/ossl_ssl.c -@@ -379,7 +379,7 @@ ossl_call_session_get_cb(VALUE ary) - - /* this method is currently only called for servers (in OpenSSL <= 0.9.8e) */ - static SSL_SESSION * --#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) -+#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER) - ossl_sslctx_session_get_cb(SSL *ssl, const unsigned char *buf, int len, int *copy) - #else - ossl_sslctx_session_get_cb(SSL *ssl, unsigned char *buf, int len, int *copy) -diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c -index cf82a53d..8d16b9b7 100644 ---- a/ext/openssl/ossl_x509cert.c -+++ b/ext/openssl/ossl_x509cert.c -@@ -440,7 +440,7 @@ ossl_x509_set_not_before(VALUE self, VALUE time) - - GetX509(self, x509); - asn1time = ossl_x509_time_adjust(NULL, time); -- if (!X509_set_notBefore(x509, asn1time)) { -+ if (!X509_set1_notBefore(x509, asn1time)) { - ASN1_TIME_free(asn1time); - ossl_raise(eX509CertError, "X509_set_notBefore"); - } -@@ -479,7 +479,7 @@ ossl_x509_set_not_after(VALUE self, VALUE time) - - GetX509(self, x509); - asn1time = ossl_x509_time_adjust(NULL, time); -- if (!X509_set_notAfter(x509, asn1time)) { -+ if (!X509_set1_notAfter(x509, asn1time)) { - ASN1_TIME_free(asn1time); - ossl_raise(eX509CertError, "X509_set_notAfter"); - } -diff --git a/ext/openssl/ossl_x509crl.c b/ext/openssl/ossl_x509crl.c -index 5ecd7ea0..45cf7fb4 100644 ---- a/ext/openssl/ossl_x509crl.c -+++ b/ext/openssl/ossl_x509crl.c -@@ -226,7 +226,7 @@ ossl_x509crl_set_last_update(VALUE self, VALUE time) - - GetX509CRL(self, crl); - asn1time = ossl_x509_time_adjust(NULL, time); -- if (!X509_CRL_set_lastUpdate(crl, asn1time)) { -+ if (!X509_CRL_set1_lastUpdate(crl, asn1time)) { - ASN1_TIME_free(asn1time); - ossl_raise(eX509CRLError, "X509_CRL_set_lastUpdate"); - } -@@ -257,7 +257,7 @@ ossl_x509crl_set_next_update(VALUE self, VALUE time) - - GetX509CRL(self, crl); - asn1time = ossl_x509_time_adjust(NULL, time); -- if (!X509_CRL_set_nextUpdate(crl, asn1time)) { -+ if (!X509_CRL_set1_nextUpdate(crl, asn1time)) { - ASN1_TIME_free(asn1time); - ossl_raise(eX509CRLError, "X509_CRL_set_nextUpdate"); - } diff --git a/dev-lang/ruby/files/2.5/001-ia64-update-ia64-specific-code-to-use-execution-cont.patch b/dev-lang/ruby/files/2.5/001-ia64-update-ia64-specific-code-to-use-execution-cont.patch deleted file mode 100644 index 2ade8b8d4203..000000000000 --- a/dev-lang/ruby/files/2.5/001-ia64-update-ia64-specific-code-to-use-execution-cont.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 5af43b1ec2674e9f86090790bc61abdb96be14ff Mon Sep 17 00:00:00 2001 -From: hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> -Date: Tue, 30 Jan 2018 05:43:42 +0000 -Subject: [PATCH] ia64: update ia64-specific code to use execution context - -This change follows commit 837fd5e494731d7d44786f29e7d6e8c27029806f -in '#ifdef __ia64' branches. - -Noticed as a build failure by John Paul Adrian Glaubitz: - -``` - cont.c:502:50: error: 'rb_thread_t {aka struct rb_thread_struct}' - has no member named 'machine' - size = cont->machine.register_stack_size = - th->machine.register_stack_end - th->machine.register_stack_start; - ^~ -``` - -The change is trivial: update 'th->machine' usage to 'th->ec->machine'. -Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - cont.c | 6 +++--- - thread.c | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/cont.c b/cont.c -index f48fd2e52b..93a64f8fe6 100644 ---- a/cont.c -+++ b/cont.c -@@ -475,7 +475,7 @@ cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont) - - SET_MACHINE_STACK_END(&th->ec->machine.stack_end); - #ifdef __ia64 -- th->machine.register_stack_end = rb_ia64_bsp(); -+ th->ec->machine.register_stack_end = rb_ia64_bsp(); - #endif - - if (th->ec->machine.stack_start > th->ec->machine.stack_end) { -@@ -499,8 +499,8 @@ cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont) - - #ifdef __ia64 - rb_ia64_flushrs(); -- size = cont->machine.register_stack_size = th->machine.register_stack_end - th->machine.register_stack_start; -- cont->machine.register_stack_src = th->machine.register_stack_start; -+ size = cont->machine.register_stack_size = th->ec->machine.register_stack_end - th->ec->machine.register_stack_start; -+ cont->machine.register_stack_src = th->ec->machine.register_stack_start; - if (cont->machine.register_stack) { - REALLOC_N(cont->machine.register_stack, VALUE, size); - } -diff --git a/thread.c b/thread.c -index acb53354fd..23957eba09 100644 ---- a/thread.c -+++ b/thread.c -@@ -133,7 +133,7 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio - - #ifdef __ia64 - #define RB_GC_SAVE_MACHINE_REGISTER_STACK(th) \ -- do{(th)->machine.register_stack_end = rb_ia64_bsp();}while(0) -+ do{(th)->ec->machine.register_stack_end = rb_ia64_bsp();}while(0) - #else - #define RB_GC_SAVE_MACHINE_REGISTER_STACK(th) - #endif --- -2.16.1 - diff --git a/dev-lang/ruby/files/2.5/002-autoconf-2.70.patch b/dev-lang/ruby/files/2.5/002-autoconf-2.70.patch deleted file mode 100644 index 576ed6c759bd..000000000000 --- a/dev-lang/ruby/files/2.5/002-autoconf-2.70.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 6160ea5e22ee7353a0814159c94bd3cf890a52ce Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich <slyfox@gentoo.org> -Date: Mon, 16 Nov 2020 08:42:15 +0000 -Subject: [PATCH] configure.ac: fix for upcoming autoconf-2.70 - -The failure initially noticed on `autoconf-2.69d` (soon to become 2.70): - -``` -$ ./configure -./configure: line 8720: syntax error near unexpected token `fi' -./configure: line 8720: `fi' -``` - -Before the change generated `./configure ` snippet looked like: - -``` - if ! $CC -E -xc - <<SRC >/dev/null -then : - - #if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 - #error premature clang - #endif -SRC - as_fn_error $? "clang version 3.0 or later is required" "$LINENO" 5 -fi -``` - -Note the newline that breaks here-document syntax. - -After the change the snippet does not use here-document. - -Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> ---- - configure.ac | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/configure.ac b/configure.ac -index a5e3dc76f6..4e4a52f066 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -271,13 +271,14 @@ AS_CASE(["$host_os:$build_os"], - # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported) - # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn) - # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn) -- AS_IF([! $CC -E -xc - <<SRC >/dev/null], [ -- @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 -- @%:@error premature clang -- @%:@endif --SRC -- AC_MSG_ERROR([clang version 3.0 or later is required]) -- ]) -+ AC_PREPROC_IFELSE( -+ [AC_LANG_PROGRAM([ -+ @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 -+ @%:@error premature clang -+ @%:@endif -+ ])], -+ [], -+ [AC_MSG_ERROR([clang version 3.0 or later is required])]) - ]) - - AS_CASE(["$target_os"], --- -2.29.2 - diff --git a/dev-lang/ruby/files/2.5/005_no-undefined-ext.patch b/dev-lang/ruby/files/2.5/005_no-undefined-ext.patch deleted file mode 100644 index 1f0fdda08da5..000000000000 --- a/dev-lang/ruby/files/2.5/005_no-undefined-ext.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure.ac.~1~ 2017-12-15 10:43:40.000000000 +0100 -+++ b/configure.ac 2017-12-25 11:02:19.099076831 +0100 -@@ -3233,7 +3233,7 @@ - [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu | haiku*], [ - : ${LDSHARED='$(CC) -shared'} - AS_IF([test "$rb_cv_binary_elf" = yes], [ -- LDFLAGS="$LDFLAGS -Wl,-export-dynamic" -+ LDFLAGS="$LDFLAGS -Wl,-export-dynamic -Wl,--no-undefined" - ]) - rb_cv_dlopen=yes], - [interix*], [ : ${LDSHARED='$(CC) -shared'} diff --git a/dev-lang/ruby/files/2.5/009_no-gems.patch b/dev-lang/ruby/files/2.5/009_no-gems.patch deleted file mode 100644 index e12429a43242..000000000000 --- a/dev-lang/ruby/files/2.5/009_no-gems.patch +++ /dev/null @@ -1,95 +0,0 @@ ---- a/tool/rbinstall.rb.~1~ 2017-10-30 06:45:20.000000000 +0100 -+++ b/tool/rbinstall.rb 2017-12-25 11:06:53.340432435 +0100 -@@ -700,20 +700,10 @@ - # :startdoc: - - install?(:ext, :comm, :gem, :'default-gems', :'default-gems-comm') do -- install_default_gem('lib', srcdir) -+ # Gems are unbundled in Gentoo - end - install?(:ext, :arch, :gem, :'default-gems', :'default-gems-arch') do -- install_default_gem('ext', srcdir) do |path| -- # assume that gemspec and extconf.rb are placed in the same directory -- success = false -- begin -- IO.foreach(File.dirname(path[(srcdir.size+1)..-1]) + "/Makefile") do |l| -- break success = true if /^TARGET\s*=/ =~ l -- end -- rescue Errno::ENOENT -- end -- success -- end -+ # Gems are unbundled in Gentoo - end - - def load_gemspec(file) -@@ -765,68 +755,7 @@ - end - - install?(:ext, :comm, :gem, :'bundled-gems') do -- gem_dir = Gem.default_dir -- directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) -- prepare "bundled gems", gem_dir, directories -- install_dir = with_destdir(gem_dir) -- installed_gems = {} -- options = { -- :install_dir => install_dir, -- :bin_dir => with_destdir(bindir), -- :domain => :local, -- :ignore_dependencies => true, -- :dir_mode => $dir_mode, -- :data_mode => $data_mode, -- :prog_mode => $prog_mode, -- :wrappers => true, -- :format_executable => true, -- } -- gem_ext_dir = "#$extout/gems/#{CONFIG['arch']}" -- extensions_dir = Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir -- Gem::Specification.each_gemspec([srcdir+'/gems/*']) do |path| -- spec = load_gemspec(path) -- next unless spec.platform == Gem::Platform::RUBY -- next unless spec.full_name == path[srcdir.size..-1][/\A\/gems\/([^\/]+)/, 1] -- spec.extension_dir = "#{extensions_dir}/#{spec.full_name}" -- if File.directory?(ext = "#{gem_ext_dir}/#{spec.full_name}") -- spec.extensions[0] ||= "-" -- end -- ins = RbInstall::UnpackedInstaller.new(spec, options) -- puts "#{INDENT}#{spec.name} #{spec.version}" -- ins.install -- File.chmod($data_mode, File.join(install_dir, "specifications", "#{spec.full_name}.gemspec")) -- unless spec.extensions.empty? -- install_recursive(ext, spec.extension_dir) -- end -- installed_gems[spec.full_name] = true -- end -- installed_gems, gems = Dir.glob(srcdir+'/gems/*.gem').partition {|gem| installed_gems.key?(File.basename(gem, '.gem'))} -- unless installed_gems.empty? -- install installed_gems, gem_dir+"/cache" -- end -- next if gems.empty? -- if defined?(Zlib) -- Gem.instance_variable_set(:@ruby, with_destdir(File.join(bindir, ruby_install_name))) -- silent = Gem::SilentUI.new -- gems.each do |gem| -- inst = Gem::Installer.new(gem, options) -- inst.spec.extension_dir = with_destdir(inst.spec.extension_dir) -- begin -- Gem::DefaultUserInteraction.use_ui(silent) {inst.install} -- rescue Gem::InstallError => e -- next -- end -- gemname = File.basename(gem) -- puts "#{INDENT}#{gemname}" -- end -- # fix directory permissions -- # TODO: Gem.install should accept :dir_mode option or something -- File.chmod($dir_mode, *Dir.glob(install_dir+"/**/")) -- # fix .gemspec permissions -- File.chmod($data_mode, *Dir.glob(install_dir+"/specifications/*.gemspec")) -- else -- puts "skip installing bundled gems because of lacking zlib" -- end -+ # Gems are unbundled in Gentoo - end - - parse_args() diff --git a/dev-lang/ruby/files/2.5/010-libressl_2.7.patch b/dev-lang/ruby/files/2.5/010-libressl_2.7.patch deleted file mode 100644 index 150f43c9e55d..000000000000 --- a/dev-lang/ruby/files/2.5/010-libressl_2.7.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/ext/openssl/extconf.rb.orig 2018-04-02 09:57:14 UTC -+++ b/ext/openssl/extconf.rb -@@ -122,8 +122,11 @@ OpenSSL.check_func_or_macro("SSL_get_ser - have_func("SSL_is_server") - - # added in 1.1.0 -+if !have_struct_member("SSL", "ctx", "openssl/ssl.h") || -+ try_static_assert("LIBRESSL_VERSION_NUMBER >= 0x2070000fL", "openssl/opensslv.h") -+ $defs.push("-DHAVE_OPAQUE_OPENSSL") -+end - have_func("CRYPTO_lock") || $defs.push("-DHAVE_OPENSSL_110_THREADING_API") --have_struct_member("SSL", "ctx", "openssl/ssl.h") || $defs.push("-DHAVE_OPAQUE_OPENSSL") - have_func("BN_GENCB_new") - have_func("BN_GENCB_free") - have_func("BN_GENCB_get_arg") diff --git a/dev-lang/ruby/files/2.5/011-no-gems.patch b/dev-lang/ruby/files/2.5/011-no-gems.patch deleted file mode 100644 index 2ebe064c8ac6..000000000000 --- a/dev-lang/ruby/files/2.5/011-no-gems.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- a/tool/rbinstall.rb.~1~ 2017-10-30 06:45:20.000000000 +0100 -+++ b/tool/rbinstall.rb 2017-12-25 11:06:53.340432435 +0100 -@@ -700,10 +700,10 @@ - # :startdoc: - - install?(:ext, :comm, :gem, :'default-gems', :'default-gems-comm') do -- install_default_gem('lib', srcdir) -+ # Gems are unbundled in Gentoo - end - install?(:ext, :arch, :gem, :'default-gems', :'default-gems-arch') do -- install_default_gem('ext', srcdir) -+ # Gems are unbundled in Gentoo - end - - def load_gemspec(file) -@@ -765,68 +755,7 @@ - end - - install?(:ext, :comm, :gem, :'bundled-gems') do -- gem_dir = Gem.default_dir -- directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) -- prepare "bundled gems", gem_dir, directories -- install_dir = with_destdir(gem_dir) -- installed_gems = {} -- options = { -- :install_dir => install_dir, -- :bin_dir => with_destdir(bindir), -- :domain => :local, -- :ignore_dependencies => true, -- :dir_mode => $dir_mode, -- :data_mode => $data_mode, -- :prog_mode => $prog_mode, -- :wrappers => true, -- :format_executable => true, -- } -- gem_ext_dir = "#$extout/gems/#{CONFIG['arch']}" -- extensions_dir = Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir -- Gem::Specification.each_gemspec([srcdir+'/gems/*']) do |path| -- spec = load_gemspec(path) -- next unless spec.platform == Gem::Platform::RUBY -- next unless spec.full_name == path[srcdir.size..-1][/\A\/gems\/([^\/]+)/, 1] -- spec.extension_dir = "#{extensions_dir}/#{spec.full_name}" -- if File.directory?(ext = "#{gem_ext_dir}/#{spec.full_name}") -- spec.extensions[0] ||= "-" -- end -- ins = RbInstall::UnpackedInstaller.new(spec, options) -- puts "#{INDENT}#{spec.name} #{spec.version}" -- ins.install -- File.chmod($data_mode, File.join(install_dir, "specifications", "#{spec.full_name}.gemspec")) -- unless spec.extensions.empty? -- install_recursive(ext, spec.extension_dir) -- end -- installed_gems[spec.full_name] = true -- end -- installed_gems, gems = Dir.glob(srcdir+'/gems/*.gem').partition {|gem| installed_gems.key?(File.basename(gem, '.gem'))} -- unless installed_gems.empty? -- install installed_gems, gem_dir+"/cache" -- end -- next if gems.empty? -- if defined?(Zlib) -- Gem.instance_variable_set(:@ruby, with_destdir(File.join(bindir, ruby_install_name))) -- silent = Gem::SilentUI.new -- gems.each do |gem| -- inst = Gem::Installer.new(gem, options) -- inst.spec.extension_dir = with_destdir(inst.spec.extension_dir) -- begin -- Gem::DefaultUserInteraction.use_ui(silent) {inst.install} -- rescue Gem::InstallError => e -- next -- end -- gemname = File.basename(gem) -- puts "#{INDENT}#{gemname}" -- end -- # fix directory permissions -- # TODO: Gem.install should accept :dir_mode option or something -- File.chmod($dir_mode, *Dir.glob(install_dir+"/**/")) -- # fix .gemspec permissions -- File.chmod($data_mode, *Dir.glob(install_dir+"/specifications/*.gemspec")) -- else -- puts "skip installing bundled gems because of lacking zlib" -- end -+ # Gems are unbundled in Gentoo - end - - parse_args() diff --git a/dev-lang/ruby/files/2.6/002-autoconf-2.70.patch b/dev-lang/ruby/files/2.6/002-autoconf-2.70.patch deleted file mode 100644 index 576ed6c759bd..000000000000 --- a/dev-lang/ruby/files/2.6/002-autoconf-2.70.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 6160ea5e22ee7353a0814159c94bd3cf890a52ce Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich <slyfox@gentoo.org> -Date: Mon, 16 Nov 2020 08:42:15 +0000 -Subject: [PATCH] configure.ac: fix for upcoming autoconf-2.70 - -The failure initially noticed on `autoconf-2.69d` (soon to become 2.70): - -``` -$ ./configure -./configure: line 8720: syntax error near unexpected token `fi' -./configure: line 8720: `fi' -``` - -Before the change generated `./configure ` snippet looked like: - -``` - if ! $CC -E -xc - <<SRC >/dev/null -then : - - #if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 - #error premature clang - #endif -SRC - as_fn_error $? "clang version 3.0 or later is required" "$LINENO" 5 -fi -``` - -Note the newline that breaks here-document syntax. - -After the change the snippet does not use here-document. - -Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> ---- - configure.ac | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/configure.ac b/configure.ac -index a5e3dc76f6..4e4a52f066 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -271,13 +271,14 @@ AS_CASE(["$host_os:$build_os"], - # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported) - # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn) - # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn) -- AS_IF([! $CC -E -xc - <<SRC >/dev/null], [ -- @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 -- @%:@error premature clang -- @%:@endif --SRC -- AC_MSG_ERROR([clang version 3.0 or later is required]) -- ]) -+ AC_PREPROC_IFELSE( -+ [AC_LANG_PROGRAM([ -+ @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 -+ @%:@error premature clang -+ @%:@endif -+ ])], -+ [], -+ [AC_MSG_ERROR([clang version 3.0 or later is required])]) - ]) - - AS_CASE(["$target_os"], --- -2.29.2 - diff --git a/dev-lang/ruby/files/2.6/005_no-undefined-ext.patch b/dev-lang/ruby/files/2.6/005_no-undefined-ext.patch deleted file mode 100644 index 1f0fdda08da5..000000000000 --- a/dev-lang/ruby/files/2.6/005_no-undefined-ext.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure.ac.~1~ 2017-12-15 10:43:40.000000000 +0100 -+++ b/configure.ac 2017-12-25 11:02:19.099076831 +0100 -@@ -3233,7 +3233,7 @@ - [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu | haiku*], [ - : ${LDSHARED='$(CC) -shared'} - AS_IF([test "$rb_cv_binary_elf" = yes], [ -- LDFLAGS="$LDFLAGS -Wl,-export-dynamic" -+ LDFLAGS="$LDFLAGS -Wl,-export-dynamic -Wl,--no-undefined" - ]) - rb_cv_dlopen=yes], - [interix*], [ : ${LDSHARED='$(CC) -shared'} diff --git a/dev-lang/ruby/files/2.6/009_no-gems.patch b/dev-lang/ruby/files/2.6/009_no-gems.patch deleted file mode 100644 index f98801d50312..000000000000 --- a/dev-lang/ruby/files/2.6/009_no-gems.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/tool/rbinstall.rb.~1~ 2018-12-27 07:43:59.938638174 +0100 -+++ b/tool/rbinstall.rb 2018-12-27 07:51:09.096382161 +0100 -@@ -723,17 +723,7 @@ - # :startdoc: - - install?(:ext, :arch, :gem, :'default-gems', :'default-gems-arch') do -- install_default_gem('ext', srcdir) do |path| -- # assume that gemspec and extconf.rb are placed in the same directory -- success = false -- begin -- IO.foreach(File.dirname(path[(srcdir.size+1)..-1]) + "/Makefile") do |l| -- break success = true if /^TARGET\s*=/ =~ l -- end -- rescue Errno::ENOENT -- end -- success -- end -+ # Gems are unbundled in Gentoo - end - - def load_gemspec(file) -@@ -743,7 +743,7 @@ - end - - def install_default_gem(dir, srcdir) -- gem_dir = Gem.default_dir -+ gem_dir = ENV['GEM_DESTDIR'] ; puts "gem_dir for default gems = #{gem_dir}" - directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) - prepare "default gems from #{dir}", gem_dir, directories - -@@ -777,7 +777,7 @@ - end - - install?(:ext, :comm, :gem, :'bundled-gems') do -- gem_dir = Gem.default_dir -+ gem_dir = ENV['GEM_DESTDIR'] - directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) - prepare "bundled gems", gem_dir, directories - install_dir = with_destdir(gem_dir) diff --git a/dev-lang/ruby/files/2.6/010-default-gem-location.patch b/dev-lang/ruby/files/2.6/010-default-gem-location.patch deleted file mode 100644 index 7a50c35ff6c9..000000000000 --- a/dev-lang/ruby/files/2.6/010-default-gem-location.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/tool/rbinstall.rb.~1~ 2019-01-24 02:00:07.000000000 +0100 -+++ b/tool/rbinstall.rb 2019-02-03 08:39:49.778007118 +0100 -@@ -806,7 +806,7 @@ - end - - def install_default_gem(dir, srcdir) -- gem_dir = Gem.default_dir -+ gem_dir = ENV['GEM_DESTDIR'] - directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) - prepare "default gems from #{dir}", gem_dir, directories - -@@ -844,7 +844,7 @@ - end - - install?(:ext, :comm, :gem, :'bundled-gems') do -- gem_dir = Gem.default_dir -+ gem_dir = ENV['GEM_DESTDIR'] - directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) - prepare "bundled gems", gem_dir, directories - install_dir = with_destdir(gem_dir) diff --git a/dev-lang/ruby/files/2.7/002-autoconf-2.70.patch b/dev-lang/ruby/files/2.7/002-autoconf-2.70.patch deleted file mode 100644 index bea2bc178dc4..000000000000 --- a/dev-lang/ruby/files/2.7/002-autoconf-2.70.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 6766df2..bc503d6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -177,13 +177,14 @@ AS_CASE(["$host_os:$build_os"], - # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported) - # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn) - # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn) -- AS_IF([! $CC -E -xc - <<SRC >/dev/null], [ -- @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 -- @%:@error premature clang -- @%:@endif --SRC -- AC_MSG_ERROR([clang version 3.0 or later is required]) -- ])], -+ AC_PREPROC_IFELSE( -+ [AC_LANG_PROGRAM([ -+ @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 -+ @%:@error premature clang -+ @%:@endif -+ ])], -+ [], -+ [AC_MSG_ERROR([clang version 3.0 or later is required])])], - [openbsd*:openbsd*], [ - AC_CHECK_TOOLS(CC, [cc]) - ]) diff --git a/dev-lang/ruby/files/2.7/010-default-gem-location.patch b/dev-lang/ruby/files/2.7/010-default-gem-location.patch deleted file mode 100644 index 7a50c35ff6c9..000000000000 --- a/dev-lang/ruby/files/2.7/010-default-gem-location.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/tool/rbinstall.rb.~1~ 2019-01-24 02:00:07.000000000 +0100 -+++ b/tool/rbinstall.rb 2019-02-03 08:39:49.778007118 +0100 -@@ -806,7 +806,7 @@ - end - - def install_default_gem(dir, srcdir) -- gem_dir = Gem.default_dir -+ gem_dir = ENV['GEM_DESTDIR'] - directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) - prepare "default gems from #{dir}", gem_dir, directories - -@@ -844,7 +844,7 @@ - end - - install?(:ext, :comm, :gem, :'bundled-gems') do -- gem_dir = Gem.default_dir -+ gem_dir = ENV['GEM_DESTDIR'] - directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) - prepare "bundled gems", gem_dir, directories - install_dir = with_destdir(gem_dir) diff --git a/dev-lang/ruby/files/3.0/900-musl-coroutine.patch b/dev-lang/ruby/files/3.0/900-musl-coroutine.patch new file mode 100644 index 000000000000..a323cdd6e770 --- /dev/null +++ b/dev-lang/ruby/files/3.0/900-musl-coroutine.patch @@ -0,0 +1,28 @@ +Adapted for Gentoo version 3.0.2 + +From b570e7de87aaad8c903176d835e8124127f627b3 Mon Sep 17 00:00:00 2001 +From: Andrew Aladjev <aladjev.andrew@gmail.com> +Date: Sat, 26 Sep 2020 12:58:06 +0300 +Subject: [PATCH] fixed default coroutine selection for musl + +--- + configure.ac | 5 ++++- + coroutine/copy/Context.c | 2 ++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index ab5d532c103b..084f0936c006 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2364,7 +2364,10 @@ + rb_cv_coroutine=copy + ], + [ +- rb_cv_coroutine=ucontext ++ AC_CHECK_FUNCS([getcontext swapcontext makecontext], ++ [rb_cv_coroutine=ucontext], ++ [rb_cv_coroutine=copy; break] ++ ) + ] + ) + AC_MSG_RESULT(${rb_cv_coroutine}) diff --git a/dev-lang/ruby/files/3.0/901-musl-stacksize.patch b/dev-lang/ruby/files/3.0/901-musl-stacksize.patch new file mode 100644 index 000000000000..e5fcfce2195e --- /dev/null +++ b/dev-lang/ruby/files/3.0/901-musl-stacksize.patch @@ -0,0 +1,26 @@ +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(); + +-#if MAINSTACKADDR_AVAILABLE ++#if MAINSTACKADDR_AVAILABLE && !(defined(__linux__) && !defined(__GLIBC__)) + if (native_main_thread.stack_maxsize) return; + { + 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->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.0/902-hppa-pthread-stack-size.patch b/dev-lang/ruby/files/3.0/902-hppa-pthread-stack-size.patch new file mode 100644 index 000000000000..7978566afc7e --- /dev/null +++ b/dev-lang/ruby/files/3.0/902-hppa-pthread-stack-size.patch @@ -0,0 +1,54 @@ +https://bugs.gentoo.org/701494 + +From 794b6fce94343c4f9dceca5d08224b0fb364fde8 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 +@@ -681,8 +681,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.1/001-socksocket-fix.patch b/dev-lang/ruby/files/3.1/001-socksocket-fix.patch new file mode 100644 index 000000000000..1a79e25491cc --- /dev/null +++ b/dev-lang/ruby/files/3.1/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.1/010-default-gem-location.patch b/dev-lang/ruby/files/3.1/010-default-gem-location.patch new file mode 100644 index 000000000000..039a44b0530b --- /dev/null +++ b/dev-lang/ruby/files/3.1/010-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)}) +@@ -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) + prepare "bundled gems", gem_dir + RbInstall.no_write do diff --git a/dev-lang/ruby/files/3.1/011-default-gem-location.patch b/dev-lang/ruby/files/3.1/011-default-gem-location.patch new file mode 100644 index 000000000000..fe5d33d69c01 --- /dev/null +++ b/dev-lang/ruby/files/3.1/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.1/901-musl-stacksize.patch b/dev-lang/ruby/files/3.1/901-musl-stacksize.patch new file mode 100644 index 000000000000..e5fcfce2195e --- /dev/null +++ b/dev-lang/ruby/files/3.1/901-musl-stacksize.patch @@ -0,0 +1,26 @@ +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(); + +-#if MAINSTACKADDR_AVAILABLE ++#if MAINSTACKADDR_AVAILABLE && !(defined(__linux__) && !defined(__GLIBC__)) + if (native_main_thread.stack_maxsize) return; + { + 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->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.1/902-hppa-pthread-stack-size.patch b/dev-lang/ruby/files/3.1/902-hppa-pthread-stack-size.patch new file mode 100644 index 000000000000..2578ff03c3a6 --- /dev/null +++ b/dev-lang/ruby/files/3.1/902-hppa-pthread-stack-size.patch @@ -0,0 +1,54 @@ +https://bugs.gentoo.org/701494 + +From 91bfb8a5166f4530ce556a11a4b7fb64983b7686 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 +@@ -738,8 +738,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.2/010-default-gem-location.patch b/dev-lang/ruby/files/3.2/010-default-gem-location.patch new file mode 100644 index 000000000000..36009ad66f61 --- /dev/null +++ b/dev-lang/ruby/files/3.2/010-default-gem-location.patch @@ -0,0 +1,11 @@ +--- 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 @@ + 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/011-arm64-branch-protection.patch b/dev-lang/ruby/files/3.2/011-arm64-branch-protection.patch new file mode 100644 index 000000000000..14d2c00837a7 --- /dev/null +++ b/dev-lang/ruby/files/3.2/011-arm64-branch-protection.patch @@ -0,0 +1,28 @@ +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/901-musl-stacksize.patch b/dev-lang/ruby/files/3.2/901-musl-stacksize.patch new file mode 100644 index 000000000000..f18aa271ea65 --- /dev/null +++ b/dev-lang/ruby/files/3.2/901-musl-stacksize.patch @@ -0,0 +1,20 @@ +--- 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 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/files/3.2/902-hppa-pthread-stack-size.patch b/dev-lang/ruby/files/3.2/902-hppa-pthread-stack-size.patch new file mode 100644 index 000000000000..96e24a340ad9 --- /dev/null +++ b/dev-lang/ruby/files/3.2/902-hppa-pthread-stack-size.patch @@ -0,0 +1,54 @@ +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/010-default-gem-location.patch b/dev-lang/ruby/files/3.3/010-default-gem-location.patch new file mode 100644 index 000000000000..36009ad66f61 --- /dev/null +++ b/dev-lang/ruby/files/3.3/010-default-gem-location.patch @@ -0,0 +1,11 @@ +--- 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 @@ + 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.3/011-arm64-branch-protection.patch b/dev-lang/ruby/files/3.3/011-arm64-branch-protection.patch new file mode 100644 index 000000000000..14d2c00837a7 --- /dev/null +++ b/dev-lang/ruby/files/3.3/011-arm64-branch-protection.patch @@ -0,0 +1,28 @@ +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/901-musl-stacksize.patch b/dev-lang/ruby/files/3.3/901-musl-stacksize.patch new file mode 100644 index 000000000000..f18aa271ea65 --- /dev/null +++ b/dev-lang/ruby/files/3.3/901-musl-stacksize.patch @@ -0,0 +1,20 @@ +--- 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 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/files/3.3/902-hppa-pthread-stack-size.patch b/dev-lang/ruby/files/3.3/902-hppa-pthread-stack-size.patch new file mode 100644 index 000000000000..96e24a340ad9 --- /dev/null +++ b/dev-lang/ruby/files/3.3/902-hppa-pthread-stack-size.patch @@ -0,0 +1,54 @@ +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/metadata.xml b/dev-lang/ruby/metadata.xml index 3a5415201c60..cf9a21622439 100644 --- a/dev-lang/ruby/metadata.xml +++ b/dev-lang/ruby/metadata.xml @@ -1,13 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="project"> <email>ruby@gentoo.org</email> <name>Gentoo Ruby Project</name> </maintainer> <use> - <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> + <upstream> + <remote-id type="github">ruby/ruby</remote-id> + </upstream> </pkgmetadata> diff --git a/dev-lang/ruby/ruby-2.5.8-r1.ebuild b/dev-lang/ruby/ruby-2.5.8-r1.ebuild deleted file mode 100644 index 1a4584807865..000000000000 --- a/dev-lang/ruby/ruby-2.5.8-r1.ebuild +++ /dev/null @@ -1,246 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools flag-o-matic multilib - -MY_P="${PN}-$(ver_cut 1-3)" -S=${WORKDIR}/${MY_P} - -SLOT=$(ver_cut 1-2) -MY_SUFFIX=$(ver_rs 1 '' ${SLOT}) -RUBYVERSION=${SLOT}.0 - -DESCRIPTION="An object-oriented scripting language" -HOMEPAGE="https://www.ruby-lang.org/" -SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" - -LICENSE="|| ( Ruby-BSD BSD-2 )" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="berkdb debug doc examples gdbm ipv6 jemalloc libressl +rdoc rubytests socks5 +ssl static-libs systemtap tk xemacs" - -RDEPEND=" - berkdb? ( sys-libs/db:= ) - gdbm? ( sys-libs/gdbm:= ) - jemalloc? ( dev-libs/jemalloc ) - ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl ) - ) - socks5? ( >=net-proxy/dante-1.1.13 ) - systemtap? ( dev-util/systemtap ) - tk? ( - dev-lang/tcl:0=[threads] - dev-lang/tk:0=[threads] - ) - dev-libs/libyaml - dev-libs/libffi:= - sys-libs/readline:0= - sys-libs/zlib - >=app-eselect/eselect-ruby-20171225 -" - -DEPEND="${RDEPEND}" - -BUNDLED_GEMS=" - >=dev-ruby/did_you_mean-1.2.0:2.5[ruby_targets_ruby25] - >=dev-ruby/minitest-5.10.3[ruby_targets_ruby25] - >=dev-ruby/net-telnet-0.1.1[ruby_targets_ruby25] - >=dev-ruby/power_assert-1.1.1[ruby_targets_ruby25] - >=dev-ruby/rake-12.3.0[ruby_targets_ruby25] - >=dev-ruby/test-unit-3.2.7[ruby_targets_ruby25] - >=dev-ruby/xmlrpc-0.3.0[ruby_targets_ruby25] -" - -PDEPEND=" - ${BUNDLED_GEMS} - virtual/rubygems[ruby_targets_ruby25] - >=dev-ruby/json-2.0.2[ruby_targets_ruby25] - rdoc? ( >=dev-ruby/rdoc-6.1.2[ruby_targets_ruby25] ) - xemacs? ( app-xemacs/ruby-modes )" - -src_prepare() { - eapply "${FILESDIR}"/${SLOT}/{001,002,005,011}*.patch - - einfo "Unbundling gems..." - cd "$S" - # Remove bundled gems that we will install via PDEPEND, bug - # 539700. Use explicit version numbers to ensure rm fails when they - # change so we can update dependencies accordingly. - rm -f gems/{did_you_mean-1.2.0,minitest-5.10.3,net-telnet-0.1.1,power_assert-1.1.1,rake-12.3.0,test-unit-3.2.7,xmlrpc-0.3.0}.gem || die - - einfo "Removing bundled libraries..." - rm -fr ext/fiddle/libffi-3.2.1 || 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 - fi - fi - - eapply_user - - eautoreconf -} - -src_configure() { - local modules= myconf= - - # -fomit-frame-pointer makes ruby segfault, see bug #150413. - filter-flags -fomit-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 - - # Socks support via dante - if use socks5 ; then - # Socks support can't be disabled as long as SOCKS_SERVER is - # set and socks library is present, so need to unset - # SOCKS_SERVER in that case. - unset SOCKS_SERVER - fi - - # Increase GC_MALLOC_LIMIT if set (default is 8000000) - if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then - append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}" - fi - - # ipv6 hack, bug 168939. Needs --enable-ipv6. - use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET" - - # Determine which modules *not* to build depending in the USE flags. - if ! use berkdb ; then - modules="${modules},dbm" - fi - if ! use gdbm ; then - modules="${modules},gdbm" - fi - if ! use ssl ; then - modules="${modules},openssl" - fi - if ! use tk ; then - modules="${modules},tk" - fi - - # Provide an empty LIBPATHENV because we disable rpath but we do not - # need LD_LIBRARY_PATH by default since that breaks USE=multitarget - # #564272 - 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 \ - --with-out-ext="${modules}" \ - $(use_with jemalloc jemalloc) \ - $(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} \ - --enable-option-checking=no -} - -src_compile() { - emake V=1 EXTLDFLAGS="${LDFLAGS}" -} - -src_test() { - emake -j1 V=1 test - - elog "Ruby's make test has been run. Ruby also ships with a make check" - elog "that cannot be run until after ruby has been installed." - elog - if use rubytests; then - elog "You have enabled rubytests, so they will be installed to" - elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other" - elog "than root, and you must place them into a writeable directory." - elog "Then call: " - elog - elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb" - else - elog "Enable the rubytests USE flag to install the make check tests" - fi -} - -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. - rm -rf ext/json || 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) - - 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" - done - export LD_LIBRARY_PATH RUBYLIB - - emake V=1 DESTDIR="${D}" 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/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed" - - if use doc; then - make DESTDIR="${D}" install-doc || die "make install-doc failed" - fi - - if use examples; then - dodoc -r sample - fi - - dodoc ChangeLog NEWS doc/NEWS* README* - - if use rubytests; then - pushd test - insinto /usr/share/${PN}-${SLOT}/test - doins -r . - popd - fi -} - -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(23|24|...)" - elog -} - -pkg_postrm() { - eselect ruby cleanup -} diff --git a/dev-lang/ruby/ruby-2.5.8.ebuild b/dev-lang/ruby/ruby-2.5.8.ebuild deleted file mode 100644 index e722111acf8c..000000000000 --- a/dev-lang/ruby/ruby-2.5.8.ebuild +++ /dev/null @@ -1,220 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools flag-o-matic multilib - -MY_P="${PN}-$(ver_cut 1-3)" -S=${WORKDIR}/${MY_P} - -SLOT=$(ver_cut 1-2) -MY_SUFFIX=$(ver_rs 1 '' ${SLOT}) -RUBYVERSION=${SLOT}.0 - -DESCRIPTION="An object-oriented scripting language" -HOMEPAGE="https://www.ruby-lang.org/" -SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" - -LICENSE="|| ( Ruby-BSD BSD-2 )" -KEYWORDS="~alpha amd64 arm arm64 hppa ~mips ppc ppc64 s390 sparc x86" -IUSE="berkdb debug doc examples gdbm ipv6 jemalloc libressl +rdoc rubytests socks5 +ssl static-libs tk xemacs" - -RDEPEND=" - berkdb? ( sys-libs/db:= ) - gdbm? ( sys-libs/gdbm:= ) - jemalloc? ( dev-libs/jemalloc ) - ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl ) - ) - socks5? ( >=net-proxy/dante-1.1.13 ) - tk? ( - dev-lang/tcl:0=[threads] - dev-lang/tk:0=[threads] - ) - dev-libs/libyaml - dev-libs/libffi:= - sys-libs/readline:0= - sys-libs/zlib - >=app-eselect/eselect-ruby-20171225 -" - -DEPEND="${RDEPEND}" - -BUNDLED_GEMS=" - >=dev-ruby/did_you_mean-1.2.0:2.5[ruby_targets_ruby25] - >=dev-ruby/minitest-5.10.3[ruby_targets_ruby25] - >=dev-ruby/net-telnet-0.1.1[ruby_targets_ruby25] - >=dev-ruby/power_assert-1.1.1[ruby_targets_ruby25] - >=dev-ruby/rake-12.3.0[ruby_targets_ruby25] - >=dev-ruby/test-unit-3.2.7[ruby_targets_ruby25] - >=dev-ruby/xmlrpc-0.3.0[ruby_targets_ruby25] -" - -PDEPEND=" - ${BUNDLED_GEMS} - virtual/rubygems[ruby_targets_ruby25] - >=dev-ruby/json-2.0.2[ruby_targets_ruby25] - rdoc? ( >=dev-ruby/rdoc-6.1.2[ruby_targets_ruby25] ) - xemacs? ( app-xemacs/ruby-modes )" - -src_prepare() { - eapply "${FILESDIR}"/${SLOT}/{001,005,011}*.patch - - einfo "Unbundling gems..." - cd "$S" - # Remove bundled gems that we will install via PDEPEND, bug - # 539700. Use explicit version numbers to ensure rm fails when they - # change so we can update dependencies accordingly. - rm -f gems/{did_you_mean-1.2.0,minitest-5.10.3,net-telnet-0.1.1,power_assert-1.1.1,rake-12.3.0,test-unit-3.2.7,xmlrpc-0.3.0}.gem || die - - einfo "Removing bundled libraries..." - rm -fr ext/fiddle/libffi-3.2.1 || die - - eapply_user - - eautoreconf -} - -src_configure() { - local modules= myconf= - - # -fomit-frame-pointer makes ruby segfault, see bug #150413. - filter-flags -fomit-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 - - # Socks support via dante - if use socks5 ; then - # Socks support can't be disabled as long as SOCKS_SERVER is - # set and socks library is present, so need to unset - # SOCKS_SERVER in that case. - unset SOCKS_SERVER - fi - - # Increase GC_MALLOC_LIMIT if set (default is 8000000) - if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then - append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}" - fi - - # ipv6 hack, bug 168939. Needs --enable-ipv6. - use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET" - - # Determine which modules *not* to build depending in the USE flags. - if ! use berkdb ; then - modules="${modules},dbm" - fi - if ! use gdbm ; then - modules="${modules},gdbm" - fi - if ! use ssl ; then - modules="${modules},openssl" - fi - if ! use tk ; then - modules="${modules},tk" - fi - - # Provide an empty LIBPATHENV because we disable rpath but we do not - # need LD_LIBRARY_PATH by default since that breaks USE=multitarget - # #564272 - INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \ - --program-suffix=${MY_SUFFIX} \ - --with-soname=ruby${MY_SUFFIX} \ - --enable-shared \ - --enable-pthread \ - --disable-rpath \ - --with-out-ext="${modules}" \ - $(use_with jemalloc jemalloc) \ - $(use_enable socks5 socks) \ - $(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} \ - --enable-option-checking=no -} - -src_compile() { - emake V=1 EXTLDFLAGS="${LDFLAGS}" -} - -src_test() { - emake -j1 V=1 test - - elog "Ruby's make test has been run. Ruby also ships with a make check" - elog "that cannot be run until after ruby has been installed." - elog - if use rubytests; then - elog "You have enabled rubytests, so they will be installed to" - elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other" - elog "than root, and you must place them into a writeable directory." - elog "Then call: " - elog - elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb" - else - elog "Enable the rubytests USE flag to install the make check tests" - fi -} - -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. - rm -rf ext/json || 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) - - LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" - 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 - - emake V=1 DESTDIR="${D}" 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/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed" - - if use doc; then - make DESTDIR="${D}" install-doc || die "make install-doc failed" - fi - - if use examples; then - dodoc -r sample - fi - - dodoc ChangeLog NEWS doc/NEWS* README* - - if use rubytests; then - pushd test - insinto /usr/share/${PN}-${SLOT}/test - doins -r . - popd - fi -} - -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(23|24|...)" - elog -} - -pkg_postrm() { - eselect ruby cleanup -} diff --git a/dev-lang/ruby/ruby-3.0.0.ebuild b/dev-lang/ruby/ruby-3.1.4-r3.ebuild index bd5074777ec7..49032262514a 100644 --- a/dev-lang/ruby/ruby-3.0.0.ebuild +++ b/dev-lang/ruby/ruby-3.1.4-r3.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -inherit autotools flag-o-matic multilib +inherit autotools flag-o-matic multiprocessing MY_P="${PN}-$(ver_cut 1-3)" S=${WORKDIR}/${MY_P} @@ -17,20 +17,19 @@ 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 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit libressl +rdoc rubytests socks5 +ssl static-libs systemtap tk 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 +rdoc socks5 +ssl static-libs systemtap tk valgrind xemacs" RDEPEND=" berkdb? ( sys-libs/db:= ) gdbm? ( sys-libs/gdbm:= ) - jemalloc? ( dev-libs/jemalloc ) + jemalloc? ( dev-libs/jemalloc:= ) jit? ( || ( sys-devel/gcc:* sys-devel/clang:* ) ) ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl ) + dev-libs/openssl:0= ) socks5? ( >=net-proxy/dante-1.1.13 ) - systemtap? ( dev-util/systemtap ) + systemtap? ( dev-debug/systemtap ) tk? ( dev-lang/tcl:0=[threads] dev-lang/tk:0=[threads] @@ -39,33 +38,43 @@ RDEPEND=" dev-libs/libffi:= sys-libs/readline:0= sys-libs/zlib + virtual/libcrypt:= >=app-eselect/eselect-ruby-20201225 " -DEPEND="${RDEPEND}" +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" BUNDLED_GEMS=" - >=dev-ruby/minitest-5.14.2[ruby_targets_ruby30] - >=dev-ruby/power_assert-1.2.0[ruby_targets_ruby30] - >=dev-ruby/rake-13.0.3[ruby_targets_ruby30] - >=dev-ruby/rbs-1.0.0[ruby_targets_ruby30] - >=dev-ruby/rexml-3.2.4[ruby_targets_ruby30] - >=dev-ruby/rss-0.2.9[ruby_targets_ruby30] - >=dev-ruby/test-unit-3.3.7[ruby_targets_ruby30] - >=dev-ruby/typeprof-0.11.0[ruby_targets_ruby30] + >=dev-ruby/minitest-5.15.0[ruby_targets_ruby31(-)] + >=dev-ruby/power_assert-2.0.1[ruby_targets_ruby31(-)] + >=dev-ruby/rake-13.0.6-r2[ruby_targets_ruby31(-)] + >=dev-ruby/rbs-2.1.0[ruby_targets_ruby31(-)] + >=dev-ruby/rexml-3.2.5[ruby_targets_ruby31(-)] + >=dev-ruby/rss-0.2.9[ruby_targets_ruby31(-)] + >=dev-ruby/test-unit-3.5.3[ruby_targets_ruby31(-)] + >=dev-ruby/typeprof-0.12.2[ruby_targets_ruby31(-)] " PDEPEND=" ${BUNDLED_GEMS} - virtual/rubygems[ruby_targets_ruby30] - >=dev-ruby/bundler-2.1.4[ruby_targets_ruby30] - >=dev-ruby/did_you_mean-1.5.0[ruby_targets_ruby30] - >=dev-ruby/json-2.5.1[ruby_targets_ruby30] - rdoc? ( >=dev-ruby/rdoc-6.3.0[ruby_targets_ruby30] ) - xemacs? ( app-xemacs/ruby-modes )" + virtual/rubygems[ruby_targets_ruby31(-)] + >=dev-ruby/bundler-2.3.3[ruby_targets_ruby31(-)] + >=dev-ruby/did_you_mean-1.6.1[ruby_targets_ruby31(-)] + >=dev-ruby/json-2.6.1[ruby_targets_ruby31(-)] + rdoc? ( >=dev-ruby/rdoc-6.3.3[ruby_targets_ruby31(-)] ) + xemacs? ( app-xemacs/ruby-modes ) +" src_prepare() { - eapply "${FILESDIR}"/"${SLOT}"/010*.patch + eapply "${FILESDIR}"/"${SLOT}"/011*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/3.1/901-musl-*.patch + fi einfo "Unbundling gems..." cd "$S" @@ -80,6 +89,12 @@ src_prepare() { einfo "Removing bundled libraries..." rm -fr ext/fiddle/libffi-3.2.1 || die + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb test/resolv/test_addr.rb \ + spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die + sed -i -e '/def test_test/askip "Depends on system setup"' test/ruby/test_file_exhaustive.rb || die + if use prefix ; then # Fix hardcoded SHELL var in mkmf library sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die @@ -94,6 +109,11 @@ src_prepare() { 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 @@ -103,7 +123,16 @@ src_prepare() { } src_configure() { - local modules= myconf= + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" # -fomit-frame-pointer makes ruby segfault, see bug #150413. filter-flags -fomit-frame-pointer @@ -151,6 +180,9 @@ src_configure() { --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 ) \ @@ -162,6 +194,7 @@ src_configure() { $(use_enable static-libs install-static-library) \ $(use_with static-libs static-linked-ext) \ $(use_enable debug) \ + $(use_with valgrind) \ ${myconf} \ --enable-option-checking=no @@ -174,28 +207,14 @@ src_compile() { } src_test() { - emake -j1 V=1 test - - elog "Ruby's make test has been run. Ruby also ships with a make check" - elog "that cannot be run until after ruby has been installed." - elog - if use rubytests; then - elog "You have enabled rubytests, so they will be installed to" - elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other" - elog "than root, and you must place them into a writeable directory." - elog "Then call: " - elog - elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb" - else - elog "Enable the rubytests USE flag to install the make check tests" - fi + 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. - rm -rf ext/json || die + 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. @@ -203,18 +222,16 @@ src_install() { 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}" + local -x 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 + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" fi - RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" + local -x 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}" @@ -237,13 +254,6 @@ src_install() { fi dodoc ChangeLog NEWS.md doc/NEWS* README* - - if use rubytests; then - pushd test - insinto /usr/share/${PN}-${SLOT}/test - doins -r . - popd - fi } pkg_postinst() { @@ -253,7 +263,7 @@ pkg_postinst() { elog elog "To switch between available Ruby profiles, execute as root:" - elog "\teselect ruby set ruby(23|24|...)" + elog "\teselect ruby set ruby(30|31|...)" elog } diff --git a/dev-lang/ruby/ruby-3.0.0-r1.ebuild b/dev-lang/ruby/ruby-3.1.4-r5.ebuild index 5653275879f3..bad6e20d9e3b 100644 --- a/dev-lang/ruby/ruby-3.0.0-r1.ebuild +++ b/dev-lang/ruby/ruby-3.1.4-r5.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -inherit autotools flag-o-matic multilib +inherit autotools flag-o-matic multiprocessing MY_P="${PN}-$(ver_cut 1-3)" S=${WORKDIR}/${MY_P} @@ -17,20 +17,19 @@ 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 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit libressl +rdoc rubytests socks5 +ssl static-libs systemtap tk 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 socks5 +ssl static-libs systemtap tk valgrind xemacs" RDEPEND=" berkdb? ( sys-libs/db:= ) gdbm? ( sys-libs/gdbm:= ) - jemalloc? ( dev-libs/jemalloc ) + jemalloc? ( dev-libs/jemalloc:= ) jit? ( || ( sys-devel/gcc:* sys-devel/clang:* ) ) ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl ) + dev-libs/openssl:0= ) socks5? ( >=net-proxy/dante-1.1.13 ) - systemtap? ( dev-util/systemtap ) + systemtap? ( dev-debug/systemtap ) tk? ( dev-lang/tcl:0=[threads] dev-lang/tk:0=[threads] @@ -39,33 +38,44 @@ RDEPEND=" dev-libs/libffi:= sys-libs/readline:0= sys-libs/zlib - >=app-eselect/eselect-ruby-20201225 + virtual/libcrypt:= + >=app-eselect/eselect-ruby-20231008 " -DEPEND="${RDEPEND}" +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" BUNDLED_GEMS=" - >=dev-ruby/minitest-5.14.2[ruby_targets_ruby30] - >=dev-ruby/power_assert-1.2.0[ruby_targets_ruby30] - >=dev-ruby/rake-13.0.3[ruby_targets_ruby30] - >=dev-ruby/rbs-1.0.0[ruby_targets_ruby30] - >=dev-ruby/rexml-3.2.4[ruby_targets_ruby30] - >=dev-ruby/rss-0.2.9[ruby_targets_ruby30] - >=dev-ruby/test-unit-3.3.7[ruby_targets_ruby30] - >=dev-ruby/typeprof-0.11.0[ruby_targets_ruby30] + >=dev-ruby/irb-1.4.1[ruby_targets_ruby31(-)] + >=dev-ruby/minitest-5.15.0[ruby_targets_ruby31(-)] + >=dev-ruby/power_assert-2.0.1[ruby_targets_ruby31(-)] + >=dev-ruby/rake-13.0.6-r2[ruby_targets_ruby31(-)] + >=dev-ruby/rbs-2.1.0[ruby_targets_ruby31(-)] + >=dev-ruby/rexml-3.2.5[ruby_targets_ruby31(-)] + >=dev-ruby/rss-0.2.9[ruby_targets_ruby31(-)] + >=dev-ruby/test-unit-3.5.3[ruby_targets_ruby31(-)] + >=dev-ruby/typeprof-0.12.2[ruby_targets_ruby31(-)] " PDEPEND=" ${BUNDLED_GEMS} - virtual/rubygems[ruby_targets_ruby30] - >=dev-ruby/bundler-2.1.4[ruby_targets_ruby30] - >=dev-ruby/did_you_mean-1.5.0[ruby_targets_ruby30] - >=dev-ruby/json-2.5.1[ruby_targets_ruby30] - rdoc? ( >=dev-ruby/rdoc-6.3.0[ruby_targets_ruby30] ) - xemacs? ( app-xemacs/ruby-modes )" + virtual/rubygems[ruby_targets_ruby31(-)] + >=dev-ruby/bundler-2.3.3[ruby_targets_ruby31(-)] + >=dev-ruby/did_you_mean-1.6.1[ruby_targets_ruby31(-)] + >=dev-ruby/json-2.6.1[ruby_targets_ruby31(-)] + >=dev-ruby/rdoc-6.3.3[ruby_targets_ruby31(-)] + xemacs? ( app-xemacs/ruby-modes ) +" src_prepare() { - eapply "${FILESDIR}"/"${SLOT}"/{001,010}*.patch + eapply "${FILESDIR}"/"${SLOT}"/011*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/3.1/901-musl-*.patch + fi einfo "Unbundling gems..." cd "$S" @@ -80,6 +90,15 @@ src_prepare() { einfo "Removing bundled libraries..." rm -fr ext/fiddle/libffi-3.2.1 || die + # Remove webrick tests because setting LD_LIBRARY_PATH does not work for them. + rm -rf tool/test/webrick || die + + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb test/resolv/test_addr.rb \ + spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die + sed -i -e '/def test_test/askip "Depends on system setup"' test/ruby/test_file_exhaustive.rb || die + if use prefix ; then # Fix hardcoded SHELL var in mkmf library sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die @@ -94,6 +113,11 @@ src_prepare() { 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 @@ -103,7 +127,16 @@ src_prepare() { } src_configure() { - local modules= myconf= + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" # -fomit-frame-pointer makes ruby segfault, see bug #150413. filter-flags -fomit-frame-pointer @@ -151,6 +184,9 @@ src_configure() { --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 ) \ @@ -162,6 +198,7 @@ src_configure() { $(use_enable static-libs install-static-library) \ $(use_with static-libs static-linked-ext) \ $(use_enable debug) \ + $(use_with valgrind) \ ${myconf} \ --enable-option-checking=no @@ -174,28 +211,14 @@ src_compile() { } src_test() { - emake -j1 V=1 test - - elog "Ruby's make test has been run. Ruby also ships with a make check" - elog "that cannot be run until after ruby has been installed." - elog - if use rubytests; then - elog "You have enabled rubytests, so they will be installed to" - elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other" - elog "than root, and you must place them into a writeable directory." - elog "Then call: " - elog - elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb" - else - elog "Enable the rubytests USE flag to install the make check tests" - fi + 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. - rm -rf ext/json || die + 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. @@ -203,18 +226,16 @@ src_install() { 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}" + local -x 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 + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" fi - RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" + local -x 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}" @@ -237,13 +258,6 @@ src_install() { fi dodoc ChangeLog NEWS.md doc/NEWS* README* - - if use rubytests; then - pushd test - insinto /usr/share/${PN}-${SLOT}/test - doins -r . - popd - fi } pkg_postinst() { @@ -253,7 +267,7 @@ pkg_postinst() { elog elog "To switch between available Ruby profiles, execute as root:" - elog "\teselect ruby set ruby(23|24|...)" + elog "\teselect ruby set ruby(30|31|...)" elog } diff --git a/dev-lang/ruby/ruby-2.7.2.ebuild b/dev-lang/ruby/ruby-3.1.5.ebuild index 138024506971..8f3d74c898fc 100644 --- a/dev-lang/ruby/ruby-2.7.2.ebuild +++ b/dev-lang/ruby/ruby-3.1.5.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -inherit autotools flag-o-matic multilib +inherit autotools flag-o-matic multiprocessing MY_P="${PN}-$(ver_cut 1-3)" S=${WORKDIR}/${MY_P} @@ -17,20 +17,19 @@ 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 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit libressl +rdoc rubytests socks5 +ssl static-libs systemtap tk 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 socks5 +ssl static-libs systemtap tk valgrind xemacs" RDEPEND=" berkdb? ( sys-libs/db:= ) gdbm? ( sys-libs/gdbm:= ) - jemalloc? ( dev-libs/jemalloc ) + jemalloc? ( dev-libs/jemalloc:= ) jit? ( || ( sys-devel/gcc:* sys-devel/clang:* ) ) ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl ) + dev-libs/openssl:0= ) socks5? ( >=net-proxy/dante-1.1.13 ) - systemtap? ( dev-util/systemtap ) + systemtap? ( dev-debug/systemtap ) tk? ( dev-lang/tcl:0=[threads] dev-lang/tk:0=[threads] @@ -39,39 +38,51 @@ RDEPEND=" dev-libs/libffi:= sys-libs/readline:0= sys-libs/zlib - >=app-eselect/eselect-ruby-20191222 + virtual/libcrypt:= + >=app-eselect/eselect-ruby-20231008 " -DEPEND="${RDEPEND}" +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" BUNDLED_GEMS=" - >=dev-ruby/minitest-5.13.0[ruby_targets_ruby27] - >=dev-ruby/net-telnet-0.2.0[ruby_targets_ruby27] - >=dev-ruby/power_assert-1.1.7[ruby_targets_ruby27] - >=dev-ruby/rake-13.0.1[ruby_targets_ruby27] - >=dev-ruby/test-unit-3.3.4[ruby_targets_ruby27] - >=dev-ruby/xmlrpc-0.3.0[ruby_targets_ruby27] + >=dev-ruby/irb-1.4.1[ruby_targets_ruby31(-)] + >=dev-ruby/minitest-5.15.0[ruby_targets_ruby31(-)] + >=dev-ruby/power_assert-2.0.1[ruby_targets_ruby31(-)] + >=dev-ruby/rake-13.0.6-r2[ruby_targets_ruby31(-)] + >=dev-ruby/rbs-2.1.0[ruby_targets_ruby31(-)] + >=dev-ruby/rexml-3.2.5[ruby_targets_ruby31(-)] + >=dev-ruby/rss-0.2.9[ruby_targets_ruby31(-)] + >=dev-ruby/test-unit-3.5.3[ruby_targets_ruby31(-)] + >=dev-ruby/typeprof-0.12.2[ruby_targets_ruby31(-)] " PDEPEND=" ${BUNDLED_GEMS} - virtual/rubygems[ruby_targets_ruby27] - >=dev-ruby/bundler-2.1.4[ruby_targets_ruby27] - >=dev-ruby/did_you_mean-1.3.1[ruby_targets_ruby27] - >=dev-ruby/json-2.0.2[ruby_targets_ruby27] - rdoc? ( >=dev-ruby/rdoc-6.1.2[ruby_targets_ruby27] ) - xemacs? ( app-xemacs/ruby-modes )" + virtual/rubygems[ruby_targets_ruby31(-)] + >=dev-ruby/bundler-2.3.3[ruby_targets_ruby31(-)] + >=dev-ruby/did_you_mean-1.6.1[ruby_targets_ruby31(-)] + >=dev-ruby/json-2.6.1[ruby_targets_ruby31(-)] + >=dev-ruby/rdoc-6.3.3[ruby_targets_ruby31(-)] + xemacs? ( app-xemacs/ruby-modes ) +" src_prepare() { - # 005 does not compile bigdecimal and is questionable because it - # compiles ruby in a non-standard way, may be dropped - eapply "${FILESDIR}"/2.7/{002,010}*.patch + eapply "${FILESDIR}"/"${SLOT}"/011*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/3.1/901-musl-*.patch + fi einfo "Unbundling gems..." cd "$S" # Remove bundled gems that we will install via PDEPEND, bug # 539700. rm -fr gems/* || die + touch gems/bundled_gems || die # Don't install CLI tools since they will clash with the gem rm -f bin/{racc,racc2y,y2racc} || die sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die @@ -79,6 +90,18 @@ src_prepare() { einfo "Removing bundled libraries..." rm -fr ext/fiddle/libffi-3.2.1 || die + # Remove webrick tests because setting LD_LIBRARY_PATH does not work for them. + rm -rf tool/test/webrick || die + + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb test/resolv/test_addr.rb \ + spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die + sed -i -e '/def test_test/askip "Depends on system setup"' test/ruby/test_file_exhaustive.rb || die + + # MJIT is broken and removed in later ruby versions. + rm -f test/ruby/test_jit.rb || die + if use prefix ; then # Fix hardcoded SHELL var in mkmf library sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die @@ -93,6 +116,11 @@ src_prepare() { 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 @@ -102,7 +130,16 @@ src_prepare() { } src_configure() { - local modules= myconf= + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" # -fomit-frame-pointer makes ruby segfault, see bug #150413. filter-flags -fomit-frame-pointer @@ -150,6 +187,9 @@ src_configure() { --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 ) \ @@ -161,6 +201,7 @@ src_configure() { $(use_enable static-libs install-static-library) \ $(use_with static-libs static-linked-ext) \ $(use_enable debug) \ + $(use_with valgrind) \ ${myconf} \ --enable-option-checking=no @@ -173,28 +214,14 @@ src_compile() { } src_test() { - emake -j1 V=1 test - - elog "Ruby's make test has been run. Ruby also ships with a make check" - elog "that cannot be run until after ruby has been installed." - elog - if use rubytests; then - elog "You have enabled rubytests, so they will be installed to" - elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other" - elog "than root, and you must place them into a writeable directory." - elog "Then call: " - elog - elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb" - else - elog "Enable the rubytests USE flag to install the make check tests" - fi + 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. - rm -rf ext/json || die + 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. @@ -202,18 +229,16 @@ src_install() { 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}" + local -x 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 + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" fi - RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" + local -x 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}" @@ -235,14 +260,7 @@ src_install() { dodoc -r sample fi - dodoc ChangeLog NEWS doc/NEWS* README* - - if use rubytests; then - pushd test - insinto /usr/share/${PN}-${SLOT}/test - doins -r . - popd - fi + dodoc ChangeLog NEWS.md doc/NEWS* README* } pkg_postinst() { @@ -252,7 +270,7 @@ pkg_postinst() { elog elog "To switch between available Ruby profiles, execute as root:" - elog "\teselect ruby set ruby(23|24|...)" + elog "\teselect ruby set ruby(30|31|...)" elog } diff --git a/dev-lang/ruby/ruby-2.6.6-r2.ebuild b/dev-lang/ruby/ruby-3.1.6.ebuild index 795321234d25..a14fd90dfe78 100644 --- a/dev-lang/ruby/ruby-2.6.6-r2.ebuild +++ b/dev-lang/ruby/ruby-3.1.6.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -inherit autotools flag-o-matic multilib +inherit autotools flag-o-matic multiprocessing MY_P="${PN}-$(ver_cut 1-3)" S=${WORKDIR}/${MY_P} @@ -17,20 +17,19 @@ 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 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit libressl +rdoc rubytests socks5 +ssl static-libs systemtap tk 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 socks5 +ssl static-libs systemtap tk valgrind xemacs" RDEPEND=" berkdb? ( sys-libs/db:= ) gdbm? ( sys-libs/gdbm:= ) - jemalloc? ( dev-libs/jemalloc ) + jemalloc? ( dev-libs/jemalloc:= ) jit? ( || ( sys-devel/gcc:* sys-devel/clang:* ) ) ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl ) + dev-libs/openssl:0= ) socks5? ( >=net-proxy/dante-1.1.13 ) - systemtap? ( dev-util/systemtap ) + systemtap? ( dev-debug/systemtap ) tk? ( dev-lang/tcl:0=[threads] dev-lang/tk:0=[threads] @@ -39,43 +38,75 @@ RDEPEND=" dev-libs/libffi:= sys-libs/readline:0= sys-libs/zlib - >=app-eselect/eselect-ruby-20181225 + virtual/libcrypt:= + >=app-eselect/eselect-ruby-20231008 " -DEPEND="${RDEPEND}" +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" BUNDLED_GEMS=" - >=dev-ruby/did_you_mean-1.2.1[ruby_targets_ruby26] - >=dev-ruby/minitest-5.11.3[ruby_targets_ruby26] - >=dev-ruby/net-telnet-0.2.0[ruby_targets_ruby26] - >=dev-ruby/power_assert-1.1.3[ruby_targets_ruby26] - >=dev-ruby/rake-12.3.2[ruby_targets_ruby26] - >=dev-ruby/test-unit-3.2.9[ruby_targets_ruby26] - >=dev-ruby/xmlrpc-0.3.0[ruby_targets_ruby26] + >=dev-ruby/irb-1.4.1[ruby_targets_ruby31(-)] + >=dev-ruby/minitest-5.15.0[ruby_targets_ruby31(-)] + >=dev-ruby/power_assert-2.0.1[ruby_targets_ruby31(-)] + >=dev-ruby/rake-13.0.6-r2[ruby_targets_ruby31(-)] + >=dev-ruby/rbs-2.1.0[ruby_targets_ruby31(-)] + >=dev-ruby/rexml-3.2.5[ruby_targets_ruby31(-)] + >=dev-ruby/rss-0.2.9[ruby_targets_ruby31(-)] + >=dev-ruby/test-unit-3.5.3[ruby_targets_ruby31(-)] + >=dev-ruby/typeprof-0.12.2[ruby_targets_ruby31(-)] " PDEPEND=" ${BUNDLED_GEMS} - virtual/rubygems[ruby_targets_ruby26] - >=dev-ruby/bundler-1.17.2[ruby_targets_ruby26] - >=dev-ruby/json-2.0.2[ruby_targets_ruby26] - rdoc? ( >=dev-ruby/rdoc-6.1.2[ruby_targets_ruby26] ) - xemacs? ( app-xemacs/ruby-modes )" + virtual/rubygems[ruby_targets_ruby31(-)] + >=dev-ruby/bundler-2.3.3[ruby_targets_ruby31(-)] + >=dev-ruby/did_you_mean-1.6.1[ruby_targets_ruby31(-)] + >=dev-ruby/json-2.6.1[ruby_targets_ruby31(-)] + >=dev-ruby/rdoc-6.3.3[ruby_targets_ruby31(-)] + xemacs? ( app-xemacs/ruby-modes ) +" src_prepare() { - # 005 does not compile bigdecimal and is questionable because it - # compiles ruby in a non-standard way, may be dropped - eapply "${FILESDIR}"/2.6/{002,010}*.patch + eapply "${FILESDIR}"/"${SLOT}"/011*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/3.1/901-musl-*.patch + fi einfo "Unbundling gems..." cd "$S" # Remove bundled gems that we will install via PDEPEND, bug # 539700. rm -fr gems/* || die + touch gems/bundled_gems || die + # Don't install CLI tools since they will clash with the gem + rm -f bin/{racc,racc2y,y2racc} || die + sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die einfo "Removing bundled libraries..." rm -fr ext/fiddle/libffi-3.2.1 || die + # Remove webrick tests because setting LD_LIBRARY_PATH does not work for them. + # rm -rf tool/test/webrick || die + + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb test/resolv/test_addr.rb \ + spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die + sed -i -e '/def test_test/askip "Depends on system setup"' test/ruby/test_file_exhaustive.rb || die + + # MJIT is broken and removed in later ruby versions. + rm -f test/ruby/test_jit.rb || die + + # This test calls out to the system ruby which is not being tested + # and may not be the same version. + sed -e '/test_without_tty/aomit "Calls system ruby"' \ + -i test/readline/test_readline.rb || die + if use prefix ; then # Fix hardcoded SHELL var in mkmf library sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die @@ -90,6 +121,11 @@ src_prepare() { 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 @@ -99,7 +135,16 @@ src_prepare() { } src_configure() { - local modules= myconf= + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" # -fomit-frame-pointer makes ruby segfault, see bug #150413. filter-flags -fomit-frame-pointer @@ -147,6 +192,9 @@ src_configure() { --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 ) \ @@ -158,6 +206,7 @@ src_configure() { $(use_enable static-libs install-static-library) \ $(use_with static-libs static-linked-ext) \ $(use_enable debug) \ + $(use_with valgrind) \ ${myconf} \ --enable-option-checking=no @@ -170,28 +219,14 @@ src_compile() { } src_test() { - emake -j1 V=1 test - - elog "Ruby's make test has been run. Ruby also ships with a make check" - elog "that cannot be run until after ruby has been installed." - elog - if use rubytests; then - elog "You have enabled rubytests, so they will be installed to" - elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other" - elog "than root, and you must place them into a writeable directory." - elog "Then call: " - elog - elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb" - else - elog "Enable the rubytests USE flag to install the make check tests" - fi + 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. - rm -rf ext/json || die + 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. @@ -199,18 +234,16 @@ src_install() { 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}" + local -x 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 + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" fi - RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" + local -x 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}" @@ -232,14 +265,7 @@ src_install() { dodoc -r sample fi - dodoc ChangeLog NEWS doc/NEWS* README* - - if use rubytests; then - pushd test - insinto /usr/share/${PN}-${SLOT}/test - doins -r . - popd - fi + dodoc ChangeLog NEWS.md doc/NEWS* README* } pkg_postinst() { @@ -249,7 +275,7 @@ pkg_postinst() { elog elog "To switch between available Ruby profiles, execute as root:" - elog "\teselect ruby set ruby(23|24|...)" + elog "\teselect ruby set ruby(30|31|...)" elog } diff --git a/dev-lang/ruby/ruby-3.2.3.ebuild b/dev-lang/ruby/ruby-3.2.3.ebuild new file mode 100644 index 000000000000..1acabf564cb0 --- /dev/null +++ b/dev-lang/ruby/ruby-3.2.3.ebuild @@ -0,0 +1,296 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic multiprocessing + +MY_P="${PN}-$(ver_cut 1-3)" +S=${WORKDIR}/${MY_P} + +SLOT=$(ver_cut 1-2) +MY_SUFFIX=$(ver_rs 1 '' ${SLOT}) +RUBYVERSION=${SLOT}.0 + +DESCRIPTION="An object-oriented scripting language" +HOMEPAGE="https://www.ruby-lang.org/" +SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" + +LICENSE="|| ( Ruby-BSD BSD-2 )" +KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs" + +RDEPEND=" + berkdb? ( sys-libs/db:= ) + gdbm? ( sys-libs/gdbm:= ) + jemalloc? ( dev-libs/jemalloc:= ) + jit? ( >=virtual/rust-1.58.1 ) + ssl? ( + dev-libs/openssl:0= + ) + socks5? ( >=net-proxy/dante-1.1.13 ) + systemtap? ( dev-debug/systemtap ) + tk? ( + dev-lang/tcl:0=[threads] + dev-lang/tk:0=[threads] + ) + dev-libs/libyaml + dev-libs/libffi:= + sys-libs/readline:0= + sys-libs/zlib + virtual/libcrypt:= + >=app-eselect/eselect-ruby-20231008 +" + +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" + +BUNDLED_GEMS=" + >=dev-ruby/debug-1.7.1[ruby_targets_ruby32(-)] + >=dev-ruby/irb-1.6.2[ruby_targets_ruby32(-)] + >=dev-ruby/matrix-0.4.2[ruby_targets_ruby32(-)] + >=dev-ruby/minitest-5.16.3[ruby_targets_ruby32(-)] + >=dev-ruby/net-ftp-0.2.0[ruby_targets_ruby32(-)] + >=dev-ruby/net-imap-0.3.4[ruby_targets_ruby32(-)] + >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby32(-)] + >=dev-ruby/net-smtp-0.3.3[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.2.5[ruby_targets_ruby32(-)] + >=dev-ruby/rss-0.2.9[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 ) +" + +src_prepare() { + eapply "${FILESDIR}"/"${SLOT}"/010*.patch + eapply "${FILESDIR}"/"${SLOT}"/011*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch + fi + + einfo "Unbundling gems..." + cd "$S" + # Remove bundled gems that we will install via PDEPEND, bug + # 539700. + rm -fr gems/* || die + touch gems/bundled_gems || die + # Don't install CLI tools since they will clash with the gem + rm -f bin/{racc,racc2y,y2racc} || die + sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die + + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die + + # Remove webrick tests because setting LD_LIBRARY_PATH does not work for them. + rm -rf tool/test/webrick || die + + # Avoid test using the system ruby + sed -i -e '/test_dumb_terminal/aomit "Uses system ruby"' test/reline/test_reline.rb || die + + # Avoid testing against hard-coded blockdev devices that most likely are not available + sed -i -e '/def blockdev/a@blockdev = nil' test/ruby/test_file_exhaustive.rb || die + + # Avoid tests that require gem downloads + sed -i -e '/^test-syntax-suggest/ s/\$(TEST_RUNNABLE)/no/' common.mk || die + sed -i -e '/^check:/ s/\$(TEST_RUNNABLE)-\$(PREPARE_SYNTAX_SUGGEST) test-syntax-suggest//' common.mk || die + + # Avoid test that fails intermittently + sed -i -e '/test_gem_exec_gem_uninstall/aomit "Fails intermittently"' test/rubygems/test_gem_commands_exec_command.rb || die + + if use prefix ; then + # Fix hardcoded SHELL var in mkmf library + sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die + + 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 + + eautoreconf +} + +src_configure() { + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" + + # -fomit-frame-pointer makes ruby segfault, see bug #150413. + filter-flags -fomit-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 + + # Socks support via dante + if use socks5 ; then + # Socks support can't be disabled as long as SOCKS_SERVER is + # set and socks library is present, so need to unset + # SOCKS_SERVER in that case. + unset SOCKS_SERVER + fi + + # Increase GC_MALLOC_LIMIT if set (default is 8000000) + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then + append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}" + fi + + # ipv6 hack, bug 168939. Needs --enable-ipv6. + use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET" + + # Determine which modules *not* to build depending in the USE flags. + if ! use berkdb ; then + modules="${modules},dbm" + fi + if ! use gdbm ; then + modules="${modules},gdbm" + fi + if ! use ssl ; then + modules="${modules},openssl" + fi + if ! use tk ; then + modules="${modules},tk" + fi + + # Provide an empty LIBPATHENV because we disable rpath but we do not + # need LD_LIBRARY_PATH by default since that breaks USE=multitarget + # #564272 + 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 \ + --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 + + # 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}" + + if [[ ${CHOST} == *darwin* ]] ; then + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + fi + + 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.2.4.ebuild b/dev-lang/ruby/ruby-3.2.4.ebuild new file mode 100644 index 000000000000..1c19b91c8e3d --- /dev/null +++ b/dev-lang/ruby/ruby-3.2.4.ebuild @@ -0,0 +1,296 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic multiprocessing + +MY_P="${PN}-$(ver_cut 1-3)" +S=${WORKDIR}/${MY_P} + +SLOT=$(ver_cut 1-2) +MY_SUFFIX=$(ver_rs 1 '' ${SLOT}) +RUBYVERSION=${SLOT}.0 + +DESCRIPTION="An object-oriented scripting language" +HOMEPAGE="https://www.ruby-lang.org/" +SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" + +LICENSE="|| ( Ruby-BSD BSD-2 )" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs" + +RDEPEND=" + berkdb? ( sys-libs/db:= ) + gdbm? ( sys-libs/gdbm:= ) + jemalloc? ( dev-libs/jemalloc:= ) + jit? ( >=virtual/rust-1.58.1 ) + ssl? ( + dev-libs/openssl:0= + ) + socks5? ( >=net-proxy/dante-1.1.13 ) + systemtap? ( dev-debug/systemtap ) + tk? ( + dev-lang/tcl:0=[threads] + dev-lang/tk:0=[threads] + ) + dev-libs/libyaml + dev-libs/libffi:= + sys-libs/readline:0= + sys-libs/zlib + virtual/libcrypt:= + >=app-eselect/eselect-ruby-20231008 +" + +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" + +BUNDLED_GEMS=" + >=dev-ruby/debug-1.7.1[ruby_targets_ruby32(-)] + >=dev-ruby/irb-1.6.2[ruby_targets_ruby32(-)] + >=dev-ruby/matrix-0.4.2[ruby_targets_ruby32(-)] + >=dev-ruby/minitest-5.16.3[ruby_targets_ruby32(-)] + >=dev-ruby/net-ftp-0.2.0[ruby_targets_ruby32(-)] + >=dev-ruby/net-imap-0.3.4[ruby_targets_ruby32(-)] + >=dev-ruby/net-pop-0.1.2[ruby_targets_ruby32(-)] + >=dev-ruby/net-smtp-0.3.3[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.2.5[ruby_targets_ruby32(-)] + >=dev-ruby/rss-0.2.9[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 ) +" + +src_prepare() { + eapply "${FILESDIR}"/"${SLOT}"/010*.patch + eapply "${FILESDIR}"/"${SLOT}"/011*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch + fi + + einfo "Unbundling gems..." + cd "$S" + # Remove bundled gems that we will install via PDEPEND, bug + # 539700. + rm -fr gems/* || die + touch gems/bundled_gems || die + # Don't install CLI tools since they will clash with the gem + rm -f bin/{racc,racc2y,y2racc} || die + sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die + + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die + + # Remove webrick tests because setting LD_LIBRARY_PATH does not work for them. + rm -rf tool/test/webrick || die + + # Avoid test using the system ruby + sed -i -e '/test_dumb_terminal/aomit "Uses system ruby"' test/reline/test_reline.rb || die + + # Avoid testing against hard-coded blockdev devices that most likely are not available + sed -i -e '/def blockdev/a@blockdev = nil' test/ruby/test_file_exhaustive.rb || die + + # Avoid tests that require gem downloads + sed -i -e '/^test-syntax-suggest/ s/\$(TEST_RUNNABLE)/no/' common.mk || die + sed -i -e '/^check:/ s/\$(TEST_RUNNABLE)-\$(PREPARE_SYNTAX_SUGGEST) test-syntax-suggest//' common.mk || die + + # Avoid test that fails intermittently + sed -i -e '/test_gem_exec_gem_uninstall/aomit "Fails intermittently"' test/rubygems/test_gem_commands_exec_command.rb || die + + if use prefix ; then + # Fix hardcoded SHELL var in mkmf library + sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die + + 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 + + eautoreconf +} + +src_configure() { + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" + + # -fomit-frame-pointer makes ruby segfault, see bug #150413. + filter-flags -fomit-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 + + # Socks support via dante + if use socks5 ; then + # Socks support can't be disabled as long as SOCKS_SERVER is + # set and socks library is present, so need to unset + # SOCKS_SERVER in that case. + unset SOCKS_SERVER + fi + + # Increase GC_MALLOC_LIMIT if set (default is 8000000) + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then + append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}" + fi + + # ipv6 hack, bug 168939. Needs --enable-ipv6. + use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET" + + # Determine which modules *not* to build depending in the USE flags. + if ! use berkdb ; then + modules="${modules},dbm" + fi + if ! use gdbm ; then + modules="${modules},gdbm" + fi + if ! use ssl ; then + modules="${modules},openssl" + fi + if ! use tk ; then + modules="${modules},tk" + fi + + # Provide an empty LIBPATHENV because we disable rpath but we do not + # need LD_LIBRARY_PATH by default since that breaks USE=multitarget + # #564272 + 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 \ + --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 + + # 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}" + + if [[ ${CHOST} == *darwin* ]] ; then + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + fi + + 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.0-r2.ebuild b/dev-lang/ruby/ruby-3.3.0-r2.ebuild new file mode 100644 index 000000000000..73b25c63a53d --- /dev/null +++ b/dev-lang/ruby/ruby-3.3.0-r2.ebuild @@ -0,0 +1,294 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic multiprocessing + +MY_P="${PN}-$(ver_cut 1-3)" +S=${WORKDIR}/${MY_P} + +SLOT=$(ver_cut 1-2) +MY_SUFFIX=$(ver_rs 1 '' ${SLOT}) +RUBYVERSION=${SLOT}.0 + +DESCRIPTION="An object-oriented scripting language" +HOMEPAGE="https://www.ruby-lang.org/" +SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" + +LICENSE="|| ( Ruby-BSD BSD-2 )" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs" + +RDEPEND=" + berkdb? ( sys-libs/db:= ) + gdbm? ( sys-libs/gdbm:= ) + jemalloc? ( dev-libs/jemalloc:= ) + jit? ( >=virtual/rust-1.58.1 ) + ssl? ( + dev-libs/openssl:0= + ) + socks5? ( >=net-proxy/dante-1.1.13 ) + systemtap? ( dev-debug/systemtap ) + tk? ( + dev-lang/tcl:0=[threads] + dev-lang/tk:0=[threads] + ) + dev-libs/libyaml + dev-libs/libffi:= + sys-libs/zlib + virtual/libcrypt:= + >=app-eselect/eselect-ruby-20231226 +" + +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" + +BUNDLED_GEMS=" + >=dev-ruby/debug-1.9.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.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.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.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(-)] +" + +PDEPEND=" + ${BUNDLED_GEMS} + virtual/rubygems[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.1[ruby_targets_ruby33(-)] + >=dev-ruby/rdoc-6.6.2[ruby_targets_ruby33(-)] + xemacs? ( app-xemacs/ruby-modes ) +" + +src_prepare() { + eapply "${FILESDIR}"/"${SLOT}"/010*.patch + eapply "${FILESDIR}"/"${SLOT}"/011*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch + fi + + einfo "Unbundling gems..." + cd "$S" + # Remove bundled gems that we will install via PDEPEND, bug + # 539700. + rm -fr gems/* || die + touch gems/bundled_gems || die + + # Avoid the irb default gemspec since we will install the normal gem + # instead. This avoids a file collision with dev-ruby/irb. + rm lib/irb/irb.gemspec || die + + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb \ + spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| die + + # Remove webrick tests because setting LD_LIBRARY_PATH does not work for them. + rm -rf tool/test/webrick || die + + # Avoid test using the system ruby + sed -i -e '/test_dumb_terminal/aomit "Uses system ruby"' test/reline/test_reline.rb || die + + # Avoid testing against hard-coded blockdev devices that most likely are not available + sed -i -e '/def blockdev/a@blockdev = nil' test/ruby/test_file_exhaustive.rb || die + + # Avoid tests that require gem downloads + sed -e '/^\(test-syntax-suggest\|PREPARE_SYNTAX_SUGGEST\)/ s/\$(TEST_RUNNABLE)/no/' \ + -i common.mk + + # Avoid test that fails intermittently + sed -e '/test_gem_exec_gem_uninstall/aomit "Fails intermittently"' \ + -i test/rubygems/test_gem_commands_exec_command.rb || die + + 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 + + eautoreconf +} + +src_configure() { + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" + + # -fomit-frame-pointer makes ruby segfault, see bug #150413. + filter-flags -fomit-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 + + # 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 + 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) \ + $(use_enable static-libs static) \ + $(use_enable static-libs install-static-library) \ + $(use_with static-libs static-linked-ext) \ + $(use_enable debug) \ + ${myconf} \ + $(use_with valgrind) \ + --enable-option-checking=no + + # Makefile is broken because it lacks -ldl + rm -rf ext/-test-/popen_deadlock || die +} + +src_compile() { + local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS="" +} + +src_test() { + local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + emake V=1 check +} + +src_install() { + # Remove the remaining bundled gems. We do this late in the process + # since they are used during the build to e.g. create the + # documentation. + einfo "Removing default gems before installation" + rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die + + # Ruby is involved in the install process, we don't want interference here. + unset RUBYOPT + + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby) + + local -x LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + + if [[ ${CHOST} == *darwin* ]] ; then + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + fi + + 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.1.ebuild b/dev-lang/ruby/ruby-3.3.1.ebuild new file mode 100644 index 000000000000..02b05be1c6ca --- /dev/null +++ b/dev-lang/ruby/ruby-3.3.1.ebuild @@ -0,0 +1,293 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic multiprocessing + +MY_P="${PN}-$(ver_cut 1-3)" +S=${WORKDIR}/${MY_P} + +SLOT=$(ver_cut 1-2) +MY_SUFFIX=$(ver_rs 1 '' ${SLOT}) +RUBYVERSION=${SLOT}.0 + +DESCRIPTION="An object-oriented scripting language" +HOMEPAGE="https://www.ruby-lang.org/" +SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" + +LICENSE="|| ( Ruby-BSD BSD-2 )" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs" + +RDEPEND=" + berkdb? ( sys-libs/db:= ) + gdbm? ( sys-libs/gdbm:= ) + jemalloc? ( dev-libs/jemalloc:= ) + jit? ( >=virtual/rust-1.58.1 ) + ssl? ( + dev-libs/openssl:0= + ) + socks5? ( >=net-proxy/dante-1.1.13 ) + systemtap? ( dev-debug/systemtap ) + tk? ( + dev-lang/tcl:0=[threads] + dev-lang/tk:0=[threads] + ) + dev-libs/libyaml + dev-libs/libffi:= + sys-libs/zlib + virtual/libcrypt:= + >=app-eselect/eselect-ruby-20231226 +" + +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" + +BUNDLED_GEMS=" + >=dev-ruby/debug-1.9.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.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.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.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(-)] +" + +PDEPEND=" + ${BUNDLED_GEMS} + virtual/rubygems[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.1[ruby_targets_ruby33(-)] + >=dev-ruby/rdoc-6.6.2[ruby_targets_ruby33(-)] + xemacs? ( app-xemacs/ruby-modes ) +" + +src_prepare() { + eapply "${FILESDIR}"/"${SLOT}"/010*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch + fi + + einfo "Unbundling gems..." + cd "$S" + # Remove bundled gems that we will install via PDEPEND, bug + # 539700. + rm -fr gems/* || die + touch gems/bundled_gems || die + + # Avoid the irb default gemspec since we will install the normal gem + # instead. This avoids a file collision with dev-ruby/irb. + rm lib/irb/irb.gemspec || die + + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb \ + spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| 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 + + 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 + + eautoreconf +} + +src_configure() { + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" + + # -fomit-frame-pointer makes ruby segfault, see bug #150413. + filter-flags -fomit-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 + + # 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 + 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) \ + $(use_enable static-libs static) \ + $(use_enable static-libs install-static-library) \ + $(use_with static-libs static-linked-ext) \ + $(use_enable debug) \ + ${myconf} \ + $(use_with valgrind) \ + --enable-option-checking=no + + # Makefile is broken because it lacks -ldl + rm -rf ext/-test-/popen_deadlock || die +} + +src_compile() { + local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS="" +} + +src_test() { + local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + emake V=1 check +} + +src_install() { + # Remove the remaining bundled gems. We do this late in the process + # since they are used during the build to e.g. create the + # documentation. + einfo "Removing default gems before installation" + rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die + + # Ruby is involved in the install process, we don't want interference here. + unset RUBYOPT + + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby) + + local -x LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + + if [[ ${CHOST} == *darwin* ]] ; then + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + fi + + 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.2.ebuild b/dev-lang/ruby/ruby-3.3.2.ebuild new file mode 100644 index 000000000000..02b05be1c6ca --- /dev/null +++ b/dev-lang/ruby/ruby-3.3.2.ebuild @@ -0,0 +1,293 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic multiprocessing + +MY_P="${PN}-$(ver_cut 1-3)" +S=${WORKDIR}/${MY_P} + +SLOT=$(ver_cut 1-2) +MY_SUFFIX=$(ver_rs 1 '' ${SLOT}) +RUBYVERSION=${SLOT}.0 + +DESCRIPTION="An object-oriented scripting language" +HOMEPAGE="https://www.ruby-lang.org/" +SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" + +LICENSE="|| ( Ruby-BSD BSD-2 )" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="berkdb debug doc examples gdbm jemalloc jit socks5 +ssl static-libs systemtap tk valgrind xemacs" + +RDEPEND=" + berkdb? ( sys-libs/db:= ) + gdbm? ( sys-libs/gdbm:= ) + jemalloc? ( dev-libs/jemalloc:= ) + jit? ( >=virtual/rust-1.58.1 ) + ssl? ( + dev-libs/openssl:0= + ) + socks5? ( >=net-proxy/dante-1.1.13 ) + systemtap? ( dev-debug/systemtap ) + tk? ( + dev-lang/tcl:0=[threads] + dev-lang/tk:0=[threads] + ) + dev-libs/libyaml + dev-libs/libffi:= + sys-libs/zlib + virtual/libcrypt:= + >=app-eselect/eselect-ruby-20231226 +" + +DEPEND=" + ${RDEPEND} + valgrind? ( dev-debug/valgrind ) +" + +BUNDLED_GEMS=" + >=dev-ruby/debug-1.9.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.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.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.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(-)] +" + +PDEPEND=" + ${BUNDLED_GEMS} + virtual/rubygems[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.1[ruby_targets_ruby33(-)] + >=dev-ruby/rdoc-6.6.2[ruby_targets_ruby33(-)] + xemacs? ( app-xemacs/ruby-modes ) +" + +src_prepare() { + eapply "${FILESDIR}"/"${SLOT}"/010*.patch + eapply "${FILESDIR}"/"${SLOT}"/902*.patch + + if use elibc_musl ; then + eapply "${FILESDIR}"/${SLOT}/901-musl-*.patch + fi + + einfo "Unbundling gems..." + cd "$S" + # Remove bundled gems that we will install via PDEPEND, bug + # 539700. + rm -fr gems/* || die + touch gems/bundled_gems || die + + # Avoid the irb default gemspec since we will install the normal gem + # instead. This avoids a file collision with dev-ruby/irb. + rm lib/irb/irb.gemspec || die + + # Remove tests that are known to fail or require a network connection + rm -f test/ruby/test_process.rb test/rubygems/test_gem{,_path_support}.rb || die + rm -f test/rinda/test_rinda.rb test/socket/test_tcp.rb test/fiber/test_address_resolve.rb \ + spec/ruby/library/socket/tcpsocket/{initialize,open}_spec.rb|| 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 + + 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 + + eautoreconf +} + +src_configure() { + local modules="win32,win32ole" myconf= + + # Ruby's build system does interesting things with MAKEOPTS and doesn't + # handle MAKEOPTS="-Oline" or similar well. Just filter it all out + # and use -j/-l parsed out from the original MAKEOPTS, then use that. + # Newer Portage sets this option by default in GNUMAKEFLAGS if nothing + # is set by the user in MAKEOPTS. See bug #900929 and bug #728424. + local makeopts_tmp="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset MAKEOPTS MAKEFLAGS GNUMAKEFLAGS + export MAKEOPTS="${makeopts_tmp}" + + # -fomit-frame-pointer makes ruby segfault, see bug #150413. + filter-flags -fomit-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 + + # 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 + 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) \ + $(use_enable static-libs static) \ + $(use_enable static-libs install-static-library) \ + $(use_with static-libs static-linked-ext) \ + $(use_enable debug) \ + ${myconf} \ + $(use_with valgrind) \ + --enable-option-checking=no + + # Makefile is broken because it lacks -ldl + rm -rf ext/-test-/popen_deadlock || die +} + +src_compile() { + local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS="" +} + +src_test() { + local -x LD_LIBRARY_PATH="${S}${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + emake V=1 check +} + +src_install() { + # Remove the remaining bundled gems. We do this late in the process + # since they are used during the build to e.g. create the + # documentation. + einfo "Removing default gems before installation" + rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die + + # Ruby is involved in the install process, we don't want interference here. + unset RUBYOPT + + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby) + + local -x LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + + if [[ ${CHOST} == *darwin* ]] ; then + local -x DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}" + fi + + 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 +} |