From afe23a432c5e201d86225f09059d95f00cb3c890 Mon Sep 17 00:00:00 2001 From: ljo Date: Wed, 19 Mar 2025 04:31:21 +0100 Subject: [PATCH] Fix RPM packaging and add support for building with Qt6 and PySide6 for Fedora 40+ (#19565) --- package/fedora/freecad.spec | 64 ++++++++++++++++++------------------- rpkg.macros | 2 +- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/package/fedora/freecad.spec b/package/fedora/freecad.spec index 0de38bd387..92045a4019 100644 --- a/package/fedora/freecad.spec +++ b/package/fedora/freecad.spec @@ -7,18 +7,16 @@ # Maintainers: keep this list of plugins up to date # List plugins in %%{_libdir}/%{name}/lib, less '.so' and 'Gui.so', here -%global plugins Fem FreeCAD PathApp Import Inspection Mesh MeshPart Part Points ReverseEngineering Robot Sketcher Start Web PartDesignGui _PartDesign Path PathGui Spreadsheet SpreadsheetGui area DraftUtils DraftUtils libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libSMDS libSMESH libSMESHDS libStdMeshers Measure TechDraw TechDrawGui libarea-native Surface SurfaceGui AssemblyGui flatmesh QtUnitGui PathSimulator MatGui Material - +%global plugins AssemblyApp AssemblyGui CAMSimulator DraftUtils Fem FreeCAD Import Inspection MatGui Materials Measure Mesh MeshPart Part PartDesignGui Path PathApp PathSimulator Points QtUnitGui ReverseEngineering Robot Sketcher Spreadsheet Start Surface TechDraw Web _PartDesign area flatmesh libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libOndselSolver libSMDS libSMESH libSMESHDS libStdMeshers libarea-native # Some configuration options for other environments # rpmbuild --with=bundled_zipios: use bundled version of zipios++ %global bundled_zipios %{?_with_bundled_zipios: 1} %{?!_with_bundled_zipios: 1} -# rpmbuild --without=bundled_pycxx: don't use bundled version of pycxx -%global bundled_pycxx %{?_without_bundled_pycxx: 0} %{?!_without_bundled_pycxx: 1} +# rpmbuild --with=bundled_pycxx: use bundled version of pycxx +%global bundled_pycxx %{?_with_bundled_pycxx: 1} %{?!_with_bundled_pycxx: 0} # rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh %global bundled_smesh %{?_without_bundled_smesh: 0} %{?!_without_bundled_smesh: 1} - # Prevent RPM from doing its magical 'build' directory for now %global __cmake_in_source_build 0 @@ -33,7 +31,7 @@ Name: %{name} Epoch: 1 -Version: 0.22 +Version: 1.1.0 Release: pre_{{{git_commit_no}}}%{?dist} Summary: A general purpose 3D CAD modeler Group: Applications/Engineering @@ -63,21 +61,19 @@ BuildRequires: python3-devel BuildRequires: python3-matplotlib BuildRequires: python3-pivy BuildRequires: boost-devel -BuildRequires: boost-python3-devel BuildRequires: eigen3-devel -# Qt5 dependencies -\BuildRequires: qt5-qtsvg-devel -BuildRequires: qt5-qttools-static +BuildRequires: qt6-qtsvg-devel +BuildRequires: qt6-qttools-static BuildRequires: fmt-devel - BuildRequires: xerces-c BuildRequires: xerces-c-devel BuildRequires: libspnav-devel -BuildRequires: python3-shiboken2-devel -BuildRequires: python3-pyside2-devel -BuildRequires: pyside2-tools + +BuildRequires: python3-shiboken6-devel +BuildRequires: python3-pyside6-devel +BuildRequires: pyside6-tools %if ! %{bundled_smesh} BuildRequires: smesh-devel %endif @@ -90,6 +86,7 @@ BuildRequires: zipios++-devel %if ! %{bundled_pycxx} BuildRequires: python3-pycxx-devel %endif +BuildRequires: python3-pybind11 BuildRequires: libicu-devel BuildRequires: vtk-devel BuildRequires: openmpi-devel @@ -111,7 +108,8 @@ BuildRequires: libappstream-glib # here. Requires: %{name}-data = %{epoch}:%{version}-%{release} # Obsolete old doc package since it's required for functionality. -Obsoletes: %{name}-doc < 0.13-5 +Obsoletes: %{name}-doc < 0.22-1 + Requires: hicolor-icon-theme Requires: fmt @@ -119,8 +117,9 @@ Requires: fmt Requires: python3-pivy Requires: python3-matplotlib Requires: python3-collada -Requires: python3-pyside2 -Requires: qt5-assistant +Requires: python3-pyside6 +Requires: qt6-assistant + %if %{bundled_smesh} Provides: bundled(smesh) = %{bundled_smesh_version} @@ -184,11 +183,7 @@ rm -rf build && mkdir build && cd build CXXFLAGS='-Wno-error=cast-function-type'; export CXXFLAGS LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS -%if 0%{?fedora} > 27 %define MEDFILE_INCLUDE_DIRS %{_includedir}/med/ -%else -%define MEDFILE_INCLUDE_DIRS %{_includedir}/ -%endif %cmake \ -DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \ @@ -197,13 +192,14 @@ LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \ -DRESOURCEDIR=%{_datadir}/%{name} \ -DFREECAD_USE_EXTERNAL_PIVY=TRUE \ - -DFREECAD_USE_PCL=TRUE \ - -DBUILD_QT5=ON \ - -DSHIBOKEN_INCLUDE_DIR=%{_includedir}/shiboken2 \ - -DSHIBOKEN_LIBRARY=-lshiboken2.%{py_suffix} \ + -DFREECAD_USE_EXTERNAL_FMT=TRUE \ + -DFREECAD_USE_PCL:BOOL=OFF \ + -DFREECAD_QT_VERSION:STRING=6 \ + -DSHIBOKEN_INCLUDE_DIR=%{_includedir}/shiboken6 \ + -DSHIBOKEN_LIBRARY=-lshiboken6.%{py_suffix} \ -DPYTHON_SUFFIX=.%{py_suffix} \ - -DPYSIDE_INCLUDE_DIR=/usr/include/PySide2 \ - -DPYSIDE_LIBRARY=-lpyside2.%{py_suffix} \ + -DPYSIDE_INCLUDE_DIR=/usr/include/PySide6 \ + -DPYSIDE_LIBRARY=-lpyside6.%{py_suffix} \ -DPython3_EXECUTABLE:FILEPATH=/usr/bin/python3 \ -DMEDFILE_INCLUDE_DIRS=%{MEDFILE_INCLUDE_DIRS} \ -DOpenGL_GL_PREFERENCE=GLVND \ @@ -226,7 +222,7 @@ LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS -DPACKAGE_WCREF="%{release} (Git)" \ -DPACKAGE_WCURL="git://github.com/%{github_name}/FreeCAD.git main" \ -DENABLE_DEVELOPER_TESTS=FALSE \ - -DBUILD_GUI=TRUE \ + -DBUILD_GUI=TRUE \ ../ make fc_version @@ -274,12 +270,13 @@ popd # Remove obsolete Start_Page.html rm -f %{buildroot}%{_docdir}/%{name}/Start_Page.html -# Belongs in %%license not %%doc -rm -f %{buildroot}%{_docdir}/freecad/ThirdPartyLibraries.html # Remove header from external library that's erroneously installed rm -f %{buildroot}%{_libdir}/%{name}/include/E57Format/E57Export.h +rm -rf %{buildroot}%{_includedir}/OndselSolver/* +rm -f %{buildroot}%{_libdir}/%{name}/share/pkgconfig/OndselSolver.pc + # Bug maintainers to keep %%{plugins} macro up to date. # # Make sure there are no plugins that need to be added to plugins macro @@ -346,12 +343,13 @@ fi %{_datadir}/pixmaps/* %{_datadir}/mime/packages/* %{_datadir}/thumbnailers/* +%{_libdir}/../lib/python*/site-packages/%{name}/* %files data %{_datadir}/%{name}/ %{_docdir}/%{name}/LICENSE.html - +%{_docdir}/%{name}/ThirdPartyLibraries.html %changelog - - +* Mon Mar 10 2025 Leif-Jöran Olsson - 1.1.0-1 +- Adding support for building with Qt6 and PySide6 for Fedora 40+ diff --git a/rpkg.macros b/rpkg.macros index 4ae7012c14..13e4c09de7 100644 --- a/rpkg.macros +++ b/rpkg.macros @@ -1,4 +1,4 @@ function git_commit_no { - commits=$(curl -s 'https://api.github.com/repos/FreeCAD/FreeCAD/compare/120ca87015...master' | grep "\"ahead_by\":" | sed -s 's/ //g' | sed -s 's/"ahead_by"://' | sed -s 's/,//') + commits=$(curl -s 'https://api.github.com/repos/FreeCAD/FreeCAD/compare/120ca87015...main' | grep "\"ahead_by\":" | sed -s 's/ //g' | sed -s 's/"ahead_by"://' | sed -s 's/,//') echo -n $((commits + 1)) }