296.2. keepassxc-2.7.12
Password manager — KeePass databases, TOTP, SSH agent, browser integration and the Secret Service
| Version | 2.7.12, release 1 |
| Shelf | security — Security applications: GnuPG and front-ends, password and secret managers, certificates, scanners, forensics and audit |
| Phase | 44_apps (Applications), 360 of 422 in build order |
| Licence | GPL-2.0-only OR GPL-3.0-only |
| Homepage | https://keepassxc.org/ |
| Build time | 16.3 SBU |
| Installed size | 27.2 MiB in 37 files |
| Recipe | ports/core/security/keepassxc/kpkgbuild |
About
KeePassXC is a password manager for KeePass (.kdbx) databases. Besides passwords it keeps one-time-password (TOTP) secrets, can hold SSH keys for a running SSH agent, fills logins into a browser through the keepassxc-browser extension, and can serve its database as the desktop’s Secret Service, the D-Bus API through which other programs store their own passwords. It is a Qt 5 program. It also ships keepassxc-cli and keepassxc-proxy, the browser extension’s native-messaging helper.
Sources
keepassxc-2.7.12.tar.xz(10.1 MiB)
sha256be34eeb297881adea4f894c7c6e4a1835bd7927f8043ddea495040df4792a7de
upstream: https://github.com/keepassxreboot/keepassxc/releases/download/2.7.12/keepassxc-2.7.12-src.tar.xz
archive copy: sources-4/security--keepassxc-2.7.12.tar.xz
Dependencies
Depends on: cmake, ninja, qt5-qtbase, qt5-qtsvg, qt5-qttools, qt5-qtx11extras, qt5-qtwayland, libX11, libXi, libXtst, botan, argon2, zlib, minizip, qrencode, readline, pcsc-lite, libusb, asciidoctor.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
app-id.patch— Inshare/linux/org.keepassxc.KeePassXC.desktop.in, the template of the installed desktop entry, changesStartupWMClass=keepassxctoStartupWMClass=org.keepassxc.KeePassXC. KeePassXC sets its desktop file name toorg.keepassxc.KeePassXC.desktop, which Qt’s Wayland plugin turns into the app idorg.keepassxc.KeePassXC; with the patch the entry’s file name and itsStartupWMClassboth name that id, so the panel matches the window to the entry (seekdos appid).
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 keepassxc'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/security/keepassxc.
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/security/keepassxc
echo 'be34eeb297881adea4f894c7c6e4a1835bd7927f8043ddea495040df4792a7de keepassxc-2.7.12.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/keepassxc
SRC=$SRC_ROOT/keepassxc-2.7.12
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf keepassxc-2.7.12.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/app-id.patch"
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D KEEPASSXC_BUILD_TYPE=Release \
-D WITH_TESTS=OFF \
-D WITH_GUI_TESTS=OFF \
-D WITH_XC_DOCS=ON \
-D WITH_XC_UPDATECHECK=OFF \
-D WITH_XC_NETWORKING=OFF \
-D WITH_XC_FDOSECRETS=ON \
-D WITH_XC_AUTOTYPE=ON \
-D WITH_XC_X11=ON \
-D WITH_XC_BROWSER=ON \
-D WITH_XC_BROWSER_PASSKEYS=ON \
-D WITH_XC_SSHAGENT=ON \
-D WITH_XC_KEESHARE=ON \
-D WITH_XC_YUBIKEY=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Readline=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
find "$PKG/usr/share/keepassxc/translations" -name 'keepassxc_*.qm' \
! -name 'keepassxc_en.qm' ! -name 'keepassxc_en_US.qm' ! -name 'keepassxc_en_GB.qm' \
-delete
install -d "$PKG/usr/lib/mozilla/native-messaging-hosts"
cat > "$PKG/usr/lib/mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json" <<'JSON'
{
"name": "org.keepassxc.keepassxc_browser",
"description": "KeePassXC integration with native messaging support",
"path": "/usr/bin/keepassxc-proxy",
"type": "stdio",
"allowed_extensions": [
"keepassxc-browser@keepassxc.org"
]
}
JSON
chmod 644 "$PKG/usr/lib/mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json"
The switches, and why each is set:
-D KEEPASSXC_BUILD_TYPE=Release— the build type KeePassXC shows in its version string and about box (Release,PreReleaseorSnapshot, which appends-snapshotto the version). The release tarball’s.versionfile already makes itRelease; the switch says the same.-D WITH_TESTS=OFF— no unit tests, which upstream builds by default;-D WITH_GUI_TESTS=OFFleaves out the GUI tests as well.-D WITH_XC_DOCS=ON— build the user guide, the getting-started guide, the keyboard-shortcut page and the manual pages with asciidoctor, which is why it is independs.-D WITH_XC_UPDATECHECK=OFF— no check for new KeePassXC releases at start-up; upstream’s own description of the switch says to disable it for controlled distributions, where the package manager brings updates. CMake also turns it off wheneverWITH_XC_NETWORKINGis off.-D WITH_XC_NETWORKING=OFF— leave out all of KeePassXC’s own network code: the downloader of website icons (favicons) for entries, the download of Have I Been Pwned breach data for the database report, and the update checker’s code. This is upstream’s default. Everything KeePassXC does is then local; browser integration is a local socket tokeepassxc-proxy.-D WITH_XC_FDOSECRETS=ON— implement the freedesktop.org Secret Service on the session bus. Off by default upstream. The integration still has to be turned on in KeePassXC’s own settings, and the bus name is one program’s at a time: in a Plasma sessionksecretd, from kwallet, already serves it (see A login that typed no password leaves the wallet locked).-D WITH_XC_AUTOTYPE=ON— Auto-Type, which types a username and password into another window. On Linux it is an X11 plugin,keepassxc-autotype-xcb, that needs libXi, libXtst and Qt 5’s X11 extras, all independs. KeePassXC loads the plugin named after Qt’s platform, and there is no Wayland one, so in the KDOS session, whereQT_QPA_PLATFORMputs Qt on Wayland first (see Starting a session), Auto-Type is unavailable. It works only in a KeePassXC started on Xwayland, withQT_QPA_PLATFORM=xcb, and then types only into X11 windows.-D WITH_XC_X11=ON— build the X11 helpers into the core and link libX11 and Qt 5 X11 Extras.-D WITH_XC_BROWSER=ON— browser integration through keepassxc-browser andkeepassxc-proxy;-D WITH_XC_BROWSER_PASSKEYS=ONadds passkey (WebAuthn) support to it. Both are off by default upstream.-D WITH_XC_SSHAGENT=ON— add keys stored in a database to a running SSH agent while the database is open.-D WITH_XC_KEESHARE=ON— KeeShare, which synchronises groups of entries between databases through shared container files.-D WITH_XC_YUBIKEY=ON— challenge-response unlocking of a database with a YubiKey, reached over USB (libusb) and smart-card readers (pcsc-lite).-D CMAKE_REQUIRE_FIND_PACKAGE_Readline=ON—keepassxc-clilinks readline for its interactive shell only when configure finds it; required, a missing readline stops the configure instead of building a CLI with no line editing (see a graphical application).
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/keepassxc, 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 keepassxc-2.7.12-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/keepassxc, and runs the triggers its paths call for.
Contents
Installed programs: keepassxc, keepassxc-cli, keepassxc-proxy.
Installed directories: /usr/lib/keepassxc, /usr/share/keepassxc, /usr/share/licenses/keepassxc.
Short descriptions
keepassxc |
a modern open-source password manager |
keepassxc-cli |
command line interface for the KeePassXC password manager |
Notes
build.sh deletes every translation catalogue under /usr/share/keepassxc/translations except the English ones. kpkg’s size and language policy removes the same catalogues from every package it makes, so the line does not change what ships.
It also writes /usr/lib/mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json, the system-wide native-messaging manifest Firefox reads, which names /usr/bin/keepassxc-proxy and allows only the keepassxc-browser extension. KeePassXC can write a per-user manifest from its own browser-integration settings; the system one means Firefox finds the proxy without that step.
KeePassXC draws its own light or dark style, with its own palette, unless its setting GUI/ApplicationTheme is classic; its default, auto, replaces the palette qt5ct gives every Qt 5 program, so the window would show KeePassXC’s grey in every accent. The account skeleton therefore ships ~/.config/keepassxc/keepassxc.ini with ApplicationTheme=classic (see Theming native applications). KeePassXC reads that file at start and writes it back with every setting changed in its own window.