From 8b39c0bc535814e04d01d50a4891cb31b6bf84bd Mon Sep 17 00:00:00 2001 From: Tim Orling Date: Tue, 22 Feb 2022 11:16:43 -0800 Subject: 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] Signed-off-by: Tim Orling Signed-off-by: Richard Purdie --- meta/classes/setuptools3.bbclass | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'meta') 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 @@ -inherit setuptools3-base +inherit setuptools3-base pip_install_wheel -B = "${WORKDIR}/build" +# bdist_wheel builds in ./dist +#B = "${WORKDIR}/build" SETUPTOOLS_BUILD_ARGS ?= "" SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ @@ -23,20 +24,15 @@ setuptools3_do_compile() { STAGING_INCDIR=${STAGING_INCDIR} \ STAGING_LIBDIR=${STAGING_LIBDIR} \ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ - build --build-base=${B} ${SETUPTOOLS_BUILD_ARGS} || \ - bbfatal_log "'${PYTHON_PN} setup.py build ${SETUPTOOLS_BUILD_ARGS}' execution failed." + bdist_wheel ${SETUPTOOLS_BUILD_ARGS} || \ + bbfatal_log "'${PYTHON_PN} setup.py bdist_wheel ${SETUPTOOLS_BUILD_ARGS}' execution failed." } setuptools3_do_compile[vardepsexclude] = "MACHINE" setuptools3_do_install() { cd ${SETUPTOOLS_SETUP_PATH} - install -d ${D}${PYTHON_SITEPACKAGES_DIR} - STAGING_INCDIR=${STAGING_INCDIR} \ - STAGING_LIBDIR=${STAGING_LIBDIR} \ - PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ - ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ - build --build-base=${B} install --skip-build ${SETUPTOOLS_INSTALL_ARGS} || \ - bbfatal_log "'${PYTHON_PN} setup.py install ${SETUPTOOLS_INSTALL_ARGS}' execution failed." + + pip_install_wheel_do_install # support filenames with *spaces* find ${D} -name "*.py" -exec grep -q ${D} {} \; \ @@ -64,5 +60,5 @@ setuptools3_do_install[vardepsexclude] = "MACHINE" EXPORT_FUNCTIONS do_configure do_compile do_install export LDSHARED="${CCLD} -shared" -DEPENDS += "python3-setuptools-native" +DEPENDS += "python3-setuptools-native python3-wheel-native" -- cgit 1.2.3-korg