From ad86b85609e20096a1360a3dcc3513c93204120e Mon Sep 17 00:00:00 2001 From: iFoundSilentHouse Date: Wed, 27 Mar 2024 17:11:47 +0600 Subject: [PATCH 1/3] wesnoth: update to 1.18.0. wesnoth: update to 1.18.0 --- .../wesnoth/patches/000-fix-musl-build.patch | 79 +++++++++++++++++++ .../patches/001-disable-audio-test.patch | 25 ++++++ srcpkgs/wesnoth/patches/boost-1.83.0.patch | 26 ------ srcpkgs/wesnoth/template | 7 +- 4 files changed, 108 insertions(+), 29 deletions(-) create mode 100644 srcpkgs/wesnoth/patches/000-fix-musl-build.patch create mode 100644 srcpkgs/wesnoth/patches/001-disable-audio-test.patch delete mode 100644 srcpkgs/wesnoth/patches/boost-1.83.0.patch diff --git a/srcpkgs/wesnoth/patches/000-fix-musl-build.patch b/srcpkgs/wesnoth/patches/000-fix-musl-build.patch new file mode 100644 index 00000000000000..1cea150d84f4c7 --- /dev/null +++ b/srcpkgs/wesnoth/patches/000-fix-musl-build.patch @@ -0,0 +1,79 @@ +diff --git a/src/utils/config_filters.cpp b/src/utils/config_filters.cpp +index f833acd7..dc0cbad5 100644 +--- a/src/utils/config_filters.cpp ++++ b/src/utils/config_filters.cpp +@@ -53,7 +53,7 @@ bool utils::config_filters::unsigned_matches_if_present(const config& filter, co + return in_ranges(cfg[attribute].to_int(0), utils::parse_ranges_unsigned(filter[attribute].str())); + } + +-bool utils::config_filters::int_matches_if_present(const config& filter, const config& cfg, const std::string& attribute, std::optional def) ++bool utils::config_filters::int_matches_if_present(const config& filter, const config& cfg, const std::string& attribute, int def) + { + if(!filter.has_attribute(attribute)) { + return true; +@@ -62,12 +62,11 @@ bool utils::config_filters::int_matches_if_present(const config& filter, const c + return false; + } + +- int value_def = def ? (*def) : 0; +- return in_ranges(cfg[attribute].to_int(value_def), utils::parse_ranges_int(filter[attribute].str())); ++ return in_ranges(cfg[attribute].to_int(def), utils::parse_ranges_int(filter[attribute].str())); + } + + bool utils::config_filters::int_matches_if_present_or_negative( +- const config& filter, const config& cfg, const std::string& attribute, const std::string& opposite, std::optional def) ++ const config& filter, const config& cfg, const std::string& attribute, const std::string& opposite, int def) + { + if(int_matches_if_present(filter, cfg, attribute, def)) { + return true; +@@ -79,14 +78,13 @@ bool utils::config_filters::int_matches_if_present_or_negative( + if(!cfg.has_attribute(opposite) && !def) { + return false; + } +- int value_def = def ? (*def) : 0; +- return in_ranges(-cfg[opposite].to_int(value_def), utils::parse_ranges_int(filter[attribute].str())); ++ return in_ranges(-cfg[opposite].to_int(def), utils::parse_ranges_int(filter[attribute].str())); + } + + return false; + } + +-bool utils::config_filters::double_matches_if_present(const config& filter, const config& cfg, const std::string& attribute, std::optional def) ++bool utils::config_filters::double_matches_if_present(const config& filter, const config& cfg, const std::string& attribute, double def) + { + if(!filter.has_attribute(attribute)) { + return true; +@@ -95,8 +93,7 @@ bool utils::config_filters::double_matches_if_present(const config& filter, cons + return false; + } + +- double value_def = def ? (*def) : 1; +- return in_ranges(cfg[attribute].to_double(value_def), utils::parse_ranges_real(filter[attribute].str())); ++ return in_ranges(cfg[attribute].to_double(def), utils::parse_ranges_real(filter[attribute].str())); + } + + bool utils::config_filters::bool_or_empty(const config& filter, const config& cfg, const std::string& attribute) +diff --git a/src/utils/config_filters.hpp b/src/utils/config_filters.hpp +index 878042a0..95423353 100644 +--- a/src/utils/config_filters.hpp ++++ b/src/utils/config_filters.hpp +@@ -40,8 +40,8 @@ bool bool_matches_if_present(const config& filter, const config& cfg, const std: + * + * Always returns true if the filter puts no restriction on the value of @a cfg[@a attribute]. + */ +-bool double_matches_if_present(const config& filter, const config& cfg, const std::string& attribute, std::optional def = NULL); +-bool int_matches_if_present(const config& filter, const config& cfg, const std::string& attribute, std::optional def = NULL); ++bool double_matches_if_present(const config& filter, const config& cfg, const std::string& attribute, double def = 1); ++bool int_matches_if_present(const config& filter, const config& cfg, const std::string& attribute, int def = 0); + + /** + * Restricts filters to only looking for values that are zero or more. +@@ -62,7 +62,7 @@ bool unsigned_matches_if_present(const config& filter, const config& cfg, const + * The function is named "negative" in case we later want to add a "reciprocal" for the "multiply"/"divide" pair. + */ + bool int_matches_if_present_or_negative( +- const config& filter, const config& cfg, const std::string& attribute, const std::string& opposite, std::optional def = NULL); ++ const config& filter, const config& cfg, const std::string& attribute, const std::string& opposite, int def = 0); + + bool string_matches_if_present( + const config& filter, const config& cfg, const std::string& attribute, const std::string& def); diff --git a/srcpkgs/wesnoth/patches/001-disable-audio-test.patch b/srcpkgs/wesnoth/patches/001-disable-audio-test.patch new file mode 100644 index 00000000000000..0c70f50f6fa4f4 --- /dev/null +++ b/srcpkgs/wesnoth/patches/001-disable-audio-test.patch @@ -0,0 +1,25 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 52b0de2..bfb6d9c 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -196,12 +196,6 @@ if((ENABLE_GAME OR ENABLE_TESTS) AND NOT MSVC) + target_link_libraries(sdl2_webp ${game-external-libs}) + add_test(NAME SDL2_WEBP_SUPPORT COMMAND sdl2_webp "${CMAKE_SOURCE_DIR}/data/core/images/scons_conftest_images/end-n.webp") + +- # test for audio support in SDL2 +- add_executable(sdl2_audio conftests/sdl2_audio.cpp) +- set_target_properties(sdl2_audio PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Testing) +- target_link_libraries(sdl2_audio ${game-external-libs}) +- add_test(NAME SDL2_AUDIO_SUPPORT COMMAND sdl2_audio "${CMAKE_SOURCE_DIR}/data/core/music/main_menu.ogg") +- + add_custom_target(conftests + COMMAND ${CMAKE_COMMAND} -E env "SDL_AUDIODRIVER=dummy" ${CMAKE_CTEST_COMMAND} + DEPENDS +@@ -211,7 +205,6 @@ if((ENABLE_GAME OR ENABLE_TESTS) AND NOT MSVC) + sdl2_jpg + sdl2_png + sdl2_webp +- sdl2_audio + ) + endif() + diff --git a/srcpkgs/wesnoth/patches/boost-1.83.0.patch b/srcpkgs/wesnoth/patches/boost-1.83.0.patch deleted file mode 100644 index 5a07fa82ba8971..00000000000000 --- a/srcpkgs/wesnoth/patches/boost-1.83.0.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 182d0ff548b0149a17a6fefcf061074db05c82de Mon Sep 17 00:00:00 2001 -From: Pentarctagon -Date: Thu, 17 Aug 2023 23:16:09 -0500 -Subject: [PATCH] Compile fix for boost 1.83. - -Fixes #7849 ---- - src/gettext.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/gettext.cpp b/src/gettext.cpp -index 2d27ef6abc00..5e0d2f6c3ea5 100644 ---- a/src/gettext.cpp -+++ b/src/gettext.cpp -@@ -166,7 +166,11 @@ namespace - return msg; - } - -+#if BOOST_VERSION < 108300 - const char* get(int domain_id, const char* ctx, const char* sid, int n) const override -+#else -+ const char* get(int domain_id, const char* ctx, const char* sid, bl::count_type n) const override -+#endif - { - auto& base = get_base(); - const char* msg = base.get(domain_id, ctx, sid, n); diff --git a/srcpkgs/wesnoth/template b/srcpkgs/wesnoth/template index 1af59888ab187d..60b0cf3da167f8 100644 --- a/srcpkgs/wesnoth/template +++ b/srcpkgs/wesnoth/template @@ -1,20 +1,21 @@ # Template file for 'wesnoth' pkgname=wesnoth -version=1.16.10 +version=1.18.0 revision=1 build_style=cmake configure_args="-DENABLE_OMP=1" hostmakedepends="pkg-config gettext" makedepends="dbus-devel libgomp-devel fribidi-devel SDL2_image-devel SDL2_net-devel SDL2_ttf-devel SDL2_mixer-devel pango-devel libvorbis-devel - zlib-devel bzip2-devel boost-devel openssl-devel SDL2-devel" + zlib-devel bzip2-devel boost-devel openssl-devel SDL2-devel libcurl-devel" depends="desktop-file-utils" short_desc="Turn-based fantasy strategy game" maintainer="Orphaned " license="GPL-2.0-or-later" homepage="https://wesnoth.org" +changelog="https://github.com/wesnoth/wesnoth/blob/master/changelog.md" distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.bz2" -checksum=a60521b1ee1c2ddc7dfde89a038b893a4b43337085bd1478f4bc92dab7da7fc7 +checksum=2cdc75b97c3437e6490f1982c7938e87d5dcbe29ca8aed32a8d13b25e06939c0 replaces="wesnoth-data>=0" CFLAGS="-UNDEBUG" From 1da37c354f0eddf39d572899e4cb096108dff5b7 Mon Sep 17 00:00:00 2001 From: iFoundSilentHouse Date: Wed, 27 Mar 2024 17:12:43 +0600 Subject: [PATCH 2/3] SDL2_image: rebuild for webp support --- .../SDL2_image/patches/000-add-webp-support.patch | 13 +++++++++++++ srcpkgs/SDL2_image/template | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/SDL2_image/patches/000-add-webp-support.patch diff --git a/srcpkgs/SDL2_image/patches/000-add-webp-support.patch b/srcpkgs/SDL2_image/patches/000-add-webp-support.patch new file mode 100644 index 00000000000000..e6bb4711b29fd2 --- /dev/null +++ b/srcpkgs/SDL2_image/patches/000-add-webp-support.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 65a8811..1c76fad 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -86,7 +86,7 @@ option(SDL2IMAGE_QOI "Support loading QOI images" ON) + option(SDL2IMAGE_SVG "Support loading SVG images" ON) + option(SDL2IMAGE_TGA "Support loading TGA images" ON) + option(SDL2IMAGE_TIF "Support loading TIFF images" OFF) +-option(SDL2IMAGE_WEBP "Support loading WEBP images" OFF) ++option(SDL2IMAGE_WEBP "Support loading WEBP images" ON) + option(SDL2IMAGE_XCF "Support loading XCF images" ON) + option(SDL2IMAGE_XPM "Support loading XPM images" ON) + option(SDL2IMAGE_XV "Support loading XV images" ON) diff --git a/srcpkgs/SDL2_image/template b/srcpkgs/SDL2_image/template index 9178845cd04142..70bef596f0eb3b 100644 --- a/srcpkgs/SDL2_image/template +++ b/srcpkgs/SDL2_image/template @@ -1,8 +1,9 @@ # Template file for 'SDL2_image' pkgname=SDL2_image version=2.8.2 -revision=1 +revision=2 build_style=cmake +configure_args="-DSDL2IMAGE_WEBP=ON" hostmakedepends="pkg-config" makedepends="SDL2-devel libjpeg-turbo-devel libpng-devel libwebp-devel tiff-devel zlib-devel" From e3da402a7b630c457e90cd491ecd9877ddd6b1f9 Mon Sep 17 00:00:00 2001 From: iFoundSilentHouse Date: Thu, 28 Mar 2024 08:10:05 +0600 Subject: [PATCH 3/3] wesnoth: update to 1.18.0. --- srcpkgs/wesnoth/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/wesnoth/template b/srcpkgs/wesnoth/template index 60b0cf3da167f8..64cb40f634c514 100644 --- a/srcpkgs/wesnoth/template +++ b/srcpkgs/wesnoth/template @@ -13,7 +13,7 @@ short_desc="Turn-based fantasy strategy game" maintainer="Orphaned " license="GPL-2.0-or-later" homepage="https://wesnoth.org" -changelog="https://github.com/wesnoth/wesnoth/blob/master/changelog.md" +changelog="https://github.com/wesnoth/wesnoth/blob/${version}/changelog" distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.bz2" checksum=2cdc75b97c3437e6490f1982c7938e87d5dcbe29ca8aed32a8d13b25e06939c0 replaces="wesnoth-data>=0"