From b612e5051a5aceb33a612bf6b8cad35512819869b3ec536026b233c50f06936f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 8 Jan 2018 07:39:57 +0000 Subject: [PATCH 01/20] merge OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=20 --- FreeCAD.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeCAD.spec b/FreeCAD.spec index 1cbc7cb..33f0c09 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -1,7 +1,7 @@ # # spec file for package FreeCAD # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 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 From 73168449454bb0c621b1601a005970e5e3b38cdd4071bbf52feb4ac21277f8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 5 Mar 2018 12:17:57 +0000 Subject: [PATCH 02/20] fix desc OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=21 --- FreeCAD.spec | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/FreeCAD.spec b/FreeCAD.spec index 33f0c09..4e00eda 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -22,7 +22,7 @@ Name: FreeCAD Version: 0.16.6712 Release: 0 Summary: General Purpose 3D CAD Modeler -License: LGPL-2.0+ and GPL-2.0+ +License: LGPL-2.0-or-later AND GPL-2.0-or-later Group: Productivity/Graphics/CAD Url: http://www.freecadweb.org/ Source0: %{name}-%{version}.tar.xz @@ -85,14 +85,8 @@ Requires(postun): shared-mime-info Recommends: python-pivy %description -Note: This package contains the current development version and thus might -be unstable! +FreeCAD is a parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history and changing its parameters. FreeCAD is open-source and highly customizable, scriptable and extensible. -FreeCAD is a general purpose 3D CAD modeler. The development will be completely -Open Source. As with many modern 3D CAD modelers it will have a 2D component in -order to extract design detail from the 3D model to create 2D production -drawings, although 2D (e.g. AutoCAD LT) is not the focus, neither are animation -and organic shapes (e.g. Maya, 3D StudioMAX and Cinema 4D). %package devel Summary: Development Files for %{name} From 5731cd6770f32b0ec3ed95a5154491a999013d2d0bff2742097c96910eaa3c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 10 Apr 2018 11:51:36 +0000 Subject: [PATCH 03/20] 0.17 OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=22 --- 0001-find-openmpi2-include-files.patch | 13 ++ FreeCAD-0.16.6712.obscpio | 3 - FreeCAD-0.17.obscpio | 3 + FreeCAD.changes | 8 ++ FreeCAD.obsinfo | 6 +- FreeCAD.sh | 5 + FreeCAD.spec | 163 +++++++++++++++++-------- FreeCADCmd.sh | 4 + _service | 4 +- fix-build.diff | 36 ++++++ 10 files changed, 184 insertions(+), 61 deletions(-) create mode 100644 0001-find-openmpi2-include-files.patch delete mode 100644 FreeCAD-0.16.6712.obscpio create mode 100644 FreeCAD-0.17.obscpio create mode 100644 FreeCAD.sh create mode 100644 FreeCADCmd.sh create mode 100644 fix-build.diff diff --git a/0001-find-openmpi2-include-files.patch b/0001-find-openmpi2-include-files.patch new file mode 100644 index 0000000..24d6e78 --- /dev/null +++ b/0001-find-openmpi2-include-files.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3ecfe23a6..1db9bf33e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -717,7 +717,7 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + add_compile_options(${OPENMPI_CFLAGS}) + link_directories(${OPENMPI_LIBRARY_DIRS}) + link_libraries(${OPENMPI_LIBRARIES}) +- find_file(MpidotH mpi.h PATHS ${OPENMPI_INCLUDE_DIRS} NO_DEFAULT_PATH) ++ find_file(MpidotH mpi.h PATHS ${OPENMPI_INCLUDE_DIRS} /usr/lib64/mpi/gcc/openmpi2/include NO_DEFAULT_PATH) + if(NOT MpidotH) + message( WARNING "mpi.h was not found. Check for error above.") + endif() diff --git a/FreeCAD-0.16.6712.obscpio b/FreeCAD-0.16.6712.obscpio deleted file mode 100644 index b9e04f0..0000000 --- a/FreeCAD-0.16.6712.obscpio +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:66891dd8a208daa48024216e1dca6627b8ec90c6105cce7d33eaffc066b307ef -size 241548815 diff --git a/FreeCAD-0.17.obscpio b/FreeCAD-0.17.obscpio new file mode 100644 index 0000000..21a2831 --- /dev/null +++ b/FreeCAD-0.17.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15bf621edb984b0914fd7e5c1ce2e2469b3f031fbb4d2bd1f86c90f634e0829b +size 385050127 diff --git a/FreeCAD.changes b/FreeCAD.changes index d0c0ca1..40ede9a 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Apr 10 11:33:35 UTC 2018 - adrian@suse.de + +- update to version 0.17 + 2 years of work: https://www.freecadweb.org/wiki/Release_notes_0.17 +- switching to Qt5 +- enabled netgen FEM support + ------------------------------------------------------------------- Thu Jan 4 15:36:57 UTC 2018 - wbauer@tmo.at diff --git a/FreeCAD.obsinfo b/FreeCAD.obsinfo index 6f1f41d..7e08a1c 100644 --- a/FreeCAD.obsinfo +++ b/FreeCAD.obsinfo @@ -1,5 +1,5 @@ name: FreeCAD -version: 0.16.6712 -mtime: 1500312467 -commit: da2d364457257a7a8c6fb2137cea12c45becd71a +version: 0.17 +mtime: 1523004517 +commit: 0258808ccb6ba3bd5ea9312f79cd023f1a8671b7 diff --git a/FreeCAD.sh b/FreeCAD.sh new file mode 100644 index 0000000..99a0bc5 --- /dev/null +++ b/FreeCAD.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# let Python pick up /usr/lib64/FreeCAD/bin/PySide +cd /usr/lib64/FreeCAD/bin +# temporary workaround for a bug somewhere around python3 in Factory leading to memory corruption +LC_ALL=C ./FreeCAD $@ diff --git a/FreeCAD.spec b/FreeCAD.spec index 4e00eda..48f782e 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -19,20 +19,29 @@ %define x_prefix %{_libdir}/%{name} Name: FreeCAD -Version: 0.16.6712 +Version: 0.17 Release: 0 Summary: General Purpose 3D CAD Modeler License: LGPL-2.0-or-later AND GPL-2.0-or-later Group: Productivity/Graphics/CAD Url: http://www.freecadweb.org/ -Source0: %{name}-%{version}.tar.xz -Source2: FreeCAD_shared_mimeinfo -# PATCH-FIX-OPENSUSE remove-qtwebkit.patch -- fix build without QtWebKit -Patch0: remove-qtwebkit.patch -# PATCH-FIX-OPENSUSE remove-webgui.patch -- remove browser view that would need QtWebKit -Patch1: remove-webgui.patch +Source0: %{name}-%version.tar.xz +Source1: FreeCAD.sh +Source2: FreeCADCmd.sh +Source3: FreeCAD_shared_mimeinfo +Patch1: fix-build.diff +Patch2: 0001-find-openmpi2-include-files.patch BuildRequires: Coin-devel -BuildRequires: SoQt-devel +#BuildRequires: SoQt-devel +BuildRequires: libmed-devel +BuildRequires: netgen-devel +# we use upstream OpenCASCADE instead of oce atm +BuildRequires: occt-devel +BuildRequires: vtk-devel +BuildRequires: vtk-java +BuildRequires: vtk-tcl +#BuildRequires: smesh-devel + %if 0%{?suse_version} >= 1330 BuildRequires: libboost_filesystem-devel >= 1.55 BuildRequires: libboost_graph-devel >= 1.55 @@ -45,6 +54,7 @@ BuildRequires: libboost_thread-devel >= 1.55 %else BuildRequires: boost-devel >= 1.55 %endif + BuildRequires: cmake BuildRequires: dos2unix BuildRequires: doxygen @@ -53,36 +63,67 @@ BuildRequires: fdupes BuildRequires: freeglut-devel BuildRequires: gcc-fortran BuildRequires: git -BuildRequires: hdf5-devel +BuildRequires: hdf5-1_8-devel BuildRequires: libXerces-c-devel -BuildRequires: libeigen3-devel -BuildRequires: libqt4-devel +BuildRequires: pkg-config + +%if 0%{?suse_version} >= 1330 +# Qt5 & python3 +BuildRequires: openmpi2-devel +#BuildRequires: python3-devel +BuildRequires: python3-matplotlib +BuildRequires: python3-pyside2-devel +BuildRequires: python3-vtk +BuildRequires: python3-xml +BuildRequires: pkgconfig(Qt5Concurrent) +BuildRequires: pkgconfig(Qt5OpenGL) +BuildRequires: pkgconfig(Qt5PrintSupport) +BuildRequires: pkgconfig(Qt5ScriptTools) +BuildRequires: pkgconfig(Qt5Svg) +BuildRequires: pkgconfig(Qt5UiTools) +BuildRequires: pkgconfig(Qt5WebKit) +BuildRequires: pkgconfig(Qt5WebKitWidgets) +Requires: python3-pyside2 +# core dump if PySide is installed +Conflicts: python3-pyside +Conflicts: python-pyside +Recommends: python-pivy +%else BuildRequires: libshiboken-devel -BuildRequires: libspnav-devel -BuildRequires: oce-devel -BuildRequires: opencv-devel -BuildRequires: pkgconfig BuildRequires: python-CXX-devel BuildRequires: python-devel BuildRequires: python-matplotlib -BuildRequires: python-pyside BuildRequires: python-pyside-devel BuildRequires: python-pyside-tools +BuildRequires: pkgconfig(QtWebKit) +%if 0%{?suse_version} > 0 +# Qt4 & python2 +BuildRequires: libqt4-devel BuildRequires: python-xml +%endif +%endif +%if 0%{?fedora} > 18 +BuildRequires: eigen3-devel +BuildRequires: qt5-qtbase-devel +%endif + +BuildRequires: libspnav-devel +BuildRequires: opencv-devel BuildRequires: swig +%if 0%{?suse_version} +BuildRequires: libeigen3-devel +BuildRequires: update-desktop-files +%endif +BuildRequires: dos2unix +BuildRequires: make +BuildRequires: python3-qt5-devel BuildRequires: unzip BuildRequires: update-desktop-files BuildRequires: zlib-devel -%if 0%{?suse_version} < 1500 -BuildRequires: pkgconfig(QtWebKit) -%endif -Requires: python-CXX -Requires: python-pyside -%if 0%{?suse_version} <= 1320 Requires(post): shared-mime-info Requires(postun): shared-mime-info -%endif -Recommends: python-pivy + +Recommends: ccx %description FreeCAD is a parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history and changing its parameters. FreeCAD is open-source and highly customizable, scriptable and extensible. @@ -98,15 +139,16 @@ This package contains the files needed for development with FreeCAD. %prep %setup -q - -%if 0%{?suse_version} >= 1500 -%patch0 -p1 %patch1 -p1 -%endif +%patch2 -p1 + +# fix env-script-interpreter +sed -i '1c#!%{__python2}' \ + src/Mod/Test/testmakeWireString.py \ + src/Mod/Test/unittestgui.py # Fix "wrong-file-end-of-line-encoding" rpmlint warning sed -i 's/\r$//' ChangeLog.txt -sed -i 's/\r$//' copying.lib # Fix "wrong-script-end-of-line-encoding" rpmlint warning sed -i 's/\r$//' src/Mod/PartDesign/Scripts/Spring.py @@ -116,36 +158,46 @@ sed -i 's/\r$//' src/Mod/Robot/MovieTool.py rm src/3rdparty/Pivy -fr rm src/3rdparty/Pivy-0.5 -fr -# fix env-script-interpreter -sed -i '1c#!%{__python2}' \ - src/Mod/Test/testmakeWireString.py \ - src/Mod/Test/unittestgui.py - %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 + +# -fpermissive should become $RPM_OPT_FLAGS , but bugs ... +printenv cmake \ -DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \ -DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \ -DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \ -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/%{name} \ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \ - -DOCC_INCLUDE_DIR=%{_includedir}/oce \ + -DOCC_INCLUDE_DIR=%{_includedir}/opencascade \ -DRESOURCEDIR=%{_datadir}/%{name} \ -DCMAKE_BUILD_TYPE=Release \ -%if %{with netgen} - -DBUILD_FEM_NETGEN=ON \ + -DCMAKE_CXX_FLAGS="-fpermissive -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 \ %else - -DBUILD_FEM_NETGEN=OFF \ + -DPYCXX_INCLUDE_DIR:PATH=%{_includedir}/python2.7 \ + -DPYCXX_SOURCE_DIR:PATH=%{_datadir}/python2.7/CXX \ %endif -%if 0%{?suse_version} >= 1500 - -DBUILD_START=OFF \ - -DBUILD_WEB=OFF \ -%endif - ../ + -DFREECAD_USE_EXTERNAL_PIVY:BOOL=TRUE \ + -DBUILD_MESH_PART:BOOL=ON \ + -DBUILD_OPENSCAD:BOOL=ON \ + -DBUILD_FEM:BOOL=ON \ + -DNGLIB_INCLUDE_DIR=/usr/include/netgen/include/ \ + -DNGLIB_LIBNGLIB=%_libdir/netgen/libnglib.so \ + -DNGLIB_LIBINTERFACE=%_libdir/netgen/libinterface.so \ + -DNGLIB_LIBMESH=%_libdir/netgen/libmesh.so \ + -DNGLIB_LIBOCC=%_libdir/netgen/libocc.so \ + -DBUILD_FEM_NETGEN:BOOL=ON \ + -DFREECAD_USE_EXTERNAL_SMESH=OFF \ + .. -make VERBOSE=1 %{?_smp_mflags} all +make VERBOSE=1 %{?_smp_mflags} all || make VERBOSE=1 all # # Build documentation last, somehow # # this triggers a rebuild @@ -176,9 +228,6 @@ popd # nice make VERBOSE=1 %%{?_smp_mflags} install DESTDIR=%%{buildroot} # popd -# Install the Qt plugin -#install -Dpm 0755 src/Tools/plugins/widget/libFreeCAD_widgets.so %%{buildroot}/usr/%%{_lib}/qt4/plugins/designer/libFreeCAD_widgets.so - # Fix "non-executable-script" rpmlint warning chmod 755 %{buildroot}%{x_prefix}/Mod/Robot/MovieTool.py \ %{buildroot}%{x_prefix}/Mod/Test/testmakeWireString.py \ @@ -189,12 +238,12 @@ mkdir -p %{buildroot}%{_datadir}/pixmaps mv %{buildroot}%{_datadir}/%{name}/freecad.xpm %{buildroot}%{_datadir}/pixmaps/freecad.xpm # Install additional documentation files -install -pm 0644 ChangeLog.txt copying.lib %{buildroot}%{_docdir}/%{name}/ +#install -pm 0644 ChangeLog.txt copying.lib %{buildroot}%{_docdir}/%{name}/ %suse_update_desktop_file -c %{name} "%{name}" "3D CAD Modeler" %{name} "freecad" Education Engineering # Install mime type -install -Dpm 0644 %{SOURCE2} %{buildroot}/%{_datadir}/mime/packages/%{name}.xml +install -Dpm 0644 %{SOURCE3} %{buildroot}/usr/share/mime/packages/%{name}.xml # Remove unneeded files find %{buildroot} -type f -name "*.la" -delete -print @@ -213,9 +262,17 @@ dos2unix %{buildroot}%{x_prefix}/Mod/Test/unittestgui.py dos2unix %{buildroot}%{x_prefix}/Mod/Part/MakeBottle.py # Link binaries -mkdir -p %{buildroot}%{_bindir} -ln -s -t %{buildroot}%{_bindir} %{x_prefix}/bin/FreeCAD -ln -s -t %{buildroot}%{_bindir} %{x_prefix}/bin/FreeCADCmd +mkdir -p %{buildroot}/usr/bin +%if 0%{?suse_version} >= 91330 +# disabled, hopefully not anymore needed +cp %{S:1} %{buildroot}/usr/bin/FreeCAD +chmod +x %{buildroot}/usr/bin/FreeCAD +cp %{S:2} %{buildroot}/usr/bin/FreeCADCmd +chmod +x %{buildroot}/usr/bin/FreeCADCmd +%else +ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCAD +ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCADCmd +%endif %fdupes -s %{buildroot} diff --git a/FreeCADCmd.sh b/FreeCADCmd.sh new file mode 100644 index 0000000..ce9b4aa --- /dev/null +++ b/FreeCADCmd.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# let Python pick up /usr/lib64/FreeCAD/bin/PySide +cd /usr/lib64/FreeCAD/bin +./FreeCADCmd diff --git a/_service b/_service index faf275c..c8a1f9b 100644 --- a/_service +++ b/_service @@ -2,8 +2,8 @@ https://github.com/FreeCAD/FreeCAD.git git - releases/FreeCAD-0-16 - 0.16.6712 + 0.17 + 0.17 diff --git a/fix-build.diff b/fix-build.diff new file mode 100644 index 0000000..21c8593 --- /dev/null +++ b/fix-build.diff @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3ecfe23a6..246bb15a8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -445,7 +445,6 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) + + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598 + # Acceptable versions of Python +-set(Python_ADDITIONAL_VERSIONS "2.7") + + # For building on OS X + if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +diff --git a/src/3rdParty/salomesmesh/CMakeLists.txt b/src/3rdParty/salomesmesh/CMakeLists.txt +index 303ae6e0a..9c10046e6 100644 +--- a/src/3rdParty/salomesmesh/CMakeLists.txt ++++ b/src/3rdParty/salomesmesh/CMakeLists.txt +@@ -379,6 +379,7 @@ if (BUILD_FEM_NETGEN) + FILE(GLOB NETGENPlugin_source_files src/NETGENPlugin/*.cpp inc/NETGENPlugin_*.h* ) + ADD_LIBRARY(NETGENPlugin SHARED ${NETGENPlugin_source_files}) + TARGET_LINK_LIBRARIES(NETGENPlugin SMDS SMESHDS SMESH StdMeshers ${SMESH_LIBS} ) ++set_property(TARGET NETGENPlugin PROPERTY CXX_STANDARD 14) + + SET_BIN_DIR(NETGENPlugin NETGENPlugin) + if(WIN32) +diff --git a/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp b/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp +index 3b66ec663..3d4bc8afd 100644 +--- a/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp ++++ b/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include + #include From b500920c84d8f24e07b4a62caf55dcbeac6b3f2df9d2cf7b134b66eeb5e19df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 10 Apr 2018 14:22:58 +0000 Subject: [PATCH 04/20] drop netgen support OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=23 --- FreeCAD.changes | 1 - FreeCAD.spec | 6 ------ 2 files changed, 7 deletions(-) diff --git a/FreeCAD.changes b/FreeCAD.changes index 40ede9a..57b4381 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -4,7 +4,6 @@ Tue Apr 10 11:33:35 UTC 2018 - adrian@suse.de - update to version 0.17 2 years of work: https://www.freecadweb.org/wiki/Release_notes_0.17 - switching to Qt5 -- enabled netgen FEM support ------------------------------------------------------------------- Thu Jan 4 15:36:57 UTC 2018 - wbauer@tmo.at diff --git a/FreeCAD.spec b/FreeCAD.spec index 48f782e..a5d20fb 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -34,7 +34,6 @@ Patch2: 0001-find-openmpi2-include-files.patch BuildRequires: Coin-devel #BuildRequires: SoQt-devel BuildRequires: libmed-devel -BuildRequires: netgen-devel # we use upstream OpenCASCADE instead of oce atm BuildRequires: occt-devel BuildRequires: vtk-devel @@ -188,11 +187,6 @@ cmake \ -DBUILD_MESH_PART:BOOL=ON \ -DBUILD_OPENSCAD:BOOL=ON \ -DBUILD_FEM:BOOL=ON \ - -DNGLIB_INCLUDE_DIR=/usr/include/netgen/include/ \ - -DNGLIB_LIBNGLIB=%_libdir/netgen/libnglib.so \ - -DNGLIB_LIBINTERFACE=%_libdir/netgen/libinterface.so \ - -DNGLIB_LIBMESH=%_libdir/netgen/libmesh.so \ - -DNGLIB_LIBOCC=%_libdir/netgen/libocc.so \ -DBUILD_FEM_NETGEN:BOOL=ON \ -DFREECAD_USE_EXTERNAL_SMESH=OFF \ .. From 8804824df1693f046eaf01dd8176d2954771b452b3b39fda1d4cf9661e1e690c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 10 Apr 2018 16:41:31 +0000 Subject: [PATCH 05/20] try OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=24 --- FreeCAD.spec | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/FreeCAD.spec b/FreeCAD.spec index a5d20fb..74b4127 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -173,15 +173,10 @@ cmake \ -DOCC_INCLUDE_DIR=%{_includedir}/opencascade \ -DRESOURCEDIR=%{_datadir}/%{name} \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS="-fpermissive -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 \ -%else - -DPYCXX_INCLUDE_DIR:PATH=%{_includedir}/python2.7 \ - -DPYCXX_SOURCE_DIR:PATH=%{_datadir}/python2.7/CXX \ + -DBUILD_FEM_NETGEN=OFF \ +%if 0%{?suse_version} >= 1500 + -DBUILD_START=OFF \ + -DBUILD_WEB=OFF \ %endif -DFREECAD_USE_EXTERNAL_PIVY:BOOL=TRUE \ -DBUILD_MESH_PART:BOOL=ON \ From b0886e4dc6dc836ef73b41e8c8c41573014b739cba8a309a12ef097118dffed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 10 Apr 2018 16:52:38 +0000 Subject: [PATCH 06/20] ups OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=25 --- FreeCAD.spec | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/FreeCAD.spec b/FreeCAD.spec index 74b4127..94e3b94 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -173,16 +173,21 @@ cmake \ -DOCC_INCLUDE_DIR=%{_includedir}/opencascade \ -DRESOURCEDIR=%{_datadir}/%{name} \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_FEM_NETGEN=OFF \ -%if 0%{?suse_version} >= 1500 - -DBUILD_START=OFF \ - -DBUILD_WEB=OFF \ + -DCMAKE_CXX_FLAGS="-fpermissive -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 \ +%else + -DPYCXX_INCLUDE_DIR:PATH=%{_includedir}/python2.7 \ + -DPYCXX_SOURCE_DIR:PATH=%{_datadir}/python2.7/CXX \ %endif -DFREECAD_USE_EXTERNAL_PIVY:BOOL=TRUE \ -DBUILD_MESH_PART:BOOL=ON \ -DBUILD_OPENSCAD:BOOL=ON \ -DBUILD_FEM:BOOL=ON \ - -DBUILD_FEM_NETGEN:BOOL=ON \ + -DBUILD_FEM_NETGEN:BOOL=OFF \ -DFREECAD_USE_EXTERNAL_SMESH=OFF \ .. From 93baf5f6ff5e4abe39737bf91b797ab11f61f58b45185bbd21966d43f59186f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 11 Apr 2018 04:36:31 +0000 Subject: [PATCH 07/20] add OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=26 --- FreeCAD.changes | 1 + FreeCAD.spec | 2 ++ 2 files changed, 3 insertions(+) diff --git a/FreeCAD.changes b/FreeCAD.changes index 57b4381..b09f8a2 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -4,6 +4,7 @@ Tue Apr 10 11:33:35 UTC 2018 - adrian@suse.de - update to version 0.17 2 years of work: https://www.freecadweb.org/wiki/Release_notes_0.17 - switching to Qt5 + (fix-build.diff 0001-find-openmpi2-include-files.patch) ------------------------------------------------------------------- Thu Jan 4 15:36:57 UTC 2018 - wbauer@tmo.at diff --git a/FreeCAD.spec b/FreeCAD.spec index 94e3b94..91bf450 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -29,7 +29,9 @@ Source0: %{name}-%version.tar.xz Source1: FreeCAD.sh Source2: FreeCADCmd.sh Source3: FreeCAD_shared_mimeinfo +# python3 and generic compile fixes Patch1: fix-build.diff +# support for openmpi2 suse package Patch2: 0001-find-openmpi2-include-files.patch BuildRequires: Coin-devel #BuildRequires: SoQt-devel From 73a619e34c4cf5a98abf7bd5d167aa4328c0ec10a51b5663d7920b565193fcb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 11 Apr 2018 04:37:37 +0000 Subject: [PATCH 08/20] cleanup OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=27 --- remove-qtwebkit.patch | 23 -------- remove-webgui.patch | 124 ------------------------------------------ 2 files changed, 147 deletions(-) delete mode 100644 remove-qtwebkit.patch delete mode 100644 remove-webgui.patch diff --git a/remove-qtwebkit.patch b/remove-qtwebkit.patch deleted file mode 100644 index 72fb99c..0000000 --- a/remove-qtwebkit.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -Naur FreeCAD-0.16.orig/src/Gui/DownloadManager.cpp FreeCAD-0.16/src/Gui/DownloadManager.cpp ---- FreeCAD-0.16.orig/src/Gui/DownloadManager.cpp 2016-04-07 03:39:34.000000000 +0200 -+++ FreeCAD-0.16/src/Gui/DownloadManager.cpp 2017-02-07 17:05:51.753657498 +0100 -@@ -33,7 +33,6 @@ - #include - #include - #include --#include - - #include "DownloadItem.h" - #include "DownloadManager.h" -@@ -224,11 +223,6 @@ - ui->downloadsView->setRowHeight(row, item->minimumSizeHint().height()); - - bool remove = false; -- QWebSettings *globalSettings = QWebSettings::globalSettings(); -- if (!item->downloading() -- && globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) -- remove = true; -- - if (item->downloadedSuccessfully() - && removePolicy() == DownloadManager::SuccessFullDownload) { - remove = true; diff --git a/remove-webgui.patch b/remove-webgui.patch deleted file mode 100644 index e21bae0..0000000 --- a/remove-webgui.patch +++ /dev/null @@ -1,124 +0,0 @@ -diff -Naur FreeCAD-0.16.orig/src/Mod/Arch/ArchServer.py FreeCAD-0.16/src/Mod/Arch/ArchServer.py ---- FreeCAD-0.16.orig/src/Mod/Arch/ArchServer.py 2016-04-07 03:39:34.000000000 +0200 -+++ FreeCAD-0.16/src/Mod/Arch/ArchServer.py 2017-02-07 18:55:34.918643280 +0100 -@@ -36,20 +36,6 @@ - __url__ = "http://www.freecadweb.org" - - --class _CommandBimserver: -- "the Arch Bimserver command definition" -- def GetResources(self): -- return {'Pixmap' : 'Arch_Bimserver', -- 'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Bimserver","BIM server"), -- 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Arch_Bimserver","Opens a browser window and connects to a BIM server instance")} -- -- def Activated(self): -- p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") -- url = p.GetString("BimServerUrl","http://localhost:8082") -- FreeCADGui.addModule("WebGui") -- FreeCADGui.doCommand("WebGui.openBrowser(\""+url+"\")") -- -- - class _CommandGit: - "the Arch Git Commit command definition" - def GetResources(self): -@@ -161,5 +147,4 @@ - - - if FreeCAD.GuiUp: -- FreeCADGui.addCommand('Arch_Bimserver',_CommandBimserver()) - FreeCADGui.addCommand('Arch_Git',_CommandGit()) -diff -Naur FreeCAD-0.16.orig/src/Mod/Arch/InitGui.py FreeCAD-0.16/src/Mod/Arch/InitGui.py ---- FreeCAD-0.16.orig/src/Mod/Arch/InitGui.py 2016-04-07 03:39:34.000000000 +0200 -+++ FreeCAD-0.16/src/Mod/Arch/InitGui.py 2017-02-07 18:54:19.949158114 +0100 -@@ -44,7 +44,7 @@ - "Arch_SelectNonSolidMeshes","Arch_RemoveShape", - "Arch_CloseHoles","Arch_MergeWalls","Arch_Check", - "Arch_IfcExplorer","Arch_ToggleIfcBrepFlag","Arch_3Views", -- "Arch_Bimserver","Arch_Git","Arch_IfcSpreadsheet"] -+ "Arch_Git","Arch_IfcSpreadsheet"] - - # draft tools - self.drafttools = ["Draft_Line","Draft_Wire","Draft_Circle","Draft_Arc","Draft_Ellipse", -diff -Naur FreeCAD-0.16.orig/src/Mod/Drawing/Gui/Command.cpp FreeCAD-0.16/src/Mod/Drawing/Gui/Command.cpp ---- FreeCAD-0.16.orig/src/Mod/Drawing/Gui/Command.cpp 2016-04-07 03:39:34.000000000 +0200 -+++ FreeCAD-0.16/src/Mod/Drawing/Gui/Command.cpp 2017-02-07 18:52:19.077843909 +0100 -@@ -427,43 +427,6 @@ - - - //=========================================================================== --// Drawing_OpenBrowserView --//=========================================================================== -- --DEF_STD_CMD_A(CmdDrawingOpenBrowserView); -- --CmdDrawingOpenBrowserView::CmdDrawingOpenBrowserView() -- : Command("Drawing_OpenBrowserView") --{ -- // seting the -- sGroup = QT_TR_NOOP("Drawing"); -- sMenuText = QT_TR_NOOP("Open &browser view"); -- sToolTipText = QT_TR_NOOP("Opens the selected page in a browser view"); -- sWhatsThis = "Drawing_OpenBrowserView"; -- sStatusTip = QT_TR_NOOP("Opens the selected page in a browser view"); -- sPixmap = "actions/drawing-openbrowser"; --} -- --void CmdDrawingOpenBrowserView::activated(int iMsg) --{ -- unsigned int n = getSelection().countObjectsOfType(Drawing::FeaturePage::getClassTypeId()); -- if (n != 1) { -- QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), -- QObject::tr("Select one Page object.")); -- return; -- } -- std::vector Sel = getSelection().getSelection(); -- doCommand(Doc,"PageName = App.activeDocument().%s.PageResult",Sel[0].FeatName); -- doCommand(Doc,"import WebGui"); -- doCommand(Doc,"WebGui.openBrowser(PageName)"); --} -- --bool CmdDrawingOpenBrowserView::isActive(void) --{ -- return (getActiveGuiDocument() ? true : false); --} -- --//=========================================================================== - // Drawing_Annotation - //=========================================================================== - -@@ -786,7 +749,6 @@ - rcCmdMgr.addCommand(new CmdDrawingNewA3Landscape()); - rcCmdMgr.addCommand(new CmdDrawingNewView()); - rcCmdMgr.addCommand(new CmdDrawingOrthoViews()); -- rcCmdMgr.addCommand(new CmdDrawingOpenBrowserView()); - rcCmdMgr.addCommand(new CmdDrawingAnnotation()); - rcCmdMgr.addCommand(new CmdDrawingClip()); - rcCmdMgr.addCommand(new CmdDrawingSymbol()); -diff -Naur FreeCAD-0.16.orig/src/Mod/Drawing/Gui/Workbench.cpp FreeCAD-0.16/src/Mod/Drawing/Gui/Workbench.cpp ---- FreeCAD-0.16.orig/src/Mod/Drawing/Gui/Workbench.cpp 2016-04-07 03:39:34.000000000 +0200 -+++ FreeCAD-0.16/src/Mod/Drawing/Gui/Workbench.cpp 2017-02-07 19:10:18.512913826 +0100 -@@ -61,7 +61,6 @@ - *part << "Drawing_NewPage"; - *part << "Drawing_NewView"; - *part << "Drawing_OrthoViews"; -- *part << "Drawing_OpenBrowserView"; - *part << "Drawing_Annotation"; - *part << "Drawing_Clip"; - *part << "Drawing_Symbol"; -@@ -84,7 +83,6 @@ - *part << "Drawing_NewPage"; - *part << "Drawing_NewView"; - *part << "Drawing_OrthoViews"; -- *part << "Drawing_OpenBrowserView"; - *part << "Drawing_Annotation"; - *part << "Drawing_Clip"; - *part << "Drawing_Symbol"; -@@ -106,7 +104,6 @@ - //*img << "Drawing_NewA3Landscape"; - *img << "Drawing_NewPage"; - *img << "Drawing_OrthoViews"; -- *img << "Drawing_OpenBrowserView"; - *img << "Drawing_Annotation"; - *img << "Drawing_Clip"; - *img << "Drawing_DraftView"; From 805219c3113000c284ad25bbf7210825dbba33d013b9be6f6dc0feb16acf87cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 12 Apr 2018 06:30:26 +0000 Subject: [PATCH 09/20] add conflict OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=28 --- FreeCAD.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeCAD.spec b/FreeCAD.spec index 91bf450..a1489ef 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -88,7 +88,7 @@ Requires: python3-pyside2 # core dump if PySide is installed Conflicts: python3-pyside Conflicts: python-pyside -Recommends: python-pivy +Conflicts: python-pivy %else BuildRequires: libshiboken-devel BuildRequires: python-CXX-devel From 83f09c5dab4d4926ea0d593021f208e49aaa03c345b89320dc62bbb9b36bb278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 12 Apr 2018 06:34:22 +0000 Subject: [PATCH 10/20] and add missing python3-pivy OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=29 --- FreeCAD.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/FreeCAD.spec b/FreeCAD.spec index a1489ef..2cf7b4f 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -84,6 +84,7 @@ BuildRequires: pkgconfig(Qt5Svg) BuildRequires: pkgconfig(Qt5UiTools) BuildRequires: pkgconfig(Qt5WebKit) BuildRequires: pkgconfig(Qt5WebKitWidgets) +Requires: python3-pivy Requires: python3-pyside2 # core dump if PySide is installed Conflicts: python3-pyside From 019c571a1997bc06ac5410a32bd1ad2b4e140330d4311115e459c12052a8dacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 12 Apr 2018 06:37:58 +0000 Subject: [PATCH 11/20] also conflict also on 42.3 OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=30 --- FreeCAD.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FreeCAD.spec b/FreeCAD.spec index 2cf7b4f..cab4a2a 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -68,6 +68,10 @@ BuildRequires: hdf5-1_8-devel BuildRequires: libXerces-c-devel BuildRequires: pkg-config +# reported to break FreeCAD here +# https://forum.freecadweb.org/viewtopic.php?t=24610 +Conflicts: python-pivy + %if 0%{?suse_version} >= 1330 # Qt5 & python3 BuildRequires: openmpi2-devel @@ -89,7 +93,6 @@ Requires: python3-pyside2 # core dump if PySide is installed Conflicts: python3-pyside Conflicts: python-pyside -Conflicts: python-pivy %else BuildRequires: libshiboken-devel BuildRequires: python-CXX-devel From 9219ef35cd9f09e122ae43e55a53725167c2d5803e5f4bc60740cbd677e90caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 12 Apr 2018 07:32:58 +0000 Subject: [PATCH 12/20] commit OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=31 --- FreeCAD.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FreeCAD.spec b/FreeCAD.spec index cab4a2a..31b4f58 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -88,8 +88,9 @@ BuildRequires: pkgconfig(Qt5Svg) BuildRequires: pkgconfig(Qt5UiTools) BuildRequires: pkgconfig(Qt5WebKit) BuildRequires: pkgconfig(Qt5WebKitWidgets) -Requires: python3-pivy Requires: python3-pyside2 +# For Arch & Draft workbench +Requires: python3-pivy # core dump if PySide is installed Conflicts: python3-pyside Conflicts: python-pyside From 36ee94aa6260753ec540bf15ecfe6c101893c78286a88cabab54bb136b13c51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 16 Apr 2018 06:51:39 +0000 Subject: [PATCH 13/20] cleanup OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=32 --- FreeCAD.changes | 5 +++++ FreeCAD.spec | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/FreeCAD.changes b/FreeCAD.changes index b09f8a2..22f50d5 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Apr 16 06:51:06 UTC 2018 - adrian@suse.de + +- cleanup python qt deps (pyside2 only now) + ------------------------------------------------------------------- Tue Apr 10 11:33:35 UTC 2018 - adrian@suse.de diff --git a/FreeCAD.spec b/FreeCAD.spec index 31b4f58..ae151aa 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -75,7 +75,7 @@ Conflicts: python-pivy %if 0%{?suse_version} >= 1330 # Qt5 & python3 BuildRequires: openmpi2-devel -#BuildRequires: python3-devel +BuildRequires: python3-devel BuildRequires: python3-matplotlib BuildRequires: python3-pyside2-devel BuildRequires: python3-vtk @@ -122,7 +122,6 @@ BuildRequires: update-desktop-files %endif BuildRequires: dos2unix BuildRequires: make -BuildRequires: python3-qt5-devel BuildRequires: unzip BuildRequires: update-desktop-files BuildRequires: zlib-devel From d8a41c4f7999b69d7cd382f21aaa3f78a85cf4f55740f8823efb20e0f1e77633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 16 Apr 2018 15:15:36 +0000 Subject: [PATCH 14/20] just for factory OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=33 --- FreeCAD.changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FreeCAD.changes b/FreeCAD.changes index 22f50d5..c8304a1 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -10,6 +10,8 @@ Tue Apr 10 11:33:35 UTC 2018 - adrian@suse.de 2 years of work: https://www.freecadweb.org/wiki/Release_notes_0.17 - switching to Qt5 (fix-build.diff 0001-find-openmpi2-include-files.patch) + (the old 0.16 fork had obsolete temporary patches remove-qtwebkit.patch and + remove-webgui.patch) ------------------------------------------------------------------- Thu Jan 4 15:36:57 UTC 2018 - wbauer@tmo.at From 55072c6a025d4b9f5dc98351444dce2f900b39938ee9b5079eced2379bf959d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 17 Apr 2018 06:46:44 +0000 Subject: [PATCH 15/20] test OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=34 --- FreeCAD.changes | 5 ++++ FreeCAD.spec | 7 ++++++ fix-draft-module-with-python3.patch | 37 +++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 fix-draft-module-with-python3.patch diff --git a/FreeCAD.changes b/FreeCAD.changes index c8304a1..c0db46e 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 17 06:46:23 UTC 2018 - adrian@suse.de + +- fix crash in Draft module with python 3 + ------------------------------------------------------------------- Mon Apr 16 06:51:06 UTC 2018 - adrian@suse.de diff --git a/FreeCAD.spec b/FreeCAD.spec index ae151aa..fd30a85 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -33,6 +33,8 @@ Source3: FreeCAD_shared_mimeinfo Patch1: fix-build.diff # support for openmpi2 suse package Patch2: 0001-find-openmpi2-include-files.patch +# runtime fix, submitted upstream +Patch3: fix-draft-module-with-python3.patch BuildRequires: Coin-devel #BuildRequires: SoQt-devel BuildRequires: libmed-devel @@ -146,6 +148,7 @@ This package contains the files needed for development with FreeCAD. %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 # fix env-script-interpreter sed -i '1c#!%{__python2}' \ @@ -276,6 +279,10 @@ ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCADCmd %fdupes -s %{buildroot} +%check +cd build +./bin/FreeCAD --run-test 0 || exit 1 + %post /sbin/ldconfig %mime_database_post diff --git a/fix-draft-module-with-python3.patch b/fix-draft-module-with-python3.patch new file mode 100644 index 0000000..99f6fe5 --- /dev/null +++ b/fix-draft-module-with-python3.patch @@ -0,0 +1,37 @@ +diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py +index 4c27018c4..f48c11528 100644 +--- a/src/Mod/Draft/Draft.py ++++ b/src/Mod/Draft/Draft.py +@@ -6133,8 +6133,7 @@ class _ShapeString(_DraftObject): + ff8 = obj.FontFile.encode('utf8') # 1947 accents in filepath + # TODO: change for Py3?? bytes? + # Part.makeWireString uses FontFile as char* string +-# CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking) +- CharList = Part.makeWireString(obj.String,ff8,obj.Size,obj.Tracking) ++ CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking) + if len(CharList) == 0: + msg(translate("draft","ShapeString: string has no wires\n"), 'warning') + return +@@ -6142,8 +6141,7 @@ class _ShapeString(_DraftObject): + + # test a simple letter to know if we have a sticky font or not + sticky = False +-# testWire = Part.makeWireString("L",obj.FontFile,obj.Size,obj.Tracking)[0][0] +- testWire = Part.makeWireString("L",ff8,obj.Size,obj.Tracking)[0][0] ++ testWire = Part.makeWireString("L",obj.FontFile,obj.Size,obj.Tracking)[0][0] + if testWire.isClosed: + try: + testFace = Part.Face(testWire) +diff --git a/src/Mod/Draft/DraftTools.py b/src/Mod/Draft/DraftTools.py +index a007d03e6..1de205bbf 100644 +--- a/src/Mod/Draft/DraftTools.py ++++ b/src/Mod/Draft/DraftTools.py +@@ -2204,7 +2204,7 @@ class ShapeString(Creator): + #print("debug: D_T ShapeString.createObject type(self.SString): " str(type(self.SString))) + + dquote = '"' +- if type(self.SString) == unicode: # Python3: no more unicode ++ if sys.version_info.major < 3: # Python3: no more unicode + String = 'u' + dquote + self.SString.encode('unicode_escape') + dquote + else: + String = dquote + self.SString + dquote From 5340b8d5bcd1be02db31d65c47b0ebc53a6eb22446b635d218466b2980b4b818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 17 Apr 2018 06:52:41 +0000 Subject: [PATCH 16/20] ups OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=35 --- FreeCAD.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/FreeCAD.spec b/FreeCAD.spec index fd30a85..2bcd5b7 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -279,10 +279,6 @@ ln -s -t %{buildroot}/usr/bin %{x_prefix}/bin/FreeCADCmd %fdupes -s %{buildroot} -%check -cd build -./bin/FreeCAD --run-test 0 || exit 1 - %post /sbin/ldconfig %mime_database_post From c860d527e6be675da3b834a9ffacf0e1453e35a813514fbd907b8eeaf3e06548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 17 Apr 2018 14:19:22 +0000 Subject: [PATCH 17/20] update OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=36 --- fix-draft-module-with-python3.patch | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/fix-draft-module-with-python3.patch b/fix-draft-module-with-python3.patch index 99f6fe5..fb89470 100644 --- a/fix-draft-module-with-python3.patch +++ b/fix-draft-module-with-python3.patch @@ -1,18 +1,29 @@ +commit 338630b951abab1e44b01c80fbe2d07aba415daf +Author: Adrian Schröter +Date: Tue Apr 17 08:39:39 2018 +0200 + + fix runtime error creating a wire from string with python3 + + Tested against version 0.17 + diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py -index 4c27018c4..f48c11528 100644 +index 4c27018c4..da8db2895 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py -@@ -6133,8 +6133,7 @@ class _ShapeString(_DraftObject): +@@ -6133,8 +6133,10 @@ class _ShapeString(_DraftObject): ff8 = obj.FontFile.encode('utf8') # 1947 accents in filepath # TODO: change for Py3?? bytes? # Part.makeWireString uses FontFile as char* string -# CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking) - CharList = Part.makeWireString(obj.String,ff8,obj.Size,obj.Tracking) -+ CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking) ++ if sys.version_info.major < 3: ++ CharList = Part.makeWireString(obj.String,ff8,obj.Size,obj.Tracking) ++ else: ++ CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking) if len(CharList) == 0: msg(translate("draft","ShapeString: string has no wires\n"), 'warning') return -@@ -6142,8 +6141,7 @@ class _ShapeString(_DraftObject): +@@ -6142,8 +6144,7 @@ class _ShapeString(_DraftObject): # test a simple letter to know if we have a sticky font or not sticky = False From 46a3cc10022d96ffdaadff622e58c3c90c21086d54f260980927b9190eb9cf26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 27 Apr 2018 12:56:06 +0000 Subject: [PATCH 18/20] update OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=37 --- FreeCAD.changes | 6 + FreeCAD.spec | 2 + branch_update.patch | 541 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 549 insertions(+) create mode 100644 branch_update.patch diff --git a/FreeCAD.changes b/FreeCAD.changes index c0db46e..59e5f0e 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 27 12:55:30 UTC 2018 - adrian@suse.de + +- apply current 0.17 branch (branch_update.patch) + In first place for occt 7.2 fixes + ------------------------------------------------------------------- Tue Apr 17 06:46:23 UTC 2018 - adrian@suse.de diff --git a/FreeCAD.spec b/FreeCAD.spec index 2bcd5b7..91a916c 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -29,6 +29,7 @@ Source0: %{name}-%version.tar.xz Source1: FreeCAD.sh Source2: FreeCADCmd.sh Source3: FreeCAD_shared_mimeinfo +Patch0: branch_update.patch # python3 and generic compile fixes Patch1: fix-build.diff # support for openmpi2 suse package @@ -146,6 +147,7 @@ This package contains the files needed for development with FreeCAD. %prep %setup -q +%patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 diff --git a/branch_update.patch b/branch_update.patch new file mode 100644 index 0000000..7763336 --- /dev/null +++ b/branch_update.patch @@ -0,0 +1,541 @@ +diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp +index 6f6fb6cba..471c07428 100644 +--- a/src/App/Expression.cpp ++++ b/src/App/Expression.cpp +@@ -897,16 +897,13 @@ Expression * FunctionExpression::evalAggregate() const + throw Exception("Invalid property type for aggregate"); + } while (range.next()); + } +- else if (args[i]->isDerivedFrom(App::VariableExpression::getClassTypeId())) { ++ else { + std::unique_ptr e(args[i]->eval()); + NumberExpression * n(freecad_dynamic_cast(e.get())); + + if (n) + c->collect(n->getQuantity()); + } +- else if (args[i]->isDerivedFrom(App::NumberExpression::getClassTypeId())) { +- c->collect(static_cast(args[i])->getQuantity()); +- } + } + + return new NumberExpression(owner, c->getQuantity()); +diff --git a/src/App/FeaturePython.cpp b/src/App/FeaturePython.cpp +index 0a90b43a0..9d04fecad 100644 +--- a/src/App/FeaturePython.cpp ++++ b/src/App/FeaturePython.cpp +@@ -108,17 +108,21 @@ void FeaturePythonImp::onBeforeChange(const Property* prop) + if (feature.hasAttr("__object__")) { + Py::Callable method(feature.getAttr(std::string("onBeforeChange"))); + Py::Tuple args(1); +- std::string prop_name = object->getPropertyName(prop); +- args.setItem(0, Py::String(prop_name)); +- method.apply(args); ++ const char* prop_name = object->getPropertyName(prop); ++ if (prop_name) { ++ args.setItem(0, Py::String(prop_name)); ++ method.apply(args); ++ } + } + else { + Py::Callable method(feature.getAttr(std::string("onBeforeChange"))); + Py::Tuple args(2); + args.setItem(0, Py::Object(object->getPyObject(), true)); +- std::string prop_name = object->getPropertyName(prop); +- args.setItem(1, Py::String(prop_name)); +- method.apply(args); ++ const char* prop_name = object->getPropertyName(prop); ++ if (prop_name) { ++ args.setItem(1, Py::String(prop_name)); ++ method.apply(args); ++ } + } + } + } +@@ -141,17 +145,21 @@ void FeaturePythonImp::onChanged(const Property* prop) + if (feature.hasAttr("__object__")) { + Py::Callable method(feature.getAttr(std::string("onChanged"))); + Py::Tuple args(1); +- std::string prop_name = object->getPropertyName(prop); +- args.setItem(0, Py::String(prop_name)); +- method.apply(args); ++ const char* prop_name = object->getPropertyName(prop); ++ if (prop_name) { ++ args.setItem(0, Py::String(prop_name)); ++ method.apply(args); ++ } + } + else { + Py::Callable method(feature.getAttr(std::string("onChanged"))); + Py::Tuple args(2); + args.setItem(0, Py::Object(object->getPyObject(), true)); +- std::string prop_name = object->getPropertyName(prop); +- args.setItem(1, Py::String(prop_name)); +- method.apply(args); ++ const char* prop_name = object->getPropertyName(prop); ++ if (prop_name) { ++ args.setItem(1, Py::String(prop_name)); ++ method.apply(args); ++ } + } + } + } +diff --git a/src/Gui/ViewProviderPythonFeature.cpp b/src/Gui/ViewProviderPythonFeature.cpp +index 927557068..2fe1c4fd1 100644 +--- a/src/Gui/ViewProviderPythonFeature.cpp ++++ b/src/Gui/ViewProviderPythonFeature.cpp +@@ -643,17 +643,21 @@ void ViewProviderPythonFeatureImp::onChanged(const App::Property* prop) + if (vp.hasAttr("__object__")) { + Py::Callable method(vp.getAttr(std::string("onChanged"))); + Py::Tuple args(1); +- std::string prop_name = object->getPropertyName(prop); +- args.setItem(0, Py::String(prop_name)); +- method.apply(args); ++ const char* prop_name = object->getPropertyName(prop); ++ if (prop_name) { ++ args.setItem(0, Py::String(prop_name)); ++ method.apply(args); ++ } + } + else { + Py::Callable method(vp.getAttr(std::string("onChanged"))); + Py::Tuple args(2); + args.setItem(0, Py::Object(object->getPyObject(), true)); +- std::string prop_name = object->getPropertyName(prop); +- args.setItem(1, Py::String(prop_name)); +- method.apply(args); ++ const char* prop_name = object->getPropertyName(prop); ++ if (prop_name) { ++ args.setItem(1, Py::String(prop_name)); ++ method.apply(args); ++ } + } + } + } +diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py +index 1a442dff2..a0ec64d56 100644 +--- a/src/Mod/Arch/ArchStructure.py ++++ b/src/Mod/Arch/ArchStructure.py +@@ -152,7 +152,7 @@ class _CommandStructure: + st = Draft.getObjectsOfType(sel,"Structure") + ax = Draft.getObjectsOfType(sel,"Axis") + if ax: +- FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Create Structural System"))) ++ FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Structural System")) + FreeCADGui.addModule("Arch") + if st: + FreeCADGui.doCommand("obj = Arch.makeStructuralSystem(" + ArchCommands.getStringList(st) + "," + ArchCommands.getStringList(ax) + ")") +@@ -164,7 +164,7 @@ class _CommandStructure: + FreeCAD.ActiveDocument.recompute() + return + elif not(ax) and not(st): +- FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Create Structure"))) ++ FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Structure")) + FreeCADGui.addModule("Arch") + for obj in sel: + FreeCADGui.doCommand("obj = Arch.makeStructure(FreeCAD.ActiveDocument." + obj.Name + ")") +@@ -194,7 +194,7 @@ class _CommandStructure: + self.tracker.finalize() + if point == None: + return +- FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Create Structure"))) ++ FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Structure")) + FreeCADGui.addModule("Arch") + if self.Profile is not None: + if "Precast" in self.Profile: +diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp +index b83092d9e..6c20eb94c 100644 +--- a/src/Mod/Import/Gui/AppImportGuiPy.cpp ++++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp +@@ -541,7 +541,12 @@ private: + // the App Code. + std::vector< std::vector > Colors; + get_parts_colors(hierarchical_part,FreeLabels,part_id,Colors); +- ocaf.reallocateFreeShape(hierarchical_part,FreeLabels,part_id,Colors); ++ ocaf.reallocateFreeShape(hierarchical_part,FreeLabels,part_id,Colors); ++ ++#if OCC_VERSION_HEX >= 0x070200 ++ // Update is not performed automatically anymore: https://tracker.dev.opencascade.org/view.php?id=28055 ++ XCAFDoc_DocumentTool::ShapeTool(hDoc->Main())->UpdateAssemblies(); ++#endif + + Base::FileInfo file(Utf8Name.c_str()); + if (file.hasExtension("stp") || file.hasExtension("step")) { +diff --git a/src/Mod/Mesh/App/MeshPy.xml b/src/Mod/Mesh/App/MeshPy.xml +index c71944df6..76bc4618a 100644 +--- a/src/Mod/Mesh/App/MeshPy.xml ++++ b/src/Mod/Mesh/App/MeshPy.xml +@@ -520,7 +520,7 @@ for p in mesh.Facets: + + private: + friend class PropertyMeshKernel; +- class PropertyMeshKernel* parentProperty; ++ class PropertyMeshKernel* parentProperty = nullptr; + + + +diff --git a/src/Mod/PartDesign/App/DatumPoint.cpp b/src/Mod/PartDesign/App/DatumPoint.cpp +index 297d56276..5a65f09a6 100644 +--- a/src/Mod/PartDesign/App/DatumPoint.cpp ++++ b/src/Mod/PartDesign/App/DatumPoint.cpp +@@ -99,12 +99,12 @@ void Point::onChanged(const App::Property* prop) + Superclass::onChanged(prop); + } + +-void Point::Restore(Base::XMLReader& r) ++void Point::onDocumentRestored() + { +- Superclass::Restore(r); + //fix for #0002758 Datum point moves to (0,0,0) when reopening the file. + //recreate shape, as the restored one has old Placement burned into it. + this->makeShape(); ++ Superclass::onDocumentRestored(); + } + + void Point::makeShape() +@@ -114,7 +114,9 @@ void Point::makeShape() + BRepBuilderAPI_MakeVertex builder(gp_Pnt(0,0,0)); + if (!builder.IsDone()) + return; +- Shape.setValue(builder.Shape()); ++ Part::TopoShape tshape(builder.Shape()); ++ tshape.setPlacement(this->Placement.getValue()); ++ Shape.setValue(tshape); + } + + Base::Vector3d Point::getPoint() +diff --git a/src/Mod/PartDesign/App/DatumPoint.h b/src/Mod/PartDesign/App/DatumPoint.h +index 19dfdbeb4..e00cf6434 100644 +--- a/src/Mod/PartDesign/App/DatumPoint.h ++++ b/src/Mod/PartDesign/App/DatumPoint.h +@@ -50,9 +50,11 @@ public: + + protected: + virtual void onChanged(const App::Property* prop); +- virtual void Restore(Base::XMLReader& r); ++ virtual void onDocumentRestored() override; ++ + private: + void makeShape(); ++ + }; + + } //namespace PartDesign +diff --git a/src/Mod/Path/libarea/CMakeLists.txt b/src/Mod/Path/libarea/CMakeLists.txt +index ef95c29d3..087c911dd 100644 +--- a/src/Mod/Path/libarea/CMakeLists.txt ++++ b/src/Mod/Path/libarea/CMakeLists.txt +@@ -16,13 +16,17 @@ OPTION(USE_BOOST_PYTHON "use BOOST_PYTHON, otherwise use PYBIND11" ON) + + if(USE_BOOST_PYTHON) + if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) +- if(NOT PYTHON_VERSION_MAJOR LESS 3) +- find_package( Boost COMPONENTS python3) +- if (NOT Boost_PYTHON3_FOUND) ++ # boost-python >= 1.67 on some platforms has suffix ++ set(BOOST_PY_SUFFIX ${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}) ++ ++ find_package( Boost COMPONENTS python${BOOST_PY_SUFFIX} ) ++ if (NOT Boost_PYTHON${BOOST_PY_SUFFIX}_FOUND) ++ # try just the major version ++ find_package( Boost COMPONENTS python${PYTHON_VERSION_MAJOR} ) ++ if (NOT Boost_PYTHON${PYTHON_VERSION_MAJOR}_FOUND) ++ # unversioned + find_package( Boost COMPONENTS python REQUIRED) + endif() +- else() +- find_package( Boost COMPONENTS python REQUIRED) # find BOOST and boost-python + endif() + + if(Boost_FOUND) +diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +index 83c6c6007..3d9709603 100644 +--- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp ++++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +@@ -4867,7 +4867,7 @@ CmdSketcherCreatePeriodicBSpline::CmdSketcherCreatePeriodicBSpline() + void CmdSketcherCreatePeriodicBSpline::activated(int iMsg) + { + Q_UNUSED(iMsg); +- ActivateHandler(getActiveGuiDocument(),new DrawSketchHandlerEllipse(1) ); ++ ActivateHandler(getActiveGuiDocument(),new DrawSketchHandlerBSpline(1) ); + } + + bool CmdSketcherCreatePeriodicBSpline::isActive(void) +diff --git a/src/Mod/Spreadsheet/TestSpreadsheet.py b/src/Mod/Spreadsheet/TestSpreadsheet.py +index 56a0acf92..19ed6be8d 100644 +--- a/src/Mod/Spreadsheet/TestSpreadsheet.py ++++ b/src/Mod/Spreadsheet/TestSpreadsheet.py +@@ -851,6 +851,16 @@ class SpreadsheetCases(unittest.TestCase): + self.assertEqual(sheet.getContents('B1'), '=A1 == 1 ? 11 : (A1 == 2 ? 12 : 13)') + self.assertEqual(sheet.getContents('C1'), '=A1 == 1 ? (A1 == 2 ? 12 : 13) : 11') + ++ def testIssue3432(self): ++ """ Regression test for issue 3432; numbers with units are ignored from aggregates""" ++ sheet = self.doc.addObject('Spreadsheet::Sheet','Spreadsheet') ++ sheet.set('A1', '1mm') ++ sheet.set('B1', '2mm') ++ sheet.set('C1', '=max(A1:B1;3mm)') ++ self.doc.recompute() ++ self.assertEqual(sheet.get('C1'), Units.Quantity('3 mm')) ++ ++ + def tearDown(self): + #closing doc + FreeCAD.closeDocument(self.doc.Name) +diff --git a/src/Mod/TechDraw/Gui/Command.cpp b/src/Mod/TechDraw/Gui/Command.cpp +index 02f0103d2..de4f5ff8e 100644 +--- a/src/Mod/TechDraw/Gui/Command.cpp ++++ b/src/Mod/TechDraw/Gui/Command.cpp +@@ -78,6 +78,16 @@ + using namespace TechDrawGui; + using namespace std; + ++bool isArchSection(App::DocumentObject* obj) ++{ ++ bool result = true; ++ App::Property* prop1 = obj->getPropertyByName("Objects"); ++ App::Property* prop2 = obj->getPropertyByName("OnlySolids"); ++ if ( (!prop1) || (!prop2) ) { ++ result = false; ++ } ++ return result; ++} + + //=========================================================================== + // TechDraw_NewPageDef (default template) +@@ -92,7 +102,7 @@ CmdTechDrawNewPageDef::CmdTechDrawNewPageDef() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert new default drawing page"); + sToolTipText = QT_TR_NOOP("Insert new default drawing page"); +- sWhatsThis = "TechDraw_NewPageDef"; ++ sWhatsThis = "TechDraw_New_Default"; + sStatusTip = sToolTipText; + sPixmap = "actions/techdraw-new-default"; + } +@@ -162,7 +172,7 @@ CmdTechDrawNewPage::CmdTechDrawNewPage() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert new drawing page from template"); + sToolTipText = QT_TR_NOOP("Insert new drawing page from template"); +- sWhatsThis = "TechDraw_NewPage"; ++ sWhatsThis = "TechDraw_New_Pick"; + sStatusTip = sToolTipText; + sPixmap = "actions/techdraw-new-pick"; + } +@@ -302,7 +312,7 @@ CmdTechDrawNewViewSection::CmdTechDrawNewViewSection() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert section view in drawing"); + sToolTipText = QT_TR_NOOP("Insert a new Section View of a Part in the active drawing"); +- sWhatsThis = "TechDraw_NewViewSecton"; ++ sWhatsThis = "TechDraw_NewSection"; + sStatusTip = sToolTipText; + sPixmap = "actions/techdraw-viewsection"; + } +@@ -371,7 +381,7 @@ CmdTechDrawNewViewDetail::CmdTechDrawNewViewDetail() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert detail view in drawing"); + sToolTipText = QT_TR_NOOP("Insert a new Detail View of a Part in the active drawing"); +- sWhatsThis = "TechDraw_NewViewDetail"; ++ sWhatsThis = "TechDraw_NewProjGroup"; + sStatusTip = sToolTipText; + sPixmap = "actions/techdraw-viewdetail"; + } +@@ -562,7 +572,7 @@ CmdTechDrawAnnotation::CmdTechDrawAnnotation() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("&Annotation"); + sToolTipText = QT_TR_NOOP("Inserts an Annotation in the active drawing"); +- sWhatsThis = "TechDraw_Annotation"; ++ sWhatsThis = "TechDraw_NewAnnotation"; + sStatusTip = QT_TR_NOOP("Inserts an Annotation in the active drawing"); + sPixmap = "actions/techdraw-annotation"; + } +@@ -855,7 +865,7 @@ CmdTechDrawDraftView::CmdTechDrawDraftView() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert a DraftView"); + sToolTipText = QT_TR_NOOP("Inserts a Draft WB object into the active drawing"); +- sWhatsThis = "TechDraw_DraftView"; ++ sWhatsThis = "TechDraw_NewDraft"; + sStatusTip = QT_TR_NOOP("Inserts a Draft WB object into the active drawing"); + sPixmap = "actions/techdraw-draft-view"; + } +@@ -869,6 +879,7 @@ void CmdTechDrawDraftView::activated(int iMsg) + } + + //TODO: shouldn't this be checking for a Draft object only? ++// there is no obvious way of check for a Draft object. Could be App::FeaturePython, Part::Part2DObject, ??? + std::vector objects = getSelection().getObjectsOfType(App::DocumentObject::getClassTypeId()); + if (objects.empty()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), +@@ -894,7 +905,6 @@ bool CmdTechDrawDraftView::isActive(void) + return DrawGuiUtil::needPage(this); + } + +-//TODO: shouldn't this be checking for an Arch object only? + //=========================================================================== + // TechDraw_ArchView + //=========================================================================== +@@ -908,7 +918,7 @@ CmdTechDrawArchView::CmdTechDrawArchView() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert an ArchView"); + sToolTipText = QT_TR_NOOP("Inserts a view of an Arch Section Plane into the active drawing"); +- sWhatsThis = "TechDraw_ArchView"; ++ sWhatsThis = "TechDraw_NewArch"; + sStatusTip = QT_TR_NOOP("Inserts a view of an Arch Section Plane into the active drawing"); + sPixmap = "actions/techdraw-arch-view"; + } +@@ -922,23 +932,33 @@ void CmdTechDrawArchView::activated(int iMsg) + } + + std::vector objects = getSelection().getObjectsOfType(App::DocumentObject::getClassTypeId()); +- if (objects.size() != 1) { ++ if (objects.empty()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), +- QObject::tr("Select exactly one Arch Section Plane object.")); ++ QObject::tr("Select at least one object.")); + return; + } +- App::Property* prop1 = objects[0]->getPropertyByName("Objects"); +- App::Property* prop2 = objects[0]->getPropertyByName("OnlySolids"); +- if ( (!prop1) || (!prop2) ) { ++ int ifound = 0; ++ bool found = false; ++ for (auto& obj: objects) { ++ if (isArchSection(obj)) { ++ found = true; ++ break; ++ } ++ ifound++; ++ } ++ App::DocumentObject* archObj; ++ if (found) { ++ archObj = objects[ifound]; ++ } else { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), +- QObject::tr("The selected object is not an Arch Section Plane.")); ++ QObject::tr("There is no Arch Section Plane in selection.")); + return; + } + + std::string PageName = page->getNameInDocument(); + + std::string FeatName = getUniqueObjectName("ArchView"); +- std::string SourceName = objects[0]->getNameInDocument(); ++ std::string SourceName = archObj->getNameInDocument(); + openCommand("Create ArchView"); + doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewArch','%s')",FeatName.c_str()); + doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",FeatName.c_str(),SourceName.c_str()); +@@ -1024,7 +1044,7 @@ CmdTechDrawExportPage::CmdTechDrawExportPage() + sGroup = QT_TR_NOOP("File"); + sMenuText = QT_TR_NOOP("&Export page..."); + sToolTipText = QT_TR_NOOP("Export a page to an SVG file"); +- sWhatsThis = "TechDraw_ExportPage"; ++ sWhatsThis = "TechDraw_SaveSVG"; + sStatusTip = QT_TR_NOOP("Export a page to an SVG file"); + sPixmap = "actions/techdraw-saveSVG"; + } +diff --git a/src/Mod/TechDraw/Gui/CommandCreateDims.cpp b/src/Mod/TechDraw/Gui/CommandCreateDims.cpp +index f5324cc3b..5fa0b0bf9 100644 +--- a/src/Mod/TechDraw/Gui/CommandCreateDims.cpp ++++ b/src/Mod/TechDraw/Gui/CommandCreateDims.cpp +@@ -236,7 +236,7 @@ CmdTechDrawNewRadiusDimension::CmdTechDrawNewRadiusDimension() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert a new radius dimension into the drawing"); + sToolTipText = QT_TR_NOOP("Insert a new radius dimension feature for the selected view"); +- sWhatsThis = "TechDraw_NewRadiusDimension"; ++ sWhatsThis = "TechDraw_Dimension_Radius"; + sStatusTip = sToolTipText; + sPixmap = "TechDraw_Dimension_Radius"; + } +@@ -323,7 +323,7 @@ CmdTechDrawNewDiameterDimension::CmdTechDrawNewDiameterDimension() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert a new diameter dimension into the drawing"); + sToolTipText = QT_TR_NOOP("Insert a new diameter dimension feature for the selected view"); +- sWhatsThis = "TechDraw_NewDiameterDimension"; ++ sWhatsThis = "TechDraw_Dimension_Diameter"; + sStatusTip = sToolTipText; + sPixmap = "TechDraw_Dimension_Diameter"; + } +@@ -410,7 +410,7 @@ CmdTechDrawNewLengthDimension::CmdTechDrawNewLengthDimension() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert a new length dimension into the drawing"); + sToolTipText = QT_TR_NOOP("Insert a new length dimension"); +- sWhatsThis = "TechDraw_NewLengthDimension"; ++ sWhatsThis = "TechDraw_Dimension_Length"; + sStatusTip = sToolTipText; + sPixmap = "TechDraw_Dimension_Length"; + } +@@ -518,7 +518,7 @@ CmdTechDrawNewDistanceXDimension::CmdTechDrawNewDistanceXDimension() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert a new horizontal dimension into the drawing"); + sToolTipText = QT_TR_NOOP("Insert a new horizontal-distance dimension"); +- sWhatsThis = "TechDraw_NewDistanceXDimension"; ++ sWhatsThis = "TechDraw_Dimension_Horizontal"; + sStatusTip = sToolTipText; + sPixmap = "TechDraw_Dimension_Horizontal"; + } +@@ -626,7 +626,7 @@ CmdTechDrawNewDistanceYDimension::CmdTechDrawNewDistanceYDimension() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert a new vertical dimension into the drawing"); + sToolTipText = QT_TR_NOOP("Insert a new vertical distance dimension"); +- sWhatsThis = "TechDraw_NewDistanceYDimension"; ++ sWhatsThis = "TechDraw_Dimension_Vertical"; + sStatusTip = sToolTipText; + sPixmap = "TechDraw_Dimension_Vertical"; + } +@@ -733,7 +733,7 @@ CmdTechDrawNewAngleDimension::CmdTechDrawNewAngleDimension() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Insert a new angle dimension into the drawing"); + sToolTipText = QT_TR_NOOP("Insert a new angle dimension"); +- sWhatsThis = "TechDraw_NewAngleDimension"; ++ sWhatsThis = "TechDraw_Dimension_Angle"; + sStatusTip = sToolTipText; + sPixmap = "TechDraw_Dimension_Angle"; + } +@@ -822,7 +822,7 @@ CmdTechDrawLinkDimension::CmdTechDrawLinkDimension() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Link a dimension to 3D geometry"); + sToolTipText = QT_TR_NOOP("Link a dimension to 3D geometry"); +- sWhatsThis = "TechDraw_LinkDimension"; ++ sWhatsThis = "TechDraw_Dimension_Link"; + sStatusTip = sToolTipText; + sPixmap = "TechDraw_Dimension_Link"; + } +diff --git a/src/Mod/TechDraw/Gui/CommandDecorate.cpp b/src/Mod/TechDraw/Gui/CommandDecorate.cpp +index 9edf97d00..b6cb5dab0 100644 +--- a/src/Mod/TechDraw/Gui/CommandDecorate.cpp ++++ b/src/Mod/TechDraw/Gui/CommandDecorate.cpp +@@ -80,7 +80,7 @@ CmdTechDrawNewHatch::CmdTechDrawNewHatch() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Hatch a Face using image file"); + sToolTipText = QT_TR_NOOP("Hatch a Face using image file"); +- sWhatsThis = "TechDraw_NewHatch"; ++ sWhatsThis = "TechDraw_Hatch"; + sStatusTip = sToolTipText; + sPixmap = "actions/techdraw-hatch"; + } +@@ -142,7 +142,7 @@ CmdTechDrawNewGeomHatch::CmdTechDrawNewGeomHatch() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Apply geometric hatch to a Face"); + sToolTipText = QT_TR_NOOP("Apply geometric hatch to a Face"); +- sWhatsThis = "TechDraw_NewGeomHatch"; ++ sWhatsThis = "TechDraw_GeomHatch"; + sStatusTip = sToolTipText; + sPixmap = "actions/techdraw-geomhatch"; + } +@@ -264,7 +264,7 @@ CmdTechDrawToggleFrame::CmdTechDrawToggleFrame() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Turn View Frames on or off"); + sToolTipText = QT_TR_NOOP("Turn View Frames on or off"); +- sWhatsThis = "TechDraw_ToggleFrame"; ++ sWhatsThis = "TechDraw_Toggle"; + sStatusTip = sToolTipText; + sPixmap = "actions/techdraw-toggleframe"; + } +@@ -311,7 +311,7 @@ CmdTechDrawRedrawPage::CmdTechDrawRedrawPage() + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Redraw a page"); + sToolTipText = QT_TR_NOOP("Redraw a page"); +- sWhatsThis = "TechDraw_RedrawPage"; ++ sWhatsThis = "TechDraw_Redraw"; + sStatusTip = sToolTipText; + sPixmap = "TechDraw_Tree_Page_Sync"; + } From 2993c1af4b1b128752a15b5f3c96b3989237dade46f549eb24104d505f99aee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 8 May 2018 06:37:23 +0000 Subject: [PATCH 19/20] try OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=38 --- FreeCAD.changes | 7 +++++++ FreeCAD.spec | 5 ++--- branch_update.patch | 13 +++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/FreeCAD.changes b/FreeCAD.changes index 59e5f0e..d279001 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue May 8 06:33:56 UTC 2018 - adrian@suse.de + +- temporary disable FEM module + * it works fine, but requires hdf5 version 1.8 via med-tools, + which currently conflicts in openSUSE distro. + ------------------------------------------------------------------- Fri Apr 27 12:55:30 UTC 2018 - adrian@suse.de diff --git a/FreeCAD.spec b/FreeCAD.spec index 91a916c..579d57f 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -38,7 +38,7 @@ Patch2: 0001-find-openmpi2-include-files.patch Patch3: fix-draft-module-with-python3.patch BuildRequires: Coin-devel #BuildRequires: SoQt-devel -BuildRequires: libmed-devel +#BuildRequires: libmed-devel # needed for FEM module, but requires older hdf5 lib # we use upstream OpenCASCADE instead of oce atm BuildRequires: occt-devel BuildRequires: vtk-devel @@ -67,7 +67,6 @@ BuildRequires: fdupes BuildRequires: freeglut-devel BuildRequires: gcc-fortran BuildRequires: git -BuildRequires: hdf5-1_8-devel BuildRequires: libXerces-c-devel BuildRequires: pkg-config @@ -197,7 +196,7 @@ cmake \ -DFREECAD_USE_EXTERNAL_PIVY:BOOL=TRUE \ -DBUILD_MESH_PART:BOOL=ON \ -DBUILD_OPENSCAD:BOOL=ON \ - -DBUILD_FEM:BOOL=ON \ + -DBUILD_FEM:BOOL=OFF \ -DBUILD_FEM_NETGEN:BOOL=OFF \ -DFREECAD_USE_EXTERNAL_SMESH=OFF \ .. diff --git a/branch_update.patch b/branch_update.patch index 7763336..49487fb 100644 --- a/branch_update.patch +++ b/branch_update.patch @@ -221,6 +221,19 @@ index 19dfdbeb4..e00cf6434 100644 }; } //namespace PartDesign +diff --git a/src/Mod/Path/PathScripts/post/grbl_post.py b/src/Mod/Path/PathScripts/post/grbl_post.py +index 536c2cf54..9ad099243 100644 +--- a/src/Mod/Path/PathScripts/post/grbl_post.py ++++ b/src/Mod/Path/PathScripts/post/grbl_post.py +@@ -261,7 +261,7 @@ def parse(pathobj): + if param in c.Parameters: + if param == 'F': + if command not in RAPID_MOVES: +- outstring.append(param + format(c.Parameters['F'], '.2f')) ++ outstring.append(param + format(c.Parameters['F'] * 60, '.2f')) + elif param == 'T': + outstring.append(param + str(c.Parameters['T'])) + else: diff --git a/src/Mod/Path/libarea/CMakeLists.txt b/src/Mod/Path/libarea/CMakeLists.txt index ef95c29d3..087c911dd 100644 --- a/src/Mod/Path/libarea/CMakeLists.txt From 96c9f67d81fa75d6663de4e70f31c153664b9571677a0538f667a5a61a8e6c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 8 May 2018 07:42:39 +0000 Subject: [PATCH 20/20] bah OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=39 --- FreeCAD.changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FreeCAD.changes b/FreeCAD.changes index d279001..3abbc23 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -4,6 +4,8 @@ Tue May 8 06:33:56 UTC 2018 - adrian@suse.de - temporary disable FEM module * it works fine, but requires hdf5 version 1.8 via med-tools, which currently conflicts in openSUSE distro. +- Fix draft module crash + (got merged upstream for 0.18 fix-draft-module-with-python3.patch) ------------------------------------------------------------------- Fri Apr 27 12:55:30 UTC 2018 - adrian@suse.de