Skip to content

bricke/meta-mir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 

Repository files navigation

meta-mir

License: MIT

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 dependencies

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

Provided recipes

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)

Packages

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

Setup

1. Install host dependencies

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-extra

These 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.

2. Fix AppArmor user namespace restriction

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.conf

3. Clone layers

mkdir -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.git

4. Initialize the build environment

cd ~/workspace/yocto
source poky/oe-init-build-env build

5. Configure bblayers.conf

BBLAYERS += " \
    /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 \
"

6. Configure local.conf

systemd requires usrmerge in Scarthgap. Add to build/conf/local.conf:

DISTRO_FEATURES:append = " systemd usrmerge"
VIRTUAL-RUNTIME_init_manager = "systemd"

7. Build

bitbake mir

Notes

Build platform

  • Builds only the gbm-kms platform — no X11, no Wayland nesting, no NVIDIA egl-wayland
  • Tests and examples are disabled

Cross-compilation workarounds

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.

Dependencies

  • libdisplay-info is not available in meta-oe Scarthgap — a custom recipe is provided in this layer
  • gmp is required by Miral (gmpxx.h) and is pulled from poky/meta

About

Yocto layer providing Canonical Mir (Wayland compositor framework) for embedded Linux — Scarthgap (5.0 LTS)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors