Skip to content
Snippets Groups Projects
Commit d3c9137c authored by Alexey Dokuchaev's avatar Alexey Dokuchaev
Browse files

games/openttd: update OpenTTD to version 14.1 (major update)

Users and server operators should read the announcement:
https://www.openttd.org/news/2024/04/13/openttd-14-0

Drop nowadays needless USES+=gnome: as explained by tobik@,
it was required for INSTALLS_ICONS which only did something
when `gnome.mk' was loaded, but this knob is long gone.
parent 1f3a8925
No related branches found
No related tags found
No related merge requests found
PORTNAME= openttd
DISTVERSION= 13.4
DISTVERSION= 14.1
CATEGORIES= games
MASTER_SITES= https://cdn.openttd.org/openttd-releases/${DISTVERSION}/
DISTNAME= ${PORTNAME}-${DISTVERSION}-source
......@@ -10,8 +10,9 @@ WWW= https://www.openttd.org/
LICENSE= GPLv2
LIB_DEPENDS= libpng.so:graphics/png \
liblzo2.so:archivers/lzo2
LIB_DEPENDS= libcurl.so:ftp/curl \
liblzo2.so:archivers/lzo2 \
libpng.so:graphics/png
USES= cmake compiler:c++17-lang cpe pkgconfig tar:xz
CMAKE_ARGS= -DCMAKE_INSTALL_BINDIR:PATH=bin \
......@@ -34,14 +35,13 @@ SDL1_CMAKE_OFF= -DWITH_SDL2:BOOL=ON
SDL1_VARS_OFF= _SDL_VERSION=sdl2
SERVER_DESC= Build dedicated server only (no GUI)
SERVER_USES_OFF= gnome sdl
SERVER_USES_OFF= sdl
SERVER_USE_OFF= SDL=${_SDL_VERSION}
SERVER_CMAKE_ON= -DOPTION_DEDICATED:BOOL=ON
SERVER_LIB_DEPENDS_OFF= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2 \
libicui18n.so:devel/icu \
libicu-le-hb.so:devel/icu-le-hb \
libiculx.so:devel/icu-lx
libharfbuzz.so:print/harfbuzz \
libicui18n.so:devel/icu
SERVER_VARS= USE_RC_SUBR=${PORTNAME}
post-install-SERVER-on:
......
TIMESTAMP = 1708509717
SHA256 (openttd-13.4-source.tar.xz) = 2a1deba01bfe58e2188879f450c3fa4f3819271ab49bf348dd66545f040d146f
SIZE (openttd-13.4-source.tar.xz) = 7428012
TIMESTAMP = 1715229396
SHA256 (openttd-14.1-source.tar.xz) = 2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494
SIZE (openttd-14.1-source.tar.xz) = 8015032
......@@ -25,8 +25,8 @@
this->last_frame = this->last_frame_server = _frame_counter;
+ Debug( net, 1, "requesting GAME password" );
Packet *p = new Packet(PACKET_SERVER_NEED_GAME_PASSWORD);
this->SendPacket(p);
auto p = std::make_unique<Packet>(PACKET_SERVER_NEED_GAME_PASSWORD);
this->SendPacket(std::move(p));
return NETWORK_RECV_STATUS_OKAY;
@@ -1563,6 +1565,9 @@ static void NetworkAutoCleanCompanies()
IConsolePrint(CC_INFO, "Auto-removed protection from company #{}.", c->index + 1);
......@@ -57,9 +57,9 @@
+void NetworkSavePassword( )
+{
+ static FILE *file_pointer;
+ char password_file_name[80];
+ std::string password_file_name;
+
+ seprintf( password_file_name, lastof(password_file_name), "%u.pwd", _settings_game.game_creation.generation_seed );
+ password_file_name = fmt::format("{}.pwd", _settings_game.game_creation.generation_seed);
+ Debug( net, 0, "Saving companies password to %s", password_file_name );
+ file_pointer = FioFOpenFile( password_file_name, "wb", SAVE_DIR );
+
......@@ -78,9 +78,9 @@
+{
+ static FILE *file_pointer;
+ char password[NETWORK_PASSWORD_LENGTH];
+ char password_file_name[80];
+ std::string password_file_name;
+
+ seprintf( password_file_name, lastof(password_file_name), "%u.pwd", _settings_game.game_creation.generation_seed );
+ password_file_name = fmt::format("{}.pwd", _settings_game.game_creation.generation_seed);
+ file_pointer = FioFOpenFile( password_file_name, "rb", SAVE_DIR );
+ if (file_pointer != NULL) {
+ Debug( net, 0, "Loading password from %s", password_file_name );
......@@ -115,8 +115,8 @@
+++ src/settings_type.h
@@ -296,6 +296,7 @@ struct NetworkSettings {
std::string last_joined; ///< Last joined server
bool no_http_content_downloads; ///< do not do content downloads over HTTP
UseRelayService use_relay_service; ///< Use relay service?
UseRelayService use_relay_service; ///< Use relay service?
ParticipateSurvey participate_survey; ///< Participate in the automated survey
+ bool save_password; ///< If password file is used
};
......@@ -124,9 +124,9 @@
--- src/table/settings/network_settings.ini.orig 2021-10-17 09:31:25 UTC
+++ src/table/settings/network_settings.ini
@@ -265,3 +265,8 @@ str = STR_CONFIG_SETTING_USE_RELAY_SERVICE
strhelp = STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT
strval = STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER
cat = SC_BASIC
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY
def = false
cat = SC_EXPERT
+
+[SDTC_BOOL]
+var = network.save_password
......
--- CMakeLists.txt.orig 2023-07-29 23:01:44 UTC
--- CMakeLists.txt.orig 2024-04-13 12:55:23 UTC
+++ CMakeLists.txt
@@ -129,11 +129,14 @@ if(NOT OPTION_DEDICATED)
@@ -143,11 +143,14 @@ if(NOT OPTION_DEDICATED)
find_package(Allegro)
if(NOT APPLE)
find_package(Freetype)
......@@ -13,16 +13,21 @@
+if(WITH_FLUIDSYNTH)
find_package(Fluidsynth)
+endif()
find_package(Fontconfig)
find_package(ICU OPTIONAL_COMPONENTS i18n lx)
endif()
@@ -260,7 +263,9 @@ link_package(LIBLZMA TARGET LibLZMA::LibLZMA ENCOURAGE
link_package(LZO)
if(Freetype_FOUND)
find_package(Fontconfig)
endif()
@@ -323,9 +326,14 @@ if(NOT EMSCRIPTEN)
endif()
if(NOT OPTION_DEDICATED)
+ if(WITH_FLUIDSYNTH)
link_package(Fluidsynth)
+ endif()
+ if(NOT WITH_SDL2)
link_package(SDL)
+ else()
link_package(SDL2 TARGET SDL2::SDL2)
+ endif()
link_package(Allegro)
link_package(FREETYPE TARGET Freetype::Freetype)
link_package(Fontconfig TARGET Fontconfig::Fontconfig)
......@@ -12,8 +12,8 @@
COMPONENT manual)
endif()
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT OPTION_DEDICATED)
-if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
+if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT OPTION_DEDICATED)
install(DIRECTORY
${CMAKE_BINARY_DIR}/media/icons
${CMAKE_BINARY_DIR}/media/pixmaps
bin/openttd
share/man/man6/openttd.6.gz
%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTING.md
%%PORTDOCS%%%%DOCSDIR%%/CREDITS.md
%%PORTDOCS%%%%DOCSDIR%%/README.md
%%PORTDOCS%%%%DOCSDIR%%/changelog.txt
%%PORTDOCS%%%%DOCSDIR%%/known-bugs.txt
%%PORTDOCS%%%%DOCSDIR%%/multiplayer.md
%%PORTDOCS%%%%DOCSDIR%%/docs/admin_network.md
%%PORTDOCS%%%%DOCSDIR%%/docs/debugging_desyncs.md
%%PORTDOCS%%%%DOCSDIR%%/docs/desync.md
%%PORTDOCS%%%%DOCSDIR%%/docs/directory_structure.md
%%PORTDOCS%%%%DOCSDIR%%/docs/eints.md
%%PORTDOCS%%%%DOCSDIR%%/docs/game_coordinator.md
%%PORTDOCS%%%%DOCSDIR%%/docs/linkgraph.md
%%PORTDOCS%%%%DOCSDIR%%/docs/logging_and_performance_metrics.md
%%PORTDOCS%%%%DOCSDIR%%/docs/multiplayer.md
%%PORTDOCS%%%%DOCSDIR%%/docs/obg_format.txt
%%PORTDOCS%%%%DOCSDIR%%/docs/obm_format.txt
%%PORTDOCS%%%%DOCSDIR%%/docs/obs_format.txt
%%PORTDOCS%%%%DOCSDIR%%/docs/savegame_format.md
%%PORTDOCS%%%%DOCSDIR%%/docs/symbol_server.md
%%DATADIR%%/ai/compat_0.7.nut
%%DATADIR%%/ai/compat_1.0.nut
%%DATADIR%%/ai/compat_1.1.nut
......@@ -19,6 +34,12 @@ share/man/man6/openttd.6.gz
%%DATADIR%%/ai/compat_1.11.nut
%%DATADIR%%/ai/compat_12.nut
%%DATADIR%%/ai/compat_13.nut
%%DATADIR%%/ai/compat_14.nut
%%DATADIR%%/game/compat_14.nut
%%DATADIR%%/baseset/OpenTTD-Mono.ttf
%%DATADIR%%/baseset/OpenTTD-Sans.ttf
%%DATADIR%%/baseset/OpenTTD-Serif.ttf
%%DATADIR%%/baseset/OpenTTD-Small.ttf
%%DATADIR%%/baseset/no_music.obm
%%DATADIR%%/baseset/no_sound.obs
%%DATADIR%%/baseset/openttd.32.bmp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment