git: 0a652002cc99 - main - x11-toolkits/rubygem-gtk2: Fix build with Ruby 3.2+

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sat, 06 Apr 2024 00:03:13 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0a652002cc99ac5ad962711ffa1af091ea8728a1

commit 0a652002cc99ac5ad962711ffa1af091ea8728a1
Author:     Dirk Meyer <dinoex@FreeBSD.org>
AuthorDate: 2024-04-06 00:00:09 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-04-06 00:00:09 +0000

    x11-toolkits/rubygem-gtk2: Fix build with Ruby 3.2+
    
    PR:             277916
---
 x11-toolkits/rubygem-gtk2/Makefile           |  2 --
 x11-toolkits/rubygem-gtk2/files/patch-ruby32 | 42 ++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/x11-toolkits/rubygem-gtk2/Makefile b/x11-toolkits/rubygem-gtk2/Makefile
index 77c136280167..5b300b8ad145 100644
--- a/x11-toolkits/rubygem-gtk2/Makefile
+++ b/x11-toolkits/rubygem-gtk2/Makefile
@@ -12,8 +12,6 @@ WWW=		https://ruby-gnome.github.io/ \
 LICENSE=	LGPL21+
 LICENSE_FILE=	${WRKSRC}/COPYING.LIB
 
-BROKEN_RUBY32=	yes
-
 RUN_DEPENDS=	rubygem-atk>=${PORTVERSION}:accessibility/rubygem-atk \
 		rubygem-gdk_pixbuf2>=${PORTVERSION}:graphics/rubygem-gdk_pixbuf2 \
 		rubygem-pango>=${PORTVERSION}:x11-toolkits/rubygem-pango
diff --git a/x11-toolkits/rubygem-gtk2/files/patch-ruby32 b/x11-toolkits/rubygem-gtk2/files/patch-ruby32
new file mode 100644
index 000000000000..aa8105d525e4
--- /dev/null
+++ b/x11-toolkits/rubygem-gtk2/files/patch-ruby32
@@ -0,0 +1,42 @@
+--- ext/gtk2/rbgtkcontainer.c.orig	2024-04-05 14:08:42 UTC
++++ ext/gtk2/rbgtkcontainer.c
+@@ -172,7 +172,7 @@ rbgtkcontainer_register_child_property_setter(GType gt
+     pspec = gtk_container_class_find_child_property(oclass, name);
+ 
+     rb_hash_aset(table, rb_intern(g_param_spec_get_name(pspec)),
+-                 Data_Wrap_Struct(rb_cData, NULL, NULL, func));
++                 Data_Wrap_Struct(rb_cObject, NULL, NULL, func));
+ 
+     g_type_class_unref(oclass);
+ }
+@@ -193,7 +193,7 @@ rbgtkcontainer_register_child_property_getter(GType gt
+     pspec = gtk_container_class_find_child_property(oclass, name);
+ 
+     rb_hash_aset(table, rb_intern(g_param_spec_get_name(pspec)),
+-                 Data_Wrap_Struct(rb_cData, NULL, NULL, func));
++                 Data_Wrap_Struct(rb_cObject, NULL, NULL, func));
+ }
+ 
+ static VALUE
+--- ext/gtk2/rbgtktreeiter.c.orig	2024-04-05 14:08:42 UTC
++++ ext/gtk2/rbgtktreeiter.c
+@@ -29,7 +29,7 @@ rbgtk_register_treeiter_set_value_func(GType gtype, rb
+ rbgtk_register_treeiter_set_value_func(GType gtype, rbgtkiter_set_value_func func)
+ {
+     rb_hash_aset(treeiter_set_value_table, INT2NUM(gtype), 
+-                 Data_Wrap_Struct(rb_cData, NULL, NULL, func));
++                 Data_Wrap_Struct(rb_cObject, NULL, NULL, func));
+ }
+ 
+ static VALUE
+--- ext/gtk2/rbgtkwindow.c.orig	2024-04-05 14:08:42 UTC
++++ ext/gtk2/rbgtkwindow.c
+@@ -582,7 +582,7 @@ Init_gtk_window(VALUE mGtk)
+     {
+         static VALUE toplevels_marker;
+         toplevels_marker =
+-            rb_data_object_alloc(rb_cData, NULL, mark_toplevels, NULL);
++            rb_data_object_alloc(rb_cObject, NULL, mark_toplevels, NULL);
+         rb_global_variable(&toplevels_marker);
+     }
+ }