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

323.5. powder-toy-100.1.400

The Powder Toy — a falling-sand physics sandbox of air pressure, heat, gravity and electronics, with local saves

Version 100.1.400, release 1
Shelf games-action — Action, arcade, racing, platform and sandbox games
Phase 44_apps (Applications), 140 of 422 in build order
Licence GPL-3.0-or-later
Homepage https://powdertoy.co.uk
Build time 5.5 SBU
Installed size 4.1 MiB in 7 files
Recipe ports/core/games-action/powder-toy/kpkgbuild

About

The Powder Toy is a falling-sand physics sandbox: the player places particles of powders, liquids, gases, explosives and electronic parts, and the game simulates air pressure, heat, gravity and electricity between them. The program is powder; it saves simulations as local .cps files and stamps, its reusable pieces of a simulation, as .stm files.

Sources

Dependencies

Depends on: meson, ninja, pkgconf, python3, sdl2-compat, luajit, fftw, jsoncpp, libpng, bzip2, zlib.

Required by: no port names it.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

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/44_apps/phase.env && kpkg install powder-toy'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/games-action/powder-toy.

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/games-action/powder-toy
echo '75cd971e1b2d6789f9e35b75926b76d037a564ad9291fa852ad9996c8ac40c96  powder-toy-100.1.400.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/powder-toy
SRC=$SRC_ROOT/powder-toy-100.1.400
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf powder-toy-100.1.400.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:

meson setup build --prefix=/usr --libdir=lib --buildtype=release \
	-Dstatic=none \
	-Dhttp=false \
	-Dignore_updates=true \
	-Dcan_install=no \
	-Dlua=luajit \
	-Dworkaround_elusive_bzip2=none \
	-Duse_bluescreen=no \
	-Dresolve_vcs_tag=no \
	-Drender_icons_with_inkscape=disabled
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

install -Dm644 resources/powder.man "$PKG/usr/share/man/man6/powder.6"
install -Dm644 resources/generated_icons/icon_exe.png \
	"$PKG/usr/share/icons/hicolor/256x256/apps/powder-toy.png"
install -Dm644 resources/generated_icons/icon_exe_48.png \
	"$PKG/usr/share/icons/hicolor/48x48/apps/powder-toy.png"
install -Dm644 build/resources/save.xml \
	"$PKG/usr/share/mime/packages/powder-toy.xml"

install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/powder-toy.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=The Powder Toy
GenericName=Physics Sandbox
Comment=Falling-sand sandbox of pressure, heat, gravity and electronics
Exec=powder %f
Icon=powder-toy
Terminal=false
StartupWMClass=powder
MimeType=application/vnd.powdertoy.save;
Categories=Game;Simulation;
Keywords=sandbox;physics;falling sand;simulation;tpt;powder;
DESKTOP
chmod 644 "$PKG/usr/share/applications/powder-toy.desktop"

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/powder-toy, 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 powder-toy-100.1.400-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/powder-toy, and runs the triggers its paths call for.

Contents

Installed programs: powder.

Installed directories: /usr/share/licenses/powder-toy.

Short descriptions

powder a physics sandbox game

Notes

meson install installs the program alone, so build.sh installs the rest from the source and build trees: the manual page, two of the generated icons, and build/resources/save.xml, the shared-MIME definition of application/vnd.powdertoy.save, which kpkg folds into the MIME database (see Shared indexes). The desktop entry is written by build.sh and claims that type, so a .cps or .stm file opens in the game. Upstream’s own entry also claims the ptsave: URL scheme, which opens the online save browser that this build does not have, so the entry here leaves it out. The window’s Wayland app id is SDL’s default, the executable’s name, powder, which is what StartupWMClass names.