49.2. sqlite-3530400
Self-contained, serverless, transactional SQL database engine
| Version | 3530400, release 1 |
| Shelf | database — Database engines, embedded key-value stores, database servers, clients and full-text indexes |
| Phase | 30_foundation (Build Foundation), 31 of 127 in build order |
| Licence | blessing |
| Homepage | https://www.sqlite.org/ |
| Build time | 1.7 SBU |
| Installed size | 6.9 MiB in 9 files |
| Recipe | ports/core/database/sqlite/kpkgbuild |
About
SQLite is an SQL database engine in a library: a database is one file, opened directly by the program that uses it, with no server. A great deal of the tree stores its data this way: python3’s sqlite3 module, util-linux, GnuPG, nss, both Qt bases, WebKitGTK, gdal and the map programs, and the container stack behind the boxes, where podman and buildah are built with it. The port builds upstream’s amalgamation tarball, whose library is one large sqlite3.c, and turns on at compile time the optional features listed below.
The sqlite3 shell that ships beside the library embeds its own copy of sqlite3.c rather than linking libsqlite3.so, so the options below reach both.
Sources
sqlite-3530400.tar.gz(3.1 MiB)
sha2560e9483900e92cd5de8fd48d16bf9200145a61f7fd5be542a5ac81d8a9516eb9c
upstream: https://sqlite.org/2026/sqlite-autoconf-3530400.tar.gz
archive copy: sources-1/database--sqlite-3530400.tar.gz
Dependencies
Depends on: zlib, readline, ncurses.
Required by (71): aircrack-ng, aria2, atuin, avidemux, buildah, calibre, crawl-tiles, darktable, ddnet, diamond, dino, doxygen, fastfetch, filezilla, font-manager, freeciv, fwupd, gdal, gnupg, horizon-eda, hostapd, iamb, kdos-runner, kget, kodi, libaccounts-glib, libgpod, libreoffice, libsoup3, libspatialite, libstoragemgmt, lnav, luanti, maddy, mgba, minidlna, mosquitto, mpd, mumble, newsboat, nfs-utils, nodejs, nss, opencpn, podman, profanity, proj, python3, qgis, qt5-qtbase, qt5-qttools, qt6-qtbase, qt6-qttools, ripgrep-all, skopeo, sleuthkit, sqlitebrowser, stella, strawberry, supertuxkart, taskwarrior, tenacity, termusic, usql, util-linux, viking, vtk, warzone2100, webkitgtk, webkitgtk6, zeal.
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/30_foundation/phase.env && kpkg install sqlite'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/database/sqlite.
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/database/sqlite
echo '0e9483900e92cd5de8fd48d16bf9200145a61f7fd5be542a5ac81d8a9516eb9c sqlite-3530400.tar.gz' | 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/sqlite
SRC=$SRC_ROOT/sqlite-3530400
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf sqlite-3530400.tar.gz -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 CPPFLAGS="$CPPFLAGS \
-DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY \
-DSQLITE_ENABLE_DBSTAT_VTAB=1 \
-DSQLITE_ENABLE_FTS3_TOKENIZER=1 \
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_SECURE_DELETE \
-DSQLITE_ENABLE_STMTVTAB \
-DSQLITE_MAX_VARIABLE_NUMBER=250000 \
-DSQLITE_MAX_EXPR_DEPTH=10000 \
-DSQLITE_ENABLE_MATH_FUNCTIONS \
-DSQLITE_ENABLE_RTREE=1 \
-DSQLITE_ENABLE_GEOPOLY=1"
./configure --prefix=/usr \
--enable-fts3 \
--enable-fts4 \
--enable-fts5 \
--session \
--dbpage \
--enable-readline \
--soname=legacy \
--disable-rpath
make
make DESTDIR=$PKG install
The switches, and why each is set:
-DSQLITE_ENABLE_COLUMN_METADATA=1— Compile insqlite3_column_table_name(),sqlite3_column_origin_name(),sqlite3_table_column_metadata()and the rest of the column metadata interface, which tells a caller which table and column a result column came from.-DSQLITE_ENABLE_UNLOCK_NOTIFY— Compile insqlite3_unlock_notify(), which lets a connection in shared-cache mode wait for a lock held by another connection instead of failing withSQLITE_LOCKED.-DSQLITE_ENABLE_DBSTAT_VTAB=1— Thedbstatvirtual table, which reports how the pages of a database file are used, table by table.-DSQLITE_ENABLE_FTS3_TOKENIZER=1— Allow the two-argument form offts3_tokenizer(), through which an application registers its own tokenizer for full-text search.-DSQLITE_ENABLE_FTS3_PARENTHESIS— The enhanced FTS3 query syntax, withAND,NOTand parentheses.-DSQLITE_SECURE_DELETE— Makesecure_deletethe default: deleted content is overwritten with zeros instead of being left in free pages of the file.-DSQLITE_ENABLE_STMTVTAB— Thesqlite_stmtvirtual table, which lists a connection’s prepared statements.-DSQLITE_MAX_VARIABLE_NUMBER=250000— Raise the highest?NNNparameter number a statement may use, and so the number of values one statement can bind, above upstream’s default.-DSQLITE_MAX_EXPR_DEPTH=10000— Raise the deepest expression tree the parser accepts above upstream’s default.-DSQLITE_ENABLE_MATH_FUNCTIONS— The SQL maths functions (sqrt(),log(),sin()and the rest). The configure script turns them on by default as well.-DSQLITE_ENABLE_RTREE=1— The R*Tree module, a spatial index. A GeoPackage keeps its spatial index as an R*Tree virtual table, so without it a GeoPackage file opens but cannot answer a bounding-box query, and gdal’s GeoPackage driver requires it.-DSQLITE_ENABLE_GEOPOLY=1— The Geopoly extension, polygon functions on top of R*Tree.--enable-fts3— The FTS3 full-text search module.--enable-fts4— FTS4, the same module with its additional options.--enable-fts5— FTS5, the newer full-text search module.--session— The session extension, which records the changes made to a database as a changeset that can be applied elsewhere; it brings the pre-update hook with it.--dbpage— Thesqlite_dbpagevirtual table, raw access to the pages of the file, which the shell’s.recovercommand reads.--enable-readline— Link the shell with readline for line editing. Given explicitly, a readline that cannot be found stops the configure instead of leaving a shell without line editing.--soname=legacy— Givelibsqlite3.sothe sonamelibsqlite3.so.0, the value upstream’s configure calls legacy. Without the switch the configure sets no soname at all, and every program linked against the library would record the barelibsqlite3.soas its dependency.--disable-rpath— Record no run path in the library or the shell;/usr/libis on the loader’s default path.
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/sqlite, 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 sqlite-3530400-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/sqlite, and runs the triggers its paths call for.
Contents
Installed programs: sqlite3.
Installed libraries: libsqlite3.a, libsqlite3.so.
Short descriptions
sqlite3 |
A command line interface for SQLite version 3 |
sqlite3.pc |
SQL database engine |