summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2025-11-23 20:38:37 +0100
committerMichał Górny <mgorny@gentoo.org>2025-11-26 16:44:04 +0100
commit433ae7d2b54dfd881b2f6b10fab5eed763f6e1ee (patch)
treed8c5497556da2a514176ffe9a065b346cff655f6 /eclass
parent2b94cf3b1b9493448876b622065693b675aae117 (diff)
downloadgentoo-433ae7d2b54dfd881b2f6b10fab5eed763f6e1ee.tar.gz
gentoo-433ae7d2b54dfd881b2f6b10fab5eed763f6e1ee.tar.bz2
gentoo-433ae7d2b54dfd881b2f6b10fab5eed763f6e1ee.zip
distutils-r1.eclass: Add DISTUTILS_CONFIG_SETTINGS_JSON
Add DISTUTILS_CONFIG_SETTINGS_JSON that can be used to specify the JSON data for config_settings directly. For the time being, this is only supported for standalone backends, since we can never know what arguments they expect and we do not want the value to conflict with any future defaults for known backends. This is going to be used by the next version of x11-wm/qtile to control building the Wayland support (currently handled by sed in the backend code). Signed-off-by: Michał Górny <mgorny@gentoo.org> Part-of: https://github.com/gentoo/gentoo/pull/44745 Closes: https://github.com/gentoo/gentoo/pull/44745 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/distutils-r1.eclass28
1 files changed, 28 insertions, 0 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index c7a17dd39863..5980cc47e5f7 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -415,6 +415,28 @@ unset -f _distutils_set_globals
# }
# @CODE
+# @ECLASS_VARIABLE: DISTUTILS_CONFIG_SETTINGS_JSON
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The JSON object deserialized into config_settings dictionary passed
+# to the build backend.
+#
+# Allowed only for DISTUTILS_USE_PEP517=standalone. Use DISTUTILS_ARGS
+# for other backends.
+#
+# Example:
+# @CODE
+# python_configure_all() {
+# DISTUTILS_CONFIG_SETTINGS_JSON='
+# {
+# "verbose": true,
+# "targets": ["foo", "bar"],
+# "build-type": "release"
+# }
+# '
+# }
+# @CODE
+
# @FUNCTION: distutils_enable_sphinx
# @USAGE: <subdir> [--no-autodoc | <plugin-pkgs>...]
# @DESCRIPTION:
@@ -1197,6 +1219,12 @@ distutils_pep517_install() {
;;
esac
+ if [[ ${DISTUTILS_USE_PEP517} == standalone ]]; then
+ config_settings=${DISTUTILS_CONFIG_SETTINGS_JSON}
+ elif [[ -n ${DISTUTILS_CONFIG_SETTINGS_JSON} ]]; then
+ die "DISTUTILS_CONFIG_SETTINGS_JSON supported only for standalone backends"
+ fi
+
# https://pyo3.rs/latest/building-and-distribution.html#cross-compiling
if tc-is-cross-compiler; then
local -x PYO3_CROSS_LIB_DIR=${SYSROOT}/$(python_get_stdlib)