diff --git a/games/widelands/Makefile b/games/widelands/Makefile index 808ef4e98390..341d3da609cd 100644 --- a/games/widelands/Makefile +++ b/games/widelands/Makefile @@ -1,54 +1,53 @@ PORTNAME= widelands DISTVERSIONPREFIX= v -DISTVERSION= 1.2 -PORTREVISION= 6 +DISTVERSION= 1.2.1 CATEGORIES= games MAINTAINER= amdmi3@FreeBSD.org COMMENT= Realtime strategy game inspired by Settlers II WWW= https://wl.widelands.org/ LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libpng.so:graphics/png \ libicuuc.so:devel/icu \ libboost_thread.so:devel/boost-libs \ libminizip.so:archivers/minizip BUILD_DEPENDS= ${PREFIX}/include/asio.hpp:net/asio USES= cmake compiler:c++11-lib cpe gettext gl pkgconfig \ python:build sdl USE_GITHUB= yes USE_GL= gl glew USE_SDL= sdl2 mixer2 image2 ttf2 CMAKE_ARGS= -DWL_INSTALL_BINDIR=bin \ -DWL_INSTALL_BASEDIR="${PREFIX}" \ -DWL_INSTALL_DATADIR="${DATADIR}" \ -DWL_INSTALL_DOCDIR="${DOCSDIR}" \ -DWL_VERSION="${DISTVERSION}" \ -DWL_OPTIMIZE_FLAGS="" \ -Wno-dev CMAKE_BUILD_TYPE=None PORTSCOUT= limit:^[0-9]+\. PORTDATA= * PORTDOCS= * OPTIONS_DEFINE= DOCS LTO NLS TEST OPTIONS_DEFAULT=LTO OPTIONS_EXCLUDE_riscv64= LTO LTO_CMAKE_ON= -DUSE_FLTO_IF_AVAILABLE:STRING="yes" NLS_CMAKE_BOOL= OPTION_BUILD_TRANSLATIONS TEST_CMAKE_BOOL=OPTION_BUILD_TESTS post-extract: @${RM} -r ${WRKSRC}/src/third_party/minizip post-patch: @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \ ${WRKSRC}/cmake/Modules/*.cmake .include diff --git a/games/widelands/distinfo b/games/widelands/distinfo index 18724690f854..2250b591ca41 100644 --- a/games/widelands/distinfo +++ b/games/widelands/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1712068495 -SHA256 (widelands-widelands-v1.2_GH0.tar.gz) = c6bed3717c541276fbed8a33adce230a2637297588c719268fcb963e076210e2 -SIZE (widelands-widelands-v1.2_GH0.tar.gz) = 457713595 +TIMESTAMP = 1736974158 +SHA256 (widelands-widelands-v1.2.1_GH0.tar.gz) = 799bfd32048ef20118c48e21f3fc843ae0451c42bb8bf2eabcb9b26bf6fe54b4 +SIZE (widelands-widelands-v1.2.1_GH0.tar.gz) = 457853247 diff --git a/games/widelands/files/patch-CMakeLists.txt b/games/widelands/files/patch-CMakeLists.txt index eeda6cbe5c97..63e0398f9b2f 100644 --- a/games/widelands/files/patch-CMakeLists.txt +++ b/games/widelands/files/patch-CMakeLists.txt @@ -1,53 +1,53 @@ ---- CMakeLists.txt.orig 2024-03-28 10:12:05 UTC +--- CMakeLists.txt.orig 2024-11-12 20:03:25 UTC +++ CMakeLists.txt -@@ -328,7 +328,7 @@ if(NOT MSVC) +@@ -329,7 +329,7 @@ if(NOT MSVC) endif() if(NOT MSVC) -- if(CMAKE_BUILD_TYPE STREQUAL "Release") -+ if(TRUE OR CMAKE_BUILD_TYPE STREQUAL "Release") +- if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) ++ if(TRUE OR (CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) message(STATUS "Compiler warnings will be ignored.") elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND ( ((NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)) AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.2)) -@@ -360,12 +360,12 @@ if(USE_FLTO_IF_AVAILABLE STREQUAL "yes") +@@ -361,12 +361,12 @@ if(USE_FLTO_IF_AVAILABLE STREQUAL "yes") if(USE_FLTO_IF_AVAILABLE STREQUAL "yes") # Cross-compile-unit optimization not supported by gcc with debug on! # Therefore, this may only be done with Release builds. --if(CMAKE_BUILD_TYPE STREQUAL "Release") -+if(TRUE OR CMAKE_BUILD_TYPE STREQUAL "Release") +-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) ++if(TRUE OR (CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) # Only tested on Linux. Might work also on other platforms. # If tested and found good, remove this check - if (CMAKE_SYSTEM MATCHES "Linux") + if (TRUE OR CMAKE_SYSTEM MATCHES "Linux") # Usage of -flto tested only with gcc 8.3 and 9.3 (2020-04); when in doubt, leaving it out.. - if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)) -+ if(TRUE OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)) ++ if(TRUE OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)) # # The execution jumps between compile units rather often. -flot allows optimization across # comple units. Binary size reduced by >15% on tested environments. This does not directly -@@ -479,13 +479,6 @@ endif (OPTION_BUILD_TESTS) +@@ -484,13 +484,6 @@ endif (OPTION_BUILD_TESTS) ) endif (OPTION_BUILD_TESTS) -install ( - FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION - DESTINATION ${WL_INSTALL_BASEDIR} -- CONFIGURATIONS Debug;Release;None +- CONFIGURATIONS Debug;Release;RelWithDebInfo;None - COMPONENT CoreVersionFile -) - - # Installation. - add_subdirectory(doc) - if(OPTION_BUILD_TRANSLATIONS) -@@ -538,10 +531,9 @@ install( + # TODO(Nordfriese): Use this consistently in places in code that use various other tests for endianness + include(TestBigEndian) + TEST_BIG_ENDIAN(IS_BIG_ENDIAN) +@@ -553,10 +546,9 @@ install( install( FILES - COPYING CREDITS ChangeLog - DESTINATION ${WL_INSTALL_BASEDIR} + DESTINATION ${WL_INSTALL_DOCDIR} - CONFIGURATIONS Debug;Release;None + CONFIGURATIONS Debug;Release;RelWithDebInfo;None COMPONENT CoreLicenseFiles ) diff --git a/games/widelands/files/patch-c0b44ccc04df35a9a23ca9be3e05f5d3a5428f6f b/games/widelands/files/patch-c0b44ccc04df35a9a23ca9be3e05f5d3a5428f6f new file mode 100644 index 000000000000..8465cd586a40 --- /dev/null +++ b/games/widelands/files/patch-c0b44ccc04df35a9a23ca9be3e05f5d3a5428f6f @@ -0,0 +1,224 @@ +From c0b44ccc04df35a9a23ca9be3e05f5d3a5428f6f Mon Sep 17 00:00:00 2001 +From: matthiakl +Date: Sun, 23 Mar 2025 09:17:47 +0000 +Subject: [PATCH] Update asio interfaces (GH #6665 / CB #5025) + +Co-authored-by: matthiakl +Co-authored-by: Widelands Bunnybot +Co-authored-by: matthiakl +Co-committed-by: matthiakl +--- + src/network/bufferedconnection.cc | 16 ++++++++-------- + src/network/bufferedconnection.h | 4 ++-- + src/network/nethost.cc | 12 ++++++------ + src/network/nethost.h | 4 ++-- + src/network/network.cc | 14 +++++++------- + src/network/network_lan_promotion.cc | 4 ++-- + src/network/network_lan_promotion.h | 2 +- + 7 files changed, 28 insertions(+), 28 deletions(-) + +diff --git a/src/network/bufferedconnection.cc b/src/network/bufferedconnection.cc +index 715c2baf5c2..389360526c3 100644 +--- src/network/bufferedconnection.cc ++++ src/network/bufferedconnection.cc +@@ -141,12 +141,12 @@ void BufferedConnection::close() { + verb_log_info("[BufferedConnection] Closing network socket."); + } + // Stop the thread +- io_service_.stop(); +- // Not sure if that is required, wait up to one second for the io_service to stop +- for (int i = 0; i < 1000 && !io_service_.stopped(); i++) { ++ io_context_.stop(); ++ // Not sure if that is required, wait up to one second for the io_context to stop ++ for (int i = 0; i < 1000 && !io_context_.stopped(); i++) { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } +- assert(io_service_.stopped()); ++ assert(io_context_.stopped()); + if (asio_thread_.joinable()) { + try { + asio_thread_.join(); +@@ -334,7 +334,7 @@ void BufferedConnection::reduce_send_buffer(asio::ip::tcp::socket& socket) { + } + + BufferedConnection::BufferedConnection(const NetAddress& host) +- : socket_(io_service_), currently_sending_(false) { ++ : socket_(io_context_), currently_sending_(false) { + + const asio::ip::tcp::endpoint destination(host.ip, host.port); + +@@ -353,7 +353,7 @@ BufferedConnection::BufferedConnection(const NetAddress& host) + asio_thread_ = std::thread([this]() { + // The output might actually be messed up if it collides with the main thread... + verb_log_info("[BufferedConnection] Starting networking thread\n"); +- io_service_.run(); ++ io_context_.run(); + verb_log_info("[BufferedConnection] Stopping networking thread\n"); + }); + } else { +@@ -364,7 +364,7 @@ BufferedConnection::BufferedConnection(const NetAddress& host) + } + } + +-BufferedConnection::BufferedConnection() : socket_(io_service_) { ++BufferedConnection::BufferedConnection() : socket_(io_context_) { + } + + void BufferedConnection::notify_connected() { +@@ -379,7 +379,7 @@ void BufferedConnection::notify_connected() { + asio_thread_ = std::thread([this]() { + // The output might actually be messed up if it collides with the main thread... + verb_log_info("[BufferedConnection] Starting networking thread"); +- io_service_.run(); ++ io_context_.run(); + verb_log_info("[BufferedConnection] Stopping networking thread"); + }); + } +diff --git a/src/network/bufferedconnection.h b/src/network/bufferedconnection.h +index 71f9bdfd6a0..c47b994500b 100644 +--- src/network/bufferedconnection.h ++++ src/network/bufferedconnection.h +@@ -314,8 +314,8 @@ class BufferedConnection { + /// Each packet in the queue is a vector of uint8_t. + std::map>> buffers_to_send_; + +- /// An io_service needed by asio. Primarily needed for asynchronous operations. +- asio::io_service io_service_; ++ /// An io_context needed by asio. Primarily needed for asynchronous operations. ++ asio::io_context io_context_; + + /// The socket that connects us to the host. + asio::ip::tcp::socket socket_; +diff --git a/src/network/nethost.cc b/src/network/nethost.cc +index 16b08454929..25e369ef3c1 100644 +--- src/network/nethost.cc ++++ src/network/nethost.cc +@@ -67,11 +67,11 @@ bool NetHost::is_connected(const ConnectionId id) const { + void NetHost::stop_listening() { + + // Stop the thread +- io_service_.stop(); +- for (int i = 0; i < 1000 && !io_service_.stopped(); i++) { ++ io_context_.stop(); ++ for (int i = 0; i < 1000 && !io_context_.stopped(); i++) { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } +- assert(io_service_.stopped()); ++ assert(io_context_.stopped()); + if (asio_thread_.joinable()) { + try { + asio_thread_.join(); +@@ -183,7 +183,7 @@ void NetHost::start_accepting( + }); + } + +-NetHost::NetHost(const uint16_t port) : acceptor_v4_(io_service_), acceptor_v6_(io_service_) { ++NetHost::NetHost(const uint16_t port) : acceptor_v4_(io_context_), acceptor_v6_(io_context_) { + + if (open_acceptor(&acceptor_v4_, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port))) { + verb_log_info("[NetHost] Opening a listening IPv4 socket on TCP port %u", port); +@@ -198,7 +198,7 @@ NetHost::NetHost(const uint16_t port) : acceptor_v4_(io_service_), acceptor_v6_( + + asio_thread_ = std::thread([this]() { + verb_log_info("[NetHost] Starting networking thread"); +- io_service_.run(); ++ io_context_.run(); + verb_log_info("[NetHost] Stopping networking thread"); + }); + } +@@ -214,7 +214,7 @@ bool NetHost::open_acceptor(asio::ip::tcp::acceptor* acceptor, + acceptor->set_option(option_v6only); + } + acceptor->bind(endpoint); +- acceptor->listen(asio::socket_base::max_connections); ++ acceptor->listen(asio::socket_base::max_listen_connections); + return true; + } catch (const std::system_error&) { + return false; +diff --git a/src/network/nethost.h b/src/network/nethost.h +index 86fe4f920d5..7d17502b9d4 100644 +--- src/network/nethost.h ++++ src/network/nethost.h +@@ -101,8 +101,8 @@ class NetHost : public NetHostInterface { + std::map> clients_; + /// The next client id that will be used + NetHostInterface::ConnectionId next_id_{1}; +- /// An io_service needed by asio. Primary needed for async operations. +- asio::io_service io_service_; ++ /// An io_context needed by asio. Primary needed for async operations. ++ asio::io_context io_context_; + /// The acceptor we get IPv4 connection requests to. + asio::ip::tcp::acceptor acceptor_v4_; + /// The acceptor we get IPv6 connection requests to. +diff --git a/src/network/network.cc b/src/network/network.cc +index f945b28b665..1c142f1f846 100644 +--- src/network/network.cc ++++ src/network/network.cc +@@ -30,17 +30,17 @@ bool do_resolve(const asio::ip::tcp& protocol, + uint16_t port) { + assert(addr != nullptr); + try { +- asio::io_service io_service; +- asio::ip::tcp::resolver resolver(io_service); +- asio::ip::tcp::resolver::query query(protocol, hostname, as_string(port)); +- asio::ip::tcp::resolver::iterator iter = resolver.resolve(query); +- if (iter == asio::ip::tcp::resolver::iterator()) { ++ asio::io_context io_context; ++ asio::ip::tcp::resolver resolver(io_context); ++ asio::ip::tcp::resolver::results_type iter = ++ resolver.resolve(protocol, hostname, as_string(port)); ++ if (iter.empty()) { + // Resolution failed + log_err("Could not resolve network name '%s:%u' to %s-address\n", hostname.c_str(), port, + ((protocol == asio::ip::tcp::v4()) ? "IPv4" : "IPv6")); + return false; + } +- addr->ip = iter->endpoint().address(); ++ addr->ip = iter.begin()->endpoint().address(); + addr->port = port; + verb_log_info("Resolved network name '%s:%u' to %s", hostname.c_str(), port, + addr->ip.to_string().c_str()); +@@ -64,7 +64,7 @@ bool NetAddress::resolve_to_v6(NetAddress* addr, const std::string& hostname, ui + + bool NetAddress::parse_ip(NetAddress* addr, const std::string& ip, uint16_t port) { + std::error_code ec; +- asio::ip::address new_addr = asio::ip::address::from_string(ip, ec); ++ asio::ip::address new_addr = asio::ip::make_address(ip, ec); + if (ec) { + return false; + } +diff --git a/src/network/network_lan_promotion.cc b/src/network/network_lan_promotion.cc +index 5e8e8f6b912..7cdbf1962ec 100644 +--- src/network/network_lan_promotion.cc ++++ src/network/network_lan_promotion.cc +@@ -75,7 +75,7 @@ int get_ip_version(const asio::ip::udp& version) { + * On Apple we have to specify the interface, forcing us to send our message over all interfaces we + * can find. + */ +-LanBase::LanBase(uint16_t port) : socket_v4(io_service), socket_v6(io_service) { ++LanBase::LanBase(uint16_t port) : socket_v4(io_context), socket_v6(io_context) { + + #ifndef _WIN32 + // Iterate over all interfaces. If they support IPv4, store the broadcast-address +@@ -252,7 +252,7 @@ bool LanBase::broadcast(void const* const buf, size_t const len, uint16_t const + asio::ip::udp::socket& socket, const std::string& address) -> bool { + if (socket.is_open()) { + std::error_code ec; +- asio::ip::udp::endpoint destination(asio::ip::address::from_string(address), port); ++ asio::ip::udp::endpoint destination(asio::ip::make_address(address), port); + socket.send_to(asio::buffer(buf, len), destination, 0, ec); + if (!ec) { + return true; +diff --git a/src/network/network_lan_promotion.h b/src/network/network_lan_promotion.h +index dc1ccbadbc3..a227043ccf8 100644 +--- src/network/network_lan_promotion.h ++++ src/network/network_lan_promotion.h +@@ -135,7 +135,7 @@ struct LanBase { + void close_socket(asio::ip::udp::socket* socket); + + /// No idea what this does. I think it is only really used when asynchronous operations are done. +- asio::io_service io_service; ++ asio::io_context io_context; + /// The socket for IPv4. + asio::ip::udp::socket socket_v4; + /// The socket for IPv6.