Hello community, here is the log from the commit of package FreeCAD for openSUSE:Factory checked in at 2019-02-08 12:09:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/FreeCAD (Old) and /work/SRC/openSUSE:Factory/.FreeCAD.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "FreeCAD" Fri Feb 8 12:09:46 2019 rev:10 rq:671003 version:0.17.1545162057.e1db7bff8 Changes: -------- --- /work/SRC/openSUSE:Factory/FreeCAD/FreeCAD.changes 2018-09-07 15:41:01.898431440 +0200 +++ /work/SRC/openSUSE:Factory/.FreeCAD.new.28833/FreeCAD.changes 2019-02-08 12:10:31.965533833 +0100 @@ -1,0 +2,13 @@ +Mon Feb 4 08:28:22 UTC 2019 - Adrian Schröter <[email protected]> + +- update to current branch: + - Spreadsheet: Fixed issue #3361. + +------------------------------------------------------------------- +Fri Feb 1 09:42:55 UTC 2019 - [email protected] + +- Add upstream patches to fix build with python 3.7: + * get-rid-of-private-function-_PyImport_FixupBuiltin-for-__FreeCADBase__-module.patch + * get-rid-of-private-function-_PyImport_FixupBuiltin-for-FreeCAD-and-FreeCADGui-modules.patch + +------------------------------------------------------------------- Old: ---- FreeCAD-0.17.1534399137.9948ee4f1.obscpio New: ---- FreeCAD-0.17.1545162057.e1db7bff8.obscpio get-rid-of-private-function-_PyImport_FixupBuiltin-for-FreeCAD-and-FreeCADGui-modules.patch get-rid-of-private-function-_PyImport_FixupBuiltin-for-__FreeCADBase__-module.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ FreeCAD-test.spec ++++++ --- /var/tmp/diff_new_pack.LmawmC/_old 2019-02-08 12:10:46.725528297 +0100 +++ /var/tmp/diff_new_pack.LmawmC/_new 2019-02-08 12:10:46.733528294 +0100 @@ -1,7 +1,7 @@ # # spec file for package FreeCAD-test # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: FreeCAD-test -Version: 0.17.1534399137.9948ee4f1 +Version: 0.17.1545162057.e1db7bff8 Release: 0 Summary: Meta source package that runs the FreeCAD testsuite when built License: LGPL-2.0-or-later AND GPL-2.0-or-later ++++++ FreeCAD.spec ++++++ --- /var/tmp/diff_new_pack.LmawmC/_old 2019-02-08 12:10:46.757528285 +0100 +++ /var/tmp/diff_new_pack.LmawmC/_new 2019-02-08 12:10:46.761528283 +0100 @@ -1,7 +1,7 @@ # # spec file for package FreeCAD # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,14 +12,14 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define x_prefix %{_libdir}/%{name} Name: FreeCAD -Version: 0.17.1534399137.9948ee4f1 +Version: 0.17.1545162057.e1db7bff8 Release: 0 Summary: General Purpose 3D CAD Modeler License: LGPL-2.0-or-later AND GPL-2.0-or-later @@ -37,6 +37,10 @@ Patch3: fix-draft-module-with-python3.patch # PATCH-FIX-UPSTREAM -- fix-build-with-Qt5_11.diff Patch4: fix-build-with-Qt5_11.diff +# PATCH-FIX-UPSTREAM -- https://github.com/FreeCAD/FreeCAD/commit/8c08635d3 +Patch5: get-rid-of-private-function-_PyImport_FixupBuiltin-for-__FreeCADBase__-module.patch +# PATCH-FIX-UPSTREAM -- https://github.com/FreeCAD/FreeCAD/commit/b79e1bfee +Patch6: get-rid-of-private-function-_PyImport_FixupBuiltin-for-FreeCAD-and-FreeCADGui-modules.patch BuildRequires: Coin-devel #BuildRequires: SoQt-devel #BuildRequires: libmed-devel # needed for FEM module, but requires older hdf5 lib ++++++ FreeCAD-0.17.1534399137.9948ee4f1.obscpio -> FreeCAD-0.17.1545162057.e1db7bff8.obscpio ++++++ /work/SRC/openSUSE:Factory/FreeCAD/FreeCAD-0.17.1534399137.9948ee4f1.obscpio /work/SRC/openSUSE:Factory/.FreeCAD.new.28833/FreeCAD-0.17.1545162057.e1db7bff8.obscpio differ: char 8, line 1 ++++++ FreeCAD.obsinfo ++++++ --- /var/tmp/diff_new_pack.LmawmC/_old 2019-02-08 12:10:46.833528256 +0100 +++ /var/tmp/diff_new_pack.LmawmC/_new 2019-02-08 12:10:46.837528255 +0100 @@ -1,5 +1,5 @@ name: FreeCAD -version: 0.17.1534399137.9948ee4f1 -mtime: 1534399137 -commit: 9948ee4f1570df9216862a79705afb367b2c6ffb +version: 0.17.1545162057.e1db7bff8 +mtime: 1545162057 +commit: e1db7bff8ff36439373eb9a426567d8afe289c4d ++++++ get-rid-of-private-function-_PyImport_FixupBuiltin-for-FreeCAD-and-FreeCADGui-modules.patch ++++++ >From b79e1bfee45d003e5ba646d828faca5d673f3e9b Mon Sep 17 00:00:00 2001 From: wmayer <[email protected]> Date: Sat, 1 Sep 2018 19:57:15 +0200 Subject: [PATCH] get rid of private function _PyImport_FixupBuiltin for FreeCAD and FreeCADGui modules --- src/App/Application.cpp | 38 ++++++++++++++++++++++++++++++-------- src/Gui/Application.cpp | 6 ++++-- src/Main/MainPy.cpp | 4 +++- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 82270e3eea0..0895a8c83ac 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -226,6 +226,21 @@ init_freecad_base_module(void) }; return PyModule_Create(&BaseModuleDef); } + +// Set in inside Application +static PyMethodDef* __AppMethods = nullptr; + +PyMODINIT_FUNC +init_freecad_module(void) +{ + static struct PyModuleDef FreeCADModuleDef = { + PyModuleDef_HEAD_INIT, + "FreeCAD", FreeCAD_doc, -1, + __AppMethods, + NULL, NULL, NULL, NULL + }; + return PyModule_Create(&FreeCADModuleDef); +} #endif Application::Application(std::map<std::string,std::string> &mConfig) @@ -239,14 +254,15 @@ Application::Application(std::map<std::string,std::string> &mConfig) // setting up Python binding Base::PyGILStateLocker lock; #if PY_MAJOR_VERSION >= 3 - static struct PyModuleDef FreeCADModuleDef = { - PyModuleDef_HEAD_INIT, - "FreeCAD", FreeCAD_doc, -1, - Application::Methods, - NULL, NULL, NULL, NULL - }; - PyObject* pAppModule = PyModule_Create(&FreeCADModuleDef); - _PyImport_FixupBuiltin(pAppModule, "FreeCAD"); + PyObject* modules = PyImport_GetModuleDict(); + + __AppMethods = Application::Methods; + PyObject* pAppModule = PyImport_ImportModule ("FreeCAD"); + if (!pAppModule) { + PyErr_Clear(); + pAppModule = init_freecad_module(); + PyDict_SetItemString(modules, "FreeCAD", pAppModule); + } #else PyObject* pAppModule = Py_InitModule3("FreeCAD", Application::Methods, FreeCAD_doc); #endif @@ -282,6 +298,11 @@ Application::Application(std::map<std::string,std::string> &mConfig) #if PY_MAJOR_VERSION >= 3 PyObject* pBaseModule = PyImport_ImportModule ("__FreeCADBase__"); + if (!pBaseModule) { + PyErr_Clear(); + pBaseModule = init_freecad_base_module(); + PyDict_SetItemString(modules, "__FreeCADBase__", pBaseModule); + } #else PyObject* pBaseModule = Py_InitModule3("__FreeCADBase__", NULL, Base_doc); #endif @@ -1427,6 +1448,7 @@ void Application::initConfig(int argc, char ** argv) // init python #if PY_MAJOR_VERSION >= 3 + PyImport_AppendInittab ("FreeCAD", init_freecad_module); PyImport_AppendInittab ("__FreeCADBase__", init_freecad_base_module); #endif mConfig["PythonSearchPath"] = Interpreter().init(argc,argv); diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 33ddde2b4c6..8715c8d6e52 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -345,7 +345,8 @@ Application::Application(bool GUIenabled) #if PY_MAJOR_VERSION >= 3 // if this returns a valid pointer then the 'FreeCADGui' Python module was loaded, // otherwise the executable was launched - PyObject *module = PyImport_AddModule("FreeCADGui"); + PyObject* modules = PyImport_GetModuleDict(); + PyObject* module = PyDict_GetItemString(modules, "FreeCADGui"); if (!module) { static struct PyModuleDef FreeCADGuiModuleDef = { PyModuleDef_HEAD_INIT, @@ -354,7 +355,8 @@ Application::Application(bool GUIenabled) NULL, NULL, NULL, NULL }; module = PyModule_Create(&FreeCADGuiModuleDef); - _PyImport_FixupBuiltin(module, "FreeCADGui"); + + PyDict_SetItemString(modules, "FreeCADGui", module); } else { // extend the method list diff --git a/src/Main/MainPy.cpp b/src/Main/MainPy.cpp index 061740903c0..58b86fa7991 100644 --- a/src/Main/MainPy.cpp +++ b/src/Main/MainPy.cpp @@ -225,7 +225,9 @@ PyMOD_INIT_FUNC(FreeCAD) free(argv); #if PY_MAJOR_VERSION >= 3 - PyObject* module = _PyImport_FindBuiltin("FreeCAD"); + //PyObject* module = _PyImport_FindBuiltin("FreeCAD"); + PyObject* modules = PyImport_GetModuleDict(); + PyObject* module = PyDict_GetItemString(modules, "FreeCAD"); if (!module) { PyErr_SetString(PyExc_ImportError, "Failed to load FreeCAD module!"); } ++++++ get-rid-of-private-function-_PyImport_FixupBuiltin-for-__FreeCADBase__-module.patch ++++++ >From 8c08635d301c3418810e5c8984bdb9f2c17cb9dc Mon Sep 17 00:00:00 2001 From: wmayer <[email protected]> Date: Sat, 1 Sep 2018 16:26:18 +0200 Subject: [PATCH] get rid of private function _PyImport_FixupBuiltin for __FreeCADBase__ module --- src/App/Application.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index f719cd2375a..82270e3eea0 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -212,6 +212,22 @@ PyDoc_STRVAR(Base_doc, "like vector, matrix, bounding box, placement, rotation, axis, ...\n" ); +#if PY_MAJOR_VERSION >= 3 +// This is called via the PyImport_AppendInittab mechanism called +// during initialization, to make the built-in __FreeCADBase__ +// module known to Python. +PyMODINIT_FUNC +init_freecad_base_module(void) +{ + static struct PyModuleDef BaseModuleDef = { + PyModuleDef_HEAD_INIT, + "__FreeCADBase__", Base_doc, -1, + NULL, NULL, NULL, NULL, NULL + }; + return PyModule_Create(&BaseModuleDef); +} +#endif + Application::Application(std::map<std::string,std::string> &mConfig) : _mConfig(mConfig), _pActiveDoc(0) { @@ -265,13 +281,7 @@ Application::Application(std::map<std::string,std::string> &mConfig) // remove these types from the FreeCAD module. #if PY_MAJOR_VERSION >= 3 - static struct PyModuleDef BaseModuleDef = { - PyModuleDef_HEAD_INIT, - "__FreeCADBase__", Base_doc, -1, - NULL, NULL, NULL, NULL, NULL - }; - PyObject* pBaseModule = PyModule_Create(&BaseModuleDef); - _PyImport_FixupBuiltin(pBaseModule, "__FreeCADBase__"); + PyObject* pBaseModule = PyImport_ImportModule ("__FreeCADBase__"); #else PyObject* pBaseModule = Py_InitModule3("__FreeCADBase__", NULL, Base_doc); #endif @@ -1416,6 +1426,9 @@ void Application::initConfig(int argc, char ** argv) # endif // init python +#if PY_MAJOR_VERSION >= 3 + PyImport_AppendInittab ("__FreeCADBase__", init_freecad_base_module); +#endif mConfig["PythonSearchPath"] = Interpreter().init(argc,argv); // Parse the options that have impact on the init process
