SUMMARY = "FCB Looper GUI Application"
DESCRIPTION = "Rust egui GUI for FCB1010 looper pedal"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit cargo_bin systemd externalsrc

# Network access required for cargo dependencies (Yocto 4.0+)
do_compile[network] = "1"

# Remove debug function - clean recipe
#CARGO_BUILD_FLAGS = "--target x86_64-poky-linux-gnu --release"

# Use external source directory
EXTERNALSRC = "/repo/gui"
EXTERNALSRC_BUILD = "${WORKDIR}/build"

# Disable externalsrc debug symlinks
EXTERNALSRC_SYMLINKS = ""

# Dependencies for GUI
DEPENDS += "wayland wayland-protocols libxkbcommon fontconfig"
RDEPENDS:${PN} += "weston liberation-fonts systemd"

# Systemd service
SRC_URI += "file://gui-app.service"

do_install:append() {
    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/gui-app.service ${D}${systemd_system_unitdir}/
}

SYSTEMD_SERVICE:${PN} = "gui-app.service"
SYSTEMD_AUTO_ENABLE:${PN} = "enable"

FILES:${PN} += "${systemd_system_unitdir}/gui-app.service"