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

306.16. gthumb-4.0

gThumb: browse, view, tag and edit photos and videos, for GTK 4 and libadwaita

Version 4.0, release 2
Shelf graphics — Graphics applications: painting, vector, photo development and management, image viewers, screenshot and image optimisers
Phase 44_apps (Applications), 236 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://gitlab.gnome.org/GNOME/gthumb
Build time 10.8 SBU
Installed size 4.1 MiB in 18 files
Recipe ports/core/graphics/gthumb/kpkgbuild

About

gThumb is GNOME’s photo and video browser: a thumbnail browser, a viewer, catalogues and tags, import from removable devices and folders, and simple editing. It is built for GTK 4 and libadwaita.

Sources

Dependencies

Depends on: meson, ninja, pkgconf, vala, gettext, glib, gtk4, libadwaita, libportal, libpng, libjpeg-turbo, zlib, lcms2, exiv2, libwebp, librsvg, libheif, libjxl, libtiff, giflib, libraw, gstreamer, gst-plugins-base, gst-plugins-good, gst-libav, hicolor-icon-theme.

Required by: no port names 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 gthumb'

What kpkg does

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

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/gthumb
echo 'a24aaa72b5637f49097dedc9c141a33615da770d029315f3285ebf2156cf7b61  gthumb-4.0.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/gthumb
SRC=$SRC_ROOT/gthumb-4.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf gthumb-4.0.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:

export CFLAGS="$CFLAGS -std=gnu23"
meson setup build --prefix=/usr --sysconfdir=/etc --libdir=lib \
	--buildtype=release \
	-Ddeveloper-mode=false \
	-Dflatpak-build=false \
	-Dcolord=false \
	-Dlibwebp=true \
	-Dlibrsvg=true \
	-Dlibheif=true \
	-Dlibjxl=true \
	-Dlibtiff=true \
	-Dlibgif=true \
	-Dlibraw=true
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

for s in 48 64 128 256; do
	install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
	rsvg-convert -w $s -h $s -o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/org.gnome.gthumb.png" \
		data/icons/org.gnome.gthumb.svg
done

cat > "$PKG/usr/share/applications/org.gnome.gthumb.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=gThumb
GenericName=Photo Browser
Comment=Browse, view, tag and edit photos and videos
Exec=gthumb %U
Icon=org.gnome.gthumb
Terminal=false
StartupNotify=true
StartupWMClass=org.gnome.gthumb
Categories=GTK;Graphics;Viewer;RasterGraphics;2DGraphics;Photography;
Keywords=image;photo;viewer;browser;thumbnail;catalog;gthumb;
Actions=new-window;

[Desktop Action new-window]
Name=New Window
Exec=gthumb --new-window
EOF
chmod 644 "$PKG/usr/share/applications/org.gnome.gthumb.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/gthumb, 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 gthumb-4.0-2.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/gthumb, and runs the triggers its paths call for.

Contents

Installed programs: gthumb.

Installed directories: /usr/libexec/gthumb, /usr/share/licenses/gthumb.

Short descriptions

gthumb an image viewer and browser

Notes

GStreamer is a quiet probe as well, with no option: without gstreamer and its plug-in ports, videos show only as file icons.

Upstream installs only an SVG application icon. The loop after the install rasterises it with rsvg-convert into hicolor PNGs at four sizes (see Desktop entries belong to the port).

The desktop entry is written over upstream’s. StartupWMClass is the GApplication id, which is the Wayland app id. The entry carries no MimeType: the image types already have a handler, and a second claim would make the default whichever entry sorts first.