[packages/ruby/DEVEL-2.7] - started updated to 2.7.6 (2.6.x is EOL); fails on changed gems installation paths

qboosh qboosh at pld-linux.org
Wed Sep 14 21:38:30 CEST 2022


commit 3797574e8040a2fe8881e9c9b4b4a4ed91efe3cf
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Sep 14 21:38:34 2022 +0200

    - started updated to 2.7.6 (2.6.x is EOL); fails on changed gems installation paths

 autoconf2.70.patch                     |  62 ------
 bison3.59.patch                        |  21 --
 ruby-version.patch                     |  46 ++---
 ruby.spec                              | 130 +++++++------
 rubygems-2.0.0-binary-extensions.patch | 344 ---------------------------------
 5 files changed, 90 insertions(+), 513 deletions(-)
---
diff --git a/ruby.spec b/ruby.spec
index b66cff9..ff22c4f 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -1,4 +1,5 @@
 # TODO:
+# - FIX gems installation paths
 #	- include ext/ in docs
 #	- replace ri with fastri
 #	- patch ri to search multiple indexes (one per package), so RPMs can install ri docs
@@ -12,12 +13,13 @@
 %bcond_with	bootstrap	# build bootstrap version
 %bcond_with	tests		# build without tests
 
-%define		rel		2
-%define		ruby_version	2.6
-%define		patchlevel	10
+%define		rel		0.1
+%define		ruby_version	2.7
+%define		patchlevel	6
 %define		pkg_version	%{ruby_version}.%{patchlevel}
-%define		ruby_suffix %{!?with_default_ruby:%{ruby_version}}
-%define		doc_version	2_6_9
+%define		ruby_suffix	%{!?with_default_ruby:%{ruby_version}}
+%define		doc_version	2_7_6
+%define		unicode_ver	12.1.0
 %define		oname	ruby
 Summary:	Ruby - interpreted scripting language
 Summary(ja.UTF-8):	オブジェクト指向言語Rubyインタプリタ
@@ -36,34 +38,32 @@ License:	(Ruby or BSD) and Public Domain and MIT and CC0 and zlib and UCD
 Group:		Development/Languages
 # https://www.ruby-lang.org/en/downloads/
 Source0:	https://cache.ruby-lang.org/pub/ruby/%{ruby_version}/%{oname}-%{pkg_version}.tar.xz
-# Source0-md5:	de4cf1c977d6dd05b9842015a9a21efd
-Source2:	https://www.ruby-doc.org/downloads/%{oname}_%{doc_version}_stdlib_rdocs.tgz
-# Source2-md5:	f726a5bd96f90969fb15b1e785375af5
-Source3:	https://www.ruby-doc.org/downloads/%{oname}_%{doc_version}_core_rdocs.tgz
-# Source3-md5:	53251c65f70f6e4e37ca0451b6268cac
-Source50:	https://www.unicode.org/Public/9.0.0/ucd/CaseFolding.txt
+# Source0-md5:	a426258d48bccd0178525f9dd57e5543
+Source2:	https://ruby-doc.org/downloads/%{oname}_%{doc_version}_stdlib_rdocs.tgz
+# Source2-md5:	8ea8e657d972d6cb72baa296c985b668
+Source3:	https://ruby-doc.org/downloads/%{oname}_%{doc_version}_core_rdocs.tgz
+%if 0
+# Source3-md5:	6a1cb2191d10c7478dfc39a925ca235e
+Source50:	https://www.unicode.org/Public/%{unicode_ver}/ucd/CaseFolding.txt
 # Source50-md5:	e3fbf2f626f10070000fe66f3a2ff5ef
-Source51:	https://www.unicode.org/Public/9.0.0/ucd/CompositionExclusions.txt
+Source51:	https://www.unicode.org/Public/%{unicode_ver}/ucd/CompositionExclusions.txt
 # Source51-md5:	263381d7b4b5e2d52a91e1bbbd4722d4
-Source52:	https://www.unicode.org/Public/9.0.0/ucd/NormalizationTest.txt
+Source52:	https://www.unicode.org/Public/%{unicode_ver}/ucd/NormalizationTest.txt
 # Source52-md5:	aacb8a8acfc449d09136fe39f3f97cf1
-Source53:	https://www.unicode.org/Public/9.0.0/ucd/SpecialCasing.txt
+Source53:	https://www.unicode.org/Public/%{unicode_ver}/ucd/SpecialCasing.txt
 # Source53-md5:	fea30f45a2f81ffa474fd984d297e2ea
-Source54:	https://www.unicode.org/Public/9.0.0/ucd/UnicodeData.txt
+Source54:	https://www.unicode.org/Public/%{unicode_ver}/ucd/UnicodeData.txt
 # Source54-md5:	dde25b1cf9bbb4ba1140ac12e4128b0b
+%endif
 Source4:	rdoc.1
 Source5:	testrb.1
 Source6:	operating_system.rb
-Patch0:		autoconf2.70.patch
-Patch1:		bison3.59.patch
 Patch2:		fix-bison-invocation.patch
 Patch3:		mkmf-verbose.patch
 Patch4:		strip-ccache.patch
 Patch5:		ruby-version.patch
 Patch6:		duplicated-paths.patch
 Patch7:		openssl3.patch
-# obsolete?
-Patch8:		rubygems-2.0.0-binary-extensions.patch
 Patch9:		custom-rubygems-location.patch
 Patch12:	archlibdir.patch
 URL:		http://www.ruby-lang.org/
@@ -108,54 +108,72 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define	_noautoreq	ipaddr
 
 # separate modules
-%define	bigdecimal_ver		1.4.1
-%define	bundler_ver		1.17.2
-%define	did_you_mean_ver	1.3.0
-%define	io_console_ver		0.4.7
+%define	bigdecimal_ver		2.0.0
+%define	bundler_ver		2.1.4
+%define	did_you_mean_ver	1.4.0
+%define	io_console_ver		0.5.6
 %define	irb_ver			1.0.0
-%define	json_ver		2.1.0
-%define	minitest_ver		5.11.3
+%define	json_ver		2.3.0
+%define	minitest_ver		5.13.0
 %define	net_telnet_ver		0.2.0
-%define	power_assert_ver	1.1.3
+%define	power_assert_ver	1.1.7
 %define	psych_ver		3.1.0
-%define	rake_ver		12.3.3
-%define	rdoc_ver		6.1.2.1
-%define	rubygems_ver		3.0.3.1
-%define	test_unit_ver		3.2.9
+%define	rake_ver		13.0.1
+%define	rdoc_ver		6.2.1.1
+%define	rubygems_ver		3.1.6
+%define	test_unit_ver		3.3.4
 %define	xmlrpc_ver		0.3.0
 # default modules, separated
-%define	irb_ver			1.0.0
+%define	irb_ver			1.2.6
 # default modules packaged in main modules
 %define	cmath_ver		1.0.0
-%define	csv_ver			3.0.9
-%define	date_ver		2.0.3
-%define	dbm_ver			1.0.0
+%define	csv_ver			3.1.2
+%define	date_ver		3.0.3
+%define	dbm_ver			1.1.0
 %define	e2mmap_ver		0.1.0
-%define	etc_ver			1.0.1
+%define	etc_ver			1.1.0
 %define	fcntl_ver		1.0.0
 %define	fiddle_ver		1.0.0
-%define	fileutils_ver		1.1.0
-%define	forwardable_ver		1.2.0
-%define	gdbm_ver		2.0.0
+%define	fileutils_ver		1.4.1
+%define	forwardable_ver		1.3.1
+%define	gdbm_ver		2.1.0
 %define	ipaddr_ver		1.2.2
-%define	logger_ver		1.3.0
-%define	matrix_ver		0.1.0
+%define	logger_ver		1.4.2
+%define	matrix_ver		0.2.0
 %define	mutex_m_ver		0.1.0
-%define	ostruct_ver		0.1.0
-%define	openssl_ver		2.1.2
-%define	prime_ver		0.1.0
-%define	rexml_ver		3.1.9.1
-%define	rss_ver			0.2.7
+%define	ostruct_ver		0.2.0
+%define	openssl_ver		2.1.3
+%define	prime_ver		0.1.1
+%define	rexml_ver		3.2.3.1
+%define	rss_ver			0.2.8
 %define	scanf_ver		1.0.0
 %define	sdbm_ver		1.0.0
 %define	shell_ver		0.7
-%define	stringio_ver		0.0.2
-%define	strscan_ver		1.0.0
+%define	stringio_ver		0.1.0
+%define	strscan_ver		1.0.3
 %define	sync_ver		0.5.0
 %define	thwait_ver		0.1.0
 %define	tracer_ver		0.1.0
-%define	webrick_ver		1.4.4
-%define	zlib_ver		1.0.0
+%define	webrick_ver		1.6.1
+%define	zlib_ver		1.1.0
+
+%define	benchmark_ver		0.1.0
+%define	cgi_ver			0.1.0.1
+%define	delegate_ver		0.1.0
+%define	getoptlong_ver		0.1.0
+%define	net_pop_ver		0.1.0
+%define	net_smtp_ver		0.1.0
+%define	observer_ver		0.1.0
+%define	open3_ver		0.1.0
+%define	pstore_ver		0.1.0
+%define	racc_ver		1.4.16
+%define	readline_ver		0.0.2
+%define	readline_ext_ver	0.1.0
+%define	reline_ver		0.1.5
+%define	singleton_ver		0.1.0
+%define	timeout_ver		0.1.0
+%define	uri_ver			0.1.0
+%define	yaml_ver		0.1.0
 
 %define	ruby_ridir		%{_datadir}/ri/system
 %define	gem_dir			%{_datadir}/gems
@@ -681,20 +699,19 @@ wywołującego je. Aby to osiągnąć wystarczy bardzo mało kodu.
 
 %prep
 %setup -q -n %{oname}-%{pkg_version} -a2 -a3
-%patch0 -p1
-%patch1 -p1
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
-#%patch8 -p1
 %patch9 -p1
 %patch12 -p1
 
-install -d enc/unicode/data/9.0.0
-cp -p %{SOURCE50} %{SOURCE51} %{SOURCE52} %{SOURCE53} %{SOURCE54} enc/unicode/data/9.0.0/
+%if 0
+install -d enc/unicode/data/%{unicode_ver}
+cp -p %{SOURCE50} %{SOURCE51} %{SOURCE52} %{SOURCE53} %{SOURCE54} enc/unicode/data/%{unicode_ver}
+%endif
 
 # must be regenerated with new bison
 %{__rm} parse.{c,h}
@@ -715,7 +732,7 @@ find -type f '(' -name '*.rb' -o -name '*.cgi' -o -name '*.test' \
 
 %if %{with bootstrap}
 # avoid regeneration, needs iostring module
-touch enc/unicode/9.0.0/*.h
+touch enc/unicode/%{unicode_ver}/*.h
 %endif
 
 %build
@@ -868,7 +885,7 @@ install -d $RPM_BUILD_ROOT%{gem_dir}/gems/bigdecimal-%{bigdecimal_ver}/lib
 install -d $RPM_BUILD_ROOT%{gem_libdir}/bigdecimal-%{bigdecimal_ver}/lib/bigdecimal
 %{__mv} $RPM_BUILD_ROOT%{ruby_libdir}/bigdecimal $RPM_BUILD_ROOT%{gem_dir}/gems/bigdecimal-%{bigdecimal_ver}/lib
 %{__mv} $RPM_BUILD_ROOT%{ruby_libarchdir}/bigdecimal.so $RPM_BUILD_ROOT%{gem_libdir}/bigdecimal-%{bigdecimal_ver}/lib
-%{__mv} $RPM_BUILD_ROOT%{ruby_libarchdir}/bigdecimal/util.so $RPM_BUILD_ROOT%{gem_libdir}/bigdecimal-%{bigdecimal_ver}/lib/bigdecimal/
+#%{__mv} $RPM_BUILD_ROOT%{ruby_libarchdir}/bigdecimal/util.so $RPM_BUILD_ROOT%{gem_libdir}/bigdecimal-%{bigdecimal_ver}/lib/bigdecimal/
 %{__mv} $RPM_BUILD_ROOT%{gem_dir}/specifications/default/bigdecimal-%{bigdecimal_ver}.gemspec $RPM_BUILD_ROOT%{gem_dir}/specifications
 ln -s %{gem_dir}/gems/bigdecimal-%{bigdecimal_ver}/lib/bigdecimal $RPM_BUILD_ROOT%{ruby_libdir}/bigdecimal
 ln -s %{gem_libdir}/bigdecimal-%{bigdecimal_ver}/lib/bigdecimal.so $RPM_BUILD_ROOT%{ruby_libarchdir}/bigdecimal.so
@@ -955,7 +972,6 @@ done
 	$RPM_BUILD_ROOT%{ruby_libdir}/abbrev.rb \
 	$RPM_BUILD_ROOT%{gem_dir}/gems/rake-%{rake_ver}/exe/rake \
 	$RPM_BUILD_ROOT%{gem_dir}/gems/rdoc-%{rdoc_ver}/exe/{rdoc,ri} \
-	$RPM_BUILD_ROOT%{gem_dir}/gems/bundler-%{bundler_ver}/exe/{bundle,bundler} \
 	$RPM_BUILD_ROOT%{_examplesdir}/%{oname}-%{pkg_version}/{cal,test,time,uumerge}.rb \
 	$RPM_BUILD_ROOT%{_examplesdir}/%{oname}-%{pkg_version}/{drb,logger,openssl,ripper,rss}/*.rb \
 	$RPM_BUILD_ROOT%{_examplesdir}/%{oname}-%{pkg_version}/webrick/*.cgi
diff --git a/autoconf2.70.patch b/autoconf2.70.patch
deleted file mode 100644
index d5d03ac..0000000
--- a/autoconf2.70.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From fcc88da5eb162043adcba552646677d2ab5adf55 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox at 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 at gentoo.org>
----
- configure.ac | 15 ++++++++-------
- 1 file changed, 8 insertions(+), 7 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index a5e3dc76f6f5..4e4a52f066d6 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_IF([test x"${build}" != x"${host}"], [
-   AC_CHECK_TOOL(CC, gcc)
diff --git a/bison3.59.patch b/bison3.59.patch
deleted file mode 100644
index d434eb2..0000000
--- a/bison3.59.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From 47720e2255f34ecad49763c66a7ea02a55a3f60a Mon Sep 17 00:00:00 2001
-From: Nobuyoshi Nakada <nobu at ruby-lang.org>
-Date: Mon, 4 May 2020 13:35:38 +0900
-Subject: [PATCH] Bison 3.59.1 folds yydestruct function header
-
----
- tool/ytab.sed | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/tool/ytab.sed b/tool/ytab.sed
-index ba7566ac7fab..95a9b3e1eb33 100755
---- a/tool/ytab.sed
-+++ b/tool/ytab.sed
-@@ -14,6 +14,7 @@ a\
- }
- /^yydestruct.*yymsg/,/{/{
-   /^yydestruct/{
-+    /,$/N
-     /[, *]p)/!{
-       H
-       s/^/ruby_parser_&/
diff --git a/ruby-version.patch b/ruby-version.patch
index 43ed045..a962e1a 100644
--- a/ruby-version.patch
+++ b/ruby-version.patch
@@ -194,35 +194,25 @@ Subject: [PATCH 3/4] Add ruby_version_dir_name support for RubyGems.
  test/rubygems/test_gem.rb |  5 +++--
  2 files changed, 9 insertions(+), 7 deletions(-)
 
-diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
-index 55ca080..75eea2b 100644
---- a/lib/rubygems/defaults.rb
-+++ b/lib/rubygems/defaults.rb
-@@ -32,20 +32,20 @@ def self.default_dir
+--- ruby-2.7.6/lib/rubygems/defaults.rb.orig	2022-04-12 13:25:48.000000000 +0200
++++ ruby-2.7.6/lib/rubygems/defaults.rb	2022-09-08 19:29:57.011900694 +0200
+@@ -32,13 +32,13 @@ module Gem
               [
                 File.dirname(RbConfig::CONFIG['sitedir']),
                 'Gems',
 -               RbConfig::CONFIG['ruby_version']
-+               RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
-              ]
-            elsif RbConfig::CONFIG['rubylibprefix']
-              [
-                RbConfig::CONFIG['rubylibprefix'],
-                'gems',
--               RbConfig::CONFIG['ruby_version']
 +               RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
               ]
             else
               [
-                RbConfig::CONFIG['libdir'],
-                ruby_engine,
+                RbConfig::CONFIG['rubylibprefix'],
                 'gems',
 -               RbConfig::CONFIG['ruby_version']
 +               RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
               ]
             end
  
-@@ -75,7 +75,8 @@ def self.default_rubygems_dirs
+@@ -75,7 +75,8 @@ module Gem
  
    def self.user_dir
      parts = [Gem.user_home, '.gem', ruby_engine]
@@ -232,7 +222,7 @@ index 55ca080..75eea2b 100644
      File.join parts
    end
  
-@@ -172,7 +173,7 @@ def self.vendor_dir # :nodoc:
+@@ -158,7 +159,7 @@ module Gem
      return nil unless RbConfig::CONFIG.key? 'vendordir'
  
      File.join RbConfig::CONFIG['vendordir'], 'gems',
@@ -241,11 +231,9 @@ index 55ca080..75eea2b 100644
    end
  
    ##
-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
-@@ -1288,7 +1288,8 @@ def test_self_use_paths
+--- ruby-2.7.6/test/rubygems/test_gem.rb.orig	2022-04-12 13:25:48.000000000 +0200
++++ ruby-2.7.6/test/rubygems/test_gem.rb	2022-09-08 19:32:06.067868205 +0200
+@@ -1378,7 +1378,8 @@ class TestGem < Gem::TestCase
  
    def test_self_user_dir
      parts = [@userhome, '.gem', Gem.ruby_engine]
@@ -255,15 +243,15 @@ index 0428bea..b6e090e 100644
  
      assert_equal File.join(parts), Gem.user_dir
    end
-@@ -1365,7 +1366,7 @@ def test_self_gzip
-   def test_self_vendor_dir
-     expected =
-       File.join RbConfig::CONFIG['vendordir'], 'gems',
--                RbConfig::CONFIG['ruby_version']
-+                RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
+@@ -1454,7 +1455,7 @@ class TestGem < Gem::TestCase
+     vendordir(File.join(@tempdir, 'vendor')) do
+       expected =
+         File.join RbConfig::CONFIG['vendordir'], 'gems',
+-                  RbConfig::CONFIG['ruby_version']
++                  RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
  
-     assert_equal expected, Gem.vendor_dir
-   end
+       assert_equal expected, Gem.vendor_dir
+     end
 -- 
 2.1.0
 
diff --git a/rubygems-2.0.0-binary-extensions.patch b/rubygems-2.0.0-binary-extensions.patch
deleted file mode 100644
index 4876d35..0000000
--- a/rubygems-2.0.0-binary-extensions.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-From ec90622235ae19b28a327cb50a10e0311e8f3d71 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
-Date: Thu, 3 Nov 2011 16:43:05 +0100
-Subject: [PATCH 1/8] Add dedicate extensions folder into $LOAD_PATH.
-
----
- lib/rubygems/specification.rb | 32 ++++++++++++++++++++++++++++++--
- 1 file changed, 30 insertions(+), 2 deletions(-)
-
-diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
-index cabdf8d..87b14d2 100644
---- a/lib/rubygems/specification.rb
-+++ b/lib/rubygems/specification.rb
-@@ -1256,6 +1256,12 @@ class Gem::Specification
-       File.join full_gem_path, path
-     end
- 
-+    unless extensions.empty?
-+      paths += require_paths.map do |path|
-+        File.join ext_dir, path
-+      end
-+    end
-+
-     # gem directories must come after -I and ENV['RUBYLIB']
-     insert_index = Gem.load_path_insert_index
- 
-@@ -1374,11 +1380,16 @@ class Gem::Specification
- 
-   def contains_requirable_file? file
-     root     = full_gem_path
-+    ext      = ext_dir
-     suffixes = Gem.suffixes
- 
-     require_paths.any? do |lib|
--      base = "#{root}/#{lib}/#{file}"
--      suffixes.any? { |suf| File.file? "#{base}#{suf}" }
-+      base = ["#{root}/#{lib}/#{file}"]
-+      base << "#{ext}/#{lib}/#{file}" unless extensions.empty?
-+
-+      base.any? do |path|
-+        suffixes.any? { |suf| File.file? "#{path}#{suf}" }
-+      end
-     end
-   end
- 
-@@ -1674,6 +1685,23 @@ class Gem::Specification
-   end
- 
-   ##
-+  # Returns the full path to this spec's ext directory.
-+  # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
-+
-+  def ext_dir
-+    @gem_dir ||= File.expand_path File.join(exts_dir, full_name)
-+  end
-+
-+  ##
-+  # Returns the full path to the exts directory containing this spec's
-+  # gem directory. eg: /usr/local/lib/ruby/1.8/exts
-+
-+  def exts_dir
-+    # TODO: this logic seems terribly broken, but tests fail if just base_dir
-+    @exts_dir ||= File.join(loaded_from && base_dir || Gem.dir, "exts")
-+  end
-+
-+  ##
-   # Deprecated and ignored, defaults to true.
-   #
-   # Formerly used to indicate this gem was RDoc-capable.
--- 
-1.8.1.2
-
-
-From e42819f32fc5d935f7e7189ec4be8bdab0a2cf3f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
-Date: Wed, 16 Nov 2011 13:26:48 +0100
-Subject: [PATCH 2/8] Use spec's ext dir for extension installation.
-
----
- lib/rubygems/installer.rb     | 2 +-
- lib/rubygems/specification.rb | 7 +++----
- 2 files changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
-index 780a88b..854c177 100644
---- a/lib/rubygems/installer.rb
-+++ b/lib/rubygems/installer.rb
-@@ -646,7 +646,7 @@ TEXT
-       say "This could take a while..."
-     end
- 
--    dest_path = File.join gem_dir, spec.require_paths.first
-+    dest_path = spec.ext_dir
-     ran_rake = false # only run rake once
- 
-     spec.extensions.each do |extension|
-diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
-index 87b14d2..492ddbe 100644
---- a/lib/rubygems/specification.rb
-+++ b/lib/rubygems/specification.rb
-@@ -1689,16 +1689,15 @@ class Gem::Specification
-   # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
- 
-   def ext_dir
--    @gem_dir ||= File.expand_path File.join(exts_dir, full_name)
-+    @ext_dir ||= File.join exts_dir, full_name, require_paths.first
-   end
- 
-   ##
-   # Returns the full path to the exts directory containing this spec's
--  # gem directory. eg: /usr/local/lib/ruby/1.8/exts
-+  # gem directory. eg: /usr/local/lib/ruby/1.8/gems
- 
-   def exts_dir
--    # TODO: this logic seems terribly broken, but tests fail if just base_dir
--    @exts_dir ||= File.join(loaded_from && base_dir || Gem.dir, "exts")
-+    @exts_dir ||= gems_dir
-   end
- 
-   ##
--- 
-1.8.1.2
-
-
-From 0e9dd0655111f7dda805233c79a3771459d9a66a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
-Date: Wed, 16 Nov 2011 14:52:16 +0100
-Subject: [PATCH 3/9] Simplify the extending of $LOAD_PATH for binary gems.
-
----
- lib/rubygems/specification.rb | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
-index 492ddbe..c703827 100644
---- a/lib/rubygems/specification.rb
-+++ b/lib/rubygems/specification.rb
-@@ -1256,11 +1256,7 @@ class Gem::Specification
-       File.join full_gem_path, path
-     end
- 
--    unless extensions.empty?
--      paths += require_paths.map do |path|
--        File.join ext_dir, path
--      end
--    end
-+    paths << ext_dir unless extensions.empty? || paths.include?(ext_dir)
- 
-     # gem directories must come after -I and ENV['RUBYLIB']
-     insert_index = Gem.load_path_insert_index
-@@ -1697,7 +1693,10 @@ class Gem::Specification
-   # gem directory. eg: /usr/local/lib/ruby/1.8/gems
- 
-   def exts_dir
--    @exts_dir ||= gems_dir
-+    @exts_dir ||= begin
-+      dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
-+      dirs ? File.join(dirs.last[:ext_dir], 'exts') : gems_dir
-+    end
-   end
- 
-   ##
--- 
-1.8.1.2
-
-
-From 9a8556c609e800d0dbd24af416d613f2e82f323c Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
-Date: Fri, 9 Dec 2011 16:31:04 +0100
-Subject: [PATCH 4/8] Fix the binary extension search path construction.
-
----
- lib/rubygems/installer.rb     | 2 +-
- lib/rubygems/specification.rb | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
-index 854c177..f1f2ad7 100644
---- a/lib/rubygems/installer.rb
-+++ b/lib/rubygems/installer.rb
-@@ -646,7 +646,7 @@ TEXT
-       say "This could take a while..."
-     end
- 
--    dest_path = spec.ext_dir
-+    dest_path = File.join spec.ext_dir, spec.require_paths.first
-     ran_rake = false # only run rake once
- 
-     spec.extensions.each do |extension|
-diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
-index c703827..fa9ea6e 100644
---- a/lib/rubygems/specification.rb
-+++ b/lib/rubygems/specification.rb
-@@ -1256,7 +1256,7 @@ class Gem::Specification
-       File.join full_gem_path, path
-     end
- 
--    paths << ext_dir unless extensions.empty? || paths.include?(ext_dir)
-+    paths << File.join(ext_dir, require_paths.first) unless extensions.empty? || (ext_dir == full_gem_path)
- 
-     # gem directories must come after -I and ENV['RUBYLIB']
-     insert_index = Gem.load_path_insert_index
-@@ -1685,7 +1685,7 @@ class Gem::Specification
-   # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
- 
-   def ext_dir
--    @ext_dir ||= File.join exts_dir, full_name, require_paths.first
-+    @ext_dir ||= File.join exts_dir, full_name
-   end
- 
-   ##
--- 
-1.8.1.2
-
-
-From 476c2f90cc6f5f490858f253a9b23eb19d53d2fc Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
-Date: Tue, 13 Dec 2011 12:14:54 +0100
-Subject: [PATCH 5/8] Remove binary extensions during uninstall.
-
----
- lib/rubygems/uninstaller.rb | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb
-index d672b9d..5c31a0c 100644
---- a/lib/rubygems/uninstaller.rb
-+++ b/lib/rubygems/uninstaller.rb
-@@ -246,6 +246,7 @@ class Gem::Uninstaller
-       File.writable?(spec.base_dir)
- 
-     FileUtils.rm_rf spec.full_gem_path
-+    FileUtils.rm_rf spec.ext_dir
- 
-     # TODO: should this be moved to spec?... I vote eww (also exists in docmgr)
-     old_platform_name = [spec.name,
--- 
-1.8.1.2
-
-
-From 35dc17e86f701fe1be80d98ace79735c535fd570 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
-Date: Tue, 13 Dec 2011 14:27:14 +0100
-Subject: [PATCH 6/8] Avoid dependency on customized operating_system.rb.
-
----
- lib/rubygems/defaults.rb      | 11 +++++++++++
- lib/rubygems/specification.rb |  5 +----
- 2 files changed, 12 insertions(+), 4 deletions(-)
-
-diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
-index ea84e5c..b221954 100644
---- a/lib/rubygems/defaults.rb
-+++ b/lib/rubygems/defaults.rb
-@@ -101,6 +101,17 @@ module Gem
-   end
- 
-   ##
-+  # Returns binary extensions dir for specified RubyGems base dir or nil
-+  # if such directory cannot be determined.
-+  #
-+  # By default, the binary extensions are located side by side with their
-+  # Ruby counterparts, therefore nil is returned
-+
-+  def self.default_ext_dir_for base_dir
-+    nil
-+  end
-+
-+  ##
-   # A wrapper around RUBY_ENGINE const that may not be defined
- 
-   def self.ruby_engine
-diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
-index fa9ea6e..2b10499 100644
---- a/lib/rubygems/specification.rb
-+++ b/lib/rubygems/specification.rb
-@@ -1693,10 +1693,7 @@ class Gem::Specification
-   # gem directory. eg: /usr/local/lib/ruby/1.8/gems
- 
-   def exts_dir
--    @exts_dir ||= begin
--      dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
--      dirs ? File.join(dirs.last[:ext_dir], 'exts') : gems_dir
--    end
-+    @exts_dir ||= Gem.default_ext_dir_for(base_dir) || gems_dir
-   end
- 
-   ##
--- 
-1.8.1.2
-
-
-From 0937c0b0a3c2ed08ab5b0875f7f95e24157525c2 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
-Date: Thu, 7 Feb 2013 13:07:34 +0100
-Subject: [PATCH 7/8] Fix binary extensions installation when --install-dir is
- specified.
-
----
- lib/rubygems/installer.rb | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
-index f1f2ad7..e1577fc 100644
---- a/lib/rubygems/installer.rb
-+++ b/lib/rubygems/installer.rb
-@@ -646,7 +646,7 @@ TEXT
-       say "This could take a while..."
-     end
- 
--    dest_path = File.join spec.ext_dir, spec.require_paths.first
-+    dest_path = File.join(options[:install_dir] ? gem_dir : spec.ext_dir, spec.require_paths.first)
-     ran_rake = false # only run rake once
- 
-     spec.extensions.each do |extension|
--- 
-1.8.1.2
-
-
-From 062a11c59731f5875d5a8821a212c8a41cb84577 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
-Date: Fri, 15 Feb 2013 17:07:07 +0100
-Subject: [PATCH 8/8] Use correct option.
-
----
- lib/rubygems/installer.rb | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
-index e1577fc..1492c68 100644
---- a/lib/rubygems/installer.rb
-+++ b/lib/rubygems/installer.rb
-@@ -646,7 +646,7 @@ TEXT
-       say "This could take a while..."
-     end
- 
--    dest_path = File.join(options[:install_dir] ? gem_dir : spec.ext_dir, spec.require_paths.first)
-+    dest_path = File.join(@install_dir ? gem_dir : spec.ext_dir, spec.require_paths.first)
-     ran_rake = false # only run rake once
- 
-     spec.extensions.each do |extension|
--- 
-1.8.1.2
-
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list