Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions 0001-Drop-Boost-system.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/cMake/FreeCAD_Helpers/SetupBoost.cmake b/cMake/FreeCAD_Helpers/SetupBoost.cmake
index 0bb1343c3f11..1a389bf797c2 100644
--- a/cMake/FreeCAD_Helpers/SetupBoost.cmake
+++ b/cMake/FreeCAD_Helpers/SetupBoost.cmake
@@ -3,7 +3,7 @@ macro(SetupBoost)

set(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS})

- set (BOOST_COMPONENTS filesystem program_options regex system thread date_time)
+ set (BOOST_COMPONENTS filesystem program_options regex thread date_time)
find_package(Boost ${BOOST_MIN_VERSION}
COMPONENTS ${BOOST_COMPONENTS} REQUIRED)

26 changes: 26 additions & 0 deletions 0002-Link-libOpenGL-instead-of-libGL.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt
index b928eccc124f..18329a26692e 100644
--- a/src/Gui/CMakeLists.txt
+++ b/src/Gui/CMakeLists.txt
@@ -93,7 +93,7 @@ else(MSVC)
FreeCADApp
${COIN3D_LIBRARIES}
${Boost_LIBRARIES}
- ${OPENGL_gl_LIBRARY}
+ ${OPENGL_opengl_LIBRARY}
${3DCONNEXION_LINKFLAGS}
)
endif(MSVC)
diff --git a/src/Mod/CAM/PathSimulator/AppGL/CMakeLists.txt b/src/Mod/CAM/PathSimulator/AppGL/CMakeLists.txt
index 9191cbdc1ffd..1ad2e5492921 100644
--- a/src/Mod/CAM/PathSimulator/AppGL/CMakeLists.txt
+++ b/src/Mod/CAM/PathSimulator/AppGL/CMakeLists.txt
@@ -26,7 +26,7 @@ set(CAMSimulator_LIBS
FreeCADApp
FreeCADGui
${QtOpenGL_LIBRARIES}
- ${OPENGL_gl_LIBRARY}
+ ${OPENGL_opengl_LIBRARY}
)

SET(CAMSimulator_SRCS_Python
86 changes: 86 additions & 0 deletions 0003-Py3.13-Update-PyCXX-to-version-7.1.11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
From 39ca75bac294a69504e1ea551e1615816e3aec06 Mon Sep 17 00:00:00 2001
From: wmayer <wmayer@freecad.org>
Date: Tue, 27 May 2025 11:34:34 +0200
Subject: [PATCH] Py3.13: Update PyCXX to version 7.1.11

---
src/CXX/Python3/Objects.hxx | 12 ++++++------
src/CXX/Python3/cxxsupport.cxx | 2 +-
src/CXX/Version.hxx | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/CXX/Python3/Objects.hxx b/src/CXX/Python3/Objects.hxx
index 4894ba9c2821..0ed3fc969b33 100644
--- a/src/CXX/Python3/Objects.hxx
+++ b/src/CXX/Python3/Objects.hxx
@@ -1787,8 +1787,8 @@ namespace Py
typedef std::basic_string<Py_UNICODE> unicodestring;
extern Py_UNICODE unicode_null_string[1];
#endif
- typedef std::basic_string<Py_UCS4> ucs4string;
- extern Py_UCS4 ucs4_null_string[1];
+ typedef std::basic_string<char32_t> ucs4string;
+ extern char32_t ucs4_null_string[1];

class PYCXX_EXPORT Byte: public Object
{
@@ -2152,13 +2152,13 @@ namespace Py
// Need these c'tors becuase Py_UNICODE is 2 bytes
// User may use "int" or "unsigned int" as the unicode type
String( const unsigned int *s, int length )
- : SeqBase<Char>( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, reinterpret_cast<const Py_UCS4 *>( s ), length ), true )
+ : SeqBase<Char>( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, reinterpret_cast<const char32_t *>( s ), length ), true )
{
validate();
}

String( const int *s, int length )
- : SeqBase<Char>( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, reinterpret_cast<const Py_UCS4 *>( s ), length ), true )
+ : SeqBase<Char>( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, reinterpret_cast<const char32_t *>( s ), length ), true )
{
validate();
}
@@ -2196,7 +2196,7 @@ namespace Py
#if !defined( Py_UNICODE_WIDE ) && !defined( Py_LIMITED_API )
String &operator=( const ucs4string &v )
{
- set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, reinterpret_cast<const Py_UCS4 *>( v.data() ), v.length() ), true );
+ set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, reinterpret_cast<const char32_t *>( v.data() ), v.length() ), true );
return *this;
}
#endif
@@ -2237,7 +2237,7 @@ namespace Py
{
ifPyErrorThrowCxxException();
}
- ucs4string ucs4( buf, size() );
+ ucs4string ucs4( reinterpret_cast<char32_t *>(buf), size() );
delete[] buf;

return ucs4;
diff --git a/src/CXX/Python3/cxxsupport.cxx b/src/CXX/Python3/cxxsupport.cxx
index a22160bd026a..3c58afe9600d 100644
--- a/src/CXX/Python3/cxxsupport.cxx
+++ b/src/CXX/Python3/cxxsupport.cxx
@@ -48,7 +48,7 @@ Py_ssize_t numeric_limits_max()
#if !defined(Py_LIMITED_API)
Py_UNICODE unicode_null_string[1] = { 0 };
#endif
-Py_UCS4 ucs4_null_string[1] = { 0 };
+char32_t ucs4_null_string[1] = { 0 };

Type Object::type() const
{
diff --git a/src/CXX/Version.hxx b/src/CXX/Version.hxx
index 59fe3c203b86..a814ac92d6aa 100644
--- a/src/CXX/Version.hxx
+++ b/src/CXX/Version.hxx
@@ -40,7 +40,7 @@

#define PYCXX_VERSION_MAJOR 7
#define PYCXX_VERSION_MINOR 1
-#define PYCXX_VERSION_PATCH 9
+#define PYCXX_VERSION_PATCH 11
#define PYCXX_MAKEVERSION( major, minor, patch ) ((major<<16)|(minor<<8)|(patch))
#define PYCXX_VERSION PYCXX_MAKEVERSION( PYCXX_VERSION_MAJOR, PYCXX_VERSION_MINOR, PYCXX_VERSION_PATCH )
#endif
115 changes: 115 additions & 0 deletions 0004-Py3.13-Disable-Py_UNICODE-support-in-PyCXX.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
From 692d40916a61c813560c72c80c7c91c8c44b672a Mon Sep 17 00:00:00 2001
From: wmayer <wmayer@freecad.org>
Date: Tue, 27 May 2025 11:54:04 +0200
Subject: [PATCH] Py3.13: Disable Py_UNICODE support in PyCXX

---
src/CXX/Python3/Config.hxx | 4 ++++
src/CXX/Python3/Objects.hxx | 16 ++++++++--------
src/CXX/Python3/cxxsupport.cxx | 2 +-
3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/CXX/Python3/Config.hxx b/src/CXX/Python3/Config.hxx
index 08aa49526957..76bd4b786bdc 100644
--- a/src/CXX/Python3/Config.hxx
+++ b/src/CXX/Python3/Config.hxx
@@ -133,6 +133,10 @@
typedef long int Py_hash_t;
#endif

+#if PY_VERSION_HEX >= 0x030d0000
+#define Py_UNICODE_DEPRECATED
+#endif
+
#ifndef PYCXX_PYTHON_2TO3
#define PYCXX_PYTHON_2TO3
#endif
diff --git a/src/CXX/Python3/Objects.hxx b/src/CXX/Python3/Objects.hxx
index 0ed3fc969b33..e216d6858d8a 100644
--- a/src/CXX/Python3/Objects.hxx
+++ b/src/CXX/Python3/Objects.hxx
@@ -1783,7 +1783,7 @@ namespace Py
// Python strings return strings as individual elements.
// I'll try having a class Char which is a String of length 1
//
-#if !defined(Py_LIMITED_API)
+#if !defined(Py_LIMITED_API) && !defined(Py_UNICODE_DEPRECATED)
typedef std::basic_string<Py_UNICODE> unicodestring;
extern Py_UNICODE unicode_null_string[1];
#endif
@@ -1979,7 +1979,7 @@ namespace Py
validate();
}

-#if !defined( Py_LIMITED_API )
+#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
Char( Py_UNICODE v )
: Object( PyUnicode_FromOrdinal( v ), true )
{
@@ -1987,7 +1987,7 @@ namespace Py
}
#endif

-#if !defined( Py_LIMITED_API )
+#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
Char( const unicodestring &v )
: Object( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast<Py_UNICODE*>( v.data() ),1 ), true )
{
@@ -2008,7 +2008,7 @@ namespace Py
return *this;
}

-#if !defined( Py_LIMITED_API )
+#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
Char &operator=( const unicodestring &v )
{
set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast<Py_UNICODE*>( v.data() ), 1 ), true );
@@ -2016,7 +2016,7 @@ namespace Py
}
#endif

-#if !defined( Py_LIMITED_API )
+#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
Char &operator=( int v_ )
{
Py_UNICODE v( v_ );
@@ -2025,7 +2025,7 @@ namespace Py
}
#endif

-#if !defined( Py_LIMITED_API )
+#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
Char &operator=( Py_UNICODE v )
{
set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, &v, 1 ), true );
@@ -2164,7 +2164,7 @@ namespace Py
}
#endif

-#if !defined( Py_LIMITED_API )
+#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
String( const Py_UNICODE *s, int length )
: SeqBase<Char>( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, s, length ), true )
{
@@ -2185,7 +2185,7 @@ namespace Py
return *this;
}

-#if !defined( Py_LIMITED_API )
+#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
String &operator=( const unicodestring &v )
{
set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast<Py_UNICODE *>( v.data() ), v.length() ), true );
diff --git a/src/CXX/Python3/cxxsupport.cxx b/src/CXX/Python3/cxxsupport.cxx
index 3c58afe9600d..dad7198648dc 100644
--- a/src/CXX/Python3/cxxsupport.cxx
+++ b/src/CXX/Python3/cxxsupport.cxx
@@ -45,7 +45,7 @@ Py_ssize_t numeric_limits_max()
return std::numeric_limits<Py_ssize_t>::max();
}

-#if !defined(Py_LIMITED_API)
+#if !defined(Py_LIMITED_API) && !defined(Py_UNICODE_DEPRECATED)
Py_UNICODE unicode_null_string[1] = { 0 };
#endif
char32_t ucs4_null_string[1] = { 0 };
Loading