Aegis documentation

#Build profiles

Every application with a build.toml under storage/data/apps/<name>/build.toml is buildable. Nothing is hardcoded in Python: the profile declares what to do, the builder executes it.

#Minimal profile

toml
[source]kind = "configure"[configure]options = [verify]libraries = "lib/libz.so*"

#[source]

KeyMeaning
kindbuild system: autoconf, configure, cmake, meson, make, openssl, icu, python, binary
build_dirsubdirectory where the build runs (out-of-tree builds)
patchespatch files applied once after extraction

#[dependencies]

toml
[dependencies]libs = "openssl" "pcre2" "zlib"

Names are catalog entries. The plan resolves them recursively, dependencies first, and rejects cycles:

text
openssl → pcre2 → zlib → nginx

Libraries are not only headers: CPPFLAGS, LDFLAGS, PKG_CONFIG_PATH and CMAKE_PREFIX_PATH are built from their prefixes.

#[configure]

toml
[configure] Commands run before ./configure in order as argv arrays.pre = "autoreconf" "-fi"options =     "--with-zlib"    "--with-openssl={lib:openssl}"

Token expansion works in options, pre, make args, install command and [env] values:

TokenExpands to
{lib:name}prefix of a declared library
{prefix}the application's own install prefix

Third-party sources (nginx modules) go in [configure] modules:

toml
modules =      name = "ndk"    path = "web/nginx-modules/ndk/0.3.3"      name = "geoip2" path = "web/nginx-modules/geoip2/3.4" 

Each archive is extracted into <work>/modules/<name> and passed as --add-module=…. Order matters when a module depends on another (ndk before set-misc).

#[make]

toml
[make]args = "BUILD_TLS=yes" "OPENSSL_PREFIX={lib:openssl}"targets = "build" "redis"jobs = "auto"

args and targets are passed to both compile and install, because many Makefiles declare install: all.

#[install]

toml
[install]command = "install" "-D" "-m" "755" "vsftpd" "{prefix}/sbin/vsftpd"

When present it replaces make install, for Makefiles that ignore PREFIX. Otherwise the builder passes both PREFIX= and prefix= (git uses the lowercase one).

#[system]

toml
[system]packages = "libpq-dev" "default-libmysqlclient-dev"groups = "postdrop"users = "postfix"

Packages are installed through uapi.packages (index refreshed only when something is missing). Accounts are created before the install step, groups first so useradd finds them.

#[env]

toml
[env]CFLAGS = "-O2 -std=gnu17"LIBS = "-lsharpyuv"

Values support {lib:…} and {prefix}. They are merged over the computed environment, so a profile wins.

#[verify]

toml
[verify]binaries = "sbin/nginx"                       # exists and is executablelibraries = "lib/libssl.so*"                  # at least one glob matchcommands = "sbin/nginx" "-V"               # must exit zero

Commands run with the prefix and its libraries on LD_LIBRARY_PATH, so a freshly built binary is checked the way it will run.

On success the prefix gets .aegis-installed with the profile fingerprint; on failure .aegis-failed, which makes the next run rebuild it.

#[extensions] (PHP)

toml
[extensions]build =      name = "igbinary" path = "web/pecl/igbinary/3.2.17RC1"      name = "redis"    path = "web/pecl/redis/6.3.0"      args = "--enable-redis-igbinary"      name = "imagick"  path = "web/pecl/imagick/3.8.1"      args = "--with-imagick={lib:imagemagick}" 

Built after PHP itself: phpize, ./configure --with-php-config=…, make, make install, into the PHP prefix.

igbinary is pinned to 3.2.17RC1 because 3.2.16 does not build against PHP 8.5: it includes ext/standard/php_smart_string.h, which PHP 8.5 no longer ships. The release candidate is what PECL publishes for 8.5.

#Patches

text
storage/data/apps/<app>/patches/<name>.patch
toml
[source]kind = "make"patches = "modern-toolchain.patch"

Applied with patch -p1 inside the extracted source, once. The .prepared marker stores the artifact checksum and the patch list, so changing either re-extracts and re-applies automatically.

Write patches without blank context lines — GNU patch then reports Hunk #1 FAILED even when the content matches.

#Kinds

kindconfigurecompileinstall
autoconf / configure./configure --prefix=…make -jNmake install
cmakecmake -S . -B buildcmake --build buildcmake --install build
mesonmeson setup buildninja -C buildninja -C build install
makeprofile pre onlymake <args> <targets>make <args> install
openssl./Configure <arch> --libdir=libmakemake install_sw
icu./configuremakemake install
python—pip install into the runtime—
binary——copy the artifact to <prefix>/bin/<name>

openssl picks linux-x86_64 or linux-aarch64 from platform.machine().