The package rpms/freecad.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/freecad.git/commit/?id=f7440d5416....
Change:
+%ifarch x86_64 aarch64
Thanks.
Full change:
============
commit f7440d54161a5206774c017dfb956425ec1ccad8
Author: Richard Shaw <hobbes1069(a)gmail.com>
Date: Sat Jan 14 06:48:30 2023 -0600
Add ifarch since Qt WebEngine seems to only be available for x86_64 and aarch64.
diff --git a/freecad.spec b/freecad.spec
index 8eaed26..988d915 100644
--- a/freecad.spec
+++ b/freecad.spec
@@ -61,7 +61,11 @@ BuildRequires: eigen3-devel
BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5Svg)
BuildRequires: cmake(Qt5UiTools)
+%ifarch x86_64 aarch64
BuildRequires: cmake(Qt5WebEngine)
+%else
+BuildRequires: cmake(Qt5WebKit)
+%endif
BuildRequires: cmake(Qt5XmlPatterns)
#BuildRequires: SoQt-devel
BuildRequires: xerces-c xerces-c-devel
commit 8c8cc452e8d1ca10257bfb6c4cf3a4770e7fffd6
Author: Richard Shaw <hobbes1069(a)gmail.com>
Date: Fri Jan 13 21:16:02 2023 -0600
Update to 0.20.2.
diff --git a/.gitignore b/.gitignore
index 21aaced..6130b33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,4 @@
/FreeCAD-0.19.4.tar.gz
/FreeCAD-0.20.tar.gz
/FreeCAD-0.20.1.tar.gz
+/FreeCAD-0.20.2.tar.gz
diff --git a/freecad.spec b/freecad.spec
index da89492..8eaed26 100644
--- a/freecad.spec
+++ b/freecad.spec
@@ -20,8 +20,8 @@
Name: freecad
Epoch: 1
-Version: 0.20.1
-Release: 1%{?dist}.1
+Version: 0.20.2
+Release: 1%{?dist}
Summary: A general purpose 3D CAD modeler
License: GPLv2+
@@ -30,9 +30,6 @@ Source0:
https://github.com/FreeCAD/FreeCAD/archive/%{version}%{?pre:_pre
Source102: freecad.1
Patch0: freecad-unbundled-pycxx.patch
-# The following two patches are for Python 3.11 compatibility
-Patch1:
https://github.com/FreeCAD/FreeCAD/commit/1ae55905ba.patch
-Patch2:
https://github.com/FreeCAD/FreeCAD/commit/6820e0a9ec.patch
#
https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
%if 0%{?fedora} > 36
@@ -244,6 +241,9 @@ desktop-file-validate \
%changelog
+* Fri Jan 13 2023 Richard Shaw <hobbes1069(a)gmail.com> - 1:0.20.2-1
+- Update to 0.20.2.
+
* Tue Aug 30 2022 Richard Shaw <hobbes1069(a)gmail.com> - 1:0.20.1-1.1
- Rebuild for retagged upstream source, fixes rhbz#2121671.
- Readd Python 3.11 patches that did not make it into the current release.
diff --git a/sources b/sources
index 79cb3db..794f262 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (FreeCAD-0.20.1.tar.gz) =
ab4cfab4008300b8273769b9395602261c88c19f0893dabe6498a2eac020f1fe3fbf7284928144f1d4147d8627a47d83a40a1777a298673da2e24d956006d827
+SHA512 (FreeCAD-0.20.2.tar.gz) =
f3f90751c7a19a112f7683aafc920ff913962b36aa1886990908d9597fe0565e7e108eca9cd35edfc1640ef6400674f8ade26310f43f9dc3d5b054625403ad70
commit f41cdb153f4b5ae5a1dc037e0eb57db32f8be99f
Author: Richard Shaw <hobbes1069(a)gmail.com>
Date: Sun Oct 30 09:00:14 2022 -0500
Migrate from deprecated QtWebKit to QtWebEngine.
diff --git a/freecad.spec b/freecad.spec
index d8d2097..da89492 100644
--- a/freecad.spec
+++ b/freecad.spec
@@ -64,7 +64,7 @@ BuildRequires: eigen3-devel
BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5Svg)
BuildRequires: cmake(Qt5UiTools)
-BuildRequires: cmake(Qt5WebKit)
+BuildRequires: cmake(Qt5WebEngine)
BuildRequires: cmake(Qt5XmlPatterns)
#BuildRequires: SoQt-devel
BuildRequires: xerces-c xerces-c-devel
commit b7dc8261bd74796019fb8ae3d3157895deefd31b
Author: Richard Shaw <hobbes1069(a)gmail.com>
Date: Tue Aug 30 08:13:15 2022 -0500
Rebuild for retagged upstream source, fixes rhbz#2121671.
Readd Python 3.11 patches that did not make it into the current release.
diff --git a/1ae55905ba.patch b/1ae55905ba.patch
new file mode 100644
index 0000000..d543806
--- /dev/null
+++ b/1ae55905ba.patch
@@ -0,0 +1,214 @@
+From 1ae55905ba7e89278bf656ebcc57ea1088e8fa44 Mon Sep 17 00:00:00 2001
+From: wmayer <wmayer(a)users.sourceforge.net>
+Date: Fri, 1 Jul 2022 17:54:50 +0200
+Subject: [PATCH] Py: make FreeCAD to compile with Py3.11
+
+---
+ src/Base/ConsoleObserver.cpp | 6 ++++
+ src/Base/Interpreter.cpp | 56 ++++++++++++++++++++++++++++++++++++
+ src/Base/PyObjectBase.cpp | 4 +++
+ src/Base/PyTools.c | 10 ++++++-
+ src/Gui/Command.cpp | 7 +++++
+ src/Gui/PythonDebugger.cpp | 17 +++++++++--
+ 6 files changed, 97 insertions(+), 3 deletions(-)
+
+diff --git a/src/Base/ConsoleObserver.cpp b/src/Base/ConsoleObserver.cpp
+index c6428a7f18be..ab3b3e9157b1 100644
+--- a/src/Base/ConsoleObserver.cpp
++++ b/src/Base/ConsoleObserver.cpp
+@@ -266,7 +266,13 @@ std::stringstream &LogLevel::prefix(std::stringstream &str,
const char *src, int
+ PyFrameObject* frame = PyEval_GetFrame();
+ if (frame) {
+ line = PyFrame_GetLineNumber(frame);
++#if PY_VERSION_HEX < 0x030b0000
+ src = PyUnicode_AsUTF8(frame->f_code->co_filename);
++#else
++ PyCodeObject* code = PyFrame_GetCode(frame);
++ src = PyUnicode_AsUTF8(code->co_filename);
++ Py_DECREF(code);
++#endif
+ }
+ }
+ if (print_src && src && src[0]) {
+diff --git a/src/Base/Interpreter.cpp b/src/Base/Interpreter.cpp
+index 2bacea30cbb7..5a476094b749 100644
+--- a/src/Base/Interpreter.cpp
++++ b/src/Base/Interpreter.cpp
+@@ -523,6 +523,7 @@ void InterpreterSingleton::addPythonPath(const char* Path)
+ list.append(Py::String(Path));
+ }
+
++#if PY_VERSION_HEX < 0x030b0000
+ const char* InterpreterSingleton::init(int argc,char *argv[])
+ {
+ if (!Py_IsInitialized()) {
+@@ -565,6 +566,61 @@ const char* InterpreterSingleton::init(int argc,char *argv[])
+ PyGILStateLocker lock;
+ return Py_EncodeLocale(Py_GetPath(),nullptr);
+ }
++#else
++namespace {
++void initInterpreter(int argc,char *argv[])
++{
++ PyStatus status;
++ PyConfig config;
++ PyConfig_InitPythonConfig(&config);
++
++ status = PyConfig_SetBytesArgv(&config, argc, argv);
++ if (PyStatus_Exception(status)) {
++ throw Base::RuntimeError("Failed to set config");
++ }
++
++ status = Py_InitializeFromConfig(&config);
++ if (PyStatus_Exception(status)) {
++ throw Base::RuntimeError("Failed to init from config");
++ }
++
++ PyConfig_Clear(&config);
++
++ Py_Initialize();
++ const char* virtualenv = getenv("VIRTUAL_ENV");
++ if (virtualenv) {
++ PyRun_SimpleString(
++ "# Check for virtualenv, and activate if present.\n"
++ "# See
https://virtualenv.pypa.io/en/latest/userguide/#using-virtualenv-without-...
++ "import os\n"
++ "import sys\n"
++ "base_path = os.getenv(\"VIRTUAL_ENV\")\n"
++ "if not base_path is None:\n"
++ " activate_this = os.path.join(base_path, \"bin\",
\"activate_this.py\")\n"
++ " exec(open(activate_this).read(),
{'__file__':activate_this})\n"
++ );
++ }
++}
++}
++const char* InterpreterSingleton::init(int argc,char *argv[])
++{
++ try {
++ if (!Py_IsInitialized()) {
++ initInterpreter(argc, argv);
++
++ PythonStdOutput::init_type();
++ this->_global = PyEval_SaveThread();
++ }
++
++ PyGILStateLocker lock;
++ return Py_EncodeLocale(Py_GetPath(),nullptr);
++ }
++ catch (const Base::Exception& e) {
++ e.ReportException();
++ throw;
++ }
++}
++#endif
+
+ void InterpreterSingleton::replaceStdOutput()
+ {
+diff --git a/src/Base/PyObjectBase.cpp b/src/Base/PyObjectBase.cpp
+index 773a61b259b3..343ab26999f6 100644
+--- a/src/Base/PyObjectBase.cpp
++++ b/src/Base/PyObjectBase.cpp
+@@ -60,7 +60,11 @@ PyObjectBase::PyObjectBase(void* p,PyTypeObject *T)
+ , baseProxy(nullptr)
+ , attrDict(nullptr)
+ {
++#if PY_VERSION_HEX < 0x030b0000
+ Py_TYPE(this) = T;
++#else
++ Py_SET_TYPE(this, T);
++#endif
+ _Py_NewReference(this);
+ #ifdef FC_LOGPYOBJECTS
+ Base::Console().Log("PyO+: %s (%p)\n",T->tp_name, this);
+diff --git a/src/Base/PyTools.c b/src/Base/PyTools.c
+index 71569e26a200..492d0c8563a4 100644
+--- a/src/Base/PyTools.c
++++ b/src/Base/PyTools.c
+@@ -15,8 +15,10 @@ is provided on an as is basis, without warranties of any kind.
+ #include <string.h>
+ #include <assert.h>
+ #include <compile.h>
+-#include <eval.h>
+ #include <frameobject.h>
++#if PY_VERSION_HEX < 0x030b0000
++#include <eval.h>
++#endif
+
+
+ /*****************************************************************************
+@@ -310,7 +312,13 @@ void PP_Fetch_Error_Text()
+ if(!frame)
+ return;
+ int line = PyFrame_GetLineNumber(frame);
++#if PY_VERSION_HEX < 0x030b0000
+ const char *file = PyUnicode_AsUTF8(frame->f_code->co_filename);
++#else
++ PyCodeObject* code = PyFrame_GetCode(frame);
++ const char *file = PyUnicode_AsUTF8(code->co_filename);
++ Py_DECREF(code);
++#endif
+ #ifdef FC_OS_WIN32
+ const char *_f = strstr(file, "\\src\\");
+ #else
+diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp
+index c9568e8f0e69..cf555439fcd2 100644
+--- a/src/Gui/Command.cpp
++++ b/src/Gui/Command.cpp
+@@ -657,8 +657,15 @@ void Command::printPyCaller() {
+ if(!frame)
+ return;
+ int line = PyFrame_GetLineNumber(frame);
++#if PY_VERSION_HEX < 0x030b0000
+ const char *file = PyUnicode_AsUTF8(frame->f_code->co_filename);
+ printCaller(file?file:"<no file>",line);
++#else
++ PyCodeObject* code = PyFrame_GetCode(frame);
++ const char* file = PyUnicode_AsUTF8(code->co_filename);
++ printCaller(file?file:"<no file>",line);
++ Py_DECREF(code);
++#endif
+ }
+
+ void Command::printCaller(const char *file, int line) {
+diff --git a/src/Gui/PythonDebugger.cpp b/src/Gui/PythonDebugger.cpp
+index 7e731a9dd6af..cd44e9b1c233 100644
+--- a/src/Gui/PythonDebugger.cpp
++++ b/src/Gui/PythonDebugger.cpp
+@@ -563,6 +563,14 @@ void PythonDebugger::hideDebugMarker(const QString& fn)
+ }
+ }
+
++#if PY_VERSION_HEX < 0x030900B1
++static PyCodeObject* PyFrame_GetCode(PyFrameObject *frame)
++{
++ Py_INCREF(frame->f_code);
++ return frame->f_code;
++}
++#endif
++
+ //
http://www.koders.com/cpp/fidBA6CD8A0FE5F41F1464D74733D9A711DA257D20B.asp...
+ //
http://code.google.com/p/idapython/source/browse/trunk/python.cpp
+ //
http://www.koders.com/cpp/fid191F7B13CF73133935A7A2E18B7BF43ACC6D1784.asp...
+@@ -578,7 +586,9 @@ int PythonDebugger::tracer_callback(PyObject *obj, PyFrameObject
*frame, int wha
+
+ //no = frame->f_tstate->recursion_depth;
+ //std::string funcname = PyString_AsString(frame->f_code->co_name);
+- QString file =
QString::fromUtf8(PyUnicode_AsUTF8(frame->f_code->co_filename));
++ PyCodeObject* code = PyFrame_GetCode(frame);
++ QString file = QString::fromUtf8(PyUnicode_AsUTF8(code->co_filename));
++ Py_DECREF(code);
+ switch (what) {
+ case PyTrace_CALL:
+ self->depth++;
+@@ -592,7 +602,10 @@ int PythonDebugger::tracer_callback(PyObject *obj, PyFrameObject
*frame, int wha
+ //PyObject *str;
+ //str = PyObject_Str(frame->f_code->co_filename);
+ //no = frame->f_lineno;
+- int line = PyCode_Addr2Line(frame->f_code, frame->f_lasti);
++ PyCodeObject* f_code = PyFrame_GetCode(frame);
++ int f_lasti = PyFrame_GetLineNumber(frame);
++ int line = PyCode_Addr2Line(f_code, f_lasti);
++ Py_DECREF(f_code);
+ //if (str) {
+ // Base::Console().Message("PROFILING: %s:%d\n",
PyString_AsString(str), frame->f_lineno);
+ // Py_DECREF(str);
diff --git a/6820e0a9ec.patch b/6820e0a9ec.patch
new file mode 100644
index 0000000..735beae
--- /dev/null
+++ b/6820e0a9ec.patch
@@ -0,0 +1,22 @@
+From 6820e0a9ec85203a6f342ca72a2ff8fd417beaf1 Mon Sep 17 00:00:00 2001
+From: wmayer <wmayer(a)users.sourceforge.net>
+Date: Sat, 2 Jul 2022 19:36:27 +0200
+Subject: [PATCH] Py3: properly port to Py3.11
+
+---
+ src/Base/PyObjectBase.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Base/PyObjectBase.cpp b/src/Base/PyObjectBase.cpp
+index 343ab26999f6..a8e1b327809b 100644
+--- a/src/Base/PyObjectBase.cpp
++++ b/src/Base/PyObjectBase.cpp
+@@ -63,7 +63,7 @@ PyObjectBase::PyObjectBase(void* p,PyTypeObject *T)
+ #if PY_VERSION_HEX < 0x030b0000
+ Py_TYPE(this) = T;
+ #else
+- Py_SET_TYPE(this, T);
++ this->ob_type = T;
+ #endif
+ _Py_NewReference(this);
+ #ifdef FC_LOGPYOBJECTS
diff --git a/freecad.spec b/freecad.spec
index 758b06c..d8d2097 100644
--- a/freecad.spec
+++ b/freecad.spec
@@ -30,6 +30,9 @@ Source0:
https://github.com/FreeCAD/FreeCAD/archive/%{version}%{?pre:_pre
Source102: freecad.1
Patch0: freecad-unbundled-pycxx.patch
+# The following two patches are for Python 3.11 compatibility
+Patch1:
https://github.com/FreeCAD/FreeCAD/commit/1ae55905ba.patch
+Patch2:
https://github.com/FreeCAD/FreeCAD/commit/6820e0a9ec.patch
#
https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
%if 0%{?fedora} > 36
@@ -54,6 +57,7 @@ BuildRequires: opencascade-devel
BuildRequires: Coin4-devel
BuildRequires: python3-devel
BuildRequires: python3-matplotlib
+BuildRequires: python3-pivy
BuildRequires: boost-devel
BuildRequires: eigen3-devel
# Qt5 dependencies
@@ -242,6 +246,7 @@ desktop-file-validate \
%changelog
* Tue Aug 30 2022 Richard Shaw <hobbes1069(a)gmail.com> - 1:0.20.1-1.1
- Rebuild for retagged upstream source, fixes rhbz#2121671.
+- Readd Python 3.11 patches that did not make it into the current release.
* Tue Aug 09 2022 Richard Shaw <hobbes1069(a)gmail.com> - 1:0.20.1-1
- Update to 0.20.1.