Skip to content

Commit

Permalink
Merge pull request #5057 from rubygems/fixup-destdir-fix
Browse files Browse the repository at this point in the history
Set DESTDIR with GNU Make
  • Loading branch information
hsbt committed Nov 6, 2021
2 parents 03b11fc + 7fd987d commit 9caab60
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/rubygems/ext/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def self.make(dest_path, results, make_dir = Dir.pwd)

# try to find make program from Ruby configure arguments first
RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/
make_program = ENV['MAKE'] || ENV['make'] || $1
unless make_program
make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
make_program_name = ENV['MAKE'] || ENV['make'] || $1
unless make_program_name
make_program_name = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
end
make_program = Shellwords.split(make_program)
make_program = Shellwords.split(make_program_name)

# The installation of the bundled gems is failed when DESTDIR is empty in mswin platform.
destdir = (ENV['DESTDIR'] && ENV['DESTDIR'] != "") ? 'DESTDIR=%s' % ENV['DESTDIR'] : ''
destdir = (/\bnmake/i !~ make_program_name || ENV['DESTDIR'] && ENV['DESTDIR'] != "") ? 'DESTDIR=%s' % ENV['DESTDIR'] : ''

['clean', '', 'install'].each do |target|
# Pass DESTDIR via command line to override what's in MAKEFLAGS
Expand Down

0 comments on commit 9caab60

Please sign in to comment.