Yocto layer providing Canonical Mir — a set of shared libraries for building Wayland compositors.
Tested on Yocto Scarthgap (5.0 LTS), targeting Raspberry Pi 4 (aarch64), built on Ubuntu 24.04 LTS.
| Layer | Purpose |
|---|---|
poky/meta (oe-core) |
Base layer |
meta-openembedded/meta-oe |
yaml-cpp, lttng-ust, glm |
meta-openembedded/meta-python |
python3-pillow (if examples are enabled) |
meta-openembedded/meta-networking |
Optional networking support |
| Recipe | Description |
|---|---|
mir |
Mir display server libraries and Miral toolkit (cross-compiled for target) |
libdisplay-info |
EDID/DisplayID parsing library (required by Mir's gbm-kms platform) |
| Package | Contents |
|---|---|
mir |
Runtime shared libraries |
mir-dev |
Headers and pkg-config files |
mir-graphics-drivers-gbm-kms |
KMS/DRM platform plugin and evdev input plugin |
sudo apt update && sudo apt install -y \
gawk wget git diffstat unzip texinfo gcc build-essential \
chrpath socat cpio python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping python3-git python3-jinja2 \
python3-subunit zstd liblz4-tool file locales libacl1 \
python3-distutils-extraThese are the standard Yocto host dependencies. No additional packages (like libxml++2.6-dev or liblttng-ust-dev) are required — all build tools are provided by Yocto native recipes.
Ubuntu 24.04 restricts unprivileged user namespaces by default, which breaks Yocto's sandbox:
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
echo 'kernel.apparmor_restrict_unprivileged_userns=0' | sudo tee /etc/sysctl.d/99-yocto.confmkdir -p ~/workspace/yocto && cd ~/workspace/yocto
git clone --depth=1 -b scarthgap https://github.com/yoctoproject/poky.git
git clone --depth=1 -b scarthgap https://github.com/openembedded/meta-openembedded.git
git clone --depth=1 -b scarthgap https://github.com/bricke/meta-mir.gitcd ~/workspace/yocto
source poky/oe-init-build-env buildBBLAYERS += " \
/home/<user>/workspace/yocto/poky/meta \
/home/<user>/workspace/yocto/poky/meta-poky \
/home/<user>/workspace/yocto/meta-openembedded/meta-oe \
/home/<user>/workspace/yocto/meta-openembedded/meta-python \
/home/<user>/workspace/yocto/meta-openembedded/meta-networking \
/home/<user>/workspace/yocto/meta-mir \
"
systemd requires usrmerge in Scarthgap. Add to build/conf/local.conf:
DISTRO_FEATURES:append = " systemd usrmerge"
VIRTUAL-RUNTIME_init_manager = "systemd"
bitbake mir- Builds only the
gbm-kmsplatform — no X11, no Wayland nesting, no NVIDIA egl-wayland - Tests and examples are disabled
Several of Mir's build steps require host-architecture tools to generate source files before the cross-compiler runs. Bitbake's sanitized task environment does not reliably expose these tools to ninja subprocesses even when declared via HOSTTOOLS, so the recipe pre-generates all outputs in do_compile:prepend.
mir_wayland_generator — Mir's Wayland protocol wrapper generator must run on the host (x86_64). It is compiled from source in do_compile:prepend using ${BUILD_CXX} and libxml2-native (built automatically by Yocto). A compatibility shim (libxmlpp_compat.h) provides the xmlpp API over libxml2 so no host libxml++2.6-dev package is needed. Three patches are applied to allow passing the generator path via a CMake variable and to skip its in-tree build.
lttng-gen-tp — Generates LTTng tracepoint .h/.c files from .tp sources. Bundled from lttng-ust v2.13.8 in SRC_URI (no native recipe exists for lttng-ust). Pre-generated in do_compile:prepend using the host's python3.
gdbus-codegen — Generates D-Bus GLib proxy code from .xml interface files (used for logind seat/session support). Provided by glib-2.0-native (in DEPENDS). Pre-generated in do_compile:prepend using ${STAGING_BINDIR_NATIVE}/gdbus-codegen.
libdisplay-infois not available in meta-oe Scarthgap — a custom recipe is provided in this layergmpis required by Miral (gmpxx.h) and is pulled frompoky/meta