[v3,06/32] setuptools_build_meta.bbclass: add helper class

Message ID 08688c61ae3479338052bdb1c0f96a1455a17a84.1645557032.git.tim.orling@konsulko.com
State Accepted, archived
Commit b8f25c75f152683de4fa6c176118583d3dea894d
Headers show
Series [v3,01/32] python3-wheel: move 0.37.1 from meta-python | expand

Commit Message

Tim Orling Feb. 22, 2022, 7:16 p.m. UTC
This class uses the PEP 517 compliant setuptools.buil_meta to build
wheels.

[YOCTO #14638]

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 meta/classes/setuptools_build_meta.bbclass | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 meta/classes/setuptools_build_meta.bbclass

Patch

diff --git a/meta/classes/setuptools_build_meta.bbclass b/meta/classes/setuptools_build_meta.bbclass
new file mode 100644
index 00000000000..b1441e65dd5
--- /dev/null
+++ b/meta/classes/setuptools_build_meta.bbclass
@@ -0,0 +1,18 @@ 
+inherit pip_install_wheel setuptools3-base
+
+DEPENDS += "python3 python3-setuptools-native python3-wheel-native"
+
+setuptools_build_meta_do_configure () {
+    mkdir -p ${S}/dist
+    cat > ${S}/build-it.py << EOF
+from setuptools import build_meta
+wheel = build_meta.build_wheel('./dist')
+print(wheel)
+EOF
+}
+
+setuptools_build_meta_do_compile () {
+    nativepython3 ${S}/build-it.py
+}
+
+EXPORT_FUNCTIONS do_configure do_compile