283.3. kapptemplate-26.08.2
Project template generator — KDE Frameworks, Kirigami, plasmoid and KParts skeletons for a new program
| Version | 26.08.2, release 1 |
| Shelf | devtools — Debuggers, tracers, profilers, analysers, linters, language servers and developer utilities |
| Phase | 44_apps (Applications), 46 of 422 in build order |
| Licence | GPL-2.0-or-later AND (GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL) AND LGPL-2.1-or-later AND CC-BY-SA-4.0 AND GFDL-1.2-or-later AND CC0-1.0 |
| Homepage | https://apps.kde.org/kapptemplate/ |
| Build time | 0.3 SBU |
| Installed size | 1.1 MiB in 22 files |
| Recipe | ports/core/devtools/kapptemplate/kpkgbuild |
About
KAppTemplate starts a new KDE or Qt project from a template: a KDE Frameworks widgets application, a Kirigami application, a plasmoid, a KParts component and others. It asks for the project’s name and location and writes the source tree, with its CMake files, ready to build.
Sources
kapptemplate-26.08.2.tar.xz(470.9 KiB)
sha2561fa05808863df97682959280eb7b3bc5255099a10e1507e66dbed50a83f30521
upstream: https://download.kde.org/stable/release-service/26.08.2/src/kapptemplate-26.08.2.tar.xz
archive copy: sources-1/devtools--kapptemplate-26.08.2.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, karchive, kconfig, kconfigwidgets, kcoreaddons, kdoctools, ki18n, kiconthemes, kirigami, kirigami-addons, kitemmodels, qqc2-desktop-style.
Required by (1): kde-gear-devtools.
Patches
build.sh applies these; kpkg applies nothing by itself.
The desktop entry’s StartupWMClass is upstream’s kapptemplate, but the window’s Wayland app_id is org.kde.kapptemplate, the desktop file name that KAboutData derives from the apps.kde.org home page and the component name; app-id.patch sets the class to the app_id so the task manager matches the window to its entry.
app-id.patch— set the desktop entry's StartupWMClass to the Wayland app_id, org.kde.kapptemplate
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 kapptemplate'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/devtools/kapptemplate.
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/devtools/kapptemplate
echo '1fa05808863df97682959280eb7b3bc5255099a10e1507e66dbed50a83f30521 kapptemplate-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/kapptemplate
SRC=$SRC_ROOT/kapptemplate-26.08.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf kapptemplate-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:
patch -p1 -i "$PORT_SRC/app-id.patch"
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 \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-D KF_SKIP_PO_PROCESSING=ON— Builds none of the interface translations inpo/, which kpkg’s English-only rule would remove from the package anyway (see Size and language policy).-Wno-dev— Silences CMake’s warnings meant for the project’s own developers.
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/kapptemplate, 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 kapptemplate-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/kapptemplate, and runs the triggers its paths call for.
Contents
Installed programs: kapptemplate.
Installed directories: /usr/share/doc/HTML/en/kapptemplate, /usr/share/licenses/kapptemplate.
Notes
The window is Kirigami. It imports org.kde.kirigamiaddons.formcard, .treeview and .delegates from kirigami-addons and org.kde.kitemmodels from kitemmodels, and asks for the org.kde.desktop Qt Quick Controls style that qqc2-desktop-style provides, falling back to Fusion; all three are needed only at run time. A generated project is built with cmake, extra-cmake-modules and a compiler, and a plasmoid template needs libplasma, none of which the program itself runs.
The templates are packed into archives at build time by ECM’s KDEPackageAppTemplates. kdoctools_install(po) still builds the handbook in every translated language; kpkg’s language rule removes /usr/share/doc/HTML/<lang>/ from the package.