From d40b62aa8dcd886583ed488e7303d2aa50141a69 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Mon, 16 Sep 2024 10:30:04 -0400 Subject: [PATCH] layers/meta-opentrons: add cargo recipe crates classes From upstream meta-openembedded --- .../cargo-update-recipe-crates.bbclass | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 layers/meta-opentrons/classes/cargo-update-recipe-crates.bbclass diff --git a/layers/meta-opentrons/classes/cargo-update-recipe-crates.bbclass b/layers/meta-opentrons/classes/cargo-update-recipe-crates.bbclass new file mode 100644 index 00000000..3251d5ef --- /dev/null +++ b/layers/meta-opentrons/classes/cargo-update-recipe-crates.bbclass @@ -0,0 +1,81 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +## +## Purpose: +## This class is used to update the list of crates in SRC_URI +## by reading Cargo.lock in the source tree. +## +## See meta/recipes-devtools/python/python3-bcrypt_*.bb for an example +## +## To perform the update: bitbake -c update_crates recipe-name + +addtask do_update_crates after do_patch +do_update_crates[depends] = "python3-native:do_populate_sysroot" +do_update_crates[nostamp] = "1" +do_update_crates[doc] = "Update the recipe by reading Cargo.lock and write in ${THISDIR}/${BPN}-crates.inc" + +RECIPE_UPGRADE_EXTRA_TASKS += "do_update_crates" + +# The directory where to search for Cargo.lock files +CARGO_LOCK_SRC_DIR ??= "${S}" + +do_update_crates() { + TARGET_FILE="${THISDIR}/${BPN}-crates.inc" + + nativepython3 - <