From b53463e85dfacb44d0680a73fda3b807d044d913 Mon Sep 17 00:00:00 2001 From: Krul Ceter Date: Mon, 28 Nov 2022 01:42:53 +0300 Subject: [PATCH] widelands: update to 1.1. boost is deprecated and removed upstream. Following the deprecation procedure upstream now needs asio. --- .../patches/cmake-build-type-none.patch | 67 ------------------- .../widelands/patches/fix-install-path.patch | 40 ----------- srcpkgs/widelands/patches/musl.patch | 63 +++++++---------- srcpkgs/widelands/patches/no-werror.patch | 11 +++ srcpkgs/widelands/patches/wordsize.patch | 25 +++++++ srcpkgs/widelands/template | 11 +-- 6 files changed, 68 insertions(+), 149 deletions(-) delete mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch delete mode 100644 srcpkgs/widelands/patches/fix-install-path.patch create mode 100644 srcpkgs/widelands/patches/no-werror.patch create mode 100644 srcpkgs/widelands/patches/wordsize.patch diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch deleted file mode 100644 index 0f9b0cc921ad..000000000000 --- a/srcpkgs/widelands/patches/cmake-build-type-none.patch +++ /dev/null @@ -1,67 +0,0 @@ -Index: CMakeLists.txt -=================================================================== ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -209,6 +209,8 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") - endif () - set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE") - option(OPTION_ASAN "Build with AddressSanitizer" ON) -+elseif(CMAKE_BUILD_TYPE STREQUAL "None") -+ message(STATUS "Not setting any default flags.") - else() - message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") - endif() -@@ -415,7 +417,7 @@ endif (OPTION_BUILD_TESTS) - install ( - FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION - DESTINATION ${WL_INSTALL_BASEDIR} -- CONFIGURATIONS Debug;Release -+ CONFIGURATIONS Debug;Release;None - COMPONENT CoreVersionFile - ) - -@@ -440,7 +442,7 @@ install( - data/txts - data/world - DESTINATION ${WL_INSTALL_DATADIR} -- CONFIGURATIONS Debug;Release -+ CONFIGURATIONS Debug;Release;None - COMPONENT CoreDataFiles - ) - -@@ -448,7 +450,7 @@ install( - DIRECTORY - data/maps - DESTINATION ${WL_INSTALL_DATADIR} -- CONFIGURATIONS Debug;Release -+ CONFIGURATIONS Debug;Release;None - COMPONENT MapFiles - ) - -@@ -457,7 +459,7 @@ install( - data/music - data/sound - DESTINATION ${WL_INSTALL_DATADIR} -- CONFIGURATIONS Debug;Release -+ CONFIGURATIONS Debug;Release;None - COMPONENT MusicFiles - ) - -@@ -467,7 +469,7 @@ install( - CREDITS - ChangeLog - DESTINATION ${WL_INSTALL_BASEDIR} -- CONFIGURATIONS Debug;Release -+ CONFIGURATIONS Debug;Release;None - COMPONENT CoreLicenseFiles - ) - -@@ -486,7 +488,7 @@ install( - DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR}/locale/ - DESTINATION ${WL_INSTALL_DATADIR}/locale -- CONFIGURATIONS Debug;Release -+ CONFIGURATIONS Debug;Release;None - COMPONENT CoreLanguageFiles - ) - diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch deleted file mode 100644 index 277c9a74726e..000000000000 --- a/srcpkgs/widelands/patches/fix-install-path.patch +++ /dev/null @@ -1,40 +0,0 @@ -Index: cmake/WlFunctions.cmake -=================================================================== ---- a/cmake/WlFunctions.cmake -+++ b/cmake/WlFunctions.cmake -@@ -289,5 +289,5 @@ function(wl_binary NAME) - - #Quoting the CMake documentation on DESTINATION: - #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX" -- install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles) -+ install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles) - endfunction() -Index: xdg/CMakeLists.txt -=================================================================== ---- a/xdg/CMakeLists.txt -+++ b/xdg/CMakeLists.txt -@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi - list(APPEND icon_sizes "16" "32" "48" "64" "128") - foreach (icon_size ${icon_sizes}) - #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png) -- install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png) -+ install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png) - endforeach (icon_size ${icon_sizes}) - #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6) --install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6 DESTINATION ../share/man/man6) -+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6 DESTINATION share/man/man6) - #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) --install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop DESTINATION ../share/applications) -+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop DESTINATION share/applications) - #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo) --install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo) -+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo) - - find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache) - if (GTK_UPDATE_ICON_CACHE) - #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )") -- install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )") -+ install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )") - else (GTK_UPDATE_ICON_CACHE) - message(WARNING "gtk-update-icon-cache not found!") - endif (GTK_UPDATE_ICON_CACHE) diff --git a/srcpkgs/widelands/patches/musl.patch b/srcpkgs/widelands/patches/musl.patch index 49b135775540..137e2b83461c 100644 --- a/srcpkgs/widelands/patches/musl.patch +++ b/srcpkgs/widelands/patches/musl.patch @@ -1,50 +1,39 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 018d9ea0..827bf33e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -312,19 +312,15 @@ IF (WIN32) - endif (CMAKE_SIZEOF_VOID_P EQUAL 4) +@@ -459,6 +459,10 @@ IF (WIN32) + endif() endif (WIN32) --# on BSD this must be explicitly linked --if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") -- # Not needed on Debian GNU/kFreeBSD.. -- if (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") -- find_library(EXECINFO_LIBRARY NAMES execinfo) -- endif (NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") -- -- # OpenBSD needs the X11 include directory in order to find GL/glu.h -- if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") -- find_package(X11 REQUIRED) -- include_directories(${X11_INCLUDE_DIR}) -- endif () --endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") +# Find libexecinfo and libintl for musl +find_library(EXECINFO_LIBRARY NAMES execinfo) +find_library(INTL_LIBRARY NAMES intl) + -+# OpenBSD needs the X11 include directory in order to find GL/glu.h -+if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") -+ find_package(X11 REQUIRED) -+ include_directories(${X11_INCLUDE_DIR}) -+endif () + # on BSD this must be explicitly linked + if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + # Not needed on Debian GNU/kFreeBSD.. +--- a/cmake/WlFunctions.cmake ++++ b/cmake/WlFunctions.cmake +@@ -184,6 +184,10 @@ + endif() + endif() - if (NOT DEFINED WL_VERSION) - include (${CMAKE_SOURCE_DIR}/cmake/BzrRevision.cmake) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 31f5a76e..1f27495f 100644 ++ if (INTL_LIBRARY) ++ target_link_libraries(${NAME} ${INTL_LIBRARY}) ++ endif() ++ + if (ARG_USES_INTL) + # libintl is not used on all systems, so only include it, when we actually + # found it. --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -140,9 +140,9 @@ wl_library(widelands_options - logic_filesystem_constants +@@ -161,6 +161,10 @@ + USES_SDL2 ) --if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") -- target_link_libraries(widelands_ball_of_mud ${EXECINFO_LIBRARY}) --endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") -+if (EXECINFO_LIBRARY OR INTL_LIBRARY) -+ target_link_libraries(widelands_ball_of_mud ${EXECINFO_LIBRARY} ${INTL_LIBRARY}) -+endif (EXECINFO_LIBRARY OR INTL_LIBRARY) - - if (WIN32) - target_link_libraries(widelands_ball_of_mud wsock32) ++if (EXECINFO_LIBRARY) ++ target_link_libraries(widelands_ball_of_mud ${EXECINFO_LIBRARY}) ++endif() ++ + if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + target_link_libraries(widelands_ball_of_mud ${EXECINFO_LIBRARY}) + endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") diff --git a/srcpkgs/widelands/patches/no-werror.patch b/srcpkgs/widelands/patches/no-werror.patch new file mode 100644 index 000000000000..205714ef5959 --- /dev/null +++ b/srcpkgs/widelands/patches/no-werror.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -372,7 +372,7 @@ + endif() + + if(NOT MSVC) +- if(CMAKE_BUILD_TYPE STREQUAL "Release") ++ if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "None") + 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)) diff --git a/srcpkgs/widelands/patches/wordsize.patch b/srcpkgs/widelands/patches/wordsize.patch new file mode 100644 index 000000000000..537d914f6c5f --- /dev/null +++ b/srcpkgs/widelands/patches/wordsize.patch @@ -0,0 +1,25 @@ +--- a/src/base/macros.h ++++ b/src/base/macros.h +@@ -28,6 +28,9 @@ + #endif + #endif + ++/* Used for wordsize only */ ++#include ++ + /* Macros for disabling GCC warnings and errors + * From http://dbp-consulting.com/tutorials/SuppressingGCCWarnings.html and + * slightly modified to remove support entirely for GCC < 4.6 because we'll +@@ -135,10 +138,10 @@ + #define PRIuS PRIu32 + #endif + #else +-#if __WORDSIZE == 64 ++#if (ULONG_MAX == 0xffffffffffffffff) + #define PRIuS "lu" + #else +-#if defined(__WORDSIZE32_SIZE_ULONG) && __WORDSIZE32_SIZE_ULONG ++#if (ULONG_MAX == 0xffffffff) + #define PRIuS "lu" + #else + #define PRIuS "u" diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template index 17351e8a0bf7..e9da5eacf79d 100644 --- a/srcpkgs/widelands/template +++ b/srcpkgs/widelands/template @@ -3,22 +3,23 @@ pkgname=widelands # Widelands 1.0 release supercedes beta builds reverts="21_5 21_4 21_3 21_2 21_1 20_4 20_3 20_2 20_1 19_10 19_9 19_8 19_7 19_6 19_5 19_4 19_3 19_2 19_1 18_5 18_4 18_3 18_2 18_1" -version=1.0 -revision=4 +version=1.1 +revision=1 build_style=cmake configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include -DOPTION_BUILD_WEBSITE_TOOLS=OFF -DWL_INSTALL_BASEDIR=/usr/share/widelands - -DWL_INSTALL_DATADIR=/usr/share/widelands" + -DWL_INSTALL_DATADIR=/usr/share/widelands -DWL_INSTALL_BINDIR=${DESTDIR}/usr/bin" hostmakedepends="python3 pkg-config gettext" -makedepends="boost-devel icu-devel minizip-devel gettext-devel +makedepends="asio icu-devel minizip-devel gettext-devel glu-devel glew-devel libcurl-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel" short_desc="Real-time strategy game" maintainer="travankor " license="GPL-2.0-or-later" homepage="https://www.widelands.org/" +changelog="https://raw.githubusercontent.com/widelands/widelands/master/ChangeLog" distfiles="https://github.com/widelands/widelands/archive/v${version}.tar.gz" -checksum=1dab0c4062873cc72c5e0558f9e9620b0ef185f1a78923a77c4ce5b9ed76031a +checksum=6853fcf3daec9b66005691e5bcb00326634baf0985ad89a7e6511502612f6412 replaces="widelands-data>=0" CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"