This applies some upstream patches to support ruby 1.9.  With these
patches, most of the examples that ship with ruby-bdb run correctly on
ruby 1.9.

Only textproc/gonzui depends on ruby-bdb, and it doesn't support ruby
1.9.3, so it will still use the ruby 1.8 version (which still builds
fine with these patches). The REVISION bump is just for safety, these
patches should only affect build-time, not run-time.

Tested on i386 and amd64. Will be committing in a few days unless I hear
objections or get OKs.

Thanks,
Jeremy

Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/ruby-bdb/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- Makefile    23 Sep 2012 17:00:49 -0000      1.30
+++ Makefile    8 Oct 2012 15:48:30 -0000
@@ -2,7 +2,7 @@
 
 COMMENT=               ruby interface to Berkeley DB
 DISTNAME=              bdb-0.6.5
-REVISION=              4
+REVISION=              5
 CATEGORIES=            databases
 
 HOMEPAGE=              http://rubyforge.org/projects/bdb/
@@ -16,9 +16,6 @@ PERMIT_DISTFILES_FTP= Yes
 MASTER_SITES=          http://rubyforge.org/frs/download.php/56887/
 
 MODULES=               lang/ruby
-
-FLAVORS=               ruby18
-FLAVOR=                        ruby18
 
 WANTLIB=               lib/db4/db>=4
 LIB_DEPENDS=           databases/db/v4
Index: patches/patch-bdbxml2_extconf_rb
===================================================================
RCS file: patches/patch-bdbxml2_extconf_rb
diff -N patches/patch-bdbxml2_extconf_rb
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-bdbxml2_extconf_rb    8 Oct 2012 15:55:06 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Backport ruby 1.9 support from GitHub commit
+cf470443a66a7e05fc402dd7f18750add74a9bb9.
+
+--- bdbxml2/extconf.rb.orig    Mon Oct  8 17:40:51 2012
++++ bdbxml2/extconf.rb Mon Oct  8 17:40:52 2012
+@@ -76,7 +76,7 @@ end
+ 
+ have_func("rb_block_call")
+ 
+-require 'features.rb'
++require './features'
+ create_makefile('bdbxml')
+ 
+ begin
Index: patches/patch-src_bdb_h
===================================================================
RCS file: patches/patch-src_bdb_h
diff -N patches/patch-src_bdb_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_bdb_h     8 Oct 2012 15:56:15 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+Backport ruby 1.9 support from GitHub commit
+6dcb0fb6e872798a7b36125dda294ddaebd96185.
+
+--- src/bdb.h.orig     Thu Jun 26 14:16:36 2008
++++ src/bdb.h  Mon Oct  8 17:44:02 2012
+@@ -1,9 +1,13 @@
++#include <db.h>
++#include <errno.h>
++
+ #include <ruby.h>
++#ifdef HAVE_RUBY_IO_H
++#include <ruby/io.h>
++#else
+ #include <rubysig.h>
+ #include <rubyio.h>
+-
+-#include <db.h>
+-#include <errno.h>
++#endif
+ 
+ #include "bdb_features.h"
+ 
Index: patches/patch-src_extconf_rb
===================================================================
RCS file: patches/patch-src_extconf_rb
diff -N patches/patch-src_extconf_rb
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_extconf_rb        8 Oct 2012 15:55:52 -0000
@@ -0,0 +1,40 @@
+$OpenBSD$
+
+Backport ruby 1.9 support from GitHub commits
+cf470443a66a7e05fc402dd7f18750add74a9bb9 and
+6dcb0fb6e872798a7b36125dda294ddaebd96185.
+
+--- src/extconf.rb.orig        Thu Jun 26 14:14:52 2008
++++ src/extconf.rb     Mon Oct  8 17:46:09 2012
+@@ -90,6 +90,12 @@ catch(:done) do
+    raise "libdb#{version[-1]} not found"
+ end
+ 
++headers = ["ruby.h"]
++if have_header("ruby/io.h")
++   headers << "ruby/io.h"
++else
++   headers << "rubyio.h"
++end
+ ["rb_frame_this_func", "rb_block_proc", "rb_io_stdio_file", 
"rb_block_call"].each do |f|
+    have_func(f, "ruby.h")
+ end
+@@ -103,16 +109,15 @@ end
+       puts "no"
+    end
+ end
++have_type('rb_io_t', headers)
+ 
+-have_type('rb_io_t', ['ruby.h', 'rubyio.h'])
+-
+ if enable_config('db-xml')
+    $defs << '-DHAVE_DBXML_INTERFACE'
+ else
+    $defs << '-DNOT_HAVE_DBXML_INTERFACE'
+ end
+ 
+-require 'features'
++require './features'
+ 
+ create_makefile("bdb")
+ if unknown

Reply via email to