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

326.1. cataclysm-dda-0.I.1

Cataclysm: Dark Days Ahead — turn-based survival in a procedurally generated post-apocalyptic world, in its tiles build

Version 0.I.1, release 2
Shelf games-rpg — RPGs, roguelikes and interactive fiction
Phase 44_apps (Applications), 188 of 422 in build order
Licence CC-BY-SA-3.0 AND OFL-1.1 AND Apache-2.0
Homepage https://cataclysmdda.org
Build time 15.5 SBU
Installed size 175.5 MiB in 7936 files
Recipe ports/core/games-rpg/cataclysm-dda/kpkgbuild

About

Cataclysm: Dark Days Ahead is a turn-based survival roguelike set in a procedurally generated world after a catastrophe: the player scavenges, crafts, builds and fights through an open map that is simulated as they move. This port is its tiles build, cataclysm-tiles, which draws through SDL2 with graphical tilesets and plays sound, rather than the curses build for a terminal. It also installs zzip, upstream’s tool for compressing and expanding save files.

Sources

Dependencies

Depends on: pkgconf, sdl2-compat, sdl2-image, sdl2-mixer, sdl2-ttf, freetype2, zlib, librsvg.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

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 cataclysm-dda'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/games-rpg/cataclysm-dda.

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-rpg/cataclysm-dda
echo '27e35a0a5181f88f0929bef180ca0465d00e606e569911cb02d97b59b8b5768a  cataclysm-dda-0.I.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/cataclysm-dda
SRC=$SRC_ROOT/cataclysm-dda-0.I.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf cataclysm-dda-0.I.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 recipe’s helpers _tag and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/flatbuffers.patch"
patch -p1 -i "$PORT_SRC/pathmax.patch"
patch -p1 -i "$PORT_SRC/make.patch"
patch -p1 -i "$PORT_SRC/zzip-ldflags.patch"

mk() {
	make \
		PREFIX=/usr \
		WARNINGS='-Wall -Wextra' \
		RELEASE=1 TILES=1 SOUND=1 \
		LOCALIZE=0 LANGUAGES= \
		USE_XDG_DIR=1 DYNAMIC_LINKING=1 \
		BACKTRACE=0 PCH=0 \
		TESTS=0 RUNTESTS=0 \
		ASTYLE=0 LINTJSON=0 \
		"$@"
}
mk
mk DESTDIR=$PKG install

rm -rf "$PKG/usr/share/icons/hicolor/scalable"
install -d "$PKG/usr/share/icons/hicolor/256x256/apps"
rsvg-convert -w 256 -h 256 data/xdg/org.cataclysmdda.CataclysmDDA.svg \
	-o "$PKG/usr/share/icons/hicolor/256x256/apps/org.cataclysmdda.CataclysmDDA.png"
rm -f "$PKG/usr/share/applications/org.cataclysmdda.CataclysmDDA.desktop"
cat > "$PKG/usr/share/applications/org.cataclysmdda.CataclysmDDA.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Cataclysm: Dark Days Ahead
GenericName=Survival Game
Comment=Turn-based survival in a post-apocalyptic world
Exec=cataclysm-tiles
Icon=org.cataclysmdda.CataclysmDDA
Terminal=false
StartupWMClass=cataclysm-tiles
Categories=Game;RolePlaying;
Keywords=zombie;survival;roguelike;tiles;dda;cdda;cataclysm;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.cataclysmdda.CataclysmDDA.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/cataclysm-dda, 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 cataclysm-dda-0.I.1-2.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/cataclysm-dda, and runs the triggers its paths call for.

Contents

Installed programs: cataclysm-tiles, zzip.

Installed directories: /usr/share/cataclysm-dda, /usr/share/licenses/cataclysm-dda.

Notes

The mk function in build.sh passes the same variables to both make runs, the build and make install: the Makefile decides what to install from them, and an install run without TILES=1 and SOUND=1 would leave out the tilesets and the sound data.

Upstream installs a scalable SVG icon and a desktop entry. The desktop’s icon lookup reads PNGs only (see Desktop entries belong to the port), so build.sh removes the SVG, renders a 256-pixel PNG from it with rsvg-convert from librsvg, and replaces the entry with one that adds StartupWMClass=cataclysm-tiles, the window’s Wayland app id, which is SDL’s default, the executable’s name.