Skip to content

Commit

Permalink
openmw: fix build on GCC 14 (#370126)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilazy authored Jan 3, 2025
2 parents c3dd1ba + 156776e commit dd1853c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
41 changes: 41 additions & 0 deletions pkgs/games/openmw/0001-function-inclusion-fixes-for-gcc14.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 59f8403616e8db6dcf8f3489c44b61524044fe64 Mon Sep 17 00:00:00 2001
From: Fernando Rodrigues <[email protected]>
Date: Thu, 2 Jan 2025 04:28:42 +0000
Subject: [PATCH] Function inclusion fixes for GCC 14

This patch includes <algorithm> in bsa_file.cpp and <list> in
charactermanager.hpp to prevent a build failure with GCC 14.

Signed-off-by: Fernando Rodrigues <[email protected]>
---
apps/openmw/mwstate/charactermanager.hpp | 1 +
components/bsa/bsa_file.cpp | 1 +
2 files changed, 2 insertions(+)

diff --git a/apps/openmw/mwstate/charactermanager.hpp b/apps/openmw/mwstate/charactermanager.hpp
index 8b3f2b8f8f..fac73b3d44 100644
--- a/apps/openmw/mwstate/charactermanager.hpp
+++ b/apps/openmw/mwstate/charactermanager.hpp
@@ -4,6 +4,7 @@
#include <boost/filesystem/path.hpp>

#include "character.hpp"
+#include <list>

namespace MWState
{
diff --git a/components/bsa/bsa_file.cpp b/components/bsa/bsa_file.cpp
index 4f795ec0d4..38e97b267b 100644
--- a/components/bsa/bsa_file.cpp
+++ b/components/bsa/bsa_file.cpp
@@ -25,6 +25,7 @@

#include <components/files/constrainedfilestream.hpp>

+#include <algorithm>
#include <cassert>

#include <boost/filesystem/path.hpp>
--
2.47.0

2 changes: 2 additions & 0 deletions pkgs/games/openmw/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ stdenv.mkDerivation rec {
hash = "sha256-zkjVt3GfQZsFXl2Ht3lCuQtDMYQWxhdFO4aGSb3rsyo=";
};

patches = [ ./0001-function-inclusion-fixes-for-gcc14.patch ];

postPatch =
''
sed '1i#include <memory>' -i components/myguiplatform/myguidatamanager.cpp # gcc12
Expand Down

0 comments on commit dd1853c

Please sign in to comment.