Package management library for NurOS.
  • C 54.4%
  • Assembly 41.9%
  • Meson 1.9%
  • Python 1.6%
  • Nix 0.2%
Find a file
AnmiTaliDev 766d84fc03
Some checks are pending
CI / Code quality (push) Waiting to run
CI / Build and test (push) Waiting to run
CI / Sanitizers (ASan + UBSan) (push) Waiting to run
CI / Assembly (minor arch validation) (push) Waiting to run
CI / Cross-compile (aarch64) (push) Waiting to run
CI / Cross-compile (riscv64) (push) Waiting to run
CI / Cross-compile (mips64el) (push) Waiting to run
CI / Cross-compile (armhf) (push) Waiting to run
docs / build (push) Waiting to run
fix: buffer size in sscanf format strings
2026-07-21 14:41:13 +05:00
.forgejo ci: update cross-file paths to cross/ in workflows and meson.build 2026-07-20 21:51:12 +05:00
.github ci: update cross-file paths to cross/ in workflows and meson.build 2026-07-20 21:51:12 +05:00
arch fix: disable broken x86_64 SHA-256 hardware backend 2026-07-20 00:09:53 +05:00
cross refactor: move cross-compilation files to cross/ directory 2026-07-20 21:50:57 +05:00
docs chore(scripts): include html_title in bump-version targets and sync 2026-07-20 22:49:36 +05:00
include refactor(util): move copy_file helper to internal util.h header 2026-07-21 12:13:35 +05:00
pkg ci: use metadata.json template for APG release packaging 2026-06-15 00:39:47 +05:00
scripts chore(scripts): include html_title in bump-version targets and sync 2026-07-20 22:49:36 +05:00
src fix: buffer size in sscanf format strings 2026-07-21 14:41:13 +05:00
subprojects build(deps): add Meson wrap for yyjson 2026-07-20 21:42:39 +05:00
test test(install): add path traversal escape prevention check to 2026-07-21 13:52:20 +05:00
.clang-format build: add .clang-format 2026-06-13 17:55:09 +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 docs: add Doxygen + Sphinx documentation pipeline 2026-06-07 15:32:21 +05:00
CHANGELOG.md docs(changelog): update CHANGELOG.md for unreleased changes 2026-07-20 21:58:41 +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 1.10.1 2026-07-20 01:18:34 +05:00
flake.nix chore: bump version to 1.10.1 2026-07-20 01:18:34 +05:00
LICENSE Add GNU General Public License v3 2025-12-27 13:23:06 +05:00
meson.build build: disable openssl and unused features in libarchive subproject 2026-07-20 21:54:50 +05:00
meson_options.txt fix: complete FreeBSD port (Capsicum sandbox, hier(7) paths, gpgme CI) 2026-07-18 18:59:25 +05:00
README.md docs: add repository mirror and contribution notice to README 2026-07-20 00:42:34 +05:00
ROADMAP.md feat: add db_get_dependents for reverse dependency lookup 2026-06-15 23:17:34 +05:00
SECURITY.md docs: add security policy 2026-06-14 17:18:46 +05:00

libapg

Package management library for NurOS.

Note

Repository Mirror & Issue Tracking

  • Primary Repository: Active development takes place on our self-hosted Forgejo instance at git.nuros.org (accounts are restricted to the core team).
  • GitHub Mirror: This GitHub repository is a read-only mirror.
  • Issues & Contributions: External contributors are welcome and encouraged to open Issues and Pull Requests directly here on GitHub! The team will review and process them.

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
gpgme or libsodium Package signing
libseccomp (optional, Linux only) Syscall filtering for install script sandbox

Signing backends

libapg supports two signing backends. The build system picks the first one available:

  • gpgme (preferred) — PGP signing via GnuPG. Only ECC keys are accepted by default (Ed25519, ECDSA). RSA can be enabled explicitly by passing allow_rsa = true to sign_verify.
  • libsodium (fallback) — Ed25519 signing. Always ECC, 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.
  • FreeBSDCapsicum capability mode (cap_enter()). The script binary is opened before entering capability mode and executed with fexecve(); once sandboxed, the process loses access to global namespaces (path-based lookups, most syscalls).
  • 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 gpgme

Ubuntu / Debian

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

Fedora / RHEL / CentOS

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

openSUSE

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

Alpine Linux

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

Gentoo

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

Void Linux

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

FreeBSD

sudo pkg install meson pkgconf ninja lmdb libarchive yyjson gpgme

libseccomp is not available on FreeBSD; the install-script sandbox uses Capsicum instead (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

License

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

See the LICENSE file for details.