diff --git a/0001-fem-use-time.process_time-instead-of-removed-time.cl.patch b/0001-fem-use-time.process_time-instead-of-removed-time.cl.patch new file mode 100644 index 0000000..699f316 --- /dev/null +++ b/0001-fem-use-time.process_time-instead-of-removed-time.cl.patch @@ -0,0 +1,86 @@ +From 96af5fea1fab074e93011078974fd24fff1068f8 Mon Sep 17 00:00:00 2001 +From: looooo +Date: Tue, 14 Jan 2020 13:45:35 +0100 +Subject: [PATCH] fem: use time.process_time instead of removed time.clock() + +[rebased on 0.18.4 branch] +--- + src/Mod/Fem/femmesh/femmesh2mesh.py | 4 ++-- + src/Mod/Fem/femsolver/calculix/writer.py | 9 +++++++-- + src/Mod/Fem/femsolver/z88/writer.py | 8 ++++++-- + 3 files changed, 15 insertions(+), 6 deletions(-) + +diff --git a/src/Mod/Fem/femmesh/femmesh2mesh.py b/src/Mod/Fem/femmesh/femmesh2mesh.py +index 9c0b4f1b9..e6159f2c7 100644 +--- a/src/Mod/Fem/femmesh/femmesh2mesh.py ++++ b/src/Mod/Fem/femmesh/femmesh2mesh.py +@@ -90,7 +90,7 @@ def femmesh_2_mesh(myFemMesh, myResults=None): + # This code generates a dict and a faceCode for each face of all elements + # All faceCodes are than sorted. + +- start_time = time.clock() ++ start_time = time.process_time() + faceCodeList = [] + faceCodeDict = {} + +@@ -194,6 +194,6 @@ def femmesh_2_mesh(myFemMesh, myResults=None): + output_mesh.extend(triangle) + # print('my 2. triangle: ', triangle) + +- end_time = time.clock() ++ end_time = time.process_time() + print('Mesh by surface search method: ', end_time - start_time) + return output_mesh +diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py +index e9d9e9bae..33302cefa 100644 +--- a/src/Mod/Fem/femsolver/calculix/writer.py ++++ b/src/Mod/Fem/femsolver/calculix/writer.py +@@ -69,12 +69,17 @@ class FemInputWriterCcx(FemInputWriter.FemInputWriter): + FreeCAD.Console.PrintMessage('FemInputWriterCcx --> self.file_name --> ' + self.file_name + '\n') + + def write_calculix_input_file(self): +- timestart = time.clock() ++ timestart = time.process_time() ++ FreeCAD.Console.PrintMessage("Start writing CalculiX input file\n") ++ FreeCAD.Console.PrintMessage("Write ccx input file to: {}\n".format(self.file_name)) + if self.solver_obj.SplitInputWriter is True: + self.write_calculix_splitted_input_file() + else: + self.write_calculix_one_input_file() +- writing_time_string = "Writing time input file: " + str(round((time.clock() - timestart), 2)) + " seconds" ++ writing_time_string = ( ++ "Writing time CalculiX input file: {} seconds" ++ .format(round((time.process_time() - timestart), 2)) ++ ) + if self.femelement_count_test is True: + FreeCAD.Console.PrintMessage(writing_time_string + ' \n\n') + return self.file_name +diff --git a/src/Mod/Fem/femsolver/z88/writer.py b/src/Mod/Fem/femsolver/z88/writer.py +index e141ab9f0..cdcaff63b 100644 +--- a/src/Mod/Fem/femsolver/z88/writer.py ++++ b/src/Mod/Fem/femsolver/z88/writer.py +@@ -61,7 +61,7 @@ class FemInputWriterZ88(FemInputWriter.FemInputWriter): + FreeCAD.Console.PrintMessage('FemInputWriterZ88 --> self.file_name --> ' + self.file_name + '\n') + + def write_z88_input(self): +- timestart = time.clock() ++ timestart = time.process_time() + if not self.femnodes_mesh: + self.femnodes_mesh = self.femmesh.Nodes + if not self.femelement_table: +@@ -76,7 +76,11 @@ class FemInputWriterZ88(FemInputWriter.FemInputWriter): + self.write_z88_integration_properties() + self.write_z88_memory_parameter() + self.write_z88_solver_parameter() +- FreeCAD.Console.PrintMessage("Writing time input file: " + str(time.clock() - timestart) + ' \n\n') ++ writing_time_string = ( ++ "Writing time input file: {} seconds" ++ .format(round((time.process_time() - timestart), 2)) ++ ) ++ FreeCAD.Console.PrintMessage(writing_time_string + " \n\n") + return self.dir_name + + def set_z88_elparam(self): +-- +2.25.1 + diff --git a/0002-fix-compile.patch b/0002-fix-compile.patch deleted file mode 100644 index e216a2b..0000000 --- a/0002-fix-compile.patch +++ /dev/null @@ -1,278 +0,0 @@ -diff --git a/src/3rdParty/salomesmesh/inc/Rn.h b/src/3rdParty/salomesmesh/inc/Rn.h -index 6ec871d93..e92d2275a 100644 ---- a/src/3rdParty/salomesmesh/inc/Rn.h -+++ b/src/3rdParty/salomesmesh/inc/Rn.h -@@ -180,12 +180,12 @@ class R4: public R3 - { - friend std::ostream& operator <<(std::ostream& f, const R4 & P ) - { f << P.x << ' ' << P.y << ' ' << P.z << ' ' << P.omega; return f; } -- friend istream& operator >>(istream& f, R4 & P) -+ friend std::istream& operator >>(std::istream& f, R4 & P) - { f >> P.x >> P.y >> P.z >> P.omega ; return f; } - - friend std::ostream& operator <<(std::ostream& f, const R4 * P ) - { f << P->x << ' ' << P->y << ' ' << P->z << ' ' << P->omega; return f; } -- friend istream& operator >>(istream& f, R4 * P) -+ friend std::istream& operator >>(std::istream& f, R4 * P) - { f >> P->x >> P->y >> P->z >> P->omega ; return f; } - - public: -diff --git a/src/Mod/Drawing/App/DrawingExport.cpp b/src/Mod/Drawing/App/DrawingExport.cpp -index 0c3c23231..550b12c25 100644 ---- a/src/Mod/Drawing/App/DrawingExport.cpp -+++ b/src/Mod/Drawing/App/DrawingExport.cpp -@@ -81,6 +81,7 @@ - #include - - using namespace Drawing; -+using namespace std; - - TopoDS_Edge DrawingOutput::asCircle(const BRepAdaptor_Curve& c) const - { -diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp -index c206bfb63..8403ff29f 100644 ---- a/src/Mod/Part/App/Geometry.cpp -+++ b/src/Mod/Part/App/Geometry.cpp -@@ -203,7 +203,7 @@ unsigned int Geometry::getMemSize (void) const - void Geometry::Save(Base::Writer &writer) const - { - const char c = Construction?'1':'0'; -- writer.Stream() << writer.ind() << "" << endl; -+ writer.Stream() << writer.ind() << "" << std::endl; - } - - void Geometry::Restore(Base::XMLReader &reader) -@@ -323,7 +323,7 @@ void GeomPoint::Save(Base::Writer &writer) const - << "X=\"" << Point.x << - "\" Y=\"" << Point.y << - "\" Z=\"" << Point.z << -- "\"/>" << endl; -+ "\"/>" << std::endl; - } - - void GeomPoint::Restore(Base::XMLReader &reader) -@@ -793,7 +793,7 @@ void GeomBezierCurve::Save(Base::Writer& writer) const - << writer.ind() - << "" << endl; -+ "\">" << std::endl; - - writer.incInd(); - -@@ -808,11 +808,11 @@ void GeomBezierCurve::Save(Base::Writer& writer) const - "\" Y=\"" << (*itp).y << - "\" Z=\"" << (*itp).z << - "\" Weight=\"" << (*itw) << -- "\"/>" << endl; -+ "\"/>" << std::endl; - } - - writer.decInd(); -- writer.Stream() << writer.ind() << "" << endl ; -+ writer.Stream() << writer.ind() << "" << std::endl ; - } - - void GeomBezierCurve::Restore(Base::XMLReader& reader) -@@ -1270,7 +1270,7 @@ void GeomBSplineCurve::Save(Base::Writer& writer) const - "\" KnotsCount=\"" << knots.size() << - "\" Degree=\"" << degree << - "\" IsPeriodic=\"" << (int) isperiodic << -- "\">" << endl; -+ "\">" << std::endl; - - writer.incInd(); - -@@ -1285,7 +1285,7 @@ void GeomBSplineCurve::Save(Base::Writer& writer) const - "\" Y=\"" << (*itp).y << - "\" Z=\"" << (*itp).z << - "\" Weight=\"" << (*itw) << -- "\"/>" << endl; -+ "\"/>" << std::endl; - } - - std::vector::const_iterator itk; -@@ -1297,11 +1297,11 @@ void GeomBSplineCurve::Save(Base::Writer& writer) const - << "" << endl; -+ "\"/>" << std::endl; - } - - writer.decInd(); -- writer.Stream() << writer.ind() << "" << endl ; -+ writer.Stream() << writer.ind() << "" << std::endl ; - } - - void GeomBSplineCurve::Restore(Base::XMLReader& reader) -@@ -1903,7 +1903,7 @@ void GeomCircle::Save(Base::Writer& writer) const - "\" NormalZ=\"" << normal.Z() << - "\" AngleXU=\"" << AngleXU << - "\" Radius=\"" << this->myCurve->Radius() << -- "\"/>" << endl; -+ "\"/>" << std::endl; - } - - void GeomCircle::Restore(Base::XMLReader& reader) -@@ -2132,7 +2132,7 @@ void GeomArcOfCircle::Save(Base::Writer &writer) const - "\" Radius=\"" << circle->Radius() << - "\" StartAngle=\"" << this->myCurve->FirstParameter() << - "\" EndAngle=\"" << this->myCurve->LastParameter() << -- "\"/>" << endl; -+ "\"/>" << std::endl; - } - - void GeomArcOfCircle::Restore(Base::XMLReader &reader) -@@ -2383,7 +2383,7 @@ void GeomEllipse::Save(Base::Writer& writer) const - << "MajorRadius=\"" << this->myCurve->MajorRadius() << "\" " - << "MinorRadius=\"" << this->myCurve->MinorRadius() << "\" " - << "AngleXU=\"" << AngleXU << "\" " -- << "/>" << endl; -+ << "/>" << std::endl; - } - - void GeomEllipse::Restore(Base::XMLReader& reader) -@@ -2653,7 +2653,7 @@ void GeomArcOfEllipse::Save(Base::Writer &writer) const - << "AngleXU=\"" << AngleXU << "\" " - << "StartAngle=\"" << this->myCurve->FirstParameter() << "\" " - << "EndAngle=\"" << this->myCurve->LastParameter() << "\" " -- << "/>" << endl; -+ << "/>" << std::endl; - } - - void GeomArcOfEllipse::Restore(Base::XMLReader &reader) -@@ -2826,7 +2826,7 @@ void GeomHyperbola::Save(Base::Writer& writer) const - << "MajorRadius=\"" << this->myCurve->MajorRadius() << "\" " - << "MinorRadius=\"" << this->myCurve->MinorRadius() << "\" " - << "AngleXU=\"" << AngleXU << "\" " -- << "/>" << endl; -+ << "/>" << std::endl; - } - - void GeomHyperbola::Restore(Base::XMLReader& reader) -@@ -3083,7 +3083,7 @@ void GeomArcOfHyperbola::Save(Base::Writer &writer) const - << "AngleXU=\"" << AngleXU << "\" " - << "StartAngle=\"" << this->myCurve->FirstParameter() << "\" " - << "EndAngle=\"" << this->myCurve->LastParameter() << "\" " -- << "/>" << endl; -+ << "/>" << std::endl; - } - - void GeomArcOfHyperbola::Restore(Base::XMLReader &reader) -@@ -3236,7 +3236,7 @@ void GeomParabola::Save(Base::Writer& writer) const - << "NormalZ=\"" << normal.Z() << "\" " - << "Focal=\"" << this->myCurve->Focal() << "\" " - << "AngleXU=\"" << AngleXU << "\" " -- << "/>" << endl; -+ << "/>" << std::endl; - } - - void GeomParabola::Restore(Base::XMLReader& reader) -@@ -3436,7 +3436,7 @@ void GeomArcOfParabola::Save(Base::Writer &writer) const - << "AngleXU=\"" << AngleXU << "\" " - << "StartAngle=\"" << this->myCurve->FirstParameter() << "\" " - << "EndAngle=\"" << this->myCurve->LastParameter() << "\" " -- << "/>" << endl; -+ << "/>" << std::endl; - } - - void GeomArcOfParabola::Restore(Base::XMLReader &reader) -@@ -3581,7 +3581,7 @@ void GeomLine::Save(Base::Writer &writer) const - "\" DirX=\"" << Dir.x << - "\" DirY=\"" << Dir.y << - "\" DirZ=\"" << Dir.z << -- "\"/>" << endl; -+ "\"/>" << std::endl; - } - void GeomLine::Restore(Base::XMLReader &reader) - { -@@ -3722,7 +3722,7 @@ void GeomLineSegment::Save (Base::Writer &writer) const - "\" EndX=\"" << End.x << - "\" EndY=\"" << End.y << - "\" EndZ=\"" << End.z << -- "\"/>" << endl; -+ "\"/>" << std::endl; - } - - void GeomLineSegment::Restore (Base::XMLReader &reader) -diff --git a/src/Mod/Part/App/Geometry2d.cpp b/src/Mod/Part/App/Geometry2d.cpp -index fb1de909c..979465533 100644 ---- a/src/Mod/Part/App/Geometry2d.cpp -+++ b/src/Mod/Part/App/Geometry2d.cpp -@@ -83,6 +83,7 @@ - #include - - using namespace Part; -+using namespace std; - - extern const char* gce_ErrorStatusText(gce_ErrorType et); - -diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp -index d590a8553..892e568d4 100644 ---- a/src/Mod/Part/App/PropertyTopoShape.cpp -+++ b/src/Mod/Part/App/PropertyTopoShape.cpp -@@ -281,11 +281,11 @@ static void BRepTools_Write(const TopoDS_Shape& Sh, Standard_OStream& S) { - static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh, - const Standard_CString File) - { -- ofstream os; -+ std::ofstream os; - #if OCC_VERSION_HEX >= 0x060800 -- OSD_OpenStream(os, File, ios::out); -+ OSD_OpenStream(os, File, std::ios::out); - #else -- os.open(File, ios::out); -+ os.open(File, std::ios::out); - #endif - if (!os.rdbuf()->is_open()) return Standard_False; - -diff --git a/src/Mod/Raytracing/App/AppRaytracingPy.cpp b/src/Mod/Raytracing/App/AppRaytracingPy.cpp -index d48c51c97..1bb2b1b01 100644 ---- a/src/Mod/Raytracing/App/AppRaytracingPy.cpp -+++ b/src/Mod/Raytracing/App/AppRaytracingPy.cpp -@@ -40,6 +40,8 @@ - #include - #include - -+using namespace std; -+ - - namespace Raytracing { - class Module : public Py::ExtensionModule -diff --git a/src/Mod/Raytracing/App/LuxFeature.cpp b/src/Mod/Raytracing/App/LuxFeature.cpp -index 930fe12b7..d1e0a0089 100644 ---- a/src/Mod/Raytracing/App/LuxFeature.cpp -+++ b/src/Mod/Raytracing/App/LuxFeature.cpp -@@ -38,6 +38,7 @@ - - - using namespace Raytracing; -+using namespace std; - - PROPERTY_SOURCE(Raytracing::LuxFeature, Raytracing::RaySegment) - -diff --git a/src/Mod/Raytracing/App/RayFeature.cpp b/src/Mod/Raytracing/App/RayFeature.cpp -index cdd2cb6dc..235a98685 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 123be7979..16e7487ee 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() diff --git a/FreeCAD-0.18.4.obscpio b/FreeCAD-0.18.4.obscpio index 0648102..6d0e860 100644 --- a/FreeCAD-0.18.4.obscpio +++ b/FreeCAD-0.18.4.obscpio @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ed50e632f9cc25ad508e8d89372e8f2e88dfb684d88212237314db440c2c5192 -size 427463182 +oid sha256:6d5e0772aaca0a5aeb6b9e7fef35420011bcf312c7853904c1399e388f648728 +size 427464206 diff --git a/FreeCAD.changes b/FreeCAD.changes index 28c5040..e3aadf9 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Sun Mar 15 18:13:15 UTC 2020 - Stefan Brüns + +- Fix runtime errors with Python 3.8: + * 0001-fem-use-time.process_time-instead-of-removed-time.cl.patch +- Fix last python2 she-bang remainders, fix imports: + * fix_unittestgui_tkinter_py3.patch +- Remove unnecessary opencv build dependency +- update to current 0.18 branch: + * Fem: fix segmentation fault when opening contraint transform + panel. Fix Python code + * Part: the number of domains returned by TopoShape::getDomains + must match with number of faces + * apply fixes from master when building with occt 7.4 + + Drop 0002-fix-compile.patch + +------------------------------------------------------------------- +Sat Mar 14 15:12:29 UTC 2020 - Stefan Brüns + +- Fix build with Python 3.8: + Add update-swigpyrunin-for-python-3.8.patch +- Spec file cleanup + * Drop xpm FreeCAD icon + * Install PNGs/SVG icons in correct paths + * Remove obsolete update_mime_database calls in %post + * Remove obsolete conditionals for Leap 42.x + ------------------------------------------------------------------- Sat Jan 25 11:03:06 UTC 2020 - Hans-Peter Jansen @@ -8,18 +35,22 @@ Sat Jan 25 11:03:06 UTC 2020 - Hans-Peter Jansen Fri Jan 24 09:02:08 UTC 2020 - Adrian Schröter - update to current 0.18 branch: - * fixes #0004182: Segfault when clicking constraints from a different viewport [skip ci] - * See discussion https://forum.freecadweb.org/viewtopic.php?f=3&t=41879 - * fixes #0004233: Access violation and file corruption on undo duplicate sketch + * fixes #0004182: Segfault when clicking constraints from a + different viewport [skip ci] + * [Draft] ImportDXF 0.18 Bug upgrading from 0.16. See discussion + https://forum.freecadweb.org/viewtopic.php?f=3&t=41879 + * fixes #0004233: Access violation and file corruption on undo + duplicate sketch * FEM: py3 fix in selection widget * FEM: selection widgets, add some error prints * FEM: equations, fix reset edit mode - * [AddonManager] 0.18 Improve Non GitPython Error.. - * ...Handling. Previous output when clicking Macros tab caused errors in Report View with no Macros loaded at all. - * fix encoding problem when clicking a link on StartPage if application is installed into a directory with non-ASCII characters + * [AddonManager] 0.18 Improve Non GitPython Error Handling. + Previous output when clicking Macros tab caused errors in + Report View with no Macros loaded at all. + * fix encoding problem when clicking a link on StartPage if + application is installed into a directory with non-ASCII characters * [Arch] ArchMaterial 0.18 Fix Crash - ------------------------------------------------------------------- Thu Jan 23 16:41:29 UTC 2020 - Adrian Schröter diff --git a/FreeCAD.obsinfo b/FreeCAD.obsinfo index 6fc9ed9..f716b42 100644 --- a/FreeCAD.obsinfo +++ b/FreeCAD.obsinfo @@ -1,5 +1,5 @@ name: FreeCAD version: 0.18.4 -mtime: 1578760669 -commit: 9ae129705652eec6be426211e5eaaa16c847b7c5 +mtime: 1582676121 +commit: 783e1346c7a078f5265c3f0c6a927d09a8c1fe70 diff --git a/FreeCAD.spec b/FreeCAD.spec index 3f540fb..f326057 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -41,16 +41,19 @@ Source2: FreeCADCmd.sh Source3: FreeCAD_shared_mimeinfo # PATCH-FIX-UPSTREAM 0001-Fix-build-with-pyside2-shiboken2-5.12.1.patch -- Fix build with shiboken2/pyside2 >= 5.12.1 Patch1: 0001-Fix-build-with-pyside2-shiboken2-5.12.1.patch -# PATCH-FIX-UPSTREAM 0002-fix-compile.patch -Patch2: 0002-fix-compile.patch # PATCH-FIX-OPENSUSE qt-5.14.patch Patch3: 0003-qt-5.14.patch +# PATCH-FIX-UPSTREAM https://github.com/FreeCAD/FreeCAD/commit/6eacb17b3e03d200.patch +Patch4: update-swigpyrunin-for-python-3.8.patch +# PATCH-FIX-UPSTREAM https://github.com/FreeCAD/FreeCAD/pull/2899 +Patch5: 0001-fem-use-time.process_time-instead-of-removed-time.cl.patch +# PATCH-FIX-OPENSUSE Use correct import for Python 3 tkinter +Patch6: fix_unittestgui_tkinter_py3.patch # Test suite fails on 32bit and I don't want to debug that anymore ExcludeArch: %ix86 %arm ppc s390 s390x BuildRequires: Coin-devel -%if 0%{?suse_version} >= 1330 BuildRequires: libboost_filesystem-devel >= 1.55 BuildRequires: libboost_graph-devel >= 1.55 BuildRequires: libboost_program_options-devel >= 1.55 @@ -61,9 +64,6 @@ BuildRequires: libboost_signals-devel >= 1.55 %endif BuildRequires: libboost_system-devel >= 1.55 BuildRequires: libboost_thread-devel >= 1.55 -%else -BuildRequires: boost-devel >= 1.55 -%endif BuildRequires: cmake BuildRequires: dos2unix @@ -78,6 +78,7 @@ BuildRequires: git BuildRequires: glew-devel BuildRequires: graphviz BuildRequires: hdf5-devel +BuildRequires: hicolor-icon-theme # We use the internal smesh version with fixes atm #BuildRequires: smesh-devel BuildRequires: libXerces-c-devel @@ -88,10 +89,9 @@ BuildRequires: make BuildRequires: netgen-devel # we use upstream OpenCASCADE instead of oce-devel atm BuildRequires: occt-devel -BuildRequires: opencv-devel BuildRequires: pkg-config -%if 0%{?suse_version} >= 1330 +%if 0%{?suse_version} # Qt5 & python3 BuildRequires: python3-devel BuildRequires: python3-matplotlib @@ -120,7 +120,8 @@ Conflicts: python-pyside # reported to break FreeCAD here # https://forum.freecadweb.org/viewtopic.php?t=24610 Conflicts: python-pivy -%else +%endif +%if 0%{?fedora} > 18 BuildRequires: libshiboken-devel BuildRequires: python-CXX-devel BuildRequires: python-devel @@ -130,13 +131,6 @@ BuildRequires: python-pyside-tools BuildRequires: pkgconfig(QtWebKit) Requires: python-numpy Requires: python-pyside -%if 0%{?suse_version} > 0 -# Qt4 & python2 -BuildRequires: libqt4-devel -BuildRequires: python-xml -%endif -%endif -%if 0%{?fedora} > 18 BuildRequires: qt5-qtbase-devel %endif @@ -176,9 +170,9 @@ mv %_sourcedir/%name-%version %_builddir/%name-%version %autopatch -p1 # fix env-script-interpreter -sed -i '1c#!%{__python2}' \ +sed -i '1c#!%{__python3}' \ src/Mod/Test/testmakeWireString.py \ - src/Mod/Test/unittestgui.py + src/Mod/Robot/MovieTool.py # Fix "wrong-file-end-of-line-encoding" rpmlint warning sed -i 's/\r$//' ChangeLog.txt @@ -194,7 +188,7 @@ rm src/3rdparty/Pivy-0.5 -fr %build mkdir build && cd build # cmake macro would set standard libdir -# it needs an older specific zipios version -DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE +# it needs an older specific zipios version -DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE printenv cmake \ @@ -207,12 +201,10 @@ cmake \ -DRESOURCEDIR=%{_datadir}/%{name} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ -%if 0%{?suse_version} >= 1330 -DPYTHON_EXECUTABLE=/usr/bin/python3 \ -DSHIBOKEN_INCLUDE_DIR=/usr/include/shiboken2/ \ -DPYSIDE_INCLUDE_DIR=/usr/include/PySide2/ \ -DBUILD_QT5=ON \ -%endif -DFREECAD_USE_EXTERNAL_PIVY:BOOL=TRUE \ -DBUILD_MESH_PART:BOOL=ON \ -DBUILD_OPENSCAD:BOOL=ON \ @@ -258,8 +250,15 @@ chmod 755 %{buildroot}%{x_prefix}/Mod/Robot/MovieTool.py \ %{buildroot}%{x_prefix}/Mod/Test/unittestgui.py # Move desktop icon in the correct location -mkdir -p %{buildroot}%{_datadir}/pixmaps -mv %{buildroot}%{_datadir}/%{name}/freecad.xpm %{buildroot}%{_datadir}/pixmaps/freecad.xpm +mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable +for size in 64 48 32 16; do + mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/ + mv %{buildroot}%{_datadir}/%{name}/freecad-icon-${size}.png \ + %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/freecad.png +done +mv %{buildroot}%{_datadir}/%{name}/freecad.svg %{buildroot}%{_datadir}/icons/hicolor/scalable +mv %{buildroot}%{_datadir}/%{name}/freecad-doc.png %{buildroot}%{_datadir}/icons/hicolor/64x64/ +rm %{buildroot}%{_datadir}/%{name}/freecad.xpm %suse_update_desktop_file -c %{name} "%{name}" "3D CAD Modeler" %{name} "freecad" Education Engineering @@ -297,13 +296,9 @@ ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCADCmd %fdupes -s %{buildroot} -%post -/sbin/ldconfig -%mime_database_post +%post -p /sbin/ldconfig -%postun -/sbin/ldconfig -%mime_database_postun +%postun -p /sbin/ldconfig %files %license LICENSE @@ -313,7 +308,7 @@ ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCADCmd %{_libdir}/%{name} %{_datadir}/%{name}/ %{_datadir}/mime/packages/%{name}.xml -%{_datadir}/pixmaps/freecad.xpm %{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/*/freecad*.{png,svg} %changelog diff --git a/fix_unittestgui_tkinter_py3.patch b/fix_unittestgui_tkinter_py3.patch new file mode 100644 index 0000000..7372ac2 --- /dev/null +++ b/fix_unittestgui_tkinter_py3.patch @@ -0,0 +1,29 @@ +diff --git a/src/Mod/Test/unittestgui.py b/src/Mod/Test/unittestgui.py +index 6e93079b8..e6125a694 100755 +--- a/src/Mod/Test/unittestgui.py ++++ b/src/Mod/Test/unittestgui.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + """ + GUI framework and application for use with Python unit testing framework. + Execute tests written using the framework provided by the 'unittest' module. +@@ -29,12 +29,15 @@ __version__ = "$Revision: 2.0 $"[11:-2] + + import unittest + import sys +-import Tkinter +-import tkMessageBox ++if sys.version_info.major >= 3: ++ import tkinter as tk ++ from tkinter import messagebox as tkMessageBox ++else: ++ import Tkinter as tk ++ import tkMessageBox + import traceback + + import string +-tk = Tkinter # Alternative to the messy 'from Tkinter import *' often seen + + + ############################################################################## diff --git a/update-swigpyrunin-for-python-3.8.patch b/update-swigpyrunin-for-python-3.8.patch new file mode 100644 index 0000000..5fae877 --- /dev/null +++ b/update-swigpyrunin-for-python-3.8.patch @@ -0,0 +1,27 @@ +From 6eacb17b3e03d20039b85c9daebab9e44386d6bf Mon Sep 17 00:00:00 2001 +From: Richard +Date: Thu, 17 Oct 2019 11:20:10 -0500 +Subject: [PATCH] Update swigpyrun.in for Python 3.8 + +In Python 3.8 some functions related to thread state were intentionally made private. + +This fix (specific to FreeCAD) was suggested here: + +https://bugs.python.org/issue35886 +--- + src/Base/swigpyrun.inl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Base/swigpyrun.inl b/src/Base/swigpyrun.inl +index 0eedaaa87a9..65bba62db3c 100644 +--- a/src/Base/swigpyrun.inl ++++ b/src/Base/swigpyrun.inl +@@ -72,7 +72,7 @@ void cleanupSWIG_T(const char* TypeName) + + PyObject *module, *dict; + PyInterpreterState *interp = PyThreadState_GET()->interp; +- PyObject *modules = interp->modules; ++ PyObject *modules = PyImport_GetModuleDict(); + module = PyDict_GetItemString(modules, "__builtin__"); + if (module != NULL && PyModule_Check(module)) { + dict = PyModule_GetDict(module);