From 1d1d25bb49117dd2fcb1eb8a3d40ff95a88f1391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sun, 19 Jul 2020 08:48:10 +0200 Subject: [PATCH] widelands: update to 21 --- srcpkgs/widelands/files/disable-testing.patch | 22 ---------- srcpkgs/widelands/patches/fix-execinfo.patch | 28 ------------ srcpkgs/widelands/patches/libgl.patch | 13 ------ srcpkgs/widelands/patches/musl-execinfo.patch | 43 +++++++++++++++++++ srcpkgs/widelands/template | 38 ++++++++-------- 5 files changed, 61 insertions(+), 83 deletions(-) delete mode 100644 srcpkgs/widelands/files/disable-testing.patch delete mode 100644 srcpkgs/widelands/patches/fix-execinfo.patch delete mode 100644 srcpkgs/widelands/patches/libgl.patch create mode 100644 srcpkgs/widelands/patches/musl-execinfo.patch diff --git a/srcpkgs/widelands/files/disable-testing.patch b/srcpkgs/widelands/files/disable-testing.patch deleted file mode 100644 index 6c15b249323..00000000000 --- a/srcpkgs/widelands/files/disable-testing.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- CMakeLists.txt 2016-11-10 08:28:01.000000000 +0100 -+++ CMakeLists.txt 2017-12-19 15:31:31.468125411 +0100 -@@ -229,18 +229,7 @@ - ) - endif (NOT DEFINED WL_VERSION) - --# Enable testing. --include(CTest) --enable_testing() -- --# Run a test after a normal compile. This magic is needed as 'make test' will --# not rebuild tests: --# http://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests --add_custom_target(_run_all_tests ALL -- COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -- WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -- DEPENDS wl_tests --) -+# No testing. - - install ( - FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION diff --git a/srcpkgs/widelands/patches/fix-execinfo.patch b/srcpkgs/widelands/patches/fix-execinfo.patch deleted file mode 100644 index 220d1620409..00000000000 --- a/srcpkgs/widelands/patches/fix-execinfo.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- src/logic/backtrace.cc 2016-11-10 08:28:01.000000000 +0100 -+++ src/logic/backtrace.cc 2017-12-19 07:58:01.659673467 +0100 -@@ -22,15 +22,17 @@ - #ifndef _WIN32 - #ifndef __APPLE__ - #include -- -+#if defined(__GLIBC__) - #include - #endif - #endif -+#endif - - std::string get_backtrace() { - std::string result("Backtrace:\n"); - #ifndef _WIN32 - #ifndef __APPLE__ -+#ifdef __GLIBC__ - #define BACKTRACE_STACKSIZE 24 - - void* stack[BACKTRACE_STACKSIZE]; -@@ -43,5 +45,6 @@ - free(list); - #endif - #endif -+#endif - return result; - } diff --git a/srcpkgs/widelands/patches/libgl.patch b/srcpkgs/widelands/patches/libgl.patch deleted file mode 100644 index 1fb25d8fd47..00000000000 --- a/srcpkgs/widelands/patches/libgl.patch +++ /dev/null @@ -1,13 +0,0 @@ -This fixes linker errors with glvnd. - ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -181,7 +181,7 @@ endif(OPTION_ASAN) - - # This is set to avoid linker errors when using GLVND-libs on Linux - if("${OpenGL_GL_PREFERENCE}" STREQUAL "GLVND") -- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lGL") -+ link_libraries("GL") - add_compile_definitions(WL_USE_GLVND) - message(STATUS "Adding linker flags for GLVND.") - endif() diff --git a/srcpkgs/widelands/patches/musl-execinfo.patch b/srcpkgs/widelands/patches/musl-execinfo.patch new file mode 100644 index 00000000000..15467dcae0e --- /dev/null +++ b/srcpkgs/widelands/patches/musl-execinfo.patch @@ -0,0 +1,43 @@ +--- CMakeLists.txt 2020-07-12 21:33:44.000000000 +0200 ++++ CMakeLists.txt 2020-07-19 08:28:28.360260489 +0200 +@@ -312,19 +312,14 @@ + endif (CMAKE_SIZEOF_VOID_P EQUAL 4) + 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") ++# Find libexecinfo for musl ++find_library(EXECINFO_LIBRARY NAMES execinfo) + +- # 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") ++# 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 () + + if (NOT DEFINED WL_VERSION) + include (${CMAKE_SOURCE_DIR}/cmake/BzrRevision.cmake) +--- src/CMakeLists.txt 2020-07-12 21:33:44.000000000 +0200 ++++ src/CMakeLists.txt 2020-07-19 08:28:57.894258728 +0200 +@@ -140,9 +140,9 @@ + logic_filesystem_constants + ) + +-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") ++if (EXECINFO_LIBRARY) + target_link_libraries(widelands_ball_of_mud ${EXECINFO_LIBRARY}) +-endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD") ++endif (EXECINFO_LIBRARY) + + if (WIN32) + target_link_libraries(widelands_ball_of_mud wsock32) diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template index 798a45847c3..211db3729bb 100644 --- a/srcpkgs/widelands/template +++ b/srcpkgs/widelands/template @@ -1,39 +1,37 @@ # Template file for 'widelands' pkgname=widelands -version=20 -revision=4 +version=21 +revision=1 wrksrc="${pkgname}-build${version}" build_style=cmake -configure_args=" - -DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include - -DOPTION_BUILD_WEBSITE_TOOLS=OFF - -DWL_INSTALL_DATADIR=/usr/share/widelands" -hostmakedepends="python pkg-config gettext" -makedepends="boost-devel icu-devel minizip-devel gettext-devel glu-devel - glew-devel SDL2_gfx-devel SDL2_image-devel SDL2_net-devel - SDL2_mixer-devel SDL2_ttf-devel" +configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include + -DOPTION_BUILD_WEBSITE_TOOLS=OFF -DWL_INSTALL_DATADIR=/usr/share/widelands" +hostmakedepends="python3 pkg-config gettext" +makedepends="boost-devel icu-devel minizip-devel gettext-devel + glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel + SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel" depends="${pkgname}-data-${version}_${revision}" short_desc="Real-time strategy game" maintainer="Jürgen Buchmüller " license="GPL-2.0-or-later" homepage="http://www.widelands.org/" -distfiles="https://launchpad.net/${pkgname}/build${version}/build${version}/+download/${pkgname}-build${version}.tar.bz2" -checksum=38594d98c74f357d4c31dd8ee2b056bfe921f42935935af915d11b792677bcb2 +distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz" +checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357 +nocross="Cmake does not find cross SDL2 header files because it looks into /usr/include/SDL2" -CXXFLAGS="-Wno-maybe-uninitialized -DU_USING_ICU_NAMESPACE=1" +CXXFLAGS="-DU_USING_ICU_NAMESPACE=1" -pre_configure() { - if [ "$CROSS_BUILD" ]; then - # Upstream could have defined a flag to disable tests, - # or make sure that test binaries are in host format... - patch -p0 < ${FILESDIR}/disable-testing.patch - fi -} +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + makedepends+=" libexecinfo-devel" +fi post_install() { # For some reason the binary is installed as /usr/widelands - move it vmkdir usr/bin mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin + vmkdir usr/share + mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/ + rmdir ${DESTDIR}/share # Remove files not needed in the package rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION