327.1. kpat-26.08.2
KPatience — fourteen solitaire card games, with a solver for each deal
| Version | 26.08.2, release 1 |
| Shelf | games-board — Board, card, puzzle, chess and classic small games, whatever toolkit or desktop project they come from |
| Phase | 44_apps (Applications), 147 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://apps.kde.org/kpat/ |
| Build time | 1.7 SBU |
| Installed size | 4.6 MiB in 57 files |
| Recipe | ports/core/games-board/kpat/kpkgbuild |
About
KPatience (kpat) is KDE’s collection of solitaire card games: Klondike, Spider, FreeCell, Yukon, Golf, Simple Simon and the rest of upstream’s list, with hints, demo play and a solver that says whether a deal can be won. It is a Qt 6 and KDE Frameworks application, and it draws its cards from the decks libkdegames installs under /usr/share/carddecks.
Sources
kpat-26.08.2.tar.xz(3.6 MiB)
sha2566f4b69ebde5602d808fe857e989568255be2c3a9b8f36c8adaa959fe529b1a17
upstream: https://download.kde.org/stable/release-service/26.08.2/src/kpat-26.08.2.tar.xz
archive copy: sources-2/games-board--kpat-26.08.2.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtwayland, qt6-qtsvg, kcompletion, kconfig, kconfigwidgets, kcoreaddons, kcrash, kdbusaddons, kguiaddons, ki18n, kio, knewstuff, kwidgetsaddons, kxmlgui, kdoctools, libkdegames, freecell-solver, black-hole-solver.
Required by (1): kde-gear-games.
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 kpat'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/games-board/kpat.
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-board/kpat
echo '6f4b69ebde5602d808fe857e989568255be2c3a9b8f36c8adaa959fe529b1a17 kpat-26.08.2.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/kpat
SRC=$SRC_ROOT/kpat-26.08.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf kpat-26.08.2.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:
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D KDE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
-D BUILD_TESTING=OFF \
-D KF_SKIP_PO_PROCESSING=ON \
-D BUILD_DOC=ON \
-D WITH_BH_SOLVER=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6DocTools=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
find "$PKG/usr/share/man" -mindepth 1 -maxdepth 1 ! -name 'man[0-9]*' -exec rm -rf {} +
cat > "$PKG/usr/share/applications/org.kde.kpat.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=KPatience
GenericName=Patience Card Game
Comment=Solitaire card game
TryExec=kpat
Exec=kpat -qwindowtitle %c %u
Icon=kpat
X-DocPath=kpat/index.html
MimeType=application/vnd.kde.kpatience.savedstate;
Categories=Qt;KDE;Game;CardGame;
Keywords=solitaire;patience;cards;klondike;spider;freecell;yukon;golf;kpat;
Terminal=false
StartupWMClass=org.kde.kpat
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.kde.kpat.desktop"
The switches, and why each is set:
-D KF_SKIP_PO_PROCESSING=ON— compile none of the interface translation catalogues inpo/. kpkg removes every non-English catalogue from the package anyway (see size and language policy), so this only saves build time.-D BUILD_DOC=ON— build the KPatience handbook and thekpat(6)manual page with kdoctools, so Help opens the handbook. Upstream’s default, named.-D CMAKE_REQUIRE_FIND_PACKAGE_KF6DocTools=ON— make the KF6DocTools lookup required at thefind_packagecall itself, so a build root without kdoctools stops the configure there.-D WITH_BH_SOLVER=ON— use black-hole-solver to solve Golf, which upstream then requires. The solver for FreeCell, Simple Simon, Baker’s Dozen and Castle, freecell-solver, is required whatever this switch says. Upstream’s default, named, so Golf cannot be left without its solver.
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/kpat, 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 kpat-26.08.2-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/kpat, and runs the triggers its paths call for.
Contents
Installed programs: kpat.
Installed libraries: libkcardgame.so.
Installed directories: /usr/share/doc/HTML/en/kpat, /usr/share/kpat, /usr/share/licenses/kpat.
Short descriptions
kpat |
A highly addictive card game |
Notes
kdoctools_install(po) builds and installs every translated handbook and every translated kpat(6) page that the release carries, and this happens even with KF_SKIP_PO_PROCESSING on. build.sh deletes every directory in /usr/share/man that is not a man<section> one, which removes the translated manual pages, and kpkg’s prune removes the same directories again together with the translated handbooks under usr/share/doc/HTML/<lang>/, so Help and man kpat open the English copies.
build.sh writes its own org.kde.kpat.desktop over upstream’s to add StartupWMClass=org.kde.kpat: KDE’s KAboutData sets the desktop file name, so the window’s Wayland app id is org.kde.kpat. The entry keeps upstream’s Exec, MIME type for saved games and handbook path, and adds a TryExec=kpat upstream’s lacks. It drops the per-game actions upstream lists for starting one game directly, and the translations; its keywords are a list of its own. The hicolor icons it names are upstream’s.