Blame SOURCES/ruby-2.3.0-ruby_version.patch

a54e24
From 4fc1be3af3f58621bb751c9e63c208b15c0e8d16 Mon Sep 17 00:00:00 2001
a54e24
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
a54e24
Date: Tue, 31 Mar 2015 16:21:04 +0200
a54e24
Subject: [PATCH 1/4] Use ruby_version_dir_name for versioned directories.
a54e24
a54e24
This disallows changing the ruby_version constant by --with-ruby-version
a54e24
configuration options. The two places version numbers are disallowed as
a54e24
well, since there are a lot of places which cannot handle this format
a54e24
properly.
a54e24
a54e24
ruby_version_dir_name now specifies custom version string for versioned
a54e24
directories, e.g. instead of default X.Y.Z, you can specify whatever
a54e24
string.
a54e24
---
a54e24
 configure.ac        | 64 ++++++++++++++++++++++++---------------------
a54e24
 template/ruby.pc.in |  1 +
a54e24
 2 files changed, 35 insertions(+), 30 deletions(-)
a54e24
a54e24
diff --git a/configure.ac b/configure.ac
a54e24
index 8ea969412f..a00f2b6776 100644
a54e24
--- a/configure.ac
a54e24
+++ b/configure.ac
9f47f6
@@ -3678,9 +3678,6 @@ AS_CASE(["$target_os"],
a54e24
     rubyw_install_name='$(RUBYW_INSTALL_NAME)'
a54e24
     ])
a54e24
 
a54e24
-rubylibdir='${rubylibprefix}/${ruby_version}'
a54e24
-rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
a54e24
-
a54e24
 rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
a54e24
 AC_ARG_WITH(rubyarchprefix,
a54e24
 	    AS_HELP_STRING([--with-rubyarchprefix=DIR],
9f47f6
@@ -3703,56 +3703,62 @@ AC_ARG_WITH(ridir,
a54e24
 AC_SUBST(ridir)
a54e24
 AC_SUBST(RI_BASE_NAME)
a54e24
 
a54e24
-AC_ARG_WITH(ruby-version,
a54e24
-	    AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]),
a54e24
-            [ruby_version=$withval],
a54e24
-            [ruby_version=full])
a54e24
 unset RUBY_LIB_VERSION
a54e24
-unset RUBY_LIB_VERSION_STYLE
a54e24
-AS_CASE(["$ruby_version"],
a54e24
-  [full],  [RUBY_LIB_VERSION_STYLE='3	/* full */'],
a54e24
-  [minor], [RUBY_LIB_VERSION_STYLE='2	/* minor */'])
a54e24
-AS_IF([test ${RUBY_LIB_VERSION_STYLE+set}], [
a54e24
-    {
a54e24
-    echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
a54e24
-    echo '#define STRINGIZE(x) x'
a54e24
-    test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
a54e24
-    echo '#include "version.h"'
a54e24
-    echo 'ruby_version=RUBY_LIB_VERSION'
a54e24
-    } > conftest.c
a54e24
-    ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
a54e24
-    eval $ruby_version
a54e24
-], [test -z "${ruby_version}"], [
a54e24
-    AC_MSG_ERROR([No ruby version, No place for bundled libraries])
a54e24
-], [
a54e24
-    RUBY_LIB_VERSION="${ruby_version}"
a54e24
-])
a54e24
+RUBY_LIB_VERSION_STYLE='3	/* full */'
a54e24
+{
a54e24
+echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
a54e24
+echo '#define STRINGIZE(x) x'
a54e24
+test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
a54e24
+echo '#include "version.h"'
a54e24
+echo 'ruby_version=RUBY_LIB_VERSION'
a54e24
+} > conftest.c
a54e24
+ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
a54e24
+eval $ruby_version
a54e24
+
a54e24
+RUBY_LIB_VERSION="${ruby_version}"
a54e24
+
a54e24
 AC_SUBST(RUBY_LIB_VERSION_STYLE)
a54e24
 AC_SUBST(RUBY_LIB_VERSION)
a54e24
 
a54e24
+AC_ARG_WITH(ruby-version,
a54e24
+	    AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|STR)]),
a54e24
+            [ruby_version_dir_name=$withval],
a54e24
+            [ruby_version_dir_name=full])
a54e24
+AS_CASE(["$ruby_version_dir_name"],
a54e24
+  [full], [ruby_version_dir_name='${ruby_version}'])
a54e24
+
a54e24
+ruby_version_dir=/'${ruby_version_dir_name}'
a54e24
+
a54e24
+if test -z "${ruby_version_dir_name}"; then
a54e24
+    AC_MSG_ERROR([No ruby version, No place for bundled libraries])
a54e24
+fi
a54e24
+
a54e24
+rubylibdir='${rubylibprefix}'${ruby_version_dir}
a54e24
+rubyarchdir=${multiarch+'${rubyarchprefix}'${ruby_version_dir}}${multiarch-'${rubylibdir}/${arch}'}
a54e24
+
a54e24
 AC_ARG_WITH(sitedir,
a54e24
 	    AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
a54e24
             [sitedir=$withval],
a54e24
             [sitedir='${rubylibprefix}/site_ruby'])
a54e24
-sitelibdir='${sitedir}/${ruby_version}'
a54e24
+sitelibdir='${sitedir}'${ruby_version_dir}
a54e24
 
a54e24
 AC_ARG_WITH(sitearchdir,
a54e24
 	    AS_HELP_STRING([--with-sitearchdir=DIR],
a54e24
 			   [architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
a54e24
             [sitearchdir=$withval],
a54e24
-            [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
a54e24
+            [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby'${ruby_version_dir}}${multiarch-'${sitelibdir}/${sitearch}'}])
a54e24
 
a54e24
 AC_ARG_WITH(vendordir,
a54e24
 	    AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
a54e24
             [vendordir=$withval],
a54e24
             [vendordir='${rubylibprefix}/vendor_ruby'])
a54e24
-vendorlibdir='${vendordir}/${ruby_version}'
a54e24
+vendorlibdir='${vendordir}'${ruby_version_dir}
a54e24
 
a54e24
 AC_ARG_WITH(vendorarchdir,
a54e24
 	    AS_HELP_STRING([--with-vendorarchdir=DIR],
a54e24
 			   [architecture dependent vendor libraries in DIR [[VENDORDIR/SITEARCH]], "no" to disable vendor directory]),
a54e24
             [vendorarchdir=$withval],
a54e24
-            [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
a54e24
+            [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}])
a54e24
 
a54e24
 AS_IF([test "${LOAD_RELATIVE+set}"], [
a54e24
     AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
9f47f6
@@ -3769,6 +3769,7 @@ AC_SUBST(sitearchincludedir)dnl
a54e24
 AC_SUBST(arch)dnl
a54e24
 AC_SUBST(sitearch)dnl
a54e24
 AC_SUBST(ruby_version)dnl
a54e24
+AC_SUBST(ruby_version_dir_name)dnl
a54e24
 AC_SUBST(rubylibdir)dnl
a54e24
 AC_SUBST(rubyarchdir)dnl
a54e24
 AC_SUBST(sitedir)dnl
a54e24
diff --git a/template/ruby.pc.in b/template/ruby.pc.in
a54e24
index 8a2c066..c81b211 100644
a54e24
--- a/template/ruby.pc.in
a54e24
+++ b/template/ruby.pc.in
a54e24
@@ -9,6 +9,7 @@ MAJOR=@MAJOR@
a54e24
 MINOR=@MINOR@
a54e24
 TEENY=@TEENY@
a54e24
 ruby_version=@ruby_version@
a54e24
+ruby_version_dir_name=@ruby_version_dir_name@
a54e24
 RUBY_API_VERSION=@RUBY_API_VERSION@
a54e24
 RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
a54e24
 RUBY_BASE_NAME=@RUBY_BASE_NAME@
a54e24
-- 
a54e24
2.1.0
a54e24
a54e24
a54e24
From 518850aba6eee76de7715aae8d37330e34b01983 Mon Sep 17 00:00:00 2001
a54e24
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
a54e24
Date: Tue, 31 Mar 2015 16:37:26 +0200
a54e24
Subject: [PATCH 2/4] Add ruby_version_dir_name support for RDoc.
a54e24
a54e24
---
a54e24
 lib/rdoc/ri/paths.rb | 2 +-
a54e24
 tool/rbinstall.rb    | 2 +-
a54e24
 2 files changed, 2 insertions(+), 2 deletions(-)
a54e24
a54e24
diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb
a54e24
index 970cb91..5bf8230 100644
a54e24
--- a/lib/rdoc/ri/paths.rb
a54e24
+++ b/lib/rdoc/ri/paths.rb
a54e24
@@ -10,7 +10,7 @@ module RDoc::RI::Paths
a54e24
   #:stopdoc:
a54e24
   require 'rbconfig'
a54e24
 
a54e24
-  version = RbConfig::CONFIG['ruby_version']
a54e24
+  version = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
a54e24
 
a54e24
   BASE    = if RbConfig::CONFIG.key? 'ridir' then
a54e24
               File.join RbConfig::CONFIG['ridir'], version
a54e24
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
a54e24
index d4c110e..d39c9a6 100755
a54e24
--- a/tool/rbinstall.rb
a54e24
+++ b/tool/rbinstall.rb
9f47f6
@@ -428,7 +428,7 @@ def CONFIG.[](name, mandatory = false)
a54e24
 
a54e24
 install?(:doc, :rdoc) do
a54e24
   if $rdocdir
a54e24
-    ridatadir = File.join(CONFIG['ridir'], CONFIG['ruby_version'], "system")
a54e24
+    ridatadir = File.join(CONFIG['ridir'], CONFIG['ruby_version_dir_name'] || CONFIG['ruby_version'], "system")
a54e24
     prepare "rdoc", ridatadir
a54e24
     install_recursive($rdocdir, ridatadir, :no_install => rdoc_noinst, :mode => $data_mode)
a54e24
   end
a54e24
-- 
a54e24
2.1.0
a54e24
a54e24
a54e24
From f8d136f9a46d1fe87eba622ab9665935d05e981b Mon Sep 17 00:00:00 2001
a54e24
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
a54e24
Date: Tue, 31 Mar 2015 16:37:44 +0200
a54e24
Subject: [PATCH 3/4] Add ruby_version_dir_name support for RubyGems.
a54e24
a54e24
---
a54e24
 lib/rubygems/defaults.rb  | 11 ++++++-----
a54e24
 test/rubygems/test_gem.rb |  5 +++--
a54e24
 2 files changed, 9 insertions(+), 7 deletions(-)
a54e24
a54e24
diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
a54e24
index 55ca080..75eea2b 100644
a54e24
--- a/lib/rubygems/defaults.rb
a54e24
+++ b/lib/rubygems/defaults.rb
a54e24
@@ -32,20 +32,20 @@ def self.default_dir
a54e24
              [
a54e24
                File.dirname(RbConfig::CONFIG['sitedir']),
a54e24
                'Gems',
a54e24
-               RbConfig::CONFIG['ruby_version']
a54e24
+               RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
a54e24
              ]
a54e24
            elsif RbConfig::CONFIG['rubylibprefix']
a54e24
              [
a54e24
                RbConfig::CONFIG['rubylibprefix'],
a54e24
                'gems',
a54e24
-               RbConfig::CONFIG['ruby_version']
a54e24
+               RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
a54e24
              ]
a54e24
            else
a54e24
              [
a54e24
                RbConfig::CONFIG['libdir'],
a54e24
                ruby_engine,
a54e24
                'gems',
a54e24
-               RbConfig::CONFIG['ruby_version']
a54e24
+               RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
a54e24
              ]
a54e24
            end
a54e24
 
a54e24
@@ -75,7 +75,8 @@ def self.default_rubygems_dirs
a54e24
 
a54e24
   def self.user_dir
a54e24
     parts = [Gem.user_home, '.gem', ruby_engine]
a54e24
-    parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty?
a54e24
+    ruby_version_dir_name = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
a54e24
+    parts << ruby_version_dir_name unless ruby_version_dir_name.empty?
a54e24
     File.join parts
a54e24
   end
a54e24
 
a54e24
@@ -172,7 +173,7 @@ def self.vendor_dir # :nodoc:
a54e24
     return nil unless RbConfig::CONFIG.key? 'vendordir'
a54e24
 
a54e24
     File.join RbConfig::CONFIG['vendordir'], 'gems',
a54e24
-              RbConfig::CONFIG['ruby_version']
a54e24
+              RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
a54e24
   end
a54e24
 
a54e24
   ##
a54e24
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
a54e24
index 0428bea..b6e090e 100644
a54e24
--- a/test/rubygems/test_gem.rb
a54e24
+++ b/test/rubygems/test_gem.rb
a54e24
@@ -1288,7 +1288,8 @@ def test_self_use_paths
a54e24
 
a54e24
   def test_self_user_dir
a54e24
     parts = [@userhome, '.gem', Gem.ruby_engine]
a54e24
-    parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty?
a54e24
+    ruby_version_dir_name = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
a54e24
+    parts << ruby_version_dir_name unless ruby_version_dir_name.empty?
a54e24
 
a54e24
     assert_equal File.join(parts), Gem.user_dir
a54e24
   end
a54e24
@@ -1365,7 +1366,7 @@ def test_self_gzip
a54e24
   def test_self_vendor_dir
a54e24
     expected =
a54e24
       File.join RbConfig::CONFIG['vendordir'], 'gems',
a54e24
-                RbConfig::CONFIG['ruby_version']
a54e24
+                RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
a54e24
 
a54e24
     assert_equal expected, Gem.vendor_dir
a54e24
   end
a54e24
-- 
a54e24
2.1.0
a54e24
a54e24
a54e24
From 88c38a030c22dbf9422ece847bdfbf87d6659313 Mon Sep 17 00:00:00 2001
a54e24
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
a54e24
Date: Wed, 1 Apr 2015 14:55:37 +0200
a54e24
Subject: [PATCH 4/4] Let headers directories follow the configured version
a54e24
 name.
a54e24
a54e24
---
a54e24
 configure.ac | 2 +-
a54e24
 1 file changed, 1 insertion(+), 1 deletion(-)
a54e24
a54e24
diff --git a/configure.ac b/configure.ac
a54e24
index a00f2b6776..999e2d6d5d 100644
a54e24
--- a/configure.ac
a54e24
+++ b/configure.ac
a54e24
@@ -101,7 +101,7 @@ RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
a54e24
 RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
a54e24
 AC_SUBST(RUBY_BASE_NAME)
a54e24
 AC_SUBST(RUBYW_BASE_NAME)
a54e24
-AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version}')
a54e24
+AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version_dir_name}')
a54e24
 
a54e24
 AC_CANONICAL_TARGET
a54e24
 test x"$target_alias" = x &&
a54e24
-- 
a54e24
2.1.0
a54e24