diff options
author | Ross Burton <ross@burtonini.com> | 2022-03-07 15:26:48 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-08 09:44:27 +0000 |
commit | 2552f836c90b8b7355da37415920107c26fb35c0 (patch) | |
tree | 418bd5d0226139a02b8eb809bbfc5fb7cbcc69ad /meta | |
parent | b678b7f0a0e172aff188310af676f45b27e69e2a (diff) | |
download | poky-2552f836c90b8b7355da37415920107c26fb35c0.tar.gz |
setuptools3.bbclass: clean up
There's been a lot of work in this class lately, so a little spring
cleaning is needed.
Create wheels verbosely to help debug problems.
Remove unused SETUPTOOLS_INSTALL_ARGS, these can't be passed to
bdist_wheel.
Remove duplicate manipulation of files in bindir as pip_install_wheel
does the same.
Remove obsolete deletion of easy-install.pth, wheels don't generate that.
Remove obsolete ${datadir}/share fixup, pip-installed wheels can't
generate that path combination.
Remove purging of ${D} references from *.py, these won't be written by
standard setuptools, and recipes can do it themselves to work around
specific issues if needed.
Remove obsolete vardepsexclude of MACHINE on do_install, as that variable
isn't referenced.
(From OE-Core rev: 57c477ca13e352b6f9b21385abbfaad9778c6398)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/setuptools3.bbclass | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/meta/classes/setuptools3.bbclass b/meta/classes/setuptools3.bbclass index 564996c556..1b1a8aac76 100644 --- a/meta/classes/setuptools3.bbclass +++ b/meta/classes/setuptools3.bbclass | |||
@@ -4,13 +4,6 @@ inherit setuptools3-base pip_install_wheel | |||
4 | #B = "${WORKDIR}/build" | 4 | #B = "${WORKDIR}/build" |
5 | 5 | ||
6 | SETUPTOOLS_BUILD_ARGS ?= "" | 6 | SETUPTOOLS_BUILD_ARGS ?= "" |
7 | SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ | ||
8 | --prefix=${prefix} \ | ||
9 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
10 | --install-data=${datadir}" | ||
11 | |||
12 | SETUPTOOLS_PYTHON = "python3" | ||
13 | SETUPTOOLS_PYTHON:class-native = "nativepython3" | ||
14 | 7 | ||
15 | SETUPTOOLS_SETUP_PATH ?= "${S}" | 8 | SETUPTOOLS_SETUP_PATH ?= "${S}" |
16 | 9 | ||
@@ -24,42 +17,17 @@ setuptools3_do_compile() { | |||
24 | STAGING_INCDIR=${STAGING_INCDIR} \ | 17 | STAGING_INCDIR=${STAGING_INCDIR} \ |
25 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 18 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
26 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ | 19 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ |
27 | bdist_wheel ${SETUPTOOLS_BUILD_ARGS} || \ | 20 | bdist_wheel --verbose ${SETUPTOOLS_BUILD_ARGS} || \ |
28 | bbfatal_log "'${PYTHON_PN} setup.py bdist_wheel ${SETUPTOOLS_BUILD_ARGS}' execution failed." | 21 | bbfatal_log "'${PYTHON_PN} setup.py bdist_wheel ${SETUPTOOLS_BUILD_ARGS}' execution failed." |
29 | } | 22 | } |
30 | setuptools3_do_compile[vardepsexclude] = "MACHINE" | 23 | setuptools3_do_compile[vardepsexclude] = "MACHINE" |
31 | do_compile[cleandirs] += "${SETUPTOOLS_SETUP_PATH}/dist" | 24 | do_compile[cleandirs] += "${SETUPTOOLS_SETUP_PATH}/dist" |
32 | 25 | ||
33 | setuptools3_do_install() { | 26 | setuptools3_do_install() { |
34 | cd ${SETUPTOOLS_SETUP_PATH} | ||
35 | |||
36 | pip_install_wheel_do_install | 27 | pip_install_wheel_do_install |
37 | |||
38 | # support filenames with *spaces* | ||
39 | find ${D} -name "*.py" -exec grep -q ${D} {} \; \ | ||
40 | -exec sed -i -e s:${D}::g {} \; | ||
41 | |||
42 | for i in ${D}${bindir}/* ${D}${sbindir}/*; do | ||
43 | if [ -f "$i" ]; then | ||
44 | sed -i -e s:${PYTHON}:${USRBINPATH}/env\ ${SETUPTOOLS_PYTHON}:g $i | ||
45 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i | ||
46 | fi | ||
47 | done | ||
48 | |||
49 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth | ||
50 | |||
51 | # | ||
52 | # FIXME: Bandaid against wrong datadir computation | ||
53 | # | ||
54 | if [ -e ${D}${datadir}/share ]; then | ||
55 | mv -f ${D}${datadir}/share/* ${D}${datadir}/ | ||
56 | rmdir ${D}${datadir}/share | ||
57 | fi | ||
58 | } | 28 | } |
59 | setuptools3_do_install[vardepsexclude] = "MACHINE" | ||
60 | 29 | ||
61 | EXPORT_FUNCTIONS do_configure do_compile do_install | 30 | EXPORT_FUNCTIONS do_configure do_compile do_install |
62 | 31 | ||
63 | export LDSHARED="${CCLD} -shared" | 32 | export LDSHARED="${CCLD} -shared" |
64 | DEPENDS += "python3-setuptools-native python3-wheel-native" | 33 | DEPENDS += "python3-setuptools-native python3-wheel-native" |
65 | |||