summaryrefslogtreecommitdiff
path: root/lib/rubygems/ext/ext_conf_builder.rb
diff options
context:
space:
mode:
authorYuta Saito <[email protected]>2024-05-04 21:23:36 +0000
committergit <[email protected]>2024-06-18 00:59:35 +0000
commit273d41b9e3c90d4d3fe2ffcb88477197d528b9a0 ()
tree4449b79880de2d84cd1e82651f61902db35aeb8e /lib/rubygems/ext/ext_conf_builder.rb
parent91bbb7831301f405c56b5de1bd9e7a79f4d302b5 (diff)
[rubygems/rubygems] Add `--target-rbconfig` option to `gem install` and `gem update` commands
This adds `--target-rbconfig` option to specify the rbconfig.rb file for the deployment target platform. This is useful when cross-compiling gems. At the moment, this option is only available for `extconf.rb`-based extensions. https://.com/rubygems/rubygems/commit/cf2843f7a2
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb8
1 files changed, 5 insertions, 3 deletions
@@ -7,7 +7,8 @@
#++
class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
- def self.build(extension, dest_path, results, args=[], lib_dir=nil, extension_dir=Dir.pwd)
require "fileutils"
require "tempfile"
@@ -23,6 +24,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
begin
cmd = ruby << File.basename(extension)
cmd.push(*args)
run(cmd, results, class_name, extension_dir) do |s, r|
@@ -39,7 +41,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
ENV["DESTDIR"] = nil
- make dest_path, results, extension_dir, tmp_dest_relative
full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
@@ -55,7 +57,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
destent.exist? || FileUtils.mv(ent.path, destent.path)
end
- make dest_path, results, extension_dir, tmp_dest_relative, ["clean"]
ensure
ENV["DESTDIR"] = destdir
end