6 |
6 |
DISTUTILS_EXT=1
|
7 |
7 |
DISTUTILS_USE_PEP517=setuptools
|
8 |
8 |
PYTHON_TESTED=( python3_{10..11} )
|
9 |
|
# 3.12 not tested yet for https://github.com/cython/cython/issues/5285.
|
10 |
9 |
PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_12 pypy3 )
|
11 |
10 |
PYTHON_REQ_USE="threads(+)"
|
12 |
11 |
|
13 |
|
inherit distutils-r1 multiprocessing toolchain-funcs elisp-common
|
|
12 |
inherit distutils-r1 multiprocessing toolchain-funcs
|
14 |
13 |
|
|
14 |
MY_P=${P/_rc/rc}
|
15 |
15 |
DESCRIPTION="A Python to C compiler"
|
16 |
16 |
HOMEPAGE="
|
17 |
17 |
https://cython.org/
|
... | ... | |
19 |
19 |
https://pypi.org/project/Cython/
|
20 |
20 |
"
|
21 |
21 |
SRC_URI="
|
22 |
|
https://github.com/cython/cython/archive/${PV}.tar.gz
|
23 |
|
-> ${P}.gh.tar.gz
|
|
22 |
https://github.com/cython/cython/archive/${PV/_rc/rc}.tar.gz
|
|
23 |
-> ${MY_P}.gh.tar.gz
|
24 |
24 |
"
|
|
25 |
S=${WORKDIR}/${MY_P}
|
25 |
26 |
|
26 |
27 |
LICENSE="Apache-2.0"
|
27 |
28 |
SLOT="0"
|
28 |
29 |
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
|
29 |
|
IUSE="emacs test"
|
|
30 |
IUSE="test"
|
30 |
31 |
RESTRICT="!test? ( test )"
|
31 |
32 |
|
32 |
|
RDEPEND="
|
33 |
|
emacs? ( >=app-editors/emacs-23.1:* )
|
34 |
|
"
|
35 |
33 |
BDEPEND="
|
36 |
34 |
${RDEPEND}
|
37 |
35 |
test? (
|
38 |
36 |
$(python_gen_cond_dep '
|
39 |
37 |
dev-python/numpy[${PYTHON_USEDEP}]
|
40 |
|
' "${PYTHON_TESTED[@]}")
|
|
38 |
' python3_{10..11})
|
41 |
39 |
)
|
42 |
40 |
"
|
43 |
41 |
|
... | ... | |
45 |
43 |
"${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch"
|
46 |
44 |
"${FILESDIR}/${PN}-0.29.23-test_exceptions-py310.patch"
|
47 |
45 |
"${FILESDIR}/${PN}-0.29.23-pythran-parallel-install.patch"
|
|
46 |
# https://github.com/cython/cython/pull/5675
|
|
47 |
"${FILESDIR}/${P}-enummeta.patch"
|
48 |
48 |
)
|
49 |
49 |
|
50 |
|
SITEFILE=50cython-gentoo.el
|
51 |
|
|
52 |
|
distutils_enable_sphinx docs
|
|
50 |
distutils_enable_sphinx docs \
|
|
51 |
dev-python/jinja \
|
|
52 |
dev-python/sphinx-issues \
|
|
53 |
dev-python/sphinx-tabs
|
53 |
54 |
|
54 |
55 |
python_compile() {
|
55 |
56 |
# Python gets confused when it is in sys.path before build.
|
... | ... | |
58 |
59 |
distutils-r1_python_compile
|
59 |
60 |
}
|
60 |
61 |
|
61 |
|
python_compile_all() {
|
62 |
|
use emacs && elisp-compile Tools/cython-mode.el
|
63 |
|
}
|
64 |
|
|
65 |
62 |
python_test() {
|
66 |
63 |
if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then
|
67 |
64 |
einfo "Skipping tests on ${EPYTHON} (xfail)"
|
68 |
65 |
return
|
69 |
66 |
fi
|
70 |
67 |
|
|
68 |
# Needed to avoid confusing cache tests
|
|
69 |
unset CYTHON_FORCE_REGEN
|
|
70 |
|
71 |
71 |
tc-export CC
|
72 |
72 |
# https://github.com/cython/cython/issues/1911
|
73 |
73 |
local -x CFLAGS="${CFLAGS} -fno-strict-overflow"
|
74 |
|
"${PYTHON}" runtests.py -vv -j "$(makeopts_jobs)" --work-dir "${BUILD_DIR}"/tests ||
|
75 |
|
die "Tests fail with ${EPYTHON}"
|
|
74 |
"${PYTHON}" runtests.py \
|
|
75 |
-vv \
|
|
76 |
-j "$(makeopts_jobs)" \
|
|
77 |
--work-dir "${BUILD_DIR}"/tests \
|
|
78 |
--no-examples \
|
|
79 |
--no-code-style \
|
|
80 |
|| die "Tests fail with ${EPYTHON}"
|
76 |
81 |
}
|
77 |
82 |
|
78 |
83 |
python_install_all() {
|
79 |
84 |
local DOCS=( CHANGES.rst README.rst ToDo.txt USAGE.txt )
|
80 |
85 |
distutils-r1_python_install_all
|
81 |
|
|
82 |
|
if use emacs; then
|
83 |
|
elisp-install ${PN} Tools/cython-mode.*
|
84 |
|
elisp-site-file-install "${FILESDIR}/${SITEFILE}"
|
85 |
|
fi
|
86 |
|
}
|
87 |
|
|
88 |
|
pkg_postinst() {
|
89 |
|
use emacs && elisp-site-regen
|
90 |
|
}
|
91 |
|
|
92 |
|
pkg_postrm() {
|
93 |
|
use emacs && elisp-site-regen
|
94 |
86 |
}
|