SUMMARY = "Recovery GUI application (Rust)" DESCRIPTION = "GUI for the recovery system, written in Rust. It works with LVGL \ and the framebuffer and talks to SWUpdate via libswupdate. It is a drop-in \ replacement for swupdate-gui." HOMEPAGE = "https://github.com/sbabic/SWUpdateGUI" LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://LICENSE;md5=de4b1111cc7f3c8bc81546de6f9b24e4" SRC_URI = "git://github.com/sbabic/SWUpdateGUI.git;protocol=https;branch=rust-port \ file://0001-lv-build-with-LVGL-9.2.patch \ file://swupdate-gui \ file://swupdate-gui.service \ file://90-recovery-gui.rules \ " SRCREV = "de64c91ea54671f25c47029cfcd36fc8a7a05a41" S = "${WORKDIR}/git" PV = "1.0.0+git" include swupdategui-rs-crates.inc inherit cargo cargo-update-recipe-crates pkgconfig update-rc.d systemd # Requirements in scarthgap: # - Rust >= 1.77 (scarthgap ships 1.75), for example from meta-lts-mixins, # branch scarthgap/rust # - 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" export BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${STAGING_DIR_HOST} -I${STAGING_INCDIR}" export SWUPDATE_INCLUDE_DIR = "${STAGING_INCDIR}" export SWUPDATE_LIB_DIR = "${STAGING_LIBDIR}" INITSCRIPT_NAME = "swupdate-gui" INITSCRIPT_PARAMS = "defaults 90" SYSTEMD_SERVICE:${PN} = "swupdate-gui.service" do_install:append() { install -d ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/swupdate-gui.service ${D}${systemd_system_unitdir} # Same init script as the C implementation if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/swupdate-gui ${D}${sysconfdir}/init.d/ fi install -d ${D}${sysconfdir}/recovery_gui install -m 0644 ${S}/config/config.txt ${D}${sysconfdir}/recovery_gui/ install -d ${D}${bindir} for script in ${S}/scripts/recovery-*.sh; do install -m 0755 ${script} ${D}${bindir} done # The GUI opens /dev/fb and /dev/input/{keyboard0,touchscreen0} install -d ${D}${sysconfdir}/udev/rules.d install -m 0644 ${WORKDIR}/90-recovery-gui.rules ${D}${sysconfdir}/udev/rules.d/ } FILES:${PN} += "${sysconfdir}/udev/rules.d/90-recovery-gui.rules" # Same files as the C implementation RPROVIDES:${PN} = "swupdate-gui" RREPLACES:${PN} = "swupdate-gui" RCONFLICTS:${PN} = "swupdate-gui" RDEPENDS:${PN} = "swupdate"