summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-08-06 10:42:25 +0200
committerMichał Górny <mgorny@gentoo.org>2023-08-06 10:48:43 +0200
commit7e0bd57379aed1e5d0fc19cbae2e7813b312775a (patch)
treead793061f7d916022f9cc570380f88050b9ad3bc /dev-python/multidict
parentdev-python/multidict: Disable the C extension on py3.12 (diff)
downloadgentoo-7e0bd57379aed1e5d0fc19cbae2e7813b312775a.tar.gz
gentoo-7e0bd57379aed1e5d0fc19cbae2e7813b312775a.tar.bz2
gentoo-7e0bd57379aed1e5d0fc19cbae2e7813b312775a.zip
dev-python/multidict: Add a flag to disable C extensions entirely
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/multidict')
-rw-r--r--dev-python/multidict/metadata.xml6
-rw-r--r--dev-python/multidict/multidict-6.0.4-r1.ebuild3
2 files changed, 8 insertions, 1 deletions
diff --git a/dev-python/multidict/metadata.xml b/dev-python/multidict/metadata.xml
index 7a91ba1ea080..de495329e26d 100644
--- a/dev-python/multidict/metadata.xml
+++ b/dev-python/multidict/metadata.xml
@@ -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>
diff --git a/dev-python/multidict/multidict-6.0.4-r1.ebuild b/dev-python/multidict/multidict-6.0.4-r1.ebuild
index 84caa6eba04e..b96ba51c677a 100644
--- a/dev-python/multidict/multidict-6.0.4-r1.ebuild
+++ b/dev-python/multidict/multidict-6.0.4-r1.ebuild
@@ -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