From: Nam Nguyen Subject: unbreak games/openmw libc++19 To: pascal@stumpf.co Cc: ports@openbsd.org Date: Tue, 02 Sep 2025 19:04:35 -0700 Here is an inline diff to unbreak openmw with libc++19. I backported the fix from the new version 0.49.0, so it can be removed once openmw is updated. upstream decided to use span instead of basic_string_view. some links of interest: https://gitlab.com/OpenMW/openmw/-/commit/e5ad1cd2144cfedf0418a30a125bf057734150f0 https://reviews.llvm.org/D157058 https://reviews.llvm.org/D138307 I was able to play. I did have to uninstall, remove the global defaults.bin and reinstall for it to launch successfully. --8<---------------cut here---------------start------------->8--- --- -openmw-0.48.0p2 ------------------- You should also remove /etc/openmw/defaults.bin (which was modified) Loading settings file: /etc/openmw/defaults.bin [18:46:01.116 E] Error: Trying to retrieve a non-existing setting: log buffer size. [18:46:01.116 E] Make sure the defaults.bin file was properly installed. --8<---------------cut here---------------end--------------->8--- Feedback and tests are welcome. OK? Index: Makefile =================================================================== RCS file: /cvs/ports/games/openmw/Makefile,v diff -u -p -r1.35 Makefile --- Makefile 2 Sep 2025 12:22:24 -0000 1.35 +++ Makefile 3 Sep 2025 01:40:26 -0000 @@ -1,4 +1,3 @@ -BROKEN = implicit instantiation of undefined template 'std::char_traits' ONLY_FOR_ARCHS = amd64 i386 COMMENT = open source implementation of TES III: Morrowind @@ -8,7 +7,7 @@ GH_ACCOUNT = OpenMW GH_PROJECT = openmw GH_TAGNAME = openmw-$V DISTNAME = openmw-$V -REVISION = 1 +REVISION = 2 DISTFILES.a = e75adf86f91eb3082220085e42dda62679f9a3ea.zip DIST_SUBDIR = openmw Index: patches/patch-components_to_utf8_to_utf8_cpp =================================================================== RCS file: patches/patch-components_to_utf8_to_utf8_cpp diff -N patches/patch-components_to_utf8_to_utf8_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-components_to_utf8_to_utf8_cpp 3 Sep 2025 01:40:26 -0000 @@ -0,0 +1,14 @@ +Fix build with libc++19; backported from openmw-0.49.0 + +Index: components/to_utf8/to_utf8.cpp +--- components/to_utf8/to_utf8.cpp.orig ++++ components/to_utf8/to_utf8.cpp +@@ -52,7 +52,7 @@ namespace + return std::find_if(input.begin(), input.end(), [] (unsigned char v) { return v == 0 || v >= 128; }); + } + +- std::basic_string_view getTranslationArray(FromType sourceEncoding) ++ std::span getTranslationArray(FromType sourceEncoding) + { + switch (sourceEncoding) + { Index: patches/patch-components_to_utf8_to_utf8_hpp =================================================================== RCS file: patches/patch-components_to_utf8_to_utf8_hpp diff -N patches/patch-components_to_utf8_to_utf8_hpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-components_to_utf8_to_utf8_hpp 3 Sep 2025 01:40:26 -0000 @@ -0,0 +1,22 @@ +Fix build with libc++19; backported from openmw-0.49.0 + +Index: components/to_utf8/to_utf8.hpp +--- components/to_utf8/to_utf8.hpp.orig ++++ components/to_utf8/to_utf8.hpp +@@ -3,6 +3,7 @@ + + #include + #include ++#include + #include + #include + +@@ -46,7 +47,7 @@ namespace ToUTF8 + inline std::pair getLengthLegacyEnc(std::string_view input) const; + inline void copyFromArrayLegacyEnc(std::string_view::iterator& chp, std::string_view::iterator end, char* &out) const; + +- const std::basic_string_view mTranslationArray; ++ const std::span mTranslationArray; + }; + + class Utf8Encoder