swupdategui-rs_git.bb 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. SUMMARY = "Recovery GUI application (Rust)"
  2. DESCRIPTION = "GUI for the recovery system, written in Rust. It works with LVGL \
  3. and the framebuffer and talks to SWUpdate via libswupdate. It is a drop-in \
  4. replacement for swupdate-gui."
  5. HOMEPAGE = "https://github.com/sbabic/SWUpdateGUI"
  6. LICENSE = "GPL-2.0-or-later"
  7. LIC_FILES_CHKSUM = "file://LICENSE;md5=de4b1111cc7f3c8bc81546de6f9b24e4"
  8. SRC_URI = "git://github.com/sbabic/SWUpdateGUI.git;protocol=https;branch=rust-port \
  9. file://0001-lv-build-with-LVGL-9.2.patch \
  10. file://swupdate-gui \
  11. file://swupdate-gui.service \
  12. file://90-recovery-gui.rules \
  13. "
  14. SRCREV = "de64c91ea54671f25c47029cfcd36fc8a7a05a41"
  15. S = "${WORKDIR}/git"
  16. PV = "1.0.0+git"
  17. include swupdategui-rs-crates.inc
  18. inherit cargo cargo-update-recipe-crates pkgconfig update-rc.d systemd
  19. # Requirements in scarthgap:
  20. # - Rust >= 1.77 (scarthgap ships 1.75), for example from meta-lts-mixins,
  21. # branch scarthgap/rust
  22. # - LVGL >= 9.2 (provided by this layer)
  23. # - clang-native from meta-clang
  24. #
  25. # The recipe is skipped if one of these layers is missing: most builds do
  26. # not use the GUI and must not need meta-clang or the Rust mixin.
  27. python () {
  28. collections = (d.getVar('BBFILE_COLLECTIONS') or '').split()
  29. required = [
  30. ('clang-layer', 'meta-clang'),
  31. ('scarthgap-rust-mixin', 'meta-lts-mixins (branch scarthgap/rust)'),
  32. ]
  33. missing = [layer for (collection, layer) in required if collection not in collections]
  34. if missing:
  35. raise bb.parse.SkipRecipe('requires %s' % ' and '.join(missing))
  36. }
  37. # Bindings for LVGL and libswupdate are generated by bindgen, which needs libclang.
  38. # LVGL is found with pkg-config, libswupdate in the target sysroot.
  39. DEPENDS += "clang-native lvgl swupdate"
  40. export BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${STAGING_DIR_HOST} -I${STAGING_INCDIR}"
  41. export SWUPDATE_INCLUDE_DIR = "${STAGING_INCDIR}"
  42. export SWUPDATE_LIB_DIR = "${STAGING_LIBDIR}"
  43. INITSCRIPT_NAME = "swupdate-gui"
  44. INITSCRIPT_PARAMS = "defaults 90"
  45. SYSTEMD_SERVICE:${PN} = "swupdate-gui.service"
  46. do_install:append() {
  47. install -d ${D}${systemd_system_unitdir}
  48. install -m 0644 ${WORKDIR}/swupdate-gui.service ${D}${systemd_system_unitdir}
  49. # Same init script as the C implementation
  50. if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
  51. install -d ${D}${sysconfdir}/init.d
  52. install -m 0755 ${WORKDIR}/swupdate-gui ${D}${sysconfdir}/init.d/
  53. fi
  54. install -d ${D}${sysconfdir}/recovery_gui
  55. install -m 0644 ${S}/config/config.txt ${D}${sysconfdir}/recovery_gui/
  56. install -d ${D}${bindir}
  57. for script in ${S}/scripts/recovery-*.sh; do
  58. install -m 0755 ${script} ${D}${bindir}
  59. done
  60. # The GUI opens /dev/fb and /dev/input/{keyboard0,touchscreen0}
  61. install -d ${D}${sysconfdir}/udev/rules.d
  62. install -m 0644 ${WORKDIR}/90-recovery-gui.rules ${D}${sysconfdir}/udev/rules.d/
  63. }
  64. FILES:${PN} += "${sysconfdir}/udev/rules.d/90-recovery-gui.rules"
  65. # Same files as the C implementation
  66. RPROVIDES:${PN} = "swupdate-gui"
  67. RREPLACES:${PN} = "swupdate-gui"
  68. RCONFLICTS:${PN} = "swupdate-gui"
  69. RDEPENDS:${PN} = "swupdate"