commit:     675d5a016e43ba66c198d94cb2fd32f0ba6abc67
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 24 07:09:19 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 24 07:09:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=675d5a01

games-simulation/openttd: fix build w/ gcc-15

Closes: https://bugs.gentoo.org/936417
Thanks-to: David Seifert <soap <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../openttd/files/openttd-13.4-gcc15.patch         | 22 ++++++++++++++++++++++
 games-simulation/openttd/openttd-13.4.ebuild       |  3 ++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/games-simulation/openttd/files/openttd-13.4-gcc15.patch 
b/games-simulation/openttd/files/openttd-13.4-gcc15.patch
new file mode 100644
index 000000000000..f849d82c1ed0
--- /dev/null
+++ b/games-simulation/openttd/files/openttd-13.4-gcc15.patch
@@ -0,0 +1,22 @@
+https://github.com/OpenTTD/OpenTTD/pull/12876
+https://github.com/OpenTTD/OpenTTD/commit/db36e61807955c896267d6585de0577efd30465d
+
+From 866cd4381189658641a69bdeca86ceec15aa027d Mon Sep 17 00:00:00 2001
+From: David Seifert <[email protected]>
+Date: Mon, 22 Jul 2024 09:27:01 +0200
+Subject: [PATCH] Codechange: fix for GCC 15 two-phase lookup
+
+* GCC 15 is more aggressive about checking dependent names
+
+Bug: https://bugs.gentoo.org/936417
+--- a/src/pathfinder/yapf/yapf_road.cpp
++++ b/src/pathfinder/yapf/yapf_road.cpp
+@@ -470,7 +470,7 @@ class CYapfFollowRoadT
+               /* set origin (tile, trackdir) */
+               TileIndex src_tile = v->tile;
+               Trackdir src_td = v->GetVehicleTrackdir();
+-              if (!HasTrackdir(GetTrackdirBitsForRoad(src_tile, 
this->IsTram() ? RTT_TRAM : RTT_ROAD), src_td)) {
++              if (!HasTrackdir(GetTrackdirBitsForRoad(src_tile, 
Yapf().IsTram() ? RTT_TRAM : RTT_ROAD), src_td)) {
+                       /* sometimes the roadveh is not on the road (it resides 
on non-existing track)
+                        * how should we handle that situation? */
+                       return false;

diff --git a/games-simulation/openttd/openttd-13.4.ebuild 
b/games-simulation/openttd/openttd-13.4.ebuild
index 20010db20802..11d583b49c7f 100644
--- a/games-simulation/openttd/openttd-13.4.ebuild
+++ b/games-simulation/openttd/openttd-13.4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -64,6 +64,7 @@ DOCS=( docs/directory_structure.md )
 
 PATCHES=(
        "${FILESDIR}/${PN}-1.11.2_dont_compress_man.patch"
+       "${FILESDIR}/${PN}-13.4-gcc15.patch"
 )
 
 src_prepare() {

Reply via email to