widelands: update to 21

This commit is contained in:
Jürgen Buchmüller 2020-07-19 08:48:10 +02:00
parent b004bdab8f
commit 1d1d25bb49
5 changed files with 61 additions and 83 deletions

View file

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

View file

@ -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 <cstdlib>
-
+#if defined(__GLIBC__)
#include <execinfo.h>
#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;
}

View file

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

View file

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

View file

@ -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 <pullmoll@t-online.de>"
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