Package management library for NurOS.
  • C 82.8%
  • Python 9.6%
  • C++ 5.7%
  • Meson 1.7%
  • Nix 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AnmiTaliDev e0c3f6b7ae
Some checks failed
docs / build (push) Has been cancelled
CI / Code quality (push) Has been cancelled
CI / Build and test (push) Has been cancelled
CI / Sanitizers (ASan + UBSan) (push) Has been cancelled
CI / Fuzzing (smoke test) (push) Has been cancelled
CI / ABI regression check (push) Has been cancelled
CI / Cross-compile (aarch64) (push) Has been cancelled
CI / Cross-compile (riscv64) (push) Has been cancelled
CI / Cross-compile (mips64el) (push) Has been cancelled
CI / Cross-compile (armhf) (push) Has been cancelled
ci: find the sanitizer runtime with clang -print-file-name
2026-11-08 11:55:01 +05:00
.forgejo ci: build and run every fuzz harness in the smoke job 2026-11-07 22:12:18 +05:00
.github ci: find the sanitizer runtime with clang -print-file-name 2026-11-08 11:55:01 +05:00
bindings ci: find the sanitizer runtime with clang -print-file-name 2026-11-08 11:55:01 +05:00
cmake build: add proper libapg.pc naming and a CMake find module 2026-07-27 19:32:28 +05:00
cross refactor: move cross-compilation files to cross/ directory 2026-07-20 21:50:57 +05:00
docs chore: bump version to 2.8.0 2026-11-08 11:34:12 +05:00
fuzz test(fuzz): add the keyring harness 2026-11-07 22:12:18 +05:00
include/apg perf(package): read metadata and file lists without extracting the archive 2026-11-08 11:20:29 +05:00
pkg ci: use metadata.json template for APG release packaging 2026-06-15 00:39:47 +05:00
scripts fix: exclude build-*/ scratch dirs from checkpatch's clang-format scan, only build/ was excluded 2026-08-24 09:23:40 +05:00
src perf(db): write the journal entry in the same transaction as the package record 2026-11-08 11:26:41 +05:00
subprojects build(deps): add Meson wrap for yyjson 2026-07-20 21:42:39 +05:00
test test(db): cover one commit per database operation and per transaction step 2026-11-08 11:26:41 +05:00
.clang-format build: add .clang-format 2026-06-13 17:55:09 +05:00
.clang-tidy fix: exclude vendored subproject headers from clang-tidy, fix a 2026-07-29 09:02:49 +05:00
.clocignore chore: add .clocignore 2026-06-19 17:56:43 +05:00
.editorconfig chore: add editorconfig 2026-06-14 17:42:15 +05:00
.gitignore chore: ignore .cache 2026-08-09 10:11:16 +05:00
abi-suppressions.txt revert: remove commit hooks, audit filters, db_get_providers, trans_step_required_by and db_verify_against_archive 2026-11-08 11:07:36 +05:00
CHANGELOG.md chore: bump version to 2.8.0 2026-11-08 11:34:12 +05:00
CODE_OF_CONDUCT.md Closes #11 2025-12-27 14:57:57 +05:00
CONTRIBUTING.md docs: document code style checks and doxygen requirements 2026-06-14 17:36:39 +05:00
Doxyfile chore: bump version to 2.8.0 2026-11-08 11:34:12 +05:00
flake.nix chore: bump version to 2.8.0 2026-11-08 11:34:12 +05:00
LICENSE Add GNU General Public License v3 2025-12-27 13:23:06 +05:00
meson.build chore: bump version to 2.8.0 2026-11-08 11:34:12 +05:00
meson_options.txt feat: add ctypes-based Python bindings 2026-08-08 23:30:36 +05:00
README.md docs(readme): correct the install-script sandbox description 2026-11-07 21:29:03 +05:00
ROADMAP.md docs: update roadmap 2026-09-15 21:27:54 +05:00
SECURITY.md feat!: drop the gpgme (OpenPGP) signing backend entirely 2026-08-02 11:50:09 +05:00

libapg

Package management library for NurOS.

Note

Repository Mirrors

  • git.nuros.org (core/libapg): primary, self-hosted Forgejo instance, accounts restricted to the core team.
  • GitHub (NurOS-Linux/libapg): mirror for external contributors. Issues and Pull Requests opened here are welcome and are reviewed and processed by the core team.

Dependencies

Dependency Description
Meson Build system
Ninja Build tool
pkg-config Helper tool for compiling
libarchive Archive and compression library
lmdb Embedded key-value database
yyjson JSON library
libsodium Package signing
libseccomp (optional, Linux only) Detected at configure time, not used by the current sources

Signing

Packages are signed and verified with libsodium (sign_verify, sign_file, keyring_load, ...): Ed25519 signing, keys are read from /etc/apg/keys/.

Install-script sandbox

run_script() runs pre/post-install scripts as /bin/sh <script> in a child process.

  • Linux: unshare() with user, network, mount, UTS, and IPC namespaces. If unshare() fails with EPERM or EINVAL, the script runs without them. Any other error fails the call.
  • FreeBSD: chroot() into the alternate install root, when one is given. Capsicum capability mode is not used here, since it forbids the kernel from resolving an interpreter path, which any #!-script exec requires.
  • Other POSIX platforms: chroot() into the alternate install root, when one is given. No other isolation is applied.

On every platform, if chroot() to a given install root fails, the script is not executed.

Building

With Nix

nix build

Without Nix

Arch Linux

sudo pacman -S meson ninja pkgconf libarchive lmdb yyjson libsodium

Ubuntu / Debian

sudo apt install meson ninja-build pkg-config libarchive-dev liblmdb-dev libyyjson-dev libsodium-dev

Fedora / RHEL / CentOS

sudo dnf install meson ninja-build pkgconf libarchive-devel lmdb-devel yyjson-devel libsodium-devel

openSUSE

sudo zypper install meson ninja pkgconf libarchive-devel lmdb-devel yyjson-devel libsodium-devel

Alpine Linux

sudo apk add meson ninja pkgconf libarchive-dev lmdb-dev yyjson-dev libsodium-dev

Gentoo

sudo emerge dev-build/meson dev-build/ninja dev-util/pkgconf app-arch/libarchive dev-db/lmdb dev-libs/yyjson dev-libs/libsodium

Void Linux

sudo xbps-install meson ninja pkgconf libarchive-devel lmdb-devel libsodium-devel

FreeBSD

sudo pkg install meson pkgconf ninja lmdb libarchive yyjson libsodium

libseccomp is not available on FreeBSD; the install-script sandbox falls back to chroot() only there (see Install-script sandbox). Default configuration paths follow FreeBSD's hier(7) and resolve under /usr/local/etc/apg/ instead of /etc/apg/.

Build

meson setup build --buildtype=release
meson compile -C build

Install

sudo meson install -C build

Using libapg

Installing libapg also installs a libapg.pc pkg-config file and a CMake package config module, so it can be picked up either way:

pkg-config --cflags --libs libapg
find_package(libapg REQUIRED)
target_link_libraries(your_target PRIVATE libapg::libapg)

The CMake module resolves through pkg-config, so pkg-config must be installed and discoverable on the consuming system.

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

See the LICENSE file for details.