%global giacver 2.0.0.17 %global pypi_name giacpy %global with_check 1 # Architectures currently not supported # http://xcas.e.ujf-grenoble.fr/XCAS/viewtopic.php?f=19&t=1723 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: aarch64 %{ix86} %{power64} s390x Name: python-%{pypi_name} Version: 0.7.4 Release: %autorelease Summary: Python binding for Giac License: GPL-2.0-or-later URL: https://gitlab.math.univ-paris-diderot.fr/han/giacpy/ Source0: %pypi_source BuildRequires: giac-devel >= %{giacver} BuildRequires: giac-doc >= %{giacver} BuildRequires: gmp-devel, qt5-qtsvg-devel # Fix build with Cython >= 3.2 Patch0: %{name}-fix_cython-3.2-build.patch %description A Cython frontend to the c++ library Giac (Computer Algebra System). %package -n python3-%{pypi_name} Summary: Python3 binding for Giac %py_provides python3-%{pypi_name} BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros BuildRequires: python3-setuptools BuildRequires: %{_bindir}/cython BuildRequires: libqcas-devel Requires: python3dist(cython) Requires: giac-doc >= %{giacver} Obsoletes: python2-%{pypi_name} < 0:%{version} %description -n python3-%{pypi_name} A Cython frontend to the c++ library Giac (Computer Algebra System). %package -n python3-%{pypi_name}-devel Summary: Development libraries of python3-%{pypi_name} Requires: python3-%{pypi_name}%{?_isa} %description -n python3-%{pypi_name}-devel Development libraries of Python3 %{pypi_name}. %prep %autosetup -n %{pypi_name}-%{version} -N rm -rf *.egg-info %global cythonversion %(rpm -qi python3-cython | awk -F': ' '/Version/ {print $2}') %if 0%{!?cythonversion:3.2.0} %patch -P 0 -p1 -b .backup %endif # Remove the cythonized files in order to regenerate them during build. rm $(grep -rl '/\* Generated by Cython') %generate_buildrequires %pyproject_buildrequires -x tests %build export CFLAGS="%{optflags} %(pkg-config --cflags Qt5Xml Qt5Widgets)" %pyproject_wheel -C--global-option=--enable-qcas %install %pyproject_install %pyproject_save_files %{pypi_name} rm -f $RPM_BUILD_ROOT%{python3_sitearch}/%{pypi_name}/giacpy.cpp %if 0%{?with_check} %check pushd build/lib.linux-* export PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch} export PYTEST_XDIST_AUTO_NUM_WORKERS=1 export PYTHONDONTWRITEBYTECODE=1 %{python3} -m doctest ../../%{pypi_name}/%{pypi_name}.pyx -vvv popd %endif %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.txt %exclude %{python3_sitearch}/%{pypi_name}/*.h %files -n python3-%{pypi_name}-devel %{python3_sitearch}/%{pypi_name}/*.h %changelog %autochangelog