This updates rake-compiler to the newest version. The previous version
was over a decade old.

This removes the support for cross compiling with mingw, as devel/mingw
was removed last year.

This adds a new patch section to patch out the use of -o root -g bin
when running rake-compiler as a regular user.  A similar patch is
already done in the Ruby ports, to the gem extension building code.

This removes now unnecessary use of SUBST_CMD.  It also removes the
test code, which no longer work as they require dependencies not in
ports.

Tested on amd64.  Will commit in a couple days unless I hear
objections.

Thanks,
Jeremy

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/ruby-rake-compiler/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- Makefile    11 Mar 2022 18:53:17 -0000      1.14
+++ Makefile    29 Jul 2022 20:52:03 -0000
@@ -1,10 +1,9 @@
 COMMENT =      build and package Ruby extensions using Rake as glue
 
-DISTNAME =     rake-compiler-0.7.9
-REVISION =     6
+DISTNAME =     rake-compiler-1.2.0
 CATEGORIES =   devel
 
-HOMEPAGE =     https://github.com/luislavena/rake-compiler
+HOMEPAGE =     https://github.com/rake-compiler/rake-compiler
 
 MAINTAINER  =  Jeremy Evans <jer...@openbsd.org>
 
@@ -14,15 +13,5 @@ PERMIT_PACKAGE =     Yes
 MODULES =      lang/ruby
 
 CONFIGURE_STYLE = ruby gem
-
-pre-configure:
-       ${SUBST_CMD} -DMAKE_PROGRAM=${MAKE_PROGRAM} \
-               ${WRKSRC}/lib/rake/extensiontask.rb \
-               ${WRKSRC}/tasks/bin/cross-ruby.rake
-       rm ${WRKSRC}/lib/rake/extensiontask.rb.beforesubst \
-               ${WRKSRC}/tasks/bin/cross-ruby.rake.beforesubst
-
-TEST_DEPENDS = devel/ruby-isolate,${MODRUBY_FLAVOR}
-MODRUBY_TEST = rake rspec
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/ruby-rake-compiler/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- distinfo    18 Jan 2015 03:13:46 -0000      1.3
+++ distinfo    29 Jul 2022 20:21:23 -0000
@@ -1,2 +1,2 @@
-SHA256 (rake-compiler-0.7.9.gem) = iEhKAhaDiF6mUqeUKaC8hw4gWGvdAGo43IzYLsckpqw=
-SIZE (rake-compiler-0.7.9.gem) = 31232
+SHA256 (rake-compiler-1.2.0.gem) = 4CvPVtLz2Ay4eLdgJo6PE9yOQlHJ+6CA3td5sWeub/U=
+SIZE (rake-compiler-1.2.0.gem) = 38912
Index: patches/patch-lib_rake_extensiontask_rb
===================================================================
RCS file: 
/cvs/ports/devel/ruby-rake-compiler/patches/patch-lib_rake_extensiontask_rb,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_rake_extensiontask_rb
--- patches/patch-lib_rake_extensiontask_rb     11 Mar 2022 18:53:17 -0000      
1.4
+++ patches/patch-lib_rake_extensiontask_rb     29 Jul 2022 20:39:49 -0000
@@ -1,27 +1,43 @@
-Include the mingw directory in the PATH if cross compiling.
+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.
 
---- lib/rake/extensiontask.rb.orig     Wed Dec 31 16:00:00 1969
-+++ lib/rake/extensiontask.rb  Wed Nov 30 04:25:41 2011
-@@ -70,6 +70,8 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/nativ
-       # only define cross platform functionality when enabled
-       return unless @cross_compile
- 
-+      ENV['PATH'] = "${LOCALBASE}/mingw32/bin:#{ENV['PATH']}"
-+
-       if cross_platform.is_a?(Array) then
-         cross_platform.each { |platf| define_cross_platform_tasks(platf) }
-       else
-@@ -359,9 +361,7 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/nativ
-           if RUBY_PLATFORM =~ /mswin/ then
-             'nmake'
-           else
--            ENV['MAKE'] || %w[gmake make].find { |c|
--              system("#{c} -v >> #{dev_null} 2>&1")
--            }
-+            ENV['MAKE'] || 'make'
-           end
+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
-       @make
+       # 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
Index: patches/patch-tasks_bin_cross-ruby_rake
===================================================================
RCS file: patches/patch-tasks_bin_cross-ruby_rake
diff -N patches/patch-tasks_bin_cross-ruby_rake
--- patches/patch-tasks_bin_cross-ruby_rake     11 Mar 2022 18:53:17 -0000      
1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-Include the mingw directory in the PATH as this file is only used
-for cross-compilation.
-
-Add the j flag to tar as all downloaded files are .tar.bz2.
-
---- tasks/bin/cross-ruby.rake.orig     Wed Dec 31 16:00:00 1969
-+++ tasks/bin/cross-ruby.rake  Wed Nov 30 04:23:04 2011
-@@ -17,6 +17,8 @@
- # for cross-compilation.
- #
- 
-+ENV['PATH'] = "${LOCALBASE}/mingw32/bin:#{ENV['PATH']}"
-+
- require 'rake'
- require 'rake/clean'
- 
-@@ -84,7 +86,7 @@ end
- source_file = RUBY_SOURCE ? RUBY_SOURCE.split('/').last : 
"#{RUBY_CC_VERSION}.tar.bz2"
- file "#{USER_HOME}/sources/#{RUBY_CC_VERSION}" => 
["#{USER_HOME}/sources/#{source_file}"] do |t|
-   chdir File.dirname(t.name) do
--    t.prerequisites.each { |f| sh "tar xf #{File.basename(f)}" }
-+    t.prerequisites.each { |f| sh "tar jxf #{File.basename(f)}" }
-   end
- end
- 
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/ruby-rake-compiler/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST   11 Mar 2022 18:53:17 -0000      1.2
+++ pkg/PLIST   29 Jul 2022 20:26:42 -0000
@@ -1,11 +1,12 @@
 ${GEM_BIN}/rake-compiler${GEM_BIN_SUFFIX}
 ${GEM_LIB}/cache/${DISTNAME}.gem
 ${GEM_LIB}/gems/${DISTNAME}/
-${GEM_LIB}/gems/${DISTNAME}/History.txt
-${GEM_LIB}/gems/${DISTNAME}/Isolate
+${GEM_LIB}/gems/${DISTNAME}/Gemfile
+${GEM_LIB}/gems/${DISTNAME}/History.md
 ${GEM_LIB}/gems/${DISTNAME}/LICENSE.txt
-${GEM_LIB}/gems/${DISTNAME}/README.rdoc
+${GEM_LIB}/gems/${DISTNAME}/README.md
 ${GEM_LIB}/gems/${DISTNAME}/Rakefile
+${GEM_LIB}/gems/${DISTNAME}/appveyor.yml
 ${GEM_LIB}/gems/${DISTNAME}/bin/
 ${GEM_LIB}/gems/${DISTNAME}/bin/rake-compiler
 ${GEM_LIB}/gems/${DISTNAME}/cucumber.yml
@@ -52,7 +53,5 @@ ${GEM_LIB}/gems/${DISTNAME}/tasks/bootst
 ${GEM_LIB}/gems/${DISTNAME}/tasks/common.rake
 ${GEM_LIB}/gems/${DISTNAME}/tasks/cucumber.rake
 ${GEM_LIB}/gems/${DISTNAME}/tasks/gem.rake
-${GEM_LIB}/gems/${DISTNAME}/tasks/news.rake
-${GEM_LIB}/gems/${DISTNAME}/tasks/release.rake
 ${GEM_LIB}/gems/${DISTNAME}/tasks/rspec.rake
 ${GEM_LIB}/specifications/${DISTNAME}.gemspec

Reply via email to