Compile flutter desktop application using bitbake for yocto distro

1k Views Asked by At

I want to compile my flutter desktop app for a yocto distro, so I somehow need access to flutter build. How am I able to use flutter in do_compile(){}? It's installed in my docker container I use to build my yocto images.

recipe.bb

SUMMARY = "larning-installer recipe"
DESCRIPTION = "Larning installer app for installing other larning software"
SRCREV= "aa237f9ad19436b61b2f930721837682a637759b"
LICENSE="GPLv3"
LIC_FILES_CHKSUM = "file://src/LICENSE;md5=442763063122646a01b61b4839320293"

PV="0.0.1+git${SRCPV}"
PR="r1"

SRC_URI="git://gitlab.com/larning/installer.git \
            file://config.json"

S = "${WORKDIR}"
FILES_${PN} += "${bindir}"

do_configure() {
    rm git/assets/config.json
    mv config.json git/assets/
}

do_compile() {
    cd git
    flutter build linux
    cd ..
}

do_install() {
    install -d ${D}${bindir}
    install -m 0755 git/build/release/bundle/installer ${D}${bindir}
}
1

There are 1 best solutions below

2
On BEST ANSWER

You must add an build time dependency to the tool, you must use the DEPENDS variable for that.

DEPENDS += "flutter-engine-native"

Add the meta-flutter layer to your bblayers.conf after cloning it.

https://layers.openembedded.org/layerindex/branch/zeus/layer/meta-flutter/