330.5. ktouch-26.08.2
KDE touch typing tutor — graded courses, keyboard layouts and progress statistics
| Version | 26.08.2, release 1 |
| Shelf | education — Learning software, offline encyclopedias and reference dictionaries |
| Phase | 44_apps (Applications), 90 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://apps.kde.org/ktouch/ |
| Build time | 2.5 SBU |
| Installed size | 4.8 MiB in 158 files |
| Recipe | ports/core/education/ktouch/kpkgbuild |
About
KTouch is KDE’s touch-typing tutor: graded courses for many keyboard layouts, an on-screen keyboard that shows the next key, and per-lesson statistics drawn with kqtquickcharts. Its interface is QtQuick, on kdeclarative and kirigami.
Sources
ktouch-26.08.2.tar.xz(4.6 MiB)
sha256d9a309aac3edfbba033b72c00981b28bd83d3371a5c293bb3fe81744cfafd407
upstream: https://download.kde.org/stable/release-service/26.08.2/src/ktouch-26.08.2.tar.xz
archive copy: sources-2/education--ktouch-26.08.2.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, qt6-qt5compat, kcompletion, kconfig, kconfigwidgets, kcoreaddons, ki18n, kitemviews, kcmutils, ktextwidgets, kwidgetsaddons, kwindowsystem, kxmlgui, kdeclarative, kirigami, kdoctools, kqtquickcharts, libxml2, libX11, libxkbfile, libxcb.
Required by (1): kde-gear-education.
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 ktouch'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/education/ktouch.
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/education/ktouch
echo 'd9a309aac3edfbba033b72c00981b28bd83d3371a5c293bb3fe81744cfafd407 ktouch-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/ktouch
SRC=$SRC_ROOT/ktouch-26.08.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ktouch-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 WITHOUT_X11=OFF \
-D CMAKE_REQUIRE_FIND_PACKAGE_X11=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_XCB=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6DocTools=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
readelf -d "$PKG/usr/bin/ktouch" | grep -q 'NEEDED.*\[libxcb-xkb\.so\.1\]'
cat > "$PKG/usr/share/applications/org.kde.ktouch.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=KTouch
GenericName=Touch Typing Tutor
Comment=Learn to type without looking at the keys
TryExec=ktouch
Exec=ktouch
Icon=ktouch
Terminal=false
StartupWMClass=org.kde.ktouch
X-DocPath=ktouch/index.html
Categories=Qt;KDE;Education;
Keywords=typing;keyboard;tutor;touch;lesson;ktouch;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.kde.ktouch.desktop"
The switches, and why each is set:
-D KF_SKIP_PO_PROCESSING=ON— Builds none of the interface translations inpo/; the image is English only (see Size and language policy).-D WITHOUT_X11=OFF,-D CMAKE_REQUIRE_FIND_PACKAGE_X11=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_XCB=ON— Build the X11 keyboard-layout detection, which asks the X server through XKB which layout is active and follows its changes, so the course selector starts on the active layout. Upstream builds it only when it finds Qt’s private GUI headers, libX11 with its Xkb and Xkbfile parts (libxkbfile) and libxcb with its xkb library, and otherwise drops it silently. The twoREQUIREflags make a missing X11 or XCB package fail configure; a missing component passes them, so the check after the install fails the build whenktouchdoes not linklibxcb-xkb.so.1.-D CMAKE_REQUIRE_FIND_PACKAGE_KF6DocTools=ON— Requires kdoctools for the handbook, which upstream builds only when it finds kdoctools.
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/ktouch, 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 ktouch-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/ktouch, and runs the triggers its paths call for.
Contents
Installed programs: ktouch.
Installed directories: /usr/share/doc/HTML/en/ktouch, /usr/share/ktouch, /usr/share/licenses/ktouch.
Short descriptions
ktouch |
A typing tutor by KDE |
Notes
KTouch’s main() sets QT_QPA_PLATFORM=xcb on Linux, over the session’s wayland;xcb, because upstream’s key handling does not see key presses under Wayland. It always runs as an X11 client on Xwayland, and the XKB layout detection above asks Xwayland, which KWin gives the session’s keyboard layout.
The desktop entry is KDOS’s own, written over upstream’s. Its StartupWMClass is org.kde.ktouch, the desktop file name KAboutData sets. Qt puts that name on the X11 window as its _KDE_NET_WM_DESKTOP_FILE property, which is how KWin and the task manager match the window to this entry; the window’s WM_CLASS is the executable’s name, ktouch.