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

324.7. xonotic-0.8.6

Arena first-person shooter on the DarkPlaces engine: SDL client and dedicated server

Version 0.8.6, release 2
Shelf games-shooter — First-person shooters, Doom and Quake engines, and their data
Phase 44_apps (Applications), 199 of 422 in build order
Licence GPL-2.0-or-later AND BSD-3-Clause
Homepage https://xonotic.org
Build time 0.9 SBU
Installed size 7.9 MiB in 28 files
Recipe ports/core/games-shooter/xonotic/kpkgbuild

About

Xonotic is a fast arena first-person shooter on the DarkPlaces engine, an extended Quake engine. This port builds the engine twice, as the SDL client xonotic and the dedicated server xonotic-dedicated, together with d0_blind_id, the player-identification and encryption library the engine uses for its player IDs. The game’s maps, models, sounds and textures are the separate xonotic-data port, installed in /usr/share/xonotic.

Sources

Dependencies

Depends on: unzip, pkgconf, sdl2-compat, libjpeg-turbo, libpng, zlib, libogg, libvorbis, libtheora, curl, gmp, xonotic-data.

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 xonotic'

What kpkg does

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

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/xonotic
echo '8b92ac781cff4ae89c121a23eacd7dec05a2aabedaccc23a19d1a0958b4012a8  xonotic-0.8.6.zip' | 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/xonotic
SRC=$SRC_ROOT/xonotic-0.8.6
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
cp xonotic-0.8.6.zip "$SRC"

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:

unzip -q "$name-$version.zip"
cd Xonotic

patch -p1 -i "$PORT_SRC/gcc-15.patch"

cd source/d0_blind_id
./configure --prefix=/usr --libdir=/usr/lib --disable-static
make
make DESTDIR=$PKG install
cd ../..

dpflags=${CFLAGS/-O2/-O3}
dpflags=${dpflags/-std=gnu11/}
for t in sdl-release sv-release; do
	make -C source/darkplaces \
		CPUOPTIMIZATIONS="$dpflags $LDFLAGS" \
		SDL_CONFIG='pkg-config sdl2' \
		SDLCONFIG_UNIXLIBS_X11= \
		DP_FS_BASEDIR=/usr/share/xonotic \
		$t
done
install -Dm755 source/darkplaces/darkplaces-sdl "$PKG/usr/bin/xonotic"
install -Dm755 source/darkplaces/darkplaces-dedicated "$PKG/usr/bin/xonotic-dedicated"
install -Dm644 COPYING "$PKG/usr/share/licenses/$name/COPYING"
install -Dm644 GPL-2 "$PKG/usr/share/licenses/$name/GPL-2"
install -Dm644 source/darkplaces/COPYING "$PKG/usr/share/licenses/$name/darkplaces-COPYING"
install -Dm644 source/d0_blind_id/COPYING "$PKG/usr/share/licenses/$name/d0_blind_id-COPYING"

for s in 16 22 24 32 48 64 128 256 512; do
	install -Dm644 misc/logos/icons_png/xonotic_$s.png \
		"$PKG/usr/share/icons/hicolor/${s}x$s/apps/xonotic.png"
done

install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/xonotic.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Xonotic
GenericName=First-Person Shooter
Comment=Fast arena shooter, for LAN and local play against bots
Exec=xonotic
Icon=xonotic
Terminal=false
StartupWMClass=xonotic
Categories=Game;ActionGame;
Keywords=fps;shooter;arena;deathmatch;xonotic;
DESKTOP
chmod 644 "$PKG/usr/share/applications/xonotic.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/xonotic, 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 xonotic-0.8.6-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/xonotic, and runs the triggers its paths call for.

Contents

Installed programs: blind_id, xonotic, xonotic-dedicated.

Installed libraries: libd0_blind_id.so, libd0_rijndael.so.

Installed directories: /usr/include/d0_blind_id, /usr/share/licenses/xonotic.

Short descriptions

d0_blind_id.pc Library for user identification using RSA blind signatures
d0_rijndael.pc Library for Rijndael encryption

Notes

The source release is a .zip, which kpkg copies into the work directory as it is (see Sources, and what each one becomes), so build.sh unpacks it itself with unzip and builds from the Xonotic directory inside. d0_blind_id is built first, with its own configure, as a shared library: DarkPlaces opens it at run time with dlopen, as it does libpng, libogg, libvorbis, libtheora and libcurl, so those are in depends although no link line names them. Its big-number arithmetic is on gmp.

DarkPlaces picks the game it runs from its executable’s name, which is why the client is installed as xonotic; that name is also SDL’s default Wayland app id, which StartupWMClass names.