Package management library for NurOS.
  • C 76.2%
  • Python 13.5%
  • C++ 7.8%
  • Meson 2.2%
  • Nix 0.2%
  • Other 0.1%
Find a file
AnmiTaliDev 61cba0d1cb
Some checks failed
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
docs / build (push) Has been cancelled
ci: enable cxx/python bindings in the build and sanitize jobs, add a TSan job (excluding apg-test's unshare()-incompatible run_script test)
2026-08-24 09:23:54 +05:00
.forgejo ci: pin abi-check baseline instead of auto-detecting the previous tag 2026-08-03 20:58:04 +05:00
.github ci: enable cxx/python bindings in the build and sanitize jobs, add a TSan job (excluding apg-test's unshare()-incompatible run_script test) 2026-08-24 09:23:54 +05:00
bindings fix: preload the sanitizer runtime for apgpy-bindings when b_sanitize is set, ctypes dlopen() of a sanitized .so needs it 2026-08-24 09:23:45 +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.2.0 2026-08-24 08:00:11 +05:00
fuzz fix: link sat-test/fuzz-sat-model against threads_dep explicitly, 2026-08-24 07:52:07 +05:00
include feat: expose dep_graph_resolve_sat() as a public API wrapping the SAT 2026-08-23 21:35:23 +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 feat: expose dep_graph_resolve_sat() as a public API wrapping the SAT 2026-08-23 21:35:23 +05:00
subprojects build(deps): add Meson wrap for yyjson 2026-07-20 21:42:39 +05:00
test fix: link sat-test/fuzz-sat-model against threads_dep explicitly, 2026-08-24 07:52:07 +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 ci: add automated ABI regression gate (abidiff/libabigail) 2026-08-03 16:25:50 +05:00
CHANGELOG.md chore: bump version to 2.2.0 2026-08-24 08:00:11 +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.2.0 2026-08-24 08:00:11 +05:00
flake.nix chore: bump version to 2.2.0 2026-08-24 08:00:11 +05:00
LICENSE Add GNU General Public License v3 2025-12-27 13:23:06 +05:00
meson.build chore: bump version to 2.2.0 2026-08-24 08:00:11 +05:00
meson_options.txt feat: add ctypes-based Python bindings 2026-08-08 23:30:36 +05:00
README.md feat!: drop the gpgme (OpenPGP) signing backend entirely 2026-08-02 11:50:09 +05:00
ROADMAP.md docs: check off the ASan/UBSan/TSan pass in the v2.3.0 roadmap, with findings 2026-08-24 09:23:50 +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) Syscall filtering for install script sandbox

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() isolates pre/post-install scripts using the strongest primitive available on the host:

  • Linuxunshare() with isolated network, mount, UTS, and IPC namespaces, plus optional libseccomp syscall filtering.
  • 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 — no sandbox primitive is available; scripts run without isolation.

On Linux and FreeBSD, if the sandbox cannot be established the script is not executed (fail closed).

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.