From a1ce5cd7f453af1dbc8892350faeb745166c0274 Mon Sep 17 00:00:00 2001 From: Peppersawce <157759066+Peppersawce@users.noreply.github.com> Date: Tue, 3 Feb 2026 07:26:51 +0100 Subject: [PATCH] Update OpenRCT2 to 0.4.31 (#13701) --- ...2-0.4.30.recipe => openrct2-0.4.31.recipe} | 3 +- .../openrct2/patches/openrct2-0.4.30.patchset | 378 ------------------ .../openrct2/patches/openrct2-0.4.31.patchset | 92 +++++ 3 files changed, 94 insertions(+), 379 deletions(-) rename games-simulation/openrct2/{openrct2-0.4.30.recipe => openrct2-0.4.31.recipe} (97%) delete mode 100644 games-simulation/openrct2/patches/openrct2-0.4.30.patchset create mode 100644 games-simulation/openrct2/patches/openrct2-0.4.31.patchset diff --git a/games-simulation/openrct2/openrct2-0.4.30.recipe b/games-simulation/openrct2/openrct2-0.4.31.recipe similarity index 97% rename from games-simulation/openrct2/openrct2-0.4.30.recipe rename to games-simulation/openrct2/openrct2-0.4.31.recipe index 1df954b30..9cbf219e7 100644 --- a/games-simulation/openrct2/openrct2-0.4.30.recipe +++ b/games-simulation/openrct2/openrct2-0.4.31.recipe @@ -11,7 +11,7 @@ COPYRIGHT="2015-2025 OpenRCT2 team" LICENSE="GNU GPL v3" REVISION="1" SOURCE_URI="https://github.com/OpenRCT2/OpenRCT2/archive/refs/tags/v$portVersion.tar.gz" -CHECKSUM_SHA256="7be2f10cc5289cc6de18c31cb298217c26ac2400ffe2380f3cdadd18b7d8aec9" +CHECKSUM_SHA256="89f35c764b8dcdb9519b17c24bb5aff8f8106c8cc1158c6a3604448168f4fa60" SOURCE_DIR="OpenRCT2-$portVersion" SOURCE_URI_2="https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.26/title-sequences.zip" CHECKSUM_SHA256_2="dabb9787b1576342fca4dd9f64b3f8cfa04a7e6ce9c2bb9610f47b762905c858" @@ -61,6 +61,7 @@ BUILD_REQUIRES=" devel:libfontconfig$secondaryArchSuffix devel:libfreetype$secondaryArchSuffix devel:libGL$secondaryArchSuffix + devel:libicuuc$secondaryArchSuffix devel:libogg$secondaryArchSuffix devel:libpng16$secondaryArchSuffix devel:libpsl$secondaryArchSuffix diff --git a/games-simulation/openrct2/patches/openrct2-0.4.30.patchset b/games-simulation/openrct2/patches/openrct2-0.4.30.patchset deleted file mode 100644 index 2a805c8b4..000000000 --- a/games-simulation/openrct2/patches/openrct2-0.4.30.patchset +++ /dev/null @@ -1,378 +0,0 @@ -From a2fec2f3fcd1499d048aeabd214410a817a5a8a5 Mon Sep 17 00:00:00 2001 -From: Peppersawce -Date: Tue, 25 Nov 2025 15:16:58 +0100 -Subject: Haiku patches - - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b6edd7f..5e33ea6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -368,7 +368,7 @@ else () - set(CMAKE_POSITION_INDEPENDENT_CODE ON) - endif () - -- if (APPLE AND NOT USE_MMAP) -+ if (HAIKU OR (APPLE AND NOT USE_MMAP)) - set(CMAKE_POSITION_INDEPENDENT_CODE OFF) - else () - set(CMAKE_POSITION_INDEPENDENT_CODE ON) -diff --git a/src/openrct2-ui/CMakeLists.txt b/src/openrct2-ui/CMakeLists.txt -index cd3e3cc..d46972e 100644 ---- a/src/openrct2-ui/CMakeLists.txt -+++ b/src/openrct2-ui/CMakeLists.txt -@@ -38,7 +38,7 @@ endif () - - if (NOT DISABLE_OPENGL AND NOT EMSCRIPTEN) - # GL doesn't work nicely with macOS, while find_package doesn't work with multiarch on Ubuntu. -- if (APPLE) -+ if (APPLE OR HAIKU) - find_package(OpenGL REQUIRED) - elseif (NOT WIN32) - PKG_CHECK_MODULES(GL REQUIRED gl) -@@ -100,7 +100,7 @@ endif () - if (NOT DISABLE_OPENGL) - if (WIN32) - target_link_libraries(openrct2 opengl32) -- elseif (APPLE) -+ elseif (APPLE OR HAIKU) - target_link_libraries(openrct2 ${OPENGL_LIBRARY}) - else () - target_link_libraries(openrct2 ${GL_LIBRARIES}) -diff --git a/src/openrct2-ui/UiContext.Linux.cpp b/src/openrct2-ui/UiContext.Linux.cpp -index 7b2978d..cb785aa 100644 ---- a/src/openrct2-ui/UiContext.Linux.cpp -+++ b/src/openrct2-ui/UiContext.Linux.cpp -@@ -129,14 +129,14 @@ namespace OpenRCT2::Ui - - void OpenFolder(const std::string& path) override - { -- const char* args[] = { "xdg-open", path.c_str(), nullptr }; -+ const char* args[] = { "open", path.c_str(), nullptr }; - Platform::Execute(args); - } - - void OpenURL(const std::string& url) override - { - #ifndef __EMSCRIPTEN__ -- const char* args[] = { "xdg-open", url.c_str(), nullptr }; -+ const char* args[] = { "open", url.c_str(), nullptr }; - Platform::Execute(args); - #else - MAIN_THREAD_EM_ASM({ window.open(UTF8ToString($0)); }, url.c_str()); -diff --git a/src/openrct2/CMakeLists.txt b/src/openrct2/CMakeLists.txt -index f314c9c..e74c6be 100644 ---- a/src/openrct2/CMakeLists.txt -+++ b/src/openrct2/CMakeLists.txt -@@ -180,7 +180,7 @@ if (MINGW) - target_link_libraries(libopenrct2 -fstack-protector-strong) - endif() - --if (UNIX AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD") -+if (UNIX AND NOT HAIKU AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD") - # Include libdl for dlopen - target_link_libraries(libopenrct2 dl) - endif () -diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp -index e697a8a..aa405f1 100644 ---- a/src/openrct2/Context.cpp -+++ b/src/openrct2/Context.cpp -@@ -482,7 +482,7 @@ namespace OpenRCT2 - _discordService = std::make_unique(); - } - #endif -- -+#ifndef __HAIKU__ - if (Platform::ProcessIsElevated()) - { - std::string elevationWarning = _localisationService->GetString(STR_ADMIN_NOT_RECOMMENDED); -@@ -495,6 +495,7 @@ namespace OpenRCT2 - _uiContext->ShowMessageBox(elevationWarning); - } - } -+#endif - - if (Platform::IsRunningInWine()) - { -diff --git a/src/openrct2/Version.h b/src/openrct2/Version.h -index c56269e..ac7ba84 100644 ---- a/src/openrct2/Version.h -+++ b/src/openrct2/Version.h -@@ -72,6 +72,9 @@ - #ifdef __EMSCRIPTEN__ - #define OPENRCT2_PLATFORM "Emscripten" - #endif -+#ifdef __HAIKU__ -+ #define OPENRCT2_PLATFORM "Haiku" -+#endif - #ifndef OPENRCT2_PLATFORM - #error Unknown platform! - #endif -diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp -index a12c789..d74d808 100644 ---- a/src/openrct2/audio/Audio.cpp -+++ b/src/openrct2/audio/Audio.cpp -@@ -128,7 +128,7 @@ namespace OpenRCT2::Audio - } - } - --#ifndef __linux__ -+#if not defined(__linux__) && not defined(__HAIKU__) - // The first device is always system default on Windows and macOS - std::string defaultDevice = LanguageGetString(STR_OPTIONS_SOUND_VALUE_DEFAULT); - devices.insert(devices.begin(), defaultDevice); -diff --git a/src/openrct2/core/FileScanner.cpp b/src/openrct2/core/FileScanner.cpp -index 74a3d54..f9afe7e 100644 ---- a/src/openrct2/core/FileScanner.cpp -+++ b/src/openrct2/core/FileScanner.cpp -@@ -12,7 +12,7 @@ - #define WIN32_LEAN_AND_MEAN - #endif - #include --#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) -+#elif defined(__unix__) || defined(__HAIKU__) || (defined(__APPLE__) && defined(__MACH__)) - #include - #include - #include -@@ -251,7 +251,7 @@ private: - - #endif // _WIN32 - --#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) -+#if defined(__unix__) || defined(__HAIKU__) || (defined(__APPLE__) && defined(__MACH__)) - - class FileScannerUnix final : public FileScannerBase - { -@@ -290,7 +290,9 @@ private: - { - DirectoryChild result; - result.Name = std::string(node->d_name); -- if (node->d_type == DT_DIR) -+ struct stat stbuf; -+ stat(node->d_name, &stbuf); -+ if (S_ISDIR(stbuf.st_mode)) - { - result.Type = DirectoryChildType::directory; - } -@@ -324,7 +326,7 @@ std::unique_ptr Path::ScanDirectory(const std::string& pattern, bo - { - #ifdef _WIN32 - return std::make_unique(pattern, recurse); --#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) -+#elif defined(__unix__) || defined(__HAIKU__) || (defined(__APPLE__) && defined(__MACH__)) - return std::make_unique(pattern, recurse); - #endif - } -diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp -index 10218ef..f7be97c 100644 ---- a/src/openrct2/core/String.cpp -+++ b/src/openrct2/core/String.cpp -@@ -38,7 +38,7 @@ - #include "StringBuilder.h" - #include "UTF8.h" - --#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) -+#if defined(__unix__) || defined(__HAIKU__) || (defined(__APPLE__) && defined(__MACH__)) - #include - #define _stricmp(x, y) strcasecmp((x), (y)) - #endif -diff --git a/src/openrct2/network/Socket.cpp b/src/openrct2/network/Socket.cpp -index 795b96b..a76caff 100644 ---- a/src/openrct2/network/Socket.cpp -+++ b/src/openrct2/network/Socket.cpp -@@ -74,6 +74,10 @@ - #endif // _WIN32 - // clang-format on - -+#ifdef __HAIKU__ -+ #include -+#endif -+ - #include "Socket.h" - - namespace OpenRCT2::Network -diff --git a/src/openrct2/platform/Platform.Linux.cpp b/src/openrct2/platform/Platform.Linux.cpp -index 5bcb8f9..1b464be 100644 ---- a/src/openrct2/platform/Platform.Linux.cpp -+++ b/src/openrct2/platform/Platform.Linux.cpp -@@ -38,6 +38,10 @@ - #include "../localisation/Language.h" - #include "Platform.h" - -+ #ifdef __HAIKU__ -+ #include -+ #endif -+ - namespace OpenRCT2::Platform - { - // EnvLangGuard allows us to temporarily set the user's locale -@@ -150,8 +154,8 @@ namespace OpenRCT2::Platform - }; - static constexpr u8string_view SearchLocations[] = { - "/data", -- "../share/openrct2", -- "/usr/local/share/openrct2", -+ "/boot/system/data/openrct2", -+ "/boot/home/config/data/openrct2", - "/var/lib/openrct2", - "/usr/share/openrct2", - }; -@@ -180,6 +184,16 @@ namespace OpenRCT2::Platform - { - LOG_FATAL("failed to read /proc/self/exe"); - } -+ #elif defined(__HAIKU__) -+ image_info info; -+ int32 cookie = 0; -+ -+ while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) >= B_OK) { -+ if (info.type == B_APP_IMAGE) { -+ strlcpy(exePath, info.name, sizeof(exePath)); -+ break; -+ } -+ } - #elif defined(__FreeBSD__) || defined(__NetBSD__) - #if defined(__FreeBSD__) - const int32_t mib[] = { --- -2.52.0 - - -From d85ac36365ed223d8c1f95b8c9c38a9a972c0972 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9rome=20Duval?= -Date: Tue, 23 Dec 2025 11:58:37 +0100 -Subject: Haiku patch for gcc - - -diff --git a/src/openrct2-ui/UiContext.Linux.cpp b/src/openrct2-ui/UiContext.Linux.cpp -index cb785aa..12513c6 100644 ---- a/src/openrct2-ui/UiContext.Linux.cpp -+++ b/src/openrct2-ui/UiContext.Linux.cpp -@@ -7,7 +7,7 @@ - * OpenRCT2 is licensed under the GNU General Public License version 3. - *****************************************************************************/ - --#if (defined(__unix__) || defined(__EMSCRIPTEN__)) && !defined(__ANDROID__) && !defined(__APPLE__) -+#if (defined(__unix__) || defined(__HAIKU__) || defined(__EMSCRIPTEN__)) && !defined(__ANDROID__) && !defined(__APPLE__) - - #include "UiContext.h" - -diff --git a/src/openrct2/core/Range.hpp b/src/openrct2/core/Range.hpp -index 49adfd9..f055e10 100644 ---- a/src/openrct2/core/Range.hpp -+++ b/src/openrct2/core/Range.hpp -@@ -29,6 +29,10 @@ struct Range - T Change{}; - - private: -+ #if defined(__GNUC__) && !defined(__clang__) -+ #pragma GCC diagnostic push -+ #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" -+ #endif - Iterator(const Range& range, T initialValue) - : Lower(range.Lower) - , Upper(range.Upper) -@@ -36,6 +40,9 @@ struct Range - , Change(range.Upper >= range.Lower ? 1 : -1) - { - } -+ #if defined(__GNUC__) && !defined(__clang__) -+ #pragma GCC diagnostic pop -+ #endif - - public: - Iterator& operator++() -diff --git a/src/openrct2/platform/Platform.Linux.cpp b/src/openrct2/platform/Platform.Linux.cpp -index 1b464be..10bb18e 100644 ---- a/src/openrct2/platform/Platform.Linux.cpp -+++ b/src/openrct2/platform/Platform.Linux.cpp -@@ -7,7 +7,7 @@ - * OpenRCT2 is licensed under the GNU General Public License version 3. - *****************************************************************************/ - --#if defined(__unix__) && !defined(__ANDROID__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__) -+#if (defined(__unix__) || defined(__HAIKU__)) && !defined(__ANDROID__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__) - - #include "../Diagnostic.h" - -diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp -index 5329756..f8dee1e 100644 ---- a/src/openrct2/platform/Platform.Posix.cpp -+++ b/src/openrct2/platform/Platform.Posix.cpp -@@ -7,7 +7,7 @@ - * OpenRCT2 is licensed under the GNU General Public License version 3. - *****************************************************************************/ - --#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) || defined(__NetBSD__) -+#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__HAIKU__) - - #include "Platform.h" - -diff --git a/src/openrct2/platform/Platform.h b/src/openrct2/platform/Platform.h -index 6d477c7..94e9aba 100644 ---- a/src/openrct2/platform/Platform.h -+++ b/src/openrct2/platform/Platform.h -@@ -147,7 +147,7 @@ namespace OpenRCT2::Platform - - SteamPaths GetSteamPaths(); - bool triggerSteamDownload(); --#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) || defined(__NetBSD__) -+#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__HAIKU__) - std::string GetEnvironmentPath(const char* name); - std::string GetHomePath(); - #endif --- -2.52.0 - - -From 3a05fa620126970ae4415f4e79bc5a317114de40 Mon Sep 17 00:00:00 2001 -From: Peppersawce -Date: Tue, 23 Dec 2025 14:58:19 +0100 -Subject: Disable installing linux desktop files - - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5e33ea6..8a2b6da 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -517,6 +517,7 @@ if (NOT MACOS_BUNDLE OR (MACOS_BUNDLE AND WITH_TESTS)) - endif() - install(TARGETS "openrct2-cli" OPTIONAL RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - install(FILES ${DOC_FILES} DESTINATION "${CMAKE_INSTALL_DOCDIR}") -+ if (NOT HAIKU) - install(FILES "distribution/linux/io.openrct2.openrct2.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") - if (NOT DISABLE_GUI) - install(FILES "resources/logo/icon_x16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "openrct2.png") -@@ -534,6 +535,7 @@ if (NOT MACOS_BUNDLE OR (MACOS_BUNDLE AND WITH_TESTS)) - install(FILES "distribution/linux/io.openrct2.uri.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") - endif() - install(FILES "distribution/linux/io.openrct2.mimeinfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages/" RENAME "openrct2.xml") -+ endif() - install(DIRECTORY "distribution/man/" DESTINATION "${CMAKE_INSTALL_MANDIR}/man6" FILES_MATCHING PATTERN "*.6") - - if (MACOS_USE_DEPENDENCIES) --- -2.52.0 - - -From 726948309b8fa4980f330be5bd51ae6343cccfe4 Mon Sep 17 00:00:00 2001 -From: Peppersawce -Date: Wed, 24 Dec 2025 14:51:59 +0100 -Subject: Disable multi-threading by default - - -diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp -index 2aef53b..672cb20 100644 ---- a/src/openrct2/config/Config.cpp -+++ b/src/openrct2/config/Config.cpp -@@ -238,7 +238,7 @@ namespace OpenRCT2::Config - // Always have multi-threading disabled in debug builds, this makes things slower. - model->multiThreading = false; - #else -- model->multiThreading = reader->GetBoolean("multithreading", true); -+ model->multiThreading = reader->GetBoolean("multithreading", false); - #endif // _DEBUG - model->trapCursor = reader->GetBoolean("trap_cursor", false); - model->autoOpenShops = reader->GetBoolean("auto_open_shops", false); --- -2.52.0 diff --git a/games-simulation/openrct2/patches/openrct2-0.4.31.patchset b/games-simulation/openrct2/patches/openrct2-0.4.31.patchset new file mode 100644 index 000000000..5b4985659 --- /dev/null +++ b/games-simulation/openrct2/patches/openrct2-0.4.31.patchset @@ -0,0 +1,92 @@ +From e3f44d1b10bb9099b1df2a47efd53c72e9ffe463 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Tue, 23 Dec 2025 11:58:37 +0100 +Subject: Haiku patch for gcc + + +diff --git a/src/openrct2/core/Range.hpp b/src/openrct2/core/Range.hpp +index 6e15dd6..7a1ac3d 100644 +--- a/src/openrct2/core/Range.hpp ++++ b/src/openrct2/core/Range.hpp +@@ -29,6 +29,10 @@ struct Range + T Change{}; + + private: ++ #if defined(__GNUC__) && !defined(__clang__) ++ #pragma GCC diagnostic push ++ #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" ++ #endif + Iterator(const Range& range, T initialValue) + : Lower(range.Lower) + , Upper(range.Upper) +@@ -36,6 +40,9 @@ struct Range + , Change(range.Upper >= range.Lower ? 1 : -1) + { + } ++ #if defined(__GNUC__) && !defined(__clang__) ++ #pragma GCC diagnostic pop ++ #endif + + public: + Iterator& operator++() +-- +2.52.0 + + +From e24b67062f3938df68128668b5d68c0ca52baaad Mon Sep 17 00:00:00 2001 +From: Peppersawce +Date: Sun, 1 Feb 2026 20:58:59 +0100 +Subject: Fix Haiku build + + +diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp +index d68e1e7..a7983d8 100644 +--- a/src/openrct2/core/String.cpp ++++ b/src/openrct2/core/String.cpp +@@ -38,7 +38,7 @@ + #include "StringBuilder.h" + #include "UTF8.h" + +-#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) ++#if defined(__unix__) || defined(__HAIKU__) || (defined(__APPLE__) && defined(__MACH__)) + #include + #define _stricmp(x, y) strcasecmp((x), (y)) + #endif +-- +2.52.0 + + +From 75d1e70caf67db4fec9447940a5e2a8a36594042 Mon Sep 17 00:00:00 2001 +From: Peppersawce +Date: Sun, 1 Feb 2026 21:22:08 +0100 +Subject: Re-enable multithreading + + +diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp +index e06df18..bc9345c 100644 +--- a/src/openrct2/config/Config.cpp ++++ b/src/openrct2/config/Config.cpp +@@ -50,11 +50,6 @@ static constexpr bool kEnlargedUiDefault = true; + #else + static constexpr bool kEnlargedUiDefault = false; + #endif +-#ifdef __HAIKU__ // Multi-threading is unstable here +-static constexpr bool kMultiThreadingDefault = false; +-#else +-static constexpr bool kMultiThreadingDefault = true; +-#endif + + namespace OpenRCT2::Config + { +@@ -243,7 +238,7 @@ namespace OpenRCT2::Config + // Always have multi-threading disabled in debug builds, this makes things slower. + model->multiThreading = false; + #else +- model->multiThreading = reader->GetBoolean("multithreading", kMultiThreadingDefault); ++ model->multiThreading = reader->GetBoolean("multithreading", true); + #endif // _DEBUG + model->trapCursor = reader->GetBoolean("trap_cursor", false); + model->autoOpenShops = reader->GetBoolean("auto_open_shops", false); +-- +2.52.0 +