269.6. akonadi-search-26.08.2
Xapian indexing and search for Akonadi: the indexing agent, the search plugin and the contacts runner
| Version | 26.08.2, release 1 |
| Shelf | pim — Personal information: calendars, contacts, tasks, time tracking, notes and genealogy |
| Phase | 43_toolkits (Toolkits), 219 of 344 in build order |
| Licence | (LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL) AND (GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL) AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later AND BSD-3-Clause AND CC0-1.0 AND MIT |
| Homepage | https://invent.kde.org/pim/akonadi-search |
| Build time | 1.7 SBU |
| Installed size | 3.3 MiB in 67 files |
| Recipe | ports/core/pim/akonadi-search/kpkgbuild |
About
akonadi-search is full-text search over the data in akonadi. The indexing agent, akonadi_indexing_agent, writes mail, contacts and calendars into xapian-core databases as they change; the search plugin answers the Akonadi server’s searches from them; the libraries let KMail, KAddressBook and Merkuro query them directly. It also carries a KRunner plugin that finds contacts from the search field, with its settings page, and the debug dialog akonadiconsole opens.
Sources
akonadi-search-26.08.2.tar.xz(122.7 KiB)
sha2567508de35606f31bd9cfa2804a3686f232e50721cf7ad206603bdfc2b8bc48dca
upstream: https://download.kde.org/stable/release-service/26.08.2/src/akonadi-search-26.08.2.tar.xz
archive copy: sources-3/pim--akonadi-search-26.08.2.tar.xzakonadi-search-vendor-26.08.2.tar.xz(4.0 MiB)
sha2564c9291ec99566e0c478cbc186568befcbab129dab68295efd34df4c5584530be
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-3/pim--akonadi-search-vendor-26.08.2.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, kconfig, kcoreaddons, kcompletion, ki18n, kcrash, kdbusaddons, kcmutils, kio, kwidgetsaddons, krunner, xapian-core, akonadi, akonadi-mime, kcontacts, kmime, kcalendarcore, kcodecs, ktextaddons, rust, corrosion.
Required by (6): akonadiconsole, kaddressbook, kmail, merkuro, messagelib, pimcommon.
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/43_toolkits/phase.env && kpkg install akonadi-search'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/pim/akonadi-search.
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/pim/akonadi-search
echo '7508de35606f31bd9cfa2804a3686f232e50721cf7ad206603bdfc2b8bc48dca akonadi-search-26.08.2.tar.xz' | sha256sum -c -
echo '4c9291ec99566e0c478cbc186568befcbab129dab68295efd34df4c5584530be akonadi-search-vendor-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/akonadi-search
SRC=$SRC_ROOT/akonadi-search-26.08.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf akonadi-search-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 recipe’s helpers vendordir and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
tar xf "$PORT_SRC/$name-vendor-$version.tar.xz" -C agent/rs/htmlparser
export CARGO_HOME="$SRC_ROOT/.cargo"
export RUSTFLAGS="-C target-feature=-crt-static"
export CARGO_NET_OFFLINE=true
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 AKONADISEARCH_ENABLE_KRUNNER_RUNNER=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Corrosion=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Mime=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-D AKONADISEARCH_ENABLE_KRUNNER_RUNNER=ON— Build the KRunner contacts plugin, which makes krunner a requirement of the configure. It is upstream’s default on Linux; passing it stops a change of default from dropping the plugin without notice.-D CMAKE_REQUIRE_FIND_PACKAGE_Corrosion=ON— Make corrosion a requirement. Upstream finds it quietly, and without itakonadi_html_to_text, which turns HTML mail into the text the indexer stores, falls back toQTextDocumentinstead of thehtml2textRust crate upstream calls the safe parser.-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Mime=ON— Take KMime from its Frameworks package. The configure asks forKF6Mimefirst and falls back to the PIM-eraKPim6Mime; required, the fallback can never be taken. kmime installsKF6Mime.CARGO_HOME="$SRC_ROOT/.cargo"— Keep cargo’s own registry and cache in the work directory, so the build writes nothing to the builder’s home and starts from the same empty state on every machine.RUSTFLAGS="-C target-feature=-crt-static"— Link the Rust code against musl dynamically. The musl target links statically unless told otherwise; see rust.CARGO_NET_OFFLINE=true— Keep cargo off the network, so a crate missing from the bundle fails the build by name instead of being fetched.-D KF_SKIP_PO_PROCESSING=ON— Builds none of the interface translations, which kpkg’s English-only rule would remove from the package anyway (see Size and language policy).
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/akonadi-search, 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 akonadi-search-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/akonadi-search, and runs the triggers its paths call for.
Contents
Installed programs: akonadi_html_to_text, akonadi_indexing_agent.
Installed libraries: libKPim6AkonadiSearchCore.so, libKPim6AkonadiSearchDebug.so, libKPim6AkonadiSearchPIM.so, libKPim6AkonadiSearchXapian.so.
Installed directories: /usr/include/KPim6/AkonadiSearch, /usr/lib/cmake/KPim6AkonadiSearch, /usr/share/licenses/akonadi-search.
Notes
The HTML parser is the htmlparser crate under agent/rs/htmlparser, a static library that Corrosion builds with rust and links into akonadi_html_to_text through cxx. Its 63 dependency crates come from the port’s vendor bundle, akonadi-search-vendor-<version>.tar.xz, made by ports/fetch from the crate’s Cargo.lock with vendordir = agent/rs/htmlparser; build.sh unpacks it into the same directory, where cargo finds the bundle’s .cargo/config.toml (see Where the bundle goes). A version bump means a new bundle, its own sha256 = line and ports/publish akonadi-search.
The KRunner plugin is loaded by KRunner and by the Plasma search field in the session; nothing in this port starts it. KF6TextUtils comes from ktextaddons.