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

257.61. ksvg-6.31.0

KDE Frameworks: themed SVG images and nine-part frames, cached, for Plasma and its widgets

6.31.0-1 · LGPL-2.0-or-later AND GPL-2.0-or-later AND CC0-1.0 · 3.0 SBU · 940.3 KiB, 34 files · 43_toolkits, 189 of 344 · ports/core/kf6/ksvg

Homepage: https://invent.kde.org/frameworks/ksvg

KSvg draws themed SVG artwork at any size. KSvg::Svg renders a named element of one SVG file (plain or gzip-compressed .svgz, read through karchive). A file with a <style id="current-color-scheme"> element has that stylesheet replaced, before it is rendered, by .ColorScheme-* rules holding the current colour scheme’s colours (kcolorscheme), so one image follows every accent. KSvg::FrameSvg assembles a resizable frame from nine elements (four corners, four edges and a centre), the shape every panel, tooltip, dialog background and button of a Plasma style is drawn from. KSvg::ImageSet finds each file in the active image set, a theme directory under a base path its caller chooses (plasma/desktoptheme/<name>/ under /usr/share for a Plasma style), and falls back to the set named default for anything the theme leaves out. The QML module org.kde.ksvg (SvgItem, FrameSvgItem) puts the same drawing in Qt Quick and takes its colours from Kirigami.Theme (kirigami).

libplasma builds the Plasma style, Plasma::Theme, on it, so the panel, every applet, the lock screen of kscreenlocker and the window decorations of aurorae draw through this library, and kwin, kclock and knights link it directly. KDOS’s Plasma style is a directory of SVGs this library renders; the library itself carries no artwork.

Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg, karchive, kconfig, kcolorscheme, kcoreaddons, kguiaddons, kirigami.

Required by (17): aurorae, bluedevil, fcitx5-configtool, kclock, kdeplasma-addons, knights, kscreen, kscreenlocker, kwin, libplasma, merkuro, milou, plasma-desktop, plasma-pa, plasma-sdk, plasma-welcome, plasma-workspace.

Sources: ksvg-6.31.0.tar.xz (85.2 KiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install ksvg'

build.sh:

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

Libraries: libKF6Svg.so.

Directories: /usr/include/KF6/KSvg, /usr/lib/cmake/KF6Svg, /usr/lib/qt6/qml/org/kde/ksvg, /usr/share/licenses/ksvg.

Rendering an SVG is slow, so KSvg keeps two caches per user. The pixmaps of an image set go into a shared-memory cache, ~/.cache/plasma_theme_<set>_v<version>.kcache (KImageCache from kguiaddons); the position and size of each element go into ~/.cache/ksvg-elements. Neither test looks at the content of a file. The pixmap cache is named after the Version in the image set’s metadata.json and is discarded when that file is newer than the cache; the element cache is keyed on each SVG’s modification time. Every file a package installs carries the tree’s pinned SOURCE_DATE_EPOCH as its modification time (see Reproducible packages), so an update that changes a style’s SVGs changes none of those times. A user who ran the old style keeps seeing its pixmaps until the Version changes, which renames the cache and deletes the old one at the next start. A style shipped by a port raises Version in its metadata.json with every change to its images.

BUILD_TOOLS stays at its default, off. It builds split-plasma-svgs, a theme author’s tool that cuts a combined SVG into one file per element, and installs nothing a session uses. The API documentation is built only by its own prepare_docs and generate_docs targets, which need Qt’s qdoc, and the recipe builds neither.