mirror of
https://abf.rosa.ru/djam/python-cython.git
synced 2025-02-23 22:02:47 +00:00
Merge pull request #1 from djam/python-cython:rosa2023.1
Backports and update
This commit is contained in:
commit
de1579309c
3 changed files with 62 additions and 80 deletions
5
.abf.yml
5
.abf.yml
|
@ -1,5 +1,2 @@
|
|||
removed_sources:
|
||||
cython-0.25.2.tar.gz: 3ddd844d06f8e8df46058e0d8fdf8056dcbd3116
|
||||
cython-0.27.3.tar.gz: 9a2b8948ba1f7b5096c758571e20d6cb7550d97e
|
||||
sources:
|
||||
cython-0.29.5.tar.gz: b1b9df0a7bf865f7a8382ff4f0164af478486e28
|
||||
cython-3.0.2.tar.gz: 148e629f998e7908222649b957cb52e144bafe98
|
||||
|
|
11
cython-0.29.28-missing-header.patch
Normal file
11
cython-0.29.28-missing-header.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
diff -up cython-0.29.28/Cython/Compiler/ModuleNode.py.omv~ cython-0.29.28/Cython/Compiler/ModuleNode.py
|
||||
--- cython-0.29.28/Cython/Compiler/ModuleNode.py.omv~ 2022-03-19 18:48:56.463782075 +0100
|
||||
+++ cython-0.29.28/Cython/Compiler/ModuleNode.py 2022-03-19 18:57:31.325762579 +0100
|
||||
@@ -642,6 +642,7 @@ class ModuleNode(Nodes.Node, Nodes.Block
|
||||
for inc in sorted(env.c_includes.values(), key=IncludeCode.sortkey):
|
||||
if inc.location == inc.INITIAL:
|
||||
inc.write(code)
|
||||
+ code.putln('#include "internal/pycore_frame.h"') # Needed for PyFrameObject in Python 3.11a6, PyFrameObject is used heavily by cython
|
||||
code.putln("#ifndef Py_PYTHON_H")
|
||||
code.putln(" #error Python headers needed to compile C extensions, "
|
||||
"please install development version of Python.")
|
|
@ -1,23 +1,26 @@
|
|||
# Python module not linking to libpython
|
||||
%global _disable_ld_no_undefined 1
|
||||
|
||||
%bcond_with check
|
||||
%define tarname cython
|
||||
|
||||
# Force python3 build - required by new hplip
|
||||
# % {?build_python3}%{?!build_python3:%bcond_without python3}
|
||||
%bcond_without python3
|
||||
%global optflags %optflags -O3
|
||||
|
||||
Summary: Language for writing C extensions to Python
|
||||
Name: python-cython
|
||||
License: Apache License
|
||||
Group: Development/Python
|
||||
Url: http://www.cython.org
|
||||
Version: 0.29.5
|
||||
Release: 1
|
||||
Source0: https://github.com/cython/cython/archive/%{version}%{?rctag:%{rctag}}/%{tarname}-%{version}%{?rctag:%{rctag}}.tar.gz
|
||||
Source100: %{name}.rpmlintrc
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: dos2unix
|
||||
BuildRequires: python-distribute
|
||||
%if %{with python3}
|
||||
BuildRequires: python3-distribute
|
||||
Summary: Language for writing C extensions to Python
|
||||
Name: python-cython
|
||||
Version: 3.0.2
|
||||
Release: 1
|
||||
License: Python
|
||||
Group: Development/Python
|
||||
Url: http://www.cython.org
|
||||
Source0: https://github.com/cython/cython/archive/%{version}.tar.gz?/cython-%{version}.tar.gz
|
||||
Source1: %{name}.rpmlintrc
|
||||
Patch0: cython-0.29.28-missing-header.patch
|
||||
BuildRequires: dos2unix
|
||||
%if %{with check}
|
||||
BuildRequires: gdb
|
||||
BuildRequires: gomp-devel
|
||||
BuildRequires: python3-numpy-devel
|
||||
%endif
|
||||
|
||||
%description
|
||||
|
@ -25,76 +28,47 @@ Cython is a language that facilitates the writing of C extensions for
|
|||
the Python language. It is based on Pyrex, but provides more cutting
|
||||
edge functionality and optimizations.
|
||||
|
||||
%if %{with python3}
|
||||
#--------------------------------------------------------------------
|
||||
%package -n python3-cython
|
||||
Summary: Language for writing C extensions to Python
|
||||
Group: Development/Python
|
||||
BuildRequires: python3-devel
|
||||
Summary: Language for writing C extensions to Python
|
||||
Group: Development/Python
|
||||
BuildRequires: pkgconfig(python3)
|
||||
BuildRequires: python3-setuptools
|
||||
Provides: python-cython = %{version}-%{release}
|
||||
|
||||
%description -n python3-cython
|
||||
Cython is a language that facilitates the writing of C extensions for
|
||||
the Python language. It is based on Pyrex, but provides more cutting
|
||||
edge functionality and optimizations.
|
||||
%endif
|
||||
|
||||
%files -n python3-cython
|
||||
%{_bindir}/cython
|
||||
%{_bindir}/cythonize
|
||||
%{_bindir}/cygdb
|
||||
%{py3_platsitedir}/Cython
|
||||
%{py3_platsitedir}/Cython-%{version}-*.egg-info
|
||||
%{py3_platsitedir}/cython*
|
||||
%{py3_platsitedir}/pyximport
|
||||
%{py3_platsitedir}/__pycache__/
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
%prep
|
||||
%setup -q -c
|
||||
%autosetup -p1 -n %{tarname}-%{version}
|
||||
|
||||
mv %{tarname}-%{version} python2
|
||||
%if %{with python3}
|
||||
cp -r python2 python3
|
||||
%endif
|
||||
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
||||
|
||||
%build
|
||||
pushd python2
|
||||
python setup.py build
|
||||
popd
|
||||
%if %{with python3}
|
||||
pushd python3
|
||||
python3 setup.py build
|
||||
popd
|
||||
%endif
|
||||
%setup_compile_flags
|
||||
CFLAGS="%{optflags}" %{__python3} setup.py build
|
||||
|
||||
%install
|
||||
%if %{with python3}
|
||||
pushd python3
|
||||
PYTHONDONTWRITEBYTECODE= python3 setup.py install --root %{buildroot}
|
||||
mv %{buildroot}/usr/bin/cython %{buildroot}/usr/bin/cython3
|
||||
mv %{buildroot}/usr/bin/cygdb %{buildroot}/usr/bin/cygdb3
|
||||
mv %{buildroot}/usr/bin/cythonize %{buildroot}/usr/bin/cythonize3
|
||||
popd
|
||||
%endif
|
||||
|
||||
pushd python2
|
||||
find -name .*DS_Store* | xargs rm -rf
|
||||
|
||||
PYTHONDONTWRITEBYTECODE= python setup.py install --root %{buildroot}
|
||||
pushd Tools
|
||||
dos2unix cython-mode.el
|
||||
install -m 755 -d %{buildroot}%{_sysconfdir}/emacs/site-start.d
|
||||
install -m 644 *.el* %{buildroot}%{_sysconfdir}/emacs/site-start.d
|
||||
popd
|
||||
popd
|
||||
|
||||
#%%check
|
||||
#PYTHONPATH=`pwd`/../build/lib make test clean
|
||||
|
||||
%files
|
||||
%{_sysconfdir}/emacs/site-start.d/*.el*
|
||||
%{_bindir}/cython
|
||||
%{_bindir}/cygdb
|
||||
%{_bindir}/cythonize
|
||||
%{py_platsitedir}/Cython*
|
||||
%{py_platsitedir}/cython*
|
||||
%{py_platsitedir}/pyximport*
|
||||
|
||||
%if %{with python3}
|
||||
%files -n python3-cython
|
||||
%{_bindir}/cython3
|
||||
%{_bindir}/cygdb3
|
||||
%{_bindir}/cythonize3
|
||||
%{py3_platsitedir}/__pycache__/*
|
||||
%{py3_platsitedir}/Cython*
|
||||
%{py3_platsitedir}/cython*
|
||||
%{py3_platsitedir}/pyximport*
|
||||
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
|
||||
rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
|
||||
rm -rf %{buildroot}/%{python3_sitearch}/__pycache__/
|
||||
|
||||
%if %{with check}
|
||||
%check
|
||||
python3 runtests.py
|
||||
|
||||
%endif
|
||||
|
|
Loading…
Add table
Reference in a new issue