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

324.1. chocolate-doom-3.1.1

Doom engine faithful to the DOS original — Doom, Heretic, Hexen and Strife

Version 3.1.1, release 2
Shelf games-shooter — First-person shooters, Doom and Quake engines, and their data
Phase 44_apps (Applications), 193 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://www.chocolate-doom.org/
Build time 3.6 SBU
Installed size 6.1 MiB in 77 files
Recipe ports/core/games-shooter/chocolate-doom/kpkgbuild

About

Chocolate Doom is a Doom source port that aims to behave exactly like the original DOS executables, bugs and limits included, and plays Heretic, Hexen and Strife on the same code. It installs chocolate-doom, chocolate-heretic, chocolate-hexen, chocolate-strife, a setup program for each, and chocolate-server. With freedoom in depends, the free Freedoom IWADs are in /usr/share/games/doom, one of the directories the engine searches, so chocolate-doom has a game to play without any of id Software’s data.

Sources

Dependencies

Depends on: autoconf, automake, pkgconf, python3, python3-pillow, sdl2-compat, sdl2-mixer, sdl2-net, libsamplerate, libpng, fluidsynth, freedoom.

Required by: no port names it.

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 chocolate-doom'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/games-shooter/chocolate-doom.

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-shooter/chocolate-doom
echo '1edcc41254bdc194beb0d33e267fae306556c4d24110a1d3d3f865717f25da23  chocolate-doom-3.1.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/chocolate-doom
SRC=$SRC_ROOT/chocolate-doom-3.1.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf chocolate-doom-3.1.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:

autoreconf -fi

export CFLAGS="$CFLAGS -g0"

./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
	--enable-sdl2mixer \
	--enable-sdl2net \
	--enable-doc \
	--enable-bash-completion \
	--enable-fonts \
	--enable-icons \
	--with-libsamplerate \
	--with-libpng \
	--with-fluidsynth \
	--disable-werror
make
make appdatadir=/usr/share/metainfo DESTDIR=$PKG install

rm -f "$PKG/usr/share/applications/org.chocolate_doom".{Heretic,Hexen,Strife}.desktop
cat > "$PKG/usr/share/applications/org.chocolate_doom.Doom.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Chocolate Doom
GenericName=First Person Shooter
Comment=Play Doom as it was on DOS
Exec=chocolate-doom
Icon=chocolate-doom
Terminal=false
StartupWMClass=chocolate-doom
Categories=Game;ActionGame;
Keywords=first;person;shooter;doom;freedoom;vanilla;
DESKTOP
cat > "$PKG/usr/share/applications/org.chocolate_doom.Setup.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Chocolate Doom Setup
Comment=Controls, sound, video and network settings for Chocolate Doom
Exec=chocolate-doom-setup
Icon=chocolate-setup
Terminal=false
StartupWMClass=chocolate-doom-setup
Categories=Settings;Game;
Keywords=doom;setup;controls;joystick;
DESKTOP
chmod 644 "$PKG/usr/share/applications/"*.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/chocolate-doom, 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 chocolate-doom-3.1.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/chocolate-doom, and runs the triggers its paths call for.

Contents

Installed programs: chocolate-doom, chocolate-doom-setup, chocolate-heretic, chocolate-heretic-setup, chocolate-hexen, chocolate-hexen-setup, chocolate-server, chocolate-strife, chocolate-strife-setup.

Installed directories: /usr/share/doc/chocolate-doom, /usr/share/doc/chocolate-heretic, /usr/share/doc/chocolate-hexen, /usr/share/doc/chocolate-strife, /usr/share/licenses/chocolate-doom.

Short descriptions

chocolate-doom historically compatible Doom engine
chocolate-doom-setup configuration tool for chocolate-doom
chocolate-heretic historically compatible Heretic engine
chocolate-heretic-setup configuration tool for chocolate-heretic
chocolate-hexen historically compatible Hexen engine
chocolate-hexen-setup configuration tool for chocolate-hexen
chocolate-server dedicated server for chocolate-doom
chocolate-strife historically compatible Strife engine
chocolate-strife-setup configuration tool for chocolate-strife

Notes

The source is GitHub’s archive of the release tag, which carries configure.ac but no generated configure, so build.sh runs autoreconf -fi first; autoconf and automake are in depends for it.

Upstream installs a desktop entry for each of the four games, the setup program and a Doom screensaver. build.sh removes the Heretic, Hexen and Strife entries, whose games need data KDOS does not ship (their programs stay, for a player with the data), and writes the Doom and setup entries itself with StartupWMClass set to each program’s name, which is its Wayland app id.