From 761f76d66ab671e3cccc5a5b5c3bc4a5a4b66cea Mon Sep 17 00:00:00 2001 From: taca Date: Fri, 10 Sep 2010 08:25:16 +0000 Subject: * Add a patch to support both ruby18 and ruby19. * Remove RUBY_HAS_ARCHLIB. No functional change. --- textproc/hyperestraier/distinfo | 3 +- textproc/hyperestraier/patches/patch-af | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 textproc/hyperestraier/patches/patch-af (limited to 'textproc/hyperestraier') diff --git a/textproc/hyperestraier/distinfo b/textproc/hyperestraier/distinfo index 4bcc986819c..478e11442c6 100644 --- a/textproc/hyperestraier/distinfo +++ b/textproc/hyperestraier/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.28 2008/06/19 15:18:31 taca Exp $ +$NetBSD: distinfo,v 1.29 2010/09/10 08:25:16 taca Exp $ SHA1 (hyperestraier-1.4.13.tar.gz) = 21c3f325f42019fef096172105c2fc16f3e72fc0 RMD160 (hyperestraier-1.4.13.tar.gz) = 8af0af25df6d5bd45a09e9abfbb26300339b5a2c @@ -8,3 +8,4 @@ SHA1 (patch-ab) = f3f57404f02ff9928adc0a8c5c9ddec65700ce85 SHA1 (patch-ac) = 06bc0a56cc3a7592995d615a1afbffce8fb99931 SHA1 (patch-ad) = 519ec64e5e87b5de00a488b4d19d82fe336724f4 SHA1 (patch-ae) = fcde455f65834f004897805b61de40b1171ae6dd +SHA1 (patch-af) = 24ba33d20fc9b23cbc91c8345d2250db14dab536 diff --git a/textproc/hyperestraier/patches/patch-af b/textproc/hyperestraier/patches/patch-af new file mode 100644 index 00000000000..7590e866cc8 --- /dev/null +++ b/textproc/hyperestraier/patches/patch-af @@ -0,0 +1,55 @@ +$NetBSD: patch-af,v 1.1 2010/09/10 08:25:17 taca Exp $ + +Use modern Ruby API. + +--- rubynative/src/estraier.c.orig 2007-04-12 01:52:50.000000000 +0000 ++++ rubynative/src/estraier.c +@@ -351,7 +351,7 @@ static VALUE doc_make_snippet(VALUE vsel + vdoc = rb_iv_get(vself, VNDATA); + Data_Get_Struct(vdoc, ESTDOC, doc); + Check_Type(vwords, T_ARRAY); +- len = RARRAY(vwords)->len; ++ len = RARRAY_LEN(vwords); + for(i = 0; i < len; i++){ + Check_Type(rb_ary_entry(vwords, i), T_STRING); + } +@@ -764,7 +764,7 @@ static VALUE db_search_meta(VALUE vself, + CBMAP *hints; + int i, dnum, *res, rnum; + Check_Type(vdbs, T_ARRAY); +- dnum = RARRAY(vdbs)->len; ++ dnum = RARRAY_LEN(vdbs); + dbs = cbmalloc(dnum * sizeof(ESTMTDB *) + 1); + for(i = 0; i < dnum; i++){ + vdb = rb_ary_entry(vdbs, i); +@@ -1189,10 +1189,10 @@ static CBLIST *objtocblist(VALUE obj){ + VALUE str; + int i, len; + list = cblistopen(); +- len = RARRAY(obj)->len; ++ len = RARRAY_LEN(obj); + for(i = 0; i < len; i++){ + str = rb_ary_entry(obj, i); +- cblistpush(list, RSTRING(str)->ptr, RSTRING(str)->len); ++ cblistpush(list, RSTRING_PTR(str), RSTRING_LEN(str)); + } + return list; + } +@@ -1218,14 +1218,14 @@ static CBMAP *objtocbmap(VALUE obj){ + int i, len; + map = cbmapopenex(31); + keys = rb_funcall(obj, rb_intern("keys"), 0); +- len = RARRAY(keys)->len; ++ len = RARRAY_LEN(keys); + for(i = 0; i < len; i++){ + key = rb_ary_entry(keys, i); + val = rb_hash_aref(obj, key); + key = rb_String(key); + val = rb_String(val); +- cbmapput(map, RSTRING(key)->ptr, RSTRING(key)->len, +- RSTRING(val)->ptr, RSTRING(val)->len, 0); ++ cbmapput(map, RSTRING_PTR(key), RSTRING_LEN(key), ++ RSTRING_PTR(val), RSTRING_LEN(val), 0); + } + return map; + } -- cgit v1.2.3