pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   tsutsui
Date:           Sun Apr 29 15:36:44 UTC 2018

Modified Files:
        pkgsrc/devel/ruby-gnome2-glib: Makefile buildlink3.mk distinfo
        pkgsrc/x11/ruby-gnome2-gtk: Makefile buildlink3.mk distinfo
Added Files:
        pkgsrc/devel/ruby-gnome2-glib/patches: patch-ext_glib2_glib2.def
            patch-ext_glib2_rbglib.h patch-ext_glib2_rbgobj__binding.c
            patch-ext_glib2_rbgobj__closure.c patch-ext_glib2_rbgobj__object.c
            patch-ext_glib2_rbgobject.c patch-ext_glib2_rbgobject.h
            patch-ext_glib2_rbgprivate.h
        pkgsrc/x11/ruby-gnome2-gtk/patches: patch-ext_gtk2_rbgtkliststore.c
            patch-ext_gtk2_rbgtktreestore.c
            patch-ext_gtk2_rbgtktreeviewcolumn.c

Log Message:
ruby-gnome2-glib, ruby-gnome2-gtk: pull upstream fixes for issue #1162.

Fixes crashes on mikutter.
Bump PKGREVISIONs.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 pkgsrc/devel/ruby-gnome2-glib/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/devel/ruby-gnome2-glib/buildlink3.mk
cvs rdiff -u -r1.14 -r1.15 pkgsrc/devel/ruby-gnome2-glib/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_glib2.def \
    pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbglib.h \
    pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__binding.c \
    pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__closure.c \
    pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__object.c \
    pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobject.c \
    pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobject.h \
    pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgprivate.h
cvs rdiff -u -r1.67 -r1.68 pkgsrc/x11/ruby-gnome2-gtk/Makefile
cvs rdiff -u -r1.41 -r1.42 pkgsrc/x11/ruby-gnome2-gtk/buildlink3.mk
cvs rdiff -u -r1.15 -r1.16 pkgsrc/x11/ruby-gnome2-gtk/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtkliststore.c \
    pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtktreestore.c \
    pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtktreeviewcolumn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/ruby-gnome2-glib/Makefile
diff -u pkgsrc/devel/ruby-gnome2-glib/Makefile:1.30 pkgsrc/devel/ruby-gnome2-glib/Makefile:1.31
--- pkgsrc/devel/ruby-gnome2-glib/Makefile:1.30 Wed Feb 21 16:59:59 2018
+++ pkgsrc/devel/ruby-gnome2-glib/Makefile      Sun Apr 29 15:36:44 2018
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.30 2018/02/21 16:59:59 jperkin Exp $
+# $NetBSD: Makefile,v 1.31 2018/04/29 15:36:44 tsutsui Exp $
 #
 
 DISTNAME=              glib2-${VERSION}
 PKGNAME=               ${RUBY_PKGPREFIX}-gnome2-glib-${VERSION}
+PKGREVISION=           1
 COMMENT=               Ruby binding of GLib-2.x
 CATEGORIES=            devel
 

Index: pkgsrc/devel/ruby-gnome2-glib/buildlink3.mk
diff -u pkgsrc/devel/ruby-gnome2-glib/buildlink3.mk:1.11 pkgsrc/devel/ruby-gnome2-glib/buildlink3.mk:1.12
--- pkgsrc/devel/ruby-gnome2-glib/buildlink3.mk:1.11    Fri Mar 14 12:45:49 2014
+++ pkgsrc/devel/ruby-gnome2-glib/buildlink3.mk Sun Apr 29 15:36:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.11 2014/03/14 12:45:49 obache Exp $
+# $NetBSD: buildlink3.mk,v 1.12 2018/04/29 15:36:44 tsutsui Exp $
 
 BUILDLINK_TREE+=       ruby-gnome2-glib
 
@@ -6,7 +6,7 @@ BUILDLINK_TREE+=        ruby-gnome2-glib
 RUBY_GNOME2_GLIB_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.ruby-gnome2-glib+=       ${RUBY_PKGPREFIX}-gnome2-glib>=0.17.0
-BUILDLINK_ABI_DEPENDS.ruby-gnome2-glib+=       ${RUBY_PKGPREFIX}-gnome2-glib>=2.2.0
+BUILDLINK_ABI_DEPENDS.ruby-gnome2-glib+=       ${RUBY_PKGPREFIX}-gnome2-glib>=2.2.4nb1
 BUILDLINK_PKGSRCDIR.ruby-gnome2-glib?=         ../../devel/ruby-gnome2-glib
 
 .include "../../devel/glib2/buildlink3.mk"

Index: pkgsrc/devel/ruby-gnome2-glib/distinfo
diff -u pkgsrc/devel/ruby-gnome2-glib/distinfo:1.14 pkgsrc/devel/ruby-gnome2-glib/distinfo:1.15
--- pkgsrc/devel/ruby-gnome2-glib/distinfo:1.14 Fri Apr 13 16:31:09 2018
+++ pkgsrc/devel/ruby-gnome2-glib/distinfo      Sun Apr 29 15:36:44 2018
@@ -1,6 +1,14 @@
-$NetBSD: distinfo,v 1.14 2018/04/13 16:31:09 tsutsui Exp $
+$NetBSD: distinfo,v 1.15 2018/04/29 15:36:44 tsutsui Exp $
 
 SHA1 (glib2-3.2.4.gem) = a1aa0ea0d88fe241825daee9f2a7e9a444cb60fe
 RMD160 (glib2-3.2.4.gem) = f6b6da60e27bf9ebaee6757d0fa7df01b9dcb73e
 SHA512 (glib2-3.2.4.gem) = d766787ad15ead3f0b8ff0a334fd0a8df5b6ea719fee36aa5c3aa38273d1e4ccfb1ceab4564b0c01e597a413a8e49009adf70a6ac27b930465a9aa7d8b033418
 Size (glib2-3.2.4.gem) = 142336 bytes
+SHA1 (patch-ext_glib2_glib2.def) = 9f6e593c494930e28c683689d7438d14333377b8
+SHA1 (patch-ext_glib2_rbglib.h) = 97a9088fb749f0985d415ee068eceb1e78237661
+SHA1 (patch-ext_glib2_rbgobj__binding.c) = 1c6459564d08d86570ad631dbd95b20f9ff22ba5
+SHA1 (patch-ext_glib2_rbgobj__closure.c) = 6655f9a2e49f8bfd1eb0ec2208ab566d5d13b02e
+SHA1 (patch-ext_glib2_rbgobj__object.c) = c0099a33d3805d2137b1f76f8050bb1c075bfefa
+SHA1 (patch-ext_glib2_rbgobject.c) = 5e81544395ee1dc543ab5cf926ea19d1ade89431
+SHA1 (patch-ext_glib2_rbgobject.h) = 8023d86bc2d119f83d37c27e7686f6a55816616c
+SHA1 (patch-ext_glib2_rbgprivate.h) = 9cad0b23a174b500a940d5d1fa4d66a6aeac3566

Index: pkgsrc/x11/ruby-gnome2-gtk/Makefile
diff -u pkgsrc/x11/ruby-gnome2-gtk/Makefile:1.67 pkgsrc/x11/ruby-gnome2-gtk/Makefile:1.68
--- pkgsrc/x11/ruby-gnome2-gtk/Makefile:1.67    Mon Apr 16 14:34:02 2018
+++ pkgsrc/x11/ruby-gnome2-gtk/Makefile Sun Apr 29 15:36:44 2018
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.67 2018/04/16 14:34:02 wiz Exp $
+# $NetBSD: Makefile,v 1.68 2018/04/29 15:36:44 tsutsui Exp $
 #
 
 DISTNAME=              gtk2-${VERSION}
 PKGNAME=               ${RUBY_PKGPREFIX}-gnome2-gtk-${VERSION}
-PKGREVISION=           1
+PKGREVISION=           2
 COMMENT=               Ruby binding of GTK+-2.x
 CATEGORIES=            x11
 

Index: pkgsrc/x11/ruby-gnome2-gtk/buildlink3.mk
diff -u pkgsrc/x11/ruby-gnome2-gtk/buildlink3.mk:1.41 pkgsrc/x11/ruby-gnome2-gtk/buildlink3.mk:1.42
--- pkgsrc/x11/ruby-gnome2-gtk/buildlink3.mk:1.41       Mon Apr 16 14:34:02 2018
+++ pkgsrc/x11/ruby-gnome2-gtk/buildlink3.mk    Sun Apr 29 15:36:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.41 2018/04/16 14:34:02 wiz Exp $
+# $NetBSD: buildlink3.mk,v 1.42 2018/04/29 15:36:44 tsutsui Exp $
 
 BUILDLINK_TREE+=       ruby-gnome2-gtk
 
@@ -6,7 +6,7 @@ BUILDLINK_TREE+=        ruby-gnome2-gtk
 RUBY_GNOME2_GTK_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.ruby-gnome2-gtk+=        ${RUBY_PKGPREFIX}-gnome2-gtk>=0.17.0
-BUILDLINK_ABI_DEPENDS.ruby-gnome2-gtk+=        ${RUBY_PKGPREFIX}-gnome2-gtk>=3.2.4nb1
+BUILDLINK_ABI_DEPENDS.ruby-gnome2-gtk+=        ${RUBY_PKGPREFIX}-gnome2-gtk>=3.2.4nb2
 BUILDLINK_PKGSRCDIR.ruby-gnome2-gtk?=  ../../x11/ruby-gnome2-gtk
 
 .include "../../devel/ruby-gnome2-pango/buildlink3.mk"

Index: pkgsrc/x11/ruby-gnome2-gtk/distinfo
diff -u pkgsrc/x11/ruby-gnome2-gtk/distinfo:1.15 pkgsrc/x11/ruby-gnome2-gtk/distinfo:1.16
--- pkgsrc/x11/ruby-gnome2-gtk/distinfo:1.15    Fri Apr 13 16:31:11 2018
+++ pkgsrc/x11/ruby-gnome2-gtk/distinfo Sun Apr 29 15:36:44 2018
@@ -1,6 +1,9 @@
-$NetBSD: distinfo,v 1.15 2018/04/13 16:31:11 tsutsui Exp $
+$NetBSD: distinfo,v 1.16 2018/04/29 15:36:44 tsutsui Exp $
 
 SHA1 (gtk2-3.2.4.gem) = e5d7b35799c5a335214fb587b4128840856e4fbb
 RMD160 (gtk2-3.2.4.gem) = 1d89f9660d861d8db1670c3ce2caa8fe243f22f9
 SHA512 (gtk2-3.2.4.gem) = 87f8d79e042912c6fadd0f357e91450ae6d1047b679e103d4b869068f5fb3c760e7d60118e7040d3ccc814839d89171791d5275d91c96ad774a1cd21b34543f0
 Size (gtk2-3.2.4.gem) = 466944 bytes
+SHA1 (patch-ext_gtk2_rbgtkliststore.c) = 3274e8a81352fcecd4a076d07fc003ea345a1967
+SHA1 (patch-ext_gtk2_rbgtktreestore.c) = 19e3edaceb9a1ed9f02e9beee7137e46944e5451
+SHA1 (patch-ext_gtk2_rbgtktreeviewcolumn.c) = 8b7b359537cf8ac37e146887d1c5524414c7f211

Added files:

Index: pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_glib2.def
diff -u /dev/null pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_glib2.def:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_glib2.def     Sun Apr 29 15:36:44 2018
@@ -0,0 +1,16 @@
+$NetBSD: patch-ext_glib2_glib2.def,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/glib2/glib2.def.orig   2018-04-29 15:03:29.000000000 +0000
++++ ext/glib2/glib2.def
+@@ -61,6 +61,9 @@ EXPORTS
+       rbgobj_class_init_func
+       rbgobj_register_type
+       rbgobj_object_alloc_func
++      rbgobj_object_add_relative
++      rbgobj_object_remove_relative
++      rbgobj_object_remove_relatives
+       rbgobj_set_signal_func
+       rbgobj_get_signal_func
+       rbgobj_set_signal_call_func
Index: pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbglib.h
diff -u /dev/null pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbglib.h:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbglib.h      Sun Apr 29 15:36:44 2018
@@ -0,0 +1,17 @@
+$NetBSD: patch-ext_glib2_rbglib.h,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/glib2/rbglib.h.orig    2018-04-29 15:03:29.000000000 +0000
++++ ext/glib2/rbglib.h
+@@ -46,6 +46,10 @@ extern "C" {
+ #  endif
+ #endif
+ 
++#ifndef RB_ALLOC
++#  define RB_ALLOC(type) ALLOC(type)
++#endif
++
+ #ifndef RB_ALLOC_N
+ #  define RB_ALLOC_N(type, n) ALLOC_N(type, n)
+ #endif
Index: pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__binding.c
diff -u /dev/null pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__binding.c:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__binding.c     Sun Apr 29 15:36:44 2018
@@ -0,0 +1,23 @@
+$NetBSD: patch-ext_glib2_rbgobj__binding.c,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/glib2/rbgobj_binding.c.orig    2018-04-29 15:03:30.000000000 +0000
++++ ext/glib2/rbgobj_binding.c
+@@ -28,7 +28,15 @@
+ static VALUE
+ rg_unbind(VALUE self)
+ {
+-    g_binding_unbind(_SELF(self));
++    GBinding *binding = _SELF(self);
++    GObject *source;
++    VALUE rb_source;
++
++    source = g_binding_get_source(binding);
++    rb_source = GOBJ2RVAL(source);
++    rbgobj_object_remove_relative(rb_source, self);
++    g_binding_unbind(binding);
++
+     return self;
+ }
+ #endif
Index: pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__closure.c
diff -u /dev/null pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__closure.c:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__closure.c     Sun Apr 29 15:36:44 2018
@@ -0,0 +1,48 @@
+$NetBSD: patch-ext_glib2_rbgobj__closure.c,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/glib2/rbgobj_closure.c.orig    2018-04-29 15:03:30.000000000 +0000
++++ ext/glib2/rbgobj_closure.c
+@@ -1,6 +1,6 @@
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
+ /*
+- *  Copyright (C) 2011-2016  Ruby-GNOME2 Project Team
++ *  Copyright (C) 2011-2018  Ruby-GNOME2 Project Team
+  *  Copyright (C) 2002-2006  Ruby-GNOME2 Project
+  *  Copyright (C) 2002,2003  Masahiro Sakai
+  *
+@@ -191,8 +191,9 @@ rclosure_invalidate(G_GNUC_UNUSED gpoint
+         for (next = rclosure->objects; next; next = next->next) {
+             GObject *object = G_OBJECT(next->data);
+             VALUE obj = rbgobj_ruby_object_from_instance2(object, FALSE);
+-            if (!NIL_P(rclosure->rb_holder) && !NIL_P(obj))
+-                G_REMOVE_RELATIVE(obj, id_closures, rclosure->rb_holder);
++            if (!NIL_P(rclosure->rb_holder) && !NIL_P(obj)) {
++                rbgobj_object_remove_relative(obj, rclosure->rb_holder);
++            }
+         }
+ 
+         rclosure_unref(rclosure);
+@@ -286,16 +287,15 @@ rclosure_weak_notify(gpointer data, GObj
+ void
+ g_rclosure_attach(GClosure *closure, VALUE object)
+ {
+-    static VALUE mGLibObject = (VALUE)NULL;
++    static VALUE cGLibObject = Qnil;
+     GRClosure *rclosure = (GRClosure *)closure;
+ 
+-    G_RELATIVE2(object, Qnil, id_closures, rclosure->rb_holder);
+-
+-    if (!mGLibObject) {
+-        mGLibObject = rb_const_get(mGLib, rb_intern("Object"));
++    if (NIL_P(cGLibObject)) {
++        cGLibObject = rb_const_get(mGLib, rb_intern("Object"));
+     }
+-    if (rb_obj_is_kind_of(object, mGLibObject)) {
++    if (rb_obj_is_kind_of(object, cGLibObject)) {
+         GObject *gobject;
++        rbgobj_object_add_relative(object, rclosure->rb_holder);
+         gobject = RVAL2GOBJ(object);
+         rclosure->count++;
+         g_object_weak_ref(gobject, rclosure_weak_notify, rclosure);
Index: pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__object.c
diff -u /dev/null pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__object.c:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobj__object.c      Sun Apr 29 15:36:44 2018
@@ -0,0 +1,176 @@
+$NetBSD: patch-ext_glib2_rbgobj__object.c,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/glib2/rbgobj_object.c.orig     2018-04-29 15:03:30.000000000 +0000
++++ ext/glib2/rbgobj_object.c
+@@ -43,7 +43,8 @@ weak_notify(gpointer data, G_GNUC_UNUSED
+     gobj_holder *holder = data;
+ 
+     rbgobj_instance_call_cinfo_free(holder->gobj);
+-    rbgobj_invalidate_relatives(holder->self);
++    g_hash_table_unref(holder->rb_relatives);
++    holder->rb_relatives = NULL;
+     holder->destroyed = TRUE;
+ 
+     g_object_unref(holder->gobj);
+@@ -51,11 +52,24 @@ weak_notify(gpointer data, G_GNUC_UNUSED
+ }
+ 
+ static void
++holder_relatives_mark(gpointer key, gpointer value, gpointer user_data)
++{
++    VALUE rb_relative = (VALUE)value;
++    rb_gc_mark(rb_relative);
++}
++
++static void
+ holder_mark(void *data)
+ {
+     gobj_holder *holder = data;
+-    if (holder->gobj && !holder->destroyed)
+-        rbgobj_instance_call_cinfo_mark(holder->gobj);
++
++    if (!holder->gobj)
++        return;
++    if (holder->destroyed)
++        return;
++
++    rbgobj_instance_call_cinfo_mark(holder->gobj);
++    g_hash_table_foreach(holder->rb_relatives, holder_relatives_mark, NULL);
+ }
+ 
+ static void
+@@ -91,6 +105,59 @@ static const rb_data_type_t rg_glib_obje
+     RUBY_TYPED_FREE_IMMEDIATELY,
+ };
+ 
++void
++rbgobj_object_add_relative(VALUE rb_gobject, VALUE rb_relative)
++{
++    gobj_holder *holder;
++    TypedData_Get_Struct(rb_gobject,
++                         gobj_holder,
++                         &rg_glib_object_type,
++                         holder);
++    if (holder->rb_relatives) {
++        g_hash_table_insert(holder->rb_relatives,
++                            (gpointer)(rb_relative),
++                            (gpointer)(rb_relative));
++    }
++}
++
++void
++rbgobj_object_remove_relative(VALUE rb_gobject, VALUE rb_relative)
++{
++    gobj_holder *holder;
++    TypedData_Get_Struct(rb_gobject,
++                         gobj_holder,
++                         &rg_glib_object_type,
++                         holder);
++    if (holder->rb_relatives) {
++        g_hash_table_remove(holder->rb_relatives,
++                            (gpointer)(rb_relative));
++    }
++}
++
++static gboolean
++rbgobj_object_remove_relatives_body(gpointer key,
++                                    gpointer value,
++                                    gpointer user_data)
++{
++    VALUE rb_relative = (VALUE)value;
++    VALUE rb_relative_class = (VALUE)user_data;
++
++    return RVAL2CBOOL(rb_obj_is_kind_of(rb_relative, rb_relative_class));
++}
++
++void
++rbgobj_object_remove_relatives(VALUE rb_gobject, VALUE rb_relative_class)
++{
++    gobj_holder *holder;
++    TypedData_Get_Struct(rb_gobject,
++                         gobj_holder,
++                         &rg_glib_object_type,
++                         holder);
++    g_hash_table_foreach_remove(holder->rb_relatives,
++                                rbgobj_object_remove_relatives_body,
++                                (gpointer)(rb_relative_class));
++}
++
+ VALUE
+ rbgobj_object_alloc_func(VALUE klass)
+ {
+@@ -105,6 +172,7 @@ rbgobj_object_alloc_func(VALUE klass)
+     holder->gobj  = NULL;
+     holder->cinfo = NULL;
+     holder->destroyed = FALSE;
++    holder->rb_relatives = g_hash_table_new(g_direct_hash, g_direct_equal);
+ 
+     return result;
+ }
+@@ -686,13 +754,6 @@ static void
+ rg_destroy_bind_property_full_data(gpointer user_data)
+ {
+     RGBindPropertyCallbackData *data = (RGBindPropertyCallbackData *)user_data;
+-
+-    if (!NIL_P(data->transform_to_callback))
+-        G_CHILD_REMOVE(data->self, data->transform_to_callback);
+-
+-    if (!NIL_P(data->transform_from_callback))
+-        G_CHILD_REMOVE(data->self, data->transform_from_callback);
+-
+     xfree(data);
+ }
+ 
+@@ -715,6 +776,7 @@ rg_bind_property(gint argc, VALUE *argv,
+     GBinding *binding;
+     GBindingTransformFunc transform_to = NULL;
+     GBindingTransformFunc transform_from = NULL;
++    VALUE rb_binding;
+ 
+     rb_scan_args(argc, argv, "41", &rb_source_property, &rb_target,
+                  &rb_target_property, &rb_flags, &rb_options);
+@@ -731,18 +793,16 @@ rg_bind_property(gint argc, VALUE *argv,
+     flags = RVAL2GBINDINGFLAGS(rb_flags);
+ 
+     if (!NIL_P(rb_transform_to)) {
+-        G_CHILD_ADD(self, rb_transform_to);
+         transform_to = rg_bind_property_transform_to_callback;
+     }
+ 
+     if (!NIL_P(rb_transform_from)) {
+-        G_CHILD_ADD(self, rb_transform_from);
+         transform_from = rg_bind_property_transform_from_callback;
+     }
+ 
+     if (transform_to || transform_from) {
+         RGBindPropertyCallbackData *data;
+-        data = (RGBindPropertyCallbackData *)xmalloc(sizeof(RGBindPropertyCallbackData));
++        data = RB_ALLOC(RGBindPropertyCallbackData);
+         data->self = self;
+         data->transform_to_callback = rb_transform_to;
+         data->transform_from_callback = rb_transform_from;
+@@ -752,13 +812,21 @@ rg_bind_property(gint argc, VALUE *argv,
+                                               transform_from,
+                                               (gpointer)data,
+                                               rg_destroy_bind_property_full_data);
++        rb_binding = GOBJ2RVAL(binding);
++        if (!NIL_P(rb_transform_to)) {
++            rbgobj_object_add_relative(rb_binding, rb_transform_to);
++        }
++        if (!NIL_P(rb_transform_from)) {
++            rbgobj_object_add_relative(rb_binding, rb_transform_from);
++        }
+     } else {
+         binding = g_object_bind_property(source, source_property,
+                                          target, target_property,
+                                          flags);
++        rb_binding = GOBJ2RVAL(binding);
+     }
+ 
+-    return GOBJ2RVAL(binding);
++    return rb_binding;
+ }
+ #endif
+ 
Index: pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobject.c
diff -u /dev/null pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobject.c:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobject.c   Sun Apr 29 15:36:44 2018
@@ -0,0 +1,114 @@
+$NetBSD: patch-ext_glib2_rbgobject.c,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/glib2/rbgobject.c.orig 2018-04-29 15:03:30.000000000 +0000
++++ ext/glib2/rbgobject.c
+@@ -1,6 +1,6 @@
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
+ /*
+- *  Copyright (C) 2011  Ruby-GNOME2 Project Team
++ *  Copyright (C) 2011-2018  Ruby-GNOME2 Project Team
+  *  Copyright (C) 2003-2006  Ruby-GNOME2 Project Team
+  *  Copyright (C) 2002,2003  Masahiro Sakai
+  *  Copyright (C) 1998-2000 Yukihiro Matsumoto,
+@@ -183,16 +183,25 @@ rbgobj_ruby_object_from_instance_with_un
+ void
+ rbgobj_add_relative(VALUE obj, VALUE relative)
+ {
+-    VALUE hash = Qnil;
++    static VALUE mGLibObject = Qnil;
++    if (NIL_P(mGLibObject)) {
++        mGLibObject = rb_const_get(mGLib, rb_intern("Object"));
++    }
+ 
+-    if (RVAL2CBOOL(rb_ivar_defined(obj, id_relatives)))
+-        hash = rb_ivar_get(obj, id_relatives);
++    if (rb_obj_is_kind_of(obj, mGLibObject)) {
++        rbgobj_object_add_relative(obj, relative);
++    } else {
++        VALUE hash = Qnil;
+ 
+-    if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
+-        hash = rb_hash_new();
+-        rb_ivar_set(obj, id_relatives, hash);
++        if (RVAL2CBOOL(rb_ivar_defined(obj, id_relatives)))
++            hash = rb_ivar_get(obj, id_relatives);
++
++        if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
++            hash = rb_hash_new();
++            rb_ivar_set(obj, id_relatives, hash);
++        }
++        rb_hash_aset(hash, relative, Qnil);
+     }
+-    rb_hash_aset(hash, relative, Qnil);
+ }
+ 
+ void
+@@ -207,16 +216,26 @@ rbgobj_invalidate_relatives(VALUE obj)
+ void
+ rbgobj_add_relative_removable(VALUE obj, VALUE relative, ID obj_ivar_id, VALUE hash_key)
+ {
+-    VALUE hash = Qnil;
++    static VALUE cGLibObject = Qnil;
++    if (NIL_P(cGLibObject)) {
++        cGLibObject = rb_const_get(mGLib, rb_intern("Object"));
++    }
+ 
+-    if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id)))
+-        hash = rb_ivar_get(obj, obj_ivar_id);
++    if (obj_ivar_id == rbgobj_id_children &&
++        rb_obj_is_kind_of(obj, cGLibObject)) {
++        rbgobj_object_add_relative(obj, hash_key);
++    } else {
++        VALUE hash = Qnil;
+ 
+-    if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
+-        hash = rb_hash_new();
+-        rb_ivar_set(obj, obj_ivar_id, hash);
++        if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id)))
++            hash = rb_ivar_get(obj, obj_ivar_id);
++
++        if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
++            hash = rb_hash_new();
++            rb_ivar_set(obj, obj_ivar_id, hash);
++        }
++        rb_hash_aset(hash, hash_key, relative);
+     }
+-    rb_hash_aset(hash, hash_key, relative);
+ }
+ 
+ VALUE
+@@ -236,15 +255,25 @@ rbgobj_get_relative_removable(VALUE obj,
+ void
+ rbgobj_remove_relative(VALUE obj, ID obj_ivar_id, VALUE hash_key)
+ {
+-    VALUE hash = Qnil;
+-
+-    if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id)))
+-        hash = rb_ivar_get(obj, obj_ivar_id);
++    static VALUE cGLibObject = Qnil;
++    if (NIL_P(cGLibObject)) {
++        cGLibObject = rb_const_get(mGLib, rb_intern("Object"));
++    }
+ 
+-    if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
+-        /* should not happen. */
++    if ((obj_ivar_id == id_relatives || obj_ivar_id == rbgobj_id_children) &&
++        rb_obj_is_kind_of(obj, cGLibObject)) {
++        rbgobj_object_remove_relative(obj, hash_key);
+     } else {
+-        rb_funcall(hash, id_delete, 1, hash_key);
++        VALUE hash = Qnil;
++
++        if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id)))
++            hash = rb_ivar_get(obj, obj_ivar_id);
++
++        if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) {
++            /* should not happen. */
++        } else {
++            rb_funcall(hash, id_delete, 1, hash_key);
++        }
+     }
+ }
+ 
Index: pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobject.h
diff -u /dev/null pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobject.h:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgobject.h   Sun Apr 29 15:36:44 2018
@@ -0,0 +1,28 @@
+$NetBSD: patch-ext_glib2_rbgobject.h,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/glib2/rbgobject.h.orig 2018-04-29 15:03:30.000000000 +0000
++++ ext/glib2/rbgobject.h
+@@ -79,6 +79,7 @@ RUBY_GLIB2_VAR  ID rbgobj_id_children;
+     (rbgobj_add_relative_removable(self, Qnil, rbgobj_id_children, child))
+ #define G_CHILD_REMOVE(self, child) \
+     (rbgobj_remove_relative(self, rbgobj_id_children, child))
++/* Deprecated since 3.2.5. Use rbobj_object_remove_relatives() instead. */
+ #define G_CHILD_REMOVE_ALL(self) \
+     (rbgobj_remove_relative_all(self, rbgobj_id_children))
+ 
+@@ -147,6 +148,13 @@ extern VALUE rbgobj_ruby_object_from_ins
+ extern VALUE rbgobj_ruby_object_from_instance_with_unref(gpointer instance);
+ extern void rbgobj_instance_unref(gpointer instance);
+ 
++extern void rbgobj_object_add_relative(VALUE rb_gobject,
++                                       VALUE rb_relative);
++extern void rbgobj_object_remove_relative(VALUE rb_gobject,
++                                          VALUE rb_relative);
++extern void rbgobj_object_remove_relatives(VALUE rb_gobject,
++                                           VALUE rb_relative_class);
++
+ extern void rbgobj_add_relative(VALUE obj, VALUE relative);
+ extern void rbgobj_invalidate_relatives(VALUE obj);
+ extern void rbgobj_add_relative_removable(VALUE obj, VALUE relative,
Index: pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgprivate.h
diff -u /dev/null pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgprivate.h:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/devel/ruby-gnome2-glib/patches/patch-ext_glib2_rbgprivate.h  Sun Apr 29 15:36:44 2018
@@ -0,0 +1,22 @@
+$NetBSD: patch-ext_glib2_rbgprivate.h,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/glib2/rbgprivate.h.orig        2018-04-29 15:03:30.000000000 +0000
++++ ext/glib2/rbgprivate.h
+@@ -1,6 +1,6 @@
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
+ /*
+- *  Copyright (C) 2007-2017  Ruby-GNOME2 Project Team
++ *  Copyright (C) 2007-2018  Ruby-GNOME2 Project Team
+  *
+  *  This library is free software; you can redistribute it and/or
+  *  modify it under the terms of the GNU Lesser General Public
+@@ -42,6 +42,7 @@ typedef struct {
+     GObject* gobj;
+     const RGObjClassInfo* cinfo;
+     gboolean destroyed;
++    GHashTable *rb_relatives;
+ } gobj_holder;
+ 
+ typedef struct {

Index: pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtkliststore.c
diff -u /dev/null pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtkliststore.c:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtkliststore.c  Sun Apr 29 15:36:44 2018
@@ -0,0 +1,27 @@
+$NetBSD: patch-ext_gtk2_rbgtkliststore.c,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/gtk2/rbgtkliststore.c.orig     2018-04-29 15:18:33.000000000 +0000
++++ ext/gtk2/rbgtkliststore.c
+@@ -1,6 +1,6 @@
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
+ /*
+- *  Copyright (C) 2011  Ruby-GNOME2 Project Team
++ *  Copyright (C) 2011-2018  Ruby-GNOME2 Project Team
+  *  Copyright (C) 2002-2005 Masao Mutoh
+  *
+  *  This library is free software; you can redistribute it and/or
+@@ -333,7 +333,11 @@ rg_append(VALUE self)
+ static VALUE
+ rg_clear(VALUE self)
+ {
+-    G_CHILD_REMOVE_ALL(self);
++    static VALUE rb_cGtkTreeIter = Qnil;
++    if (NIL_P(rb_cGtkTreeIter)) {
++        rb_cGtkTreeIter = GTYPE2CLASS(GTK_TYPE_TREE_ITER);
++    }
++    rbgobj_object_remove_relatives(self, rb_cGtkTreeIter);
+     gtk_list_store_clear(_SELF(self));
+     return self;
+ }
Index: pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtktreestore.c
diff -u /dev/null pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtktreestore.c:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtktreestore.c  Sun Apr 29 15:36:44 2018
@@ -0,0 +1,27 @@
+$NetBSD: patch-ext_gtk2_rbgtktreestore.c,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/gtk2/rbgtktreestore.c.orig     2018-04-29 15:18:34.000000000 +0000
++++ ext/gtk2/rbgtktreestore.c
+@@ -1,6 +1,6 @@
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
+ /*
+- *  Copyright (C) 2011-2012  Ruby-GNOME2 Project Team
++ *  Copyright (C) 2011-2018 Ruby-GNOME2 Project Team
+  *  Copyright (C) 2002-2006 Masao Mutoh
+  *
+  *  This library is free software; you can redistribute it and/or
+@@ -273,7 +273,11 @@ rg_iter_depth(VALUE self, VALUE iter)
+ static VALUE
+ rg_clear(VALUE self)
+ {
+-    G_CHILD_REMOVE_ALL(self);
++    static VALUE rb_cGtkTreeIter = Qnil;
++    if (NIL_P(rb_cGtkTreeIter)) {
++        rb_cGtkTreeIter = GTYPE2CLASS(GTK_TYPE_TREE_ITER);
++    }
++    rbgobj_object_remove_relatives(self, rb_cGtkTreeIter);
+     gtk_tree_store_clear(_SELF(self));
+     return self;
+ }
Index: pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtktreeviewcolumn.c
diff -u /dev/null pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtktreeviewcolumn.c:1.1
--- /dev/null   Sun Apr 29 15:36:44 2018
+++ pkgsrc/x11/ruby-gnome2-gtk/patches/patch-ext_gtk2_rbgtktreeviewcolumn.c     Sun Apr 29 15:36:44 2018
@@ -0,0 +1,27 @@
+$NetBSD: patch-ext_gtk2_rbgtktreeviewcolumn.c,v 1.1 2018/04/29 15:36:44 tsutsui Exp $
+
+- pull upstream fix for issue #1162
+
+--- ext/gtk2/rbgtktreeviewcolumn.c.orig        2018-04-29 15:18:34.000000000 +0000
++++ ext/gtk2/rbgtktreeviewcolumn.c
+@@ -1,6 +1,6 @@
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
+ /*
+- *  Copyright (C) 2011  Ruby-GNOME2 Project Team
++ *  Copyright (C) 2011-2018 Ruby-GNOME2 Project Team
+  *  Copyright (C) 2002-2004 Masao Mutoh
+  *
+  *  This library is free software; you can redistribute it and/or
+@@ -83,7 +83,11 @@ rg_pack_end(VALUE self, VALUE cell, VALU
+ static VALUE
+ rg_clear(VALUE self)
+ {
+-    G_CHILD_REMOVE_ALL(self);
++    static VALUE rb_cGtkCellRenderer = Qnil;
++    if (NIL_P(rb_cGtkCellRenderer)) {
++        rb_cGtkCellRenderer = GTYPE2CLASS(GTK_TYPE_CELL_RENDERER);
++    }
++    rbgobj_object_remove_relatives(self, rb_cGtkCellRenderer);
+     gtk_tree_view_column_clear(_SELF(self));
+     return self;
+ }



Home | Main Index | Thread Index | Old Index