Files
haikuports/games-strategy/wesnoth/patches/wesnoth-1.18.6.patchset
2026-03-28 15:39:52 +01:00

69 lines
2.0 KiB
Plaintext

From 256caf7b9e6e709227de5eef279af024f0506caf Mon Sep 17 00:00:00 2001
From: Peppersawce <michaelpeppers89@yahoo.it>
Date: Sat, 22 Mar 2025 12:46:25 +0100
Subject: Fix CMake build, get Haiku version
via uname
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ea34f9..1e3cf82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,12 +66,12 @@ if(ENABLE_SYSTEM_LUA)
if(NOT LUA_FOUND)
message(FATAL_ERROR "Lua ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR} C++ not found. Try setting 'LUA_DIR'.")
endif()
-else()
- if(NOT EXISTS "${CMAKE_SOURCE_DIR}/src/modules/lua/.git")
- message(FATAL_ERROR "Lua submodule does not exist. You must run 'git submodule update --init --recursive' to initialize it.")
- else()
- message("-- Lua submodule found.")
- endif()
+#else()
+# if(NOT EXISTS "${CMAKE_SOURCE_DIR}/src/modules/lua/.git")
+# message(FATAL_ERROR "Lua submodule does not exist. You must run 'git submodule update --init --recursive' to initialize it.")
+# else()
+# message("-- Lua submodule found.")
+# endif()
endif()
# set what std version to use
diff --git a/src/desktop/version.cpp b/src/desktop/version.cpp
index 401f249..0522fd0 100644
--- a/src/desktop/version.cpp
+++ b/src/desktop/version.cpp
@@ -25,7 +25,7 @@
#include <cstring>
-#if defined(__APPLE__) || defined(_X11)
+#if defined(__APPLE__) || defined(_X11) || defined(__HAIKU__)
#include <sys/utsname.h>
#endif
@@ -216,7 +216,7 @@ std::map<std::string, std::string> parse_fdo_osrelease(const std::string& path)
std::string os_version()
{
-#if defined(__APPLE__) || defined(_X11)
+#if defined(__APPLE__) || defined(_X11) || defined(__HAIKU__)
// Some systems, e.g. SunOS, need "struct" here
struct utsname u;
@@ -396,6 +396,12 @@ std::string os_version()
return base + " " + version + " " + windows_runtime_arch();
+#elif defined(__HAIKU__)
+ // POSIX uname version fallback.
+
+ return formatter() << u.sysname << ' '
+ << u.version << ' '
+ << u.machine;
#else
//
--
2.48.1