widelands: update to 1.1.

boost is deprecated and removed upstream.

Following the deprecation procedure upstream now needs asio.
This commit is contained in:
Krul Ceter 2022-11-28 01:42:53 +03:00 committed by Đoàn Trần Công Danh
parent 584f33ae7d
commit 840d14af1f
6 changed files with 66 additions and 149 deletions

View File

@ -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
)

View File

@ -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)

View File

@ -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")

View File

@ -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))

View File

@ -0,0 +1,23 @@
Index: widelands-1.1/src/base/macros.h
===================================================================
--- widelands-1.1.orig/src/base/macros.h
+++ widelands-1.1/src/base/macros.h
@@ -134,16 +134,8 @@
#else
#define PRIuS PRIu32
#endif
-#else
-#if __WORDSIZE == 64
-#define PRIuS "lu"
-#else
-#if defined(__WORDSIZE32_SIZE_ULONG) && __WORDSIZE32_SIZE_ULONG
-#define PRIuS "lu"
-#else
-#define PRIuS "u"
-#endif
-#endif
+#else // !_WIN32
+#define PRIuS "zu"
#endif
#endif // end of include guard: WL_BASE_MACROS_H

View File

@ -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 <travankor@tuta.io>"
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"