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

323.1. supertux-0.7.0

Classic 2D side-scrolling platformer with Tux, with a level editor

Version 0.7.0, release 2
Shelf games-action — Action, arcade, racing, platform and sandbox games
Phase 44_apps (Applications), 136 of 422 in build order
Licence GPL-3.0-or-later AND CC-BY-SA-4.0 AND CC-BY-SA-3.0 AND OFL-1.1
Homepage https://www.supertux.org/
Build time 10.1 SBU
Installed size 313.6 MiB in 4908 files
Recipe ports/core/games-action/supertux/kpkgbuild

About

SuperTux is a side-scrolling platform game in the style of the classic console platformers, with Tux as the hero, a world map, and a level editor built into the game. It draws through SDL2 and OpenGL and plays its music and sound through OpenAL; the program is supertux2, and its levels, graphics and music install under /usr/share/games/supertux2.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, sdl2-compat, sdl2-image, sdl2-ttf, physfs, openal-soft, libogg, libvorbis, libpng, zlib, fmt, glm, freetype2, glew, mesa, libglvnd, 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 supertux'

What kpkg does

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

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/supertux
echo '32fc5b99b9994ed58e58341d6f21de925764b381256e108591136de53bc31da5  supertux-0.7.0.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/supertux
SRC=$SRC_ROOT/supertux-0.7.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf supertux-0.7.0.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:

patch -p1 -i "$PORT_SRC/musl-execinfo.patch"

cmake -S . -B build -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DINSTALL_SUBDIR_BIN=bin \
	-DIS_SUPERTUX_RELEASE=ON \
	-DENABLE_OPENGL=ON \
	-DUSE_GL_LIBRARY=glew \
	-DENABLE_NETWORKING=OFF \
	-DENABLE_DISCORD=OFF \
	-DSTEAM_BUILD=OFF \
	-DFLATPAK=OFF \
	-DUSE_SYSTEM_SDL2_TTF=ON \
	-DUSE_STATIC_SIMPLESQUIRREL=ON \
	-DSUPERTUX_PCH=OFF \
	-DSUPERTUX_LTO=OFF \
	-DBUILD_TESTING=OFF \
	-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \
	-DCMAKE_REQUIRE_FIND_PACKAGE_OpenGL=ON
cmake --build build
DESTDIR=$PKG cmake --install build

find "$PKG/usr/share/games/supertux2" -name '*.po' -delete

install -d "$PKG/usr/share/icons/hicolor/256x256/apps"
rsvg-convert -w 256 -h 256 supertux2.svg \
	-o "$PKG/usr/share/icons/hicolor/256x256/apps/supertux2.png"
cat > "$PKG/usr/share/applications/supertux2.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=SuperTux
GenericName=Platform Game
Comment=Play a classic 2D platform game
Exec=supertux2
Icon=supertux2
Terminal=false
StartupWMClass=supertux2
Categories=Game;ArcadeGame;
Keywords=game;arcade;platform;tux;jump;
DESKTOP
chmod 644 "$PKG/usr/share/applications/supertux2.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/supertux, 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 supertux-0.7.0-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/supertux, and runs the triggers its paths call for.

Contents

Installed programs: supertux2.

Installed directories: /usr/share/doc/supertux2, /usr/share/games/supertux2, /usr/share/licenses/supertux.

Notes

build.sh deletes every .po file under /usr/share/games/supertux2. SuperTux reads its translations as .po files at run time, through its bundled tinygettext, and kpkg’s language prune removes compiled catalogues (.mo, .gmo, .qm) but not .po files, so without the deletion the game would ship every translation while the rest of the system is English only.

Upstream installs supertux2.svg as its hicolor icon (see Desktop entries belong to the port). build.sh also renders a 256-pixel PNG from it with rsvg-convert from librsvg, and writes its own supertux2.desktop over upstream’s, untranslated, with search keywords.