commit:     898f132966984a80f18a505598181052156f6d57
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  6 07:59:21 2024 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Sat Jan  6 08:02:10 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=898f1329

dev-ruby/tzinfo: enable ruby33

Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch | 35 +++++++++++++++++++++++++
 dev-ruby/tzinfo/tzinfo-2.0.6.ebuild             |  6 +++--
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch 
b/dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch
new file mode 100644
index 000000000000..91a9843aab22
--- /dev/null
+++ b/dev-ruby/tzinfo/files/tzinfo-2.0.6-ruby33.patch
@@ -0,0 +1,35 @@
+From 9e04c58ce10920538dc55ba6e547aa15cff39a84 Mon Sep 17 00:00:00 2001
+From: Phil Ross <phil.r...@gmail.com>
+Date: Sat, 16 Dec 2023 19:14:20 +0000
+Subject: [PATCH] Fix loading the gemspec file from rake with Ruby 3.3.
+
+Calculating the current directory name from within the gemspec would
+fail.
+
+`__FILE__` was '(eval)' with Ruby < 3.3. `File.dirname(__FILE__)` is
+'.'.
+
+`__FILE__` is '(eval at /path/Rakefile:linenumber)' with Ruby >= 3.3.
+`File.dirname(__FILE__)` is '(eval at /path'.
+---
+ Rakefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Rakefile b/Rakefile
+index 8a34fa33..69bee7b5 100644
+--- a/Rakefile
++++ b/Rakefile
+@@ -11,11 +11,11 @@ rescue LoadError, RuntimeError
+ end
+ 
+ BASE_DIR = File.expand_path(File.dirname(__FILE__))
++GEMSPEC_PATH = File.join(BASE_DIR, 'tzinfo.gemspec')
++spec = TOPLEVEL_BINDING.eval(File.read(GEMSPEC_PATH), GEMSPEC_PATH)
+ 
+ task default: [:test]
+ 
+-spec = eval(File.read('tzinfo.gemspec'))
+-
+ class TZInfoPackageTask < Gem::PackageTask
+   alias_method :orig_sh, :sh
+   private :orig_sh

diff --git a/dev-ruby/tzinfo/tzinfo-2.0.6.ebuild 
b/dev-ruby/tzinfo/tzinfo-2.0.6.ebuild
index 9c78b15dae64..aebdb3e76137 100644
--- a/dev-ruby/tzinfo/tzinfo-2.0.6.ebuild
+++ b/dev-ruby/tzinfo/tzinfo-2.0.6.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
-USE_RUBY="ruby27 ruby30 ruby31 ruby32"
+USE_RUBY="ruby31 ruby32 ruby33"
 
 RUBY_FAKEGEM_TASK_TEST="test_zoneinfo"
 
@@ -25,6 +25,8 @@ IUSE=""
 RDEPEND="sys-libs/timezone-data"
 DEPEND="test? ( sys-libs/timezone-data )"
 
+PATCHES=( "${FILESDIR}/${P}-ruby33.patch" )
+
 ruby_add_rdepend "dev-ruby/concurrent-ruby:1"
 ruby_add_bdepend "test? ( dev-ruby/bundler dev-ruby/minitest:5 )"
 

Reply via email to