public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rubygem-glu] rawhide: Use TypedData API, needed for ruby4.1
@ 2026-11-02 13:52 Mamoru TASAKA
  0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-11-02 13:52 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rubygem-glu
Branch : rawhide
Commit : 6be1f47f978cdd93adf03f8187ac223dac9ee2b9
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date   : 2026-11-02T22:52:36+09:00
Stats  : +166/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rubygem-glu/c/6be1f47f978cdd93adf03f8187ac223dac9ee2b9?branch=rawhide

Log:
Use TypedData API, needed for ruby4.1

---
diff --git a/rubygem-glu-8.3.0-TypedData-API.patch b/rubygem-glu-8.3.0-TypedData-API.patch
new file mode 100644
index 0000000..89e9256
--- /dev/null
+++ b/rubygem-glu-8.3.0-TypedData-API.patch
@@ -0,0 +1,160 @@
+diff -urp '--exclude=*.o' '--exclude=*.so' '--exclude=*~' '--exclude=Makefile' glu-8.3.0.orig/ext/glu/glu.c glu-8.3.0/ext/glu/glu.c
+--- glu-8.3.0.orig/ext/glu/glu.c	2026-11-02 16:54:58.082353081 +0900
++++ glu-8.3.0/ext/glu/glu.c	2026-11-02 17:36:07.823173966 +0900
+@@ -60,17 +60,17 @@ static VALUE cQuad;
+ #define REF_LAST    15
+ 
+ #define GetNURBS(obj, ndata) {\
+-  Data_Get_Struct(obj, struct nurbsdata, ndata);\
++  TypedData_Get_Struct(obj, struct nurbsdata, &rb_data_nurbs, ndata);\
+   if (ndata->nobj == NULL) rb_raise(rb_eRuntimeError, "Nurbs Object already deleted!");\
+ }
+ 
+ #define GetTESS(obj, tdata) {\
+-  Data_Get_Struct(obj, struct tessdata, tdata);\
++  TypedData_Get_Struct(obj, struct tessdata, &rb_data_tess, tdata);\
+   if (tdata->tobj == NULL) rb_raise(rb_eRuntimeError, "Triangulator Object already deleted!");\
+ }
+ 
+ #define GetQUAD(obj, qdata) {\
+-  Data_Get_Struct(obj, struct quaddata, qdata);\
++  TypedData_Get_Struct(obj, struct quaddata, &rb_data_quad, qdata);\
+   if (qdata->qobj == NULL) rb_raise(rb_eRuntimeError, "Quadric Object already deleted!");\
+ }
+ 
+@@ -161,21 +161,29 @@ void check_for_gluerror(GLenum error)
+ static VALUE n_current;
+ 
+ static void
+-free_nurbs(ndata)
+-struct nurbsdata *ndata;
++free_nurbs(void *data)
+ {
++  struct nurbsdata *ndata = data;
+   if (ndata->nobj) gluDeleteNurbsRenderer(ndata->nobj);
+     ndata->nobj = NULL;
+   ndata->n_ref = Qnil;
+ }
+ static void
+-mark_nurbs(ndata)
+-struct nurbsdata* ndata;
++mark_nurbs(void *data)
+ {
++  struct nurbsdata* ndata = data;
+   if (ndata->nobj)
+     rb_gc_mark(ndata->n_ref);
+ }
+ 
++static const rb_data_type_t rb_data_nurbs = {
++  .wrap_struct_name = "GL_Nurbs",
++  .function = {
++    .dmark = mark_nurbs,
++    .dfree = free_nurbs,
++  },
++};
++
+ static void CALLBACK
+ n_error(errorno)
+ GLenum errorno;
+@@ -219,7 +227,7 @@ VALUE obj;
+ {
+   VALUE ret;
+   struct nurbsdata *ndata;
+-  ret = Data_Make_Struct(cNurbs, struct nurbsdata, mark_nurbs, free_nurbs, ndata);
++  ret = TypedData_Make_Struct(cNurbs, struct nurbsdata, &rb_data_nurbs, ndata);
+   ndata->nobj = gluNewNurbsRenderer();
+   ndata->n_ref = rb_ary_new2(REF_LAST);
+ 
+@@ -570,28 +578,37 @@ static VALUE t_current;
+ #define TESS_USERDATA   14
+ 
+ static void
+-mark_tess(tdata)
+-struct tessdata* tdata;
++mark_tess(void *data)
+ {
++  struct tessdata* tdata = data;
+   if (tdata->tobj)
+     rb_gc_mark(tdata->t_ref);
+ }
+ static void
+-free_tess(tdata)
+-struct tessdata *tdata;
++free_tess(void *data)
+ {
++  struct tessdata *tdata = data;
+   if (tdata->tobj)
+     gluDeleteTess(tdata->tobj);
+   tdata->t_ref = Qnil;
+   tdata->tobj = NULL;
+ }
++
++static const rb_data_type_t rb_data_tess = {
++  .wrap_struct_name = "GL_Triangulator",
++  .function = {
++    .dmark = mark_tess,
++    .dfree = free_tess,
++  },
++};
++
+ static VALUE
+ glu_NewTess(obj)
+ VALUE obj;
+ {
+   VALUE ret;
+   struct tessdata *tdata;
+-  ret = Data_Make_Struct(cTess, struct tessdata, mark_tess, free_tess, tdata);
++  ret = TypedData_Make_Struct(cTess, struct tessdata, &rb_data_tess, tdata);
+   tdata->tobj = gluNewTess();
+   tdata->t_ref = rb_ary_new2(REF_LAST);
+ 
+@@ -932,6 +949,7 @@ VALUE obj, arg1;
+ * Quadric API
+ */
+ static VALUE q_current;
++static const rb_data_type_t rb_data_quad;
+ 
+ static void CALLBACK
+ q_error(errorno)
+@@ -972,27 +990,36 @@ VALUE obj, arg1, arg2, arg3;
+ }
+ 
+ static void
+-free_quad(qdata)
+-struct quaddata *qdata;
++free_quad(void *data)
+ {
++  struct quaddata *qdata = data;
+   if (qdata->qobj) gluDeleteQuadric(qdata->qobj);
+   qdata->qobj = NULL;
+   qdata->q_ref = Qnil;
+ }
+ static void
+-mark_quad(qdata)
+-struct quaddata* qdata;
++mark_quad(void *data)
+ {
++  struct quaddata* qdata = data;
+   if (qdata->qobj)
+     rb_gc_mark(qdata->q_ref);
+ }
++
++static const rb_data_type_t rb_data_quad = {
++  .wrap_struct_name = "GL_Quadric",
++  .function = {
++    .dmark = mark_quad,
++    .dfree = free_quad,
++  },
++};
++
+ static VALUE
+ glu_NewQuadric(obj)
+ VALUE obj;
+ {
+   VALUE ret;
+   struct quaddata *qdata;
+-  ret = Data_Make_Struct(cQuad, struct quaddata, mark_quad, free_quad, qdata);
++  ret = TypedData_Make_Struct(cQuad, struct quaddata, &rb_data_quad, qdata);
+   qdata->qobj = gluNewQuadric();
+   qdata->q_ref = rb_ary_new2(REF_LAST);
+ 

diff --git a/rubygem-glu.spec b/rubygem-glu.spec
index 5eabda8..fd6e025 100644
--- a/rubygem-glu.spec
+++ b/rubygem-glu.spec
@@ -4,7 +4,7 @@
 
 Name:		rubygem-%{gem_name}
 Version:	8.3.0
-Release:	38%{?dist}
+Release:	39%{?dist}
 
 Summary:	Glu bindings for the opengl gem
 # SPDX confirmed
@@ -12,6 +12,8 @@ License:	MIT
 URL:		https://github.com/larskanis/glu
 Source0:	https://rubygems.org/gems/%{gem_name}-%{version}.gem
 Patch1:		rubygem-glu-c99.patch
+# Use TypedData API, needed for ruby 4.1
+Patch2:		rubygem-glu-8.3.0-TypedData-API.patch
 
 BuildRequires:	gcc
 BuildRequires:	rubygems-devel 
@@ -105,6 +107,9 @@ popd
 %doc	%{gem_docdir}
 
 %changelog
+* Mon Nov 02 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 8.3.0-39
+- Use TypedData API, needed for ruby4.1
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 8.3.0-38
 - 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-11-02 13:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 13:52 [rpms/rubygem-glu] rawhide: Use TypedData API, needed for ruby4.1 Mamoru TASAKA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox