306.12. digikam-9.1.0
digiKam and showFoto: photo library, tagging, face recognition, RAW import and editing, for Qt 6
| Version | 9.1.0, release 2 |
| Shelf | graphics — Graphics applications: painting, vector, photo development and management, image viewers, screenshot and image optimisers |
| Phase | 44_apps (Applications), 232 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://www.digikam.org/ |
| Build time | 52.6 SBU |
| Installed size | 137.2 MiB in 1934 files |
| Recipe | ports/core/graphics/digikam/kpkgbuild |
About
digiKam is KDE’s photo library: albums, tags, ratings, face detection and recognition, camera and scanner import, RAW development and a full image editor. The same build produces showFoto, the editor on its own for single files. Both are built against Qt 6 and KDE Frameworks 6, and the collection lives in SQLite.
Sources
digikam-9.1.0.tar.xz(70.3 MiB)
sha256a7309191e9a4787853cb3ac4136e4f8d7c044b40338dc42c7e422c37625b72e1
upstream: https://download.kde.org/stable/digikam/9.1.0/digiKam-9.1.0.tar.xz
archive copy: sources-2/graphics--digikam-9.1.0.tar.xzface_detection_yunet_2023mar.onnx(227.1 KiB)
sha2568f2383e4dd3cfbb4553ea8718107fc0423210dc964f9f4280604804ed2552fa4
upstream: https://files.kde.org/digikam/facesengine/yunet/face_detection_yunet_2023mar.onnx
archive copy: sources-2/graphics--face_detection_yunet_2023mar.onnxface_recognition_sface_2021dec.onnx(36.9 MiB)
sha2560ba9fbfa01b5270c96627c4ef784da859931e02f04419c829e83484087c34e79
upstream: https://files.kde.org/digikam/facesengine/dnnface/face_recognition_sface_2021dec.onnx
archive copy: sources-2/graphics--face_recognition_sface_2021dec.onnxdnntestimage.jpeg(51.7 KiB)
sha256158c039c7ae795340eea959bedde4a5d263a8add9e5bebca10b4a45bb7073a2b
upstream: https://files.kde.org/digikam/facesengine/dnntestimage.jpeg
archive copy: sources-2/graphics--dnntestimage.jpeg
Dependencies
Depends on: cmake, ninja, pkgconf, gettext, extra-cmake-modules, qt6-qtbase, qt6-qtsvg, qt6-qtnetworkauth, qt6-qtscxml, qt6-qtmultimedia, qt6-qtwebengine, kxmlgui, kcoreaddons, kconfig, kservice, kwindowsystem, solid, ki18n, kio, kiconthemes, threadweaver, knotifyconfig, knotifications, sonnet, kcalendarcore, libksane, opencv, exiv2, expat, libjpeg-turbo, lcms2, libpng, libtiff, zlib, boost, eigen, libheif, libjxl, jasper, x265, flex, bison, libxml2, libxslt, imagemagick, ffmpeg, lensfun, libgphoto2, glib, libX11, libXv, mesa, libglvnd, hicolor-icon-theme.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
ai-tools-default-off.patch— Make the AI auto-tools, aesthetic detection and auto-tagging default to off insystemsettings.cpp. Left on, every start offers to download their models from files.kde.org; they can still be switched on in the settings, which then asks for the models.no-online-export.patch— Drop the export plugins whose only function is uploading to an online service (Box, Dropbox, Flickr, Google, Imgur, ImageShack, iNaturalist, MediaWiki, OneDrive, Pinterest, Piwigo, SmugMug, Twitter) fromwebservices/CMakeLists.txt. No build option switches them off. Export to a local folder and through KIO stay.
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 digikam'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/graphics/digikam.
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/digikam
echo 'a7309191e9a4787853cb3ac4136e4f8d7c044b40338dc42c7e422c37625b72e1 digikam-9.1.0.tar.xz' | sha256sum -c -
echo '8f2383e4dd3cfbb4553ea8718107fc0423210dc964f9f4280604804ed2552fa4 face_detection_yunet_2023mar.onnx' | sha256sum -c -
echo '0ba9fbfa01b5270c96627c4ef784da859931e02f04419c829e83484087c34e79 face_recognition_sface_2021dec.onnx' | sha256sum -c -
echo '158c039c7ae795340eea959bedde4a5d263a8add9e5bebca10b4a45bb7073a2b dnntestimage.jpeg' | 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/digikam
SRC=$SRC_ROOT/digikam-9.1.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf digikam-9.1.0.tar.xz -C "$SRC" --strip-components=1
cp face_detection_yunet_2023mar.onnx "$SRC"
cp face_recognition_sface_2021dec.onnx "$SRC"
cp dnntestimage.jpeg "$SRC"
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 _models and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/ai-tools-default-off.patch"
patch -p1 -i "$PORT_SRC/no-online-export.patch"
cmake -S . -B build -G Ninja \
-D CMAKE_C_STANDARD=99 \
-D CMAKE_C_EXTENSIONS=ON \
-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 BUILD_WITH_QT6=ON \
-D DIGIKAMSC_COMPILE_PO=OFF \
-D DIGIKAMSC_COMPILE_DIGIKAM=ON \
-D KF_SKIP_PO_PROCESSING=ON \
-D ENABLE_MYSQLSUPPORT=OFF \
-D ENABLE_INTERNALMYSQL=OFF \
-D ENABLE_KFILEMETADATASUPPORT=OFF \
-D ENABLE_AKONADICONTACTSUPPORT=OFF \
-D ENABLE_GEOLOCATION=ON \
-D ENABLE_MEDIAPLAYER=ON \
-D ENABLE_DBUS=ON \
-D ENABLE_KIO=ON \
-D ENABLE_APPSTYLES=OFF \
-D ENABLE_SHOWFOTO=ON \
-D ENABLE_DIGIKAM_MODELTEST=OFF \
-D ENABLE_SANITIZERS=OFF \
-D BUILD_WITH_CCACHE=OFF \
-D CMAKE_REQUIRE_FIND_PACKAGE_Jasper=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_X11=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_LensFun=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Gphoto2=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Eigen3=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_ImageMagick=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_GLIB2=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Libheif=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_X265=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Libjxl=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_FLEX=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_BISON=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_LibXml2=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_LibXslt=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KSaneWidgets6=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6KIO=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6IconThemes=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6ThreadWeaver=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6NotifyConfig=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Notifications=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Sonnet=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6CalendarCore=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6Multimedia=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6MultimediaWidgets=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
install -d "$PKG/usr/share/digikam/facesengine"
install -m644 face_detection_yunet_2023mar.onnx face_recognition_sface_2021dec.onnx \
dnntestimage.jpeg "$PKG/usr/share/digikam/facesengine/"
cat > "$PKG/usr/share/applications/org.kde.digikam.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=digiKam
GenericName=Photo Library
Comment=Organise, tag, search and edit a photo collection
Exec=digikam
Icon=digikam
Terminal=false
StartupWMClass=org.kde.digikam
Categories=Qt;KDE;Graphics;Photography;
Keywords=photo;library;album;tag;face;raw;camera;import;digikam;
EOF
cat > "$PKG/usr/share/applications/org.kde.showfoto.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=showFoto
GenericName=Photo Editor
Comment=View and edit single photos with digiKam's tools
Exec=showfoto %U
Icon=showfoto
Terminal=false
StartupWMClass=org.kde.showfoto
Categories=Qt;KDE;Graphics;Photography;
Keywords=photo;editor;viewer;raw;showfoto;
EOF
chmod 644 "$PKG/usr/share/applications/org.kde.digikam.desktop" \
"$PKG/usr/share/applications/org.kde.showfoto.desktop"
The switches, and why each is set:
-D CMAKE_C_STANDARD=99— KDE’s compiler settings compile C as strict ISO C99 unless a standard is named. The panorama tool’s flex and bison parser callsfilenoandstrdup, which strict ISO mode does not declare.-D CMAKE_C_EXTENSIONS=ON— Together with the line above, this makes the C standard GNU C99 (-std=gnu99), which declares both functions.-D BUILD_WITH_QT6=ON— Build against Qt 6 and KF6. Without it the project looks for Qt 5.-D DIGIKAMSC_COMPILE_PO=OFF— Build no translation catalogues;KF_SKIP_PO_PROCESSING=ONdoes the same for the parts that go through KDE’s own catalogue rules. The program shows its English source strings.-D ENABLE_MYSQLSUPPORT=OFF— No MySQL database back end. It needs Qt’s MySQL driver, which qt6-qtbase is built without (-DFEATURE_sql_mysql=OFF), so the collection is SQLite.-D ENABLE_INTERNALMYSQL=OFF— No bundled MySQL server: it needs amysqld, and no port provides one.-D ENABLE_KFILEMETADATASUPPORT=OFF— No link to KFileMetaData for Plasma’s file indexer. This is upstream’s default.-D ENABLE_AKONADICONTACTSUPPORT=OFF— No address-book lookups through Akonadi, which is not a port. This is upstream’s default.-D ENABLE_GEOLOCATION=ON— The map view and the geolocation editor, through the bundled map engine. Its world maps are in the source tarball and draw offline; OpenStreetMap tiles need the network.-D ENABLE_MEDIAPLAYER=ON— The video player in the preview, through Qt Multimedia over ffmpeg.-D ENABLE_SHOWFOTO=ON— Build showFoto beside digiKam. This and the remainingENABLE_switches (ENABLE_DBUS,ENABLE_KIOon;ENABLE_APPSTYLES,ENABLE_DIGIKAM_MODELTEST,ENABLE_SANITIZERSoff) are upstream’s defaults, written out.-D CMAKE_REQUIRE_FIND_PACKAGE_Jasper=ON— Every library behind an optional feature is a quiet find in digiKam’s CMake, and a missing one builds a digiKam without that tool. EachCMAKE_REQUIRE_FIND_PACKAGE_<name>=ONturns that find into an error instead, so the package always has the full feature set: Jasper for JPEG 2000, X11 for the monitor colour profile under Xwayland, KIO, IconThemes, Notifications, NotifyConfig and Sonnet for desktop integration and spell-checking, ThreadWeaver and FLEX/BISON for the panorama tool, CalendarCore for the calendar tool, Qt Multimedia for the video player, LensFun for lens correction, Gphoto2 for camera import, Eigen3 for the refocus tool, ImageMagick for extra codecs, GLIB2 for the content-aware resizer, Libheif and X265 for HEIF, Libjxl for JPEG XL, LibXml2 and LibXslt for the HTML gallery, and KSaneWidgets6 for scanner import. Each of those libraries is independs.
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/digikam, 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 digikam-9.1.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/digikam, and runs the triggers its paths call for.
Contents
Installed programs: cleanup_digikamdb, digikam, digitaglinktree, showfoto.
Installed libraries: libdigikamcore.so, libdigikamdatabase.so, libdigikamgui.so.
Installed directories: /usr/include/digikam, /usr/lib/cmake/DigikamCore, /usr/lib/cmake/DigikamDatabase, /usr/lib/cmake/DigikamGui, /usr/lib/cmake/DigikamPlugin, /usr/lib/qt6/plugins/digikam, /usr/share/digikam, /usr/share/kxmlgui5/digikam, /usr/share/kxmlgui5/showfoto, /usr/share/licenses/digikam, /usr/share/showfoto.
Short descriptions
cleanup_digikamdb |
Cleanup the digiKam databases to reduce their sizes and increase access speed |
digitaglinktree |
Export tag structure of photos in digikam to the filesystem. |
Notes
The face engine looks for its models under digikam/facesengine in the XDG data directories before it offers to download them. The three later sources are those files, installed into /usr/share/digikam/facesengine, so face detection and recognition work on first start with no network. Their names and sizes must be the ones core/data/dnnmodels/dnnmodels.conf lists: a file that differs counts as missing.
build.sh writes both desktop entries over upstream’s, with StartupWMClass set to the Wayland app ids KAboutData gives the programs, org.kde.digikam and org.kde.showfoto. showFoto’s entry carries no MimeType: the image types already have a handler, and a second claim would make the default whichever entry sorts first.