commit:     239af76bbb35b17ea7e9f053ada70562c91737fb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 22 15:59:42 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 22 16:01:30 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=239af76b

games-emulation/openmsx: fix build w/ newer GCC

GCC backported a change which exposed broken templates in openmsx. It's
fixed properly upstream already but add a minimal fix from Debian for now.

Closes: https://bugs.gentoo.org/958161
Signed-off-by: Sam James <sam <AT> gentoo.org>

 games-emulation/openmsx/files/openmsx-20.0-template.patch | 15 +++++++++++++++
 games-emulation/openmsx/openmsx-20.0-r2.ebuild            |  5 +++++
 2 files changed, 20 insertions(+)

diff --git a/games-emulation/openmsx/files/openmsx-20.0-template.patch 
b/games-emulation/openmsx/files/openmsx-20.0-template.patch
new file mode 100644
index 000000000000..f22787080c01
--- /dev/null
+++ b/games-emulation/openmsx/files/openmsx-20.0-template.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/958161
+https://sources.debian.org/patches/openmsx/20.0%2Bdfsg-1.2/c%2B%2B20-iterator.diff/
+
+This is fixed properly upstream in >20.0 but this is a quick, minimal fix for 
now.
+--- a/src/utils/view.hh
++++ b/src/utils/view.hh
+@@ -206,6 +206,7 @@ public:
+       }
+ 
+       [[nodiscard]] constexpr friend difference_type operator-(const 
TransformIterator& x, const TransformIterator& y)
++      requires std::sized_sentinel_for<Iterator, Iterator>
+       {
+               return x.it - y.it;
+       }
+

diff --git a/games-emulation/openmsx/openmsx-20.0-r2.ebuild 
b/games-emulation/openmsx/openmsx-20.0-r2.ebuild
index f254bb8574f9..80a9d1cc4f53 100644
--- a/games-emulation/openmsx/openmsx-20.0-r2.ebuild
+++ b/games-emulation/openmsx/openmsx-20.0-r2.ebuild
@@ -33,6 +33,11 @@ BDEPEND="${PYTHON_DEPS}"
 
 DOC_CONTENTS="If you want to if you want to emulate real MSX systems and not 
only the free C-BIOS machines, put the system ROMs in one of the following 
directories: ${EPREFIX}/usr/share/${PN}/systemroms or 
~/.openMSX/share/systemroms"
 
+PATCHES=(
+       # Drop this after 20.0
+       "${FILESDIR}"/${P}-template.patch
+)
+
 src_prepare() {
        default
        sed -i -e 's/-fsanitize=address//' build/flavour-unittest.mk || die

Reply via email to