Compare commits

..

No commits in common. "rawhide" and "f27" have entirely different histories.

12 changed files with 81 additions and 657 deletions

9
.gitignore vendored
View file

@ -4,12 +4,3 @@ Widelands-Build14-src.7z
/widelands-build17-src.tar.bz2
/widelands-build18-src.tar.bz2
/widelands-build19-src-gcc7.tar.bz2
/widelands-build20.tar.bz2
/widelands-build21.tar.gz
/widelands-1.0.tar.gz
/widelands-1.0.tar.gz.asc
/widelands-1.1.tar.gz
/widelands-1.2.tar.gz
/widelands-1.2.1.tar.gz
/widelands-1.3.tar.gz
/widelands-1.3.1.tar.gz

View file

@ -1 +1 @@
SHA512 (widelands-1.3.1.tar.gz) = 47d72aabac1dc873dd6f6fa86ba0bf2b0dd13c298f10df89b47654397ab5b3a55c06d4e8cf6a0da807e3402a7bff0839b7b0b18a6f8611ee83d252b8e0d61f15
SHA512 (widelands-build19-src-gcc7.tar.bz2) = 3c7cd5e166ce68aaef2a53a64579826ad6c17986154c5f03787ef6dd526b7e64fa763b14fd7002bc0abd6353d2adacd564f090530486cfbf1ebbf54930852bf9

View file

@ -1,21 +0,0 @@
diff -uNr widelands-1.2.orig/src/ui_basic/box.cc widelands-1.2/src/ui_basic/box.cc
--- widelands-1.2.orig/src/ui_basic/box.cc 2024-03-28 11:12:05.000000000 +0100
+++ widelands-1.2/src/ui_basic/box.cc 2024-08-25 12:02:46.697000000 +0200
@@ -180,7 +180,7 @@
int infspace_count = 0;
for (size_t idx = 0; idx < items_.size(); ++idx) {
- int depth;
+ int depth = 0;
int unused = 0;
get_item_desired_size(idx, &depth, &unused);
totaldepth += depth;
@@ -274,7 +274,7 @@
// Do not modify hidden items
continue;
}
- int depth;
+ int depth = 0;
int breadth = 0;
get_item_size(idx, &depth, &breadth);

View file

@ -1,11 +0,0 @@
diff -uNr widelands.orig/src/base/test/CMakeLists.txt widelands/src/base/test/CMakeLists.txt
--- widelands.orig/src/base/test/CMakeLists.txt 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/base/test/CMakeLists.txt 2025-02-16 12:21:07.246000000 +0100
@@ -7,7 +7,6 @@
test_times.cc
test_time_string.cc
test_utf8.cc
- test_string.cc
DEPENDS
base
base_crypto

View file

@ -1,12 +0,0 @@
diff -uNr widelands-1.3.orig/CMakeLists.txt widelands-1.3/CMakeLists.txt
--- widelands-1.3.orig/CMakeLists.txt 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/CMakeLists.txt 2025-12-21 13:08:24.503000000 +0100
@@ -292,7 +292,7 @@
wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-disabled-macro-expansion")
endif()
elseif(MSVC)
- wl_add_flag(WL_GENERIC_CXX_FLAGS "/std:c++17")
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "/std:gnu++17")
wl_add_flag(WL_GENERIC_C_LIBRARY_FLAGS "/std:c11")
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/
# Disabled warnings that are overly verbose right now or just do not make sense.

View file

@ -1,14 +0,0 @@
diff -uNr widelands-1.3.orig/cmake/WlFunctions.cmake widelands-1.3/cmake/WlFunctions.cmake
--- widelands-1.3.orig/cmake/WlFunctions.cmake 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/cmake/WlFunctions.cmake 2025-12-21 13:32:50.138000000 +0100
@@ -93,7 +93,9 @@
wl_include_directories(${NAME} ${CMAKE_SOURCE_DIR}/src)
wl_include_directories(${NAME} ${CMAKE_BINARY_DIR}/src)
if(MINIZIP_STATIC_LIBRARIES)
- wl_include_directories(${NAME} ${MINIZIP_INCLUDE_DIRS})
+ if (MINIZIP_INCLUDE_DIRS)
+ wl_include_directories(${NAME} ${MINIZIP_INCLUDE_DIRS})
+ endif()
target_compile_options(${NAME} PUBLIC ${MINIZIP_CFLAGS})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
include(CheckCXXCompilerFlag)

View file

@ -1,180 +0,0 @@
diff -uNr widelands-1.3.orig/src/commands/cmd_queue.h widelands-1.3/src/commands/cmd_queue.h
--- widelands-1.3.orig/src/commands/cmd_queue.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/commands/cmd_queue.h 2025-12-21 13:22:54.968000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_COMMANDS_CMD_QUEUE_H
#define WL_COMMANDS_CMD_QUEUE_H
+#include <cstdint>
#include <queue>
#include "commands/command.h"
diff -uNr widelands-1.3.orig/src/io/filesystem/zip_filesystem.h widelands-1.3/src/io/filesystem/zip_filesystem.h
--- widelands-1.3.orig/src/io/filesystem/zip_filesystem.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/io/filesystem/zip_filesystem.h 2025-12-21 13:21:40.240000000 +0100
@@ -23,6 +23,7 @@
#include <unzip.h>
#include <zip.h>
+#include <zlib.h>
#include "io/filesystem/filesystem.h"
#include "io/streamread.h"
diff -uNr widelands-1.3.orig/src/logic/addons.h widelands-1.3/src/logic/addons.h
--- widelands-1.3.orig/src/logic/addons.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/addons.h 2025-12-21 13:22:00.559000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_ADDONS_H
#define WL_LOGIC_ADDONS_H
+#include <cstdint>
#include <ctime>
#include <functional>
#include <map>
diff -uNr widelands-1.3.orig/src/logic/ai_dna_handler.h widelands-1.3/src/logic/ai_dna_handler.h
--- widelands-1.3.orig/src/logic/ai_dna_handler.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/ai_dna_handler.h 2025-12-21 13:22:21.467000000 +0100
@@ -19,6 +19,8 @@
#ifndef WL_LOGIC_AI_DNA_HANDLER_H
#define WL_LOGIC_AI_DNA_HANDLER_H
+#include <cstdint>
+
#include "logic/player.h"
namespace Widelands {
diff -uNr widelands-1.3.orig/src/logic/game_controller.h widelands-1.3/src/logic/game_controller.h
--- widelands-1.3.orig/src/logic/game_controller.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/game_controller.h 2025-12-21 13:23:11.328000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_GAME_CONTROLLER_H
#define WL_LOGIC_GAME_CONTROLLER_H
+#include <cstdint>
#include <string>
#include "base/times.h"
diff -uNr widelands-1.3.orig/src/logic/game.h widelands-1.3/src/logic/game.h
--- widelands-1.3.orig/src/logic/game.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/game.h 2025-12-21 13:23:32.586000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_GAME_H
#define WL_LOGIC_GAME_H
+#include <cstdint>
#include <memory>
#include "base/crypto.h"
diff -uNr widelands-1.3.orig/src/logic/game_settings.h widelands-1.3/src/logic/game_settings.h
--- widelands-1.3.orig/src/logic/game_settings.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/game_settings.h 2025-12-21 13:23:53.751000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_GAME_SETTINGS_H
#define WL_LOGIC_GAME_SETTINGS_H
+#include <cstdint>
#include <memory>
#include <string>
diff -uNr widelands-1.3.orig/src/logic/mapastar.h widelands-1.3/src/logic/mapastar.h
--- widelands-1.3.orig/src/logic/mapastar.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/mapastar.h 2025-12-21 13:24:10.835000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_MAPASTAR_H
#define WL_LOGIC_MAPASTAR_H
+#include <cstdint>
#include <memory>
#include "logic/map.h"
diff -uNr widelands-1.3.orig/src/logic/map.h widelands-1.3/src/logic/map.h
--- widelands-1.3.orig/src/logic/map.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/map.h 2025-12-21 13:24:25.286000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_MAP_H
#define WL_LOGIC_MAP_H
+#include <cstdint>
#include <map>
#include <memory>
#include <optional>
diff -uNr widelands-1.3.orig/src/logic/maphollowregion.h widelands-1.3/src/logic/maphollowregion.h
--- widelands-1.3.orig/src/logic/maphollowregion.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/maphollowregion.h 2025-12-21 13:24:38.671000000 +0100
@@ -19,6 +19,8 @@
#ifndef WL_LOGIC_MAPHOLLOWREGION_H
#define WL_LOGIC_MAPHOLLOWREGION_H
+#include <cstdint>
+
#include "logic/map.h"
namespace Widelands {
diff -uNr widelands-1.3.orig/src/logic/message_queue.h widelands-1.3/src/logic/message_queue.h
--- widelands-1.3.orig/src/logic/message_queue.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/message_queue.h 2025-12-21 13:24:53.770000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_MESSAGE_QUEUE_H
#define WL_LOGIC_MESSAGE_QUEUE_H
+#include <cstdint>
#include <cassert>
#include <memory>
diff -uNr widelands-1.3.orig/src/logic/pathfield.h widelands-1.3/src/logic/pathfield.h
--- widelands-1.3.orig/src/logic/pathfield.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/pathfield.h 2025-12-21 13:25:10.868000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_PATHFIELD_H
#define WL_LOGIC_PATHFIELD_H
+#include <cstdint>
#include <memory>
#include "logic/cookie_priority_queue.h"
diff -uNr widelands-1.3.orig/src/logic/player.h widelands-1.3/src/logic/player.h
--- widelands-1.3.orig/src/logic/player.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/player.h 2025-12-21 13:27:20.228000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_PLAYER_H
#define WL_LOGIC_PLAYER_H
+#include <cstdint>
#include <atomic>
#include <memory>
#include <set>
diff -uNr widelands-1.3.orig/src/logic/replay_game_controller.h widelands-1.3/src/logic/replay_game_controller.h
--- widelands-1.3.orig/src/logic/replay_game_controller.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/replay_game_controller.h 2025-12-21 13:28:10.806000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_REPLAY_GAME_CONTROLLER_H
#define WL_LOGIC_REPLAY_GAME_CONTROLLER_H
+#include <cstdint>
#include <memory>
#include "commands/command.h"
diff -uNr widelands-1.3.orig/src/logic/single_player_game_controller.h widelands-1.3/src/logic/single_player_game_controller.h
--- widelands-1.3.orig/src/logic/single_player_game_controller.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/single_player_game_controller.h 2025-12-21 13:28:30.527000000 +0100
@@ -19,6 +19,8 @@
#ifndef WL_LOGIC_SINGLE_PLAYER_GAME_CONTROLLER_H
#define WL_LOGIC_SINGLE_PLAYER_GAME_CONTROLLER_H
+#include <cstdint>
+
#include "ai/computer_player.h"
#include "logic/game_controller.h"
diff -uNr widelands-1.3.orig/src/logic/single_player_game_settings_provider.h widelands-1.3/src/logic/single_player_game_settings_provider.h
--- widelands-1.3.orig/src/logic/single_player_game_settings_provider.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/single_player_game_settings_provider.h 2025-12-21 13:28:46.109000000 +0100
@@ -19,6 +19,8 @@
#ifndef WL_LOGIC_SINGLE_PLAYER_GAME_SETTINGS_PROVIDER_H
#define WL_LOGIC_SINGLE_PLAYER_GAME_SETTINGS_PROVIDER_H
+#include <cstdint>
+
#include "logic/game_settings.h"
/**

View file

@ -1,29 +0,0 @@
diff -uNr widelands-1.3.orig/src/logic/map_objects/tribes/requirements.h widelands-1.3/src/logic/map_objects/tribes/requirements.h
--- widelands-1.3.orig/src/logic/map_objects/tribes/requirements.h 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/logic/map_objects/tribes/requirements.h 2025-12-21 13:36:41.437000000 +0100
@@ -20,6 +20,7 @@
#define WL_LOGIC_MAP_OBJECTS_TRIBES_REQUIREMENTS_H
#include <climits>
+#include <cstdint>
#include <map>
#include <memory>
#include <vector>
diff -uNr widelands-1.3.orig/src/third_party/eris/eris.c widelands-1.3/src/third_party/eris/eris.c
--- widelands-1.3.orig/src/third_party/eris/eris.c 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/third_party/eris/eris.c 2025-12-21 13:37:22.685000000 +0100
@@ -27,13 +27,7 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
-
-/* Not using stdbool because Visual Studio lives in the past... */
-#ifndef __cplusplus
-typedef int bool;
-#define false 0
-#define true 1
-#endif
+#include <stdbool.h>
/* Mark us as part of the Lua core to get access to what we need. */
#define LUA_CORE

View file

@ -1,47 +0,0 @@
diff -uNr widelands-1.3.orig/src/graphic/text/test/render_richtext.cc widelands-1.3/src/graphic/text/test/render_richtext.cc
--- widelands-1.3.orig/src/graphic/text/test/render_richtext.cc 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/graphic/text/test/render_richtext.cc 2025-12-21 13:16:33.279000000 +0100
@@ -114,6 +114,9 @@
if (parse_arguments(argc, argv, &w, outname, inname, allowed_tags))
return 0;
+ // GLEW only supports glx atm, force use of X11 even under Wayland
+ // https://github.com/nigels-com/glew/issues/172
+ setenv("SDL_VIDEODRIVER", "x11", 0);
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
std::cerr << "SDLInit did not succeed: " << SDL_GetError() << std::endl;
return 1;
diff -uNr widelands-1.3.orig/src/website/website_common.cc widelands-1.3/src/website/website_common.cc
--- widelands-1.3.orig/src/website/website_common.cc 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/website/website_common.cc 2025-12-21 13:17:16.715000000 +0100
@@ -18,6 +18,7 @@
#include "website/website_common.h"
+#include <cstdlib>
#include <SDL.h>
#include "base/i18n.h"
@@ -33,6 +34,9 @@
set_initializer_thread();
g_verbose = true;
+ // GLEW only supports glx atm, force use of X11 even under Wayland
+ // https://github.com/nigels-com/glew/issues/172
+ setenv("SDL_VIDEODRIVER", "x11", 0);
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
// We sometimes run into a missing video driver in our CI environment, so we exit 0 to prevent
// too frequent failures
diff -uNr widelands-1.3.orig/src/wlapplication.cc widelands-1.3/src/wlapplication.cc
--- widelands-1.3.orig/src/wlapplication.cc 2025-12-18 19:19:33.000000000 +0100
+++ widelands-1.3/src/wlapplication.cc 2025-12-21 13:17:48.848000000 +0100
@@ -401,6 +401,9 @@
#endif
// Start the SDL core
+ // GLEW only supports glx atm, force use of X11 even under Wayland
+ // https://github.com/nigels-com/glew/issues/172
+ setenv("SDL_VIDEODRIVER", "x11", 0);
if (SDL_Init(SDL_INIT_VIDEO) == -1) {
// We sometimes run into a missing video driver in our CI environment, so we exit 0 to prevent
// too frequent failures

View file

@ -0,0 +1,12 @@
diff -up widelands-build19-src-gcc7/CMakeLists.txt.ppc64le widelands-build19-src-gcc7/CMakeLists.txt
--- widelands-build19-src-gcc7/CMakeLists.txt.ppc64le 2017-06-20 10:33:11.000000000 +0200
+++ widelands-build19-src-gcc7/CMakeLists.txt 2018-02-20 23:01:39.680715037 +0100
@@ -102,7 +102,7 @@ else()
message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()
-wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=gnu++11")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Weverything")

View file

@ -1,4 +0,0 @@
# The symlinks to system fonts are dangling when only looking at this pkg
addFilter("dangling-symlink")
# Ignore new useless rpmlint warning
addFilter("files-duplicate")

View file

@ -1,51 +1,40 @@
# The game contains a copy of these fonts, we replace these with symlinks to the system versions of these fonts
%global fonts font(amiri) font(dejavusans) font(dejavusansmono) font(dejavuserif) font(widelands) font(gargi) font(wenquanyimicrohei) font(frankruehlclm)
%global buildno 19
%global buildid build%{buildno}
Name: widelands
Version: 1.3.1
Release: 3%{?dist}
Version: 0
Release: 0.62.%{buildid}%{?dist}
Summary: Open source realtime-strategy game
# Automatically converted from old format: GPLv2+ - review is highly recommended.
License: GPL-2.0-or-later
Group: Amusements/Games
License: GPLv2+
URL: http://www.widelands.org
Source0: https://github.com/widelands/widelands/archive/v%{version}/%{name}-%{version}.tar.gz
# gnu++11 fix in CMakeLists.txt for PPC64 little-endian
Patch0: widelands-1.3-build19-ppc64le.patch
# Fix failures on s390x due to uninitialized variables
Patch1: widelands-1.2-build20-gcc10.patch
# widelands uses glew which atm is hardcoded to glx, see e.g.:
# https://github.com/nigels-com/glew/issues/172
# This can be fixed cleaner by switching to glewContextInit once we are
# at glew 2.3, or maybe backport:
# https://github.com/nigels-com/glew/commit/715afa0ff56c0eb12c23938b80aa2813daa10d81
Patch2: widelands-1.3-make-sdl2-use-x11.patch
Patch3: widelands-1.3-gcc13.patch
Patch4: widelands-1.3-f37-sys-minizip-buildfix.patch
Patch5: widelands-1.2.1-disable-some-tests.patch
Patch6: widelands-1.3-gcc15.patch
Source0: https://launchpad.net/widelands/%{buildid}/%{buildid}/+download/widelands-%{buildid}-src-gcc7.tar.bz2
Patch0: widelands-build19-ppc64le.patch
BuildRequires: asio-devel
BuildRequires: SDL2-devel
BuildRequires: SDL2_image-devel
BuildRequires: SDL2_mixer-devel
BuildRequires: SDL2_net-devel
BuildRequires: SDL2_ttf-devel
BuildRequires: boost-devel >= 1.48.0
BuildRequires: cmake
BuildRequires: ctags
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: glew-devel
BuildRequires: libpng-devel >= 1.6.0
BuildRequires: libcurl-devel
BuildRequires: minizip-ng-compat-devel
BuildRequires: python3
# For the %%build part generating the symlinks
BuildRequires: fontconfig %{fonts}
BuildRequires: libpng-devel
Requires: hicolor-icon-theme
Requires: %{fonts}
# The game contains a copy of these fonts, we replaces these with system fonts
Requires: amiri-fonts
Requires: dejavu-serif-fonts
Requires: dejavu-sans-fonts
Requires: dejavu-sans-mono-fonts
Requires: drehatlas-widelands-fonts
Requires: lklug-fonts
Requires: wqy-microhei-fonts
%description
Widelands is an open source (GPLed), realtime-strategy game, using SDL and
@ -55,334 +44,84 @@ perhaps will have a thought, what Widelands is all about.
%prep
%setup -q -n widelands
%patch -P0 -p1
%patch -P1 -p1
%patch -P2 -p1
%patch -P3 -p1
%patch -P4 -p1
%ifarch s390x
%patch -P5 -p1
%setup -q -n widelands-%{buildid}-src-gcc7
%ifarch ppc64le
%patch0 -p1 -b .ppc64le
%endif
%patch -P6 -p1
%build
mkdir build
pushd build
# We need to set CMAKE_INCLUDE_PATH to /usr for FindLua51.cmake
%cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_bindir} \
-DWL_INSTALL_BASEDIR=%{_prefix}/share/%{name} \
-DWL_INSTALL_DATADIR=%{_prefix}/share/%{name} \
-DOPTION_BUILD_WEBSITE_TOOLS=OFF \
%{nil}
%cmake_build
..
make %{?_smp_mflags}
popd
%install
%cmake_install
pushd build
%make_install
popd
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mv $RPM_BUILD_ROOT%{_prefix}/games/%{name} \
$RPM_BUILD_ROOT%{_bindir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
ln -s /usr/share/%{name}/images/logos/wl-logo-64.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
# Validate desktop file (provided by upstream)
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
cat > widelands.desktop <<EOF
[Desktop Entry]
Type=Application
Name=Widelands
GenericName=Realtime Strategy Game
Comment=Build a growing settlement and rule the world
Icon=widelands
Exec=widelands
Categories=Game;StrategyGame;
EOF
# Validate appdata (provided by upstream)
appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/*.metainfo.xml
desktop-file-install \
--dir=$RPM_BUILD_ROOT%{_datadir}/applications/ %{name}.desktop
pushd $RPM_BUILD_ROOT
# Replace fonts with system fonts. We used to have symlinks directly from
# i18n/fonts/<widelands-name> to the /usr/share/fonts/<system-font-name> dir
# but with recent font packaging changes this no longer works because e.g.
# Widelands expects all DejaVu fonts in a single dir, where as now there are
# separate /usr/share/fonts dirs for the sans, sans-mono and serif versions.
#
# Replacing the symlinks at the dir level with keeping the
# i18n/fonts/<widelands-name> directory and then putting symlinks to the
# invidual font-files inside that directory does not work, because on upgrade
# that would mean replacing a symlink with a dir which breaks horribly.
# So for those cases where we used to have a symlink, we create a new dir
# under i18n/fonts with a different name, with symlinks to the individual
# files in that dir; and then point the symlink to this new dir, to avoid
# the replace a symlink with a dir problem.
# We don't want this development tool / utility
rm usr/bin/wl_render_richtext
# Replace fonts with system fonts
rm -r usr/share/%{name}/i18n/fonts/amiri
mkdir usr/share/%{name}/i18n/fonts/amiri-fonts
ln -s amiri-fonts usr/share/%{name}/i18n/fonts/amiri
ln -s $(fc-match -f "%{file}" "amiri") \
usr/share/%{name}/i18n/fonts/amiri-fonts/amiri-regular.ttf
ln -s $(fc-match -f "%{file}" "amiri:bold") \
usr/share/%{name}/i18n/fonts/amiri-fonts/amiri-bold.ttf
ln -s $(fc-match -f "%{file}" "amiri:italic") \
usr/share/%{name}/i18n/fonts/amiri-fonts/amiri-slanted.ttf
ln -s $(fc-match -f "%{file}" "amiri:bold:italic") \
usr/share/%{name}/i18n/fonts/amiri-fonts/amiri-boldslanted.ttf
rm -r usr/share/%{name}/i18n/fonts/DejaVu
mkdir usr/share/%{name}/i18n/fonts/dejavu-fonts
ln -s dejavu-fonts usr/share/%{name}/i18n/fonts/DejaVu
ln -s $(fc-match -f "%{file}" "sans") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSans.ttf
ln -s $(fc-match -f "%{file}" "sans:bold") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSans-Bold.ttf
ln -s $(fc-match -f "%{file}" "sans:italic") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSans-Oblique.ttf
ln -s $(fc-match -f "%{file}" "sans:bold:italic") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSans-BoldOblique.ttf
ln -s $(fc-match -f "%{file}" "serif") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSerif.ttf
ln -s $(fc-match -f "%{file}" "serif:bold") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSerif-Bold.ttf
ln -s $(fc-match -f "%{file}" "serif:italic") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSerif-Italic.ttf
ln -s $(fc-match -f "%{file}" "serif:bold:italic") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSerif-BoldItalic.ttf
ln -s $(fc-match -f "%{file}" "monospace") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansMono.ttf
ln -s $(fc-match -f "%{file}" "monospace:bold") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansMono-Bold.ttf
ln -s $(fc-match -f "%{file}" "monospace:italic") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansMono-Oblique.ttf
ln -s $(fc-match -f "%{file}" "monospace:bold:italic") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansMono-BoldOblique.ttf
ln -s $(fc-match -f "%{file}" "DejaVuSansCondensed") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansCondensed.ttf
ln -s $(fc-match -f "%{file}" "DejaVuSansCondensed:bold") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansCondensed-Bold.ttf
ln -s $(fc-match -f "%{file}" "DejaVuSansCondensed:italic") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansCondensed-Oblique.ttf
ln -s $(fc-match -f "%{file}" "DejaVuSansCondensed:bold:italic") \
usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansCondensed-BoldOblique.ttf
# Chinese fonts
rm -r usr/share/%{name}/i18n/fonts/MicroHei
mkdir usr/share/%{name}/i18n/fonts/wqy-microhei-fonts
ln -s wqy-microhei-fonts usr/share/%{name}/i18n/fonts/MicroHei
ln -s $(fc-match -f "%{file}" "wenquanyimicrohei") \
usr/share/%{name}/i18n/fonts/wqy-microhei-fonts/wqy-microhei.ttc
### IMPORTANT NOTE ###
# The fonts below never had a symlink to another font-dir shipped, so here we need
# to keep the usr/share/%%{name}/i18n/fonts/foo dir, rather then replace it with a link
# Devanagari (Hindu) fonts
# Fedora doesn't ship Nakula, but other Devanagari font sets.
# Gargi is a TTF font set and should be compatible.
rm -r usr/share/%{name}/i18n/fonts/Nakula/*
ln -s $(fc-match -f "%{file}" "gargi") \
usr/share/%{name}/i18n/fonts/Nakula/nakula.ttf
# Hebrew fonts
rm -r usr/share/%{name}/i18n/fonts/Culmus/*
ln -s $(fc-match -f "%{file}" "frankruehlclm:bold") \
usr/share/%{name}/i18n/fonts/Culmus/TaameyFrankCLM-Bold.ttf
ln -s $(fc-match -f "%{file}" "frankruehlclm:bold:italic") \
usr/share/%{name}/i18n/fonts/Culmus/TaameyFrankCLM-BoldOblique.ttf
ln -s $(fc-match -f "%{file}" "frankruehlclm:medium") \
usr/share/%{name}/i18n/fonts/Culmus/TaameyFrankCLM-Medium.ttf
ln -s $(fc-match -f "%{file}" "frankruehlclm:medium:italic") \
usr/share/%{name}/i18n/fonts/Culmus/TaameyFrankCLM-MediumOblique.ttf
# In-game Latin fonts - shipped as a separate package
rm -r usr/share/%{name}/i18n/fonts/Sinhala
rm -r usr/share/%{name}/i18n/fonts/Widelands/*
ln -s $(fc-match -f "%{file}" "widelands") \
usr/share/%{name}/i18n/fonts/Widelands/Widelands.ttf
ln -s /usr/share/fonts/amiri usr/share/%{name}/i18n/fonts/amiri
ln -s /usr/share/fonts/dejavu usr/share/%{name}/i18n/fonts/DejaVu
ln -s /usr/share/fonts/wqy-microhei usr/share/%{name}/i18n/fonts/MicroHei
ln -s /usr/share/fonts/lklug usr/share/%{name}/i18n/fonts/Sinhala
ln -s /usr/share/fonts/drehatlas-widelands/Widelands.otf usr/share/%{name}/i18n/fonts/Widelands/Widelands.ttf
# Scripting magic to add proper %%lang() markings to the locale files
find usr/share/widelands/i18n/translations/ -maxdepth 2 -type f -name \*_\*.po | sed -n 's#\(usr/share/widelands/i18n/translations/.*/\([^/]*\)_[^/]*\.po\)#%lang(\2) /\1#p' > %{_builddir}/%{?buildsubdir}/%{name}.files
find usr/share/widelands/i18n/translations/ -maxdepth 2 -type f -name \*.po -and ! -name "*_*.po" | sed -n -e 's#\(usr/share/widelands/i18n/translations/.*/\([^/]\+\)\.po\)#%lang(\2) /\1#p' >> %{_builddir}/%{?buildsubdir}/%{name}.files
find usr/share/widelands/ -mindepth 1 -maxdepth 1 -not -name i18n | sed -n 's#\(usr/share/widelands/*\)#/\1#p' >> %{_builddir}/%{?buildsubdir}/%{name}.files
find usr/share/widelands/locale/ -maxdepth 1 -type d -name \*_\* | sed -n 's#\(usr/share/widelands/locale/\(.*\)_.*\)#%lang(\2) /\1#p' > %{_builddir}/widelands-%{buildid}-src-gcc7/%{name}.files
find usr/share/widelands/locale/ -maxdepth 1 -type d ! -name "*_*" | sed -n -e 's#\(usr/share/widelands/locale/\(.\+\)\)#%lang(\2) /\1#p' >> %{_builddir}/widelands-%{buildid}-src-gcc7/%{name}.files
find usr/share/widelands/ -mindepth 1 -maxdepth 1 -not -name locale | sed -n 's#\(usr/share/widelands/*\)#/\1#p' >> %{_builddir}/widelands-%{buildid}-src-gcc7/%{name}.files
popd
%files -f %{name}.files
%doc ChangeLog CREDITS
%license COPYING
%{_mandir}/man6/widelands.6.gz
%doc ChangeLog COPYING CREDITS
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/*/apps/*.png
%{_metainfodir}/*.metainfo.xml
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/i18n/fonts.lua
%{_datadir}/%{name}/i18n/fonts
%{_datadir}/%{name}/i18n/locales.lua
%{_datadir}/%{name}/i18n/locales/*.json
%{_datadir}/%{name}/i18n/translation_stats.conf
%{_datadir}/%{name}/i18n/translations/*/*.pot
%dir %{_datadir}/%{name}/locale
%changelog
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
* Mon Jun 08 2026 František Zatloukal <fzatlouk@redhat.com> - 1.3.1-2
- Rebuilt for icu 78.3
* Sun Feb 22 2026 Peter Hanecak <hany@hany.sk> - 1.3.1-1
- New upstream release 1.3.1 (rhbz#2440036)
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Sun Dec 21 2025 Peter Hanecak <hany@hany.sk> - 1.3-1
- New upstream release 1.3 (rhbz#2422054)
* Wed Aug 06 2025 František Zatloukal <fzatlouk@redhat.com> - 1.2.1-3
- Rebuilt for icu 77.1
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Sun Feb 16 2025 Peter Hanecak <hany@hany.sk> - 1.2.1-1
- New upstream release 1.2 (rhbz#2322776)
- Generate font file symlinks also for DejaVuSansCondensed (rhbz#2334803)
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sun Dec 08 2024 Pete Walter <pwalter@fedoraproject.org> - 1.2-2
- Rebuild for ICU 76
* Sun Aug 25 2024 Peter Hanecak <hany@hany.sk> - 1.2-1
- New upstream release 1.2 (rhbz#2271240)
* Wed Aug 07 2024 Miroslav Suchý <msuchy@redhat.com> - 1.1-8
- convert license to SPDX
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Wed Jan 31 2024 Pete Walter <pwalter@fedoraproject.org> - 1.1-6
- Rebuild for ICU 74
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Dec 04 2023 Lukas Javorsky <ljavorsk@redhat.com> - 1.1-4
- Rebuilt for minizip-ng transition Fedora change
- Fedora Change: https://fedoraproject.org/wiki/Changes/MinizipNGTransition
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 11 2023 František Zatloukal <fzatlouk@redhat.com> - 1.1-2
- Rebuilt for ICU 73.2
* Mon Mar 27 2023 Hans de Goede <hdegoede@redhat.com> - 1.1-1
- New upstream release 1.1 (rhbz#2135131)
- Fix FTBFS (rhbz#2171759)
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Dec 31 2022 Pete Walter <pwalter@fedoraproject.org> - 1.0-5
- Rebuild for ICU 72
* Sun Aug 14 2022 Hans de Goede <hdegoede@redhat.com> - 1.0-4
- Fix FTBFS (rhbz#2114565)
* Mon Aug 01 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 1.0-3
- Rebuilt for ICU 71.1
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sun Mar 6 2022 Hans de Goede <hdegoede@redhat.com> - 1.0-1
- New upstream release 1.0 (rhbz1974007)
- Fix FTBFS (rhbz2047116)
* Thu Feb 10 2022 Orion Poplawski <orion@nwra.com> - 0-0.89.build21
- Rebuild for glew 2.2
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.88.build21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sat Aug 07 2021 Jonathan Wakely <jwakely@redhat.com> - 0-0.87.build21
- Rebuilt for Boost 1.76
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.86.build21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu May 20 2021 Pete Walter <pwalter@fedoraproject.org> - 0-0.85.build21
- Rebuild for ICU 69
* Mon Apr 19 2021 Hans de Goede <hdegoede@redhat.com> - 0-0.84.build21
- Stop replacing dirs with symlinks this breaks upgrades again (rhbz 1947182)
* Sun Feb 7 2021 Andy Mender <andymenderunix@fedoraproject.org> - 0-0.83.build21
- Unbundle Culmus fonts
- Update to build21
- Clean up patches
- Point Source0 to GitHub release tarballs
- Fix new issues with fonts
- Use appdata and desktop file provided by upstream
- Update records in %%files section
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.82.build20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Jan 22 2021 Jonathan Wakely <jwakely@redhat.com> - 0-0.81.build20
- Rebuilt for Boost 1.75
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.80.build20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jun 03 2020 Jonathan Wakely <jwakely@redhat.com> - 0-0.79.build20
- Rebuilt for Boost 1.73
* Sat May 16 2020 Pete Walter <pwalter@fedoraproject.org> - 0-0.78.build20
- Rebuild for ICU 67
* Thu Mar 19 2020 Hans de Goede <hdegoede@redhat.com> - 0-0.77.build20
- Stop replacing symlinks with dirs this breaks upgrades (rhbz 1806272)
- Use fc-match to generate font file symlinks to future proof the package
against future font file-path or name changes (rhbz 1806272)
* Sat Mar 7 2020 Hans de Goede <hdegoede@redhat.com> - 0-0.76.build20
- Adjust Dejavu font symlinks for dejavu font package path changes
- Fix FTBFS (rhbz#1800251)
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.75.build20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jan 17 2020 Jeff Law <law@redhat.com> - 0-0.74.build20
- Work around false positive uninitialized variable warning from gcc10
* Fri Nov 01 2019 Pete Walter <pwalter@fedoraproject.org> - 0-0.73.build20
- Rebuild for ICU 65
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.72.build20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Jul 14 2019 Hans de Goede <hdegoede@redhat.com> - 0-0.71.build20
- Update to new upstream Build20 release
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.70.build19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jan 25 2019 Jonathan Wakely <jwakely@redhat.com> - 0-0.69.build19
- Rebuilt for Boost 1.69
* Wed Jan 23 2019 Pete Walter <pwalter@fedoraproject.org> - 0-0.68.build19
- Rebuild for ICU 63
* Thu Aug 23 2018 Nicolas Chauvet <kwizart@gmail.com> - 0-0.67.build19
- Rebuilt for glew 2.1.0
* Tue Aug 14 2018 Hans de Goede <hdegoede@redhat.com> - 0-0.66.build19
- Fix FTBFS (rhbz#1606678)
- Add appdata
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.65.build19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jul 10 2018 Pete Walter <pwalter@fedoraproject.org> - 0-0.64.build19
- Rebuild for ICU 62
* Mon Apr 30 2018 Pete Walter <pwalter@fedoraproject.org> - 0-0.63.build19
- Rebuild for ICU 61.1
* Tue Feb 20 2018 Nils Philippsen <nils@tiptoe.de> - 0-0.62.build19
- require gcc, gcc-c++ for building
- FTBFS: build with --std=gnu++11 on ppc64le