Verified Commit 37c3afa5 authored by Clayton Craft's avatar Clayton Craft
Browse files
parent 2822a712
Pipeline #89005 passed with stages
in 31 minutes and 4 seconds
From 36dbf33b6b28e5d7461102cba550137ce885ea26 Mon Sep 17 00:00:00 2001
From: clayton craft <clayton@craftyguy.net>
Date: Fri, 30 Jul 2021 19:35:23 +0000
Subject: [PATCH] link libintl
---
CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e9305e5..a8613a73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,8 @@ set(WL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
include("${CMAKE_SOURCE_DIR}/cmake/UseSystemInfo.cmake")
include("${CMAKE_SOURCE_DIR}/cmake/WlFunctions.cmake")
+link_directories(/usr/lib)
+link_libraries(intl)
# This policy is not known to versions prior 3.11 and would result in errors,
# if set on such systems. This can be removed when cmake_minimum_required is set
# to 3.11 or newer by using:
--
2.32.0
From 246452c8e0be506c27c2c192690f0a4b400916a3 Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Fri, 30 Jul 2021 23:43:16 -0700
Subject: [PATCH] linux: only enable backtrace when using glibc
backtrace and backtrace_symbols are in glibc, and not POSIX-compliant
libc (like musl).
---
src/logic/map_objects/backtrace.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/logic/map_objects/backtrace.cc b/src/logic/map_objects/backtrace.cc
index 71e1f4e332..011dc882a0 100644
--- a/src/logic/map_objects/backtrace.cc
+++ b/src/logic/map_objects/backtrace.cc
@@ -21,15 +21,18 @@
#ifndef _WIN32
#ifndef __APPLE__
+#if !defined(__linux__) || defined(__GLIBC__)
#include <execinfo.h>
#endif
#endif
+#endif
std::string get_backtrace() {
std::string result("Backtrace:\n");
#ifndef _WIN32
#ifndef __APPLE__
+#if !defined(__linux__) || defined(__GLIBC__)
#define BACKTRACE_STACKSIZE 24
void* stack[BACKTRACE_STACKSIZE];
@@ -41,6 +44,7 @@ std::string get_backtrace() {
}
free(list);
#endif
+#endif
#endif
return result;
}
--
2.32.0
From 50270f4edc698fbad3de4367349f3790b23a5b4b Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Fri, 30 Jul 2021 23:19:34 -0700
Subject: [PATCH] cmake: add support for None build type
Some distros, e.g. Alpine Linux, like to control setting compiler flags.
cmake supports a "None" build type which uses CFLAGS, CXXFLAGS, etc from
the env and CMakeLists.txt should not set anything.
This change adds support for this so distros can set their own compiler
flags when building and not have them changed by the project build
configuration.
---
CMakeLists.txt | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e9305e5bc..626f6c251b 100644
--- 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
)
--
2.32.0
# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=widelands
pkgver=1.0
pkgrel=0
pkgdesc="realtime strategy game with emphasis on economy and transport"
url="https://widelands.org"
arch="all"
license="GPL-2.0-or-later"
depends="lua python3"
makedepends="
boost1.76-dev
cmake
curl-dev
dbus-dev
doxygen
freeglut-dev
gettext-dev
glew-dev
graphviz
libexecinfo-dev
libintl
libpng-dev
ninja
sdl2-dev
sdl2_image-dev
sdl2_mixer-dev
sdl2_net-dev
sdl2_ttf-dev
zlib-dev
"
source="$pkgname-$pkgver.tar.gz::https://github.com/widelands/widelands/archive/refs/tags/v$pkgver.tar.gz
widelands.desktop
widelands.png
0001-link-libintl.patch
0002-linux-only-enable-backtrace-when-using-glibc.patch
0003-cmake-add-support-for-None-build-type.patch
"
subpackages="$pkgname-doc"
build() {
cmake -B output \
-Wno-dev \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWL_INSTALL_BASEDIR=/usr \
-DWL_INSTALL_DATADIR=/usr/share/widelands \
-G Ninja
ninja -C output
}
check() {
ninja -C output test
}
package() {
DESTDIR="$pkgdir" ninja -C output install
mkdir -p "$pkgdir"/usr/bin
for _exe in widelands wl_create_spritesheet wl_map_object_info wl_map_info; do
mv "$pkgdir/usr/$_exe" "$pkgdir"/usr/bin/
done
mkdir -p "$pkgdir"/usr/share/doc/"$pkgname"
for _file in VERSION ChangeLog CREDITS; do
mv "$pkgdir/usr/$_file" "$pkgdir"/usr/share/doc/"$pkgname"
done
mkdir -p "$pkgdir"/usr/share/licenses/$pkgname
mv "$pkgdir"/usr/COPYING "$pkgdir"/usr/share/licenses/"$pkgname"
install -Dm644 "$srcdir"/$pkgname.png "$pkgdir"/usr/share/pixmaps/$pkgname.png
install -Dm644 "$srcdir"/$pkgname.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop
}
sha512sums="
1092750944a8669682097dfbd2b578cdb8fab377f32cb81ce8d85b9d9b2e8ae8c4c73500c0a89be649b360fd7e086e19595eba37cecb8d64679e46f7da13e46e widelands-1.0.tar.gz
9100b2430ee195f17e80e6096c89450792bc97d235b4c3fd596f6bef6d08ea6cbd5d722d8dbc48280663808a8ed56c496681581e195e443208f819c2919ba102 widelands.desktop
f7db9d7584ec8431f2f1857baddeb32cd3ae182343e7f0369e61fb444514bd9c2e6a3931ae34f24cc994840dffbbe4451f33845798f3d582f41b31f451b261ac widelands.png
645bae9804dab9a372176b070797c51a6720cb7372e786b3eab868fada63c7b7ddf6815b687886267d13cfe90c0ecf7516e44b3f5c921a0024c1a30e0fb87344 0001-link-libintl.patch
f0ead2f77191621c5b46c90884f5b1495f8d4ff8cbf2acfc31e2f9586f3358a96ce3eea410f9ed9f8017b12ee856f5224b77a7b1f12e8cf1c04a044b57f1c6c3 0002-linux-only-enable-backtrace-when-using-glibc.patch
4950c303231e675d85ec304858ce59f8c383ac9e38ec7df11444941421585479a21596fc23dd374c22386255014957a27e5e7508c67f00dedde147a8e2bf4e1a 0003-cmake-add-support-for-None-build-type.patch
"
[Desktop Entry]
Name=Widelands
GenericName=Widelands
Comment=Realtime strategy game
Icon=widelands
# force glx, https://github.com/widelands/widelands/issues/4958
Exec=env SDL_VIDEODRIVER=x11 widelands
Type=Application
Categories=Game;StrategyGame;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment