commit: d3e9d1b60d613066f646484033ec177cd8f8209a Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> AuthorDate: Wed Apr 16 10:12:12 2025 +0000 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> CommitDate: Wed Apr 16 10:56:43 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3e9d1b6
games-puzzle/monsterz: fix with numpy2 (used through pygame) Believe there may still be issues given runtime warnings, e.g. /usr/bin/monsterz:860: RuntimeWarning: overflow encountered ... But it seems to work regardless and not intending to spend more time on this myself. Unfortunately debian does not seem to have patches for these issues in _p13 and so haven't bumped it for now. Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> .../monsterz/files/monsterz-0.7.1-numpy2.patch | 32 ++++++++++++++++++++++ ...7.1_p12.ebuild => monsterz-0.7.1_p12-r1.ebuild} | 3 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/games-puzzle/monsterz/files/monsterz-0.7.1-numpy2.patch b/games-puzzle/monsterz/files/monsterz-0.7.1-numpy2.patch new file mode 100644 index 000000000000..917d44a1b458 --- /dev/null +++ b/games-puzzle/monsterz/files/monsterz-0.7.1-numpy2.patch @@ -0,0 +1,32 @@ +From ba17939f0af90905a90dce96f4540e273a744bdb Mon Sep 17 00:00:00 2001 +From: Oscar Lesta <[email protected]> +Date: Wed, 25 Dec 2024 21:33:16 -0300 +Subject: Fix compatibility with numpy 2.2.1. +--- a/monsterz.py ++++ b/monsterz.py +@@ -117,6 +117,10 @@ + for x, p in enumerate(line): + r, g, b = p +- M = int(max(r, g, b)) +- m = int(min(r, g, b)) ++ # convert from numpy.int8 to int ++ r = r.item() ++ g = g.item() ++ b = b.item() ++ M = max(r, g, b) ++ m = min(r, g, b) + val = (2 * M + r + g + b) // 5 + p[0] = (val + r) // 2 +@@ -141,6 +145,10 @@ + for x, p in enumerate(line): + r, g, b = p +- M = int(max(r, g, b)) +- m = int(min(r, g, b)) ++ # convert from numpy.int8 to int ++ r = r.item() ++ g = g.item() ++ b = b.item() ++ M = max(r, g, b) ++ m = min(r, g, b) + p[0] = (m + r) // 2 + p[1] = (m + g) // 2 diff --git a/games-puzzle/monsterz/monsterz-0.7.1_p12.ebuild b/games-puzzle/monsterz/monsterz-0.7.1_p12-r1.ebuild similarity index 93% rename from games-puzzle/monsterz/monsterz-0.7.1_p12.ebuild rename to games-puzzle/monsterz/monsterz-0.7.1_p12-r1.ebuild index c39a29488956..0039d4304165 100644 --- a/games-puzzle/monsterz/monsterz-0.7.1_p12.ebuild +++ b/games-puzzle/monsterz/monsterz-0.7.1_p12-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -29,6 +29,7 @@ BDEPEND="${PYTHON_DEPS}" PATCHES=( "${WORKDIR}"/debian/patches + "${FILESDIR}"/${PN}-0.7.1-numpy2.patch ) src_prepare() {
