From 0f1295a30bc7f69b5409e91918431e0e436ff242 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Mon, 5 Aug 2024 20:04:59 +0200 Subject: [PATCH] update to 0.21.2 [release 0.21.2-1mamba;Sun Jul 28 2024] --- README.md | 5 + freecad-0.21.2-boost-1.85.0-2.patch | 19 +++ freecad-0.21.2-boost-1.85.0.patch | 22 +++ ...ad-0.21.2-desktop-icon-under-wayland.patch | 52 +++++++ ...21.2-fix-qt6-issues-in-addon-manager.patch | 83 +++++++++++ ...ube_drawing_and_interaction_with_qt6.patch | 29 ++++ freecad-0.21.2-vtk-9.3.0.patch | 14 ++ freecad.spec | 133 ++++++++++++++++++ 8 files changed, 357 insertions(+) create mode 100644 freecad-0.21.2-boost-1.85.0-2.patch create mode 100644 freecad-0.21.2-boost-1.85.0.patch create mode 100644 freecad-0.21.2-desktop-icon-under-wayland.patch create mode 100644 freecad-0.21.2-fix-qt6-issues-in-addon-manager.patch create mode 100644 freecad-0.21.2-fix_navicube_drawing_and_interaction_with_qt6.patch create mode 100644 freecad-0.21.2-vtk-9.3.0.patch create mode 100644 freecad.spec diff --git a/README.md b/README.md index a483eb6..e5837dd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # freecad +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. +Can reads and writes many open file formats such as STEP, IGES, STL, SVG, DXF, OBJ, IFC, DAE and many others. + diff --git a/freecad-0.21.2-boost-1.85.0-2.patch b/freecad-0.21.2-boost-1.85.0-2.patch new file mode 100644 index 0000000..69e96f1 --- /dev/null +++ b/freecad-0.21.2-boost-1.85.0-2.patch @@ -0,0 +1,19 @@ +--- FreeCAD-0.21.2/src/Gui/PreferencePackManager.cpp.orig 2024-08-04 16:13:24.378811087 +0200 ++++ FreeCAD-0.21.2/src/Gui/PreferencePackManager.cpp 2024-08-04 16:24:11.532521492 +0200 +@@ -44,7 +44,6 @@ + + #include // For generating a timestamped filename + +- + using namespace Gui; + using namespace xercesc; + namespace fs = boost::filesystem; +@@ -221,7 +220,7 @@ + auto savedPreferencePacksDirectory = + fs::path(App::Application::getUserAppDataDir()) / "SavedPreferencePacks"; + auto cfgFilename = savedPreferencePacksDirectory / packName / (packName + ".cfg"); +- fs::copy_file(path, cfgFilename, fs::copy_option::overwrite_if_exists); ++ fs::copy_file(path, cfgFilename, fs::copy_options::overwrite_existing); + rescan(); + } + diff --git a/freecad-0.21.2-boost-1.85.0.patch b/freecad-0.21.2-boost-1.85.0.patch new file mode 100644 index 0000000..0cd8128 --- /dev/null +++ b/freecad-0.21.2-boost-1.85.0.patch @@ -0,0 +1,22 @@ +From 95692e2c5f22f14644ba92115ebf04e869d606c2 Mon Sep 17 00:00:00 2001 +From: wmayer +Date: Sun, 21 Apr 2024 08:36:16 +0200 +Subject: [PATCH] Fixes #13549: smesh doesn't compile with boost 1.85 + +--- + src/3rdParty/salomesmesh/src/SMESH/DriverGMF.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/3rdParty/salomesmesh/src/SMESH/DriverGMF.cpp b/src/3rdParty/salomesmesh/src/SMESH/DriverGMF.cpp +index d72ff2363f39..f108cbbcb2cf 100644 +--- a/src/3rdParty/salomesmesh/src/SMESH/DriverGMF.cpp ++++ b/src/3rdParty/salomesmesh/src/SMESH/DriverGMF.cpp +@@ -55,7 +55,7 @@ namespace DriverGMF + + bool isExtensionCorrect( const std::string& fileName ) + { +- std::string ext = boost::filesystem::extension(fileName); ++ std::string ext = boost::filesystem::path(fileName).extension().string(); + switch ( ext.size() ) { + case 5: return ( ext == ".mesh" || ext == ".solb" ); + case 6: return ( ext == ".meshb" ); diff --git a/freecad-0.21.2-desktop-icon-under-wayland.patch b/freecad-0.21.2-desktop-icon-under-wayland.patch new file mode 100644 index 0000000..21bcdaa --- /dev/null +++ b/freecad-0.21.2-desktop-icon-under-wayland.patch @@ -0,0 +1,52 @@ +diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp +index dd032c367b..89e2d2e1a7 100644 +--- a/src/Main/MainGui.cpp ++++ b/src/Main/MainGui.cpp +@@ -164,7 +164,7 @@ int main( int argc, char ** argv ) + App::Application::Config()["SplashInfoColor" ] = "#8aadf4"; // light blue + App::Application::Config()["SplashInfoPosition" ] = "6,75"; + +- QGuiApplication::setDesktopFileName(QStringLiteral("org.freecad.FreeCAD.desktop")); ++ QGuiApplication::setDesktopFileName(QStringLiteral("org.freecad.FreeCAD")); + + try { + // Init phase =========================================================== +diff --git a/src/XDGData/CMakeLists.txt b/src/XDGData/CMakeLists.txt +index 9c70207f59..8c4cb7c74e 100644 +--- a/src/XDGData/CMakeLists.txt ++++ b/src/XDGData/CMakeLists.txt +@@ -25,12 +25,12 @@ install( + ) + + install( +- FILES org.freecadweb.FreeCAD.desktop ++ FILES org.freecad.FreeCAD.desktop + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications + ) + + install( +- FILES org.freecadweb.FreeCAD.svg ++ FILES org.freecad.FreeCAD.svg + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps + ) + +diff --git a/src/XDGData/org.freecadweb.FreeCAD.desktop b/src/XDGData/org.freecad.FreeCAD.desktop +similarity index 97% +rename from src/XDGData/org.freecadweb.FreeCAD.desktop +rename to src/XDGData/org.freecad.FreeCAD.desktop +index df82a16063..1326f37ca7 100644 +--- a/src/XDGData/org.freecadweb.FreeCAD.desktop ++++ b/src/XDGData/org.freecad.FreeCAD.desktop +@@ -17,7 +17,7 @@ GenericName[ru]=Система автоматизированного проек + Exec=FreeCAD %F + Terminal=false + Type=Application +-Icon=org.freecadweb.FreeCAD ++Icon=org.freecad.FreeCAD + Categories=Graphics;Science;Education;Engineering; + StartupNotify=true + MimeType=application/x-extension-fcstd;model/obj;model/iges;image/vnd.dwg;image/vnd.dxf;model/vnd.collada+xml;application/iges;model/iges;model/step;model/step+zip;model/stl;application/vnd.shp;model/vrml; +diff --git a/src/XDGData/org.freecadweb.FreeCAD.svg b/src/XDGData/org.freecad.FreeCAD.svg +similarity index 100% +rename from src/XDGData/org.freecadweb.FreeCAD.svg +rename to src/XDGData/org.freecad.FreeCAD.svg diff --git a/freecad-0.21.2-fix-qt6-issues-in-addon-manager.patch b/freecad-0.21.2-fix-qt6-issues-in-addon-manager.patch new file mode 100644 index 0000000..fb18075 --- /dev/null +++ b/freecad-0.21.2-fix-qt6-issues-in-addon-manager.patch @@ -0,0 +1,83 @@ +From 62c3836c97a56db24e3ef567a31eba2d0893b945 Mon Sep 17 00:00:00 2001 +From: Ladislav Michl +Date: Tue, 23 Jan 2024 12:46:32 +0100 +Subject: [PATCH] Addon Manager: Qt6 fixes + +--- + src/Mod/AddonManager/addonmanager_utilities.py | 4 ++-- + src/Mod/AddonManager/change_branch.py | 2 +- + src/Mod/AddonManager/package_details.py | 7 +++---- + src/Mod/AddonManager/package_list.py | 7 +++---- + 4 files changed, 9 insertions(+), 11 deletions(-) + +diff --git a/src/Mod/AddonManager/addonmanager_utilities.py b/src/Mod/AddonManager/addonmanager_utilities.py +index 9ceabc2e9add..183a2047b086 100644 +--- a/src/Mod/AddonManager/addonmanager_utilities.py ++++ b/src/Mod/AddonManager/addonmanager_utilities.py +@@ -36,7 +36,7 @@ + from urllib.parse import urlparse + + try: +- from PySide import QtCore, QtWidgets ++ from PySide import QtCore, QtGui, QtWidgets + except ImportError: + QtCore = None + QtWidgets = None +@@ -245,7 +245,7 @@ def get_readme_html_url(repo): + def is_darkmode() -> bool: + """Heuristics to determine if we are in a darkmode stylesheet""" + pl = fci.FreeCADGui.getMainWindow().palette() +- return pl.color(pl.Background).lightness() < 128 ++ return pl.color(QtGui.QPalette.Window).lightness() < 128 + + + def warning_color_string() -> str: +diff --git a/src/Mod/AddonManager/change_branch.py b/src/Mod/AddonManager/change_branch.py +index 332795a22afc..ebe1819bc755 100644 +--- a/src/Mod/AddonManager/change_branch.py ++++ b/src/Mod/AddonManager/change_branch.py +@@ -216,7 +216,7 @@ def data(self, index: QtCore.QModelIndex, role: int = QtCore.Qt.DisplayRole): + dd = self.display_data[row] + if column == 3 or column == 4: + if dd[column] is not None: +- qdate = QtCore.QDateTime.fromTime_t(dd[column]) ++ qdate = QtCore.QDateTime.fromSecsSinceEpoch(dd[column]) + return QtCore.QLocale().toString(qdate, QtCore.QLocale.ShortFormat) + elif column < len(dd): + return dd[column] +diff --git a/src/Mod/AddonManager/package_details.py b/src/Mod/AddonManager/package_details.py +index 93dfb8bee962..8310b5e90343 100644 +--- a/src/Mod/AddonManager/package_details.py ++++ b/src/Mod/AddonManager/package_details.py +@@ -133,10 +133,9 @@ def display_repo_status(self, status): + date = "" + installed_version_string = "

" + if repo.updated_timestamp: +- date = ( +- QtCore.QDateTime.fromTime_t(repo.updated_timestamp) +- .date() +- .toString(QtCore.Qt.SystemLocaleShortDate) ++ date = QtCore.QLocale().toString( ++ QtCore.QDateTime.fromSecsSinceEpoch(int(round(repo.updated_timestamp, 0))), ++ QtCore.QLocale.ShortFormat, + ) + if version and date: + installed_version_string += ( +diff --git a/src/Mod/AddonManager/package_list.py b/src/Mod/AddonManager/package_list.py +index a9dd3dc59856..d26b4f5489c3 100644 +--- a/src/Mod/AddonManager/package_list.py ++++ b/src/Mod/AddonManager/package_list.py +@@ -465,10 +465,9 @@ def get_expanded_update_string(repo: Addon) -> str: + installed_date_string = ( + "
" + translate("AddonsInstaller", "Installed on") + ": " + ) +- installed_date_string += ( +- QtCore.QDateTime.fromTime_t(repo.updated_timestamp) +- .date() +- .toString(QtCore.Qt.SystemLocaleShortDate) ++ installed_date_string += QtCore.QLocale().toString( ++ QtCore.QDateTime.fromSecsSinceEpoch(int(round(repo.updated_timestamp, 0))), ++ QtCore.QLocale.ShortFormat, + ) + + available_version_string = "" diff --git a/freecad-0.21.2-fix_navicube_drawing_and_interaction_with_qt6.patch b/freecad-0.21.2-fix_navicube_drawing_and_interaction_with_qt6.patch new file mode 100644 index 0000000..0ab9997 --- /dev/null +++ b/freecad-0.21.2-fix_navicube_drawing_and_interaction_with_qt6.patch @@ -0,0 +1,29 @@ +From ccaee18917432fd02e4371a7847bdfaf0692edd1 Mon Sep 17 00:00:00 2001 +From: Martin Rodriguez Reboredo +Date: Sun, 19 May 2024 23:23:45 -0300 +Subject: [PATCH] Gui: Fix NaviCube for Qt6 + +--- + src/Gui/NaviCube.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp +index 2d164f196b3c..9e3a62d66c81 100644 +--- a/src/Gui/NaviCube.cpp ++++ b/src/Gui/NaviCube.cpp +@@ -926,6 +926,7 @@ NaviCubeImplementation::PickId NaviCubeImplementation::pickFace(short x, short y + GLubyte pixels[4] = {0}; + if (m_PickingFramebuffer && std::abs(x) <= m_CubeWidgetSize / 2 && + std::abs(y) <= m_CubeWidgetSize / 2) { ++ static_cast(m_View3DInventorViewer->viewport())->makeCurrent(); + m_PickingFramebuffer->bind(); + + glViewport(0, 0, m_CubeWidgetSize * 2, m_CubeWidgetSize * 2); +@@ -936,6 +937,7 @@ NaviCubeImplementation::PickId NaviCubeImplementation::pickFace(short x, short y + glReadPixels(2 * x + m_CubeWidgetSize, 2 * y + m_CubeWidgetSize, 1, 1, + GL_RGBA, GL_UNSIGNED_BYTE, &pixels); + m_PickingFramebuffer->release(); ++ static_cast(m_View3DInventorViewer->viewport())->doneCurrent(); + } + return pixels[3] == 255 ? static_cast(pixels[0]) : PickId::None; + } diff --git a/freecad-0.21.2-vtk-9.3.0.patch b/freecad-0.21.2-vtk-9.3.0.patch new file mode 100644 index 0000000..9270285 --- /dev/null +++ b/freecad-0.21.2-vtk-9.3.0.patch @@ -0,0 +1,14 @@ +diff --git a/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp b/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp +index 7e3de0070a..dc5249158d 100644 +--- a/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp ++++ b/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp +@@ -1026,7 +1026,8 @@ void SMDS_UnstructuredGrid::BuildLinks() + GetLinks()->Allocate(this->GetNumberOfPoints()); + GetLinks()->Register(this); + //FIXME: vtk9 +- GetLinks()->BuildLinks(this); ++ GetLinks()->SetDataSet(this); ++ GetLinks()->BuildLinks(); + GetLinks()->Delete(); + #else + this->Links = SMDS_CellLinks::New(); diff --git a/freecad.spec b/freecad.spec new file mode 100644 index 0000000..132ac85 --- /dev/null +++ b/freecad.spec @@ -0,0 +1,133 @@ +Name: freecad +Version: 0.21.2 +Release: 1mamba +Summary: a parametric 3D modeler +Group: Graphical Desktop/Applications/Graphics +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://www.freecad.org/ +Source: https://github.com/FreeCAD/FreeCAD.git/%{version}/FreeCAD-%{version}.tar.bz2 +Patch0: freecad-0.21.2-vtk-9.3.0.patch +Patch1: freecad-0.21.2-desktop-icon-under-wayland.patch +Patch2: freecad-0.21.2-fix-qt6-issues-in-addon-manager.patch +Patch3: freecad-0.21.2-fix_navicube_drawing_and_interaction_with_qt6.patch +Patch4: freecad-0.21.2-boost-1.85.0.patch +Patch5: freecad-0.21.2-boost-1.85.0-2.patch +License: LGPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libX11-devel +BuildRequires: libboost-devel +BuildRequires: libcoin-devel +BuildRequires: libfmt-devel +BuildRequires: libfreetype-devel +BuildRequires: libgcc +BuildRequires: libglew-devel +BuildRequires: libglu-devel +BuildRequires: libglvnd-devel +BuildRequires: libgomp-devel +BuildRequires: libhdf5-devel +BuildRequires: libjsoncpp-devel +BuildRequires: libmed-devel +BuildRequires: libmpi-devel +BuildRequires: libocct-devel +BuildRequires: libpython3-devel +BuildRequires: libspnav-devel +BuildRequires: libstdc++6-devel +BuildRequires: libtbb-devel +BuildRequires: libvtk-devel +BuildRequires: libxerces-c-devel +BuildRequires: libz-devel +BuildRequires: qt6-qtbase-devel +BuildRequires: qt6-qtdeclarative-devel +BuildRequires: qt6-qtpositioning-devel +BuildRequires: qt6-qtsvg-devel +BuildRequires: qt6-qttools-devel +BuildRequires: qt6-qtwebchannel-devel +BuildRequires: qt6-qtwebengine-devel +## AUTOBUILDREQ-END +BuildRequires: oce +BuildRequires: libboost-devel +BuildRequires: cmake +Obsoletes: Free-CAD < 0.21.2 +Obsoletes: libFree-CAD < 0.21.2 +Obsoletes: libFree-CAD-devel < 0.21.2 + +%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. +Can reads and writes many open file formats such as STEP, IGES, STL, SVG, DXF, OBJ, IFC, DAE and many others. + +%debug_package + +%prep +%setup -q -n FreeCAD-%{version} +#-D -T +#:<< _EOF +%patch 0 -p1 -b .vtk-9.3.0 +%patch 1 -p1 -b .desktop-icon-under-wayland +%patch 2 -p1 -b .fix-qt6-issues-in-addon-manager +%patch 3 -p1 -b .fix_navicube_drawing_and_interaction_with_qt6 +%patch 4 -p1 -b .boost-1.85.0 +%patch 5 -p1 -b .boost-1.85.0-2 + +%build +#:<< __EOF +%cmake -d build \ + -DBUILD_FLAT_MESH=ON \ + -DBUILD_ENABLE_CXX_STD=C++17 \ + -DBUILD_FEM_VTK=TRUE \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_INSTALL_BINDIR=%{_libdir}/freecad/bin \ + -DCMAKE_INSTALL_DATADIR=%{_datadir}/freecad \ + -DCMAKE_INSTALL_DOCDIR=%{_datadir}/freecad/doc \ + -DCMAKE_INSTALL_LIBDIR=%{_datadir}/freecad/lib \ + -DCMAKE_INSTALL_PREFIX=%{_datadir}/freecad \ + -DFREECAD_USE_EXTERNAL_PIVY=ON \ + -DFREECAD_USE_OCC_VARIANT='Official Version' \ + -DFREECAD_USE_QT_FILEDIALOG=ON \ + -DFREECAD_QT_VERSION=6 \ + -DCMAKE_INSTALL_DOCDIR:PATH="share/freecad/doc" \ + -DCMAKE_INSTALL_DATADIR:PATH="share/freecad" \ + -DCMAKE_BUILD_TYPE=Release + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall -C build + +install -d %{buildroot}%{_bindir} +ln -sf ../%{_lib}/freecad/bin/FreeCAD %{buildroot}%{_bindir}/freecad +ln -sf ../%{_lib}/freecad/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD +ln -sf ../%{_lib}/freecad/bin/FreeCADCmd %{buildroot}%{_bindir}/freecadcmd +ln -sf ../%{_lib}/freecad/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd + + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_bindir}/FreeCAD +%{_bindir}/FreeCADCmd +%{_bindir}/freecad +%{_bindir}/freecadcmd +%dir %{_libdir}/freecad +%dir %{_libdir}/freecad/bin +%{_libdir}/freecad/bin/FreeCAD +%{_libdir}/freecad/bin/FreeCADCmd +%dir %{_datadir}/freecad +%{_datadir}/freecad/* + +%changelog +* Sun Jul 28 2024 Silvan Calarco 0.21.2-1mamba +- update to 0.21.2 + +* Tue Jun 14 2016 Ercole 'ercolinux' Carpanetto 0.17_pre-1mamba +- update to 0.17_pre + +* Mon Jun 13 2016 Ercole 'ercolinux' Carpanetto 0.16-1mamba +- package created using the webbuild interface