diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2023-05-20 11:04:23 -0400 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2023-05-23 17:42:05 +0200 |
commit | c8efb9da208b06cbcb1351f52bbcca87ab434d10 (patch) | |
tree | 4c116bea99fe84a37b871e7843c8d2ab9f03bf38 /eclass | |
parent | dev-python/pytest-mock: Enable py3.12 (diff) | |
download | gentoo-c8efb9da208b06cbcb1351f52bbcca87ab434d10.tar.gz gentoo-c8efb9da208b06cbcb1351f52bbcca87ab434d10.tar.bz2 gentoo-c8efb9da208b06cbcb1351f52bbcca87ab434d10.zip |
distutils-r1.eclass: Use config_settings with maturin
Replaces the deprecated MATURIN_PEP517_ARGS and will also
allow ebuilds to enable/disable cargo --features through
DISTUTILS_ARGS like the rest should the need arise.
Support was technically added in 0.15.3, but 1.0.0 allows
passing an array rather than only a to-be-shlex.split string.
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/31143
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/distutils-r1.eclass | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index dbc4b9ccefd0..ec1dd08b197c 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1325,6 +1325,28 @@ distutils_pep517_install() { local config_settings= case ${DISTUTILS_USE_PEP517} in + maturin) + # ebuild's DISTUTILS_ARGS are currently ignored if <1.0.0, ebuilds + # should set the dependency if used until this can be cleaned up + # (reminder to cleanup the old MATURIN_PEP517_ARGS block too) + if has_version -b '>=dev-util/maturin-1.0.0'; then + # `maturin pep517 build-wheel --help` for options + local maturin_args=( + "${DISTUTILS_ARGS[@]}" + --jobs="$(makeopts_jobs)" + --skip-auditwheel # see bug #831171 + $(in_iuse debug && usex debug '--profile=dev' '') + ) + + config_settings=$( + "${EPYTHON}" - "${maturin_args[@]}" <<-EOF || die + import json + import sys + print(json.dumps({"build-args": sys.argv[1:]})) + EOF + ) + fi + ;; meson-python) local -x NINJAOPTS=$(get_NINJAOPTS) if has_version -b '>=dev-python/meson-python-0.13'; then @@ -1500,13 +1522,13 @@ distutils-r1_python_compile() { fi ;; maturin) - # auditwheel may auto-bundle libraries (bug #831171), - # also support cargo.eclass' IUSE=debug if available - local -x MATURIN_PEP517_ARGS=" - --jobs=$(makeopts_jobs) - --skip-auditwheel - $(in_iuse debug && usex debug --profile=dev '') - " + if has_version -b '<dev-util/maturin-1.0.0'; then + local -x MATURIN_PEP517_ARGS=" + --jobs=$(makeopts_jobs) + --skip-auditwheel + $(in_iuse debug && usex debug --profile=dev '') + " + fi ;; no) return |