Skip to content

Commit

Permalink
databases/ruby-bdb: fix build with clang16, fix build with ruby3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Meyer authored and Dirk Meyer committed Jul 13, 2023
1 parent e257787 commit 5ebb183
Show file tree
Hide file tree
Showing 12 changed files with 1,582 additions and 33 deletions.
5 changes: 1 addition & 4 deletions databases/ruby-bdb/Makefile
@@ -1,6 +1,6 @@
PORTNAME= bdb
PORTVERSION= 0.6.6
PORTREVISION= 8
PORTREVISION= 9
CATEGORIES= databases ruby
MASTER_SITES= ftp://ftp.idaemons.org/pub/distfiles/ruby/ \
http://idaemons.org/distfiles/ruby/ \
Expand All @@ -14,9 +14,6 @@ WWW= https://github.com/knu/ruby-bdb

LICENSE= RUBY

BROKEN_RUBY32= yes
BROKEN_RUBY33= yes

BUILD_DEPENDS= rubygem-rdoc>=0.a:devel/rubygem-rdoc

USES= bdb ruby:extconf shebangfix tar:bzip2
Expand Down
9 changes: 9 additions & 0 deletions databases/ruby-bdb/files/patch-bdbxml1-bdbxml.cc
Expand Up @@ -109,3 +109,12 @@
}

xb_eFatal = rb_const_get(xb_mDb, rb_intern("Fatal"));
@@ -2477,7 +2491,7 @@ extern "C" {
rb_define_method(xb_cUpd, "<<", RMF(xb_upd_add), 1);
rb_define_method(xb_cUpd, "delete", RMF(xb_upd_delete), -1);
rb_define_method(xb_cUpd, "update", RMF(xb_upd_update), -1);
- xb_cTmp = rb_define_class_under(xb_mXML, "Tmp", rb_cData);
+ xb_cTmp = rb_define_class_under(xb_mXML, "Tmp", rb_cObject);
rb_undef_method(CLASS_OF(xb_cTmp), "allocate");
rb_undef_method(CLASS_OF(xb_cTmp), "new");
rb_define_method(xb_cTmp, "[]", RMF(xb_cxt_name_get), 1);
4 changes: 2 additions & 2 deletions databases/ruby-bdb/files/patch-bdbxml2-bdbxml.h
@@ -1,11 +1,11 @@
--- bdbxml2/bdbxml.h.orig 2011-04-06 19:35:39 UTC
+++ bdbxml2/bdbxml.h
@@ -377,7 +377,7 @@
@@ -377,7 +377,7 @@ get_mod(VALUE obj)
static inline void
rset_obj(VALUE obj)
{
- RBASIC(obj)->klass = rb_cData;
+ RBASIC_SET_CLASS_RAW(obj, rb_cData);
+ RBASIC_SET_CLASS_RAW(obj, rb_cObject);
RDATA(obj)->dfree = (RDF)free;
RDATA(obj)->dmark = 0;
}
15 changes: 13 additions & 2 deletions databases/ruby-bdb/files/patch-src-bdb.c
@@ -1,18 +1,29 @@
--- src/bdb.c.orig 2011-04-06 19:35:39 UTC
+++ src/bdb.c
@@ -166,11 +166,10 @@
@@ -165,12 +165,11 @@ Init_bdb()
if (rb_const_defined_at(rb_cObject, rb_intern("BDB"))) {
rb_raise(rb_eNameError, "module already defined");
}
version = rb_tainted_str_new2(db_version(&major, &minor, &patch));
- version = rb_tainted_str_new2(db_version(&major, &minor, &patch));
- if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR
- || patch != DB_VERSION_PATCH) {
- rb_raise(rb_eNotImpError, "\nBDB needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d.%d and libdb version %d.%d.%d\n",
- DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
- major, minor, patch);
+ version = rb_str_new_cstr(db_version(&major, &minor, &patch));
+ if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR) {
+ rb_raise(rb_eNotImpError, "\nBDB needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d and libdb version %d.%d\n",
+ DB_VERSION_MAJOR, DB_VERSION_MINOR,
+ major, minor);
}
bdb_mMarshal = rb_const_get(rb_cObject, rb_intern("Marshal"));
bdb_id_current_db = rb_intern("__bdb_current_db__");
@@ -958,7 +957,7 @@ Init_bdb()
bdb_init_delegator();
bdb_init_sequence();

- bdb_errstr = rb_tainted_str_new(0, 0);
+ bdb_errstr = rb_str_new(0, 0);
rb_global_variable(&bdb_errstr);

}

0 comments on commit 5ebb183

Please sign in to comment.