Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

43.8. meson-1.12.1

Build system that generates Ninja build files

Version 1.12.1, release 1
Shelf buildtools — Build systems and build helpers
Phase 30_foundation (Build Foundation), 62 of 127 in build order
Licence Apache-2.0
Homepage https://mesonbuild.com/
Build time 0.2 SBU
Installed size 10.2 MiB in 503 files
Recipe ports/core/buildtools/meson/kpkgbuild

About

Meson is the build system a large part of the tree is configured with: it reads a project’s meson.build and writes the build files ninja runs. It is installed in the first, ordered run of 30_foundation, the build tools every later recipe reaches for without naming them in depends. Before it, muon, a meson written in C, builds pkgconf, because muon needs nothing but a C compiler; see the muon page.

Every meson setup in the chroot goes through script/bin/meson, which adds --wrap-mode=nodownload to a setup that chooses no wrap mode, so no build can fetch a subproject from the network. The wrapper answers as a missing command until this port is installed; see The phase environment.

Meson is a pure Python package with a setuptools backend and no run-time dependency of its own. The port installs it with pip, from the unpacked source.

Why it is in KDOS

The comment above the 24 ports from fortify-headers to musl-utils in script/phases/30_foundation/packages.txt is quoted in The build foundation.

Sources

Dependencies

Depends on: ninja, python3-setuptools, python3-pip.

Required by (238): accountsservice, adwaita-icon-theme, adwaita-icon-theme-legacy, aisleriot, aml, appstream, at-spi2-core, atkmm2.28, audacious, audacious-plugins, babl, basu, blueprint-compiler, bolt, bubblewrap, cairomm, cairomm1.14, ccid, celluloid, coeurl, dav1d, dbus, dconf, deja-dup, desktop-file-utils, dino, dtc, elogind, flashrom, font-manager, fprintd, freeciv, fribidi, fuse, fwupd, fwupd-efi, fzssh, gdk-pixbuf, gegl, geoclue, gexiv2, gimp, glib, glib-introspection, glib-networking, glibmm, glibmm2.66, glmark2, glu, gnome-disk-utility, gnome-mahjongg, gnome-mines, gnome-sudoku, gobject-introspection, graphene, gsettings-desktop-schemas, gspell, gstreamer, gthumb, gtk-doc, gtk-vnc, gtk3, gtk4, gtkmm3, gtkmm4, gtksourceview4, gtksourceview5, gumbo-parser, gvfs, handbrake, harfbuzz, hicolor-icon-theme, horizon-eda, iio-sensor-proxy, impression, imv, inih, iputils, iso-codes, json-glib, jsoncpp, kiwix-tools, koreader, libaccounts-glib, libadwaita, libbluray, libcacard, libcamera, libdecor, libdisplay-info, libdrm, libdvdcss, libdvdnav, libdvdread, libei, libepoxy, libevdev, libfprint, libglvnd, libgpiod, libgudev, libgusb, libhandy, libinput, libjaylink, libkiwix, liblc3, liblxi, libmbim, libnice, libnotify, libnvme, libomemo-c, libosinfo, libpciaccess, libpeas, libplacebo, libportal, libproxy, libpulse, libqmi, libqrtr-glib, libraqm, librist, librsvg, libsecret, libsigc++2, libsigc++3, libsixel, libslirp, libsoup3, libspatialaudio, libspelling, libspng, libsrtp, libtraceevent, libudfread, libva, libva-intel-driver, libva-utils, libvips, libvirt, libvirt-glib, libwacom, libxcvt, libxfce4util, libxkbcommon, libxkbfile, libxmlb, libzim, lilv, lite-xl, lv2, lxi-tools, mesa-demos, mobile-broadband-provider-info, modemmanager, mpd, mpv, ndctl, networkmanager, numpy, nvme-cli, openh264, orc, orca, osinfo-db-tools, p11-kit, pam, pandas, pango, pangomm, pangomm2.46, pcsc-lite, phodav, picolibc-arm-none-eabi, picolibc-riscv64-unknown-elf, pipewire, pixman, polkit, powder-toy, profanity, python3-cairo, python3-contourpy, python3-dbus, python3-gobject, python3-meson-python, python3-pyatspi, qemu, qv4l2, recoll, resources, rhythmbox, rizin, rtaudio, rubberband, sane-airscan, scipy, serd, shared-mime-info, simde, sord, spice, spice-gtk, spice-protocol, sratom, sshfs, suil, swayimg, switcheroo-control, tio, tomlplusplus, totem-pl-parser, turnstile, upower, usbredir, v4l-utils, virt-manager, vte3, wayland, wayland-protocols, wayland-utils, waypipe, webp-pixbuf-loader, webrtc-audio-processing, wireplumber, wl-clipboard, wlvncc, xdg-dbus-proxy, xdg-desktop-portal, xdg-desktop-portal-gtk, xdg-user-dirs, xfburn, xkeyboard-config, xorgproto, xwayland, zenity, zix.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/30_foundation/phase.env && kpkg install meson'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/buildtools/meson.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/buildtools/meson
echo 'ab0a6ca09f8ef70c564c8241fb5a23957886a0b53fb58412b5e07eaf07dba743  meson-1.12.1.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/meson
SRC=$SRC_ROOT/meson-1.12.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf meson-1.12.1.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

pip3 install --no-deps --no-index --no-build-isolation --ignore-installed --root=$PKG --prefix=/usr .

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/meson, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf meson-1.12.1-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/meson, and runs the triggers its paths call for.

Contents

Installed programs: meson.

Installed directories: /usr/lib/python3.14/site-packages/meson-1.12.1.dist-info, /usr/lib/python3.14/site-packages/mesonbuild, /usr/share/licenses/meson.

Short descriptions

meson a high productivity build system