summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-06-24 16:00:35 +0200
committerSam James <sam@gentoo.org>2022-06-29 17:49:21 +0000
commit61c43043f2b9179abde1ffda119443f866410581 (patch)
tree4a1b74fa9e71115ad17e3e1203dbab0c408fa12b
parentnet-dns/nsd: modernise (diff)
downloadgentoo-61c43043f2b9179abde1ffda119443f866410581.tar.gz
gentoo-61c43043f2b9179abde1ffda119443f866410581.tar.bz2
gentoo-61c43043f2b9179abde1ffda119443f866410581.zip
distutils-r1.eclass: Introduce distutils_wheel_install
Split the wheel installation logic from distutils_pep517_install into a new distutils_wheel_install function. Also intended for expert use only. Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--eclass/distutils-r1.eclass45
1 files changed, 33 insertions, 12 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 4e8c2d67db0b..86ab1337cee5 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1239,6 +1239,38 @@ _distutils-r1_get_backend() {
echo "${build_backend}"
}
+# @FUNCTION: distutils_wheel_install
+# @USAGE: <root> <wheel>
+# @DESCRIPTION:
+# Install the specified wheel into <root>.
+#
+# This function is intended for expert use only.
+distutils_wheel_install() {
+ debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${#} -ne 2 ]]; then
+ die "${FUNCNAME} takes exactly two arguments: <root> <wheel>"
+ fi
+ if [[ -z ${PYTHON} ]]; then
+ die "PYTHON unset, invalid call context"
+ fi
+
+ local root=${1}
+ local wheel=${2}
+
+ einfo " Installing ${wheel##*/} to ${root}"
+ gpep517 install-wheel --destdir="${root}" --interpreter="${PYTHON}" \
+ --prefix="${EPREFIX}/usr" "${wheel}" ||
+ die "Wheel install failed"
+
+ # remove installed licenses
+ find "${root}$(python_get_sitedir)" -depth \
+ \( -path '*.dist-info/COPYING*' \
+ -o -path '*.dist-info/LICENSE*' \
+ -o -path '*.dist-info/license_files/*' \
+ -o -path '*.dist-info/license_files' \
+ \) -delete || die
+}
+
# @FUNCTION: distutils_pep517_install
# @USAGE: <root>
# @DESCRIPTION:
@@ -1319,18 +1351,7 @@ distutils_pep517_install() {
)
[[ -n ${wheel} ]] || die "No wheel name returned"
- einfo " Installing ${wheel} to ${root}"
- gpep517 install-wheel --destdir="${root}" --interpreter="${PYTHON}" \
- --prefix="${EPREFIX}/usr" "${WHEEL_BUILD_DIR}/${wheel}" ||
- die "Wheel install failed"
-
- # remove installed licenses
- find "${root}$(python_get_sitedir)" -depth \
- \( -path '*.dist-info/COPYING*' \
- -o -path '*.dist-info/LICENSE*' \
- -o -path '*.dist-info/license_files/*' \
- -o -path '*.dist-info/license_files' \
- \) -delete || die
+ distutils_wheel_install "${root}" "${WHEEL_BUILD_DIR}/${wheel}"
# clean the build tree; otherwise we may end up with PyPy3
# extensions duplicated into CPython dists