[packages/ruby/dev-2.3: 7/8] update patches from fedora (d14e3f780f68851070c2a5bf08b61327a59d857c)

glen glen at pld-linux.org
Mon Apr 24 21:05:35 CEST 2017


commit 6b9c4b929408c928dce03b048ec7f8daf6721bee
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Apr 24 21:50:49 2017 +0300

    update patches from fedora (d14e3f780f68851070c2a5bf08b61327a59d857c)

 archlibdir.patch               |  2 +-
 custom-rubygems-location.patch | 14 ++++-----
 duplicated-paths.patch         | 64 ++++++------------------------------------
 mkmf-verbose.patch             |  2 +-
 operating_system.rb            | 26 +++++++++++++++--
 ruby-version.patch             |  4 +--
 ruby.spec                      |  2 +-
 7 files changed, 44 insertions(+), 70 deletions(-)
---
diff --git a/ruby.spec b/ruby.spec
index d66c092..2f924db 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -521,7 +521,7 @@ preprocess() to extract telnet command sequences.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
-#%patch5 -p1
+%patch5 -p1
 %patch6 -p1
 #%patch8 -p1
 %patch9 -p1
diff --git a/archlibdir.patch b/archlibdir.patch
index b54f8e0..43fa7f6 100644
--- a/archlibdir.patch
+++ b/archlibdir.patch
@@ -11,7 +11,7 @@ diff --git a/configure.in b/configure.in
 index 37d9a62..553d4d0 100644
 --- a/configure.in
 +++ b/configure.in
-@@ -3385,6 +3385,11 @@ if test ${multiarch+set}; then
+@@ -3632,6 +3632,11 @@ if test ${multiarch+set}; then
  fi
  
  archlibdir='${libdir}/${arch}'
diff --git a/custom-rubygems-location.patch b/custom-rubygems-location.patch
index c21c858..e82f172 100644
--- a/custom-rubygems-location.patch
+++ b/custom-rubygems-location.patch
@@ -15,9 +15,9 @@ diff --git a/configure.in b/configure.in
 index 03a4152..0e371e2 100644
 --- a/configure.in
 +++ b/configure.in
-@@ -4061,6 +4061,10 @@ AC_ARG_WITH(vendorarchdir,
+@@ -4264,6 +4264,10 @@ AC_ARG_WITH(vendorarchdir,
              [vendorarchdir=$withval],
-             [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
+             [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}])
  
 +AC_ARG_WITH(rubygemsdir,
 +           AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]),
@@ -26,14 +26,14 @@ index 03a4152..0e371e2 100644
  if test "${LOAD_RELATIVE+set}"; then
      AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
      RUBY_EXEC_PREFIX=''
-@@ -4084,6 +4088,7 @@ AC_SUBST(sitearchdir)dnl
+@@ -4288,6 +4292,7 @@ AC_SUBST(sitearchdir)dnl
  AC_SUBST(vendordir)dnl
  AC_SUBST(vendorlibdir)dnl
  AC_SUBST(vendorarchdir)dnl
 +AC_SUBST(rubygemsdir)dnl
  
+ AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")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
@@ -53,7 +53,7 @@ diff --git a/template/verconf.h.tmpl b/template/verconf.h.tmpl
 index 79c003e..34f2382 100644
 --- a/template/verconf.h.tmpl
 +++ b/template/verconf.h.tmpl
-@@ -34,6 +34,9 @@
+@@ -36,6 +36,9 @@
  % if C["RUBY_SEARCH_PATH"]
  #define RUBY_SEARCH_PATH		"${RUBY_SEARCH_PATH}"
  % end
@@ -67,7 +67,7 @@ diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
 index b47b6e1..0b99408 100755
 --- a/tool/rbinstall.rb
 +++ b/tool/rbinstall.rb
-@@ -317,6 +317,7 @@ sitelibdir = CONFIG["sitelibdir"]
+@@ -328,6 +328,7 @@ def CONFIG.[](name, mandatory = false)
  sitearchlibdir = CONFIG["sitearchdir"]
  vendorlibdir = CONFIG["vendorlibdir"]
  vendorarchlibdir = CONFIG["vendorarchdir"]
@@ -75,7 +75,7 @@ index b47b6e1..0b99408 100755
  mandir = CONFIG["mandir", true]
  docdir = CONFIG["docdir", true]
  configure_args = Shellwords.shellwords(CONFIG["configure_args"])
-@@ -505,7 +506,15 @@ end
+@@ -506,7 +507,15 @@ def CONFIG.[](name, mandatory = false)
  install?(:local, :comm, :lib) do
    prepare "library scripts", rubylibdir
    noinst = %w[README* *.txt *.rdoc *.gemspec]
diff --git a/duplicated-paths.patch b/duplicated-paths.patch
index b401158..eb34107 100644
--- a/duplicated-paths.patch
+++ b/duplicated-paths.patch
@@ -5,71 +5,25 @@ Subject: [PATCH] Prevent duplicated paths when empty version string is
  configured.
 
 ---
- configure.in     | 15 +++++++++------
+ configure.in     |  3 ++-
  loadpath.c       | 12 ++++++++++++
  tool/mkconfig.rb |  2 +-
- 3 files changed, 22 insertions(+), 7 deletions(-)
+ 3 files changed, 15 insertions(+), 2 deletions(-)
 
 diff --git a/configure.in b/configure.in
-index 17ed3ed..5843651 100644
+index db37cd6..ce8d149 100644
 --- a/configure.in
 +++ b/configure.in
-@@ -3975,8 +3975,6 @@ AS_CASE(["$target_os"],
-     rubyw_install_name='$(RUBYW_INSTALL_NAME)'
-     ])
+@@ -4228,7 +4228,8 @@ AS_CASE(["$ruby_version_dir_name"],
+ ruby_version_dir=/'${ruby_version_dir_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,
-@@ -4006,6 +4004,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 */'])
-@@ -4022,30 +4021,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
+ if test -z "${ruby_version_dir_name}"; then
 -    AC_MSG_ERROR([No ruby version, No place for bundled libraries])
-+    unset ruby_version_suffix
++    unset ruby_version_dir
 +    AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
- else
-     RUBY_LIB_VERSION="${ruby_version}"
  fi
- 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],
+ rubylibdir='${rubylibprefix}'${ruby_version_dir}
 diff --git a/loadpath.c b/loadpath.c
 index 9160031..0d4d953 100644
 --- a/loadpath.c
@@ -113,7 +67,7 @@ diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
 index 07076d4..35e6c3c 100755
 --- a/tool/mkconfig.rb
 +++ b/tool/mkconfig.rb
-@@ -123,7 +123,7 @@ File.foreach "config.status" do |line|
+@@ -122,7 +122,7 @@ def config.write(arg)
      val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
      case name
      when /^prefix$/
diff --git a/mkmf-verbose.patch b/mkmf-verbose.patch
index 120ee37..ccbd972 100644
--- a/mkmf-verbose.patch
+++ b/mkmf-verbose.patch
@@ -11,7 +11,7 @@ diff --git a/lib/mkmf.rb b/lib/mkmf.rb
 index 682eb46..e6b1445 100644
 --- a/lib/mkmf.rb
 +++ b/lib/mkmf.rb
-@@ -1829,7 +1829,7 @@ SRC
+@@ -1892,7 +1892,7 @@ def configuration(srcdir)
  SHELL = /bin/sh
  
  # V=0 quiet, V=1 verbose.  other values don't work.
diff --git a/operating_system.rb b/operating_system.rb
index ed653fd..4b2903d 100644
--- a/operating_system.rb
+++ b/operating_system.rb
@@ -14,11 +14,27 @@ module Gem
     private :previous_but_one_dir_to
 
     ##
+    # Detects --install-dir option specified on command line.
+
+    def opt_install_dir?
+      @opt_install_dir ||= ARGV.include?('--install-dir') || ARGV.include?('-i')
+    end
+    private :opt_install_dir?
+
+    ##
+    # Detects --build-root option specified on command line.
+
+    def opt_build_root?
+      @opt_build_root ||= ARGV.include?('--build-root')
+    end
+    private :opt_build_root?
+
+    ##
     # 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']
+      @rpmbuild ||= ENV['RPM_PACKAGE_NAME'] && (opt_install_dir? || opt_build_root?)
     end
     private :rpmbuild?
 
@@ -80,7 +96,9 @@ module Gem
     # RubyGems default overrides.
 
     def default_dir
-      if Process.uid == 0
+      if opt_build_root?
+        Gem.default_dirs[:system][:gem_dir]
+      elsif Process.uid == 0
         Gem.default_dirs[:local][:gem_dir]
       else
         Gem.user_dir
@@ -93,7 +111,9 @@ module Gem
     end
 
     def default_bindir
-      if Process.uid == 0
+      if opt_build_root?
+        Gem.default_dirs[:system][:bin_dir]
+      elsif Process.uid == 0
         Gem.default_dirs[:local][:bin_dir]
       else
         File.join [Dir.home, 'bin']
diff --git a/ruby-version.patch b/ruby-version.patch
index cdd016c..96d7249 100644
--- a/ruby-version.patch
+++ b/ruby-version.patch
@@ -249,7 +249,7 @@ diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
 index 0428bea..b6e090e 100644
 --- a/test/rubygems/test_gem.rb
 +++ b/test/rubygems/test_gem.rb
-@@ -963,7 +963,8 @@ def test_self_use_paths
+@@ -962,7 +962,8 @@ def test_self_use_paths
  
    def test_self_user_dir
      parts = [@userhome, '.gem', Gem.ruby_engine]
@@ -259,7 +259,7 @@ index 0428bea..b6e090e 100644
  
      assert_equal File.join(parts), Gem.user_dir
    end
-@@ -1090,7 +1091,7 @@ def test_self_user_home_user_drive_and_path
+@@ -1089,7 +1090,7 @@ def test_self_user_home_user_drive_and_path
    def test_self_vendor_dir
      expected =
        File.join RbConfig::CONFIG['vendordir'], 'gems',
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby.git/commitdiff/ec151791f7e5ded8130e6e4bd4b033b9ac4dade6



More information about the pld-cvs-commit mailing list