As found the hard way by Landry, the installation of some ruby gems
fails because of 'make -C', which our make(1) does not support.

With ruby 1.9 and 2.0 there's no way to tell gem to use gmake instead
of make, so backport the fix that went into 2.1.

OK for the following diff?

Index: 1.9/Makefile
===================================================================
RCS file: /cvs/ports/lang/ruby/1.9/Makefile,v
retrieving revision 1.47
diff -u -p -u -p -r1.47 Makefile
--- 1.9/Makefile        1 Nov 2014 04:56:09 -0000       1.47
+++ 1.9/Makefile        7 Nov 2014 11:41:14 -0000
@@ -19,6 +19,8 @@ PKGNAME-dbm =         ruby-dbm-${VERSION}.${PAT
 PKGNAME-tk =           ruby-tk-${VERSION}.${PATCHLEVEL}
 PKGNAME-ri_docs =      ruby-ri_docs-${VERSION}.${PATCHLEVEL}
 
+REVISION-main =                0
+
 PKG_ARCH-ri_docs =     *
 WANTLIB-ri_docs =      # empty
 
Index: 1.9/patches/patch-lib_rubygems_ext_builder_rb
===================================================================
RCS file: /cvs/ports/lang/ruby/1.9/patches/patch-lib_rubygems_ext_builder_rb,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-lib_rubygems_ext_builder_rb
--- 1.9/patches/patch-lib_rubygems_ext_builder_rb       24 Oct 2012 22:49:05 
-0000      1.2
+++ 1.9/patches/patch-lib_rubygems_ext_builder_rb       7 Nov 2014 11:41:14 
-0000
@@ -8,9 +8,11 @@ This removes the -o root -g bin, so it c
 Gem::Installer.path_warning is only set if --user-install is used,
 according to a grep of the sources.
 
---- lib/rubygems/ext/builder.rb.orig   Wed Oct  6 10:27:31 2010
-+++ lib/rubygems/ext/builder.rb        Wed Oct  6 10:28:16 2010
-@@ -19,6 +19,7 @@ class Gem::Ext::Builder
+Use MAKE or make from ENV over rbconfig's make.
+
+--- lib/rubygems/ext/builder.rb.orig   Wed Jul 27 04:04:03 2011
++++ lib/rubygems/ext/builder.rb        Fri Nov  7 12:35:55 2014
+@@ -19,12 +19,13 @@ class Gem::Ext::Builder
      mf = File.read('Makefile')
      mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
      mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}")
@@ -18,3 +20,10 @@ according to a grep of the sources.
  
      File.open('Makefile', 'wb') {|f| f.print mf}
  
+     # try to find make program from Ruby configure arguments first
+     RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/
+-    make_program = $1 || ENV['make']
++    make_program = ENV['MAKE'] || ENV['make'] || $1
+     unless make_program then
+       make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
+     end
Index: 2.0/Makefile
===================================================================
RCS file: /cvs/ports/lang/ruby/2.0/Makefile,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 Makefile
--- 2.0/Makefile        1 Nov 2014 04:54:43 -0000       1.16
+++ 2.0/Makefile        7 Nov 2014 11:41:14 -0000
@@ -16,6 +16,8 @@ PKGNAME-gdbm =                ruby20-gdbm-${VERSION}.$
 PKGNAME-tk =           ruby20-tk-${VERSION}.${PATCHLEVEL}
 PKGNAME-ri_docs =      ruby20-ri_docs-${VERSION}.${PATCHLEVEL}
 
+REVISION-main =                0
+
 PKG_ARCH-ri_docs =     *
 WANTLIB-ri_docs =      # empty
 
Index: 2.0/patches/patch-lib_rubygems_ext_builder_rb
===================================================================
RCS file: 2.0/patches/patch-lib_rubygems_ext_builder_rb
diff -N 2.0/patches/patch-lib_rubygems_ext_builder_rb
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 2.0/patches/patch-lib_rubygems_ext_builder_rb       7 Nov 2014 11:41:14 
-0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Use MAKE or make from ENV over rbconfig's make.
+
+--- lib/rubygems/ext/builder.rb.orig   Fri Nov  7 12:39:45 2014
++++ lib/rubygems/ext/builder.rb        Fri Nov  7 12:39:55 2014
+@@ -18,7 +18,7 @@ class Gem::Ext::Builder
+ 
+     # try to find make program from Ruby configure arguments first
+     RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/
+-    make_program = $1 || ENV['MAKE'] || ENV['make']
++    make_program = ENV['MAKE'] || ENV['make'] || $1
+     unless make_program then
+       make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
+     end

Reply via email to