* Use lang/ruby/gem.mk instead of misc/rubygems/rubygem.mk.
* Add LICENSE. * Remove default value of GEM_BUILD. * Add patch to support both ruby18 and ruby19. No functional change.
This commit is contained in:
parent
e7740292c7
commit
d9682d2298
3 changed files with 86 additions and 7 deletions
|
@ -1,18 +1,15 @@
|
|||
# $NetBSD: Makefile,v 1.4 2010/05/07 08:34:23 ahoka Exp $
|
||||
# $NetBSD: Makefile,v 1.5 2010/09/10 08:32:29 taca Exp $
|
||||
|
||||
DISTNAME= oniguruma-1.1.0
|
||||
PKGNAME= ${RUBY_PKGPREFIX}-${DISTNAME}
|
||||
CATEGORIES= textproc
|
||||
|
||||
MAINTAINER= pkgsrc-users@NetBSD.org
|
||||
HOMEPAGE= http://oniguruma.rubyforge.org/
|
||||
COMMENT= Fast regular expression library
|
||||
|
||||
PKG_DESTDIR_SUPPORT= destdir
|
||||
LICENSE= modified-bsd
|
||||
|
||||
USE_TOOLS+= pax
|
||||
GEM_BUILD= gemspec
|
||||
|
||||
.include "../../textproc/oniguruma/buildlink3.mk"
|
||||
.include "../../misc/rubygems/rubygem.mk"
|
||||
.include "../../lang/ruby/gem.mk"
|
||||
.include "../../mk/bsd.pkg.mk"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
$NetBSD: distinfo,v 1.1.1.1 2008/08/22 15:37:13 ahoka Exp $
|
||||
$NetBSD: distinfo,v 1.2 2010/09/10 08:32:29 taca Exp $
|
||||
|
||||
SHA1 (oniguruma-1.1.0.gem) = 36acce9ba77830983ec6bf1438368f1aa5ac86b8
|
||||
RMD160 (oniguruma-1.1.0.gem) = 1c5353dc5785fc23c6c7b38fcf9190117da19982
|
||||
Size (oniguruma-1.1.0.gem) = 24064 bytes
|
||||
SHA1 (patch-aa) = 8cafa2c01f2002c523eccff70d3deb6c71d6275a
|
||||
|
|
81
textproc/ruby-oniguruma/patches/patch-aa
Normal file
81
textproc/ruby-oniguruma/patches/patch-aa
Normal file
|
@ -0,0 +1,81 @@
|
|||
$NetBSD: patch-aa,v 1.1 2010/09/10 08:32:29 taca Exp $
|
||||
|
||||
Use modern Ruby's API.
|
||||
|
||||
--- ext/oregexp.c.orig 2010-08-29 06:22:26.000000000 +0000
|
||||
+++ ext/oregexp.c
|
||||
@@ -120,8 +120,8 @@ static VALUE oregexp_initialize( VALUE s
|
||||
VALUE pattern_str = StringValue( pattern );
|
||||
rb_iv_set( self, "@pattern", pattern_str );
|
||||
rb_iv_set( self, "@options", options );
|
||||
- UChar* pat_ptr = RSTRING(pattern_str)->ptr;
|
||||
- int pat_len = RSTRING(pattern_str)->len;
|
||||
+ UChar* pat_ptr = RSTRING_PTR(pattern_str);
|
||||
+ int pat_len = RSTRING_LEN(pattern_str);
|
||||
VALUE rOptions = rb_hash_aref( options, ID2SYM( rb_intern( "options" ) ) );
|
||||
VALUE rEncoding = rb_hash_aref( options, ID2SYM( rb_intern( "encoding" ) ) );
|
||||
VALUE rSyntax = rb_hash_aref( options, ID2SYM( rb_intern( "syntax" ) ) );
|
||||
@@ -212,8 +212,8 @@ static VALUE oregexp_match( int argc, VA
|
||||
}
|
||||
|
||||
VALUE string_str = StringValue( argv[0] );
|
||||
- UChar* str_ptr = RSTRING(string_str)->ptr;
|
||||
- int str_len = RSTRING(string_str)->len;
|
||||
+ UChar* str_ptr = RSTRING_PTR(string_str);
|
||||
+ int str_len = RSTRING_LEN(string_str);
|
||||
|
||||
int begin = 0;
|
||||
int end = str_len;
|
||||
@@ -264,8 +264,8 @@ oregexp_append_replacement(pat, src_text
|
||||
{
|
||||
ORegexp *oregexp;
|
||||
int32_t replIdx = 0, name_pos, name_start, name_end ;
|
||||
- int32_t replacementLength = RSTRING(repl_text)->len;
|
||||
- UChar *replacementText = RSTRING(repl_text)->ptr;
|
||||
+ int32_t replacementLength = RSTRING_LEN(repl_text);
|
||||
+ UChar *replacementText = RSTRING_PTR(repl_text);
|
||||
UChar *replacementEnd = replacementText + (replacementLength-1);
|
||||
long numDigits = 0;
|
||||
long groupNum = 0, g_start, g_end;
|
||||
@@ -274,8 +274,8 @@ oregexp_append_replacement(pat, src_text
|
||||
const UChar * matchText;
|
||||
long matchLen;
|
||||
|
||||
- matchText = RSTRING(src_text)->ptr;
|
||||
- matchLen = RSTRING(src_text)->len;
|
||||
+ matchText = RSTRING_PTR(src_text);
|
||||
+ matchLen = RSTRING_LEN(src_text);
|
||||
Data_Get_Struct( pat, ORegexp, oregexp );
|
||||
enc = onig_get_encoding( oregexp->reg );
|
||||
|
||||
@@ -402,7 +402,7 @@ str_mod_check(s, p, len)
|
||||
char *p;
|
||||
long len;
|
||||
{
|
||||
- if (RSTRING(s)->ptr != p || RSTRING(s)->len != len) {
|
||||
+ if (RSTRING_PTR(s) != p || RSTRING_LEN(s) != len) {
|
||||
rb_raise(rb_eRuntimeError, "string modified");
|
||||
}
|
||||
}
|
||||
@@ -441,8 +441,8 @@ oregexp_gsub(self, argc, argv, bang, on
|
||||
Data_Get_Struct( self, ORegexp, oregexp );
|
||||
|
||||
VALUE string_str = StringValue( argv[0] );
|
||||
- UChar* str_ptr = RSTRING(string_str)->ptr;
|
||||
- int str_len = RSTRING(string_str)->len;
|
||||
+ UChar* str_ptr = RSTRING_PTR(string_str);
|
||||
+ int str_len = RSTRING_LEN(string_str);
|
||||
|
||||
beg = onig_search(oregexp->reg, str_ptr, str_ptr + str_len, str_ptr, str_ptr + str_len, region, ONIG_OPTION_NONE);
|
||||
|
||||
@@ -611,8 +611,8 @@ oregexp_scan(VALUE self, VALUE str, Onig
|
||||
Data_Get_Struct( self, ORegexp, oregexp );
|
||||
|
||||
VALUE string_str = StringValue( str );
|
||||
- UChar* str_ptr = RSTRING(string_str)->ptr;
|
||||
- int str_len = RSTRING(string_str)->len;
|
||||
+ UChar* str_ptr = RSTRING_PTR(string_str);
|
||||
+ int str_len = RSTRING_LEN(string_str);
|
||||
beg = onig_search(oregexp->reg, str_ptr, str_ptr + str_len, str_ptr, str_ptr + str_len, region, ONIG_OPTION_NONE);
|
||||
if (beg < 0) {
|
||||
/* no match */
|
Loading…
Reference in a new issue