]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cargo.bbclass: do not install libraries by default
authorAlexander Kanavin <alex@linutronix.de>
Wed, 4 Dec 2024 06:48:49 +0000 (07:48 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Dec 2024 11:55:08 +0000 (11:55 +0000)
'cargo install' only installs executables and examples into the system,
and we should follow that. Libraries are vendored into
build trees from the crate registry and then baked directly into executables.

Neverthless, there's now a condition variable, so individual recipes can
opt into installing libraries if there's a use case for it.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/cargo.bbclass

index 0829a58dd90f1df9e1038e8f3ad21d0456f9652d..b583f84bdfde59886daa13c3bc7c06af8d7d5e72 100644 (file)
@@ -61,9 +61,11 @@ cargo_do_install () {
        for tgt in "${B}/target/${CARGO_TARGET_SUBDIR}/"*; do
                case $tgt in
                *.so|*.rlib)
-                       install -d "${D}${rustlibdir}"
-                       install -m755 "$tgt" "${D}${rustlibdir}"
-                       have_installed=true
+                        if [ -n "${CARGO_INSTALL_LIBRARIES}" ]; then
+                               install -d "${D}${rustlibdir}"
+                               install -m755 "$tgt" "${D}${rustlibdir}"
+                               have_installed=true
+                       fi
                        ;;
                *examples)
                        if [ -d "$tgt" ]; then