258.3. libksysguard-6.8.2
Process list, sensors and system statistics libraries behind System Monitor, ksystemstats and KDevelop's attach to process
| Version | 6.8.2, release 2 |
| Shelf | kde — KDE Plasma and Gear platform pieces outside Frameworks that have no other domain: KIO workers, thumbnailers, Plasma integration, KDE Wayland glue |
| Phase | 43_toolkits (Toolkits), 118 of 344 in build order |
| Licence | LGPL-2.0-or-later AND (GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL) AND (LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL) |
| Homepage | https://invent.kde.org/plasma/libksysguard |
| Build time | 3.9 SBU |
| Installed size | 3.5 MiB in 158 files |
| Recipe | ports/core/kde/libksysguard/kpkgbuild |
About
libksysguard holds the libraries behind KDE’s system monitoring: processcore, which reads the process list from /proc and changes a process’s priority or sends it a signal; the sensor client that talks to ksystemstats over D-Bus; the formatter for units and sizes; the chart “faces” that System Monitor and the system monitor widgets draw with; and systemstats, the plugin interface ksystemstats loads its sensor providers through. KDevelop’s attach-to-process dialog uses its process list, and plasma5support uses it to name the programs that keep a device busy.
Sources
libksysguard-6.8.2.tar.xz(347.4 KiB)
sha256b9dbdcf73f32b88bf6ada9ff9fdb90d7bea4edb66ce708abb107eb64fad26a3f
upstream: https://download.kde.org/stable/plasma/6.8.2/libksysguard-6.8.2.tar.xz
archive copy: sources-3/kde--libksysguard-6.8.2.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, qt6-qt5compat, kcoreaddons, kconfig, ki18n, kauth, kservice, kpackage, knewstuff, solid, kirigami, kitemmodels, kdeclarative, kquickcharts, zlib, libnl, lm-sensors, eudev, libdrm.
Required by (9): kdevelop, kdos-plasma-look, ksystemstats, ksystemstats-kdos, plasma-desktop, plasma-systemmonitor, plasma-vault, plasma-workspace, plasma5support.
Patches
build.sh applies these; kpkg applies nothing by itself.
aggregate-scope-children.patch counts, for an application’s .scope, the processes of the scope’s descendant cgroups as well as its own cgroup.procs, skipping a descendant that is a .scope or .service of its own, which the model lists and counts as a node. A box’s processes live in podman’s libpod-<id> and conmon children of the box’s app-kdos-<box>-<n>.scope, and without the patch System Monitor’s Applications page finds such a scope empty. The walk stops at eight levels and 1024 cgroups. Nothing in it is KDOS’s: it serves any engine that nests a cgroup under an application scope, Flatpak’s helpers among them.
login-cgroup-root.patch chooses where the application model starts. Upstream it reads only /user.slice/user-<uid>.slice/user@<uid>.service, the cgroup of a systemd user manager, which a KDOS login does not have. elogind runs a login in /<session>/session and gives the user /<session>/delegated, where kdos-appbox makes each box’s scope; with the patch, a process whose own cgroup is <login>/session beside a <login>/delegated directory roots the model at <login>, so the Applications page and the Overview page’s Applications table list each running box as one application, with its processor, memory and process count, under its launcher’s name and icon where the box has one launcher and under the box’s name where it has several (see System Monitor). A system with user@<uid>.service keeps upstream’s root, and any other layout keeps it too, which the model reports as unavailable. /proc/self/cgroup is read whole, not line by line until atEnd(): procfs gives the file a size of 0, so atEnd() holds before the first read. Nothing in it is KDOS’s either: any elogind system that delegates session cgroups has the same layout. Both patches are to be offered upstream.
aggregate-scope-children.patch— processcore: count processes of a scope's descendant cgroupslogin-cgroup-root.patch— processcore: root the application model at an elogind login cgroup
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/43_toolkits/phase.env && kpkg install libksysguard'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/kde/libksysguard.
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/kde/libksysguard
echo 'b9dbdcf73f32b88bf6ada9ff9fdb90d7bea4edb66ce708abb107eb64fad26a3f libksysguard-6.8.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/libksysguard
SRC=$SRC_ROOT/libksysguard-6.8.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libksysguard-6.8.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 recipe’s helpers group and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/aggregate-scope-children.patch"
patch -p1 -i "$PORT_SRC/login-cgroup-root.patch"
export LDFLAGS="$LDFLAGS -Wl,--strip-debug"
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 ENABLE_KAUTH_HELPER=ON \
-D CMAKE_DISABLE_FIND_PACKAGE_libpcap=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_UDev=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-Wl,--strip-debug— Drop debug information at the link. Upstream compiles the KAuth helper with-ggdbin that target’s own compile flags, which CMake places after the exportedCXXFLAGS, so no-g0there can cancel it (see What kpkg does around build.sh).-D KF_SKIP_PO_PROCESSING=ON— Skips building the translations of its messages, which the package-wide English-only rule would remove anyway (see Size and language policy).-D ENABLE_KAUTH_HELPER=ON— Buildksysguardprocesslist_helper, the KAuth helper that kills, renices and reschedules a process that belongs to another user, and install its polkit actions and D-Bus system service. Every action isauth_admin, so polkit asks for an administrator’s password through the session’s agent (see Security model).-D CMAKE_DISABLE_FIND_PACKAGE_libpcap=ON— No per-application network usage plugin. It captures packets with libpcap from a helper that needsCAP_NET_RAWas a file capability, which kpkg’s package tar does not carry, so the plugin could not start.-D CMAKE_REQUIRE_FIND_PACKAGE_UDev=ON— Make libudev, from eudev, a requirement. The process list’s GPU plugin finds the graphics cards through it; upstream looks for it quietly and leaves the plugin out without it.
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/libksysguard, 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 libksysguard-6.8.2-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/libksysguard, and runs the triggers its paths call for.
Contents
Installed programs: ksysguard-identify.
Installed libraries: libKSysGuardFormatter.so, libKSysGuardSensorFaces.so, libKSysGuardSensors.so, libKSysGuardSystemStats.so, libprocesscore.so.
Installed directories: /usr/include/ksysguard, /usr/lib/cmake/KSysGuard, /usr/lib/qt6/plugins/ksysguard, /usr/lib/qt6/qml/org/kde/ksysguard/faces, /usr/lib/qt6/qml/org/kde/ksysguard/formatter, /usr/lib/qt6/qml/org/kde/ksysguard/process, /usr/lib/qt6/qml/org/kde/ksysguard/sensors, /usr/share/ksysguard/sensorfaces/org.kde.ksysguard.barchart, /usr/share/ksysguard/sensorfaces/org.kde.ksysguard.colorgrid, /usr/share/ksysguard/sensorfaces/org.kde.ksysguard.facegrid, /usr/share/ksysguard/sensorfaces/org.kde.ksysguard.horizontalbars, /usr/share/ksysguard/sensorfaces/org.kde.ksysguard.linechart, /usr/share/ksysguard/sensorfaces/org.kde.ksysguard.piechart, /usr/share/ksysguard/sensorfaces/org.kde.ksysguard.textonly, /usr/share/licenses/libksysguard.
Notes
The configure requires libnl for socket information over sock_diag, lm-sensors for the hardware sensors, libdrm and zlib, with no switch for any of them. The faces are QML that imports org.kde.quickcharts, org.kde.kirigami, org.kde.kitemmodels, org.kde.kquickcontrols, org.kde.newstuff and Qt5Compat.GraphicalEffects at run time, so kquickcharts, kirigami, kitemmodels, kdeclarative, knewstuff and qt6-qt5compat are in depends; the build does not check for them.