[rubygems/rubygems] Disable install_extension_in_lib
when cross-compiling
https://github.com/rubygems/rubygems/commit/643e154f32
This commit is contained in:
parent
3e4b694565
commit
97a23db5ac
@ -45,7 +45,10 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|||||||
|
|
||||||
full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
|
full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
|
||||||
|
|
||||||
if Gem.install_extension_in_lib && lib_dir
|
is_cross_compiling = target_rbconfig["platform"] != RbConfig::CONFIG["platform"]
|
||||||
|
# Do not copy extension libraries by default when cross-compiling
|
||||||
|
# not to conflict with the one already built for the host platform.
|
||||||
|
if Gem.install_extension_in_lib && lib_dir && !is_cross_compiling
|
||||||
FileUtils.mkdir_p lib_dir
|
FileUtils.mkdir_p lib_dir
|
||||||
entries = Dir.entries(full_tmp_dest) - %w[. ..]
|
entries = Dir.entries(full_tmp_dest) - %w[. ..]
|
||||||
entries = entries.map {|entry| File.join full_tmp_dest, entry }
|
entries = entries.map {|entry| File.join full_tmp_dest, entry }
|
||||||
|
@ -330,6 +330,7 @@ install:
|
|||||||
end
|
end
|
||||||
f.puts "RbConfig::CONFIG['host_os'] = 'fake_os'"
|
f.puts "RbConfig::CONFIG['host_os'] = 'fake_os'"
|
||||||
f.puts "RbConfig::CONFIG['arch'] = 'fake_arch'"
|
f.puts "RbConfig::CONFIG['arch'] = 'fake_arch'"
|
||||||
|
f.puts "RbConfig::CONFIG['platform'] = 'fake_platform'"
|
||||||
end
|
end
|
||||||
|
|
||||||
system(Gem.ruby, "-rmkmf", "-e", "exit MakeMakefile::RbConfig::CONFIG['host_os'] == 'fake_os'",
|
system(Gem.ruby, "-rmkmf", "-e", "exit MakeMakefile::RbConfig::CONFIG['host_os'] == 'fake_os'",
|
||||||
@ -340,6 +341,9 @@ install:
|
|||||||
@builder = Gem::Ext::Builder.new @spec, "", Gem::TargetRbConfig.from_path(fake_rbconfig)
|
@builder = Gem::Ext::Builder.new @spec, "", Gem::TargetRbConfig.from_path(fake_rbconfig)
|
||||||
|
|
||||||
FileUtils.mkdir_p @spec.gem_dir
|
FileUtils.mkdir_p @spec.gem_dir
|
||||||
|
lib_dir = File.join(@spec.gem_dir, "lib")
|
||||||
|
|
||||||
|
FileUtils.mkdir lib_dir
|
||||||
|
|
||||||
File.open File.join(@spec.gem_dir, "extconf.rb"), "w" do |f|
|
File.open File.join(@spec.gem_dir, "extconf.rb"), "w" do |f|
|
||||||
f.write <<-'RUBY'
|
f.write <<-'RUBY'
|
||||||
@ -367,6 +371,7 @@ install:
|
|||||||
arch=fake_arch
|
arch=fake_arch
|
||||||
DUMP
|
DUMP
|
||||||
assert_path_exist @spec.extension_dir
|
assert_path_exist @spec.extension_dir
|
||||||
|
assert_equal [], Dir.glob(File.join(lib_dir, "*"))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_initialize
|
def test_initialize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user