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/rubygem-eventmachine] rawhide: Backport upstream patch to use TypedData API
Date: Sat, 24 Oct 2026 07:07:57 GMT	[thread overview]
Message-ID: <179282567758.1.17435361715302904331.rpms-rubygem-eventmachine-95e80a4d54ca@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rubygem-eventmachine
Branch : rawhide
Commit : 95e80a4d54ca30dd7c38fc2cf8496320424c67f8
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date   : 2026-10-24T16:07:42+09:00
Stats  : +84/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rubygem-eventmachine/c/95e80a4d54ca30dd7c38fc2cf8496320424c67f8?branch=rawhide

Log:
Backport upstream patch to use TypedData API

---
diff --git a/rubygem-eventmachine-pr1027-TypedData.patch b/rubygem-eventmachine-pr1027-TypedData.patch
new file mode 100644
index 0000000..3c677c2
--- /dev/null
+++ b/rubygem-eventmachine-pr1027-TypedData.patch
@@ -0,0 +1,76 @@
+From 26bf43719a7889b6ce5358bbb07f75fce7631c89 Mon Sep 17 00:00:00 2001
+From: Yasuo Honda <yasuo.honda@gmail.com>
+Date: Mon, 6 Jul 2026 17:10:17 +0900
+Subject: [PATCH] Migrate fastfilereader to the TypedData API
+
+Ruby master removed the long-deprecated Data_Wrap_Struct and
+Data_Get_Struct macros in
+https://github.com/ruby/ruby/commit/a26f528b3b
+("Deprecate `struct RData` in favor of `struct RTypedData`"), so the
+fastfilereader extension no longer compiles against ruby 4.1.0dev:
+
+    rubymain.cpp:53:19: error: 'Data_Wrap_Struct' was not declared in
+    this scope; did you mean 'TypedData_Wrap_Struct'?
+
+Wrap Mapper_t with TypedData_Wrap_Struct/TypedData_Get_Struct and an
+rb_data_type_t instead. The TypedData API is available on all rubies
+covered by required_ruby_version (>= 2.5.0).
+
+Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
+---
+ ext/fastfilereader/rubymain.cpp | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/ext/fastfilereader/rubymain.cpp b/ext/fastfilereader/rubymain.cpp
+index 48e6e766..d0e223b1 100644
+--- a/ext/fastfilereader/rubymain.cpp
++++ b/ext/fastfilereader/rubymain.cpp
+@@ -41,6 +41,12 @@ static void mapper_dt (void *ptr)
+ 		delete (Mapper_t*) ptr;
+ }
+ 
++static const rb_data_type_t mapper_type = {
++	"EventMachine::FastFileReader::Mapper",
++	{ 0, mapper_dt, 0, },
++	0, 0, RUBY_TYPED_FREE_IMMEDIATELY
++};
++
+ /**********
+ mapper_new
+ **********/
+@@ -50,7 +56,7 @@ static VALUE mapper_new (VALUE self, VALUE filename)
+ 	Mapper_t *m = new Mapper_t (StringValueCStr (filename));
+ 	if (!m)
+ 		rb_raise (rb_eStandardError, "No Mapper Object");
+-	VALUE v = Data_Wrap_Struct (Mapper, 0, mapper_dt, (void*)m);
++	VALUE v = TypedData_Wrap_Struct (Mapper, &mapper_type, (void*)m);
+ 	return v;
+ }
+ 
+@@ -62,7 +68,7 @@ mapper_get_chunk
+ static VALUE mapper_get_chunk (VALUE self, VALUE start, VALUE length)
+ {
+ 	Mapper_t *m = NULL;
+-	Data_Get_Struct (self, Mapper_t, m);
++	TypedData_Get_Struct (self, Mapper_t, &mapper_type, m);
+ 	if (!m)
+ 		rb_raise (rb_eStandardError, "No Mapper Object");
+ 
+@@ -85,7 +91,7 @@ mapper_close
+ static VALUE mapper_close (VALUE self)
+ {
+ 	Mapper_t *m = NULL;
+-	Data_Get_Struct (self, Mapper_t, m);
++	TypedData_Get_Struct (self, Mapper_t, &mapper_type, m);
+ 	if (!m)
+ 		rb_raise (rb_eStandardError, "No Mapper Object");
+ 	m->Close();
+@@ -99,7 +105,7 @@ mapper_size
+ static VALUE mapper_size (VALUE self)
+ {
+ 	Mapper_t *m = NULL;
+-	Data_Get_Struct (self, Mapper_t, m);
++	TypedData_Get_Struct (self, Mapper_t, &mapper_type, m);
+ 	if (!m)
+ 		rb_raise (rb_eStandardError, "No Mapper Object");
+ 	return INT2NUM (m->GetFileSize());

diff --git a/rubygem-eventmachine.spec b/rubygem-eventmachine.spec
index b6a18b0..892d13a 100644
--- a/rubygem-eventmachine.spec
+++ b/rubygem-eventmachine.spec
@@ -6,7 +6,7 @@
 
 Name: rubygem-%{gem_name}
 Version: 1.2.7
-Release: 36%{?dist}
+Release: 37%{?dist}
 Summary: Ruby/EventMachine library
 # Automatically converted from old format: GPLv2 or Ruby - review is highly recommended.
 License: GPL-2.0-only OR Ruby
@@ -35,6 +35,9 @@ Patch6: rubygem-eventmachine-1.2.7-Fix-intermittent-tests.patch
 # https://github.com/eventmachine/eventmachine/pull/970
 # Backport some OpenSSL related upstream fix
 Patch7: rubygem-eventmachine-1.2.7-openssl4-test-fix.patch
+# https://github.com/eventmachine/eventmachine/pull/1027/
+# Use TypedData API, needed for ruby4.1
+Patch8: rubygem-eventmachine-pr1027-TypedData.patch
 BuildRequires: ruby(release)
 BuildRequires: rubygems-devel
 BuildRequires: ruby-devel
@@ -82,6 +85,7 @@ sed -i '/SSL_CTX_set_cipher_list/ s/".*"/"PROFILE=SYSTEM"/' ext/ssl.cpp
 %patch 5 -p1
 %patch 6 -p1
 %patch 7 -p1
+%patch 8 -p1
 
 %build
 # Create the gem as gem install only works on a gem file
@@ -163,6 +167,9 @@ popd
 %{gem_instdir}/tests
 
 %changelog
+* Sat Oct 24 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.2.7-37
+- Backport upstream patch to use TypedData API
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.7-36
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

                 reply	other threads:[~2026-10-24  7:07 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=179282567758.1.17435361715302904331.rpms-rubygem-eventmachine-95e80a4d54ca@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