292.2. resources-1.10.2
System monitor for CPU, memory, GPU, NPU, disks, network, battery and processes (GTK 4)
| Version | 1.10.2, release 1 |
| Shelf | sysmon — Process, resource and system-information monitors |
| Phase | 44_apps (Applications), 385 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://apps.gnome.org/Resources/ |
| Build time | 9.1 SBU |
| Installed size | 8.0 MiB in 16 files |
| Recipe | ports/core/sysmon/resources/kpkgbuild |
About
Resources is a GNOME system monitor written in Rust on GTK 4 and libadwaita: it graphs CPU, memory, GPU, NPU, disks, network and battery, and lists and manages applications and processes. The desktop’s own monitor is Plasma System Monitor; this is the GTK one beside it. Its Rust crates come from a vendor bundle, and meson drives the cargo build.
Sources
resources-1.10.2.tar.gz(1.2 MiB)
sha256120aa520cf6b9cf957958c12a84b562db742114d41aeea59ad6b6caa63f34654
upstream: https://github.com/nokyan/resources/archive/refs/tags/v1.10.2.tar.gz
archive copy: sources-4/sysmon--resources-1.10.2.tar.gzresources-vendor-1.10.2.tar.xz(21.0 MiB)
sha25638e6ec544148447ebe5c37b47388832cb6616ea2bb6478798ca24a45f03f5d7b
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-4/sysmon--resources-vendor-1.10.2.tar.xz
Dependencies
Depends on: meson, ninja, pkgconf, rust, gettext, glib, gtk4, libadwaita, librsvg, polkit, dmidecode.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
fix_amd_npu_libc_type.patch— Insrc/utils/npu/amd.rs, the AMD NPU query, changes the return type of theioc()andiowr()helpers that build ioctl request numbers fromlibc::c_ulongtoi32. The Rustlibccrate declares musl’sioctl()with anintrequest, where glibc’s takes anunsigned long, so the code does not compile on musl without it.
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 resources'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/sysmon/resources.
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/sysmon/resources
echo '120aa520cf6b9cf957958c12a84b562db742114d41aeea59ad6b6caa63f34654 resources-1.10.2.tar.gz' | sha256sum -c -
echo '38e6ec544148447ebe5c37b47388832cb6616ea2bb6478798ca24a45f03f5d7b resources-vendor-1.10.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/resources
SRC=$SRC_ROOT/resources-1.10.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf resources-1.10.2.tar.gz -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 vendorsync and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/fix_amd_npu_libc_type.patch"
tar xf "$PORT_SRC/$name-vendor-$version.tar.xz"
export CARGO_NET_OFFLINE=true
export RUSTFLAGS="-C target-feature=-crt-static"
meson setup build --prefix=/usr --sysconfdir=/etc --libdir=lib \
--buildtype=release \
-Dprofile=default
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
for s in 48 64 128; do
install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
rsvg-convert -w $s -h $s data/icons/net.nokyan.Resources.svg \
-o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/net.nokyan.Resources.png"
done
cat > "$PKG/usr/share/applications/net.nokyan.Resources.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Resources (GNOME)
GenericName=System Monitor
Comment=Keep an eye on system resources
Exec=resources
Icon=net.nokyan.Resources
Terminal=false
StartupNotify=true
StartupWMClass=net.nokyan.Resources
Categories=GTK;System;Monitor;
Keywords=system;resources;monitor;processes;usage;task;manager;cpu;ram;memory;gpu;npu;performance;power;battery;
DESKTOP
chmod 644 "$PKG/usr/share/applications/net.nokyan.Resources.desktop"
The switches, and why each is set:
-Dprofile=default— the release profile. Upstream’s default,development, builds cargo in debug mode and gives the program the application idnet.nokyan.Resources.Devel;defaultpasses--releaseto cargo and keeps the plain idnet.nokyan.Resources, which the desktop entry and itsStartupWMClassname.
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/resources, 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 resources-1.10.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/resources, and runs the triggers its paths call for.
Contents
Installed programs: resources.
Installed directories: /usr/libexec/resources, /usr/share/licenses/resources, /usr/share/resources.
Notes
The vendor bundle, resources-vendor-<version>.tar.xz, is made by ports/fetch with cargo vendor (vendoring = rust, see vendoring) and checked against its sha256 = line like any source. meson builds the program with one cargo build of the top manifest. The process_data crate in lib/process_data, which the program depends on by path, has a lock file of its own, read by the cargo test target meson declares for it; vendorsync names that crate’s Cargo.toml, so cargo vendor --sync puts the crates of both lock files into the one bundle.
meson runs cargo with CARGO_HOME set inside the build tree, so cargo never reads a config.toml from a cargo home. It finds the bundle’s .cargo/config.toml instead by its upward search from the build directory, which is why build.sh unpacks the bundle at the top of the source tree. meson’s cargo build passes neither --offline nor --frozen, so build.sh exports CARGO_NET_OFFLINE=true to keep cargo off the network (see where the bundle goes).
Ending another user’s process and reading memory-module details through dmidecode run through pkexec, which polkit answers; polkit and dmidecode are both in depends. Upstream installs its icon as SVG only, so the recipe rasterises it to PNGs at 48, 64 and 128 pixels. meson installs upstream’s net.nokyan.Resources.desktop, and the recipe writes over it with an entry named Resources (GNOME), which tells it apart from Plasma System Monitor in the launcher.