From 2d6962beff128ae7c9cbb431611d4fc46c27a791 Mon Sep 17 00:00:00 2001 From: jeremy Date: Tue, 27 Jun 2023 17:18:12 +0000 Subject: [PATCH] Avoid "undefining the allocator of T_DATA class Estraier::Document_data" warning --- textproc/ruby-hyperestraier/Makefile | 2 +- .../patches/patch-ext_estraier_c | 22 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/textproc/ruby-hyperestraier/Makefile b/textproc/ruby-hyperestraier/Makefile index 7ff588f6c70..122f80948c0 100644 --- a/textproc/ruby-hyperestraier/Makefile +++ b/textproc/ruby-hyperestraier/Makefile @@ -3,7 +3,7 @@ COMMENT= Ruby interface to hyperestraier V= 1.4.10 DISTNAME= estraier-${V} PKGNAME= hyperestraier-${V} -REVISION = 1 +REVISION = 2 CATEGORIES= textproc HOMEPAGE= http://fallabs.com/hyperestraier/rubynativeapi/ diff --git a/textproc/ruby-hyperestraier/patches/patch-ext_estraier_c b/textproc/ruby-hyperestraier/patches/patch-ext_estraier_c index d923cf6232e..9517cd23eea 100644 --- a/textproc/ruby-hyperestraier/patches/patch-ext_estraier_c +++ b/textproc/ruby-hyperestraier/patches/patch-ext_estraier_c @@ -6,7 +6,15 @@ warnings on Ruby 3.2. Index: ext/estraier.c --- ext/estraier.c.orig +++ ext/estraier.c -@@ -351,7 +351,7 @@ static VALUE doc_make_snippet(VALUE vself, VALUE vword +@@ -154,6 +154,7 @@ int Init_estraier(void){ + static void doc_init(void){ + cls_doc = rb_define_class_under(mod_estraier, "Document", rb_cObject); + cls_doc_data = rb_define_class_under(mod_estraier, "Document_data", rb_cObject); ++ rb_undef_alloc_func(cls_doc_data); + rb_define_private_method(cls_doc, "initialize", doc_initialize, -1); + rb_define_method(cls_doc, "add_attr", doc_add_attr, 2); + rb_define_method(cls_doc, "add_text", doc_add_text, 1); +@@ -351,7 +352,7 @@ static VALUE doc_make_snippet(VALUE vself, VALUE vword vdoc = rb_iv_get(vself, VNDATA); Data_Get_Struct(vdoc, ESTDOC, doc); Check_Type(vwords, T_ARRAY); @@ -15,7 +23,7 @@ Index: ext/estraier.c for(i = 0; i < len; i++){ Check_Type(rb_ary_entry(vwords, i), T_STRING); } -@@ -368,6 +368,7 @@ static VALUE doc_make_snippet(VALUE vself, VALUE vword +@@ -368,6 +369,7 @@ static VALUE doc_make_snippet(VALUE vself, VALUE vword static void cond_init(void){ cls_cond = rb_define_class_under(mod_estraier, "Condition", rb_cObject); cls_cond_data = rb_define_class_under(mod_estraier, "Condition_data", rb_cObject); @@ -23,7 +31,7 @@ Index: ext/estraier.c rb_define_const(cls_cond, "SURE", INT2NUM(ESTCONDSURE)); rb_define_const(cls_cond, "USUAL", INT2NUM(ESTCONDUSUAL)); rb_define_const(cls_cond, "FAST", INT2NUM(ESTCONDFAST)); -@@ -519,6 +520,7 @@ static VALUE cond_set_mask(VALUE vself, VALUE vmask){ +@@ -519,6 +521,7 @@ static VALUE cond_set_mask(VALUE vself, VALUE vmask){ static void res_init(void){ cls_res = rb_define_class_under(mod_estraier, "Result", rb_cObject); cls_res_data = rb_define_class_under(mod_estraier, "Result_data", rb_cObject); @@ -31,7 +39,7 @@ Index: ext/estraier.c rb_define_private_method(cls_res, "initialize", res_initialize, 0); rb_define_method(cls_res, "doc_num", res_doc_num, 0); rb_define_method(cls_res, "get_doc_id", res_get_doc_id, 1); -@@ -662,6 +664,7 @@ static VALUE res_get_shadows(VALUE vself, VALUE vid){ +@@ -662,6 +665,7 @@ static VALUE res_get_shadows(VALUE vself, VALUE vid){ static void db_init(void){ cls_db = rb_define_class_under(mod_estraier, "Database", rb_cObject); cls_db_data = rb_define_class_under(mod_estraier, "Database_data", rb_cObject); @@ -39,7 +47,7 @@ Index: ext/estraier.c rb_define_const(cls_db, "VERSION", rb_str_new2(est_version)); rb_define_const(cls_db, "ERRNOERR", INT2NUM(ESTENOERR)); rb_define_const(cls_db, "ERRINVAL", INT2NUM(ESTEINVAL)); -@@ -764,7 +767,7 @@ static VALUE db_search_meta(VALUE vself, VALUE vdbs, V +@@ -764,7 +768,7 @@ static VALUE db_search_meta(VALUE vself, VALUE vdbs, V CBMAP *hints; int i, dnum, *res, rnum; Check_Type(vdbs, T_ARRAY); @@ -48,7 +56,7 @@ Index: ext/estraier.c dbs = cbmalloc(dnum * sizeof(ESTMTDB *) + 1); for(i = 0; i < dnum; i++){ vdb = rb_ary_entry(vdbs, i); -@@ -1189,10 +1192,10 @@ static CBLIST *objtocblist(VALUE obj){ +@@ -1189,10 +1193,10 @@ static CBLIST *objtocblist(VALUE obj){ VALUE str; int i, len; list = cblistopen(); @@ -61,7 +69,7 @@ Index: ext/estraier.c } return list; } -@@ -1218,14 +1221,14 @@ static CBMAP *objtocbmap(VALUE obj){ +@@ -1218,14 +1222,14 @@ static CBMAP *objtocbmap(VALUE obj){ int i, len; map = cbmapopenex(31); keys = rb_funcall(obj, rb_intern("keys"), 0);