openbsd-ports/devel/ruby-rake-compiler/patches/patch-lib_rake_extensiontask_rb
jeremy bfb46444bd Update to rake-compiler 1.2.0
Remove use of SUBST_CMD, no longer needed.
Remove test code, as tests now have dependencies not in ports.
Remove cross compiling support as mingw was removed last year.
Add patch to remove chown/chgrp use when not running as root,
similar to how Ruby is patched.
2022-08-01 16:23:45 +00:00

44 lines
1.4 KiB
Plaintext

Do not try to chown/chgrp when installing unless running
as root. This is done for the same reasons as the patch for
lib/rubygems/ext/ext_conf_builder.rb in the Ruby port.
Don't have it accidently use gmake, because the makefiles
created can use BSD make extensions.
Index: lib/rake/extensiontask.rb
--- lib/rake/extensiontask.rb.orig
+++ lib/rake/extensiontask.rb
@@ -157,7 +157,9 @@ module Rake
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
- sh "#{make} install target_prefix=", chdir: tmp_path
+ command = "#{make} install target_prefix="
+ command += " INSTALL_PROG='/usr/bin/install -c -m 0755'" unless Process.uid == 0
+ sh command, chdir: tmp_path
end
end
# copy binary from temporary location to staging directory
@@ -502,20 +504,7 @@ Java extension should be preferred.
end
def make
- unless @make
- @make =
- if RUBY_PLATFORM =~ /mswin/ then
- 'nmake'
- else
- ENV['MAKE'] || find_make
- end
- end
-
- unless @make
- raise "Couldn't find a suitable `make` tool. Use `MAKE` env to set an alternative."
- end
-
- @make
+ @make ||= ENV['MAKE'] || 'make'
end
def find_make