Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

354.23. discover-6.8.2

Software centre — system updates over the A/B slots and firmware updates through fwupd

Version 6.8.2, release 1
Shelf kde — KDE Plasma and Gear platform pieces outside Frameworks that have no other domain: KIO workers, thumbnailers, Plasma integration, KDE Wayland glue
Phase 50_desktop (Desktop), 46 of 92 in build order
Licence (GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL) AND LGPL-2.0-or-later AND (LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL) AND LGPL-3.0-or-later AND GPL-2.0-or-later
Homepage https://invent.kde.org/plasma/discover
Build time 0.4 SBU
Installed size 3.2 MiB in 78 files
Recipe ports/core/kde/discover/kpkgbuild

About

Discover is Plasma’s software centre. This port builds Discover itself with two of upstream’s backends:

Applications, packs, boxes and host software come from a third backend that is not upstream’s: kdos-backend.so, installed by kdos-discover, which also adds the KDOS update notifier plugin. This port also carries the Software Update page of System Settings and the tray notifier that announces pending updates. There is no third-party store: no Flatpak, no Snap, no PackageKit and no KNewStuff add-ons (see Offline by construction). What each page shows on a running system is in Discover.

Why it is in KDOS

The comment above it in script/phases/50_desktop/packages.txt:

The software centre: system updates over the A/B slots and firmware through fwupd.

Sources

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, pkgconf, qt6-qtbase, qt6-qtdeclarative, kirigami, kirigami-addons, kitemmodels, kcoreaddons, kconfig, kcrash, kdbusaddons, ki18n, karchive, kxmlgui, kio, kcmutils, kidletime, knotifications, purpose, kstatusnotifieritem, kiconthemes, appstream, qcoro, fwupd.

Required by (2): kde-plasma, kdos-discover.

Patches

build.sh applies these; kpkg applies nothing by itself.

odrs-offline.patch adds [Software] FetchOdrsRatings to discoverrc, read by the ratings backend before it downloads anything; upstream fetches every application’s ratings from odrs.gnome.org at each start whose cached copy is a day old, for the Home page’s “Most Popular” list. /usr/share/kdos/xdg/discoverrc sets it false. The key defaults to true, so the patch changes nothing where it is unset, and it is to be proposed upstream in that form.

sysupdate-errors.patch makes the system-update backend read the error replies of org.freedesktop.sysupdate1. Upstream reads GetVersion and CheckNew straight into a string, and an error reply converts to its own message, so a refused check (kdos-sysupdated’s Interactive authentication required) is listed as an update to a version of that name. With the patch an error reply is a passive message and the target gets no resource, and a failed ListTargets ends the fetch it began. The patch also sets “restart to finish” only when the Install job ends with status 0, so a refused or failed Acquire leaves nothing pending; and it asks the size service upstream expects at http://localhost:3129 once per update, leaving the size empty when nothing answers there, which on KDOS is always, so an update with no size of its own shows no size row instead of a busy indicator that never stops. It is to be offered upstream.

sysupdate-size.patch makes the system-update backend take an update’s size from the AppStream file the target names: the download size of an artifact of the release whose version is the one offered. sysupdate1 has no size query, so upstream asks only the size service above; kdos-sysupdated writes that artifact from the update document, and the Updates list shows the size and its total instead of “Unknown”. It applies after sysupdate-errors.patch and is to be offered upstream.

update-failed-stays-listed.patch reports a transaction that ended with an error to the Updates page as not started, as a cancelled one is, instead of done. The page hides rows whose state is done, and keeps its rows when the list of offered updates is unchanged, which it is after a refused or failed update; without the patch the page lists nothing, with Update All still enabled, until Refresh. It is to be offered upstream.

sysupdate-appstream-after-check.patch makes the system-update backend ask a target’s GetVersion and CheckNew before it fetches the target’s AppStream, and fetch the AppStream only for a target that offers a version. kdos-sysupdated regenerates the AppStream from the update document, which the check behind CheckNew rewrites, so a copy read before the check describes the previous one; upstream’s order shows the first session that finds a release with its size “Unknown” until Refresh, because sysupdate-size.patch finds no release of the offered version. It applies after update-failed-stays-listed.patch and is to be offered upstream.

notifier-reboot-clears.patch makes the tray notifier ask every backend notifier’s needsReboot() at each needsRebootChanged and report the change both ways, and makes the tray item set its title, tooltip, icon and the “Install Updates and Restart…” and “Install Updates and Shut Down…” entries from the answer each time. The notifier keeps its persistent “Restart is required” notification, and closes it when the restart is withdrawn and before it posts another. A restart withdrawn while updates are still offered shows the tray item again at once. Upstream hides an item of ordinary updates until requiredNotificationInterval has passed since the last notification, which would keep the update the disarmed slot held out of the tray for up to a day, the interval /usr/share/kdos/xdg/PlasmaDiscoverUpdates sets.

The patch also has the system-update backend read io.kdos.Slots1’s State, on the bus it reaches sysupdate1 on, when it starts, and follow it after. When rebootRequired is true and the armed slot’s version (State’s version while its phase is armed) is newer, by AppStream’s vercmpSimple, than the version the target’s GetVersion answered (less the (slot A) that answer carries), the backend sets the updater’s restart. An update applied from a terminal then puts the restart prompt on the Updates page instead of “Up to date”. A slot armed at the running or an older version is a switch between versions and sets none. A State that arrives before the first fetch has read GetVersion is taken again when the fetch ends. When rebootRequired goes false, the backend clears the restart and lists the targets again, so an open Updates page drops “Restart and Install Updates” and offers the update again.

Without the patch, upstream latches the first announcement for the session in the notifier, and learns of a restart only from the backend’s own Install, which it keeps for the life of the process. After “Keep” on the System Versions page disarms a trial slot, the tray (through kdos-discover’s notifier plugin), the notification and the open window would then keep asking for a restart that boots the slot already running. The notifier half is to be offered upstream; the backend half names a KDOS interface and stays KDOS’s.

sysupdate-licenses.patch makes the system-update resource’s licenses() return AppStreamUtils::licenses() of its component, the license objects (name, URL, whether it is free) the application page’s Licenses field reads. Upstream returns the project and metadata licences as bare SPDX strings, which the page reads as nothing, so More Info on the KDOS update shows “Licenses:” with nothing after it although kdos-sysupdated’s AppStream file carries MIT. It is to be offered upstream.

notifyrc-update-restart.patch makes the tray notifier’s “Restart is required” notification, posted when an installed update needs a restart, find its configuration and go out once. Upstream builds it with the static KNotification::event(), which queues a sendEvent() of its own, and then calls sendEvent() itself, so org.freedesktop.Notifications receives two Notify calls for every restart; it posts the UpdateRestart event with KNotification::DefaultEvent, which makes KNotification look it up in the default component, plasma_workspace, whose notifyrc declares no such event, rather than in the discoverabstractnotifier component the call names; and that component’s notifyrc spells the group [Event/UpdateResart]. The patch constructs the KNotification with its title, text and icon and the discoverabstractnotifier component, without DefaultEvent, so the one sendEvent() posts it, and renames the group [Event/UpdateRestart]; KNotification shows nothing for an event its component does not declare, so the notification appears only with both halves. It applies after notifier-reboot-clears.patch and is to be offered upstream.

notifier-restart-labels.patch labels the two buttons of that notification “Restart” and “Shut Down” where upstream reads “Update and Restart” and “Update and Shut Down”. They open the logout prompt’s restart and shut-down pages and start nothing else, and KDOS has staged the update in the other slot before the notification is posted. It applies after notifyrc-update-restart.patch and is to be offered upstream.

ratings-need-reviews.patch shows the application page’s rating row and its Reviews section, with “Write a Review”, only when the resource’s backend has a reviews backend, and leaves the Home page’s “Highest-Rated Games” and “Highest-Rated Developer Tools” rows empty when the current application backend has none. Neither KDOS backend has one, so on KDOS no page offers a rating or a review it has nowhere to send, and no row is ranked by ratings nobody gave. It is to be offered upstream.

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/50_desktop/phase.env && kpkg install discover'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/kde/discover.

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/discover
echo '2bc7280155adb003498a3b31817be8815673cc665b424b98b8250cc97dff5bc6  discover-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/discover
SRC=$SRC_ROOT/discover-6.8.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf discover-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/odrs-offline.patch"
patch -p1 -i "$PORT_SRC/sysupdate-errors.patch"
patch -p1 -i "$PORT_SRC/ratings-need-reviews.patch"
patch -p1 -i "$PORT_SRC/sysupdate-size.patch"
patch -p1 -i "$PORT_SRC/update-failed-stays-listed.patch"
patch -p1 -i "$PORT_SRC/sysupdate-appstream-after-check.patch"
patch -p1 -i "$PORT_SRC/notifier-reboot-clears.patch"
patch -p1 -i "$PORT_SRC/sysupdate-licenses.patch"
patch -p1 -i "$PORT_SRC/notifyrc-update-restart.patch"
patch -p1 -i "$PORT_SRC/notifier-restart-labels.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 \
	-D BUILD_SystemdSysupdateBackend=ON \
	-D BUILD_FwupdBackend=ON \
	-D BUILD_FlatpakBackend=OFF \
	-D BUILD_SnapBackend=OFF \
	-D BUILD_PackageKitBackend=OFF \
	-D BUILD_RpmOstreeBackend=OFF \
	-D BUILD_HoloBackend=OFF \
	-D BUILD_DummyBackend=OFF \
	-D BUILD_AlpineApkBackend=OFF \
	-D BUILD_AppStreamPreviewBackend=OFF \
	-D CMAKE_DISABLE_FIND_PACKAGE_KF6NewStuff=ON \
	-D CMAKE_DISABLE_FIND_PACKAGE_KF6UserFeedback=ON \
	-D CMAKE_DISABLE_FIND_PACKAGE_Qt6WebView=ON \
	-D WITH_KCM=ON \
	-D WITH_NOTIFIER=ON \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
cd libdiscover
find . \( -path ./backends -o -path ./tests \) -prune -o -name '*.h' -print | while read -r h; do
	install -Dm644 "$h" "$PKG/usr/include/discover/$h"
done
cd ..
install -Dm644 -t "$PKG/usr/include/discover" build/DiscoverConfig.h \
	build/libdiscover/discovercommon_export.h \
	build/libdiscover/notifiers/discovernotifiers_export.h

rm "$PKG/usr/share/applications/org.kde.discover.snap.desktop" \
	"$PKG/usr/share/applications/org.kde.discover.appstreampreview.desktop"

test "$(ls "$PKG/usr/lib/qt6/plugins/discover")" = "$(printf '%s\n' fwupd-backend.so systemdsysupdate-backend.so)"

The switches, and why each is set:

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/discover, 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 discover-6.8.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/discover, and runs the triggers its paths call for.

Contents

Installed programs: plasma-discover.

Installed directories: /usr/include/discover, /usr/lib/plasma-discover, /usr/share/kxmlgui5/plasmadiscover, /usr/share/licenses/discover.

Notes

The last line of build.sh fails the build unless /usr/lib/qt6/plugins/discover/ holds exactly fwupd-backend.so and systemdsysupdate-backend.so. A backend that appears or goes missing there is a change to what Discover offers, so it stops the build instead of shipping.

build.sh removes two hidden desktop entries upstream installs whatever backends are built: org.kde.discover.snap.desktop, which claims snap: links, and org.kde.discover.appstreampreview.desktop, which claims loose AppStream files. With neither backend built, each would open a Discover window with nothing in it, and claim a type for a program that cannot handle it (see Desktop entries belong to the port).

The firmware backend refreshes the metadata of every enabled remote that is neither local nor a directory each time Discover starts (FwupdBackend::setRemotes). fwupd installs its LVFS remote switched off and lists firmware from the kdos-snapshot local remote, so starting Discover downloads nothing; once fwupdmgr enable-remote lvfs turns the LVFS on, every start of Discover downloads its metadata.

Three of Discover’s own paths reach the network whatever backends are loaded. The ratings fetch is turned off by odrs-offline.patch. The featured list is read from the URL in /usr/share/discover/featuredurlrc, which kdos-discover installs pointing at a local file, instead of autoconfig.kde.org. The firmware backend’s refresh is the paragraph above.

libdiscover is private to Discover and installs no header, so build.sh copies its headers, and the three the build generates (DiscoverConfig.h with the plugin IIDs, and the two export headers), to /usr/include/discover. kdos-discover builds its backend and its notifier plugin against them. The IIDs embed the full version (org.kde.discover.6.8.2.…), and Discover’s loader skips a plugin whose IID differs, so every discover version bump, point releases included, rebuilds kdos-discover and changes its KDOS_DISCOVER_VERSION. Upstream keeps libdiscover private on purpose, so the header installation stays KDOS’s.

The system-update backend only pings org.freedesktop.sysupdate1 to decide whether it is usable, so it finds KDOS’s own kdos-sysupdated, which owns that name on the system bus, with no patch. Discover’s packaging-library plugins are versioned by the exact Plasma release (DISCOVER_PLUGIN_IID), so a backend built against another Discover release is not loaded.

The configure also finds the libmarkdown pkg-config module when discount is installed; only the PackageKit backend uses it, so its presence changes nothing that is built.

kirigami, kirigami-addons, kitemmodels and purpose are QML modules Discover loads at run time; the configure checks only for org.kde.kitemmodels.