BitBake language preview
1. A simple recipe
variable assignments, expansion, and a shell task
horizon-dark
# recipe for a simple tool
SUMMARY = "A simple tool"
LICENSE = "MIT"
SRC_URI = "git://example.com/tool.git;branch=main"
DEPENDS += "zlib"
S = "${WORKDIR}/git"
do_install() {
install -d ${D}${bindir}
install -m 0755 tool ${D}${bindir}
}
python do_after_install() {
d.setVar('SOMEVAR', 'value')
}
atom-one-dark
# recipe for a simple tool
SUMMARY = "A simple tool"
LICENSE = "MIT"
SRC_URI = "git://example.com/tool.git;branch=main"
DEPENDS += "zlib"
S = "${WORKDIR}/git"
do_install() {
install -d ${D}${bindir}
install -m 0755 tool ${D}${bindir}
}
python do_after_install() {
d.setVar('SOMEVAR', 'value')
}
github-dark
# recipe for a simple tool
SUMMARY = "A simple tool"
LICENSE = "MIT"
SRC_URI = "git://example.com/tool.git;branch=main"
DEPENDS += "zlib"
S = "${WORKDIR}/git"
do_install() {
install -d ${D}${bindir}
install -m 0755 tool ${D}${bindir}
}
python do_after_install() {
d.setVar('SOMEVAR', 'value')
}
dracula
# recipe for a simple tool
SUMMARY = "A simple tool"
LICENSE = "MIT"
SRC_URI = "git://example.com/tool.git;branch=main"
DEPENDS += "zlib"
S = "${WORKDIR}/git"
do_install() {
install -d ${D}${bindir}
install -m 0755 tool ${D}${bindir}
}
python do_after_install() {
d.setVar('SOMEVAR', 'value')
}
nord
# recipe for a simple tool
SUMMARY = "A simple tool"
LICENSE = "MIT"
SRC_URI = "git://example.com/tool.git;branch=main"
DEPENDS += "zlib"
S = "${WORKDIR}/git"
do_install() {
install -d ${D}${bindir}
install -m 0755 tool ${D}${bindir}
}
python do_after_install() {
d.setVar('SOMEVAR', 'value')
}
github
# recipe for a simple tool
SUMMARY = "A simple tool"
LICENSE = "MIT"
SRC_URI = "git://example.com/tool.git;branch=main"
DEPENDS += "zlib"
S = "${WORKDIR}/git"
do_install() {
install -d ${D}${bindir}
install -m 0755 tool ${D}${bindir}
}
python do_after_install() {
d.setVar('SOMEVAR', 'value')
}
2. Append and override syntax
the :append, :prepend, and :remove operators
horizon-dark
FILES:${PN} += "${bindir}/tool"
CFLAGS:append = " -DDEBUG"
RDEPENDS:remove = "unwanted-package" atom-one-dark
FILES:${PN} += "${bindir}/tool"
CFLAGS:append = " -DDEBUG"
RDEPENDS:remove = "unwanted-package" github-dark
FILES:${PN} += "${bindir}/tool"
CFLAGS:append = " -DDEBUG"
RDEPENDS:remove = "unwanted-package" dracula
FILES:${PN} += "${bindir}/tool"
CFLAGS:append = " -DDEBUG"
RDEPENDS:remove = "unwanted-package" nord
FILES:${PN} += "${bindir}/tool"
CFLAGS:append = " -DDEBUG"
RDEPENDS:remove = "unwanted-package" github
FILES:${PN} += "${bindir}/tool"
CFLAGS:append = " -DDEBUG"
RDEPENDS:remove = "unwanted-package" 3. Inline Python
an inline Python expansion for computing a value
horizon-dark
PACKAGE_ARCH = "${@d.getVar('TARGET_ARCH')}" atom-one-dark
PACKAGE_ARCH = "${@d.getVar('TARGET_ARCH')}" github-dark
PACKAGE_ARCH = "${@d.getVar('TARGET_ARCH')}" dracula
PACKAGE_ARCH = "${@d.getVar('TARGET_ARCH')}" nord
PACKAGE_ARCH = "${@d.getVar('TARGET_ARCH')}" github
PACKAGE_ARCH = "${@d.getVar('TARGET_ARCH')}"