public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ruby-augeas] rawhide: Backport upstream PR to use TypedData API needed for ruby4.1
@ 2026-11-23  7:43 Mamoru TASAKA
  0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-11-23  7:43 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/ruby-augeas
Branch : rawhide
Commit : cadabc6c1feafcddd41ff15e56e6e24c1bdc2a3f
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date   : 2026-11-23T16:43:03+09:00
Stats  : +62/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/ruby-augeas/c/cadabc6c1feafcddd41ff15e56e6e24c1bdc2a3f?branch=rawhide

Log:
Backport upstream PR to use TypedData API needed for ruby4.1

---
diff --git a/ruby-augeas-pr23-TypedData-API.patch b/ruby-augeas-pr23-TypedData-API.patch
new file mode 100644
index 0000000..2e72d31
--- /dev/null
+++ b/ruby-augeas-pr23-TypedData-API.patch
@@ -0,0 +1,59 @@
+From 5ddf2f310fd166a434592b71494acb2051d3c0e4 Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka@fedoraproject.org>
+Date: Mon, 23 Nov 2026 16:06:35 +0900
+Subject: [PATCH] Use TypedData API for ruby 4.1
+
+struct RData API is deprecated since Ruby 3.4 and is removed
+on Ruby 4.1.
+https://bugs.ruby-lang.org/issues/21768
+https://github.com/ruby/ruby/pull/15447
+
+This change uses TypedData API. Fixes #22 .
+---
+ ext/augeas/_augeas.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/ext/augeas/_augeas.c b/ext/augeas/_augeas.c
+index 4031ae7..fb429d0 100644
+--- a/ext/augeas/_augeas.c
++++ b/ext/augeas/_augeas.c
+@@ -27,17 +27,28 @@
+ static VALUE c_augeas;
+ static VALUE c_facade;
+ 
++static void augeas_free(void *data);
++
++static const rb_data_type_t augeas_rb_data_type = {
++    .wrap_struct_name = "Augeas",
++    .function = {
++        .dfree = augeas_free,
++    },
++};
++
++
+ static augeas *aug_handle(VALUE s) {
+     augeas *aug;
+ 
+-    Data_Get_Struct(s, struct augeas, aug);
++    TypedData_Get_Struct(s, struct augeas, &augeas_rb_data_type, aug);
+     if (aug == NULL) {
+         rb_raise(rb_eSystemCallError, "Failed to retrieve connection");
+     }
+     return aug;
+ }
+ 
+-static void augeas_free(augeas *aug) {
++static void augeas_free(void *data) {
++    augeas *aug = data;
+     if (aug != NULL)
+         aug_close(aug);
+ }
+@@ -352,7 +363,7 @@ static VALUE init(VALUE class, VALUE m, VALUE r, VALUE l, VALUE f) {
+     if (aug == NULL) {
+         rb_raise(rb_eSystemCallError, "Failed to initialize Augeas");
+     }
+-    return Data_Wrap_Struct(class, NULL, augeas_free, aug);
++    return TypedData_Wrap_Struct(class, &augeas_rb_data_type, aug);
+ }
+ 
+ VALUE augeas_init(VALUE m, VALUE r, VALUE l, VALUE f) {

diff --git a/ruby-augeas.spec b/ruby-augeas.spec
index ccedf52..8f7776f 100644
--- a/ruby-augeas.spec
+++ b/ruby-augeas.spec
@@ -8,6 +8,9 @@ Summary:        Ruby bindings for Augeas
 License:        LGPL-2.1-or-later
 URL:            https://augeas.net
 Source0:        https://rubygems.org/gems/%{gem_name}-%{version}.gem
+# https://github.com/hercules-team/ruby-augeas/pull/23
+# Use TypedData API needed for ruby4.1
+Patch0:        ruby-augeas-pr23-TypedData-API.patch
 
 BuildRequires:  augeas-devel >= 1.0.0
 BuildRequires:  gcc

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  7:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  7:43 [rpms/ruby-augeas] rawhide: Backport upstream PR to 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