Skip to content

Commit 048b863

Browse files
install ext/*/lib as a part of stdlib
1 parent b5be6e1 commit 048b863

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Rakefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,23 @@ namespace :build do
298298
sh "make rbconfig.rb", chdir: build.build_dir
299299
end
300300

301+
task "#{build.name}-install" => ["#{build.name}-configure", "#{build.name}-libs", build.dest_dir] do
302+
next if File.exist?("#{build.dest_dir}-install")
303+
sh "make install DESTDIR=#{build.dest_dir}-install", chdir: build.build_dir
304+
end
305+
301306
desc "Build #{build.name}"
302-
task build.name => ["#{build.name}-configure", "#{build.name}-libs", build.dest_dir] do
307+
task build.name => ["#{build.name}-install", build.dest_dir] do
303308
artifact = "rubies/ruby-#{build.name}.tar.gz"
304309
next if File.exist?(artifact)
305-
sh "make install DESTDIR=#{build.dest_dir}", chdir: build.build_dir
310+
rm_rf build.dest_dir
311+
cp_r "#{build.dest_dir}-install", build.dest_dir
312+
libs = BUILD_PROFILES[params[:profile]][:user_exts]
313+
ruby_api_version = `#{build.baseruby_path} -e 'print RbConfig::CONFIG["ruby_version"]'`
314+
libs.each do |lib|
315+
next unless File.exist?("ext/#{lib}/lib")
316+
cp_r(File.join(base_dir, "ext/#{lib}/lib/."), File.join(build.dest_dir, "usr/local/lib/ruby/#{ruby_api_version}"))
317+
end
306318
sh "tar cfz #{artifact} -C rubies #{build.name}"
307319
end
308320

0 commit comments

Comments
 (0)