Fix RPM packaging and add support for building with Qt6 and PySide6 for Fedora 40+ (#19565)

This commit is contained in:
ljo
2025-03-19 04:31:21 +01:00
committed by GitHub
parent 6cfec14545
commit afe23a432c
2 changed files with 32 additions and 34 deletions

View File

@@ -7,18 +7,16 @@
# Maintainers: keep this list of plugins up to date # Maintainers: keep this list of plugins up to date
# List plugins in %%{_libdir}/%{name}/lib, less '.so' and 'Gui.so', here # 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 # Some configuration options for other environments
# rpmbuild --with=bundled_zipios: use bundled version of zipios++ # rpmbuild --with=bundled_zipios: use bundled version of zipios++
%global bundled_zipios %{?_with_bundled_zipios: 1} %{?!_with_bundled_zipios: 1} %global bundled_zipios %{?_with_bundled_zipios: 1} %{?!_with_bundled_zipios: 1}
# rpmbuild --without=bundled_pycxx: don't use bundled version of pycxx # rpmbuild --with=bundled_pycxx: use bundled version of pycxx
%global bundled_pycxx %{?_without_bundled_pycxx: 0} %{?!_without_bundled_pycxx: 1} %global bundled_pycxx %{?_with_bundled_pycxx: 1} %{?!_with_bundled_pycxx: 0}
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh # rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
%global bundled_smesh %{?_without_bundled_smesh: 0} %{?!_without_bundled_smesh: 1} %global bundled_smesh %{?_without_bundled_smesh: 0} %{?!_without_bundled_smesh: 1}
# Prevent RPM from doing its magical 'build' directory for now # Prevent RPM from doing its magical 'build' directory for now
%global __cmake_in_source_build 0 %global __cmake_in_source_build 0
@@ -33,7 +31,7 @@
Name: %{name} Name: %{name}
Epoch: 1 Epoch: 1
Version: 0.22 Version: 1.1.0
Release: pre_{{{git_commit_no}}}%{?dist} Release: pre_{{{git_commit_no}}}%{?dist}
Summary: A general purpose 3D CAD modeler Summary: A general purpose 3D CAD modeler
Group: Applications/Engineering Group: Applications/Engineering
@@ -63,21 +61,19 @@ BuildRequires: python3-devel
BuildRequires: python3-matplotlib BuildRequires: python3-matplotlib
BuildRequires: python3-pivy BuildRequires: python3-pivy
BuildRequires: boost-devel BuildRequires: boost-devel
BuildRequires: boost-python3-devel
BuildRequires: eigen3-devel BuildRequires: eigen3-devel
# Qt5 dependencies BuildRequires: qt6-qtsvg-devel
\BuildRequires: qt5-qtsvg-devel BuildRequires: qt6-qttools-static
BuildRequires: qt5-qttools-static
BuildRequires: fmt-devel BuildRequires: fmt-devel
BuildRequires: xerces-c BuildRequires: xerces-c
BuildRequires: xerces-c-devel BuildRequires: xerces-c-devel
BuildRequires: libspnav-devel BuildRequires: libspnav-devel
BuildRequires: python3-shiboken2-devel
BuildRequires: python3-pyside2-devel BuildRequires: python3-shiboken6-devel
BuildRequires: pyside2-tools BuildRequires: python3-pyside6-devel
BuildRequires: pyside6-tools
%if ! %{bundled_smesh} %if ! %{bundled_smesh}
BuildRequires: smesh-devel BuildRequires: smesh-devel
%endif %endif
@@ -90,6 +86,7 @@ BuildRequires: zipios++-devel
%if ! %{bundled_pycxx} %if ! %{bundled_pycxx}
BuildRequires: python3-pycxx-devel BuildRequires: python3-pycxx-devel
%endif %endif
BuildRequires: python3-pybind11
BuildRequires: libicu-devel BuildRequires: libicu-devel
BuildRequires: vtk-devel BuildRequires: vtk-devel
BuildRequires: openmpi-devel BuildRequires: openmpi-devel
@@ -111,7 +108,8 @@ BuildRequires: libappstream-glib
# here. # here.
Requires: %{name}-data = %{epoch}:%{version}-%{release} Requires: %{name}-data = %{epoch}:%{version}-%{release}
# Obsolete old doc package since it's required for functionality. # 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: hicolor-icon-theme
Requires: fmt Requires: fmt
@@ -119,8 +117,9 @@ Requires: fmt
Requires: python3-pivy Requires: python3-pivy
Requires: python3-matplotlib Requires: python3-matplotlib
Requires: python3-collada Requires: python3-collada
Requires: python3-pyside2 Requires: python3-pyside6
Requires: qt5-assistant Requires: qt6-assistant
%if %{bundled_smesh} %if %{bundled_smesh}
Provides: bundled(smesh) = %{bundled_smesh_version} 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 CXXFLAGS='-Wno-error=cast-function-type'; export CXXFLAGS
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
%if 0%{?fedora} > 27
%define MEDFILE_INCLUDE_DIRS %{_includedir}/med/ %define MEDFILE_INCLUDE_DIRS %{_includedir}/med/
%else
%define MEDFILE_INCLUDE_DIRS %{_includedir}/
%endif
%cmake \ %cmake \
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \ -DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
@@ -197,13 +192,14 @@ LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \ -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
-DRESOURCEDIR=%{_datadir}/%{name} \ -DRESOURCEDIR=%{_datadir}/%{name} \
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \ -DFREECAD_USE_EXTERNAL_PIVY=TRUE \
-DFREECAD_USE_PCL=TRUE \ -DFREECAD_USE_EXTERNAL_FMT=TRUE \
-DBUILD_QT5=ON \ -DFREECAD_USE_PCL:BOOL=OFF \
-DSHIBOKEN_INCLUDE_DIR=%{_includedir}/shiboken2 \ -DFREECAD_QT_VERSION:STRING=6 \
-DSHIBOKEN_LIBRARY=-lshiboken2.%{py_suffix} \ -DSHIBOKEN_INCLUDE_DIR=%{_includedir}/shiboken6 \
-DSHIBOKEN_LIBRARY=-lshiboken6.%{py_suffix} \
-DPYTHON_SUFFIX=.%{py_suffix} \ -DPYTHON_SUFFIX=.%{py_suffix} \
-DPYSIDE_INCLUDE_DIR=/usr/include/PySide2 \ -DPYSIDE_INCLUDE_DIR=/usr/include/PySide6 \
-DPYSIDE_LIBRARY=-lpyside2.%{py_suffix} \ -DPYSIDE_LIBRARY=-lpyside6.%{py_suffix} \
-DPython3_EXECUTABLE:FILEPATH=/usr/bin/python3 \ -DPython3_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DMEDFILE_INCLUDE_DIRS=%{MEDFILE_INCLUDE_DIRS} \ -DMEDFILE_INCLUDE_DIRS=%{MEDFILE_INCLUDE_DIRS} \
-DOpenGL_GL_PREFERENCE=GLVND \ -DOpenGL_GL_PREFERENCE=GLVND \
@@ -226,7 +222,7 @@ LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
-DPACKAGE_WCREF="%{release} (Git)" \ -DPACKAGE_WCREF="%{release} (Git)" \
-DPACKAGE_WCURL="git://github.com/%{github_name}/FreeCAD.git main" \ -DPACKAGE_WCURL="git://github.com/%{github_name}/FreeCAD.git main" \
-DENABLE_DEVELOPER_TESTS=FALSE \ -DENABLE_DEVELOPER_TESTS=FALSE \
-DBUILD_GUI=TRUE \ -DBUILD_GUI=TRUE \
../ ../
make fc_version make fc_version
@@ -274,12 +270,13 @@ popd
# Remove obsolete Start_Page.html # Remove obsolete Start_Page.html
rm -f %{buildroot}%{_docdir}/%{name}/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 # Remove header from external library that's erroneously installed
rm -f %{buildroot}%{_libdir}/%{name}/include/E57Format/E57Export.h 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. # Bug maintainers to keep %%{plugins} macro up to date.
# #
# Make sure there are no plugins that need to be added to plugins macro # Make sure there are no plugins that need to be added to plugins macro
@@ -346,12 +343,13 @@ fi
%{_datadir}/pixmaps/* %{_datadir}/pixmaps/*
%{_datadir}/mime/packages/* %{_datadir}/mime/packages/*
%{_datadir}/thumbnailers/* %{_datadir}/thumbnailers/*
%{_libdir}/../lib/python*/site-packages/%{name}/*
%files data %files data
%{_datadir}/%{name}/ %{_datadir}/%{name}/
%{_docdir}/%{name}/LICENSE.html %{_docdir}/%{name}/LICENSE.html
%{_docdir}/%{name}/ThirdPartyLibraries.html
%changelog %changelog
* Mon Mar 10 2025 Leif-Jöran Olsson <info@friprogramvarusyndikatet.se> - 1.1.0-1
- Adding support for building with Qt6 and PySide6 for Fedora 40+

View File

@@ -1,4 +1,4 @@
function git_commit_no { 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)) echo -n $((commits + 1))
} }