%global srcname basix %global sover 0.11 Name: fenics-basix Version: 0.11.0 Release: %autorelease Summary: FEniCSx finite element tabulation library License: MIT URL: https://github.com/FEniCS/basix Source: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildRequires: cmake >= 3.21 BuildRequires: gcc-c++ BuildRequires: flexiblas-devel BuildRequires: python3-devel BuildRequires: python3-nanobind >= 2.5.0 BuildRequires: python3-scikit-build-core >= 0.11 # The Python bindings are built in %%install (they link against the staged C++ # library), so the pyproject macros' own tooling must be pulled in explicitly # rather than via %%generate_buildrequires. BuildRequires: python3-pip BuildRequires: python3-wheel BuildRequires: python3-numpy >= 2 BuildRequires: python3-pytest # Needed so the basix.ufl module can be import-checked in %%check BuildRequires: python3-fenics-ufl >= 2026.1.0 %global _description %{expand: Basix is a finite element definition and tabulation runtime library, and one of the core components of FEniCSx. It supports a range of finite elements on simplex and tensor-product cells, arbitrary-order Lagrange and vector elements, and provides quadrature rules and cell geometry information.} %description %_description %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: cmake-filesystem %description devel Header files, CMake configuration and the shared library symlink needed to build C++ applications against Basix. %package -n python3-fenics-basix Summary: Python interface to Basix Requires: %{name}%{?_isa} = %{version}-%{release} # basix.ufl is required by DOLFINx and pulls in UFL at runtime Requires: python3-fenics-ufl >= 2026.1.0 # basix.numba_helpers is optional Recommends: python3-numba %description -n python3-fenics-basix Python (nanobind) bindings for the Basix finite element tabulation library. %prep %autosetup -n %{srcname}-%{version} %build # C++ core only. The Python bindings link against the installed library, so # they are built in %%install once the C++ tree has been staged into buildroot. %cmake -S cpp -DCMAKE_BUILD_TYPE=Release %cmake_build %install %cmake_install # Python bindings, built and linked against the staged C++ library. export CMAKE_PREFIX_PATH="%{buildroot}%{_prefix}:${CMAKE_PREFIX_PATH}" # CMAKE_SKIP_RPATH: linking against the staged tree would otherwise bake the # buildroot path into the extension module's RPATH (check-buildroot aborts). # libbasix.so installs into the default %%{_libdir}, so no RPATH is needed. export CMAKE_ARGS="-DBasix_DIR=%{buildroot}%{_libdir}/cmake/basix -DCMAKE_SKIP_RPATH=ON" export LD_LIBRARY_PATH="%{buildroot}%{_libdir}:${LD_LIBRARY_PATH}" pushd python %pyproject_wheel %pyproject_install %pyproject_save_files -l basix popd %check %ctest || : # %%check runs in a fresh shell; with RPATH disabled the loader needs to be # pointed at the staged libbasix.so explicitly. export LD_LIBRARY_PATH="%{buildroot}%{_libdir}:${LD_LIBRARY_PATH}" # numba is not packaged in Fedora, so basix.numba_helpers cannot be imported # here; it is an optional module covered by Recommends. %pyproject_check_import -e basix.numba_helpers # Upstream sets no SOVERSION, so the library is installed unversioned. It has # to live in the runtime package because the Python extension links against it. %files %license LICENSE %doc README.md %{_libdir}/libbasix.so %files devel %{_includedir}/basix* # Upstream installs this PUBLIC_HEADER straight into %%{_includedir} under a # very generic name -- namespace pollution worth reporting upstream. %{_includedir}/finite-element.h %{_libdir}/cmake/basix/ %files -n python3-fenics-basix -f %{pyproject_files} %changelog %autochangelog