diff options
author | Tim Orling <ticotimo@gmail.com> | 2022-02-22 11:16:43 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-25 15:07:50 +0000 |
commit | 981857c63a4804cdeee3901ba512220d8e46f762 (patch) | |
tree | 1ac5118e1d8cdf40c3119102cd2fda114c024183 /meta/classes/setuptools3.bbclass | |
parent | fffeecbd9a8df7f3edc36dd0830dd6b10334c1b0 (diff) | |
download | poky-981857c63a4804cdeee3901ba512220d8e46f762.tar.gz |
setuptools3.bbclass: refactor for wheels
Depend on python3-wheel-native so that we can build with 'setup.py
bdist_wheel'.
Use pip_install_wheel class to install the built wheels with pip, as
intended by upstream Python.
[YOCTO #14638]
(From OE-Core rev: 8b39c0bc535814e04d01d50a4891cb31b6bf84bd)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/setuptools3.bbclass')
-rw-r--r-- | meta/classes/setuptools3.bbclass | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/meta/classes/setuptools3.bbclass b/meta/classes/setuptools3.bbclass index fd8499d26c..12561340b0 100644 --- a/meta/classes/setuptools3.bbclass +++ b/meta/classes/setuptools3.bbclass | |||
@@ -1,6 +1,7 @@ | |||
1 | inherit setuptools3-base | 1 | inherit setuptools3-base pip_install_wheel |
2 | 2 | ||
3 | B = "${WORKDIR}/build" | 3 | # bdist_wheel builds in ./dist |
4 | #B = "${WORKDIR}/build" | ||
4 | 5 | ||
5 | SETUPTOOLS_BUILD_ARGS ?= "" | 6 | SETUPTOOLS_BUILD_ARGS ?= "" |
6 | SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ | 7 | SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ |
@@ -23,20 +24,15 @@ setuptools3_do_compile() { | |||
23 | STAGING_INCDIR=${STAGING_INCDIR} \ | 24 | STAGING_INCDIR=${STAGING_INCDIR} \ |
24 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 25 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
25 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ | 26 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ |
26 | build --build-base=${B} ${SETUPTOOLS_BUILD_ARGS} || \ | 27 | bdist_wheel ${SETUPTOOLS_BUILD_ARGS} || \ |
27 | bbfatal_log "'${PYTHON_PN} setup.py build ${SETUPTOOLS_BUILD_ARGS}' execution failed." | 28 | bbfatal_log "'${PYTHON_PN} setup.py bdist_wheel ${SETUPTOOLS_BUILD_ARGS}' execution failed." |
28 | } | 29 | } |
29 | setuptools3_do_compile[vardepsexclude] = "MACHINE" | 30 | setuptools3_do_compile[vardepsexclude] = "MACHINE" |
30 | 31 | ||
31 | setuptools3_do_install() { | 32 | setuptools3_do_install() { |
32 | cd ${SETUPTOOLS_SETUP_PATH} | 33 | cd ${SETUPTOOLS_SETUP_PATH} |
33 | install -d ${D}${PYTHON_SITEPACKAGES_DIR} | 34 | |
34 | STAGING_INCDIR=${STAGING_INCDIR} \ | 35 | pip_install_wheel_do_install |
35 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
36 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ | ||
37 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ | ||
38 | build --build-base=${B} install --skip-build ${SETUPTOOLS_INSTALL_ARGS} || \ | ||
39 | bbfatal_log "'${PYTHON_PN} setup.py install ${SETUPTOOLS_INSTALL_ARGS}' execution failed." | ||
40 | 36 | ||
41 | # support filenames with *spaces* | 37 | # support filenames with *spaces* |
42 | find ${D} -name "*.py" -exec grep -q ${D} {} \; \ | 38 | find ${D} -name "*.py" -exec grep -q ${D} {} \; \ |
@@ -64,5 +60,5 @@ setuptools3_do_install[vardepsexclude] = "MACHINE" | |||
64 | EXPORT_FUNCTIONS do_configure do_compile do_install | 60 | EXPORT_FUNCTIONS do_configure do_compile do_install |
65 | 61 | ||
66 | export LDSHARED="${CCLD} -shared" | 62 | export LDSHARED="${CCLD} -shared" |
67 | DEPENDS += "python3-setuptools-native" | 63 | DEPENDS += "python3-setuptools-native python3-wheel-native" |
68 | 64 | ||