public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/ruby-augeas] rawhide: Backport upstream PR to use TypedData API needed for ruby4.1
Date: Mon, 23 Nov 2026 07:43:18 GMT	[thread overview]
Message-ID: <179541979809.1.830914239955021644.rpms-ruby-augeas-cadabc6c1fea@fedoraproject.org> (raw)

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

                 reply	other threads:[~2026-11-23  7:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179541979809.1.830914239955021644.rpms-ruby-augeas-cadabc6c1fea@fedoraproject.org \
    --to=mtasaka@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox