aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-13 18:58:32 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-14 09:00:13 +0900
commita2c66f52f402cb58372e271226f3341065561e53 (patch)
tree1163eaadd9bf06f52f4db4465b9b04b5a214f615 /ext
parente1a4e44f14482814a0540ae0a4b31d858ff56f53 (diff)
downloadruby-a2c66f52f402cb58372e271226f3341065561e53.tar.gz
Make dependency-free gemspec files
The default gems have not been installed yet in the build directory, bundled gems depending on them can not work. As those dependencies should be usable there even without rubygems, make temporary gemspec files without the dependencies, and use them in the build directory.
Diffstat (limited to 'ext')
-rwxr-xr-xext/extmk.rb11
1 files changed, 11 insertions, 0 deletions
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)