[03/19] python3-flit-core: simplify

Message ID 94ec7ed393b8d1eb8c0c6c2654e449e02e073131.1645405471.git.tim.orling@konsulko.com
State New
Headers show
Series [01/19] python3-wheel: move 0.37.0 from meta-python | expand

Commit Message

Tim Orling Feb. 21, 2022, 1:27 a.m. UTC
Upstream provides a build_dists.py which can be used to bootstrap
building of the sdist and wheel.

Bootstrap -native by simply unzipping the wheel to
PYTHON_SITEPACKAGES_DIR.

Use pip to install the wheel for target.

[YOCTO #14638]

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../python/python3-flit-core_3.6.0.bb                | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/recipes-devtools/python/python3-flit-core_3.6.0.bb b/meta/recipes-devtools/python/python3-flit-core_3.6.0.bb
index 4221076bc73..d0b88c3fa50 100644
--- a/meta/recipes-devtools/python/python3-flit-core_3.6.0.bb
+++ b/meta/recipes-devtools/python/python3-flit-core_3.6.0.bb
@@ -3,9 +3,10 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=41eb78fa8a872983a882c694a8305f08"
 
 SRC_URI[sha256sum] = "b1464e006df4df4c8eeb37671c0e0ce66e1d04e4a36d91b702f180a25fde3c11"
 
-inherit python3native python3-dir pypi
+inherit python3native python3-dir pypi setuptools3-base
 
-DEPENDS += "python3 python3-pip-native"
+DEPENDS:append:class-target = " python3-pip-native"
+DEPENDS:append:class-native = " unzip-native"
 
 # We need the full flit tarball
 PYPI_PACKAGE = "flit"
@@ -17,7 +18,12 @@  do_compile () {
 do_install () {
     install -d ${D}${PYTHON_SITEPACKAGES_DIR}
     PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
-    nativepython3 -m pip install -vvvv --no-index --target ${D}${PYTHON_SITEPACKAGES_DIR} ./flit_core/dist/flit_core-${PV}-py3-none-any.whl
+    nativepython3 -m pip install -vvvv --no-deps --no-index --target ${D}${PYTHON_SITEPACKAGES_DIR} ./flit_core/dist/flit_core-${PV}-py3-none-any.whl
+}
+
+do_install:class-native () {
+    install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+    unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ./flit_core/dist/flit_core-${PV}-py3-none-any.whl
 }
 
 FILES:${PN} += "\