mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-01-05 14:07:27 -08:00
dev-python/frozenlist: Add a flag to disable C extensions entirely
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
parent
7e0bd57379
commit
4fb5c79cc8
@ -22,11 +22,14 @@ SRC_URI="
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||
IUSE="+native-extensions"
|
||||
|
||||
BDEPEND="
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/cython[${PYTHON_USEDEP}]
|
||||
' 'python*')
|
||||
native-extensions? (
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/cython[${PYTHON_USEDEP}]
|
||||
' 'python*')
|
||||
)
|
||||
"
|
||||
|
||||
distutils_enable_tests pytest
|
||||
@ -36,12 +39,16 @@ src_prepare() {
|
||||
distutils-r1_src_prepare
|
||||
}
|
||||
|
||||
python_configure() {
|
||||
python_compile() {
|
||||
# pypy is not using the C extension
|
||||
if [[ ${EPYTHON} == python* ]]; then
|
||||
if use native-extensions && [[ ${EPYTHON} == python* ]]; then
|
||||
> .install-cython || die
|
||||
emake cythonize
|
||||
else
|
||||
local -x FROZENLIST_NO_EXTENSIONS=1
|
||||
fi
|
||||
|
||||
distutils-r1_python_compile
|
||||
}
|
||||
|
||||
python_test() {
|
||||
|
||||
@ -8,4 +8,10 @@
|
||||
<remote-id type="pypi">frozenlist</remote-id>
|
||||
<remote-id type="github">aio-libs/frozenlist</remote-id>
|
||||
</upstream>
|
||||
<use>
|
||||
<flag name="native-extensions">
|
||||
Compile native C extensions (speedups, instead of using Python
|
||||
fallback code).
|
||||
</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user