mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-06 00:48:18 -07:00
dev-lang/ruby: cleanup of masked ruby:2.5
Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
DIST ruby-2.5.8.tar.xz 11298404 BLAKE2B 3256c0448e72b63c0bd89f89a27fa9c09c8feed54d42cd79899b7d5cfe9dbc29ca708d12c630b3f52ff85b0c6a4011ae7ff0483d64b2fd445700a72a91028035 SHA512 2886be764a454425c5beef2777c64a70ee0d048b07896b327633d904f5077fea4299526689f9e2ac4dcd2fc4811cf9a6c8ce75367ed35d29dfe1a54222872e0d
|
||||
DIST ruby-2.5.9.tar.xz 11314448 BLAKE2B ed3c698f076066b0ca771d69ffeb92bf10de6fe051a36d373445ce071af850cb707344becf610657b473d14c7d4dcfb6a814b9d69ed6999e69c6dc3bfb3eaee4 SHA512 239f73eb4049ae2654b648ab927b1f74643d38a5f29572e4bd4e6aa3c53c1df29e0a995fd90d4ab9d4b2ff073fd809b12df820ccb1ddf395684bba6be1855b7a
|
||||
DIST ruby-2.6.8.tar.xz 11599488 BLAKE2B e5b2949233d8540f72d4d8b9c246f9bd0d1342426d2a1c19cb240b7c86f37299e9dc1dfc98ef2a86d1d91055865b4542d690de5567c71189bf2973a4989fa0fd SHA512 d040ad2238523587d8f356fcb796b8b6ad7f8caff7dd6df09e3f7efcbfa0369e33600e78c7f2bc713ae77c040757cce5c4fec223cb9070209f2bf741899c556d
|
||||
DIST ruby-2.7.4.tar.xz 12067588 BLAKE2B 2680a7ccd1daf3d156d9519d9132853e68f5f1aad592abce3e73fdd03314a6c28e7d94590153aead86af8952ff51f804ee029f8100b0137919cc27373cb8b9cd SHA512 2cbb70ecfdd69120e789023ddb2b25cab0d03bc33fdc367a8f74ca8a3ee785c18c8ded9de3ecee627c7e275ffb85147e6abf921b6a61e31851b37c7fedf45bf9
|
||||
DIST ruby-3.0.2.tar.xz 14746080 BLAKE2B 47c5591261fb63b1ec3ca719ea6b0c348937456c3711351c1f5317d1e6a748de197e90c8bd4ff822f7b2d4580ad7ed0b54b9eb7aaa5166ea1a15ab2deae96439 SHA512 0f702e2d8ca1342a9d4284dbdd234a3588e057b92566353aa7c21835cf09a3932864b2acf459a976960a1704e9befa562155d36b98b7cda8bd99526e10a374c4
|
||||
|
||||
@@ -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)'
|
||||
@@ -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'}
|
||||
@@ -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()
|
||||
@@ -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);
|
||||
@@ -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");
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'}
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
@@ -1,220 +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"
|
||||
IUSE="berkdb debug doc examples gdbm ipv6 jemalloc +rdoc rubytests socks5 +ssl static-libs tk xemacs"
|
||||
|
||||
RDEPEND="
|
||||
berkdb? ( sys-libs/db:= )
|
||||
gdbm? ( sys-libs/gdbm:= )
|
||||
jemalloc? ( dev-libs/jemalloc:= )
|
||||
ssl? (
|
||||
dev-libs/openssl:0=
|
||||
)
|
||||
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
|
||||
virtual/libcrypt:=
|
||||
>=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
|
||||
}
|
||||
@@ -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 +rdoc rubytests socks5 +ssl static-libs systemtap tk xemacs"
|
||||
|
||||
RDEPEND="
|
||||
berkdb? ( sys-libs/db:= )
|
||||
gdbm? ( sys-libs/gdbm:= )
|
||||
jemalloc? ( dev-libs/jemalloc:= )
|
||||
ssl? (
|
||||
dev-libs/openssl:0=
|
||||
)
|
||||
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
|
||||
virtual/libcrypt:=
|
||||
>=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
|
||||
}
|
||||
Reference in New Issue
Block a user