[前][次][番号順一覧][スレッド一覧]

ruby-changes:27738

From: nagachika <ko1@a...>
Date: Sun, 17 Mar 2013 23:22:55 +0900 (JST)
Subject: [ruby-changes:27738] nagachika:r39790 (ruby_2_0_0): merge revision(s) 39560,39562,39572: [Backport #7991]

nagachika	2013-03-17 23:22:43 +0900 (Sun, 17 Mar 2013)

  New Revision: 39790

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39790

  Log:
    merge revision(s) 39560,39562,39572: [Backport #7991]
    
    * 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]
      (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
    
    * lib/rubygems/ext/ext_conf_builder.rb
      (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
      circular dependencies in install-so too.  [ruby-core:52882]
      [Bug #7698]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb
    branches/ruby_2_0_0/test/rubygems/test_gem_installer.rb
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 39789)
+++ ruby_2_0_0/ChangeLog	(revision 39790)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Mar 17 23:22:22 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/rubygems/ext/ext_conf_builder.rb
+	  (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
+	  circular dependencies in install-so too.  [ruby-core:52882]
+	  [Bug #7698]
+
 Sun Mar 17 23:19:34 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
Index: ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb
===================================================================
--- ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb	(revision 39789)
+++ ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb	(revision 39790)
@@ -11,6 +11,21 @@ require 'tempfile' https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb#L11
 
 class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
 
+  def self.hack_for_obsolete_style_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|$)/, '')}"
+    }
+    changed |= mf.gsub!(/^(install-so:.*DLLIB.*\n)((?:\t.*\n)+)/) {
+      "#$1#{$2.gsub(/.*INSTALL.*DLLIB.*\n/, '')}"
+    }
+    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 +43,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/ext/ext_conf_builder.rb#L43
 
     run cmd, results
 
+    hack_for_obsolete_style_gems directory
+
     make dest_path, results
 
     results
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 39789)
+++ ruby_2_0_0/version.h	(revision 39790)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-03-17"
-#define RUBY_PATCHLEVEL 60
+#define RUBY_PATCHLEVEL 61
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_0_0/test/rubygems/test_gem_installer.rb
===================================================================
--- ruby_2_0_0/test/rubygems/test_gem_installer.rb	(revision 39789)
+++ ruby_2_0_0/test/rubygems/test_gem_installer.rb	(revision 39790)
@@ -1011,6 +1011,38 @@ load Gem.bin_path('a', 'executable', ver https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_installer.rb#L1011
     assert File.exist?(File.join(@spec.gem_dir, rb))
   end
 
+  def test_install_extension_flat
+    @spec.require_paths = ["."]
+
+    @spec.extensions << "extconf.rb"
+
+    write_file File.join(@tempdir, "extconf.rb") do |io|
+      io.write <<-RUBY
+        require "mkmf"
+
+        CONFIG['CC'] = '$(TOUCH) $@ ||'
+        CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
+
+        create_makefile("#{@spec.name}")
+      RUBY
+    end
+
+    # empty depend file for no auto dependencies
+    @spec.files += %W"depend #{@spec.name}.c".each {|file|
+      write_file File.join(@tempdir, file)
+    }
+
+    so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
+    assert !File.exist?(so)
+    use_ui @ui do
+      path = Gem::Package.build @spec
+
+      @installer = Gem::Installer.new path
+      @installer.install
+    end
+    assert File.exist?(so)
+  end
+
   def test_installation_satisfies_dependency_eh
     quick_spec 'a'
 

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39560,39562,39572


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]