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

306.9. gwenview-26.08.2

Image viewer and browser — RAW, annotation, slideshow and a camera importer

Version 26.08.2, release 1
Shelf graphics — Graphics applications: painting, vector, photo development and management, image viewers, screenshot and image optimisers
Phase 44_apps (Applications), 229 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://apps.kde.org/gwenview/
Build time 6.7 SBU
Installed size 5.7 MiB in 39 files
Recipe ports/core/graphics/gwenview/kpkgbuild

About

Gwenview is KDE’s image viewer and browser. It opens a single picture or a folder of them, with zoom, rotation, cropping and red-eye removal, slideshows, a side-by-side compare mode, raw camera files, annotation and an importer for cameras and memory cards. The port builds it on Qt 6 and the KDE Frameworks.

Sources

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtsvg, qt6-qtmultimedia, qt6-qtwayland, qt6-qtimageformats, wayland, wayland-protocols, kio, kitemmodels, ki18n, kparts, kwindowsystem, kiconthemes, knotifications, kguiaddons, kwidgetsaddons, kcrash, kdoctools, purpose, plasma-activities, baloo, libkdcraw, kimageannotator, kcolorpicker, kimageformats, libjpeg-turbo, libpng, libtiff, exiv2, lcms2, cfitsio, libX11.

Required by (1): kde-gear-core.

Patches

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

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 gwenview'

What kpkg does

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

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/graphics/gwenview
echo 'bc6eb96196daeb5879e3551b834e65e296409d2252804ee26fedcbb376826a72  gwenview-26.08.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/gwenview
SRC=$SRC_ROOT/gwenview-26.08.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf gwenview-26.08.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 five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/slidecontainer-reentrant-anim.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 GWENVIEW_SEMANTICINFO_BACKEND=Baloo \
	-D GWENVIEW_IMAGEANNOTATOR=ON \
	-D WITHOUT_X11=OFF \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Baloo=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KDcrawQt6=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_CFitsio=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_TIFF=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_X11=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Purpose=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_PlasmaActivities=ON \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

cat > "$PKG/usr/share/applications/org.kde.gwenview.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Gwenview
GenericName=Image Viewer
Comment=Browse and view images
TryExec=gwenview
Exec=gwenview %U
Icon=gwenview
Terminal=false
StartupWMClass=org.kde.gwenview
X-DocPath=gwenview/index.html
X-DBUS-ServiceName=org.kde.gwenview
MimeType=image/avif;image/gif;image/heif;image/jpeg;image/jxl;image/png;image/bmp;image/x-eps;image/x-icns;image/x-ico;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-xbitmap;image/x-xpixmap;image/tiff;image/x-psd;image/x-webp;image/webp;image/x-tga;image/x-xcf;image/openraster;image/svg+xml;image/svg+xml-compressed;application/x-krita;image/x-kde-raw;image/x-canon-cr2;image/x-canon-crw;image/x-kodak-dcr;image/x-adobe-dng;image/x-kodak-k25;image/x-kodak-kdc;image/x-minolta-mrw;image/x-nikon-nef;image/x-olympus-orf;image/x-pentax-pef;image/x-fuji-raf;image/x-panasonic-rw;image/x-sony-sr2;image/x-sony-srf;image/x-sigma-x3f;image/x-sony-arw;image/x-panasonic-rw2;
Categories=Qt;KDE;Graphics;Viewer;Photography;
Keywords=image;picture;photo;viewer;browser;slideshow;raw;gwenview;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.kde.gwenview.desktop"

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

Contents

Installed programs: gwenview, gwenview_importer.

Installed libraries: libgwenviewlib.so.

Installed directories: /usr/share/doc/HTML/en/gwenview, /usr/share/gwenview, /usr/share/licenses/gwenview.

Notes

kdoctools_install() builds the handbook in every translated language the tarball carries; the translated handbooks are removed by kpkg’s language rule, not by the recipe.

KAboutData gives Gwenview the desktop file name org.kde.gwenview, which is also its Wayland app_id. Upstream’s entry is replaced by one with StartupWMClass=org.kde.gwenview and without inode/directory in MimeType=: claimed by Gwenview, a folder could open in it instead of the file manager. The hicolor PNG icons it names are upstream’s.

slidecontainer-reentrant-anim.patch keeps the sliding bars, Crop, Red Eye Reduction and the others, from deleting their slide animation while it is updating: a bar whose content changes height mid-slide, as the Crop bar does when it is opened again after a crop, otherwise crashes Gwenview.