325.3. warzone2100-4.7.0
Post-apocalyptic real-time strategy with campaigns, skirmish and a research tree
| Version | 4.7.0, release 2 |
| Shelf | games-strategy — Strategy, simulation and space-trading games, and their data |
| Phase | 44_apps (Applications), 203 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://wz2100.net/ |
| Build time | 58.7 SBU |
| Installed size | 409.7 MiB in 133 files |
| Recipe | ports/core/games-strategy/warzone2100/kpkgbuild |
About
Warzone 2100 is a real-time strategy game set after a nuclear war: the player builds a base, researches a large technology tree and designs their own units, in campaigns, skirmishes against the computer or multiplayer. It renders through OpenGL or Vulkan on SDL3, and its texture packages are encoded during the build from the PNGs in the source.
Sources
warzone2100-4.7.0.tar.xz(497.0 MiB)
sha25695ee4d5b88680ea1b1cf230b67ea84028e08a2458b84605ac9f7fb9eb97c4e37
upstream: https://github.com/Warzone2100/warzone2100/releases/download/4.7.0/warzone2100_src.tar.xz
archive copy: sources-2/games-strategy--warzone2100-4.7.0.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, sdl3, physfs, libpng, libjpeg-turbo, freetype2, harfbuzz, fribidi, openal-soft, libogg, libvorbis, opus, libtheora, sqlite, curl, libsodium, libzip, protobuf, miniupnpc, vulkan-headers, shaderc, zip, asciidoctor.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
no-update-check.patch— Insrc/updatemanager.cpp, removes the two threads thatWzInfoManager::initialize()starts to fetch update information and driver compatibility data fromdata.wz2100.net(with a GitHub mirror as fallback), and in their place sets the compatibility check’s result to unsuccessful, the same result the game sets when that fetch fails, so whatever waits on that result is released.vulkan-colorspace.patch— Inlib/ivis_opengl/gfx_api_vk.cpp, names the sRGB colour spacevk::ColorSpaceKHR::eSrgbNonlinearinstead ofeVkColorspaceSrgbNonlinear, an alias that the tree’s Vulkan-Hpp headers do not carry.
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 warzone2100'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/games-strategy/warzone2100.
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-strategy/warzone2100
echo '95ee4d5b88680ea1b1cf230b67ea84028e08a2458b84605ac9f7fb9eb97c4e37 warzone2100-4.7.0.tar.xz' | 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/warzone2100
SRC=$SRC_ROOT/warzone2100-4.7.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf warzone2100-4.7.0.tar.xz -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/no-update-check.patch"
patch -p1 -i "$PORT_SRC/vulkan-colorspace.patch"
export LDFLAGS="$LDFLAGS -Wl,--strip-debug"
cmake -S . -B build -G Ninja \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DWZ_DISTRIBUTOR=KDOS \
-DWZ_ENABLE_WARNINGS=OFF \
-DWZ_ENABLE_WARNINGS_AS_ERRORS=OFF \
-DWZ_ENABLE_BASIS_UNIVERSAL=ON \
-DWZ_INCLUDE_TERRAIN_HIGH=ON \
-DWZ_DOWNLOAD_PREBUILT_PACKAGES=OFF \
-DWZ_DISABLE_FETCHCONTENT_GIT_CLONE=ON \
-DWZ_ENABLE_BACKEND_VULKAN=ON \
-DWZ_USE_SYSTEM_LIBJPEG_TURBO=ON \
-DWZ_FORCE_MINIMAL_OPUSFILE=ON \
-DWZ_DEBUG_GFX_API_LEAKS=OFF \
-DENABLE_GNS_NETWORK_BACKEND=ON \
-DENABLE_DISCORD=OFF \
-DWZ_BUILD_SENTRY=OFF \
-DWZ_SKIP_ELF_SEPARATE_DEBUG=ON \
-DENABLE_NLS=OFF \
-DENABLE_DOCS=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_VulkanHeaders=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_Fribidi=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_Miniupnpc=ON
cmake --build build
DESTDIR=$PKG cmake --install build
rm -rf "$PKG/usr/share/doc/warzone2100/hosting/linux_scripts"
rm -f "$PKG/usr/share/icons/net.wz2100.warzone2100.png"
install -Dm644 icons/warzone2100.large.png \
"$PKG/usr/share/icons/hicolor/256x256/apps/net.wz2100.warzone2100.png"
cat > "$PKG/usr/share/applications/net.wz2100.warzone2100.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Warzone 2100
GenericName=Strategy Game
Comment=Post-apocalyptic real-time strategy
Exec=warzone2100
Icon=net.wz2100.warzone2100
Terminal=false
StartupWMClass=warzone2100
Categories=Game;StrategyGame;
Keywords=warzone2100;wz2100;strategy;rts;real-time;
DESKTOP
chmod 644 "$PKG/usr/share/applications/net.wz2100.warzone2100.desktop"
The switches, and why each is set:
-Wl,--strip-debug— appended toLDFLAGS. On GCC and Clang upstream appends-gtoCMAKE_CXX_FLAGS_RELEASE, after the tree’s flags, so every object carries debug information; the linker drops it from the program (see the rule on debug information).-DWZ_SKIP_ELF_SEPARATE_DEBUG=ON— skip upstream’s post-build step that copies the debug information into a separate.debugfile and links it to the program with a debug link.-DWZ_DISTRIBUTOR=KDOS— the distributor name compiled in and reported with the build’s properties. Upstream’s default isUNKNOWN.-DWZ_ENABLE_WARNINGS=OFF— with-DWZ_ENABLE_WARNINGS_AS_ERRORS=OFF: no additional warnings, and warnings are not errors. Upstream’s default for the second isON, so a warning a newer compiler adds would otherwise stop the build.-DWZ_ENABLE_BASIS_UNIVERSAL=ON— with-DWZ_INCLUDE_TERRAIN_HIGH=ONand-DWZ_DOWNLOAD_PREBUILT_PACKAGES=OFF: support Basis Universal compressed textures, include the high-quality terrain texture pack, and encode that pack here from its PNGs indata/, as every other texture package is, rather than downloading upstream’s prebuilthigh.wz. The encoder isbasisu, which configure builds from3rdparty/when none is installed. The encode is slow, and it needs no network.-DWZ_DISABLE_FETCHCONTENT_GIT_CLONE=ON— never clone the Vulkan headers from git when the system’s are missing or too old. With-DCMAKE_REQUIRE_FIND_PACKAGE_VulkanHeaders=ON, the vulkan-headers lookup is required instead, so a missing one fails the configure.-DWZ_ENABLE_BACKEND_VULKAN=ON— build the Vulkan renderer beside the OpenGL one; its shaders are compiled with shaderc. Upstream’s default on Linux, named.-DWZ_USE_SYSTEM_LIBJPEG_TURBO=ON— link the tree’s libjpeg-turbo. Upstream defaults to its bundled copy, because some distributions’ CMake files for the library do not work.-DWZ_FORCE_MINIMAL_OPUSFILE=ON— a minimal build of the bundled Opusfile without HTTP stream support, which upstream says the game does not need. Upstream’s default, named.-DWZ_DEBUG_GFX_API_LEAKS=OFF— no debugging of graphics-API object leaks, which upstream turns on by default.-DENABLE_GNS_NETWORK_BACKEND=ON— build the GameNetworkingSockets network backend from3rdparty/, on protobuf. Upstream’s default, named.-DENABLE_DISCORD=OFF— with-DWZ_BUILD_SENTRY=OFF: no Discord presence and no Sentry crash uploader. Both are upstream’s defaults, named.-DENABLE_NLS=OFF— compile no translations, so the game is English only, like the rest of the system. Upstream’s default isON.-DENABLE_DOCS=ON— generate the manual with asciidoctor. Upstream’s default; without Asciidoctor ora2xit skips the documentation with only a warning.-DCMAKE_REQUIRE_FIND_PACKAGE_Fribidi=ON— with the same switch forMiniupnpc: make each lookup required. Upstream finds fribidi, for right-to-left text, and miniupnpc, for opening a hosted game’s port on the router, as optional. A missing fribidi builds the game without it, and a missing miniupnpc builds the copy inlib/netplay/3rdparty/into the program instead.
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/warzone2100, 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 warzone2100-4.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/warzone2100, and runs the triggers its paths call for.
Contents
Installed programs: warzone2100.
Installed directories: /usr/share/doc/warzone2100, /usr/share/licenses/warzone2100, /usr/share/warzone2100.
Short descriptions
warzone2100 |
3D real time strategy game |
Notes
build.sh removes /usr/share/doc/warzone2100/hosting/linux_scripts, the sample scripts for running a dedicated host, which include a systemd unit, wz2100host_sample.service; KDOS has no systemd.
Upstream installs its icon loose in /usr/share/icons, which no icon lookup reads, so build.sh removes it, installs icons/warzone2100.large.png into hicolor instead, and writes its own desktop entry over upstream’s with StartupWMClass=warzone2100, the window’s Wayland app id, which is the program’s name.
The campaign videos are not shipped. They are upstream’s separate sequences.wz, hundreds of megabytes in its standard-quality set, which -DWZ_INCLUDE_VIDEOS would download at build time and the build leaves at its default OFF; the campaigns play without the briefing videos, and the game says on the Campaign screen that they are missing. To add them, download upstream’s sequences.wz (from its wz-sequences releases) and copy it into /usr/share/warzone2100/ beside the other data packages, where WZ_INCLUDE_VIDEOS would have installed it.