Use packit to build rpm and add it as check on pull request (#21063)

* Update spec file

use custom macro to package the source file

reformat freecad.spec

add script for build from source archive

use bcond macro

use standard builddir and don't delete it to fast local rebuild

configure cmake correctly to avoid moving file later

add tests

remove python bytecompile is default

build in RelWithDebInfo to generate correctly the debuginfo package (debug info will be stripped from standard package and a debuginfo package will be generated

export dev package for ondselsolver

export libondselsolver

use new macro for filtering requires provides

simplify regexp.
remove delete unused source
enable gui tests
other fix

Disabile gui test to avoid timeout

add timeout to tests

remove rpkg macro for archive extraction

refactor prepare for packit

small fix

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

small fix

change packit configuration

fix format

fix packit

/packit build

authomatic build on commit

remove libkdtree++-devel missing in rawhide

* add packit configuration

escape changelog for spec file

add new build on release

simplify configuration to use only packit
remove script used to have only a spec file and build with 3 system
rpkg
custom bash script
packit

* add tests in test-farm

add test that read build time tests result

use default build type for pr build and always print buiild time tests result

fix and disable option without bundled_gtest

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* add github action

Update fedora-daily.yml

Potential fix for code scanning alert no. 203: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Update spec file

use custom macro to package the source file

reformat freecad.spec

add script for build from source archive

use bcond macro

use standard builddir and don't delete it to fast local rebuild

configure cmake correctly to avoid moving file later

add tests

remove python bytecompile is default

build in RelWithDebInfo to generate correctly the debuginfo package (debug info will be stripped from standard package and a debuginfo package will be generated

export dev package for ondselsolver

export libondselsolver

use new macro for filtering requires provides

simplify regexp.
remove delete unused source
enable gui tests
other fix

Disabile gui test to avoid timeout

add timeout to tests

remove rpkg macro for archive extraction

refactor prepare for packit

small fix

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

small fix

change packit configuration

fix format

fix packit

/packit build

authomatic build on commit

remove libkdtree++-devel missing in rawhide

* add packit configuration

escape changelog for spec file

add new build on release

simplify configuration to use only packit
remove script used to have only a spec file and build with 3 system
rpkg
custom bash script
packit

* add tests in test-farm

add test that read build time tests result

use default build type for pr build and always print buiild time tests result

fix and disable option without bundled_gtest

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

Update package/fedora/freecad.spec

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* add github action

Update fedora-daily.yml

Potential fix for code scanning alert no. 203: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* tentative fix test

* add verbose failed tests

* fix ctest

* Remove error file if 2 time is successful

* Update plan.fmf add IfcOpenShell-python3

* Update .packit.yaml

Update freecad.spec

Update plan.fmf

Update .packit.yaml

Update plan.fmf

* Update freecad.spec

* restore version

* add rpm cmake preset

* update tests

* add qt6-assistant deps

* use xvfb-run for QuantitySpinBox test

* fix ctest command

* clean

* restore Addon Manager: Add defusedxml dependency

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
FilippoR
2025-10-27 18:06:38 +01:00
committed by GitHub
parent 1111f8da7c
commit 9cf380810a
14 changed files with 621 additions and 290 deletions

View File

@@ -1,109 +1,67 @@
# This package depends on automagic byte compilation
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3
%global py_bytecompile 1
# Some configuration options for other environments
# rpmbuild --without=bundled_zipios: don't use bundled version of zipios++
%bcond_without bundled_zipios
# rpmbuild --with=bundled_pycxx: use bundled version of pycxx
%bcond_with bundled_pycxx
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
%bcond_without bundled_smesh
# rpmbuild --without=bundled_gtest: don't use bundled version of gtest and gmock
%bcond_with bundled_gtest
# rpmbuild --without=tests exclude tests in %%check
%bcond_without tests
# rpmbuild --without=debug_info don't generate package with debug info
%bcond_without debug_info
Name: freecad
Epoch: 1
Version: 1.1.0~dev
Release: 1%{?dist}
Summary: A general purpose 3D CAD modeler
Group: Applications/Engineering
License: LGPL-2.0-or-later
URL: https://www.freecad.org/
Source0: freecad-sources.tar.gz
# Setup python target for shiboken so the right cmake file is imported.
%global py_suffix %(%{__python3} -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))")
# Maintainers: keep this list of plugins up to date
# List plugins in %%{_libdir}/%{name}/lib, less '.so' and 'Gui.so', here
%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
# List plugins in %%{_libdir}/%%{name}/lib, less '.so' and 'Gui.so', here
%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 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 --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
%global exported_libs libOndselSolver
# See FreeCAD-main/src/3rdParty/salomesmesh/CMakeLists.txt to find this out.
%global bundled_smesh_version 7.7.1.0
# Some plugins go in the Mod folder instead of lib. Deal with those here:
%global mod_plugins Mod/PartDesign
%define name freecad
%define github_name FreeCAD
%define branch main
Name: %{name}
Epoch: 1
Version: 1.1.0
Release: pre_{{{git_commit_no}}}%{?dist}
Summary: A general purpose 3D CAD modeler
Group: Applications/Engineering
License: LGPLv2+
URL: https://www.freecad.org/
Source0: {{{ git_repo_pack }}}
#add all submodule as source
Source1: {{{ git_pack path=$GIT_ROOT/src/3rdParty/OndselSolver/ dir_name="OndselSolver" }}}
Source2: {{{ git_pack path=$GIT_ROOT/src/3rdParty/GSL/ dir_name="GSL" }}}
Source3: {{{ git_pack path=$GIT_ROOT/src/Mod/AddonManager/ dir_name="AddonManager" }}}
# See /src/3rdParty/PyCXX/CXX/Version.h to find this out.
%global bundled_pycxx_version 7.1.9
# See /src/3rdParty/OndselSolver/CMakeLists.txt to find this out.
%global bundled_ondsel_solver_version 1.0.1
# Utilities
BuildRequires: cmake gcc-c++ gettext
BuildRequires: doxygen swig graphviz
BuildRequires: gcc-gfortran
BuildRequires: desktop-file-utils
BuildRequires: git
BuildRequires: tbb-devel
BuildRequires: cmake gcc-c++ gettext doxygen swig graphviz gcc-gfortran desktop-file-utils tbb-devel ninja-build strace
%if %{with tests}
BuildRequires: xorg-x11-server-Xvfb python3-typing-extensions
%if %{without bundled_gtest}
BuildRequires: gtest-devel gmock-devel
%endif
%endif
# Development Libraries
BuildRequires: freeimage-devel
BuildRequires: libXmu-devel
BuildRequires: mesa-libEGL-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: opencascade-devel
BuildRequires: Coin4-devel
BuildRequires: python3-devel
BuildRequires: python3-matplotlib
BuildRequires: python3-pivy
BuildRequires: boost-devel
BuildRequires: eigen3-devel
BuildRequires: qt6-qtsvg-devel
BuildRequires: qt6-qttools-static
BuildRequires: fmt-devel
BuildRequires: xerces-c
BuildRequires: xerces-c-devel
BuildRequires: libspnav-devel
BuildRequires: python3-shiboken6-devel
BuildRequires: python3-pyside6-devel
BuildRequires: pyside6-tools
%if ! %{bundled_smesh}
BuildRequires:boost-devel Coin4-devel eigen3-devel freeimage-devel fmt-devel libglvnd-devel libicu-devel libspnav-devel libXmu-devel med-devel mesa-libEGL-devel mesa-libGLU-devel netgen-mesher-devel netgen-mesher-devel-private opencascade-devel openmpi-devel python3 python3-devel python3-matplotlib python3-pivy python3-pybind11 python3-pyside6-devel python3-shiboken6-devel pyside6-tools qt6-qttools-static qt6-qtsvg-devel vtk-devel xerces-c-devel yaml-cpp-devel
#pcl-devel
%if %{without bundled_smesh}
BuildRequires: smesh-devel
%endif
BuildRequires: netgen-mesher-devel
BuildRequires: netgen-mesher-devel-private
%if ! %{bundled_zipios}
%if %{without bundled_zipios}
BuildRequires: zipios++-devel
%endif
%if ! %{bundled_pycxx}
%if %{without bundled_pycxx}
BuildRequires: python3-pycxx-devel
%endif
BuildRequires: python3-pybind11
BuildRequires: libicu-devel
BuildRequires: vtk-devel
BuildRequires: openmpi-devel
BuildRequires: med-devel
BuildRequires: libkdtree++-devel
BuildRequires: pcl-devel
BuildRequires: python3
BuildRequires: libglvnd-devel
BuildRequires: yaml-cpp-devel
#BuildRequires: zlib-devel
# For appdata
%if 0%{?fedora}
BuildRequires: libappstream-glib
@@ -115,39 +73,31 @@ Requires: %{name}-data = %{epoch}:%{version}-%{release}
# Obsolete old doc package since it's required for functionality.
Obsoletes: %{name}-doc < 0.22-1
Requires: hicolor-icon-theme
Requires: hicolor-icon-theme fmt python3-matplotlib python3-pivy python3-collada python3-pyside6 qt6-assistant python3-typing-extensions python3-defusedxml
Requires: fmt
Requires: python3-defusedxml
Requires: python3-pivy
Requires: python3-matplotlib
Requires: python3-collada
Requires: python3-pyside6
Requires: qt6-assistant
%if %{bundled_smesh}
%if %{with bundled_smesh}
Provides: bundled(smesh) = %{bundled_smesh_version}
%endif
%if %{bundled_pycxx}
Provides: bundled(python-pycxx)
%if %{with bundled_pycxx}
Provides: bundled(python-pycxx) = %{bundled_pycxx_version}
%endif
Recommends: python3-pysolar
Provides: bundled(libondselsolver) = %{bundled_ondsel_solver_version}
Recommends: python3-pysolar IfcOpenShell-python3
# plugins and private shared libs in %%{_libdir}/freecad/lib are private;
# prevent private capabilities being advertised in Provides/Requires
%define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i\\\|$iGui"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
%{?filter_setup:
%filter_provides_in %{_libdir}/%{name}/lib
%filter_from_requires %{plugin_regexp}
%filter_from_provides %{plugin_regexp}
%filter_provides_in %{_libdir}/%{name}/Mod
%filter_requires_in %{_libdir}/%{name}/Mod
%filter_setup
}
%global plugin_exclude %( for i in %{plugins}; do echo -n "\|$i\(Gui\)\?"; done )
# prevent declaring Requires for internal FreeCAD libraries
%global lib_exclude %( for i in %{exported_libs}; do echo -n "\|$i"; done )
%global __requires_exclude_from ^%{_libdir}/%{name}/(lib|Mod)/.*
%global __provides_exclude_from ^%{_libdir}/%{name}/Mod/.*
%global __provides_exclude ^(libFreeCAD.*%{plugin_exclude})\.so.*
%global __requires_exclude ^(libFreeCAD.*%{plugin_exclude}%{lib_exclude})\.so.*
%description
FreeCAD is a general purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler, aimed
@@ -166,204 +116,211 @@ Requires: %{name} = %{epoch}:%{version}-%{release}
%description data
Data files for FreeCAD
%package libondselsolver-devel
Summary: Development file for OndselSolver
BuildArch: noarch
Requires: %{name} = %{epoch}:%{version}-%{release}
%description libondselsolver-devel
Development file for OndselSolver
#path that contain main FreeCAD sources for cmake
%global tests_resultdir %{_datadir}/%{name}/tests_result/%{_arch}
%if %{without debug_info}
%global debug_package %{nil}
%global _enable_debug_packages 0
%endif
%prep
rm -rf %{github_name}
# extract submodule archive and move in correct path
%setup -T -a 1 -c -q -D -n %{github_name}/src/3rdParty/ #OndselSolver
%setup -T -a 2 -c -q -D -n %{github_name}/src/3rdParty/ #GSL
%setup -T -a 3 -c -q -D -n %{github_name}/src/Mod/ #AddonManager
%setup -T -b 0 -q -D -n %{github_name}
# Remove bundled pycxx if we're not using it
%if ! %{bundled_pycxx}
rm -rf src/CXX
%endif
%if ! %{bundled_zipios}
rm -rf src/zipios++
#sed -i "s/zipios-config.h/zipios-config.hpp/g" \
# src/Base/Reader.cpp src/Base/Writer.h
%endif
# Removed bundled libraries
%setup -T -a 0 -q -c -n FreeCAD-1.0.2
%build
rm -rf build && mkdir build && cd build
# Deal with cmake projects that tend to link excessively.
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
# Deal with cmake projects that tend to link excessively.
CXXFLAGS='-Wno-error=cast-function-type'; export CXXFLAGS
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
# -DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
# -DCMAKE_INSTALL_DATAROOTDIR=%{_datadir} \
%define MEDFILE_INCLUDE_DIRS %{_includedir}/med/
%cmake \
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
-DRESOURCEDIR=%{_datadir}/%{name} \
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
-DFREECAD_USE_EXTERNAL_FMT=TRUE \
-DFREECAD_USE_PCL:BOOL=OFF \
-DFREECAD_QT_VERSION:STRING=6 \
-DOpenGL_GL_PREFERENCE=GLVND \
-DUSE_OCC=TRUE \
%if %{without bundled_pycxx}
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
%endif
%if %{without bundled_smesh}
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
%endif
%if %{without bundled_zipios}
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
%endif
%if %{with tests}
-DENABLE_DEVELOPER_TESTS=TRUE \
%if %{without bundled_gtest}
-DFREECAD_USE_EXTERNAL_GTEST=TRUE \
%else
-DINSTALL_GTEST=OFF \
-DINSTALL_GMOCK=OFF \
%endif
%else
-DENABLE_DEVELOPER_TESTS=FALSE \
%endif
-DONDSELSOLVER_BUILD_EXE=TRUE \
-DBUILD_GUI=TRUE \
-G Ninja
%cmake \
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
-DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
-DRESOURCEDIR=%{_datadir}/%{name} \
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
-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/PySide6 \
-DPYSIDE_LIBRARY=-lpyside6.%{py_suffix} \
-DPython3_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DMEDFILE_INCLUDE_DIRS=%{MEDFILE_INCLUDE_DIRS} \
-DOpenGL_GL_PREFERENCE=GLVND \
-DCOIN3D_INCLUDE_DIR=%{_includedir}/Coin4 \
-DCOIN3D_DOC_PATH=%{_datadir}/Coin4/Coin \
-DUSE_OCC=TRUE \
%if ! %{bundled_smesh}
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
-DSMESH_FOUND=TRUE \
-DSMESH_INCLUDE_DIR=%{_includedir}/smesh \
-DSMESH_DIR=`pwd`/../cMake \
%endif
%if ! %{bundled_zipios}
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
%endif
%if ! %{bundled_pycxx}
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
%endif
-DPACKAGE_WCREF="%{release} (Git)" \
-DPACKAGE_WCURL="git://github.com/%{github_name}/FreeCAD.git main" \
-DENABLE_DEVELOPER_TESTS=FALSE \
-DBUILD_GUI=TRUE \
../
%cmake_build
make fc_version
for I in src/Build/Version.h src/Build/Version.h.out; do
sed -i 's,FCRevision \"Unknown\",FCRevision \"%{release} (Git)\",' $I
sed -i 's,FCRepositoryURL \"Unknown\",FCRepositoryURL \"git://github.com/FreeCAD/FreeCAD.git main\",' $I
done
%{make_build}
%install
cd build
%make_install
%cmake_install
# Symlink binaries to /usr/bin
mkdir -p %{buildroot}%{_bindir}
ln -s ../%{_lib}/%{name}/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD
ln -s ../%{_lib}/%{name}/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd
# Symlink binaries to /usr/bin
mkdir -p %{buildroot}%{_bindir}
ln -s ../%{_lib}/%{name}/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD
ln -s ../%{_lib}/%{name}/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd
mkdir %{buildroot}%{_metainfodir}/
mv %{buildroot}%{_libdir}/%{name}/share/metainfo/* %{buildroot}%{_metainfodir}/
# Remove header from external library that's erroneously installed
rm -rf %{buildroot}%{_libdir}/%{name}/include/E57Format
rm -rf %{buildroot}%{_includedir}/gmock
rm -rf %{buildroot}%{_includedir}/gtest
mkdir %{buildroot}%{_datadir}/applications/
mv %{buildroot}%{_libdir}/%{name}/share/applications/* %{buildroot}%{_datadir}/applications/
mkdir -p %{buildroot}%{_datadir}/thumbnailers/
mv %{buildroot}%{_libdir}/%{name}/share/thumbnailers/* %{buildroot}%{_datadir}/thumbnailers/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/
mv %{buildroot}%{_libdir}/%{name}/share/icons/hicolor/scalable/* %{buildroot}%{_datadir}/icons/hicolor/scalable/
mkdir -p %{buildroot}%{_datadir}/pixmaps/
mv %{buildroot}%{_libdir}/%{name}/share/pixmaps/* %{buildroot}%{_datadir}/pixmaps/
mkdir -p %{buildroot}%{_datadir}/mime/packages/
mv %{buildroot}%{_libdir}/%{name}/share/mime/packages/* %{buildroot}%{_datadir}/mime/packages/
pushd %{buildroot}%{_libdir}/%{name}/share/
rmdir metainfo/
rmdir applications/
rm -rf mime
rm -rf icons
popd
# Remove obsolete Start_Page.html
rm -f %{buildroot}%{_docdir}/%{name}/Start_Page.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
new_plugins=`ls %{buildroot}%{_libdir}/%{name}/%{_lib} | sed -e '%{plugin_regexp}'`
if [ -n "$new_plugins" ]; then
echo -e "\n\n\n**** ERROR:\n" \
"\nPlugins not caught by regexp: " $new_plugins \
"\n\nPlugins in %{_libdir}/%{name}/lib do not exist in" \
"\nspecfile %%{plugins} macro. Please add these to" \
"\n%%{plugins} macro at top of specfile and rebuild.\n****\n" 1>&2
exit 1
fi
# Make sure there are no entries in the plugins macro that don't match plugins
for p in %{plugins}; do
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$p*.so`" ]; then
set +x
echo -e "\n\n\n**** ERROR:\n" \
"\nExtra entry in %%{plugins} macro with no matching plugin:" \
"'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
"\nspecfile and rebuild.\n****\n" 1>&2
exit 1
fi
done
# Bytecompile Python modules
%py_byte_compile %{__python3} %{buildroot}%{_libdir}/%{name}
rm -rf %{buildroot}%{_libdir}/%{name}/%{_lib}/cmake
rm -rf %{buildroot}%{_libdir}/%{name}/%{_lib}/pkgconfig
#Move files using `-DCMAKE_INSTALL_DATAROOTDIR=%%{_datadir}` break ctest
mkdir -p %{buildroot}%{_datadir}
mv %{buildroot}%{_libdir}/freecad/share/applications %{buildroot}%{_datadir}/
mkdir -p %{buildroot}%{_metainfodir}
mv %{buildroot}%{_libdir}/freecad/share/metainfo/* %{buildroot}%{_metainfodir}/
mkdir -p %{buildroot}%{_datadir}
mv %{buildroot}%{_libdir}/freecad/share/icons %{buildroot}%{_datadir}/
mv %{buildroot}%{_libdir}/freecad/share/pixmaps %{buildroot}%{_datadir}/
mv %{buildroot}%{_libdir}/freecad/share/mime %{buildroot}%{_datadir}/
mv %{buildroot}%{_libdir}/freecad/share/thumbnailers %{buildroot}%{_datadir}/
mv %{buildroot}%{_libdir}/freecad/share/pkgconfig %{buildroot}%{_datadir}/
%check
desktop-file-validate \
%{buildroot}%{_datadir}/applications/org.freecad.FreeCAD.desktop
%{?fedora:appstream-util validate-relax --nonet \
%{buildroot}%{_metainfodir}/*.metainfo.xml}
%if %{with tests}
mkdir -p %{buildroot}%tests_resultdir
if %ctest -E '^QuantitySpinBox_Tests_run$' &> %{buildroot}%tests_resultdir/ctest.result ; then
echo "ctest OK"
else
echo "**** Failed ctest ****"
touch %{buildroot}%tests_resultdir/ctest.failed
fi
if xvfb-run \%ctest -R '^QuantitySpinBox_Tests_run$' &>> %{buildroot}%tests_resultdir/ctest_gui.result ; then
echo "ctest gui OK"
else
echo "**** Failed ctest gui ****"
touch %{buildroot}%tests_resultdir/ctest_gui.failed
fi
%endif
desktop-file-validate %{buildroot}%{_datadir}/applications/org.freecad.FreeCAD.desktop
%{?fedora:appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml}
# Bug maintainers to keep %%{plugins} macro up to date.
#
# Make sure there are no plugins that need to be added to plugins macro
%define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
%define exported_libs_regexp /^\\\(%(for i in %{exported_libs}; do echo -n "\\\|$i"; done)\\\)\\.so/d
new_plugins=`ls %{buildroot}%{_libdir}/%{name}/%{_lib} | sed -e '%{plugin_regexp}' -e '%exported_libs_regexp'`
if [ -n "$new_plugins" ]; then
echo -e "\n\n\n**** ERROR:\n" \
"\nPlugins not caught by regexps:" \
"\n" $new_plugins \
"\n\nPlugins in %{_libdir}/%{name}/lib do not exist in" \
"\nspecfile %%{plugins} or %%{exported_libs_regexp} macro." \
"\nPlease add these to %%{plugins} or %%{exported_libs}" \
"\nmacro at top of specfile" \
"\nand rebuild.\n****\n" 1>&2
exit 1
fi
# Make sure there are no entries in the plugins macro that don't match plugins
for p in %{plugins}; do
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$p*.so`" ]; then
set +x
echo -e "\n\n\n**** ERROR:\n" \
"\nExtra entry in %%{plugins} macro with no matching plugin:" \
"'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
"\nspecfile and rebuild.\n****\n" 1>&2
exit 1
fi
done
# Make sure there are no entries in the exported_libs_regexp macro that don't match plugins
for d in %{exported_libs}; do
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$d*.so`" ]; then
set +x
echo -e "\n\n\n**** ERROR:\n" \
"\nExtra entry in %%{exported_libs} macro with no matching lib:" \
"'$d'.\n\nPlease remove from %%{exported_libs} macro at top of" \
"\nspecfile and rebuild.\n****\n" 1>&2
exit 1
fi
done
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor/scalable/apps &>/dev/null || :
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor/scalable/apps &>/dev/null || :
%files
%{_bindir}/*
%{_metainfodir}/*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/bin/
%{_libdir}/%{name}/%{_lib}/
%{_libdir}/%{name}/Ext/
%{_libdir}/%{name}/Mod/
%{_libdir}/%{name}/share/
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/*
%{_datadir}/pixmaps/*
%{_datadir}/mime/packages/*
%{_datadir}/thumbnailers/*
#find a way to configure in cmake with %%name to avoid conflict with different package name
%{python3_sitelib}/freecad/*
%if %{with tests}
%tests_resultdir/*
%endif
%{_bindir}/*
%{_metainfodir}/*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/bin/
%{_libdir}/%{name}/%{_lib}/
%{_libdir}/%{name}/Ext/
%{_libdir}/%{name}/Mod/
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/scalable/*
%{_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
%{_datadir}/%{name}/
%{_docdir}/%{name}/LICENSE.html
%{_docdir}/%{name}/ThirdPartyLibraries.html
%files libondselsolver-devel
%{_datadir}/pkgconfig/OndselSolver.pc
%{_includedir}/OndselSolver/*
%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,3 +0,0 @@
[rpkg]
auto_pack = False
user_macros = "${git_props:root}/rpkg.macros"

View File

@@ -0,0 +1 @@
1

1
package/fedora/tests/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
!/.fmf/

View File

@@ -0,0 +1,12 @@
/ctest :
test: |
cat /usr/share/freecad/tests_result/`uname -m`/ctest.result
if [ -f /usr/share/freecad/tests_result/`uname -m`/ctest.failed ]; then
exit 1
fi
/ctest_gui :
test: |
cat /usr/share/freecad/tests_result/`uname -m`/ctest_gui.result
if [ -f /usr/share/freecad/tests_result/`uname -m`/ctest_gui.failed ]; then
exit 1
fi

View File

@@ -0,0 +1,42 @@
/tests:
/TestAssemblyWorkbench :
test: /usr/bin/FreeCADCmd -t TestAssemblyWorkbench
/TestArch :
test: /usr/bin/FreeCADCmd -t TestArch
/TestCAMApp :
test: /usr/bin/FreeCADCmd -t TestCAMApp
/TestDraft :
test: /usr/bin/FreeCADCmd -t TestDraft
/TestFemApp :
test: /usr/bin/FreeCADCmd -t TestFemApp
/TestMaterialsApp :
test: /usr/bin/FreeCADCmd -t TestMaterialsApp
/MeshTestsApp :
test: /usr/bin/FreeCADCmd -t MeshTestsApp
/TestPartApp :
test: /usr/bin/FreeCADCmd -t TestPartApp
/TestPartDesignApp :
test: /usr/bin/FreeCADCmd -t TestPartDesignApp
/TestSketcherApp :
test: /usr/bin/FreeCADCmd -t TestSketcherApp
/TestSpreadsheet :
test: /usr/bin/FreeCADCmd -t TestSpreadsheet
/TestSurfaceApp :
test: /usr/bin/FreeCADCmd -t TestSurfaceApp
/TestTechDrawApp :
test: /usr/bin/FreeCADCmd -t TestTechDrawApp
/BaseTests :
test: /usr/bin/FreeCADCmd -t BaseTests
/UnitTests :
test: /usr/bin/FreeCADCmd -t UnitTests
/Document :
test: /usr/bin/FreeCADCmd -t Document
/Metadata :
test: /usr/bin/FreeCADCmd -t Metadata
/StringHasher :
test: /usr/bin/FreeCADCmd -t StringHasher
/UnicodeTests :
test: /usr/bin/FreeCADCmd -t UnicodeTests
/TestPythonSyntax :
test: /usr/bin/FreeCADCmd -t TestPythonSyntax

View File

@@ -0,0 +1,74 @@
/tests:
/TestAssemblyWorkbench :
test: xvfb-run /usr/bin/FreeCAD -t TestAssemblyWorkbench
/TestArch :
test: xvfb-run /usr/bin/FreeCAD -t TestArch
/TestCAMApp :
test: xvfb-run /usr/bin/FreeCAD -t TestCAMApp
/TestDraft :
test: xvfb-run /usr/bin/FreeCAD -t TestDraft
/TestFemApp :
test: xvfb-run /usr/bin/FreeCAD -t TestFemApp
/TestMaterialsApp :
test: xvfb-run /usr/bin/FreeCAD -t TestMaterialsApp
/MeshTestsApp :
test: xvfb-run /usr/bin/FreeCAD -t MeshTestsApp
/TestPartApp :
test: xvfb-run /usr/bin/FreeCAD -t TestPartApp
/TestPartDesignApp :
test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignApp
/TestSketcherApp :
test: xvfb-run /usr/bin/FreeCAD -t TestSketcherApp
/TestSpreadsheet :
test: xvfb-run /usr/bin/FreeCAD -t TestSpreadsheet
/TestSurfaceApp :
test: xvfb-run /usr/bin/FreeCAD -t TestSurfaceApp
/TestTechDrawApp :
test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawApp
/BaseTests :
test: xvfb-run /usr/bin/FreeCAD -t BaseTests
/UnitTests :
test: xvfb-run /usr/bin/FreeCAD -t UnitTests
/Document :
test: xvfb-run /usr/bin/FreeCAD -t Document
/Metadata :
test: xvfb-run /usr/bin/FreeCAD -t Metadata
/StringHasher :
test: xvfb-run /usr/bin/FreeCAD -t StringHasher
/UnicodeTests :
test: xvfb-run /usr/bin/FreeCAD -t UnicodeTests
/TestPythonSyntax :
test: xvfb-run /usr/bin/FreeCAD -t TestPythonSyntax
/TestArchGui :
test: xvfb-run /usr/bin/FreeCAD -t TestArchGui
/TestCAMGui :
test: xvfb-run /usr/bin/FreeCAD -t TestCAMGui
/TestDraftGui :
test: xvfb-run /usr/bin/FreeCAD -t TestDraftGui
/TestFemGui :
test: xvfb-run /usr/bin/FreeCAD -t TestFemGui
/TestImportGui :
test: xvfb-run /usr/bin/FreeCAD -t TestImportGui
/TestMaterialsGui :
test: xvfb-run /usr/bin/FreeCAD -t TestMaterialsGui
/TestOpenSCADGui :
test: xvfb-run /usr/bin/FreeCAD -t TestOpenSCADGui
/TestPartGui :
test: xvfb-run /usr/bin/FreeCAD -t TestPartGui
/TestPartDesignGui :
test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignGui
/TestSketcherGui :
test: xvfb-run /usr/bin/FreeCAD -t TestSketcherGui
/TestTechDrawGui :
test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawGui
/Workbench :
test: xvfb-run /usr/bin/FreeCAD -t Workbench
/Menu :
test: xvfb-run /usr/bin/FreeCAD -t Menu
/Menu.MenuDeleteCases :
test: xvfb-run /usr/bin/FreeCAD -t Menu.MenuDeleteCases
/Menu.MenuCreateCases :
test: xvfb-run /usr/bin/FreeCAD -t Menu.MenuCreateCases
/GuiDocument :
test: xvfb-run /usr/bin/FreeCAD -t GuiDocument

View File

@@ -0,0 +1,10 @@
summary:
Run All FreeCAD python tests
prepare:
how: install
package:
- xorg-x11-server-Xvfb
discover:
how: fmf
execute:
how: tmt

View File

@@ -0,0 +1,4 @@
summary: Run All FreeCADCmd python tests
test: /usr/bin/FreeCADCmd -v
require: /usr/bin/FreeCADCmd
duration: 1m