mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
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>
This commit is contained in:
committed by
Michał Górny
parent
4eb697c590
commit
c8efb9da20
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user