Introduce cython_compile bcond

This commit is contained in:
Miro Hrončok 2021-03-04 10:25:03 +01:00 committed by Charalampos Stratakis
parent 01325efb37
commit ccddd179e2

View File

@ -3,6 +3,10 @@
%bcond_without tests
# This bcond allows to ship a non-compiled version
# Slower, but sometimes necessary with alpha Python versions
%bcond_without cython_compile
Name: Cython
Version: 0.29.22
%global upver %{version_no_tilde %{nil}}
@ -22,7 +26,14 @@ Source: https://github.com/cython/cython/archive/%{upver}/%{srcname}-%{v
# See also: https://github.com/cython/cython/issues/3614
Patch3106: class-static-method-workaround.patch
%if %{with cython_compile}
BuildRequires: gcc
%global python3_site %{python3_sitearch}
%else
BuildArch: noarch
%global python3_site %{python3_sitelib}
%endif
%if %{with tests}
BuildRequires: gcc-c++
%endif
@ -70,7 +81,7 @@ cython-mode is an Emacs major mode for editing Cython source files.
%autosetup -n %{upname}-%{upver} -p1
%build
%py3_build
%py3_build -- %{!?with_cython_compile:--no-cython-compile}
# emacs-cython-mode build
echo ";;
@ -80,7 +91,7 @@ cp -p Tools/cython-mode.el .
%install
%py3_install
%py3_install -- %{!?with_cython_compile:--no-cython-compile}
rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
# emacs-cython-mode install
@ -105,11 +116,11 @@ cp -p cython-mode-init.el cython-mode-init.elc %{buildroot}%{_emacs_sitestartdir
%{_bindir}/cython
%{_bindir}/cygdb
%{_bindir}/cythonize
%{python3_sitearch}/%{srcname}-*.egg-info/
%{python3_sitearch}/%{srcname}/
%{python3_sitearch}/pyximport/
%{python3_sitearch}/%{upname}.py
%{python3_sitearch}/__pycache__/%{upname}.*
%{python3_site}/%{srcname}-*.egg-info/
%{python3_site}/%{srcname}/
%{python3_site}/pyximport/
%{python3_site}/%{upname}.py
%{python3_site}/__pycache__/%{upname}.*
%files -n emacs-cython-mode
%license LICENSE.txt