Compare commits

...
Sign in to create a new pull request.

7 commits

Author SHA1 Message Date
Fedora Release Engineering
7be6d4532f Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild 2026-07-17 08:48:38 +00:00
František Zatloukal
32ca0a0867 Rebuilt for icu 78.3 2026-06-08 15:15:56 +02:00
Peter Hanecak
da0ace3cc1 New upstream release 1.3.1 (rhbz#2440036) 2026-02-22 13:18:25 +01:00
Fedora Release Engineering
47995133e6 Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-17 20:14:17 +00:00
Peter Hanecak
6d8733dd88 New upstream release 1.3 (rhbz#2422054) 2025-12-21 22:59:59 +01:00
František Zatloukal
edd8a2078c Rebuilt for icu 77.1 2025-08-06 09:58:39 +02:00
Fedora Release Engineering
a559babaaf Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 20:25:15 +00:00
11 changed files with 281 additions and 810 deletions

2
.gitignore vendored
View file

@ -11,3 +11,5 @@ Widelands-Build14-src.7z
/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.2.1.tar.gz) = eb765367e57bab7d016a0e9ad0f5f2e17e31124cb94a149c87a17ce22169509361f408297233e14001e12a8546cfbea879a21a05e47b7f48ba6924ce1a8080e9
SHA512 (widelands-1.3.1.tar.gz) = 47d72aabac1dc873dd6f6fa86ba0bf2b0dd13c298f10df89b47654397ab5b3a55c06d4e8cf6a0da807e3402a7bff0839b7b0b18a6f8611ee83d252b8e0d61f15

View file

@ -1,12 +0,0 @@
diff -uNr widelands-1.2.orig/CMakeLists.txt widelands-1.2/CMakeLists.txt
--- widelands-1.2.orig/CMakeLists.txt 2024-03-28 11:12:05.000000000 +0100
+++ widelands-1.2/CMakeLists.txt 2024-08-25 11:56:53.948000000 +0200
@@ -272,7 +272,7 @@
wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-unsafe-buffer-usage")
endif()
elseif(MSVC)
- wl_add_flag(WL_GENERIC_CXX_FLAGS "/std:c++17")
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "/std:gnu++17")
# 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.
wl_add_flag(WL_COMPILE_DIAGNOSTICS "/wd4244")

View file

@ -1,724 +0,0 @@
diff -uNr widelands.orig/src/io/filesystem/zip_filesystem.h widelands/src/io/filesystem/zip_filesystem.h
--- widelands.orig/src/io/filesystem/zip_filesystem.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/io/filesystem/zip_filesystem.h 2025-02-16 12:16:38.737000000 +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.orig/src/logic/addons.h widelands/src/logic/addons.h
--- widelands.orig/src/logic/addons.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/addons.h 2025-02-16 12:16:38.739000000 +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.orig/src/logic/ai_dna_handler.h widelands/src/logic/ai_dna_handler.h
--- widelands.orig/src/logic/ai_dna_handler.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/ai_dna_handler.h 2025-02-16 12:16:38.739000000 +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.orig/src/logic/cmd_queue.h widelands/src/logic/cmd_queue.h
--- widelands.orig/src/logic/cmd_queue.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/cmd_queue.h 2025-02-16 12:16:38.739000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_CMD_QUEUE_H
#define WL_LOGIC_CMD_QUEUE_H
+#include <cstdint>
#include <queue>
#include "base/times.h"
diff -uNr widelands.orig/src/logic/game_controller.h widelands/src/logic/game_controller.h
--- widelands.orig/src/logic/game_controller.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/game_controller.h 2025-02-16 12:16:38.739000000 +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.orig/src/logic/game.h widelands/src/logic/game.h
--- widelands.orig/src/logic/game.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/game.h 2025-02-16 12:16:38.739000000 +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.orig/src/logic/game.h.orig widelands/src/logic/game.h.orig
--- widelands.orig/src/logic/game.h.orig 1970-01-01 01:00:00.000000000 +0100
+++ widelands/src/logic/game.h.orig 2024-11-12 21:03:25.000000000 +0100
@@ -0,0 +1,529 @@
+/*
+ * Copyright (C) 2002-2024 by the Widelands Development Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef WL_LOGIC_GAME_H
+#define WL_LOGIC_GAME_H
+
+#include <memory>
+
+#include "base/crypto.h"
+#include "base/random.h"
+#include "economy/flag_job.h"
+#include "io/streamwrite.h"
+#include "logic/cmd_queue.h"
+#include "logic/detected_port_space.h"
+#include "logic/editor_game_base.h"
+#include "logic/map_objects/tribes/shipstates.h"
+#include "logic/save_handler.h"
+#include "logic/trade_agreement.h"
+#include "scripting/logic.h"
+
+class InteractivePlayer;
+struct GameSettings;
+class GameController;
+
+namespace Widelands {
+
+/// How often are statistics to be sampled.
+constexpr Duration kStatisticsSampleTime(30 * 1000);
+// See forester_cache_
+constexpr int16_t kInvalidForesterEntry = -1;
+
+constexpr uint32_t kScenarioDifficultyNotSet = 0;
+
+struct Flag;
+struct Path;
+struct PlayerImmovable;
+enum class IslandExploreDirection;
+class PortDock;
+enum class ScoutingDirection;
+struct Ship;
+class TrainingSite;
+#if 0 // TODO(Nordfriese): Re-add training wheels code after v1.0
+class TrainingWheels;
+#endif
+enum class StockPolicy;
+
+enum {
+ gs_notrunning = 0, // game is being prepared
+ gs_running, // game was fully prepared at some point and is now in-game
+ gs_ending
+};
+
+// The entry types that are written to the syncstream
+// The IDs are a number in the higher 4 bits and the length in bytes in the lower 4 bits
+// Keep this synchronized with utils/syncstream/syncexcerpt-to-text.py
+enum SyncEntry : uint8_t {
+ // Used in:
+ // game.cc Game::report_desync()
+ // Parameters:
+ // s32 id of desynced user, -1 when written on client
+ kDesync = 0x14,
+ // map_object.cc CmdDestroyMapObject::execute()
+ // u32 object serial
+ kDestroyObject = 0x24,
+ // economy.cc Economy::process_requests()
+ // u8 request type
+ // u8 request index
+ // u32 target serial
+ kProcessRequests = 0x36,
+ // economy.cc Economy::handle_active_supplies()
+ // u32 assignments size
+ kHandleActiveSupplies = 0x44,
+ // request.cc Request::start_transfer()
+ // u32 target serial
+ // u32 source(?) serial
+ kStartTransfer = 0x58,
+ // cmd_queue.cc CmdQueue::run_queue()
+ // u32 duetime
+ // u32 command id
+ kRunQueue = 0x68,
+ // game.h Game::logic_rand_seed()
+ // u32 random seed
+ kRandomSeed = 0x74,
+ // game.cc Game::logic_rand()
+ // u32 random value
+ kRandom = 0x84,
+ // map_object.cc CmdAct::execute()
+ // u32 object serial
+ // u8 object type (see map_object.h MapObjectType)
+ kCmdAct = 0x95,
+ // battle.cc Battle::Battle()
+ // u32 first soldier serial
+ // u32 second soldier serial
+ kBattle = 0xA8,
+ // bob.cc Bob::set_position()
+ // u32 bob serial
+ // s16 position x
+ // s16 position y
+ kBobSetPosition = 0xB8
+};
+
+class PlayerCommand;
+class ReplayWriter;
+
+/** class Game
+ *
+ * This class manages the entire lifetime of a game session, from creating the
+ * game and setting options, selecting maps to the actual playing phase and the
+ * final statistics screen(s).
+ */
+
+class Game : public EditorGameBase {
+public:
+ struct GeneralStats {
+ std::vector<uint32_t> land_size;
+ std::vector<uint32_t> nr_workers;
+ std::vector<uint32_t> nr_buildings;
+ std::vector<uint32_t> nr_wares;
+ std::vector<uint32_t> productivity;
+ std::vector<uint32_t> nr_casualties;
+ std::vector<uint32_t> nr_kills;
+ std::vector<uint32_t> nr_msites_lost;
+ std::vector<uint32_t> nr_msites_defeated;
+ std::vector<uint32_t> nr_civil_blds_lost;
+ std::vector<uint32_t> nr_civil_blds_defeated;
+ std::vector<uint32_t> miltary_strength;
+ std::vector<uint32_t> nr_ships;
+ std::vector<uint32_t> nr_naval_victories;
+ std::vector<uint32_t> nr_naval_losses;
+
+ std::vector<uint32_t> custom_statistic;
+ };
+ using GeneralStatsVector = std::vector<GeneralStats>;
+
+ friend class CmdQueue; // this class handles the commands
+ friend struct GameClassPacket;
+ friend struct GamePlayerInfoPacket;
+ friend struct GameLoader;
+
+ // TODO(kxq): The lifetime of game-instance is okay for this, but is this the right spot?
+ // TODO(kxq): I should find the place where LUA changes map, and clear this whenever that
+ // happens.
+ // TODO(kxq): When done, the x_check in worker.cc could be removed (or made more rare, and put
+ // under an assert as then mismatch would indicate the presence of a bug).
+ // TODO(k.halfmann): this shoud perhpas better be a map, it will be quite sparse?
+
+ /** Qualitity of terrain for tree planting normalized to int16.
+ *
+ * Indexed by MapIndex. -1 is an ivalid entry. Shared between all tribes (on the same server)
+ * will be cleared when diffrences are detected. Presently, that can only happen if terrain
+ * is changed (lua scripting). The map is sparse, lookups are fast.
+ */
+ std::vector<int16_t> forester_cache_;
+
+ Game();
+ ~Game() override;
+
+ bool is_game() const override {
+ return true;
+ }
+
+ // life cycle
+ void set_game_controller(std::shared_ptr<GameController>);
+ GameController* game_controller();
+ void set_write_replay(bool wr);
+ void set_write_syncstream(bool wr);
+ void save_syncstream(bool save);
+ void init_newgame(const GameSettings&);
+ void init_savegame(const GameSettings&);
+
+ enum class StartGameType { kMap, kSinglePlayerScenario, kMultiPlayerScenario, kSaveGame };
+
+ bool run(StartGameType, const std::string& script_to_run, const std::string& prefix_for_replays);
+
+ // Returns the upcasted lua interface.
+ LuaGameInterface& lua() override;
+
+ // Run a single player scenario directly via --scenario on the cmdline. Will
+ // run the 'script_to_run' after any init scripts of the map.
+ // `list_of_scenarios` is list of this scenario and if applicable
+ // all the subsequent scenarios in the campaign.
+ // Returns the result of run().
+ bool run_splayer_scenario_direct(const std::list<std::string>& list_of_scenarios,
+ const std::string& script_to_run);
+
+ // Run a single player loaded game directly via --loadgame on the cmdline. Will
+ // run the 'script_to_run' directly after the game was loaded.
+ // Returns the result of run().
+ bool run_load_game(const std::string& filename, const std::string& script_to_run);
+
+ bool run_replay(const std::string& filename, const std::string& script_to_run);
+
+#if 0 // TODO(Nordfriese): Re-add training wheels code after v1.0
+ bool acquire_training_wheel_lock(const std::string& objective);
+ void release_training_wheel_lock();
+ void mark_training_wheel_as_solved(const std::string& objective);
+ void skip_training_wheel(const std::string& objective);
+ void run_training_wheel(const std::string& objective, bool force);
+
+ bool training_wheels_wanted() const;
+ std::string active_training_wheel() const;
+#endif
+
+ void postload() override;
+ void postload_addons_before_loading();
+
+ void think() override;
+
+ ReplayWriter* get_replaywriter() {
+ return replaywriter_.get();
+ }
+
+ /**
+ * \return \c true if the game is completely loaded and running (or paused)
+ * or \c false otherwise.
+ */
+ bool is_loaded() const {
+ return state_ == gs_running;
+ }
+
+ void cleanup_for_load() override;
+ void full_cleanup() override;
+
+ // in-game logic
+ const CmdQueue& cmdqueue() const {
+ return cmdqueue_;
+ }
+ CmdQueue& cmdqueue() {
+ return cmdqueue_;
+ }
+ const RNG& rng() const {
+ return rng_;
+ }
+ RNG& rng() {
+ return rng_;
+ }
+
+ uint32_t logic_rand();
+
+ /// Generate a random location within radius from location.
+ Coords random_location(Coords location, uint8_t radius);
+
+ void logic_rand_seed(uint32_t const seed) {
+ rng().seed(seed);
+ syncstream().unsigned_8(SyncEntry::kRandomSeed);
+ syncstream().unsigned_32(seed);
+ }
+
+ StreamWrite& syncstream();
+ void report_sync_request();
+ void report_desync(int32_t playernumber);
+ crypto::MD5Checksum get_sync_hash() const;
+
+ void enqueue_command(Command*);
+
+ void send_player_command(Widelands::PlayerCommand*);
+
+ void send_player_bulldoze(PlayerImmovable&, bool recurse = false);
+ void send_player_dismantle(PlayerImmovable&, bool keep_wares);
+ void send_player_build(int32_t, const Coords&, DescriptionIndex);
+ void send_player_build_flag(int32_t, const Coords&);
+ void send_player_build_road(int32_t, Path&);
+ void send_player_build_waterway(int32_t, Path&);
+ void send_player_flagaction(Flag&, FlagJob::Type);
+ void send_player_start_stop_building(Building&);
+ void send_player_toggle_infinite_production(Building&);
+ void send_player_set_soldier_preference(MapObject&, SoldierPreference preference);
+ void send_player_start_or_cancel_expedition(Building&);
+ void send_player_expedition_config(PortDock&, WareWorker, DescriptionIndex, bool);
+
+ void send_player_enhance_building(Building&, DescriptionIndex, bool keep_wares);
+ void send_player_evict_worker(Worker&);
+ void send_player_set_stock_policy(Building&, WareWorker, DescriptionIndex, StockPolicy);
+ void send_player_set_ware_priority(
+ PlayerImmovable&, WareWorker, DescriptionIndex, const WarePriority&, bool is_cs = false);
+ void send_player_set_input_max_fill(
+ PlayerImmovable&, DescriptionIndex index, WareWorker type, uint32_t, bool is_cs = false);
+ void send_player_change_training_options(TrainingSite&, TrainingAttribute, int32_t);
+ void send_player_drop_soldier(MapObject&, int32_t);
+ void send_player_change_soldier_capacity(Building&, int32_t);
+ void send_player_enemyflagaction(const Flag&,
+ PlayerNumber,
+ const std::vector<Serial>&,
+ bool allow_conquer);
+ void send_player_mark_object_for_removal(PlayerNumber, Immovable&, bool);
+
+ void send_player_ship_scouting_direction(const Ship& ship, WalkingDir direction);
+ void send_player_ship_construct_port(const Ship& ship, Coords coords);
+ void send_player_ship_explore_island(const Ship& ship, IslandExploreDirection direction);
+ void send_player_ship_set_destination(const Ship& ship, const MapObject* dest);
+ void send_player_ship_set_destination(const Ship& ship, const DetectedPortSpace& dest);
+ void send_player_sink_ship(const Ship& ship);
+ void send_player_refit_ship(const Ship& ship, ShipType t);
+ void send_player_warship_command(const Ship& ship,
+ WarshipCommand cmd,
+ const std::vector<uint32_t>& parameters);
+ void send_player_cancel_expedition_ship(const Ship&);
+ void send_player_propose_trade(const Trade& trade);
+ void send_player_toggle_mute(const Building&, bool all);
+ void send_player_diplomacy(PlayerNumber, DiplomacyAction, PlayerNumber);
+ void send_player_pinned_note(
+ PlayerNumber p, Coords pos, const std::string& text, const RGBColor& rgb, bool del);
+ void send_player_ship_port_name(PlayerNumber p, Serial s, const std::string& name);
+ void send_player_fleet_targets(PlayerNumber p, Serial i, Quantity q);
+
+ InteractivePlayer* get_ipl();
+ const InteractivePlayer* get_ipl() const;
+
+ SaveHandler& save_handler() {
+ return savehandler_;
+ }
+
+ uint32_t get_scenario_difficulty() const {
+ return scenario_difficulty_;
+ }
+ void set_scenario_difficulty(uint32_t d) {
+ assert(scenario_difficulty_ == kScenarioDifficultyNotSet);
+ assert(d != kScenarioDifficultyNotSet);
+ scenario_difficulty_ = d;
+ }
+
+ // Statistics
+ const GeneralStatsVector& get_general_statistics() const {
+ return general_stats_;
+ }
+
+ void read_statistics(FileRead& fr, uint16_t packet_version);
+ void write_statistics(FileWrite& fw);
+
+ void sample_statistics();
+
+ const std::string& get_win_condition_displayname() const;
+ void set_win_condition_displayname(const std::string& name);
+ int32_t get_win_condition_duration() const;
+ void set_win_condition_duration(int32_t);
+
+ bool is_replay() const {
+ return !replay_filename_.empty();
+ }
+ const std::string& replay_filename() const {
+ assert(is_replay());
+ return replay_filename_;
+ }
+
+ bool is_ai_training_mode() const {
+ return ai_training_mode_;
+ }
+
+ bool is_auto_speed() const {
+ return auto_speed_;
+ }
+
+ void set_ai_training_mode(bool);
+
+ void set_auto_speed(bool);
+
+ /**
+ * Cause the game to proceed with this file directly after the current game ends.
+ * A .wgf file will be loaded as a singleplayer savegame this way;
+ * a map file will be loaded as a singleplayer scenario.
+ */
+ void set_next_game_to_load(const std::string& file);
+
+ const std::list<std::string>& list_of_scenarios() const {
+ return list_of_scenarios_;
+ }
+
+ // TODO(sirver,trading): document these functions once the interface settles.
+ int propose_trade(const Trade& trade);
+ void accept_trade(int trade_id);
+ void cancel_trade(int trade_id);
+
+ struct PendingDiplomacyAction {
+ PlayerNumber sender; ///< The player who initiated the action.
+ DiplomacyAction action; ///< The action to perform.
+ PlayerNumber other; ///< The other player affected, if any.
+
+ PendingDiplomacyAction(PlayerNumber p1, DiplomacyAction a, PlayerNumber p2)
+ : sender(p1), action(a), other(p2) {
+ }
+
+ inline bool operator==(const PendingDiplomacyAction& pda) const {
+ return sender == pda.sender && action == pda.action && other == pda.other;
+ }
+ };
+ const std::list<PendingDiplomacyAction>& pending_diplomacy_actions() const {
+ return pending_diplomacy_actions_;
+ }
+ std::list<PendingDiplomacyAction>& pending_diplomacy_actions() {
+ return pending_diplomacy_actions_;
+ }
+
+ [[nodiscard]] bool diplomacy_allowed() const {
+ return diplomacy_allowed_;
+ }
+ void set_diplomacy_allowed(bool allow) {
+ diplomacy_allowed_ = allow;
+ }
+
+ [[nodiscard]] bool naval_warfare_allowed() const {
+ return naval_warfare_allowed_;
+ }
+ void set_naval_warfare_allowed(bool allow) {
+ naval_warfare_allowed_ = allow;
+ }
+
+private:
+ bool did_postload_addons_before_loading_{false};
+
+ void sync_reset();
+
+ crypto::MD5Checksummer synchash_;
+
+ struct SyncWrapper : public StreamWrite {
+ SyncWrapper(Game& game, crypto::MD5Checksummer& target) : game_(game), target_(target) {
+ }
+
+ ~SyncWrapper() override;
+
+ /// Start dumping the entire syncstream into a file.
+ ///
+ /// Note that this file is deleted at the end of the game, unless
+ /// \ref syncstreamsave_ has been set.
+ void start_dump(const std::string& fname);
+
+ void data(void const* data, size_t size) override;
+
+ public:
+ Game& game_;
+ crypto::MD5Checksummer& target_;
+ uint32_t counter_{0U};
+ uint32_t next_diskspacecheck_{0U};
+ std::unique_ptr<StreamWrite> dump_;
+ std::string dumpfname_;
+ bool syncstreamsave_{false};
+ // Use a cyclic buffer for storing parts of the syncstream
+ // Currently used buffer
+ size_t current_excerpt_id_{0U};
+ // (Arbitrary) count of buffers
+ // Syncreports seem to be requested from the network clients every game second so this
+ // buffer should be big enough to store the last 32 seconds of the game actions leading
+ // up to the desync
+ static constexpr size_t kExcerptSize = 32;
+ // Array of byte buffers
+ // std::string is used as a binary buffer here
+ std::string excerpts_buffer_[kExcerptSize];
+ } syncwrapper_;
+
+ void delete_pending_player_commands();
+ void do_send_player_command(PlayerCommand*);
+ std::shared_ptr<GameController> ctrl_;
+
+ /// Whether a replay writer should be created.
+ /// Defaults to \c true, and should only be set to \c false for playing back
+ /// replays.
+ bool writereplay_{true};
+
+ /// Whether a syncsteam file should be created.
+ /// Defaults to \c false, and can be set to true for network games. The file
+ /// is written only if \ref writereplay_ is true too.
+ bool writesyncstream_{false};
+
+ bool ai_training_mode_{false};
+ bool auto_speed_{false};
+
+ int32_t state_{gs_notrunning};
+
+ RNG rng_;
+
+ CmdQueue cmdqueue_;
+ std::deque<PlayerCommand*> pending_player_commands_;
+
+ SaveHandler savehandler_;
+
+ std::unique_ptr<ReplayWriter> replaywriter_;
+
+ uint32_t scenario_difficulty_{kScenarioDifficultyNotSet};
+
+ GeneralStatsVector general_stats_;
+ int next_trade_agreement_id_ = 1;
+ // Maps from trade agreement id to the agreement.
+ std::map<int, TradeAgreement> trade_agreements_;
+
+ std::list<PendingDiplomacyAction> pending_diplomacy_actions_;
+ bool diplomacy_allowed_{true};
+ bool naval_warfare_allowed_{false};
+
+ /// For save games and statistics generation
+ std::string win_condition_displayname_;
+
+ int32_t win_condition_duration_{kDefaultWinConditionDuration};
+
+#if 0 // TODO(Nordfriese): Re-add training wheels code after v1.0
+ std::unique_ptr<TrainingWheels> training_wheels_;
+ bool training_wheels_wanted_{false};
+#endif
+
+ /** Filename of the replay represented by this game, or empty if this is not a replay. */
+ std::string replay_filename_;
+
+ std::string next_game_to_load_;
+ std::list<std::string> list_of_scenarios_;
+};
+
+inline Coords Game::random_location(Coords location, uint8_t radius) {
+ const uint16_t s = radius * 2 + 1;
+ location.x += logic_rand() % s - radius;
+ location.y += logic_rand() % s - radius;
+ map().normalize_coords(location);
+ return location;
+}
+} // namespace Widelands
+
+#endif // end of include guard: WL_LOGIC_GAME_H
diff -uNr widelands.orig/src/logic/game_settings.h widelands/src/logic/game_settings.h
--- widelands.orig/src/logic/game_settings.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/game_settings.h 2025-02-16 12:16:38.740000000 +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.orig/src/logic/mapastar.h widelands/src/logic/mapastar.h
--- widelands.orig/src/logic/mapastar.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/mapastar.h 2025-02-16 12:16:38.740000000 +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.orig/src/logic/map.h widelands/src/logic/map.h
--- widelands.orig/src/logic/map.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/map.h 2025-02-16 12:16:38.740000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_MAP_H
#define WL_LOGIC_MAP_H
+#include <cstdint>
#include <map>
#include <memory>
#include <set>
diff -uNr widelands.orig/src/logic/maphollowregion.h widelands/src/logic/maphollowregion.h
--- widelands.orig/src/logic/maphollowregion.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/maphollowregion.h 2025-02-16 12:16:38.740000000 +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.orig/src/logic/message_queue.h widelands/src/logic/message_queue.h
--- widelands.orig/src/logic/message_queue.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/message_queue.h 2025-02-16 12:16:38.740000000 +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.orig/src/logic/pathfield.h widelands/src/logic/pathfield.h
--- widelands.orig/src/logic/pathfield.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/pathfield.h 2025-02-16 12:16:38.740000000 +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.orig/src/logic/playercommand.h widelands/src/logic/playercommand.h
--- widelands.orig/src/logic/playercommand.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/playercommand.h 2025-02-16 12:16:38.740000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_PLAYERCOMMAND_H
#define WL_LOGIC_PLAYERCOMMAND_H
+#include <cstdint>
#include <memory>
#include "economy/flag.h"
diff -uNr widelands.orig/src/logic/player.h widelands/src/logic/player.h
--- widelands.orig/src/logic/player.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/player.h 2025-02-16 12:16:38.741000000 +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.orig/src/logic/replay_game_controller.h widelands/src/logic/replay_game_controller.h
--- widelands.orig/src/logic/replay_game_controller.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/replay_game_controller.h 2025-02-16 12:16:38.741000000 +0100
@@ -19,6 +19,7 @@
#ifndef WL_LOGIC_REPLAY_GAME_CONTROLLER_H
#define WL_LOGIC_REPLAY_GAME_CONTROLLER_H
+#include <cstdint>
#include <memory>
#include "logic/cmd_queue.h"
diff -uNr widelands.orig/src/logic/single_player_game_controller.h widelands/src/logic/single_player_game_controller.h
--- widelands.orig/src/logic/single_player_game_controller.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/single_player_game_controller.h 2025-02-16 12:16:38.741000000 +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.orig/src/logic/single_player_game_settings_provider.h widelands/src/logic/single_player_game_settings_provider.h
--- widelands.orig/src/logic/single_player_game_settings_provider.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/single_player_game_settings_provider.h 2025-02-16 12:16:38.741000000 +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,41 +0,0 @@
diff -uNr widelands.orig/src/base/format/abstract_node.h widelands/src/base/format/abstract_node.h
--- widelands.orig/src/base/format/abstract_node.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/base/format/abstract_node.h 2025-02-16 15:15:22.182000000 +0100
@@ -19,6 +19,8 @@
#ifndef WL_BASE_FORMAT_ABSTRACT_NODE_H
#define WL_BASE_FORMAT_ABSTRACT_NODE_H
+#include <cstdint>
+
namespace format_impl {
enum Flags : uint8_t {
diff -uNr widelands.orig/src/logic/map_objects/tribes/requirements.h widelands/src/logic/map_objects/tribes/requirements.h
--- widelands.orig/src/logic/map_objects/tribes/requirements.h 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/logic/map_objects/tribes/requirements.h 2025-02-16 15:22:47.038000000 +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.orig/src/third_party/eris/eris.c widelands/src/third_party/eris/eris.c
--- widelands.orig/src/third_party/eris/eris.c 2024-11-12 21:03:25.000000000 +0100
+++ widelands/src/third_party/eris/eris.c 2025-02-16 12:44:28.581000000 +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

@ -0,0 +1,12 @@
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,7 +1,7 @@
diff -up widelands-1.1/cmake/WlFunctions.cmake~ widelands-1.1/cmake/WlFunctions.cmake
--- widelands-1.1/cmake/WlFunctions.cmake~ 2022-10-22 13:51:16.000000000 +0200
+++ widelands-1.1/cmake/WlFunctions.cmake 2023-03-28 10:31:21.413196378 +0200
@@ -77,7 +77,9 @@ macro(_common_compile_tasks)
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)

180
widelands-1.3-gcc13.patch Normal file
View file

@ -0,0 +1,180 @@
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"
/**

29
widelands-1.3-gcc15.patch Normal file
View file

@ -0,0 +1,29 @@
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,7 +1,7 @@
diff -up widelands-1.1/src/graphic/text/test/render_richtext.cc.orig widelands-1.1/src/graphic/text/test/render_richtext.cc
--- widelands-1.1/src/graphic/text/test/render_richtext.cc.orig 2022-10-22 13:51:16.000000000 +0200
+++ widelands-1.1/src/graphic/text/test/render_richtext.cc 2023-03-27 21:11:06.712405327 +0200
@@ -114,6 +114,9 @@ int main(int argc, char** argv) {
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;
@ -11,9 +11,9 @@ diff -up widelands-1.1/src/graphic/text/test/render_richtext.cc.orig widelands-1
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
std::cerr << "SDLInit did not succeed: " << SDL_GetError() << std::endl;
return 1;
diff -up widelands-1.1/src/website/website_common.cc.orig widelands-1.1/src/website/website_common.cc
--- widelands-1.1/src/website/website_common.cc.orig 2022-10-22 13:51:16.000000000 +0200
+++ widelands-1.1/src/website/website_common.cc 2023-03-27 21:11:06.712405327 +0200
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"
@ -22,9 +22,9 @@ diff -up widelands-1.1/src/website/website_common.cc.orig widelands-1.1/src/webs
#include <SDL.h>
#include "base/i18n.h"
@@ -33,6 +34,9 @@ void initialize() {
@@ -33,6 +34,9 @@
set_initializer_thread();
i18n::set_locale("en");
g_verbose = true;
+ // GLEW only supports glx atm, force use of X11 even under Wayland
+ // https://github.com/nigels-com/glew/issues/172
@ -32,10 +32,10 @@ diff -up widelands-1.1/src/website/website_common.cc.orig widelands-1.1/src/webs
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 -up widelands-1.1/src/wlapplication.cc.orig widelands-1.1/src/wlapplication.cc
--- widelands-1.1/src/wlapplication.cc.orig 2022-10-22 13:51:16.000000000 +0200
+++ widelands-1.1/src/wlapplication.cc 2023-03-27 21:11:06.713405319 +0200
@@ -404,6 +404,9 @@ WLApplication::WLApplication(int const a
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

View file

@ -2,8 +2,8 @@
%global fonts font(amiri) font(dejavusans) font(dejavusansmono) font(dejavuserif) font(widelands) font(gargi) font(wenquanyimicrohei) font(frankruehlclm)
Name: widelands
Version: 1.2.1
Release: 1%{?dist}
Version: 1.3.1
Release: 3%{?dist}
Summary: Open source realtime-strategy game
# Automatically converted from old format: GPLv2+ - review is highly recommended.
@ -11,7 +11,7 @@ License: GPL-2.0-or-later
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.2-build19-ppc64le.patch
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.:
@ -19,11 +19,11 @@ Patch1: widelands-1.2-build20-gcc10.patch
# 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.0-make-sdl2-use-x11.patch
Patch3: widelands-1.2.1-gcc13.patch
Patch4: widelands-1.1-f37-sys-minizip-buildfix.patch
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.2.1-gcc15.patch
Patch6: widelands-1.3-gcc15.patch
BuildRequires: asio-devel
BuildRequires: SDL2-devel
@ -35,7 +35,6 @@ BuildRequires: cmake
BuildRequires: ctags
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: gettext
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: glew-devel
@ -70,7 +69,7 @@ perhaps will have a thought, what Widelands is all about.
%build
%cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWL_INSTALL_BASEDIR=%{_prefix}/share/%{name} \
-DWL_INSTALL_DATADIR=%{_prefix}/share/%{name} \
-DOPTION_BUILD_WEBSITE_TOOLS=OFF \
@ -89,7 +88,7 @@ mv $RPM_BUILD_ROOT%{_prefix}/games/%{name} \
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
# Validate appdata (provided by upstream)
appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/*.appdata.xml
appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/*.metainfo.xml
pushd $RPM_BUILD_ROOT
# Replace fonts with system fonts. We used to have symlinks directly from
@ -190,9 +189,9 @@ ln -s $(fc-match -f "%{file}" "widelands") \
# Scripting magic to add proper %%lang() markings to the locale files
find usr/share/widelands/locale/ -maxdepth 1 -type d -name \*_\* | sed -n 's#\(usr/share/widelands/locale/\(.*\)_.*\)#%lang(\2) /\1#p' > %{_builddir}/%{?buildsubdir}/%{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}/%{?buildsubdir}/%{name}.files
find usr/share/widelands/ -mindepth 1 -maxdepth 1 -not -name locale | sed -n 's#\(usr/share/widelands/*\)#/\1#p' >> %{_builddir}/%{?buildsubdir}/%{name}.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
popd
@ -202,13 +201,39 @@ popd
%{_mandir}/man6/widelands.6.gz
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/*/apps/*.png
%{_metainfodir}/*.appdata.xml
%{_metainfodir}/*.metainfo.xml
%{_datadir}/applications/*.desktop
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/locale
%{_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
%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)