summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <tim.orling@konsulko.com>2022-03-12 12:50:43 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-16 08:48:08 +0000
commit8af946e718317b1a47cf1a8a78938ba55f992cb8 (patch)
tree3785abef4c1e753987c8f09e00fba2bb38abc926
parent09ba720ec9a24990c61f94371485391c9924aaed (diff)
downloadpoky-8af946e718317b1a47cf1a8a78938ba55f992cb8.tar.gz
setuptools3_rust.bbclass: move from meta-python
setuptools-rust is a plugin for setuptools to build Rust Python extensions implemented with PyO3 or rust-cpython. Compile and distribute Python extensions written in Rust as easily as if they were written in C. This class inherits pyo3.bbclass (and therefore cargo.bbclass) and setuptools3.bbclass to make it easier to build Python modules with Rust extensions. Need to call pyo3_do_configure to properly setup the PyO3 environment for cross-compiling. Need to call cargo_common_do_configure to setup cargo_home/config so that the linker properly finds e.g. crti.o and crtbeginS.o It is strongly recommended to provide crates needed for your recipe using the crate:// fetcher. This can be helped with the cargo-bitbake command [1]. If you choose not to use the crate fetcher, bitbake vendoring will not work with setuptools-rust, as it errors out immediately because it cannot find pyo3 or some other crate. The (strongly discouraged) workaround for this is to set: CARGO_DISABLE_BITBAKE_VENDORING = "1" [1] https://crates.io/crates/cargo-bitbake (From OE-Core rev: de3e166cf6f0de4fe0681ddb4b209fb9b8b06811) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/setuptools3_rust.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/setuptools3_rust.bbclass b/meta/classes/setuptools3_rust.bbclass
new file mode 100644
index 0000000000..fb11f08f89
--- /dev/null
+++ b/meta/classes/setuptools3_rust.bbclass
@@ -0,0 +1,11 @@
1inherit pyo3 setuptools3
2
3DEPENDS += "python3-setuptools-rust-native"
4
5setuptools3_rust_do_configure() {
6 pyo3_do_configure
7 cargo_common_do_configure
8 setuptools3_do_configure
9}
10
11EXPORT_FUNCTIONS do_configure