summaryrefslogtreecommitdiff
path: root/archivers
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2014-03-16 07:24:21 +0000
committertaca <taca@pkgsrc.org>2014-03-16 07:24:21 +0000
commit93abcfde0c74e3bcbbb72dea26207803fedb6299 (patch)
tree1102b8a10805997b81118113194fba5238b58ee1 /archivers
parenta7253444d9e456b7473b23c5dd45f775508cb406 (diff)
downloadpkgsrc-93abcfde0c74e3bcbbb72dea26207803fedb6299.tar.gz
Fix build problem with RUBY_VER == 21.
Diffstat (limited to 'archivers')
-rw-r--r--archivers/ruby-bz2/distinfo4
-rw-r--r--archivers/ruby-bz2/patches/patch-bz2.c56
2 files changed, 36 insertions, 24 deletions
diff --git a/archivers/ruby-bz2/distinfo b/archivers/ruby-bz2/distinfo
index 43dbc5838cd..4742de86543 100644
--- a/archivers/ruby-bz2/distinfo
+++ b/archivers/ruby-bz2/distinfo
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.2 2011/03/08 09:27:54 obache Exp $
+$NetBSD: distinfo,v 1.3 2014/03/16 07:24:21 taca Exp $
SHA1 (bz2-0.2.2.tar.gz) = d7315b5a054ff824c8022cc19b29ccbb1bd10255
RMD160 (bz2-0.2.2.tar.gz) = af39483be363d72a34bf82eebfcf072618e75145
Size (bz2-0.2.2.tar.gz) = 17129 bytes
-SHA1 (patch-bz2.c) = e8aaa2678f2de4ac87f4ca06a10e377474f82f28
+SHA1 (patch-bz2.c) = 5e14083bcbf334a9d17fde6a0debc71c9710290a
diff --git a/archivers/ruby-bz2/patches/patch-bz2.c b/archivers/ruby-bz2/patches/patch-bz2.c
index a39eb33a170..7ea55b86dea 100644
--- a/archivers/ruby-bz2/patches/patch-bz2.c
+++ b/archivers/ruby-bz2/patches/patch-bz2.c
@@ -1,6 +1,6 @@
-$NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
+$NetBSD: patch-bz2.c,v 1.2 2014/03/16 07:24:22 taca Exp $
-* for ruby-1.9
+* for ruby-1.9 and later.
--- bz2.c.orig 2004-12-04 14:36:59.000000000 +0000
+++ bz2.c
@@ -46,7 +46,19 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
Data_Get_Struct(elem, struct bz_iv, bziv);
if (bziv->bz2) {
RDATA(bziv->bz2)->dfree = ruby_xfree;
-@@ -301,7 +309,8 @@ bz_io_data_finalize(ptr)
+@@ -249,7 +257,11 @@ bz_writer_close(obj)
+ Get_BZ2(obj, bzf);
+ res = bz_writer_internal_close(bzf);
+ if (!NIL_P(res) && (bzf->flags & BZ2_RB_INTERNAL)) {
++#if RUBY_API_VERSION_MAJOR >=2 && RUBY_API_VERSION_MINOR >= 1
++ rb_obj_reveal(res, rb_cString);
++#else
+ RBASIC(res)->klass = rb_cString;
++#endif
+ }
+ return res;
+ }
+@@ -301,7 +313,8 @@ bz_io_data_finalize(ptr)
(*bziv->finalize)(ptr);
}
else if (TYPE(bzf->io) == T_FILE) {
@@ -56,7 +68,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
if (file->f) {
fclose(file->f);
file->f = 0;
-@@ -310,6 +319,16 @@ bz_io_data_finalize(ptr)
+@@ -310,6 +323,16 @@ bz_io_data_finalize(ptr)
fclose(file->f2);
file->f2 = 0;
}
@@ -73,7 +85,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
}
}
}
-@@ -396,8 +415,8 @@ bz_str_write(obj, str)
+@@ -396,8 +419,8 @@ bz_str_write(obj, str)
if (TYPE(str) != T_STRING) {
rb_raise(rb_eArgError, "expected a String");
}
@@ -84,7 +96,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
}
return str;
}
-@@ -436,7 +455,7 @@ bz_writer_init(argc, argv, obj)
+@@ -436,7 +459,7 @@ bz_writer_init(argc, argv, obj)
else {
VALUE iv;
struct bz_iv *bziv;
@@ -93,7 +105,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
rb_io_taint_check(a);
if (!rb_respond_to(a, id_write)) {
-@@ -507,8 +526,8 @@ bz_writer_write(obj, a)
+@@ -507,8 +530,8 @@ bz_writer_write(obj, a)
bzf->buflen = BZ_RB_BLOCKSIZE;
bzf->buf[0] = bzf->buf[bzf->buflen] = '\0';
}
@@ -104,7 +116,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
while (bzf->bzs.avail_in) {
bzf->bzs.next_out = bzf->buf;
bzf->bzs.avail_out = bzf->buflen;
-@@ -523,7 +542,7 @@ bz_writer_write(obj, a)
+@@ -523,7 +546,7 @@ bz_writer_write(obj, a)
rb_funcall(bzf->io, id_write, 1, rb_str_new(bzf->buf, n));
}
}
@@ -113,7 +125,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
}
static VALUE
-@@ -614,7 +633,7 @@ bz_reader_init(argc, argv, obj)
+@@ -614,7 +637,7 @@ bz_reader_init(argc, argv, obj)
}
if (rb_respond_to(a, id_read)) {
if (TYPE(a) == T_FILE) {
@@ -122,7 +134,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
GetOpenFile(a, fptr);
rb_io_check_readable(fptr);
-@@ -691,14 +710,14 @@ bz_next_available(bzf, in)
+@@ -691,14 +714,14 @@ bz_next_available(bzf, in)
}
if (!bzf->bzs.avail_in) {
bzf->in = rb_funcall(bzf->io, id_read, 1, INT2FIX(1024));
@@ -140,7 +152,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
}
if ((bzf->buflen - in) < (BZ_RB_BLOCKSIZE / 2)) {
bzf->buf = REALLOC_N(bzf->buf, char, bzf->buflen+BZ_RB_BLOCKSIZE+1);
-@@ -780,7 +799,7 @@ bz_read_until(bzf, str, len, td1)
+@@ -780,7 +803,7 @@ bz_read_until(bzf, str, len, td1)
if (nex) {
res = rb_str_cat(res, bzf->buf, nex);
}
@@ -149,7 +161,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
return res;
}
return Qnil;
-@@ -845,8 +864,8 @@ bz_reader_read(argc, argv, obj)
+@@ -845,8 +868,8 @@ bz_reader_read(argc, argv, obj)
}
while (1) {
total = bzf->bzs.avail_out;
@@ -160,7 +172,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
res = rb_str_cat(res, bzf->bzs.next_out, n);
bzf->bzs.next_out += n;
bzf->bzs.avail_out -= n;
-@@ -868,10 +887,10 @@ bz_getc(obj)
+@@ -868,10 +891,10 @@ bz_getc(obj)
{
VALUE length = INT2FIX(1);
VALUE res = bz_reader_read(1, &length, obj);
@@ -173,7 +185,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
}
static VALUE
-@@ -911,15 +930,15 @@ bz_reader_ungets(obj, a)
+@@ -911,15 +934,15 @@ bz_reader_ungets(obj, a)
if (!bzf->buf) {
bz_raise(BZ_SEQUENCE_ERROR);
}
@@ -196,7 +208,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
bzf->buf[bzf->buflen] = '\0';
bzf->bzs.next_out = bzf->buf;
bzf->bzs.avail_out = bzf->buflen;
-@@ -966,8 +985,8 @@ bz_reader_gets_internal(argc, argv, obj,
+@@ -966,8 +989,8 @@ bz_reader_gets_internal(argc, argv, obj,
if (NIL_P(rs)) {
return bz_reader_read(1, &rs, obj);
}
@@ -207,7 +219,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
return bz_reader_gets(obj);
}
-@@ -977,7 +996,7 @@ bz_reader_gets_internal(argc, argv, obj,
+@@ -977,7 +1000,7 @@ bz_reader_gets_internal(argc, argv, obj,
rspara = 1;
}
else {
@@ -216,7 +228,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
rspara = 0;
}
-@@ -1024,13 +1043,13 @@ bz_reader_set_unused(obj, a)
+@@ -1024,13 +1047,13 @@ bz_reader_set_unused(obj, a)
Check_Type(a, T_STRING);
Get_BZ2(obj, bzf);
if (!bzf->in) {
@@ -234,7 +246,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
return Qnil;
}
-@@ -1042,10 +1061,10 @@ bz_reader_getc(obj)
+@@ -1042,10 +1065,10 @@ bz_reader_getc(obj)
VALUE len = INT2FIX(1);
str = bz_reader_read(1, &len, obj);
@@ -247,7 +259,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
}
static void
-@@ -1319,7 +1338,7 @@ bz_reader_s_foreach(argc, argv, obj)
+@@ -1319,7 +1342,7 @@ bz_reader_s_foreach(argc, argv, obj)
rb_raise(rb_eArgError, "call out of a block");
}
rb_scan_args(argc, argv, "11", &fname, &sep);
@@ -256,7 +268,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
arg.argc = argc - 1;
arg.sep = sep;
arg.obj = rb_funcall2(rb_mKernel, id_open, 1, &fname);
-@@ -1357,7 +1376,7 @@ bz_reader_s_readlines(argc, argv, obj)
+@@ -1357,7 +1380,7 @@ bz_reader_s_readlines(argc, argv, obj)
struct bz_file *bzf;
rb_scan_args(argc, argv, "11", &fname, &sep);
@@ -265,7 +277,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
arg.argc = argc - 1;
arg.sep = sep;
arg.obj = rb_funcall2(rb_mKernel, id_open, 1, &fname);
-@@ -1411,7 +1430,7 @@ bz_str_read(argc, argv, obj)
+@@ -1411,7 +1434,7 @@ bz_str_read(argc, argv, obj)
Data_Get_Struct(obj, struct bz_str, bzs);
rb_scan_args(argc, argv, "01", &len);
if (NIL_P(len)) {
@@ -274,7 +286,7 @@ $NetBSD: patch-bz2.c,v 1.1 2011/03/08 09:27:54 obache Exp $
}
else {
count = NUM2INT(len);
-@@ -1422,13 +1441,13 @@ bz_str_read(argc, argv, obj)
+@@ -1422,13 +1445,13 @@ bz_str_read(argc, argv, obj)
if (!count || bzs->pos == -1) {
return Qnil;
}