diff options
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r-- | eclass/distutils-r1.eclass | 51 |
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 |