summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2022-02-22 11:16:43 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-25 15:07:50 +0000
commit981857c63a4804cdeee3901ba512220d8e46f762 (patch)
tree1ac5118e1d8cdf40c3119102cd2fda114c024183
parentfffeecbd9a8df7f3edc36dd0830dd6b10334c1b0 (diff)
downloadpoky-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>
-rw-r--r--meta/classes/setuptools3.bbclass20
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 @@
1inherit setuptools3-base 1inherit setuptools3-base pip_install_wheel
2 2
3B = "${WORKDIR}/build" 3# bdist_wheel builds in ./dist
4#B = "${WORKDIR}/build"
4 5
5SETUPTOOLS_BUILD_ARGS ?= "" 6SETUPTOOLS_BUILD_ARGS ?= ""
6SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ 7SETUPTOOLS_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}
29setuptools3_do_compile[vardepsexclude] = "MACHINE" 30setuptools3_do_compile[vardepsexclude] = "MACHINE"
30 31
31setuptools3_do_install() { 32setuptools3_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"
64EXPORT_FUNCTIONS do_configure do_compile do_install 60EXPORT_FUNCTIONS do_configure do_compile do_install
65 61
66export LDSHARED="${CCLD} -shared" 62export LDSHARED="${CCLD} -shared"
67DEPENDS += "python3-setuptools-native" 63DEPENDS += "python3-setuptools-native python3-wheel-native"
68 64