: nply/foundationpkgs

commit 7177c664097c6a34b336cc3067ebc1fce439c406
parent 26ccfcf6aa61db7ddaccb4b4556fc02afb0e5ed0
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Mon, 2 Nov 2026 00:06:07 +0530

Package sqlite-memory with local and remote engines and sqlite-vector
5 files changed, 93 insertions(+), 2 deletions(-)
M
.config/Jobfile
|
2
+-
M
.config/ci-packages.list
|
4
++++
A
Unix/sqlite-memory/APKBUILD
|
53
+++++++++++++++++++++++++++++++++++++++++++++++++++++
A
Unix/sqlite-vector/APKBUILD
|
33
+++++++++++++++++++++++++++++++++
M
docs/ci.md
|
3
++-
diff --git a/.config/Jobfile b/.config/Jobfile
@@ -4,7 +4,7 @@ triggers="refs/heads/main: checks plan packages"
 ci_apk_packages=${FPKGS_APK_PACKAGES:-}
 # initify is a required CI tool artifact, even when application selection changes.
 # Builds exercise conversion fixtures; package jobs never install into the host.
-ci_deb_packages="initify ${FPKGS_DEB_PACKAGES:-minimal-fxa-server}"
+ci_deb_packages="initify ${FPKGS_DEB_PACKAGES:-minimal-fxa-server sqlite-vector sqlite-memory}"
 
 checks() {
 	for file in "$srcdir"/scripts/*.sh "$srcdir"/tests/*.sh; do
diff --git a/.config/ci-packages.list b/.config/ci-packages.list
@@ -12,6 +12,10 @@ apt patch
 # initify's rootless CI build/check and installed converter runtime.
 apt perl
 apt pkgconf
+# sqlite-memory: full local llama.cpp engine, system curl, SQLite load checks.
+apt cmake
+apt libcurl4-openssl-dev
+apt sqlite3
 apt rsync
 apt bmake
 apt scdoc
diff --git a/Unix/sqlite-memory/APKBUILD b/Unix/sqlite-memory/APKBUILD
@@ -0,0 +1,53 @@
+pkgname=sqlite-memory
+pkgver=1.3.6
+pkgrel=0
+deb_pkgver=$pkgver
+deb_depends="libc6, libstdc++6, libcurl4t64, sqlite-vector"
+pkgdesc="Persistent searchable memory for AI agents as a SQLite extension (local and remote embeddings)"
+url="https://github.com/sqliteai/sqlite-memory"
+arch="all"
+license="Apache-2.0 AND MIT"
+depends="sqlite-vector"
+makedepends="build-base cmake curl-dev sqlite"
+_llama_commit=8abcc70a747eff568198ae64aa1a60b7625a3c36
+source="$url/archive/refs/tags/$pkgver.tar.gz
+	https://github.com/ggml-org/llama.cpp/archive/$_llama_commit.tar.gz"
+sha512sums="be5a0e62bbceb608976786decc9a3917b74001067e92a3dd550ac308e6490077151bf585f8f71773a12db37473a3e3b42e938a7ee305b7cb9a7d29c7d246e37f  1.3.6.tar.gz
+073de391415ad5f3bb60e054c49c77b7a1fe01bdc3e12dccf9f802f782f63e139f1cdfa8da6ecbf7223d7d58a3ef4cfe6dd0057fb1d59b2fd0c321ff3a9a2e8c  8abcc70a747eff568198ae64aa1a60b7625a3c36.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+_make() {
+	# Use system libcurl, not upstream's build-time curl download/static TLS copy.
+	make CC="${CC:-cc}" CXX="${CXX:-c++}" BUILD_DIR=out \
+		LLAMA_DIR="$srcdir/llama.cpp-$_llama_commit" \
+		LLAMA_BUILD="$builddir/out/llama" \
+		LLAMA="-DLLAMA_BUILD_COMMON=ON" \
+		CPUS="${JOBS:-2}" CURL_DEPS= CURL_LIB=-lcurl CURL_SSL_LIBS=-lcurl \
+		STRIP_CMD=: "$@"
+}
+
+build() {
+	_make
+	if [ -z "${CBUILD:-}" ] || [ "$CBUILD" = "$CHOST" ]; then
+		check
+	fi
+}
+
+check() {
+	_make test
+	case "$(uname -s)" in Darwin) _ext=dylib ;; *) _ext=so ;; esac
+	[ "$(sqlite3 :memory: ".load ./dist/memory.$_ext" 'SELECT memory_version();')" = "$pkgver" ]
+}
+
+package() {
+	case "$(uname -s)" in Darwin) _ext=dylib ;; *) _ext=so ;; esac
+	mkdir -p "$pkgdir/usr/lib/sqlite3" "$pkgdir/usr/share/licenses/$pkgname" \
+		"$pkgdir/usr/share/doc/$pkgname"
+	install -m755 "dist/memory.$_ext" "$pkgdir/usr/lib/sqlite3/"
+	install -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+	# md4c's MIT notice is embedded in its leading source comment.
+	awk '{ print } /\*\// { exit }' src/md4c.h > "$pkgdir/usr/share/licenses/$pkgname/md4c-LICENSE"
+	install -m644 "$srcdir/llama.cpp-$_llama_commit/LICENSE" \
+		"$pkgdir/usr/share/licenses/$pkgname/llama.cpp-LICENSE"
+	install -m644 README.md "$pkgdir/usr/share/doc/$pkgname/"
+}
diff --git a/Unix/sqlite-vector/APKBUILD b/Unix/sqlite-vector/APKBUILD
@@ -0,0 +1,33 @@
+pkgname=sqlite-vector
+pkgver=1.2.0
+pkgrel=0
+deb_pkgver=$pkgver
+deb_depends="libc6"
+pkgdesc="SQLite extension for vector search"
+url="https://github.com/sqliteai/sqlite-vector"
+arch="all"
+license="Apache-2.0"
+makedepends="build-base sqlite"
+source="$url/archive/refs/tags/$pkgver.tar.gz"
+sha512sums="35837cfe7df5c39a1c367d82c86b9ab4e534411448116cf9382375ef3e2fea42cd1d41995e55a90a76f02aa5fc266700350d69d75a95c4642d4626bf249f2724  1.2.0.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+	LDFLAGS="${LDFLAGS:-} -lm" make CC="${CC:-cc}" ARCH="$(uname -m)" BUILD_DIR=out \
+		CFLAGS="${CFLAGS:--O2} -Isrc -Ilibs"
+	if [ -z "${CBUILD:-}" ] || [ "$CBUILD" = "$CHOST" ]; then
+		check
+	fi
+}
+
+check() {
+	case "$(uname -s)" in Darwin) _ext=dylib ;; *) _ext=so ;; esac
+	[ "$(sqlite3 :memory: ".load ./dist/vector.$_ext" 'SELECT vector_version();')" = "$pkgver" ]
+}
+
+package() {
+	case "$(uname -s)" in Darwin) _ext=dylib ;; *) _ext=so ;; esac
+	mkdir -p "$pkgdir/usr/lib/sqlite3" "$pkgdir/usr/share/licenses/$pkgname"
+	install -m755 "dist/vector.$_ext" "$pkgdir/usr/lib/sqlite3/"
+	install -m644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
diff --git a/docs/ci.md b/docs/ci.md
@@ -17,7 +17,8 @@ live host or rewrite existing recipes; keep legacy CI explicitly on tar.gz until
 its packages and toolchain have been migrated.
 
 **Per-format allowlists:** `.config/Jobfile` always selects `initify` as a required
-Debian CI tool artifact, plus `minimal-fxa-server` by default. `FPKGS_DEB_PACKAGES`
+Debian CI tool artifact, plus `minimal-fxa-server`, `sqlite-vector`, and
+`sqlite-memory` by default. `FPKGS_DEB_PACKAGES`
 changes the application selection without dropping `initify`. Its recipe checks
 Perl syntax and converts a synthetic service/timer during each uncached build.
 The APK allowlist