summaryrefslogtreecommitdiff
path: root/textproc/ruby-sary
diff options
context:
space:
mode:
authortaca <taca>2010-09-10 08:39:27 +0000
committertaca <taca>2010-09-10 08:39:27 +0000
commit75e6ac37b48e28bc521f7d472be6e1ff41ca11d9 (patch)
treec92a56e0949fccf5937a8881891535d347fe3908 /textproc/ruby-sary
parentd7231f36bfcb828e564ec32fc7408669aee816c2 (diff)
downloadpkgsrc-75e6ac37b48e28bc521f7d472be6e1ff41ca11d9.tar.gz
* Remove RUBY_HAS_ARCHLIB.
* Add patches to support both ruby18 and ruby19. No functional change.
Diffstat (limited to 'textproc/ruby-sary')
-rw-r--r--textproc/ruby-sary/Makefile3
-rw-r--r--textproc/ruby-sary/distinfo4
-rw-r--r--textproc/ruby-sary/patches/patch-aa39
-rw-r--r--textproc/ruby-sary/patches/patch-ab130
4 files changed, 173 insertions, 3 deletions
diff --git a/textproc/ruby-sary/Makefile b/textproc/ruby-sary/Makefile
index 7e84e9dd21e..93241d2572d 100644
--- a/textproc/ruby-sary/Makefile
+++ b/textproc/ruby-sary/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2010/05/16 00:37:37 obache Exp $
+# $NetBSD: Makefile,v 1.6 2010/09/10 08:39:27 taca Exp $
#
DISTNAME= sary-ruby-1.2.0
@@ -14,7 +14,6 @@ LICENSE= gnu-lgpl-v2.1
PKG_DESTDIR_SUPPORT= user-destdir
-RUBY_HAS_ARCHLIB= yes
USE_RUBY_EXTCONF= yes
USE_TOOLS+= pkg-config
diff --git a/textproc/ruby-sary/distinfo b/textproc/ruby-sary/distinfo
index a7ec46da078..28024469fc5 100644
--- a/textproc/ruby-sary/distinfo
+++ b/textproc/ruby-sary/distinfo
@@ -1,5 +1,7 @@
-$NetBSD: distinfo,v 1.1.1.1 2008/03/01 08:30:48 obache Exp $
+$NetBSD: distinfo,v 1.2 2010/09/10 08:39:27 taca Exp $
SHA1 (sary-ruby-1.2.0.tar.gz) = 18ad1c8a1d095dbaa99efbb4a040e77a58b9df08
RMD160 (sary-ruby-1.2.0.tar.gz) = f35602bea532138b87c6d77b08dbc71f7ebddc41
Size (sary-ruby-1.2.0.tar.gz) = 9155 bytes
+SHA1 (patch-aa) = 27cc4cb9ab605b5a7c1ac8dac813c002dc634e11
+SHA1 (patch-ab) = ef757061c7f2a860f4311839607f473a4ceaac7e
diff --git a/textproc/ruby-sary/patches/patch-aa b/textproc/ruby-sary/patches/patch-aa
new file mode 100644
index 00000000000..bd629806121
--- /dev/null
+++ b/textproc/ruby-sary/patches/patch-aa
@@ -0,0 +1,39 @@
+$NetBSD: patch-aa,v 1.1 2010/09/10 08:39:27 taca Exp $
+
+Use moddern Ruby's API.
+
+--- builder.c.orig 2005-03-29 22:48:09.000000000 +0000
++++ builder.c
+@@ -26,7 +26,6 @@
+ #include <errno.h>
+ #include "sary.h"
+ #include "ruby.h"
+-#include "version.h"
+
+ #define GET_Builder(obj, dat) Data_Get_Struct(obj, SaryBuilder, dat)
+
+@@ -62,22 +61,14 @@ static VALUE rsbuilder_initialize(int ar
+
+ rb_scan_args(argc, argv, "11", &file_name, &array_name);
+
+- Check_SafeStr(file_name);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(file_name);
+ file_name_ptr = StringValuePtr(file_name);
+-#else
+- file_name_ptr = STR2CSTR(file_name);
+-#endif
+
+ if (array_name == Qnil)
+ builder = sary_builder_new(file_name_ptr);
+ else {
+- Check_SafeStr(array_name);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(array_name);
+ array_name_ptr = StringValuePtr(array_name);
+-#else
+- array_name_ptr = STR2CSTR(array_name);
+-#endif
+ builder = sary_builder_new2(file_name_ptr, array_name_ptr);
+ }
+ if (builder == NULL)
diff --git a/textproc/ruby-sary/patches/patch-ab b/textproc/ruby-sary/patches/patch-ab
new file mode 100644
index 00000000000..cd1e7fe14e5
--- /dev/null
+++ b/textproc/ruby-sary/patches/patch-ab
@@ -0,0 +1,130 @@
+$NetBSD: patch-ab,v 1.1 2010/09/10 08:39:27 taca Exp $
+
+Use moddern Ruby's API.
+
+--- searcher.c.orig 2005-03-29 22:48:09.000000000 +0000
++++ searcher.c
+@@ -27,7 +27,6 @@
+ #include <errno.h>
+ #include "sary.h"
+ #include "ruby.h"
+-#include "version.h"
+
+ #define GET_Searcher(obj, dat) Data_Get_Struct(obj, SarySearcher, dat)
+
+@@ -81,22 +80,14 @@ rsearcher_initialize(int argc, VALUE *ar
+
+ rb_scan_args(argc, argv, "11", &file_name, &array_name);
+
+- Check_SafeStr(file_name);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(file_name);
+ file_name_ptr = StringValuePtr(file_name);
+-#else
+- file_name_ptr = STR2CSTR(file_name);
+-#endif
+
+ if (array_name == Qnil)
+ searcher = sary_searcher_new(file_name_ptr);
+ else {
+- Check_SafeStr(array_name);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(array_name);
+ array_name_ptr = StringValuePtr(array_name);
+-#else
+- array_name_ptr = STR2CSTR(array_name);
+-#endif
+ searcher = sary_searcher_new2(file_name_ptr, array_name_ptr);
+ }
+ if (searcher == NULL)
+@@ -132,13 +123,9 @@ rsearcher_search(VALUE klass, VALUE patt
+
+ GET_Searcher(klass, searcher);
+
+- Check_SafeStr(pattern);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(pattern);
+ pat = StringValuePtr(pattern);
+- len = RSTRING(pattern)->len;
+-#else
+- pat = str2cstr(pattern, &len);
+-#endif
++ len = RSTRING_LEN(pattern);
+
+ if (sary_searcher_search2(searcher, pat, len))
+ return Qtrue;
+@@ -157,7 +144,7 @@ rsearcher_multi_search(VALUE klass, VALU
+
+ GET_Searcher(klass, searcher);
+
+- len = RARRAY(pattern_array)->len;
++ len = RARRAY_LEN(pattern_array);
+ if (len == 0) {
+ return Qfalse;
+ }
+@@ -165,12 +152,8 @@ rsearcher_multi_search(VALUE klass, VALU
+ pat = ALLOCA_N(char*, len);
+ for (i = 0; i < len; i++) {
+ pattern = rb_ary_entry(pattern_array, (long)i);
+- Check_SafeStr(pattern);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(pattern);
+ pat[i] = StringValuePtr(pattern);
+-#else
+- pat[i] = STR2CSTR(pattern);
+-#endif
+ }
+
+ if (sary_searcher_multi_search(searcher, pat, len))
+@@ -188,12 +171,8 @@ rsearcher_isearch(VALUE klass, VALUE pat
+
+ GET_Searcher(klass, searcher);
+
+- Check_SafeStr(pattern);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(pattern);
+ pat = StringValuePtr(pattern);
+-#else
+- pat = STR2CSTR(pattern);
+-#endif
+
+ if (sary_searcher_isearch(searcher, pat, NUM2INT(len)))
+ return Qtrue;
+@@ -223,13 +202,9 @@ rsearcher_icase_search(VALUE klass, VALU
+
+ GET_Searcher(klass, searcher);
+
+- Check_SafeStr(pattern);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(pattern);
+ pat = StringValuePtr(pattern);
+- len = RSTRING(pattern)->len;
+-#else
+- pat = str2cstr(pattern, &len);
+-#endif
++ len = RSTRING_LEN(pattern);
+
+ if (sary_searcher_icase_search2(searcher, pat, len))
+ return Qtrue;
+@@ -273,17 +248,12 @@ rsearcher_get_next_tagged_region(VALUE k
+ if (sary_searcher_count_occurrences(searcher) == 0)
+ return Qnil;
+
+- Check_SafeStr(start_tag);
+- Check_SafeStr(end_tag);
+-#if RUBY_VERSION_CODE >= 180
++ SafeStringValue(start_tag);
++ SafeStringValue(end_tag);
+ stag = StringValuePtr(start_tag);
+ etag = StringValuePtr(end_tag);
+- slen = RSTRING(stag)->len;
+- elen = RSTRING(etag)->len;
+-#else
+- stag = rb_str2cstr(start_tag, &slen);
+- etag = rb_str2cstr(end_tag, &elen);
+-#endif
++ slen = RSTRING_LEN(stag);
++ elen = RSTRING_LEN(etag);
+
+ region = sary_searcher_get_next_tagged_region2(searcher, stag, slen,
+ etag, elen, &rlen);