public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rubygem-gtk2] rawhide: Port to use rb_data_type_t
@ 2026-10-24 5:15 Mamoru TASAKA
0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-10-24 5:15 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rubygem-gtk2
Branch : rawhide
Commit : 9c7f4fe6962409b864e6e38bb6c0048e8e265920
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date : 2026-10-24T14:15:25+09:00
Stats : +117/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rubygem-gtk2/c/9c7f4fe6962409b864e6e38bb6c0048e8e265920?branch=rawhide
Log:
Port to use rb_data_type_t
---
diff --git a/gtk2-3.4.3-rb_data_type_t.patch b/gtk2-3.4.3-rb_data_type_t.patch
new file mode 100644
index 0000000..46657e7
--- /dev/null
+++ b/gtk2-3.4.3-rb_data_type_t.patch
@@ -0,0 +1,110 @@
+diff -urp '--exclude=*~' '--exclude=Makefile' gtk2-3.4.3.orig/ext/gtk2/rbgtkcontainer.c gtk2-3.4.3/ext/gtk2/rbgtkcontainer.c
+--- gtk2-3.4.3.orig/ext/gtk2/rbgtkcontainer.c 2026-10-24 11:49:46.880259973 +0900
++++ gtk2-3.4.3/ext/gtk2/rbgtkcontainer.c 2026-10-24 12:44:59.990731415 +0900
+@@ -156,6 +156,15 @@ void gtk_container_child_set
+ ...);
+ */
+
++static const rb_data_type_t rb_type_gtk_container_setter = {
++ .wrap_struct_name = "GtkContainer::set",
++};
++
++
++static const rb_data_type_t rb_type_gtk_container_getter = {
++ .wrap_struct_name = "GtkContainer::get",
++};
++
+ void
+ rbgtkcontainer_register_child_property_setter(GType gtype, const char *name, RValueToGValueFunc func)
+ {
+@@ -172,7 +181,7 @@ rbgtkcontainer_register_child_property_s
+ 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_cObject, NULL, NULL, func));
++ TypedData_Wrap_Struct(rb_cObject, &rb_type_gtk_container_setter, func));
+
+ g_type_class_unref(oclass);
+ }
+@@ -193,7 +202,7 @@ rbgtkcontainer_register_child_property_g
+ 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_cObject, NULL, NULL, func));
++ TypedData_Wrap_Struct(rb_cObject, &rb_type_gtk_container_getter, func));
+ }
+
+ static VALUE
+@@ -224,7 +233,7 @@ rg_child_get_property(VALUE self, VALUE
+ if (!NIL_P(table)){
+ VALUE obj = rb_hash_aref(table, rb_intern(g_param_spec_get_name(pspec)));
+ if (!NIL_P(obj))
+- Data_Get_Struct(obj, void, getter);
++ TypedData_Get_Struct(obj, void, &rb_type_gtk_container_getter, getter);
+ }
+ }
+ g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec));
+@@ -268,7 +277,7 @@ rg_child_set_property(VALUE self, VALUE
+ if (!NIL_P(table)){
+ VALUE obj = rb_hash_aref(table, rb_intern(g_param_spec_get_name(pspec)));
+ if (!NIL_P(obj))
+- Data_Get_Struct(obj, void, setter);
++ TypedData_Get_Struct(obj, void, &rb_type_gtk_container_setter, setter);
+ }
+ }
+
+diff -urp '--exclude=*~' '--exclude=Makefile' gtk2-3.4.3.orig/ext/gtk2/rbgtktreeiter.c gtk2-3.4.3/ext/gtk2/rbgtktreeiter.c
+--- gtk2-3.4.3.orig/ext/gtk2/rbgtktreeiter.c 2026-10-24 11:49:46.952181088 +0900
++++ gtk2-3.4.3/ext/gtk2/rbgtktreeiter.c 2026-10-24 12:26:47.886546417 +0900
+@@ -25,11 +25,15 @@
+ #define RG_TARGET_NAMESPACE cTreeIter
+ #define _SELF(i) ((GtkTreeIter*)RVAL2BOXED(i, GTK_TYPE_TREE_ITER))
+
++static const rb_data_type_t rb_type_gtk_tree_iter = {
++ .wrap_struct_name = "GtkTreeIter",
++};
++
+ void
+ 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_cObject, NULL, NULL, func));
++ TypedData_Wrap_Struct(rb_cObject, &rb_type_gtk_tree_iter, func));
+ }
+
+ static VALUE
+@@ -147,7 +151,7 @@ rg_set_value(VALUE self, VALUE column, V
+ if (NIL_P(obj))
+ rb_raise(rb_eTypeError, "Gtk::TreeModel is invalid.");
+
+- Data_Get_Struct(obj, void, func);
++ TypedData_Get_Struct(obj, void, &rb_type_gtk_tree_iter, func);
+
+ g_value_init(&gval, gtype);
+ rbgobj_rvalue_to_gvalue(value, &gval);
+Only in gtk2-3.4.3/ext/gtk2: gtk2.so
+diff -urp '--exclude=*~' gtk2-3.4.3.orig/ext/gtk2/rbgtkwindow.c gtk2-3.4.3/ext/gtk2/rbgtkwindow.c
+--- gtk2-3.4.3.orig/ext/gtk2/rbgtkwindow.c 2026-10-24 13:47:12.298596976 +0900
++++ gtk2-3.4.3/ext/gtk2/rbgtkwindow.c 2026-10-24 14:11:34.791111264 +0900
+@@ -504,6 +504,11 @@ mark_toplevels(G_GNUC_UNUSED void *_)
+ g_list_free(list);
+ }
+
++static const rb_data_type_t rb_type_toplevels_marker = {
++ "GtkWindow::toplevels_marker",
++ { mark_toplevels, NULL, NULL, },
++};
++
+ void
+ Init_gtk_window(VALUE mGtk)
+ {
+@@ -582,7 +587,7 @@ Init_gtk_window(VALUE mGtk)
+ {
+ static VALUE toplevels_marker;
+ toplevels_marker =
+- rb_data_object_alloc(rb_cObject, NULL, mark_toplevels, NULL);
++ rb_data_typed_object_wrap(rb_cObject, NULL, &rb_type_toplevels_marker);
+ rb_global_variable(&toplevels_marker);
+ }
+ }
+Only in gtk2-3.4.3/ext/gtk2: rbgtkwindow.o
diff --git a/rubygem-gtk2.spec b/rubygem-gtk2.spec
index d9b7618..cc4ddb1 100644
--- a/rubygem-gtk2.spec
+++ b/rubygem-gtk2.spec
@@ -11,7 +11,7 @@
Summary: Ruby binding of GTK+-2.x
Name: rubygem-%{gem_name}
Version: 3.4.3
-Release: 30%{?dist}
+Release: 31%{?dist}
# gemspec LGPL-2.1-or-later
# SPDX confirmed
License: LGPL-2.1-or-later
@@ -26,6 +26,7 @@ Patch2: gtk2-3.4.3-rb_define_method_arg_number.patch
Patch3: gtk2-3.4.3-pointer-type-extra-cast-c99.patch
Patch4: gtk2-3.4.3-c23-strict-function-prototype.patch
Patch5: gtk2-3.4.3-c23-port-to-glib2_426.patch
+Patch6: gtk2-3.4.3-rb_data_type_t.patch
Requires: ruby(release)
BuildRequires: ruby(release)
@@ -119,6 +120,8 @@ find sample/ -name \*.rb | xargs chmod 0644
# rb_cData is deprecated, removed in ruby32
grep -rl rb_cData . | xargs sed -i -e 's|rb_cData|rb_cObject|'
+%patch -P6 -p1 -b .rb_data_type
+
%build
gem build ./%{gem_name}-%{version}.gemspec
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
@@ -215,6 +218,9 @@ xvfb-run \
%{gem_instdir}/sample/
%changelog
+* Sat Oct 24 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.4.3-31
+- Port to use rb_data_type_t
+
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.3-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-24 5:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-24 5:15 [rpms/rubygem-gtk2] rawhide: Port to use rb_data_type_t Mamoru TASAKA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox