https://bugs.gentoo.org/955590
https://github.com/wesnoth/wesnoth/issues/10174
https://github.com/wesnoth/wesnoth/pull/10202

From ce4f4077494e51ce95d5061582e1be53967d1a07 Mon Sep 17 00:00:00 2001
From: Gunter Labes <soliton@wesnoth.org>
Date: Wed, 14 May 2025 21:36:42 +0200
Subject: [PATCH] Handle boost process defaulting to v2 and add missing include

---
 src/filesystem.cpp    | 10 ++++++++--
 src/game_launcher.cpp | 12 +++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/filesystem.cpp b/src/filesystem.cpp
index ab9672a1f7707..bf647d1d3cdcd 100644
--- a/src/filesystem.cpp
+++ b/src/filesystem.cpp
@@ -23,6 +23,7 @@
 
 #include "config.hpp"
 #include "deprecation.hpp"
+#include "game_config_view.hpp"
 #include "gettext.hpp"
 #include "log.hpp"
 #include "serialization/base64.hpp"
@@ -30,12 +31,17 @@
 #include "serialization/unicode.hpp"
 #include "utils/general.hpp"
 
+#include <boost/algorithm/string/replace.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/iostreams/device/file_descriptor.hpp>
 #include <boost/iostreams/stream.hpp>
-#include <boost/process.hpp>
-#include "game_config_view.hpp"
+#if BOOST_VERSION >= 108800 // v2 is now default
+#  define BOOST_PROCESS_VERSION 1
+#  include <boost/process/v1/search_path.hpp>
+#else
+#  include <boost/process.hpp>
+#endif
 
 #ifdef _WIN32
 #include <boost/locale.hpp>
diff --git a/src/game_launcher.cpp b/src/game_launcher.cpp
index 42a6f193fbab0..85f937073f5b8 100644
--- a/src/game_launcher.cpp
+++ b/src/game_launcher.cpp
@@ -57,11 +57,17 @@
 #include "wesnothd_connection_error.hpp"
 #include "wml_exception.hpp" // for wml_exception
 
-#include <algorithm> // for copy, max, min, stable_sort
 #ifdef _WIN32
-#include <boost/process/windows.hpp>
+#  include <boost/process/windows.hpp>
+#endif
+#if BOOST_VERSION >= 108800 // v2 is now default
+#  define BOOST_PROCESS_VERSION 1
+#  include <boost/process/v1/child.hpp>
+#else
+#  include <boost/process.hpp>
 #endif
-#include <boost/process.hpp>
+
+#include <algorithm> // for copy, max, min, stable_sort
 #include <cstdlib>   // for system
 #include <new>
 #include <utility> // for pair

