Bladeren bron

swupdategui-rs: skip the recipe without meta-clang and Rust mixin

On scarthgap the recipe needs clang-native from meta-clang and Rust
>= 1.77 from meta-lts-mixins. Most builds do not use the GUI and do not
have these layers, but bitbake still considers swupdategui-rs, for
example as runtime provider of swupdate-gui or for world builds, and
fails with:

  Nothing PROVIDES 'clang-native'

Skip the recipe when one of the layers is missing. Builds without the
GUI do not see it anymore, and a build that asks for it reports which
layer is missing.

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
Stefano Babic 1 dag geleden
bovenliggende
commit
d4208016c4
2 gewijzigde bestanden met toevoegingen van 16 en 0 verwijderingen
  1. 3 0
      README
  2. 13 0
      recipes-support/rescuegui/swupdategui-rs_git.bb

+ 3 - 0
README

@@ -25,6 +25,9 @@ swupdategui-rs needs more than scarthgap provides:
   branch: scarthgap
 * LVGL >= 9.2: this layer provides LVGL 9.2.2
 
+Without meta-clang or meta-lts-mixins the recipe is skipped, so builds that
+do not use the GUI need neither of them.
+
 Documentation for the layer
 ---------------------------
 

+ 13 - 0
recipes-support/rescuegui/swupdategui-rs_git.bb

@@ -29,6 +29,19 @@ inherit cargo cargo-update-recipe-crates pkgconfig update-rc.d systemd
 # - LVGL >= 9.2 (provided by this layer)
 # - clang-native from meta-clang
 #
+# The recipe is skipped if one of these layers is missing: most builds do
+# not use the GUI and must not need meta-clang or the Rust mixin.
+python () {
+    collections = (d.getVar('BBFILE_COLLECTIONS') or '').split()
+    required = [
+        ('clang-layer', 'meta-clang'),
+        ('scarthgap-rust-mixin', 'meta-lts-mixins (branch scarthgap/rust)'),
+    ]
+    missing = [layer for (collection, layer) in required if collection not in collections]
+    if missing:
+        raise bb.parse.SkipRecipe('requires %s' % ' and '.join(missing))
+}
+
 # Bindings for LVGL and libswupdate are generated by bindgen, which needs libclang.
 # LVGL is found with pkg-config, libswupdate in the target sysroot.
 DEPENDS += "clang-native lvgl swupdate"