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

358.4. kdos-discover-0.1.0

Discover backend for packs, boxes and ports, and the A/B update tray notifier

Version 0.1.0, release 1
Source tree src/desktop/kdos-discover/
Phase 50_desktop (Desktop), 57 of 92 in build order
Licence MIT
Homepage https://github.com/kunaldawn/kdos
Build time 0.6 SBU
Installed size 1.2 MiB in 12 files
Recipe src/desktop/kdos-discover/kpkgbuild

About

kdos-discover is what makes Discover KDOS’s software centre. It installs five things:

It also points Discover’s featured list at /usr/share/kdos/discover/featured.json, ships /usr/share/kdos/discover/debian-exclude, the Debian packages the backend never offers to build in a box, and defines the MIME types application/vnd.kdos.ktar and application/vnd.kdos.kpack with a hidden desktop entry that opens both in Discover. How Discover, the backend and the system update fit together is in Discover.

Why it is in KDOS

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

Discover's backend for packs, boxes and ports, and the A/B update notifier.

Sources

None: the port builds from its own directory, /kdos/src/desktop/kdos-discover.

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, kcoreaddons, kconfig, ki18n, karchive, kservice, kio, kjobwidgets, appstream, debian-dep11, qcoro, discover, polkit, kdos-appbox, kdos-pack, kdos-tools.

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

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 kdos-discover'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /kdos/src/desktop/kdos-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.

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/kdos-discover
SRC=$SRC_ROOT/kdos-discover-0.1.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"

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:

LIBS="$PORT_SRC/../../libs"

cmake -S "$PORT_SRC" -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

gcc $CFLAGS -O2 -std=gnu11 -D_GNU_SOURCE -Wall -Wextra \
	-I"$LIBS/libkbase" \
	-o kdos-ports-helper "$PORT_SRC"/helper/kdos-ports-helper.c "$LIBS"/libkbase/*.c $LDFLAGS
gcc $CFLAGS -O2 -std=gnu11 -D_GNU_SOURCE -Wall -Wextra -DKPH_BUILD \
	-I"$LIBS/libkbase" \
	-o kdos-ports-builder "$PORT_SRC"/helper/kdos-ports-helper.c "$LIBS"/libkbase/*.c $LDFLAGS
install -Dm755 kdos-ports-helper "$PKG/usr/libexec/kdos-discover/kdos-ports-helper"
install -Dm755 kdos-ports-builder "$PKG/usr/libexec/kdos-discover/kdos-ports-builder"
install -Dm644 "$PORT_SRC"/helper/io.kdos.ports.policy "$PKG/usr/share/polkit-1/actions/io.kdos.ports.policy"

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

Other files in the port directory, read by build.sh: CMakeLists.txt, backend/, catalog/, data/, helper/, model/, notifier/, tests/.

Contents

Installed programs: kdos-discover-catalog.

Installed directories: /usr/lib/qt6/plugins/discover-notifier, /usr/libexec/kdos-discover, /usr/share/discover, /usr/share/kdos/discover.

Notes