[packages/ruby/dev-2.1] update fedora patches
glen
glen at pld-linux.org
Thu Jul 30 23:07:40 CEST 2015
commit 1a83bc1126c2222c08c6dca2d05f38f0fcc148bc
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Jul 30 20:55:42 2015 +0300
update fedora patches
custom-rubygems-location.patch | 82 ++++++++++++++++------------
duplicated-paths.patch | 121 ++++++++++++++++++++++++++++++-----------
mkmf-verbose.patch | 8 +--
operating_system.rb | 31 ++++++++++-
ruby.spec | 6 +-
5 files changed, 172 insertions(+), 76 deletions(-)
---
diff --git a/ruby.spec b/ruby.spec
index 6a535de..7256830 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -430,10 +430,10 @@ Biblioteka JSON dla języka Ruby.
%patch2 -p1
%patch3 -p1
%patch4 -p1
-#%patch5 -p1
+%patch5 -p1
#%patch7 -p1
#%patch8 -p1
-#%patch9 -p1
+%patch9 -p1
#%patch10 -p1
#%patch11 -p1
@@ -495,7 +495,7 @@ cd ..
--enable-multiarch \
--disable-rubygems \
--disable-install-doc \
- --with-ruby-version=minor
+ --with-ruby-version='' \
%{__make} -j1 main \
COPY="cp -p" Q= \
diff --git a/custom-rubygems-location.patch b/custom-rubygems-location.patch
index 90ad58d..55c7448 100644
--- a/custom-rubygems-location.patch
+++ b/custom-rubygems-location.patch
@@ -1,46 +1,73 @@
-From b5e9dc3683cb085aa57e7b12c35a4f21b2cc1482 Mon Sep 17 00:00:00 2001
+From 94da59aafacc6a9efe829529eb51385588d6f149 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
Date: Fri, 11 Nov 2011 13:14:45 +0100
Subject: [PATCH] Allow to install RubyGems into custom location, outside of
Ruby tree.
---
- configure.in | 8 ++++++++
- tool/rbinstall.rb | 9 +++++++++
- version.c | 4 ++++
- 3 files changed, 21 insertions(+)
+ configure.in | 5 +++++
+ loadpath.c | 4 ++++
+ template/verconf.h.in | 3 +++
+ tool/rbinstall.rb | 9 +++++++++
+ 4 files changed, 21 insertions(+)
diff --git a/configure.in b/configure.in
-index 1627d12..e064b2b 100644
+index 03a4152..0e371e2 100644
--- a/configure.in
+++ b/configure.in
-@@ -3349,6 +3349,13 @@ AC_ARG_WITH(vendorarchdir,
+@@ -3804,6 +3804,10 @@ AC_ARG_WITH(vendorarchdir,
[vendorarchdir=$withval],
[vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
+AC_ARG_WITH(rubygemsdir,
+ AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]),
+ [rubygemsdir=$withval])
-+if test "$rubygemsdir" != ""; then
-+ AC_DEFINE_UNQUOTED(RUBYGEMS_DIR,"$rubygemsdir" !<verconf>!)
-+fi
+
- unexpand_shvar rubylibprefix exec_prefix libdir RUBY_BASE_NAME
- unexpand_shvar rubyarchprefix exec_prefix libdir arch RUBY_BASE_NAME archlibdir rubylibprefix
- unexpand_shvar rubysitearchprefix exec_prefix libdir sitearch arch RUBY_BASE_NAME archlibdir sitearchlibdir rubylibprefix
-@@ -3415,6 +3422,7 @@ AC_SUBST(sitearchdir)dnl
+ if test "${LOAD_RELATIVE+set}"; then
+ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
+ RUBY_EXEC_PREFIX=''
+@@ -3827,6 +3831,7 @@ AC_SUBST(sitearchdir)dnl
AC_SUBST(vendordir)dnl
AC_SUBST(vendorlibdir)dnl
AC_SUBST(vendorarchdir)dnl
+AC_SUBST(rubygemsdir)dnl
- configure_args=$ac_configure_args
- AC_SUBST(configure_args)dnl
+ AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
+
+diff --git a/loadpath.c b/loadpath.c
+index 623dc9d..74c5d9e 100644
+--- a/loadpath.c
++++ b/loadpath.c
+@@ -94,6 +94,10 @@ const char ruby_initial_load_paths[] =
+ #endif
+ #endif
+
++#ifdef RUBYGEMS_DIR
++ RUBYGEMS_DIR "\0"
++#endif
++
+ RUBY_LIB "\0"
+ #ifdef RUBY_THINARCH
+ RUBY_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
+diff --git a/template/verconf.h.in b/template/verconf.h.in
+index 79c003e..34f2382 100644
+--- a/template/verconf.h.in
++++ b/template/verconf.h.in
+@@ -34,6 +34,9 @@
+ % if C["RUBY_SEARCH_PATH"]
+ #define RUBY_SEARCH_PATH "${RUBY_SEARCH_PATH}"
+ % end
++% if C["rubygemsdir"]
++#define RUBYGEMS_DIR "${rubygemsdir}"
++% end
+ %
+ % R = {}
+ % R["ruby_version"] = '"RUBY_LIB_VERSION"'
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
-index 92e54c6..c72dfb6 100755
+index b47b6e1..0b99408 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
-@@ -313,6 +313,7 @@ sitelibdir = CONFIG["sitelibdir"]
+@@ -324,6 +324,7 @@ sitelibdir = CONFIG["sitelibdir"]
sitearchlibdir = CONFIG["sitearchdir"]
vendorlibdir = CONFIG["vendorlibdir"]
vendorarchlibdir = CONFIG["vendorarchdir"]
@@ -48,7 +75,7 @@ index 92e54c6..c72dfb6 100755
mandir = CONFIG["mandir", true]
docdir = CONFIG["docdir", true]
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
-@@ -500,7 +501,15 @@ end
+@@ -512,7 +513,15 @@ end
install?(:local, :comm, :lib) do
prepare "library scripts", rubylibdir
noinst = %w[README* *.txt *.rdoc *.gemspec]
@@ -64,21 +91,6 @@ index 92e54c6..c72dfb6 100755
end
install?(:local, :arch, :lib) do
-diff --git a/version.c b/version.c
-index 54c4513..d76100b 100644
---- a/version.c
-+++ b/version.c
-@@ -99,6 +99,10 @@ const char ruby_initial_load_paths[] =
- #endif
- #endif
-
-+#ifdef RUBYGEMS_DIR
-+ RUBYGEMS_DIR "\0"
-+#endif
-+
- RUBY_LIB "\0"
- #ifdef RUBY_THINARCH
- RUBY_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
--
-1.8.1.2
+1.8.3.1
diff --git a/duplicated-paths.patch b/duplicated-paths.patch
index 58d602d..89f5890 100644
--- a/duplicated-paths.patch
+++ b/duplicated-paths.patch
@@ -1,49 +1,89 @@
-From e943a89efd63dcfb80a0ab8d9a4db37f523f508e Mon Sep 17 00:00:00 2001
+From e24d97c938c481450ed80ec83e5399595946c1ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
Date: Fri, 8 Feb 2013 22:48:41 +0100
Subject: [PATCH] Prevent duplicated paths when empty version string is
configured.
---
- configure.in | 3 +++
- version.c | 10 ++++++++++
- 2 files changed, 13 insertions(+)
+ configure.in | 15 +++++++++------
+ loadpath.c | 12 ++++++++++++
+ tool/mkconfig.rb | 2 +-
+ 3 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/configure.in b/configure.in
-index 5850bbf..7604bb8 100644
+index 17ed3ed..5843651 100644
--- a/configure.in
+++ b/configure.in
-@@ -3367,6 +3367,9 @@ unexpand_shvar exec_prefix prefix
- if test ${RUBY_LIB_VERSION_STYLE+set}; then
- AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE !<verconf>!)
+@@ -3718,8 +3718,6 @@ AS_CASE(["$target_os"],
+ rubyw_install_name='$(RUBYW_INSTALL_NAME)'
+ ])
+
+-rubylibdir='${rubylibprefix}/${ruby_version}'
+-rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
+
+ rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
+ AC_ARG_WITH(rubyarchprefix,
+@@ -3749,6 +3747,7 @@ AC_ARG_WITH(ruby-version,
+ [ruby_version=full])
+ unset RUBY_LIB_VERSION
+ unset RUBY_LIB_VERSION_STYLE
++ruby_version_suffix=/'${ruby_version}'
+ AS_CASE(["$ruby_version"],
+ [full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
+ [minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
+@@ -3765,30 +3764,34 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
+ ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
+ eval $ruby_version
+ elif test -z "${ruby_version}"; then
+- AC_MSG_ERROR([No ruby version, No place for bundled libraries])
++ unset ruby_version_suffix
++ AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
else
-+ if test "x${ruby_version}" = 'x'; then
-+ AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
-+ fi
- AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
+ RUBY_LIB_VERSION="\"${ruby_version}\""
fi
- AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, ${RUBY_EXEC_PREFIX})
-diff --git a/version.c b/version.c
-index 282960d..54c4513 100644
---- a/version.c
-+++ b/version.c
-@@ -39,9 +39,15 @@
- #define RUBY_VENDOR_LIB RUBY_LIB_PREFIX"/vendor_ruby"
- #endif
+ AC_SUBST(RUBY_LIB_VERSION_STYLE)
+ AC_SUBST(RUBY_LIB_VERSION)
+
++rubylibdir='${rubylibprefix}'${ruby_version_suffix}
++rubyarchdir=${multiarch+'${rubyarchprefix}'${ruby_version_suffix}}${multiarch-'${rubylibdir}/${arch}'}
++
+ AC_ARG_WITH(sitedir,
+ AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
+ [sitedir=$withval],
+ [sitedir='${rubylibprefix}/site_ruby'])
+-sitelibdir='${sitedir}/${ruby_version}'
++sitelibdir='${sitedir}'${ruby_version_suffix}
+ AC_ARG_WITH(sitearchdir,
+ AS_HELP_STRING([--with-sitearchdir=DIR],
+ [architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
+ [sitearchdir=$withval],
+- [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
++ [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby'${ruby_version_suffix}}${multiarch-'${sitelibdir}/${sitearch}'}])
+
+ AC_ARG_WITH(vendordir,
+ AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
+ [vendordir=$withval],
+ [vendordir='${rubylibprefix}/vendor_ruby'])
+-vendorlibdir='${vendordir}/${ruby_version}'
++vendorlibdir='${vendordir}'${ruby_version_suffix}
+
+ AC_ARG_WITH(vendorarchdir,
+ AS_HELP_STRING([--with-vendorarchdir=DIR],
+diff --git a/loadpath.c b/loadpath.c
+index 9160031..0d4d953 100644
+--- a/loadpath.c
++++ b/loadpath.c
+@@ -65,22 +65,34 @@ const char ruby_initial_load_paths[] =
+ RUBY_SEARCH_PATH "\0"
+ #endif
+ #ifndef NO_RUBY_SITE_LIB
+#ifdef RUBY_LIB_VERSION_BLANK
-+#define RUBY_LIB RUBY_LIB_PREFIX
-+#define RUBY_SITE_LIB2 RUBY_SITE_LIB
-+#define RUBY_VENDOR_LIB2 RUBY_VENDOR_LIB
++ RUBY_SITE_LIB "\0"
+#else
- #define RUBY_LIB RUBY_LIB_PREFIX "/"RUBY_LIB_VERSION
- #define RUBY_SITE_LIB2 RUBY_SITE_LIB "/"RUBY_LIB_VERSION
- #define RUBY_VENDOR_LIB2 RUBY_VENDOR_LIB "/"RUBY_LIB_VERSION
+ RUBY_SITE_LIB2 "\0"
+#endif
- #ifndef RUBY_ARCH_LIB_FOR
- #define RUBY_ARCH_LIB_FOR(arch) RUBY_LIB "/"arch
- #endif
-@@ -77,8 +83,10 @@ const char ruby_initial_load_paths[] =
+ #ifdef RUBY_THINARCH
RUBY_SITE_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
#endif
RUBY_SITE_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
@@ -53,8 +93,12 @@ index 282960d..54c4513 100644
+#endif
#ifndef NO_RUBY_VENDOR_LIB
++#ifdef RUBY_LIB_VERSION_BLANK
++ RUBY_VENDOR_LIB "\0"
++#else
RUBY_VENDOR_LIB2 "\0"
-@@ -86,8 +94,10 @@ const char ruby_initial_load_paths[] =
++#endif
+ #ifdef RUBY_THINARCH
RUBY_VENDOR_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
#endif
RUBY_VENDOR_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
@@ -65,6 +109,19 @@ index 282960d..54c4513 100644
RUBY_LIB "\0"
#ifdef RUBY_THINARCH
+diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
+index 07076d4..35e6c3c 100755
+--- a/tool/mkconfig.rb
++++ b/tool/mkconfig.rb
+@@ -121,7 +121,7 @@ File.foreach "config.status" do |line|
+ val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
+ case name
+ when /^prefix$/
+- val = "(TOPDIR || DESTDIR + #{val})"
++ val = "(((TOPDIR && TOPDIR.empty?) ? nil : TOPDIR) || DESTDIR + #{val})"
+ when /^ARCH_FLAG$/
+ val = "arch_flag || #{val}" if universal
+ when /^UNIVERSAL_ARCHNAMES$/
--
-1.8.1.2
+1.9.0
diff --git a/mkmf-verbose.patch b/mkmf-verbose.patch
index de78ad8..120ee37 100644
--- a/mkmf-verbose.patch
+++ b/mkmf-verbose.patch
@@ -1,4 +1,4 @@
-From ec16398159a161fc77436b4855d489f193b2515b Mon Sep 17 00:00:00 2001
+From 28cc0749d6729aa2444661ee7b411e183fe220b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
Date: Mon, 19 Nov 2012 15:14:51 +0100
Subject: [PATCH] Verbose mkmf.
@@ -8,10 +8,10 @@ Subject: [PATCH] Verbose mkmf.
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
-index 4b6c52e..67a15ee 100644
+index 682eb46..e6b1445 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
-@@ -1777,7 +1777,7 @@ SRC
+@@ -1829,7 +1829,7 @@ SRC
SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work.
@@ -21,5 +21,5 @@ index 4b6c52e..67a15ee 100644
Q = $(Q1:0=@)
ECHO1 = $(V:1=@#{CONFIG['NULLCMD']})
--
-1.8.1.2
+1.8.3.1
diff --git a/operating_system.rb b/operating_system.rb
index c3b19d6..079564f 100644
--- a/operating_system.rb
+++ b/operating_system.rb
@@ -12,6 +12,15 @@ module Gem
private :previous_but_one_dir_to
##
+ # Tries to detect, if arguments and environment variables suggest that
+ # 'gem install' is executed from rpmbuild.
+
+ def rpmbuild?
+ (ARGV.include?('--install-dir') || ARGV.include?('-i')) && ENV['RPM_PACKAGE_NAME']
+ end
+ private :rpmbuild?
+
+ ##
# Default gems locations allowed on FHS system (/usr, /usr/share).
# The locations are derived from directories specified during build
# configuration.
@@ -78,8 +87,26 @@ module Gem
end
def default_ext_dir_for base_dir
- dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
- dirs && File.join(dirs.last[:ext_dir], RbConfig::CONFIG['RUBY_INSTALL_NAME'])
+ dir = if rpmbuild?
+ build_dir = base_dir.chomp Gem.default_dirs[:system][:gem_dir]
+ if build_dir != base_dir
+ File.join build_dir, Gem.default_dirs[:system][:ext_dir]
+ end
+ else
+ dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
+ dirs && dirs.last[:ext_dir]
+ end
+ dir && File.join(dir, RbConfig::CONFIG['RUBY_INSTALL_NAME'])
+ end
+
+ # This method should be available since RubyGems 2.2 until RubyGems 3.0.
+ # https://github.com/rubygems/rubygems/issues/749
+ if method_defined? :install_extension_in_lib
+ remove_method :install_extension_in_lib
+
+ def install_extension_in_lib
+ false
+ end
end
end
end
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ruby.git/commitdiff/e8995a8bbd9a57598140860e25b2aed9582f03d1
More information about the pld-cvs-commit
mailing list