dev-python/multidict: Add a flag to disable C extensions entirely

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2023-08-06 10:42:25 +02:00
parent efc5b53fa6
commit 7e0bd57379
2 changed files with 8 additions and 1 deletions

View File

@@ -13,4 +13,10 @@
<remote-id type="github">aio-libs/multidict</remote-id>
<remote-id type="pypi">multidict</remote-id>
</upstream>
<use>
<flag name="native-extensions">
Compile native C extensions (speedups, instead of using Python
fallback code).
</flag>
</use>
</pkgmetadata>

View File

@@ -22,6 +22,7 @@ SRC_URI="
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos"
IUSE="+native-extensions"
distutils_enable_sphinx docs --no-autodoc
distutils_enable_tests pytest
@@ -36,7 +37,7 @@ python_prepare_all() {
python_compile() {
# the C extension segfaults on py3.12
# https://github.com/aio-libs/multidict/issues/868
if [[ ${EPYTHON} == python3.12 ]]; then
if ! use native-extensions || [[ ${EPYTHON} == python3.12 ]]; then
local -x MULTIDICT_NO_EXTENSIONS=1
fi