Skip to content

Commit

Permalink
use relative lib path instead of expanded path to avoid using mkmf
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmichaelgo committed Jul 31, 2023
1 parent 0eb68e0 commit de8d045
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/rake/extensiontask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ def define_compile_tasks(for_platform = nil, ruby_ver = RUBY_VERSION)
task "copy:#{@name}:#{platf}:#{ruby_ver}" => [lib_path, tmp_binary_path, "#{tmp_path}/Makefile"] do
# install in lib for native platform only
unless for_platform
expaned_lib_path = File.expand_path(lib_path)
relative_lib_path = Pathname(lib_path).relative_path_from(tmp_path)

make_command = "#{make}" \
" install" \
" sitearchdir=#{expaned_lib_path}" \
" sitelibdir=#{expaned_lib_path}" \
" target_prefix="
make_command_line = Shellwords.shellsplit(make)
make_command_line << "install"
make_command_line << "sitearchdir=#{relative_lib_path}"
make_command_line << "sitelibdir=#{relative_lib_path}"
make_command_line << "target_prefix="

sh(make_command, chdir: tmp_path)
sh(*make_command_line, chdir: tmp_path)
end
end
# copy binary from temporary location to staging directory
Expand Down

0 comments on commit de8d045

Please sign in to comment.