git: f53aee55c0c0 - main - games/openmw: Switch Qt5 -> Qt6 (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Tue, 29 Jul 2025 10:10:43 UTC
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f53aee55c0c0069817c67b0e43cba9061b479c0f

commit f53aee55c0c0069817c67b0e43cba9061b479c0f
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2025-07-29 10:06:17 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2025-07-29 10:10:33 +0000

    games/openmw: Switch Qt5 -> Qt6 (+)
    
    Improve crashhandler structures patch
    Also unbreak i386 build by backpoting MR4791 from upstream
---
 games/openmw/Makefile                              | 12 +++----
 .../patch-components_crashcatcher_crashcatcher.cpp | 37 +++++++++++++++-------
 games/openmw/files/patch-components_esm_formid.hpp | 17 ++++++++++
 .../patch-components_misc_strings_algorithm.hpp    | 28 ++++++++++++++++
 4 files changed, 75 insertions(+), 19 deletions(-)

diff --git a/games/openmw/Makefile b/games/openmw/Makefile
index fbd17c143ac4..ef831d06890e 100644
--- a/games/openmw/Makefile
+++ b/games/openmw/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	openmw
 DISTVERSIONPREFIX=	openmw-
 DISTVERSION=	0.49.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	games
 
 MAINTAINER=	fluffy@FreeBSD.org
@@ -15,6 +15,7 @@ LIB_DEPENDS=	libavcodec.so.60:multimedia/ffmpeg \
 		libboost_thread.so:devel/boost-libs \
 		libMyGUIEngine.so:x11-toolkits/mygui \
 		libBulletCollision.so:devel/bullet@double \
+		libcollada-dom2.5-dp.so:devel/collada-dom \
 		libosg.so:graphics/osg \
 		libRecast.so:graphics/recastnavigation \
 		libunshield.so:archivers/unshield \
@@ -23,18 +24,15 @@ LIB_DEPENDS=	libavcodec.so.60:multimedia/ffmpeg \
 		libyaml-cpp.so:devel/yaml-cpp
 
 USES=		cmake compiler:c++20-lang desktop-file-utils gl luajit openal \
-		pkgconfig qt:5 sdl sqlite xorg
+		pkgconfig qt:6 sdl sqlite xorg
 USE_GITHUB=	yes
 GH_ACCOUNT=	OpenMW
 USE_GL=		gl
-USE_QT=		core gui linguisttools network opengl printsupport svg widgets \
-		buildtools:build qmake:build
-#USE_QT=		base imageformats multimedia svg tools:build
+USE_QT=		base imageformats multimedia svg tools:build
 USE_SDL=	sdl2
 USE_CXXSTD=	c++20
-#USE_GCC=	yes
 
-CMAKE_ARGS=	-DDESIRED_QT_VERSION=5 \
+CMAKE_ARGS=	-DDESIRED_QT_VERSION=${_QT_VER} \
 		-DOPENMW_USE_SYSTEM_BULLET=ON \
 		-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=ON \
 		-DGLOBAL_DATA_PATH="${PREFIX}/share" \
diff --git a/games/openmw/files/patch-components_crashcatcher_crashcatcher.cpp b/games/openmw/files/patch-components_crashcatcher_crashcatcher.cpp
index 7d1fc2f20462..9a6941316d2b 100644
--- a/games/openmw/files/patch-components_crashcatcher_crashcatcher.cpp
+++ b/games/openmw/files/patch-components_crashcatcher_crashcatcher.cpp
@@ -1,29 +1,42 @@
 --- components/crashcatcher/crashcatcher.cpp.orig	2025-07-01 11:41:15 UTC
 +++ components/crashcatcher/crashcatcher.cpp
-@@ -95,6 +95,8 @@ namespace
-         { ILL_PRVREG, "Privileged register" },
+@@ -83,6 +83,7 @@ namespace
+         { SIGFPE, "FPU exception", "SIGFPE" },
+         { SIGBUS, "System BUS error", "SIGBUS" },
+         { SIGABRT, "Abnormal termination condition", "SIGABRT" },
++        { 0, nullptr },
+     };
+ 
+     constexpr SignalInfo sigIllCodes[] = {
+@@ -96,6 +97,7 @@ namespace
          { ILL_COPROC, "Coprocessor error" },
          { ILL_BADSTK, "Internal stack error" },
-+#else
-+        { 0, nullptr },
  #endif
++        { 0, nullptr },
+     };
+ 
+     constexpr SignalInfo sigFpeCodes[] = {
+@@ -107,6 +109,7 @@ namespace
+         { FPE_FLTRES, "Floating point inexact result" },
+         { FPE_FLTINV, "Floating point invalid operation" },
+         { FPE_FLTSUB, "Subscript out of range" },
++        { 0, nullptr },
      };
  
-@@ -113,6 +115,8 @@ namespace
- #ifndef __FreeBSD__
+     constexpr SignalInfo sigSegvCodes[] = {
+@@ -114,6 +117,7 @@ namespace
          { SEGV_MAPERR, "Address not mapped to object" },
          { SEGV_ACCERR, "Invalid permissions for mapped object" },
-+#else
-+        { 0, nullptr },
  #endif
++        { 0, nullptr },
      };
  
-@@ -121,6 +125,8 @@ namespace
-         { BUS_ADRALN, "Invalid address alignment" },
+     constexpr SignalInfo sigBusCodes[] = {
+@@ -122,6 +126,7 @@ namespace
          { BUS_ADRERR, "Non-existent physical address" },
          { BUS_OBJERR, "Object specific hardware error" },
-+#else
-+        { 0, nullptr },
  #endif
++        { 0, nullptr },
      };
  
+     const char* findSignalDescription(std::span<const SignalInfo> info, int code)
diff --git a/games/openmw/files/patch-components_esm_formid.hpp b/games/openmw/files/patch-components_esm_formid.hpp
new file mode 100644
index 000000000000..44f943fea077
--- /dev/null
+++ b/games/openmw/files/patch-components_esm_formid.hpp
@@ -0,0 +1,17 @@
+--- components/esm/formid.hpp.orig	2025-07-01 11:41:15 UTC
++++ components/esm/formid.hpp
+@@ -51,10 +51,10 @@ namespace std
+     {
+         size_t operator()(const ESM::FormId& formId) const
+         {
+-            static_assert(sizeof(ESM::FormId) == sizeof(size_t));
+-            size_t s;
+-            memcpy(&s, &formId, sizeof(size_t));
+-            return hash<size_t>()(s);
++            static_assert(sizeof(ESM::FormId) == sizeof(uint64_t));
++            uint64_t s;
++            memcpy(&s, &formId, sizeof(ESM::FormId));
++            return hash<uint64_t>()(s);
+         }
+     };
+ 
diff --git a/games/openmw/files/patch-components_misc_strings_algorithm.hpp b/games/openmw/files/patch-components_misc_strings_algorithm.hpp
new file mode 100644
index 000000000000..c7aa3b1ecfeb
--- /dev/null
+++ b/games/openmw/files/patch-components_misc_strings_algorithm.hpp
@@ -0,0 +1,28 @@
+--- components/misc/strings/algorithm.hpp.orig	2025-07-01 11:41:15 UTC
++++ components/misc/strings/algorithm.hpp
+@@ -4,6 +4,7 @@
+ #include "lower.hpp"
+ 
+ #include <algorithm>
++#include <cstdint>
+ #include <functional>
+ #include <string>
+ #include <string_view>
+@@ -88,14 +89,14 @@ namespace Misc::StringUtils
+         constexpr std::size_t operator()(std::string_view str) const
+         {
+             // FNV-1a
+-            std::size_t hash{ 0xcbf29ce484222325ull };
+-            constexpr std::size_t prime{ 0x00000100000001B3ull };
++            std::uint64_t hash{ 0xcbf29ce484222325ull };
++            constexpr std::uint64_t prime{ 0x00000100000001B3ull };
+             for (char c : str)
+             {
+-                hash ^= static_cast<std::size_t>(toLower(c));
++                hash ^= static_cast<std::uint64_t>(toLower(c));
+                 hash *= prime;
+             }
+-            return hash;
++            return static_cast<std::size_t>(hash);
+         }
+     };