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

331.7. gnucash-5.17

Double-entry accounting — personal and small-business books, invoices, reports

Version 5.17, release 1
Shelf office — Office suites, word processors, spreadsheets, presentations, accounting and finance, and office-format import libraries
Phase 44_apps (Applications), 316 of 422 in build order
Licence GPL-2.0-or-later AND (GPL-2.0-only OR GPL-3.0-only)
Homepage https://www.gnucash.org/
Build time 11.7 SBU
Installed size 51.2 MiB in 1126 files
Recipe ports/core/office/gnucash/kpkgbuild

About

GnuCash is a double-entry accounting program for personal and small-business books: accounts, transactions, scheduled entries, invoices, customers and vendors, and reports. Its engine is a C and C++ library with Scheme (guile) on top, the interface is GTK 3, and the reports are HTML drawn by webkitgtk through its 4.1 API. A book here is kept as an XML file.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, perl, swig, gettext, glib, gtk3, webkitgtk, libxml2, libxslt, zlib, icu, boost, guile, libsecret, libofx, gtest.

Required by: no port names it.

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

What kpkg does

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

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/office/gnucash
echo '3d18a88f5b8230f01e04c2d2d73bf95e7dcd3bf8d8cee6ffa54bb24dee58b85f  gnucash-5.17.tar.bz2' | 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/gnucash
SRC=$SRC_ROOT/gnucash-5.17
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf gnucash-5.17.tar.bz2 -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 --no-backup-if-mismatch -i "$PORT_SRC/install-rpath.patch"

export CFLAGS="$CFLAGS -Wno-error"
export CXXFLAGS="$CXXFLAGS -Wno-error"
cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D CMAKE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D BUILD_SHARED_LIBS=ON \
	-D WITH_GNUCASH=ON \
	-D WITH_SQL=OFF \
	-D WITH_AQBANKING=OFF \
	-D WITH_OFX=ON \
	-D WITH_PYTHON=OFF \
	-D DISABLE_NLS=ON \
	-D COMPILE_GSCHEMAS=OFF \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
chmod 755 "$PKG/usr/bin/gnucash-valgrind"

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

Contents

Installed programs: finance-quote-wrapper, gnc-fq-update, gnucash, gnucash-cli, gnucash-valgrind.

Installed libraries: libgnc-app-utils.so, libgnc-backend-xml-utils.so, libgnc-core-utils.so, libgnc-engine.so, libgnc-expressions-guile.so, libgnc-expressions.so, libgnc-generic-import.so, libgnc-gnome.so, libgnc-locale-tax.so, libgnc-module.so, libgnucash-guile.so.

Installed directories: /etc/gnucash, /usr/include/gnucash, /usr/lib/gnucash, /usr/lib/guile/3.0/site-ccache, /usr/share/doc/gnucash, /usr/share/gnucash, /usr/share/guile/site, /usr/share/licenses/gnucash.

Short descriptions

finance-quote-wrapper internal interface between gnucash and Finance::Quote
gnucash personal finance manager
gnucash-cli command line tool to go with GnuCash

Notes

The CMake configuration stops with GTEST not found unless GoogleTest (gtest) is installed, whether or not the tests are run, so it is a dependency.

gnucash-valgrind, a script that starts GnuCash under Valgrind, is installed by an install(FILES ...) rule, which gives it mode 644; build.sh makes it executable.

Online price quotes (the Price Database’s Get Quotes button and gnucash-cli --quotes) run finance-quote-wrapper, a Perl script that needs the Finance::Quote and JSON::Parse modules, neither of which is a port. GnuCash itself starts; a quote fetch reports that Perl is missing those modules and fetches nothing.