323.2. supertuxkart-1.5
3D kart racing with story mode, grand prix, battles and soccer
| Version | 1.5, release 1 |
| Shelf | games-action — Action, arcade, racing, platform and sandbox games |
| Phase | 44_apps (Applications), 137 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://supertuxkart.net/ |
| Build time | 35.7 SBU |
| Installed size | 60.2 MiB in 1256 files |
| Recipe | ports/core/games-action/supertuxkart/kpkgbuild |
About
SuperTuxKart is a 3D kart racer: story mode, grand prix, time trials, battle arenas and soccer, against the computer or other people on the same machine or over the network. It renders through its own fork of the Irrlicht engine, with an OpenGL renderer and a Vulkan one, and plays sound through OpenAL. This port is the program and the engine’s own data; the karts, tracks, music, sounds, models and textures are stk-assets, built from the same release tarball.
Sources
supertuxkart-1.5.tar.gz(692.5 MiB)
sha25633cf8841e4ff4082d80b9248014295bbbea61d14683e86dff100e3ab8f7b27cb
upstream: https://github.com/supertuxkart/stk-code/releases/download/1.5/SuperTuxKart-1.5-src.tar.gz
archive copy: sources-2/games-action--supertuxkart-1.5.tar.gz
Dependencies
Depends on: cmake, ninja, pkgconf, sdl2-compat, mesa, libglvnd, shaderc, openal-soft, libogg, libvorbis, freetype2, harfbuzz, libjpeg-turbo, libpng, zlib, curl, openssl, sqlite, bluez, stk-assets.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
offline-default.patch— Insrc/config/user_config.hpp, changes the default of theenable_internetsetting from0(“the user was not asked”) to2(“not allowed”). With0the game asks on its first start whether it may connect to the SuperTuxKart servers; with2it does not ask, and fetches no news and no add-on list until the player ticks “Connect to the Internet” under Options, General. Online multiplayer is behind the same setting.
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 supertuxkart'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/games-action/supertuxkart.
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/supertuxkart
echo '33cf8841e4ff4082d80b9248014295bbbea61d14683e86dff100e3ab8f7b27cb supertuxkart-1.5.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/supertuxkart
SRC=$SRC_ROOT/supertuxkart-1.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf supertuxkart-1.5.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 group and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/offline-default.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 \
-DSERVER_ONLY=OFF \
-DCHECK_ASSETS=OFF \
-DBUILD_RECORDER=OFF \
-DUSE_WIIUSE=ON \
-DUSE_SYSTEM_WIIUSE=OFF \
-DUSE_IPV6=ON \
-DUSE_SQLITE3=ON \
-DUSE_CRYPTO_OPENSSL=ON \
-DUSE_MOJOAL=OFF \
-DUSE_DNS_C=OFF \
-DUSE_GLES2=OFF \
-DNO_SHADERC=OFF \
-DUSE_LIBBFD=OFF
cmake --build build
DESTDIR=$PKG cmake --install build
rm "$PKG/usr/lib/libwiiuse.a" "$PKG/usr/include/wiiuse.h" \
"$PKG/usr/lib/libangelscript.a" "$PKG/usr/include/angelscript.h"
rm -r "$PKG/usr/lib/cmake/Angelscript"
rmdir "$PKG/usr/include" "$PKG/usr/lib/cmake" "$PKG/usr/lib"
find "$PKG/usr/share/supertuxkart/data/po" -name '*.po' -delete
for d in karts library models music sfx textures tracks; do
rm -rf "$PKG/usr/share/supertuxkart/data/$d"
done
The switches, and why each is set:
-DSERVER_ONLY=OFF— build the game with graphics and sound.ONbuilds a dedicated network server only. This is upstream’s default, named.-DCHECK_ASSETS=OFF— skip upstream’s configure-time check that the karts, tracks and the other asset directories are present. The release tarball carries them indata/, so the check would pass; with it off, the build does not depend on where the assets sit.-DBUILD_RECORDER=OFF— build without the in-game video recorder. It needs libopenglrecorder, which the tree does not carry, and in a release build its absence is a configure error rather than a warning.-DUSE_WIIUSE=ON— with-DUSE_SYSTEM_WIIUSE=OFF: support Wii remotes as controllers, through the copy of the wiiuse library in the source, which talks to them over Bluetooth with bluez’slibbluetooth. The tree has no wiiuse port. Both are upstream’s defaults, named.-DUSE_IPV6=ON— allow creating and joining network games over IPv6. It also makes the build use the copy of ENet in the source rather than the tree’s enet, because the IPv6 support lives in that copy. Upstream’s default, named.-DUSE_SQLITE3=ON— keep server statistics and the ban list in SQLite, for a network game this machine hosts. Upstream turns it off with a warning when SQLite is missing; sqlite is independs.-DUSE_CRYPTO_OPENSSL=ON— encrypt network-game traffic between client and server with openssl rather than mbed TLS. Upstream’s default, named.-DUSE_MOJOAL=OFF— use the system OpenAL, openal-soft, rather than the copy of MojoAL in the source. Upstream’s default, named.-DUSE_DNS_C=OFF— resolve server names through the C library’s resolver rather than the DNS library bundled in the source. Upstream’s default on Linux, named.-DUSE_GLES2=OFF— the desktop OpenGL renderer rather than OpenGL ES 2, upstream’s default on x86-64, named.-DNO_SHADERC=OFF— build the Vulkan renderer, which compiles its shaders at run time with shaderc. With shaderc missing and this off, configure stops with an error rather than leaving Vulkan out.-DUSE_LIBBFD=OFF— no libbfd in the crash reporter and leak checker, upstream’s default, named.
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/supertuxkart, 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 supertuxkart-1.5-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/supertuxkart, and runs the triggers its paths call for.
Contents
Installed programs: supertuxkart.
Installed directories: /usr/share/licenses/supertuxkart, /usr/share/supertuxkart/data/challenges, /usr/share/supertuxkart/data/gamerzilla, /usr/share/supertuxkart/data/gfx, /usr/share/supertuxkart/data/grandprix, /usr/share/supertuxkart/data/gui, /usr/share/supertuxkart/data/po, /usr/share/supertuxkart/data/replay, /usr/share/supertuxkart/data/shaders, /usr/share/supertuxkart/data/skins, /usr/share/supertuxkart/data/ttf.
Notes
cmake --install installs two libraries built from copies in the source, wiiuse and AngelScript (the scripting language tracks use), as static archives with their headers and AngelScript’s CMake package files. The game links both into its binary, so build.sh removes them, and the empty /usr/include and /usr/lib directories after them. A change that makes upstream install any other file under those directories makes the rmdir fail and the build stop.
Upstream installs the whole of data/ from the release, assets included. build.sh deletes the karts, library, models, music, sfx, textures and tracks directories again, because stk-assets installs those same seven, and kpkg’s conflict scan refuses a path two packages claim. The list here and the list in stk-assets/build.sh have to stay the same. The two ports share group = supertuxkart, so the version checker offers them only as one bump; both name the same tarball by the same sha256, so the source cache holds it once.
The game reads its translations as .po files from data/po at run time. kpkg’s language prune removes only compiled catalogues, so build.sh deletes the .po files itself, and the game is English only, like the rest of the system.