• [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip LICENSE* & COPYING*

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Jan 22 22:00:01 2022
    The .dist-info metadata installed by PEP517 packages contains a full
    copy of the license. Strip that following the Gentoo policy.

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

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index a9c86ef55124..f2804defb818 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -977,6 +977,11 @@ distutils-r1_python_compile() {
    chmod +x "${root}"/usr/bin/* || die
    fi

    + # remove installed licenses
    + find "${root}$(python_get_sitedir)" \
    + '(' -path '*.dist-info/COPYING*' -o \
    + -path '*.dist-info/LICENSE*' ')' -delete || die
    +
    # clean the build tree; otherwise we may end up with PyPy3
    # extensions duplicated into CPython dists
    if [[ ${DISTUTILS_USE_PEP517:-setuptools} == setuptools ]]; then
    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Jan 22 22:00:01 2022
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 28 ++++++++++++++--------------
    1 file changed, 14 insertions(+), 14 deletions(-)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index f2804defb818..2c75daab14cc 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -973,8 +973,8 @@ distutils-r1_python_compile() {

    # TODO: workaround for a bug in installer; remove once we depend
    # on a properly fixed version
    - if [[ -d ${root}/usr/bin ]]; then
    - chmod +x "${root}"/usr/bin/* || die
    + if [[ -d ${root}${EPREFIX}/usr/bin ]]; then
    + chmod +x "${root}${EPREFIX}"/usr/bin/* || die
    fi

    # remove installed licenses
    @@ -989,11 +989,11 @@ distutils-r1_python_compile() {
    fi

    # enable venv magic inside the install tree
    - mkdir -p "${root}"/usr/bin || die
    - ln -s "${PYTHON}" "${root}/usr/bin/${EPYTHON}" || die
    - ln -s "${EPYTHON}" "${root}/usr/bin/python3" || die
    - ln -s "${EPYTHON}" "${root}/usr/bin/python" || die
    - cat > "${root}"/usr/pyve