git: 7c2c2a20c27a - main - cad/freecad: Fix build with LLVM 19

From: Joel Bodenmann <jbo_at_FreeBSD.org>
Date: Fri, 21 Feb 2025 20:14:52 UTC
The branch main has been updated by jbo:

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

commit 7c2c2a20c27af2c6dfdc8342ac39bb5c882c3eba
Author:     Joel Bodenmann <jbo@FreeBSD.org>
AuthorDate: 2025-02-21 19:20:26 +0000
Commit:     Joel Bodenmann <jbo@FreeBSD.org>
CommitDate: 2025-02-21 20:14:19 +0000

    cad/freecad: Fix build with LLVM 19
    
    Import patch to fix build
    
    Source:
    https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-freecad/001-clang19-char-traits.patch
    
    PR:             284096
    Reported by:    Keith White <kwhite.uottawa@gmail.com>
    Reviewed by:    diizzy
    Approved by:    portmgr (maintainer timeout, 4+ weeks)
---
 cad/freecad/Makefile                                |  2 +-
 cad/freecad/files/patch-src_CXX_Python3_Objects.hxx | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/cad/freecad/Makefile b/cad/freecad/Makefile
index 8832c728cd9d..4f8d87554a63 100644
--- a/cad/freecad/Makefile
+++ b/cad/freecad/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	FreeCAD
 DISTVERSION=	1.0.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	cad
 
 MAINTAINER=	cmt@FreeBSD.org
diff --git a/cad/freecad/files/patch-src_CXX_Python3_Objects.hxx b/cad/freecad/files/patch-src_CXX_Python3_Objects.hxx
new file mode 100644
index 000000000000..1bca4004ca3c
--- /dev/null
+++ b/cad/freecad/files/patch-src_CXX_Python3_Objects.hxx
@@ -0,0 +1,20 @@
+--- src/CXX/Python3/Objects.hxx.orig	2024-11-18 16:48:00 UTC
++++ src/CXX/Python3/Objects.hxx
+@@ -1787,7 +1787,7 @@ namespace Py
+     typedef std::basic_string<Py_UNICODE> unicodestring;
+     extern Py_UNICODE unicode_null_string[1];
+ #endif
+-    typedef std::basic_string<Py_UCS4> ucs4string;
++    typedef std::basic_string<char32_t> ucs4string;
+     extern Py_UCS4 ucs4_null_string[1];
+ 
+     class PYCXX_EXPORT Byte: public Object
+@@ -2237,7 +2237,7 @@ namespace Py
+             {
+                 ifPyErrorThrowCxxException();
+             }
+-            ucs4string ucs4( buf, size() );
++            ucs4string ucs4( reinterpret_cast<const char32_t*>(buf), size() );
+             delete[] buf;
+ 
+             return ucs4;