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

327.28. knavalbattle-26.08.2

Battleship: sink the hidden fleet, against the computer or over the network

26.08.2-1 · GPL-2.0-or-later AND GFDL-1.2-or-later AND BSD-3-Clause AND CC0-1.0 · 5.6 SBU · 1.8 MiB, 24 files · 44_apps, 174 of 422 · ports/core/games-board/knavalbattle

Homepage: https://apps.kde.org/knavalbattle/

Naval Battle (knavalbattle) is KDE’s Battleship: each side places its ships on a hidden grid and the two take turns firing at the other’s. It plays against the computer, or against a second player over the network. It is a Qt 6 and KDE Frameworks application built on libkdegames.

Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, kcompletion, kconfig, kcoreaddons, kcrash, kdbusaddons, kdnssd, kdoctools, ki18n, ktextwidgets, kwidgetsaddons, kxmlgui, libkdegames, gzip.

Required by (1): kde-gear-games.

Sources: knavalbattle-26.08.2.tar.xz (1.0 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install knavalbattle'

build.sh:

cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D BUILD_TESTING=OFF \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D KF_SKIP_PO_PROCESSING=ON \
	-D CMAKE_DISABLE_FIND_PACKAGE_7Zip=ON \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

Programs: knavalbattle.

Directories: /usr/share/doc/HTML/en/knavalbattle, /usr/share/knavalbattle, /usr/share/licenses/knavalbattle.

A network game is announced and found through DNS-SD, by kdnssd over the Avahi daemon that /etc/init.d/45_avahi.sh starts; without it, the other player is reached by host name and port. The player who hosts listens on TCP port 54321 by default, which the input chain of /etc/nftables.conf drops, so hosting needs a rule accepting that port in a file of its own under /etc/nftables.d (see The firewall). Joining someone else’s game is an outgoing connection and needs no rule.

The desktop entry claims the kbattleship: URL scheme, so a link of the form kbattleship://host:port/ opens a network game.

KF_SKIP_PO_PROCESSING stops only ki18n_install(): kdoctools_install() still builds the handbook in every translated language, and kpkg’s language rule removes /usr/share/doc/HTML/<lang>/ from the package.

The desktop entry is upstream’s org.kde.knavalbattle.desktop. KAboutData derives the window’s Wayland app id, org.kde.knavalbattle, from the component name and the apps.kde.org home page, so it is the entry’s file name and Plasma pairs the window with the entry without a StartupWMClass.