• [gentoo-dev] [PATCH 08/18] distutils-r1.eclass: Introduce DISTUTILS_USE

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Jun 4 11:10:01 2022
    Introduce a new DISTUTILS_USE_PEP517 value "no" that stands for
    "no build system". This is primarily meant to replace the legacy
    distutils-r1 logic used for bootstrapping baseline PEP 517 packages.
    At the same time, it provides a convenient replacement for some
    of the uses of python-r1.

    In this mode, the eclass does not add PEP517-specific dependencies
    and does not export default python_compile() and python_install() implementations. However, it does set dependencies, REQUIRED_USE
    and enables sub-phase usage (with respect to DISTUTILS_OPTIONAL).
    It also permits using distutils_enable_{sphinx,tests}.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 30 +++++++++++++++++++++++++++++-
    1 file changed, 29 insertions(+), 1 deletion(-)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index 208bd2718cb8..30f7d941f0d4 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -106,6 +106,8 @@ esac
    #
    # - maturin - maturin backend
    #
    +# - no - no PEP517 build system (see below)
    +#
    # - pbr - pbr backend
    #
    # - pdm - pdm.pep517 backend
    @@ -121,6 +123,17 @@ esac
    #
    # The variable needs to be set before the inherit line. The eclass
    # adds appropriate build-time dependencies and verifies the value.
    +#
    +# The special value "no" indicates that the package has no build system.
    +# This is not equivalent to unset DISTUTILS_USE_PEP517 (legacy mode).
    +# It causes the eclass not to include any build system dependencies
    +# and to disable default python_compile() and python_install()
    +# implementations. Baseline Python deps and phase functions will still
    +# be set (dependi