diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-02 16:17:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-02 16:17:22 +0000 |
commit | 32458a01eba62f1468e6fc4ad858b228a5425966 (patch) | |
tree | d9dd31641ca6ef6c7a6afa94495886a15b0cf6b9 /lib/rubygems | |
parent | 9b79ed12928174fa1b36d5aaa198f3de7edfd02f (diff) | |
download | ruby-32458a01eba62f1468e6fc4ad858b228a5425966.tar.gz |
ext_conf_builder.rb: hack for obsolete sytle gems
* lib/rubygems/ext/ext_conf_builder.rb
(Gem::Ext::ExtConfBuilder.hack_for_obsolete_sytle_gems): remove
circular dependencies for old style gems which locate extconf.rb on
the toplevel. [ruby-core:53059] [ruby-trunk - Bug #7698]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/ext/ext_conf_builder.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb index e11a1cdfbc..f3fc5d8e30 100644 --- a/lib/rubygems/ext/ext_conf_builder.rb +++ b/lib/rubygems/ext/ext_conf_builder.rb @@ -11,6 +11,18 @@ require 'tempfile' class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder + def self.hack_for_obsolete_sytle_gems(directory) + return unless directory and File.identical?(directory, ".") + mf = Gem.read_binary 'Makefile' + changed = false + changed |= mf.gsub!(/^(install-rb-default:)(.*)/) { + "#$1#{$2.gsub(/(?:^|\s+)\$\(RUBY(?:ARCH|LIB)DIR\)\/\S+(?=\s|$)/, '')}" + } + if changed + File.open('Makefile', 'wb') {|f| f.print mf} + end + end + def self.build(extension, directory, dest_path, results, args=[]) siteconf = Tempfile.open(%w"siteconf .rb", ".") do |f| f.puts "require 'rbconfig'" @@ -28,6 +40,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder run cmd, results + hack_for_obsolete_sytle_gems directory + make dest_path, results results |