commit:     6cc04e3a11fb080eb32634898c28f78981376219
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu May 15 08:56:25 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 15 09:49:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cc04e3a

games-strategy/wesnoth: add 1.18.4

... and conditionally build tests.

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

 games-strategy/wesnoth/Manifest                    |   1 +
 .../wesnoth/files/wesnoth-1.18.4-boost-1.88.patch  |  72 +++++++++++++
 games-strategy/wesnoth/wesnoth-1.18.4.ebuild       | 114 +++++++++++++++++++++
 3 files changed, 187 insertions(+)

diff --git a/games-strategy/wesnoth/Manifest b/games-strategy/wesnoth/Manifest
index e55a0d66875a..49f39d1369e1 100644
--- a/games-strategy/wesnoth/Manifest
+++ b/games-strategy/wesnoth/Manifest
@@ -1,2 +1,3 @@
 DIST wesnoth-1.18.3.tar.bz2 461694247 BLAKE2B 
1998e2fdff56271dd86c390e3c25dcbaa98b4f131f15584e5d3f2f5866856a69aebf9c8d97b1126601b3e08467a9410f3ba7b53c253737c6bbf62ccb1e9ba96f
 SHA512 
def324c9ed66ac59e2a9d0ab9ab95f00ddab2d31dacb2d0b5cfba42c5acdba210937f7dd6afde8870a387847a6d021a28dffcb04ce513272df6a4b52a626f30a
+DIST wesnoth-1.18.4.tar.bz2 461847477 BLAKE2B 
ebeae7c50c3583a16744ad7e36e2330b8babfd323cc152a9001e3f11018447ada64d070506c5d5ebaa2b9041861dc81680354b4f3d55b4eb118f887b4ff5a4f6
 SHA512 
c86538dae0c5d8c0c7270ab8e13ca2a5b9b6ff44e84789bc803d2135615e55dfdd34fd6b56f325f448940fcc396d884c533d067312b988b27c155157068db3bc
 DIST wesnoth-1.19.10.tar.bz2 546744036 BLAKE2B 
a80fb0bf5b46f3021d4b05d3d4f5aebd3895131dfec14aa9e42cfa12eefaa43d250e09d47d8e21946693366ad1e043188106508013158d39febf1c3708c08d78
 SHA512 
ed3400053ba3901c450fa9930de27ef0dc4e34c4b1b8b83b60f1ba2547061eb69529ebbee390cd9c471bfff5d11a8aa9a5b67b11339416e52f8269822592f5e9

diff --git a/games-strategy/wesnoth/files/wesnoth-1.18.4-boost-1.88.patch 
b/games-strategy/wesnoth/files/wesnoth-1.18.4-boost-1.88.patch
new file mode 100644
index 000000000000..6a01897362cd
--- /dev/null
+++ b/games-strategy/wesnoth/files/wesnoth-1.18.4-boost-1.88.patch
@@ -0,0 +1,72 @@
+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 <[email protected]>
+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
+

diff --git a/games-strategy/wesnoth/wesnoth-1.18.4.ebuild 
b/games-strategy/wesnoth/wesnoth-1.18.4.ebuild
new file mode 100644
index 000000000000..17707fec3651
--- /dev/null
+++ b/games-strategy/wesnoth/wesnoth-1.18.4.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake flag-o-matic xdg
+
+DESCRIPTION="Battle for Wesnoth - A fantasy turn-based strategy game"
+HOMEPAGE="https://www.wesnoth.org
+       https://github.com/wesnoth/wesnoth";
+SRC_URI="https://downloads.sourceforge.net/${PN}/${P}.tar.bz2";
+
+LICENSE="GPL-2"
+SLOT="0"
+# uneven minor versions are development versions
+if [[ $(( $(ver_cut 2) % 2 )) == 0 ]] ; then
+       KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+fi
+IUSE="dbus dedicated doc nls server test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       acct-group/wesnoth
+       acct-user/wesnoth
+       dev-libs/boost:=[bzip2,context,icu,nls]
+       >=media-libs/libsdl2-2.0.10:0[joystick,video,X]
+       !dedicated? (
+               dev-libs/glib:2
+               dev-libs/openssl:0=
+               >=media-libs/fontconfig-2.4.1
+               >=media-libs/sdl2-image-2.0.0[jpeg,png,webp]
+               >=media-libs/sdl2-mixer-2.0.0[vorbis]
+               media-libs/libvorbis
+               >=x11-libs/pango-1.22.0
+               >=x11-libs/cairo-1.10.0
+               sys-libs/readline:0=
+               dbus? ( sys-apps/dbus )
+       )"
+DEPEND="${RDEPEND}
+       x11-libs/libX11
+"
+BDEPEND="
+       sys-devel/gettext
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.18.3-gcc15.patch
+       "${FILESDIR}"/${PN}-1.18.4-boost-1.88.patch
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       if ! use doc ; then
+               sed -i \
+                       -e '/manual/d' \
+                       doc/CMakeLists.txt || die
+       fi
+
+       # respect LINGUAS (bug #483316)
+       if [[ ${LINGUAS+set} ]] ; then
+               local lang langs=()
+               for lang in $(cat po/LINGUAS) ; do
+                       has ${lang} ${LINGUAS} && langs+=( ${lang} )
+               done
+               echo "${langs[@]}" > po/LINGUAS || die
+       fi
+}
+
+src_configure() {
+       filter-flags -ftracer -fomit-frame-pointer
+
+       local mycmakeargs=()
+
+       if use dedicated || use server ; then
+               mycmakeargs+=(
+                       -DENABLE_CAMPAIGN_SERVER="ON"
+                       -DENABLE_SERVER="ON"
+                       -DSERVER_UID="${PN}"
+                       -DSERVER_GID="${PN}"
+                       -DFIFO_DIR="/run/wesnothd"
+                       )
+       else
+               mycmakeargs+=(
+                       -DENABLE_CAMPAIGN_SERVER="OFF"
+                       -DENABLE_SERVER="OFF"
+                       )
+       fi
+       mycmakeargs+=(
+               -Wno-dev
+               -DENABLE_GAME="$(usex !dedicated)"
+               -DENABLE_DESKTOP_ENTRY="$(usex !dedicated)"
+               -DENABLE_NLS="$(usex nls)"
+               -DENABLE_NOTIFICATIONS="$(usex dbus)"
+               -DENABLE_STRICT_COMPILATION="OFF"
+               -DENABLE_TESTS="$(usex test)"
+       )
+       cmake_src_configure
+}
+
+src_test() {
+       # Allow SDL_Mixer test to pass, bug #931551
+       SDL_AUDIODRIVER=dummy cmake_src_test
+}
+
+src_install() {
+       local DOCS=( README.md changelog.md )
+       cmake_src_install
+       if use dedicated || use server ; then
+               rmdir "${ED}"/run{/wesnothd,} || die
+               newinitd "${FILESDIR}"/wesnothd.rc-r1 wesnothd
+       fi
+}

Reply via email to