summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-04-24 08:35:44 +0200
committerMichał Górny <mgorny@gentoo.org>2023-04-24 09:25:04 +0200
commit84f8159eaceb84c3df83f525a3663496f3800a97 (patch)
tree63207455f831b1f83a6e0f35854ef296ac1770d8 /eclass
parentdev-python/moto: Bump to 4.1.8 (diff)
downloadgentoo-84f8159eaceb84c3df83f525a3663496f3800a97.tar.gz
gentoo-84f8159eaceb84c3df83f525a3663496f3800a97.tar.bz2
gentoo-84f8159eaceb84c3df83f525a3663496f3800a97.zip
distutils-r1.eclass: Fix support for >=meson-python-0.13.0
Closes: https://bugs.gentoo.org/904677 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/distutils-r1.eclass51
1 files changed, 34 insertions, 17 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index cef9d71e5593..4346a86c2097 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1316,23 +1316,40 @@ distutils_pep517_install() {
case ${DISTUTILS_USE_PEP517} in
meson-python)
local -x NINJAOPTS=$(get_NINJAOPTS)
- config_settings=$(
- "${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die
- import json
- import os
- import shlex
- import sys
-
- ninjaopts = shlex.split(os.environ["NINJAOPTS"])
- print(json.dumps({
- "setup-args": sys.argv[1:],
- "compile-args": [
- "-v",
- f"--ninja-args={ninjaopts!r}",
- ],
- }))
- EOF
- )
+ if has_version -b '>=dev-python/meson-python-0.13'; then
+ config_settings=$(
+ "${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die
+ import json
+ import os
+ import shlex
+ import sys
+
+ ninjaopts = shlex.split(os.environ["NINJAOPTS"])
+ print(json.dumps({
+ "setup-args": sys.argv[1:],
+ "compile-args": ["-v"] + ninjaopts,
+ }))
+ EOF
+ )
+ else
+ config_settings=$(
+ "${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die
+ import json
+ import os
+ import shlex
+ import sys
+
+ ninjaopts = shlex.split(os.environ["NINJAOPTS"])
+ print(json.dumps({
+ "setup-args": sys.argv[1:],
+ "compile-args": [
+ "-v",
+ f"--ninja-args={ninjaopts!r}",
+ ],
+ }))
+ EOF
+ )
+ fi
;;
setuptools)
if [[ -n ${DISTUTILS_ARGS[@]} ]]; then