diff --git a/ext/extmk.rb b/ext/extmk.rb index 306d6e7c99..f805338404 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -565,6 +565,17 @@ clean-so:: end } +if @gemname + gemdir = File.join($top_srcdir, ext_prefix, @gemname) + if File.exist?(spec_file = File.join(gemdir, ".bundled.#{@gemname}.gemspec")) or + File.exist?(spec_file = File.join(gemdir, "#{@gemname}.gemspec")) + dest = "#{File.dirname(ext_prefix)}/specifications" + FileUtils.mkdir_p(dest) + File.copy_stream(spec_file, "#{dest}/#{@gemname}.gemspec") + puts "copied #{@gemname}.gemspec" + end +end + dir = Dir.pwd FileUtils::makedirs(ext_prefix) Dir::chdir(ext_prefix) diff --git a/tool/gem-unpack.rb b/tool/gem-unpack.rb index 16ee89f62d..0ba23ef4d3 100644 --- a/tool/gem-unpack.rb +++ b/tool/gem-unpack.rb @@ -18,5 +18,9 @@ def Gem.unpack(file, dir = nil, spec_dir = nil) end FileUtils.mkdir_p(spec_dir) File.binwrite(File.join(spec_dir, "#{spec.name}-#{spec.version}.gemspec"), spec.to_ruby) + unless spec.extensions.empty? or spec.dependencies.empty? + spec.dependencies.clear + end + File.binwrite(File.join(spec_dir, ".bundled.#{spec.name}-#{spec.version}.gemspec"), spec.to_ruby) puts "Unpacked #{file}" end