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
545 changes: 202 additions & 343 deletions org.freecad.FreeCAD.yaml

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions patches/0001-Always-link-to-python-libraries.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From e9591e27db4ae3412d4504a69a8afebee9a1b83e Mon Sep 17 00:00:00 2001
From: Christophe Giboudeaux <[email protected]>
Date: Tue, 27 Jul 2021 14:54:00 +0200
Subject: [PATCH] Always link to python libraries.

Change-Id: I687191431adaff55927de353db8f81dfa30ba1b1
---
sources/shiboken6/cmake/ShibokenHelpers.cmake | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sources/shiboken6/cmake/ShibokenHelpers.cmake b/sources/shiboken6/cmake/ShibokenHelpers.cmake
index 27ee333..4be2ad1 100644
--- a/sources/shiboken6/cmake/ShibokenHelpers.cmake
+++ b/sources/shiboken6/cmake/ShibokenHelpers.cmake
@@ -425,13 +425,9 @@ macro(shiboken_compute_python_libraries)
"SHIBOKEN_COMPUTE_LIBS" "shiboken_compute_python_libraries"
"IS_CALLED_FROM_EXPORT" "" "" ${ARGN})

- if (NOT SHIBOKEN_PYTHON_LIBRARIES)
- set(SHIBOKEN_PYTHON_LIBRARIES "")
- endif()
-
- if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES)
- set(SHIBOKEN_PYTHON_LIBRARIES ${Python_LIBRARIES})
- endif()
+ # Always link to python libraries.
+ message(STATUS "Linking shiboken to ${Python_LIBRARIES}")
+ set(SHIBOKEN_PYTHON_LIBRARIES ${Python_LIBRARIES})

# If the resulting variable
# contains a "debug;X;optimized;Y" list like described in shiboken_check_if_limited_api,
--
2.46.1

121 changes: 121 additions & 0 deletions patches/0001-Fix-AppendOutput-signature-for-Swig-4.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
From 879ed9d8cf54fc46939da1af987d7b5515ecdf98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <[email protected]>
Date: Fri, 7 Mar 2025 17:34:06 +0100
Subject: [PATCH] Fix AppendOutput signature for Swig 4.3

Also fix the med_err return value mapping. Older Swig version discarded
the first "None" value from the resultobj if there were additional
output parameters. Now, the result has to be discarded (it is handled
by the %exception specification), and if there is no OUTPUT parameter
the resultobj has to be initialized with Py_None.

See https://github.com/swig/swig/issues/3084
---
python/med_array_typemap.i | 4 ++--
python/med_bool_typemap.i | 2 +-
python/med_common.i | 15 ++++++++++-----
python/med_enum_typemap.i | 2 +-
python/med_enumtest_typemap.i | 2 +-
5 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/python/med_array_typemap.i b/python/med_array_typemap.i
index 6712b35..23e784b 100644
--- a/python/med_array_typemap.i
+++ b/python/med_array_typemap.i
@@ -181,7 +181,7 @@ Type.__repr__= lambda self: #Type +"("+str([x for x in self])+")"
// TypeMed * const ParamName : OUT 2/4 (l'allocation Type est faite ds Python)
%typemap(freearg) TypeMed * const ParamName {
Py_INCREF(o$argnum);
- $result=SWIG_Python_AppendOutput($result, o$argnum);
+ $result=SWIG_AppendOutput($result, o$argnum);
}
// TypeMed * const (OUT) 3/4
// pour ne pas activer un out du TypeMed * const (par sécurité)
@@ -290,7 +290,7 @@ Type.__repr__= lambda self: #Type +"("+str([x for x in self])+")"
// unsigned char * const : OUT 2/4 (l'allocation Type est faite ds Python)
%typemap(freearg) unsigned char * const {
Py_INCREF(o$argnum);
- $result=SWIG_Python_AppendOutput($result, o$argnum);
+ $result=SWIG_AppendOutput($result, o$argnum);
}
// unsigned char * const (OUT) 3/4
// pour ne pas activer un out du unsigned char * const (par sécurité)
diff --git a/python/med_bool_typemap.i b/python/med_bool_typemap.i
index 73c3660..26bce34 100644
--- a/python/med_bool_typemap.i
+++ b/python/med_bool_typemap.i
@@ -22,7 +22,7 @@
/* Py_DECREF(o2); */
/* Py_DECREF(o3); */
/* } */
- $result=SWIG_Python_AppendOutput($result, o);
+ $result=SWIG_AppendOutput($result, o);
}

%typemap(in,numinputs=0) med_bool *(med_bool temp) {
diff --git a/python/med_common.i b/python/med_common.i
index f48a8b0..c458b14 100644
--- a/python/med_common.i
+++ b/python/med_common.i
@@ -11,13 +11,11 @@
$action
if ( result < 0 ) {
/* fprintf(stderr,"Code erreur MED : %2d\n",result); */
- /* SWIG_exception(SWIG_RuntimeError,"Error returned from MEDfichier API (funcname)."); */
PyObject* exobj = PyTuple_New(2);
PyTuple_SetItem(exobj,0,PyString_FromString("Error returned from MEDfichier API (funcname)."));
PyTuple_SetItem(exobj,1,PyInt_FromLong((long) result));
SWIG_Python_SetErrorObj(PyExc_RuntimeError,exobj);
- /* PyErr_SetString(PyExc_Exception, str(result)); */
- return NULL;
+ SWIG_fail;
}
}
%enddef
@@ -101,8 +99,15 @@ MEDINT64=None
//Désactive toutes les sorties d'erreur
//les erreurs sont gérées par les exceptions
%typemap(out) med_err {
- Py_INCREF(Py_None);
- $result=Py_None;
+ // Suppress MyErr output, error codes already handled by %expection
+}
+%typemap(ret) med_err {
+ // In case the wrapped function has not OUTPUT parameters result
+ // is a nullptr, push the requite None object
+ if (!$result) {
+ $result = Py_None;
+ Py_INCREF($result);
+ }
}

//Ajoute la fonctionnalité de passage d'arguments par mot clés
diff --git a/python/med_enum_typemap.i b/python/med_enum_typemap.i
index 9c14ac5..b5ff5ee 100644
--- a/python/med_enum_typemap.i
+++ b/python/med_enum_typemap.i
@@ -111,7 +111,7 @@ Type.__repr__= lambda self: #Type +"("+str(self.val)+")"
pargs = Py_BuildValue("(i)",*$1);
pinst = PyEval_CallObject(pclass, pargs);
if (pinst == NULL) printf("%s\n","Can't instanciate class $1_basetype");
- $result=SWIG_Python_AppendOutput($result, pinst);
+ $result=SWIG_AppendOutput($result, pinst);
}

%typemap(in,numinputs=0) TypeEnum * (TypeEnum temp) {
diff --git a/python/med_enumtest_typemap.i b/python/med_enumtest_typemap.i
index 604b700..0c96a8a 100644
--- a/python/med_enumtest_typemap.i
+++ b/python/med_enumtest_typemap.i
@@ -130,7 +130,7 @@ public:
pargs = Py_BuildValue("(i)",*$1);
pinst = PyEval_CallObject(pclass, pargs);
if (pinst == NULL) printf("%s\n","Can't instanciate class $1_basetype");
- $result=SWIG_Python_AppendOutput($result, pinst);
+ $result=SWIG_AppendOutput($result, pinst);
}

%typemap(in,numinputs=0) TypeEnum * (TypeEnum temp) {
--
2.48.1

57 changes: 57 additions & 0 deletions patches/0001-Fix-installation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From c069622d35a00485742b125caf9439b31b1b972f Mon Sep 17 00:00:00 2001
From: Christophe Marin <[email protected]>
Date: Tue, 7 Oct 2025 15:54:32 +0200
Subject: [PATCH] Fix installation

Upstream decided to install files in non-standard locations.
---
sources/pyside6/CMakeLists.txt | 2 +-
sources/shiboken6/generator/CMakeLists.txt | 4 ++--
sources/shiboken6/libshiboken/CMakeLists.txt | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sources/pyside6/CMakeLists.txt b/sources/pyside6/CMakeLists.txt
index 6b73d70..74aaba5 100644
--- a/sources/pyside6/CMakeLists.txt
+++ b/sources/pyside6/CMakeLists.txt
@@ -40,7 +40,7 @@ install(EXPORT PySide6Targets
if(NOT is_pyside6_superproject_build)
install(EXPORT PySide6WheelTargets
NAMESPACE PySide6::
- DESTINATION "${LIB_INSTALL_DIR}/wheels/cmake/PySide6"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide6"
FILE PySide6Targets.cmake)
endif()

diff --git a/sources/shiboken6/generator/CMakeLists.txt b/sources/shiboken6/generator/CMakeLists.txt
index 997468f..d0948d9 100644
--- a/sources/shiboken6/generator/CMakeLists.txt
+++ b/sources/shiboken6/generator/CMakeLists.txt
@@ -73,11 +73,11 @@ install(EXPORT "${package_name}Targets"
if(NOT is_pyside6_superproject_build)
install(TARGETS shiboken6
EXPORT "${package_name}WheelTargets"
- DESTINATION "shiboken6_generator")
+ DESTINATION "${BIN_INSTALL_DIR}")

install(EXPORT "${package_name}WheelTargets"
NAMESPACE "Shiboken6::"
- DESTINATION "${LIB_INSTALL_DIR}/wheels/cmake/${package_name}"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/${package_name}"
FILE "${package_name}Targets.cmake")
endif()

diff --git a/sources/shiboken6/libshiboken/CMakeLists.txt b/sources/shiboken6/libshiboken/CMakeLists.txt
index 973d14b..c4235f8 100644
--- a/sources/shiboken6/libshiboken/CMakeLists.txt
+++ b/sources/shiboken6/libshiboken/CMakeLists.txt
@@ -217,6 +217,6 @@ if(NOT is_pyside6_superproject_build)

install(EXPORT Shiboken6WheelTargets
NAMESPACE Shiboken6::
- DESTINATION "${LIB_INSTALL_DIR}/wheels/cmake/Shiboken6"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken6"
FILE Shiboken6Targets.cmake)
endif()
--
2.51.0
50 changes: 50 additions & 0 deletions patches/0001-Fixup-spooles-include-dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From e551c655e45c8aa84b60a2540a35eecfd4d9cc5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <[email protected]>
Date: Thu, 12 Nov 2020 03:59:31 +0100
Subject: [PATCH] Fixup spooles include dir

---
src/cascade.c | 6 +++---
src/spooles.h | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/cascade.c b/src/cascade.c
index 796d5cf..c996f12 100644
--- a/src/cascade.c
+++ b/src/cascade.c
@@ -21,9 +21,9 @@
#include <string.h>

#ifdef SPOOLES
-#include <misc.h>
-#include <FrontMtx.h>
-#include <SymbFac.h>
+#include <spooles/misc.h>
+#include <spooles/FrontMtx.h>
+#include <spooles/SymbFac.h>
#endif

#include "CalculiX.h"
diff --git a/src/spooles.h b/src/spooles.h
index 388f1ff..6966215 100755
--- a/src/spooles.h
+++ b/src/spooles.h
@@ -23,11 +23,11 @@
*/

#include <pthread.h>
-#include <misc.h>
-#include <FrontMtx.h>
-#include <SymbFac.h>
+#include <spooles/misc.h>
+#include <spooles/FrontMtx.h>
+#include <spooles/SymbFac.h>
#if USE_MT
-#include <MT/spoolesMT.h>
+#include <spooles/MT/spoolesMT.h>
#endif

/* increase this for debugging */
--
2.30.1

Loading