Docs / LINUX-PACKAGING

Linux packages (AppImage + .deb, x64/arm64)

Source: docs/LINUX-PACKAGING.md

This page is the reproducible build and verification path for item 213. It is
written from the Linux containers that actually ran the builds, not from a
macOS host assumption.

Why containers

The development host is macOS/arm64. appimagetool, dpkg-deb, Electron's
Linux binaries and X11 are Linux artifacts; none of them run natively on this
host. The Kiri Docker endpoint is a real Linux/aarch64 VM, and its binfmt setup
also runs linux/amd64 containers, so both architectures are built and launched
there. The host only orchestrates Docker and stores the outputs.

Probe used to confirm the boundary:

docker --context kiri info --format '{{.ServerVersion}} / {{.Architecture}} / {{.OSType}}'
# 27.5.1 / aarch64 / linux
docker --context kiri run --rm --platform linux/arm64 alpine:3.20 uname -a
docker --context kiri run --rm --platform linux/amd64 alpine:3.20 uname -a
# ... x86_64 Linux (through QEMU/binfmt)

Build

From this checkout at revision a710b81:

scripts/linux/build.sh arm64
scripts/linux/build.sh x64

Each script builds scripts/linux/Dockerfile, mounts the checkout read-only at
/src, and runs scripts/linux/build-inner.sh inside the container. The inner
script stages the desktop shell (source, assets, brand icons), rebuilds the SDK
dist/ from the same revision, copies the Python core, templates, schema and
virtual-controller service into Electron's resources/, then runs
electron-builder@26.18.0 against scripts/linux/electron-builder.yml.
Electron is pinned to 38.8.6, the version resolved by desktop/package.json.

Packaged repositoryRoot needs no source patch: Electron resolves
__dirname inside app.asar/src to process.resourcesPath, and the shared
files above are placed in that directory as extraResources.

Outputs are written to .linux-build/out/ with the release asset names:

  • Kitty-0.2.0-x86_64.AppImage
  • kitty_0.2.0_amd64.deb
  • Kitty-0.2.0-arm64.AppImage
  • kitty_0.2.0_arm64.deb

BUILD-INFO.* in the same directory records file(1), sizes and SHA-256 sums.

What the packages contain and require

Bundled: the Electron shell, the SDK dist/, the gamecomposer Python package,
specs/, templates/ and desktop/virtual-controller/.

Not bundled: the Python interpreter with PyYAML and jsonschema, and the Kiri
CLI. On the host, install python3, python3-yaml, python3-jsonschema (or
pip equivalents) and a running Kiri on PATH. Without Kiri the app still opens,
but sandbox actions report the runtime's own "Kiri CLI is required" message.
This is a packaging boundary, not a game-session pass.

Usage:

chmod +x Kitty-0.2.0-x86_64.AppImage && ./Kitty-0.2.0-x86_64.AppImage
sudo apt install ./kitty_0.2.0_amd64.deb

Launch verification

scripts/linux/verify.sh arm64
scripts/linux/verify.sh x64

scripts/linux/verify.Dockerfile provides Debian bookworm with X11, GTK/NSS
libraries, libfuse2, Python YAML/jsonschema packages and Xvfb. The inner
script starts each package under Xvfb :99, keeps the process alive for 25
seconds, writes xwininfo window trees and import -window root screenshots
to docs/evidence/linux-installer/, then shuts the app down. The .deb is
installed with apt-get install before launch, so the verification covers the
installed binary path rather than a copied directory. The arm64 AppImage runs
through --appimage-extract-and-run (the VM lacks /dev/fuse). For x64,
QEMU's binfmt handler rejects the AppImage runtime's patched ELF header, so the
verifier extracts the embedded squashfs and launches the identical bundled
Electron binary; this limitation is recorded in appimage-x64.txt.

What a screenshot proves: the packaged app starts and draws its window on a
real Linux kernel. It does not prove sandbox launch, emulator input, audio,
saves or playability; see docs/PLATFORM-MATRIX.md for those separate claims.

Release boundary

No upload is performed by any script here. The v0.2.0 tag currently has an
empty asset list, so the README/docs/landing links point at assets that are not
published yet. Attaching these four files to the GitHub release is an external
write that needs a fresh owner approval.

Back to all docs