summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2023-09-16 07:09:14 +0200
committerHans de Graaff <graaff@gentoo.org>2023-09-16 07:09:50 +0200
commit278d4cee1197db64cc650d5d47ec2ac506a4b87b (patch)
tree82efbd0adbf4e63c1427ab30b897c4a5ce4ce675 /dev-ruby
parentdev-ruby/contracts: drop 0.17 (diff)
downloadgentoo-278d4cee1197db64cc650d5d47ec2ac506a4b87b.tar.gz
gentoo-278d4cee1197db64cc650d5d47ec2ac506a4b87b.tar.bz2
gentoo-278d4cee1197db64cc650d5d47ec2ac506a4b87b.zip
dev-ruby/chunky_png: update EAPI 7 -> 8
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'dev-ruby')
-rw-r--r--dev-ruby/chunky_png/chunky_png-1.4.0-r1.ebuild39
-rw-r--r--dev-ruby/chunky_png/files/chunky_png-1.4.0-ruby32.patch29
2 files changed, 68 insertions, 0 deletions
diff --git a/dev-ruby/chunky_png/chunky_png-1.4.0-r1.ebuild b/dev-ruby/chunky_png/chunky_png-1.4.0-r1.ebuild
new file mode 100644
index 000000000000..baab3a035f56
--- /dev/null
+++ b/dev-ruby/chunky_png/chunky_png-1.4.0-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+USE_RUBY="ruby31 ruby32"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+RUBY_FAKEGEM_TASK_DOC=""
+RUBY_FAKEGEM_DOCDIR=""
+
+RUBY_FAKEGEM_EXTRADOC="BENCHMARKING.rdoc CHANGELOG.rdoc README.md"
+
+RUBY_FAKEGEM_BINWRAP=""
+
+RUBY_FAKEGEM_GEMSPEC="chunky_png.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="Pure Ruby library that can read and write PNG images"
+HOMEPAGE="https://github.com/wvanbergen/chunky_png"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+PATCHES=(
+ "${FILESDIR}/${P}-ruby32.patch"
+)
+
+all_ruby_prepare() {
+ sed -i -e '/[bB]undler/s:^:#:' {spec,benchmarks}/*.rb || die
+ rm Gemfile* || die
+
+ # Avoid git dependency
+ sed -i -e '/s.files/d' ${RUBY_FAKEGEM_GEMSPEC} || die
+}
diff --git a/dev-ruby/chunky_png/files/chunky_png-1.4.0-ruby32.patch b/dev-ruby/chunky_png/files/chunky_png-1.4.0-ruby32.patch
new file mode 100644
index 000000000000..75d08c9fc88d
--- /dev/null
+++ b/dev-ruby/chunky_png/files/chunky_png-1.4.0-ruby32.patch
@@ -0,0 +1,29 @@
+From 8e6f5934541833f15664398f90331f3724e40933 Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka@fedoraproject.org>
+Date: Tue, 15 Nov 2022 23:22:20 +0900
+Subject: [PATCH] ruby3_2 fix: check if object responds to regex_match op
+
+Object#=~ is already deprecated since ruby2.6 and will be
+removed from ruby3.2. As the result, Array no longer
+respond to =~ from ruby3.2, for example.
+
+Check if the target object really respond to =~ .
+
+Closes #168
+---
+ lib/chunky_png/vector.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/chunky_png/vector.rb b/lib/chunky_png/vector.rb
+index 4ef965f..034104c 100644
+--- a/lib/chunky_png/vector.rb
++++ b/lib/chunky_png/vector.rb
+@@ -166,7 +166,7 @@ def dimension
+ # @return [Array<ChunkyPNG::Point>] The list of points interpreted from the input array.
+ def self.multiple_from_array(source)
+ return [] if source.empty?
+- if source.first.is_a?(Numeric) || source.first =~ /^\d+$/
++ if source.first.is_a?(Numeric) || ( source.first.respond_to?(:=~) && source.first =~ /^\d+$/ )
+ raise ArgumentError, "The points array is expected to have an even number of items!" if source.length % 2 != 0
+
+ points = []