patch: hooks from zeta

This commit is contained in:
2026-08-17 19:23:32 -04:00
parent 159f7bfe83
commit 551ba34cab
6 changed files with 204 additions and 2 deletions
+15
View File
@@ -39,6 +39,21 @@ return {
**Build systems**: `autotools`, `cmake`, `meson`, `make`, `cargo`, `custom`
## Post-transaction hooks
Packages may ship post-transaction hooks — pure-data Lua files under
`usr/share/zeta/hooks/*.hook` in the stage tree. A hook declares an `order`,
a `trigger` (e.g. `{ op = "install", type = "package", target = { "mypkg" } }`),
and an `action` (e.g. `{ when = "post", exec = "..." }`).
At build time `zeta-makepkg` scans the stage for `*.hook` files, validates each
one (they must load as a table carrying `trigger` and `action`), and merges
their paths into the generated `files` whitelist so hooks are committed
alongside the declared files. A malformed hook fails the build.
See [`toolchain/examples/hooks-demo/`](toolchain/examples/hooks-demo/hooks-demo.recipe)
for a working example.
## Structure
```