summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2024-12-01 09:52:10 +0100
committerHans de Graaff <graaff@gentoo.org>2024-12-01 10:38:29 +0100
commitdd10b2415464fd308a07e50545202a1ee82d2ed5 (patch)
treef62967eb6b096c60c11a3ad684de9a6cbe15640e /dev-ruby
parentrust.eclass: add rust-1.83.0 (diff)
downloadgentoo-dd10b2415464fd308a07e50545202a1ee82d2ed5.tar.gz
gentoo-dd10b2415464fd308a07e50545202a1ee82d2ed5.tar.bz2
gentoo-dd10b2415464fd308a07e50545202a1ee82d2ed5.zip
dev-ruby/brotli: fix gnu23 compilation
Closes: https://bugs.gentoo.org/943784 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'dev-ruby')
-rw-r--r--dev-ruby/brotli/brotli-0.6.0-r1.ebuild39
-rw-r--r--dev-ruby/brotli/files/brotli-0.6.0-definemethod.patch46
2 files changed, 85 insertions, 0 deletions
diff --git a/dev-ruby/brotli/brotli-0.6.0-r1.ebuild b/dev-ruby/brotli/brotli-0.6.0-r1.ebuild
new file mode 100644
index 000000000000..82a17cf60d1f
--- /dev/null
+++ b/dev-ruby/brotli/brotli-0.6.0-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+USE_RUBY="ruby31 ruby32 ruby33"
+
+RUBY_FAKEGEM_EXTRADOC="README.md"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+RUBY_FAKEGEM_BINWRAP=""
+
+RUBY_FAKEGEM_GEMSPEC="brotli.gemspec"
+
+RUBY_FAKEGEM_EXTENSIONS=(ext/brotli/extconf.rb)
+
+inherit ruby-fakegem
+
+DESCRIPTION="Brotli compressor/decompressor"
+HOMEPAGE="https://github.com/miyucy/brotli"
+SRC_URI="https://github.com/miyucy/brotli/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="$(ver_cut 1)"
+KEYWORDS="~amd64"
+
+RDEPEND=" >=app-arch/brotli-1.1.0"
+DEPEND=" >=app-arch/brotli-1.1.0"
+
+# Depends on the test data in app-arch/brotli
+RESTRICT="test"
+
+PATCHES=( "${FILESDIR}/${P}-definemethod.patch" )
+
+all_ruby_prepare() {
+ sed -e 's/git ls-files -z -- spec/find spec -print0/' \
+ -e 's/git ls-files -z/find * -print0/' \
+ -i ${RUBY_FAKEGEM_GEMSPEC} || die
+}
diff --git a/dev-ruby/brotli/files/brotli-0.6.0-definemethod.patch b/dev-ruby/brotli/files/brotli-0.6.0-definemethod.patch
new file mode 100644
index 000000000000..1338c5bf3be2
--- /dev/null
+++ b/dev-ruby/brotli/files/brotli-0.6.0-definemethod.patch
@@ -0,0 +1,46 @@
+From 8e589adb92a7d5c8c9e8d35bb116ad5ab0686e30 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
+ <shyouhei@ruby-lang.org>
+Date: Tue, 26 Nov 2024 13:42:54 +0900
+Subject: [PATCH] stop worrying and just pass bare function
+
+`rb_define_method` etc. already take care arities. You don't have
+to apply RUBY_METHOD_FUNC.
+---
+ ext/brotli/brotli.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/ext/brotli/brotli.c b/ext/brotli/brotli.c
+index cb69500..a9cc23d 100644
+--- a/ext/brotli/brotli.c
++++ b/ext/brotli/brotli.c
+@@ -475,9 +475,9 @@ Init_brotli(void)
+ rb_mBrotli = rb_define_module("Brotli");
+ rb_eBrotli = rb_define_class_under(rb_mBrotli, "Error", rb_eStandardError);
+ rb_global_variable(&rb_eBrotli);
+- rb_define_singleton_method(rb_mBrotli, "deflate", RUBY_METHOD_FUNC(brotli_deflate), -1);
+- rb_define_singleton_method(rb_mBrotli, "inflate", RUBY_METHOD_FUNC(brotli_inflate), 1);
+- rb_define_singleton_method(rb_mBrotli, "version", RUBY_METHOD_FUNC(brotli_version), 0);
++ rb_define_singleton_method(rb_mBrotli, "deflate", brotli_deflate, -1);
++ rb_define_singleton_method(rb_mBrotli, "inflate", brotli_inflate, 1);
++ rb_define_singleton_method(rb_mBrotli, "version", brotli_version, 0);
+ id_read = rb_intern("read");
+ // Brotli::Writer
+ id_write = rb_intern("write");
+@@ -485,9 +485,9 @@ Init_brotli(void)
+ id_close = rb_intern("close");
+ rb_Writer = rb_define_class_under(rb_mBrotli, "Writer", rb_cObject);
+ rb_define_alloc_func(rb_Writer, rb_writer_alloc);
+- rb_define_method(rb_Writer, "initialize", RUBY_METHOD_FUNC(rb_writer_initialize), -1);
+- rb_define_method(rb_Writer, "write", RUBY_METHOD_FUNC(rb_writer_write), 1);
+- rb_define_method(rb_Writer, "finish", RUBY_METHOD_FUNC(rb_writer_finish), 0);
+- rb_define_method(rb_Writer, "flush", RUBY_METHOD_FUNC(rb_writer_flush), 0);
+- rb_define_method(rb_Writer, "close", RUBY_METHOD_FUNC(rb_writer_close), 0);
++ rb_define_method(rb_Writer, "initialize", rb_writer_initialize, -1);
++ rb_define_method(rb_Writer, "write", rb_writer_write, 1);
++ rb_define_method(rb_Writer, "finish", rb_writer_finish, 0);
++ rb_define_method(rb_Writer, "flush", rb_writer_flush, 0);
++ rb_define_method(rb_Writer, "close", rb_writer_close, 0);
+ }
+--
+2.47.0