Move GTK 3 and WebKitGTK 4.1 from hard Requires/Depends to Recommends in the full Linux .rpm and .deb packages while keeping the libc6 glibc floor check on the .deb. Desktop dnf (Fedora, openSUSE) and apt installs still pull the window libraries automatically, while RHEL, Rocky Linux and AlmaLinux (where webkit2gtk4.1 lives in EPEL) and headless servers (--no-install-recommends or install_weak_deps=False) install the static engine and bundled Docker CLI cleanly. Before execing /usr/lib/kiri/kiri-window on Linux, kiri ui now probes dynamic library resolution via LD_TRACE_LOADED_OBJECTS=1 and reports an actionable package install message instead of a raw ld.so failure when GTK 3 or WebKitGTK 4.1 is missing. Fixes #260
9.7 KiB
Packaging
How Kiri reaches people on each platform, and what each piece of this
directory (and installer/windows) does.
| Platform | Package | Built by | Contents |
|---|---|---|---|
| Linux (Debian, Ubuntu) | kiri_<v>_amd64.deb, _arm64.deb |
packaging/linux/build.sh |
engine + docker CLI, Compose, buildx; the window on x86-64 |
| Linux (Debian, Ubuntu) | kiri-lite_<v>_amd64.deb, _arm64.deb |
packaging/linux/build.sh |
engine only |
| Linux (Fedora, RHEL, openSUSE) | kiri-<v>-1.x86_64.rpm, .aarch64.rpm, kiri-lite-…rpm |
packaging/linux/build.sh |
same two flavours |
| Windows | Kiri-<v>-x86_64.msi |
cargo xtask msi |
engine for WSL2, kiri-win.exe, docker CLI, Compose, buildx |
| Windows on Arm | Kiri-<v>-arm64.msi |
cargo xtask msi --arch arm64 |
the same, arm64 throughout (docker CLI built from source) |
| macOS | Kiri.app in Kiri-<v>-arm64.dmg (-x86_64 for Intel), Kiri-<v>-<arch>.tar.gz, Kiri Lite |
cargo xtask release |
app + CLI tools (DMG for cask, .tar.gz for Homebrew formula); Lite downloads the tools |
| NixOS / Linux (Nix) | kiri and kiri-lite in flake.nix |
nix build .#kiri |
engine + Docker CLI, Compose, buildx (kiri), or engine only (kiri-lite), plus nixosModules.default |
Two flavours everywhere, with the same meaning: Kiri brings the docker
CLI, Compose and buildx so docker run works right after installing;
Kiri Lite is the engine alone for people who already have a docker.
The CLI versions and their SHA-256s are pinned once, in
crates/kiri/src/cli_pins.rs, for all three platforms.
Linux
packaging/linux/fetch-cli.sh target/linux-cli # docker, compose, buildx, verified against cli_pins.rs
packaging/linux/fetch-forge.sh target/linux-x86_64-musl # kiri-forge, verified against cli_pins.rs
packaging/linux/build.sh target/linux-x86_64-musl target/packages x86_64 target/linux-cli
A release builds all eight packages (both flavours, .deb and .rpm, x86-64
and arm64) with scripts/ci/linux-build.sh on Ubuntu, zig cross-compiling
the arm64 engine; then installs the x86-64 .debs under systemd and runs
containers through them (packaging/linux/test-host.sh), and the .rpms the
same way on Fedora. Each file goes up with SHA256SUMS-linux.
A v* tag builds Mac, Windows and Linux; each build puts its files on
download.runkiri.com with its feeds staged, and the release moves every
feed and updates the website once all three are up (RELEASES.md). On a Mac, scripts/ci/linux-packages.sh builds
the same packages in a Linux container.
build.sh needs dpkg-deb and rpmbuild (apt install rpm on Debian;
both are in WSL Ubuntu). Without the CLI directory it builds only
kiri-lite. The binaries come from cargo xtask linux or
scripts/windows-engine.sh (static musl, so one package runs on every
distro). What the packages do:
/usr/bin/kiri,/usr/bin/kiri-init,kiri.service(installed, not started: installing alone runs nothing. The engine starts, and starts at boot, when someone sets Kiri up: the window's Allow access, orsudo kiri host-access $USER. An upgrade leaves a running engine as it is), thekirigroup that owns/run/kiri/docker.sock. Members of the kiri group can run containers as root on this machine; treat it like the docker group. State in/var/lib/kiri-daemon(0700), images and containers in/var/lib/kiri(0710); removal keeps them,apt purgedeletes them.- The full package adds
/usr/libexec/kiri/bin/dockerwith Compose and buildx in/usr/libexec/kiri/cli-plugins, and offersdockeron PATH throughupdate-alternativesat priority 10, only when/usr/bin/dockeris absent or already an alternatives link: a docker CLI another package owns keeps winning, as on Windows. Compose and buildx go into/usr/lib/docker/cli-pluginsthe same way, one alternatives link each, so the package installs besidedocker-compose-plugin,docker-buildx-pluginanddocker-desktop(whose plugins Kiri's docker then uses). A link is made only when Docker's own copy isn't in any of the CLI's plugin folders (/usr/lib,/usr/libexec,/usr/local/lib,/usr/local/libexec…/docker/cli-plugins), and a dpkg trigger (rpm%filetriggerinand%filetriggerpostun) checks again whenever another package changes those folders, so Docker's plugins installed or removed after Kiri still win. Itsdockertalks to Kiri's socket unlessDOCKER_HOST,DOCKER_CONTEXTor a context of your own says otherwise. - The x86-64 full package also has the window:
/usr/lib/kiri/kiri-window(kiri built with--features window, linking GTK 3 and WebKitGTK 4.1, so the package depends on the window binary's glibc floor and recommends GTK 3 and WebKitGTK 4.1), its launcher in the app menu and the icons.kiri uistarts it, or says which GTK and WebKitGTK packages to install when those shared libraries are absent; where the window isn't packaged (kiri-lite, and the arm64 packages, which zig cross-compiles),kiri uisays so.linux-build.shbuilds the window for its own machine's architecture whenlibwebkit2gtk-4.1-devis there. - Upgrading the package restarts a running engine on the new version, as the Mac and Windows apps do after an update: running containers stop, and those with a restart policy start again.
Tests: packaging/linux/test.sh (package listings, install/remove in
privileged Ubuntu and Fedora containers on any Docker-compatible engine, Kiri
included; nested, so it proves the files and scripts, not container runs) and
packaging/linux/test-host.sh (on a real host or VM with systemd: install,
run containers, publish a port, remove; it stops a kiri daemon already running
there, so it wants KIRI_TEST_KILL=1).
Not yet: an apt/dnf repository (today the packages are release assets;
a repository is what gives apt upgrade), and signing.
Arch Linux
arch/PKGBUILD builds kiri-ui, the desktop window (kiri --features window),
for Arch Linux (x86_64 and aarch64, including Omarchy and Asahi). It
installs /usr/lib/kiri/kiri-window where kiri ui expects it, plus the
application-menu launcher and icons, without replacing an installed Kiri engine,
CLI, systemd service, Docker context, or container store. See arch/README.md
for build and install steps.
Nix and NixOS
flake.nix builds two packages on x86_64-linux and aarch64-linux, matching
the .deb and .rpm split:
packages.<system>.kiri(default):kiri,kiri-init, polkit policy and NetworkManager configuration, bundled withpkgs.docker-client,pkgs.docker-composeandpkgs.docker-buildxunder$out/libexec/kiriand a$out/bin/dockerwrapper (nix build .#kiri).packages.<system>.kiri-lite: the engine alone (nix build .#kiri-lite).overlays.default: addskiriandkiri-liteto anixpkgsset.nixosModules.default(alsonixosModules.kiri): declarative NixOS service configuration.
Example flake.nix consumer on NixOS:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
kiri.url = "github:libracoder/kiri";
kiri.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { nixpkgs, kiri, ... }: {
nixosConfigurations.my-host = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
kiri.nixosModules.default
{
services.kiri = {
enable = true;
users = [ "alice" ];
# package = kiri.packages.x86_64-linux.kiri-lite;
# enableDockerCli = true; # defaults to !config.virtualisation.docker.enable
# socketGroup = "kiri";
};
}
];
};
};
}
Enabling services.kiri loads the kernel modules Kiri uses (overlay,
br_netfilter, nf_tables, tun, loop, veth), turns on IPv4 forwarding
and polkit by default, creates services.kiri.socketGroup with
services.kiri.users as members, links /libexec/docker/cli-plugins into
/run/current-system/sw, configures NetworkManager to leave Kiri's bridges and
veths unmanaged, puts NixOS's host tools (kmod, iproute2, util-linux,
e2fsprogs, nftables, iptables, coreutils, procps) on the unit's
PATH, and runs kiri.service with the same cgroup delegation, resource
limits and /run/docker.sock fallback link as packaging/linux/kiri.service.
Homebrew
The official tap is libracoder/homebrew-kiri,
which offers both a cask (for the desktop app in /Applications) and a formula
(for headless CLI and brew services workflows):
- Cask (
Casks/kiri.rb):brew install --cask libracoder/kiri/kiri. InstallsKiri.appfromKiri-<v>-<arch>.dmginto/Applications, updates in place via Kiri's signed updater, and cleans up setup state onbrew uninstall --zap --cask kiri. - Formula (
Formula/kiri.rb):brew install libracoder/kiri/kiri. Installs the signed, notarizedKiri.appfromKiri-<v>-<arch>.tar.gz(preserving itscom.apple.security.virtualizationentitlement) under$(brew --prefix)/opt/kiri/libexec/Kiri.app, symlinks$(brew --prefix)/bin/kiri, and defines abrew servicesLaunchAgent (brew services start kiri). Persisted paths written bykiri setupuse the version-independentopt/kiri/libexec/Kiri.appsymlink sobrew upgrade kirinever leaves staleCellarpaths behind,kiri setupcoexists withhomebrew.mxcl.kiri.plistwithout writing a duplicate LaunchAgent, and in-app self-update defers tobrew upgrade kiri. Both entries conflict with one another so only one owns the engine at a time. - Release automation: mirroring a release to GitHub updates both
Casks/kiri.rbandFormula/kiri.rbfromSHA256SUMSand opens a pull request onlibracoder/homebrew-kiri.