Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 29 Jun 2022 17:49:38
Message-Id: 1656524961.61c43043f2b9179abde1ffda119443f866410581.sam@gentoo
1 commit: 61c43043f2b9179abde1ffda119443f866410581
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 24 14:00:35 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 29 17:49:21 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61c43043
7
8 distutils-r1.eclass: Introduce distutils_wheel_install
9
10 Split the wheel installation logic from distutils_pep517_install
11 into a new distutils_wheel_install function. Also intended for expert
12 use only.
13
14 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
15 Signed-off-by: Sam James <sam <AT> gentoo.org>
16
17 eclass/distutils-r1.eclass | 45 +++++++++++++++++++++++++++++++++------------
18 1 file changed, 33 insertions(+), 12 deletions(-)
19
20 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
21 index 4e8c2d67db0b..86ab1337cee5 100644
22 --- a/eclass/distutils-r1.eclass
23 +++ b/eclass/distutils-r1.eclass
24 @@ -1239,6 +1239,38 @@ _distutils-r1_get_backend() {
25 echo "${build_backend}"
26 }
27
28 +# @FUNCTION: distutils_wheel_install
29 +# @USAGE: <root> <wheel>
30 +# @DESCRIPTION:
31 +# Install the specified wheel into <root>.
32 +#
33 +# This function is intended for expert use only.
34 +distutils_wheel_install() {
35 + debug-print-function ${FUNCNAME} "${@}"
36 + if [[ ${#} -ne 2 ]]; then
37 + die "${FUNCNAME} takes exactly two arguments: <root> <wheel>"
38 + fi
39 + if [[ -z ${PYTHON} ]]; then
40 + die "PYTHON unset, invalid call context"
41 + fi
42 +
43 + local root=${1}
44 + local wheel=${2}
45 +
46 + einfo " Installing ${wheel##*/} to ${root}"
47 + gpep517 install-wheel --destdir="${root}" --interpreter="${PYTHON}" \
48 + --prefix="${EPREFIX}/usr" "${wheel}" ||
49 + die "Wheel install failed"
50 +
51 + # remove installed licenses
52 + find "${root}$(python_get_sitedir)" -depth \
53 + \( -path '*.dist-info/COPYING*' \
54 + -o -path '*.dist-info/LICENSE*' \
55 + -o -path '*.dist-info/license_files/*' \
56 + -o -path '*.dist-info/license_files' \
57 + \) -delete || die
58 +}
59 +
60 # @FUNCTION: distutils_pep517_install
61 # @USAGE: <root>
62 # @DESCRIPTION:
63 @@ -1319,18 +1351,7 @@ distutils_pep517_install() {
64 )
65 [[ -n ${wheel} ]] || die "No wheel name returned"
66
67 - einfo " Installing ${wheel} to ${root}"
68 - gpep517 install-wheel --destdir="${root}" --interpreter="${PYTHON}" \
69 - --prefix="${EPREFIX}/usr" "${WHEEL_BUILD_DIR}/${wheel}" ||
70 - die "Wheel install failed"
71 -
72 - # remove installed licenses
73 - find "${root}$(python_get_sitedir)" -depth \
74 - \( -path '*.dist-info/COPYING*' \
75 - -o -path '*.dist-info/LICENSE*' \
76 - -o -path '*.dist-info/license_files/*' \
77 - -o -path '*.dist-info/license_files' \
78 - \) -delete || die
79 + distutils_wheel_install "${root}" "${WHEEL_BUILD_DIR}/${wheel}"
80
81 # clean the build tree; otherwise we may end up with PyPy3
82 # extensions duplicated into CPython dists