diff --git a/games/openttd/Makefile b/games/openttd/Makefile index 8b9f68d28199..d2c98a85d7d5 100644 --- a/games/openttd/Makefile +++ b/games/openttd/Makefile @@ -1,58 +1,46 @@ PORTNAME= openttd -DISTVERSION= 14.1 -PORTREVISION= 1 +DISTVERSION= 15.0 CATEGORIES= games MASTER_SITES= https://cdn.openttd.org/openttd-releases/${DISTVERSION}/ DISTNAME= ${PORTNAME}-${DISTVERSION}-source -PATCH_SITES= https://github.com/OpenTTD/OpenTTD/commit/ -PATCHFILES= db36e61807955c896267d6585de0577efd30465d.patch:-p1 \ - 14fac2ad37bfb9cec56b4f9169d864f6f1c7b96e.patch:-p1 - MAINTAINER= danfe@FreeBSD.org -COMMENT= Open source clone of Microprose Transport Tycoon Deluxe +COMMENT= Open-source clone of Microprose Transport Tycoon Deluxe WWW= https://www.openttd.org/ LICENSE= GPLv2 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 \ -DCMAKE_INSTALL_DATADIR:PATH=share WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION} -OPTIONS_DEFINE= DOCS FLUIDSYNTH SAVE_PASSWORDS SDL1 SERVER +OPTIONS_DEFINE= DOCS FLUIDSYNTH SERVER SERVER_PREVENTS= FLUIDSYNTH FLUIDSYNTH_LIB_DEPENDS= libfluidsynth.so:audio/fluidsynth FLUIDSYNTH_CMAKE_ON= -DWITH_FLUIDSYNTH:BOOL=ON -SAVE_PASSWORDS_DESC= Save passwords between server restarts -SAVE_PASSWORDS_EXTRA_PATCHES= ${FILESDIR}/extra-patch-save-passwords - -SDL1_DESC= Use SDL v1.2 instead of v2 for GUI -SDL1_VARS= _SDL_VERSION=sdl -SDL1_CMAKE_OFF= -DWITH_SDL2:BOOL=ON -SDL1_VARS_OFF= _SDL_VERSION=sdl2 - SERVER_DESC= Build dedicated server only (no GUI) SERVER_USES_OFF= sdl -SERVER_USE_OFF= SDL=${_SDL_VERSION} +SERVER_USE_OFF= SDL=sdl2 SERVER_CMAKE_ON= -DOPTION_DEDICATED:BOOL=ON SERVER_LIB_DEPENDS_OFF= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ - libicui18n.so:devel/icu + libicui18n.so:devel/icu \ + libopusfile.so:audio/opusfile SERVER_VARS= USE_RC_SUBR=${PORTNAME} post-install-SERVER-on: @${REINPLACE_CMD} -E '/\.desktop|icons|pixmaps/d' ${TMPPLIST} do-test: @cd ${TEST_WRKSRC} && ctest -C ${CMAKE_BUILD_TYPE} ${_MAKE_JOBS} .include diff --git a/games/openttd/distinfo b/games/openttd/distinfo index e52182bfb34e..7a375fa255fe 100644 --- a/games/openttd/distinfo +++ b/games/openttd/distinfo @@ -1,7 +1,3 @@ -TIMESTAMP = 1736018646 -SHA256 (openttd-14.1-source.tar.xz) = 2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494 -SIZE (openttd-14.1-source.tar.xz) = 8015032 -SHA256 (db36e61807955c896267d6585de0577efd30465d.patch) = 4faaf0fdc4989194e47512f91288c62aa031fc6449d87b985fb20d1cc27705c9 -SIZE (db36e61807955c896267d6585de0577efd30465d.patch) = 1076 -SHA256 (14fac2ad37bfb9cec56b4f9169d864f6f1c7b96e.patch) = 7ab95cc1719614a9e5470d06001efd27bab9db917eb8456872aa1505440881a6 -SIZE (14fac2ad37bfb9cec56b4f9169d864f6f1c7b96e.patch) = 1089 +TIMESTAMP = 1767288352 +SHA256 (openttd-15.0-source.tar.xz) = 3552d774bb246f360b0a0d35436946007fcd48b2698ef1d7dfa30032ac3135c1 +SIZE (openttd-15.0-source.tar.xz) = 8540368 diff --git a/games/openttd/files/extra-patch-save-passwords b/games/openttd/files/extra-patch-save-passwords deleted file mode 100644 index ac4fa72b2e5e..000000000000 --- a/games/openttd/files/extra-patch-save-passwords +++ /dev/null @@ -1,134 +0,0 @@ ---- src/network/network_func.h.orig 2021-10-17 09:31:25 UTC -+++ src/network/network_func.h -@@ -73,7 +73,8 @@ void NetworkServerShowStatusToConsole(); - bool NetworkServerStart(); - void NetworkServerNewCompany(const Company *company, NetworkClientInfo *ci); - bool NetworkServerChangeClientName(ClientID client_id, const std::string &new_name); -- -+void NetworkSavePassword(); -+void NetworkLoadPassword(); - - void NetworkServerDoMove(ClientID client_id, CompanyID company_id); - void NetworkServerSendRcon(ClientID client_id, TextColour colour_code, const std::string &string); ---- src/network/network_server.cpp.orig 2021-10-17 09:31:25 UTC -+++ src/network/network_server.cpp -@@ -32,6 +32,7 @@ - #include - #include - -+#include "../fileio_func.h" - #include "../safeguards.h" - - -@@ -439,6 +440,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Send - /* Reset 'lag' counters */ - this->last_frame = this->last_frame_server = _frame_counter; - -+ Debug( net, 1, "requesting GAME password" ); - auto p = std::make_unique(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); - _network_company_states[c->index].months_empty = 0; - NetworkServerUpdateCompanyPassworded(c->index, false); -+ if (_settings_client.network.save_password) { -+ NetworkSavePassword( ); -+ } - } - /* Is the company empty for autoclean_novehicles-months, and has no vehicles? */ - if (_settings_client.network.autoclean_novehicles != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_novehicles && vehicles_in_company[c->index] == 0) { -@@ -1656,6 +1661,9 @@ void NetworkServerSetCompanyPassword(CompanyID company - } - - NetworkServerUpdateCompanyPassworded(company_id, !_network_company_states[company_id].password.empty()); -+ if (_settings_client.network.save_password) { -+ NetworkSavePassword( ); -+ } - } - - /** -@@ -2022,6 +2030,49 @@ bool NetworkCompanyHasClients(CompanyID company) - if (ci->client_playas == company) return true; - } - return false; -+} -+ -+void NetworkSavePassword( ) -+{ -+ static FILE *file_pointer; -+ std::string password_file_name; -+ -+ 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 ); -+ -+ if (file_pointer != NULL) { -+ for( CompanyID l_company = (CompanyID)0; l_company < MAX_COMPANIES; l_company++ ) { -+ if (NetworkCompanyIsPassworded(l_company)) { -+ fwrite(_network_company_states[l_company].password.c_str(), _network_company_states[l_company].password.size(), 1, file_pointer); -+ } -+ fwrite( "\n", 1, 1, file_pointer ); -+ } -+ fclose(file_pointer); -+ } -+} -+ -+void NetworkLoadPassword( ) -+{ -+ static FILE *file_pointer; -+ char password[NETWORK_PASSWORD_LENGTH]; -+ std::string password_file_name; -+ -+ 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 ); -+ for( CompanyID l_company = (CompanyID)0; l_company < MAX_COMPANIES; l_company++ ) { -+ fgets( password, sizeof( password), file_pointer); -+ if (strlen(password)>1) { -+ fseek( file_pointer, 1L, SEEK_CUR ); -+ _network_company_states[l_company].password = password; -+ NetworkServerUpdateCompanyPassworded(l_company, !_network_company_states[l_company].password.empty()); -+ } -+ } -+ } else { -+ Debug( net, 0, "Password file %s not found", password_file_name ); -+ } - } - - ---- src/openttd.cpp.orig 2021-10-17 09:31:25 UTC -+++ src/openttd.cpp -@@ -1046,6 +1046,10 @@ void SwitchToMode(SwitchMode new_mode) - OnStartGame(_network_dedicated); - /* Decrease pause counter (was increased from opening load dialog) */ - Command::Post(PM_PAUSED_SAVELOAD, false); -+ // Try to load password -+ if (_settings_client.network.save_password) { -+ NetworkLoadPassword( ); -+ } - } - break; - } ---- src/settings_type.h.orig 2021-10-17 09:31:25 UTC -+++ src/settings_type.h -@@ -296,6 +296,7 @@ struct NetworkSettings { - std::string last_joined; ///< Last joined server - UseRelayService use_relay_service; ///< Use relay service? - ParticipateSurvey participate_survey; ///< Participate in the automated survey -+ bool save_password; ///< If password file is used - }; - - /** Settings related to the creation of games. */ ---- 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 - flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY - def = false - cat = SC_EXPERT -+ -+[SDTC_BOOL] -+var = network.save_password -+flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC -+def = false diff --git a/games/openttd/files/patch-CMakeLists.txt b/games/openttd/files/patch-CMakeLists.txt index 6ad87864e4c0..cdcd99beb8b1 100644 --- a/games/openttd/files/patch-CMakeLists.txt +++ b/games/openttd/files/patch-CMakeLists.txt @@ -1,33 +1,22 @@ ---- CMakeLists.txt.orig 2024-04-13 12:55:23 UTC +--- CMakeLists.txt.orig 2025-08-31 18:53:32 UTC +++ CMakeLists.txt -@@ -143,11 +143,14 @@ if(NOT OPTION_DEDICATED) - find_package(Allegro) +@@ -143,7 +143,9 @@ if(NOT OPTION_DEDICATED) if(NOT APPLE) find_package(Freetype) -+if(WITH_SDL2) find_package(SDL2) -- if(NOT SDL2_FOUND) -+else() - find_package(SDL) - endif() +if(WITH_FLUIDSYNTH) find_package(Fluidsynth) +endif() if(Freetype_FOUND) find_package(Fontconfig) endif() -@@ -323,9 +326,14 @@ if(NOT EMSCRIPTEN) +@@ -317,7 +319,9 @@ 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) diff --git a/games/openttd/pkg-plist b/games/openttd/pkg-plist index 63a33f92e99b..b63fbc5e6f7d 100644 --- a/games/openttd/pkg-plist +++ b/games/openttd/pkg-plist @@ -1,151 +1,153 @@ bin/openttd -share/man/man6/openttd.6.gz +share/applications/openttd.desktop %%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTING.md %%PORTDOCS%%%%DOCSDIR%%/CREDITS.md %%PORTDOCS%%%%DOCSDIR%%/README.md -%%PORTDOCS%%%%DOCSDIR%%/changelog.txt -%%PORTDOCS%%%%DOCSDIR%%/known-bugs.txt +%%PORTDOCS%%%%DOCSDIR%%/changelog.md +%%PORTDOCS%%%%DOCSDIR%%/known-bugs.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/fonts.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 +share/icons/hicolor/16x16/apps/openttd.png +share/icons/hicolor/32x32/apps/openttd.png +share/icons/hicolor/48x48/apps/openttd.png +share/icons/hicolor/64x64/apps/openttd.png +share/icons/hicolor/128x128/apps/openttd.png +share/icons/hicolor/256x256/apps/openttd.png +share/man/man6/openttd.6.gz %%DATADIR%%/ai/compat_0.7.nut %%DATADIR%%/ai/compat_1.0.nut %%DATADIR%%/ai/compat_1.1.nut %%DATADIR%%/ai/compat_1.2.nut %%DATADIR%%/ai/compat_1.3.nut %%DATADIR%%/ai/compat_1.4.nut %%DATADIR%%/ai/compat_1.5.nut %%DATADIR%%/ai/compat_1.6.nut %%DATADIR%%/ai/compat_1.7.nut %%DATADIR%%/ai/compat_1.8.nut %%DATADIR%%/ai/compat_1.9.nut %%DATADIR%%/ai/compat_1.10.nut %%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 %%DATADIR%%/baseset/openttd.grf %%DATADIR%%/baseset/opntitle.dat %%DATADIR%%/baseset/orig_dos.obg %%DATADIR%%/baseset/orig_dos.obm %%DATADIR%%/baseset/orig_dos.obs %%DATADIR%%/baseset/orig_dos_de.obg %%DATADIR%%/baseset/orig_extra.grf %%DATADIR%%/baseset/orig_tto.obm %%DATADIR%%/baseset/orig_win.obg %%DATADIR%%/baseset/orig_win.obm %%DATADIR%%/baseset/orig_win.obs %%DATADIR%%/game/compat_1.2.nut %%DATADIR%%/game/compat_1.3.nut %%DATADIR%%/game/compat_1.4.nut %%DATADIR%%/game/compat_1.5.nut %%DATADIR%%/game/compat_1.6.nut %%DATADIR%%/game/compat_1.7.nut %%DATADIR%%/game/compat_1.8.nut %%DATADIR%%/game/compat_1.9.nut %%DATADIR%%/game/compat_1.10.nut %%DATADIR%%/game/compat_1.11.nut %%DATADIR%%/game/compat_12.nut %%DATADIR%%/game/compat_13.nut %%DATADIR%%/lang/afrikaans.lng %%DATADIR%%/lang/arabic_egypt.lng %%DATADIR%%/lang/basque.lng %%DATADIR%%/lang/belarusian.lng %%DATADIR%%/lang/brazilian_portuguese.lng %%DATADIR%%/lang/bulgarian.lng %%DATADIR%%/lang/catalan.lng %%DATADIR%%/lang/chuvash.lng %%DATADIR%%/lang/croatian.lng %%DATADIR%%/lang/czech.lng %%DATADIR%%/lang/danish.lng %%DATADIR%%/lang/dutch.lng %%DATADIR%%/lang/english.lng %%DATADIR%%/lang/english_AU.lng %%DATADIR%%/lang/english_US.lng %%DATADIR%%/lang/esperanto.lng %%DATADIR%%/lang/estonian.lng %%DATADIR%%/lang/faroese.lng %%DATADIR%%/lang/finnish.lng %%DATADIR%%/lang/french.lng %%DATADIR%%/lang/frisian.lng %%DATADIR%%/lang/gaelic.lng %%DATADIR%%/lang/galician.lng %%DATADIR%%/lang/german.lng %%DATADIR%%/lang/greek.lng %%DATADIR%%/lang/hebrew.lng %%DATADIR%%/lang/hindi.lng %%DATADIR%%/lang/hungarian.lng %%DATADIR%%/lang/icelandic.lng %%DATADIR%%/lang/ido.lng %%DATADIR%%/lang/indonesian.lng %%DATADIR%%/lang/irish.lng %%DATADIR%%/lang/italian.lng %%DATADIR%%/lang/japanese.lng %%DATADIR%%/lang/korean.lng %%DATADIR%%/lang/latin.lng %%DATADIR%%/lang/latvian.lng %%DATADIR%%/lang/lithuanian.lng %%DATADIR%%/lang/luxembourgish.lng %%DATADIR%%/lang/macedonian.lng %%DATADIR%%/lang/malay.lng %%DATADIR%%/lang/maltese.lng +%%DATADIR%%/lang/maori.lng %%DATADIR%%/lang/marathi.lng %%DATADIR%%/lang/norwegian_bokmal.lng %%DATADIR%%/lang/norwegian_nynorsk.lng %%DATADIR%%/lang/persian.lng %%DATADIR%%/lang/polish.lng %%DATADIR%%/lang/portuguese.lng %%DATADIR%%/lang/romanian.lng %%DATADIR%%/lang/russian.lng %%DATADIR%%/lang/serbian.lng %%DATADIR%%/lang/simplified_chinese.lng %%DATADIR%%/lang/slovak.lng %%DATADIR%%/lang/slovenian.lng %%DATADIR%%/lang/spanish.lng %%DATADIR%%/lang/spanish_MX.lng %%DATADIR%%/lang/swedish.lng %%DATADIR%%/lang/tamil.lng %%DATADIR%%/lang/thai.lng %%DATADIR%%/lang/traditional_chinese.lng %%DATADIR%%/lang/turkish.lng %%DATADIR%%/lang/ukrainian.lng %%DATADIR%%/lang/urdu.lng %%DATADIR%%/lang/vietnamese.lng %%DATADIR%%/lang/welsh.lng %%DATADIR%%/scripts/autoexec.scr.example %%DATADIR%%/scripts/game_start.scr.example %%DATADIR%%/scripts/on_client.scr.example %%DATADIR%%/scripts/on_dedicated.scr.example %%DATADIR%%/scripts/on_server.scr.example %%DATADIR%%/scripts/on_server_connect.scr.example %%DATADIR%%/scripts/pre_dedicated.scr.example %%DATADIR%%/scripts/pre_server.scr.example %%DATADIR%%/scripts/readme.txt -share/applications/openttd.desktop -share/icons/hicolor/16x16/apps/openttd.png -share/icons/hicolor/32x32/apps/openttd.png -share/icons/hicolor/48x48/apps/openttd.png -share/icons/hicolor/64x64/apps/openttd.png -share/icons/hicolor/128x128/apps/openttd.png -share/icons/hicolor/256x256/apps/openttd.png share/pixmaps/openttd.32.xpm share/pixmaps/openttd.64.xpm