From 5b15f7dc8a44db77331581d408425a8e1f9f732a50ec792fe5b67b1e0d712e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Thu, 25 Feb 2021 02:28:55 +0000 Subject: [PATCH] Accepting request 874945 from home:StefanBruens:branches:science - Fix build and tests with OCCT 7.5, add 0001-Part-Import-skip-ci-disable-use-of-Message_ProgressI.patch 0001-import-Hotfix-for-build-failure-from-bad-debug-code.patch 0001-partdesign-fix-failing-tapered-hole-test.patch - Add 0001-add-missing-std-namespace-to-build-on-Debian-10.patch - Cleanup specfile: * Use system PyCXX, drop unused libboost_python3 * Drop some unused dependencies * Remove ChangeLog.txt, not updated since version 0.14 OBS-URL: https://build.opensuse.org/request/show/874945 OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=134 --- ...-ci-disable-use-of-Message_ProgressI.patch | 426 ++++++++++++++++++ ...-std-namespace-to-build-on-Debian-10.patch | 37 ++ ...or-build-failure-from-bad-debug-code.patch | 117 +++++ ...design-fix-failing-tapered-hole-test.patch | 26 ++ FreeCAD.changes | 13 + FreeCAD.spec | 62 ++- 6 files changed, 646 insertions(+), 35 deletions(-) create mode 100644 0001-Part-Import-skip-ci-disable-use-of-Message_ProgressI.patch create mode 100644 0001-add-missing-std-namespace-to-build-on-Debian-10.patch create mode 100644 0001-import-Hotfix-for-build-failure-from-bad-debug-code.patch create mode 100644 0001-partdesign-fix-failing-tapered-hole-test.patch diff --git a/0001-Part-Import-skip-ci-disable-use-of-Message_ProgressI.patch b/0001-Part-Import-skip-ci-disable-use-of-Message_ProgressI.patch new file mode 100644 index 0000000..c789a42 --- /dev/null +++ b/0001-Part-Import-skip-ci-disable-use-of-Message_ProgressI.patch @@ -0,0 +1,426 @@ +From de4de28563383c08f247738623a7ea469604e4d0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Tue, 23 Feb 2021 17:37:07 +0100 +Subject: [PATCH] Part/Import: [skip ci] disable use of + Message_ProgressIndicator for OCC >= 7.5 due to major API changes + +--- + src/Mod/Import/App/AppImportPy.cpp | 8 ++++++++ + src/Mod/Import/Gui/AppImportGuiPy.cpp | 16 ++++++++++++++++ + src/Mod/Part/App/ImportIges.cpp | 6 ++++++ + src/Mod/Part/App/ImportStep.cpp | 4 ++++ + src/Mod/Part/App/ProgressIndicator.cpp | 2 ++ + src/Mod/Part/App/ProgressIndicator.h | 3 +++ + src/Mod/Part/App/TopoShape.cpp | 22 +++++++++++++++++++--- + src/Mod/Part/Gui/TaskCheckGeometry.cpp | 13 ++++++++++++- + src/Mod/Part/Gui/TaskCheckGeometry.h | 4 +++- + 9 files changed, 73 insertions(+), 5 deletions(-) + +diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp +index dfb6234e5a..8c11ee2078 100644 +--- a/src/Mod/Import/App/AppImportPy.cpp ++++ b/src/Mod/Import/App/AppImportPy.cpp +@@ -146,12 +146,16 @@ private: + throw Py::Exception(PyExc_IOError, "cannot read STEP file"); + } + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new Part::ProgressIndicator(100); + aReader.Reader().WS()->MapReader()->SetProgress(pi); + pi->NewScope(100, "Reading STEP file..."); + pi->Show(); ++#endif + aReader.Transfer(hDoc); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + } + catch (OSD_Exception& e) { + Base::Console().Error("%s\n", e.GetMessageString()); +@@ -178,12 +182,16 @@ private: + throw Py::Exception(PyExc_IOError, "cannot read IGES file"); + } + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new Part::ProgressIndicator(100); + aReader.WS()->MapReader()->SetProgress(pi); + pi->NewScope(100, "Reading IGES file..."); + pi->Show(); ++#endif + aReader.Transfer(hDoc); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + // http://opencascade.blogspot.de/2009/03/unnoticeable-memory-leaks-part-2.html + Handle(IGESToBRep_Actor)::DownCast(aReader.WS()->TransferReader()->Actor()) + ->SetModel(new IGESData_IGESModel); +diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp +index 8f9ace29c7..9414e622a8 100644 +--- a/src/Mod/Import/Gui/AppImportGuiPy.cpp ++++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp +@@ -391,12 +391,16 @@ private: + throw Py::Exception(PyExc_IOError, "cannot read STEP file"); + } + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new Part::ProgressIndicator(100); + aReader.Reader().WS()->MapReader()->SetProgress(pi); + pi->NewScope(100, "Reading STEP file..."); + pi->Show(); ++#endif + aReader.Transfer(hDoc); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + } + catch (OSD_Exception& e) { + Base::Console().Error("%s\n", e.GetMessageString()); +@@ -423,12 +427,16 @@ private: + throw Py::Exception(Base::BaseExceptionFreeCADError, "cannot read IGES file"); + } + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new Part::ProgressIndicator(100); + aReader.WS()->MapReader()->SetProgress(pi); + pi->NewScope(100, "Reading IGES file..."); + pi->Show(); ++#endif + aReader.Transfer(hDoc); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + // http://opencascade.blogspot.de/2009/03/unnoticeable-memory-leaks-part-2.html + Handle(IGESToBRep_Actor)::DownCast(aReader.WS()->TransferReader()->Actor()) + ->SetModel(new IGESData_IGESModel); +@@ -601,12 +609,16 @@ private: + throw Py::Exception(PyExc_IOError, "cannot read STEP file"); + } + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new Part::ProgressIndicator(100); + aReader.Reader().WS()->MapReader()->SetProgress(pi); + pi->NewScope(100, "Reading STEP file..."); + pi->Show(); ++#endif + aReader.Transfer(hDoc); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + } + else if (file.hasExtension("igs") || file.hasExtension("iges")) { + Base::Reference hGrp = App::GetApplication().GetUserParameter() +@@ -623,12 +635,16 @@ private: + throw Py::Exception(PyExc_IOError, "cannot read IGES file"); + } + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new Part::ProgressIndicator(100); + aReader.WS()->MapReader()->SetProgress(pi); + pi->NewScope(100, "Reading IGES file..."); + pi->Show(); ++#endif + aReader.Transfer(hDoc); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + // http://opencascade.blogspot.de/2009/03/unnoticeable-memory-leaks-part-2.html + Handle(IGESToBRep_Actor)::DownCast(aReader.WS()->TransferReader()->Actor()) + ->SetModel(new IGESData_IGESModel); +diff --git a/src/Mod/Part/App/ImportIges.cpp b/src/Mod/Part/App/ImportIges.cpp +index abc0faeb59..f004e9bc36 100644 +--- a/src/Mod/Part/App/ImportIges.cpp ++++ b/src/Mod/Part/App/ImportIges.cpp +@@ -52,6 +52,8 @@ + #include + #include + #include ++#include ++ + + #include + #include +@@ -90,16 +92,20 @@ int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName) + + #if 1 + std::string aName = fi.fileNamePure(); ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); + pi->NewScope(100, "Reading IGES file..."); + pi->Show(); + aReader.WS()->MapReader()->SetProgress(pi); ++#endif + + // make model + aReader.ClearShapes(); + //Standard_Integer nbRootsForTransfer = aReader.NbRootsForTransfer(); + aReader.TransferRoots(); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + + // put all other free-flying shapes into a single compound + Standard_Boolean emptyComp = Standard_True; +diff --git a/src/Mod/Part/App/ImportStep.cpp b/src/Mod/Part/App/ImportStep.cpp +index 828c27040b..9db9e397d8 100644 +--- a/src/Mod/Part/App/ImportStep.cpp ++++ b/src/Mod/Part/App/ImportStep.cpp +@@ -105,10 +105,12 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name) + throw Base::FileException("Cannot open STEP file"); + } + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); + aReader.WS()->MapReader()->SetProgress(pi); + pi->NewScope(100, "Reading STEP file..."); + pi->Show(); ++#endif + + // Root transfers + Standard_Integer nbr = aReader.NbRootsForTransfer(); +@@ -117,7 +119,9 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name) + Base::Console().Log("STEP: Transferring Root %d\n",n); + aReader.TransferRoot(n); + } ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + + // Collecting resulting entities + Standard_Integer nbs = aReader.NbShapes(); +diff --git a/src/Mod/Part/App/ProgressIndicator.cpp b/src/Mod/Part/App/ProgressIndicator.cpp +index c5f9d64261..8eb0fcadd1 100644 +--- a/src/Mod/Part/App/ProgressIndicator.cpp ++++ b/src/Mod/Part/App/ProgressIndicator.cpp +@@ -54,6 +54,7 @@ using namespace Part; + \endcode + */ + ++#if OCC_VERSION_HEX < 0x070500 + ProgressIndicator::ProgressIndicator (int theMaxVal) + : myProgress(new Base::SequencerLauncher("", theMaxVal)) + { +@@ -83,3 +84,4 @@ Standard_Boolean ProgressIndicator::UserBreak() + { + return myProgress->wasCanceled(); + } ++#endif +diff --git a/src/Mod/Part/App/ProgressIndicator.h b/src/Mod/Part/App/ProgressIndicator.h +index 73214c0716..ad34d2ee5e 100644 +--- a/src/Mod/Part/App/ProgressIndicator.h ++++ b/src/Mod/Part/App/ProgressIndicator.h +@@ -25,11 +25,13 @@ + #define PART_PROGRESSINDICATOR_H + + #include ++#include + #include + #include + + namespace Part { + ++#if OCC_VERSION_HEX < 0x070500 + class PartExport ProgressIndicator : public Message_ProgressIndicator + { + public: +@@ -42,6 +44,7 @@ public: + private: + std::unique_ptr myProgress; + }; ++#endif + + } + +diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp +index cc8772e6ed..5615f217a7 100644 +--- a/src/Mod/Part/App/TopoShape.cpp ++++ b/src/Mod/Part/App/TopoShape.cpp +@@ -584,17 +584,21 @@ void TopoShape::importIges(const char *FileName) + if (aReader.ReadFile(encodeFilename(FileName).c_str()) != IFSelect_RetDone) + throw Base::FileException("Error in reading IGES"); + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); + pi->NewScope(100, "Reading IGES file..."); + pi->Show(); + aReader.WS()->MapReader()->SetProgress(pi); ++#endif + + // make brep + aReader.ClearShapes(); + aReader.TransferRoots(); + // one shape that contains all subshapes + this->_Shape = aReader.OneShape(); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + } + catch (Standard_Failure& e) { + throw Base::CADKernelError(e.GetMessageString()); +@@ -608,16 +612,20 @@ void TopoShape::importStep(const char *FileName) + if (aReader.ReadFile(encodeFilename(FileName).c_str()) != IFSelect_RetDone) + throw Base::FileException("Error in reading STEP"); + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); + aReader.WS()->MapReader()->SetProgress(pi); + pi->NewScope(100, "Reading STEP file..."); + pi->Show(); ++#endif + + // Root transfers + aReader.TransferRoots(); + // one shape that contains all subshapes + this->_Shape = aReader.OneShape(); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + } + catch (Standard_Failure& e) { + throw Base::CADKernelError(e.GetMessageString()); +@@ -630,7 +638,7 @@ void TopoShape::importBrep(const char *FileName) + // read brep-file + BRep_Builder aBuilder; + TopoDS_Shape aShape; +-#if OCC_VERSION_HEX >= 0x060300 ++#if OCC_VERSION_HEX >= 0x060300 && OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); + pi->NewScope(100, "Reading BREP file..."); + pi->Show(); +@@ -652,16 +660,19 @@ void TopoShape::importBrep(std::istream& str, int indicator) + // read brep-file + BRep_Builder aBuilder; + TopoDS_Shape aShape; +-#if OCC_VERSION_HEX >= 0x060300 ++#if OCC_VERSION_HEX >= 0x060300 && OCC_VERSION_HEX < 0x070500 + if (indicator) { + Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); + pi->NewScope(100, "Reading BREP file..."); + pi->Show(); + BRepTools::Read(aShape,str,aBuilder,pi); + pi->EndScope(); +- } else ++ } ++ else { + BRepTools::Read(aShape,str,aBuilder); ++ } + #else ++ (void)indicator; + BRepTools::Read(aShape,str,aBuilder); + #endif + this->_Shape = aShape; +@@ -750,10 +761,13 @@ void TopoShape::exportStep(const char *filename) const + + const Handle(XSControl_TransferWriter)& hTransferWriter = aWriter.WS()->TransferWriter(); + Handle(Transfer_FinderProcess) hFinder = hTransferWriter->FinderProcess(); ++ ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); + hFinder->SetProgress(pi); + pi->NewScope(100, "Writing STEP file..."); + pi->Show(); ++#endif + + if (aWriter.Transfer(this->_Shape, STEPControl_AsIs) != IFSelect_RetDone) + throw Base::FileException("Error in transferring STEP"); +@@ -767,7 +781,9 @@ void TopoShape::exportStep(const char *filename) const + + if (aWriter.Write(encodeFilename(filename).c_str()) != IFSelect_RetDone) + throw Base::FileException("Writing of STEP failed"); ++#if OCC_VERSION_HEX < 0x070500 + pi->EndScope(); ++#endif + } + catch (Standard_Failure& e) { + throw Base::CADKernelError(e.GetMessageString()); +diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp +index 0b74eec02b..b5d6d11ebb 100644 +--- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp ++++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp +@@ -418,10 +418,12 @@ void TaskCheckGeometryResults::goCheck() + std::vector::iterator it; + ResultEntry *theRoot = new ResultEntry(); + ++#if OCC_VERSION_HEX < 0x070500 + Handle(Message_ProgressIndicator) theProgress = new BOPProgressIndicator(tr("Check geometry"), Gui::getMainWindow()); + theProgress->NewScope("BOP check..."); + #if OCC_VERSION_HEX >= 0x060900 + theProgress->Show(); ++#endif + #endif + + selectedCount = static_cast(selection.size()); +@@ -484,11 +486,18 @@ void TaskCheckGeometryResults::goCheck() + std::string label = "Checking "; + label += feature->Label.getStrValue(); + label += "..."; ++#if OCC_VERSION_HEX < 0x070500 + theProgress->NewScope(label.c_str()); + invalidShapes += goBOPSingleCheck(shape, theRoot, baseName, theProgress); ++#else ++ invalidShapes += goBOPSingleCheck(shape, theRoot, baseName, nullptr); ++#endif ++ ++#if OCC_VERSION_HEX < 0x070500 + theProgress->EndScope(); + if (theProgress->UserBreak()) + break; ++#endif + } + } + } +@@ -613,7 +622,7 @@ int TaskCheckGeometryResults::goBOPSingleCheck(const TopoDS_Shape& shapeIn, Resu + //this is left for another time. + TopoDS_Shape BOPCopy = BRepBuilderAPI_Copy(shapeIn).Shape(); + BOPAlgo_ArgumentAnalyzer BOPCheck; +-#if OCC_VERSION_HEX >= 0x060900 ++#if OCC_VERSION_HEX >= 0x060900 && OCC_VERSION_HEX < 0x070500 + BOPCheck.SetProgressIndicator(theProgress); + #else + Q_UNUSED(theProgress); +@@ -961,6 +970,7 @@ TaskCheckGeometryDialog::~TaskCheckGeometryDialog() + + //////////////////////////////////////////////////////////////////////////////////////////////// + ++#if OCC_VERSION_HEX < 0x070500 + BOPProgressIndicator::BOPProgressIndicator (const QString& title, QWidget* parent) + { + steps = 0; +@@ -1023,5 +1033,6 @@ Standard_Boolean BOPProgressIndicator::UserBreak() + + return Standard_False; + } ++#endif + + #include "moc_TaskCheckGeometry.cpp" +diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.h b/src/Mod/Part/Gui/TaskCheckGeometry.h +index e7d7d31271..1cf595bf85 100644 +--- a/src/Mod/Part/Gui/TaskCheckGeometry.h ++++ b/src/Mod/Part/Gui/TaskCheckGeometry.h +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -147,6 +148,7 @@ private: + QTextEdit *contentLabel; + }; + ++#if OCC_VERSION_HEX < 0x070500 + class BOPProgressIndicator : public Message_ProgressIndicator + { + public: +@@ -162,7 +164,7 @@ private: + QTime time; + QProgressDialog* myProgress; + }; +- ++#endif + } + + #endif // TASKCHECKGEOMETRY_H +-- +2.30.1 + diff --git a/0001-add-missing-std-namespace-to-build-on-Debian-10.patch b/0001-add-missing-std-namespace-to-build-on-Debian-10.patch new file mode 100644 index 0000000..44337f0 --- /dev/null +++ b/0001-add-missing-std-namespace-to-build-on-Debian-10.patch @@ -0,0 +1,37 @@ +From b084e4340f6cad03b7182c2ffe87d8e21610e9a3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Tue, 23 Feb 2021 18:15:05 +0100 +Subject: [PATCH] add missing std:: namespace to build on Debian 10 + +--- + src/Mod/Raytracing/App/RayFeature.cpp | 1 + + src/Mod/TechDraw/App/Geometry.cpp | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/Mod/Raytracing/App/RayFeature.cpp b/src/Mod/Raytracing/App/RayFeature.cpp +index cdd2cb6dc1..235a986851 100644 +--- a/src/Mod/Raytracing/App/RayFeature.cpp ++++ b/src/Mod/Raytracing/App/RayFeature.cpp +@@ -36,6 +36,7 @@ + + + using namespace Raytracing; ++using namespace std; + + PROPERTY_SOURCE(Raytracing::RayFeature, Raytracing::RaySegment) + +diff --git a/src/Mod/TechDraw/App/Geometry.cpp b/src/Mod/TechDraw/App/Geometry.cpp +index 123be79795..16e7487eec 100644 +--- a/src/Mod/TechDraw/App/Geometry.cpp ++++ b/src/Mod/TechDraw/App/Geometry.cpp +@@ -75,6 +75,7 @@ + + using namespace TechDrawGeometry; + using namespace TechDraw; ++using namespace std; + + // Collection of Geometric Features + Wire::Wire() +-- +2.30.1 + diff --git a/0001-import-Hotfix-for-build-failure-from-bad-debug-code.patch b/0001-import-Hotfix-for-build-failure-from-bad-debug-code.patch new file mode 100644 index 0000000..8af2911 --- /dev/null +++ b/0001-import-Hotfix-for-build-failure-from-bad-debug-code.patch @@ -0,0 +1,117 @@ +From 063515f65007c116c4c0e05c1fcf82637b8bf152 Mon Sep 17 00:00:00 2001 +From: Gabriel Wicke +Date: Sun, 17 May 2020 21:09:19 -0700 +Subject: [PATCH] [import] Hotfix for build failure from bad debug code + +Quick fix for a build failure with latest opencascade. Directly use +std::cout instead of custom streams. +--- + src/Mod/Import/App/StepShape.cpp | 29 ++++++++++++----------------- + 1 file changed, 12 insertions(+), 17 deletions(-) + +diff --git a/src/Mod/Import/App/StepShape.cpp b/src/Mod/Import/App/StepShape.cpp +index acd4a9e706..ec714c891e 100644 +--- a/src/Mod/Import/App/StepShape.cpp ++++ b/src/Mod/Import/App/StepShape.cpp +@@ -65,38 +65,33 @@ int StepShape::read(const char* fileName) + throw Base::FileException("Cannot open STEP file"); + } + +- //Standard_Integer ic = Interface_Static::IVal("read.precision.mode"); +- //Standard_Real rp = Interface_Static::RVal("read.maxprecision.val"); +- //Standard_Integer ic = Interface_Static::IVal("read.maxprecision.mode"); +- //Standard_Integer mv = Interface_Static::IVal("read.stdsameparameter.mode"); +- //Standard_Integer rp = Interface_Static::IVal("read.surfacecurve.mode"); +- //Standard_Real era = Interface_Static::RVal("read.encoderegularity.angle"); +- //Standard_Integer ic = Interface_Static::IVal("read.step.product.mode"); ++ //Standard_Integer ic = Interface_Static::IVal("read.precision.mode"); ++ //Standard_Real rp = Interface_Static::RVal("read.maxprecision.val"); ++ //Standard_Integer ic = Interface_Static::IVal("read.maxprecision.mode"); ++ //Standard_Integer mv = Interface_Static::IVal("read.stdsameparameter.mode"); ++ //Standard_Integer rp = Interface_Static::IVal("read.surfacecurve.mode"); ++ //Standard_Real era = Interface_Static::RVal("read.encoderegularity.angle"); ++ //Standard_Integer ic = Interface_Static::IVal("read.step.product.mode"); + //Standard_Integer ic = Interface_Static::IVal("read.step.product.context"); +- //Standard_Integer ic = Interface_Static::IVal("read.step.shape.repr"); ++ //Standard_Integer ic = Interface_Static::IVal("read.step.shape.repr"); + //Standard_Integer ic = Interface_Static::IVal("read.step.assembly.level"); + //Standard_Integer ic = Interface_Static::IVal("read.step.shape.relationship"); +- //Standard_Integer ic = Interface_Static::IVal("read.step.shape.aspect"); ++ //Standard_Integer ic = Interface_Static::IVal("read.step.shape.aspect"); + +- Handle(TColStd_HSequenceOfTransient) list = aReader.GiveList(); ++ Handle(TColStd_HSequenceOfTransient) list = aReader.GiveList(); + + //Use method StepData_StepModel::NextNumberForLabel to find its rank with the following: + //Standard_CString label = "#..."; + Handle(StepData_StepModel) model = aReader.StepModel(); + //rank = model->NextNumberForLabe(label, 0, Standard_False); + +- Handle(Message_PrinterOStream) mstr = new Message_PrinterOStream(); +- Handle(Message_Messenger) msg = new Message_Messenger(mstr); +- + std::cout << "dump of step header:" << std::endl; +- +- model->DumpHeader(msg); ++ model->DumpHeader(std::cout); + + for(int nent=1;nent<=model->NbEntities();nent++) { + Handle(Standard_Transient) entity=model->Entity(nent); +- + std::cout << "label entity " << nent << ":" ; +- model->PrintLabel(entity,msg); ++ model->PrintLabel(entity, std::cout); + std::cout << ";"<< entity->DynamicType()->Name() << std::endl; + } + +-- +2.30.1 + +From 2cb9b147f13419f019f9808ace21d3d2ceae99c5 Mon Sep 17 00:00:00 2001 +From: wmayer +Date: Sat, 30 May 2020 11:56:14 +0200 +Subject: [PATCH] Import: handle OCC versions 7.4.1 and earlier + +--- + src/Mod/Import/App/StepShape.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/Mod/Import/App/StepShape.cpp b/src/Mod/Import/App/StepShape.cpp +index ec714c891e..a27ff781b6 100644 +--- a/src/Mod/Import/App/StepShape.cpp ++++ b/src/Mod/Import/App/StepShape.cpp +@@ -34,6 +34,7 @@ + # include + # include + # include ++# include + + # include + # include +@@ -86,12 +87,22 @@ int StepShape::read(const char* fileName) + //rank = model->NextNumberForLabe(label, 0, Standard_False); + + std::cout << "dump of step header:" << std::endl; ++#if OCC_VERSION_HEX < 0x070401 ++ Handle(Message_PrinterOStream) mstr = new Message_PrinterOStream(); ++ Handle(Message_Messenger) msg = new Message_Messenger(mstr); ++ model->DumpHeader(msg); ++#else + model->DumpHeader(std::cout); ++#endif + +- for(int nent=1;nent<=model->NbEntities();nent++) { ++ for (int nent=1;nent<=model->NbEntities();nent++) { + Handle(Standard_Transient) entity=model->Entity(nent); + std::cout << "label entity " << nent << ":" ; ++#if OCC_VERSION_HEX < 0x070401 ++ model->PrintLabel(entity, msg); ++#else + model->PrintLabel(entity, std::cout); ++#endif + std::cout << ";"<< entity->DynamicType()->Name() << std::endl; + } + +-- +2.30.1 + diff --git a/0001-partdesign-fix-failing-tapered-hole-test.patch b/0001-partdesign-fix-failing-tapered-hole-test.patch new file mode 100644 index 0000000..a432570 --- /dev/null +++ b/0001-partdesign-fix-failing-tapered-hole-test.patch @@ -0,0 +1,26 @@ +From 8be2c08141f0275e9da005bd143771953e982a59 Mon Sep 17 00:00:00 2001 +From: lorenz +Date: Sun, 3 May 2020 07:47:27 +0200 +Subject: [PATCH] partdesign: fix failing tapered hole test + +The given parameters return an invalid shape. This fails with occt7.4 but doesn't with occt7.3. If the angle is 45 degree the cone is self-intersecting as Hole.Depth > Hole.Diameter/2. Changing the Hole.TaperedAngle to 60 degree solves this issue. +--- + src/Mod/PartDesign/PartDesignTests/TestHole.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Mod/PartDesign/PartDesignTests/TestHole.py b/src/Mod/PartDesign/PartDesignTests/TestHole.py +index d84afd69ca..cc838f4a3b 100644 +--- a/src/Mod/PartDesign/PartDesignTests/TestHole.py ++++ b/src/Mod/PartDesign/PartDesignTests/TestHole.py +@@ -68,7 +68,7 @@ class TestHole(unittest.TestCase): + def testTaperedHole(self): + self.Hole.Diameter = 6 + self.Hole.Depth = 5 +- self.Hole.TaperedAngle = 45 ++ self.Hole.TaperedAngle = 60 + self.Hole.ThreadType = 0 + self.Hole.HoleCutType = 0 + self.Hole.DepthType = 0 +-- +2.30.1 + diff --git a/FreeCAD.changes b/FreeCAD.changes index b40276b..c04f0ee 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Feb 23 19:05:09 UTC 2021 - Stefan Brüns + +- Fix build and tests with OCCT 7.5, add + 0001-Part-Import-skip-ci-disable-use-of-Message_ProgressI.patch + 0001-import-Hotfix-for-build-failure-from-bad-debug-code.patch + 0001-partdesign-fix-failing-tapered-hole-test.patch +- Add 0001-add-missing-std-namespace-to-build-on-Debian-10.patch +- Cleanup specfile: + * Use system PyCXX, drop unused libboost_python3 + * Drop some unused dependencies + * Remove ChangeLog.txt, not updated since version 0.14 + ------------------------------------------------------------------- Mon Jan 4 22:02:50 UTC 2021 - Stefan Brüns diff --git a/FreeCAD.spec b/FreeCAD.spec index a050b93..23a3a97 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -16,8 +16,6 @@ # -%define build_tar_ball 1 - %define x_prefix %{_libdir}/%{name} %if 0%{?suse_version} > 1500 @@ -56,6 +54,14 @@ Patch9: fix-smesh-vtk9.patch Patch10: 0001-Fix-ODR-violation-correct-Ui_TaskSketcherGeneral-nam.patch # PATCH-FIX-UPSTREAM -- https://github.com/FreeCAD/FreeCAD/commit/6bd39e8a90e65d81 Patch11: 0001-Gui-skip-ci-fix-Wodr.patch +# PATCH-FIX-UPSTREAM -- Rebased https://github.com/FreeCAD/FreeCAD/commit/fd9cdb9de9d06ebd +Patch12: 0001-Part-Import-skip-ci-disable-use-of-Message_ProgressI.patch +# PATCH-FIX-UPSTREAM -- Rebased https://github.com/FreeCAD/FreeCAD/commit/063515f65007c116 +Patch13: 0001-import-Hotfix-for-build-failure-from-bad-debug-code.patch +# PATCH-FIX-UPSTREAM -- https://github.com/FreeCAD/FreeCAD/commit/50957037764de76b +Patch14: 0001-add-missing-std-namespace-to-build-on-Debian-10.patch +# PATCH-FIX-UPSTREAM -- https://github.com/FreeCAD/FreeCAD/commit/8be2c08141f0275e +Patch15: 0001-partdesign-fix-failing-tapered-hole-test.patch # Test suite fails on 32bit and I don't want to debug that anymore ExcludeArch: %ix86 %arm ppc s390 s390x @@ -64,7 +70,6 @@ BuildRequires: Coin-devel BuildRequires: libboost_filesystem-devel >= 1.55 BuildRequires: libboost_graph-devel >= 1.55 BuildRequires: libboost_program_options-devel >= 1.55 -BuildRequires: libboost_python3-devel >= 1.55 BuildRequires: libboost_regex-devel >= 1.55 %if %{without boost_signals2} BuildRequires: libboost_signals-devel >= 1.55 @@ -73,16 +78,10 @@ BuildRequires: libboost_system-devel >= 1.55 BuildRequires: libboost_thread-devel >= 1.55 BuildRequires: cmake -BuildRequires: dos2unix BuildRequires: double-conversion-devel -BuildRequires: doxygen BuildRequires: eigen3-devel -BuildRequires: f2c BuildRequires: fdupes -BuildRequires: freeglut-devel -BuildRequires: gcc-fortran BuildRequires: glew-devel -BuildRequires: graphviz BuildRequires: hdf5-devel BuildRequires: hicolor-icon-theme # We use the internal smesh version with fixes atm @@ -104,6 +103,8 @@ BuildRequires: sqlite3-devel # Qt5 & python3 BuildRequires: python3-devel BuildRequires: python3-matplotlib +BuildRequires: python3-pybind11-devel +BuildRequires: python3-pycxx-devel BuildRequires: python3-pyside2-devel BuildRequires: python3-vtk BuildRequires: python3-xml @@ -144,12 +145,9 @@ BuildRequires: qt5-qtbase-devel %endif BuildRequires: swig -BuildRequires: unzip BuildRequires: update-desktop-files BuildRequires: vtk-devel BuildRequires: zlib-devel -Requires(post): shared-mime-info -Requires(postun): shared-mime-info # we need to ensure to have the minimum version from build env Requires: libopencascade7 >= %(/bin/bash -c 'rpm -q --qf "%%{version}" libopencascade7') @@ -172,25 +170,26 @@ Requires: %{name} = %{version} This package contains the files needed for development with FreeCAD. %prep -%if %{build_tar_ball} %setup -q -%else -mv %_sourcedir/%name-%version %_builddir/%name-%version -%setup -q -D -T 0 -%endif %autopatch -p1 # fix env-script-interpreter sed -i '1c#!%{__python3}' \ - src/Mod/Test/testmakeWireString.py \ - src/Mod/Robot/MovieTool.py + src/Mod/Robot/MovieTool.py \ + src/Mod/Test/testmakeWireString.py -# Fix "wrong-file-end-of-line-encoding" rpmlint warning -sed -i 's/\r$//' ChangeLog.txt +# Fix "non-executable-script" rpmlint warning +chmod 755 src/Mod/Robot/MovieTool.py \ + src/Mod/Test/testmakeWireString.py \ + src/Mod/Test/unittestgui.py # Fix "wrong-script-end-of-line-encoding" rpmlint warning +sed -i 's/\r$//' src/Mod/Part/MakeBottle.py +sed -i 's/\r$//' src/Mod/PartDesign/Scripts/FilletArc.py +sed -i 's/\r$//' src/Mod/PartDesign/Scripts/Parallelepiped.py sed -i 's/\r$//' src/Mod/PartDesign/Scripts/Spring.py sed -i 's/\r$//' src/Mod/Robot/MovieTool.py +sed -i 's/\r$//' src/Mod/Test/unittestgui.py # Remove 3rd party libs rm src/3rdparty/Pivy -fr @@ -211,15 +210,19 @@ rm src/3rdparty/Pivy-0.5 -fr -DPYTHON_EXECUTABLE=/usr/bin/python3 \ -DSHIBOKEN_INCLUDE_DIR=/usr/include/shiboken2/ \ -DPYSIDE_INCLUDE_DIR=/usr/include/PySide2/ \ + -DFREECAD_USE_PYBIND11:BOOL=ON \ -DBUILD_ENABLE_CXX_STD:STRING="C++17" \ -DBUILD_QT5=ON \ + -DFREECAD_USE_QT_DIALOG:BOOL=ON \ -DFREECAD_USE_EXTERNAL_PIVY:BOOL=TRUE \ -DBUILD_OPENSCAD:BOOL=ON \ - -DBUILD_FEM_NETGEN:BOOL=OFF \ -DFREECAD_USE_EXTERNAL_SMESH=OFF \ + -DBUILD_FLAT_MESH:BOOL=ON \ -DBUILD_SMESH:BOOL=%{?with_smesh:ON}%{!?with_smesh:OFF} \ -DBUILD_MESH_PART:BOOL=%{?with_smesh:ON}%{!?with_smesh:OFF} \ -DBUILD_FEM:BOOL=%{?with_smesh:ON}%{!?with_smesh:OFF} \ + -DBUILD_FEM_NETGEN:BOOL=OFF \ + -DBUILD_FEM_VTK:BOOL=ON \ -Wno-dev \ .. @@ -228,11 +231,6 @@ rm src/3rdparty/Pivy-0.5 -fr %install %cmake_install -# Fix "non-executable-script" rpmlint warning -chmod 755 %{buildroot}%{x_prefix}/Mod/Robot/MovieTool.py \ - %{buildroot}%{x_prefix}/Mod/Test/testmakeWireString.py \ - %{buildroot}%{x_prefix}/Mod/Test/unittestgui.py - # Move icons, mimeinfo, metainfo to the correct location mv %{buildroot}%{x_prefix}/share/* %{buildroot}%{_datadir}/ for size in 64 48 32 16; do @@ -258,12 +256,6 @@ rm -f html/installdox mkdir -p %{buildroot}%{_docdir}/%{name}-devel #cp -a html/ %%{buildroot}%%{_docdir}/%%{name}-devel/ -# Correct line endings -dos2unix %{buildroot}%{x_prefix}/Mod/PartDesign/Scripts/FilletArc.py -dos2unix %{buildroot}%{x_prefix}/Mod/PartDesign/Scripts/Parallelepiped.py -dos2unix %{buildroot}%{x_prefix}/Mod/Test/unittestgui.py -dos2unix %{buildroot}%{x_prefix}/Mod/Part/MakeBottle.py - # Link binaries mkdir -p %{buildroot}/usr/bin ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCAD @@ -278,8 +270,8 @@ ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCADCmd %files %license LICENSE -%doc ChangeLog.txt README.md -%{_bindir}/FreeCAD* +%doc README.md +%{_bindir}/FreeCAD{,Cmd} %doc %{_docdir}/%{name}/ %{_libdir}/%{name} %{_datadir}/%{name}/