78 lines
2.1 KiB
Markdown
78 lines
2.1 KiB
Markdown
# Zeta Toolchain
|
|
|
|
Package management for [Zerene OS](https://github.com/gretagen). Two tools:
|
|
|
|
| Tool | What |
|
|
|---|---|
|
|
| `zeta-makepkg` | Build engine: `.recipe` → binary tarball + `package.lua` |
|
|
| `zeta-cli` | Interactive wizard: prompts → `.recipe` file |
|
|
|
|
## Quick Start
|
|
|
|
```sh
|
|
# Create a recipe interactively
|
|
./cli/zeta-cli
|
|
|
|
# Build it
|
|
./builder/zeta-makepkg mypkg.recipe --output ~/zeta-packages
|
|
|
|
# Install system-wide
|
|
make install
|
|
```
|
|
|
|
## Recipe Format
|
|
|
|
Declarative Lua — no functions, just data:
|
|
|
|
```lua
|
|
return {
|
|
name = "mypkg",
|
|
version = "1.0",
|
|
summary = "Short description",
|
|
url = "https://.../src.tar.gz",
|
|
deps = { "libfoo", "libbar>=2.0" },
|
|
build_system = "autotools", -- autotools | cmake | meson | make | cargo | zig | build.sh | custom
|
|
configure_args = { "--enable-x" },
|
|
test = "${DESTDIR}/usr/bin/mypkg --version",
|
|
}
|
|
```
|
|
|
|
**Build systems**: `autotools`, `cmake`, `meson`, `make`, `cargo`, `zig`, `build.sh`, `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
|
|
|
|
```
|
|
toolchain/
|
|
├── cli/ zeta-cli — recipe wizard
|
|
├── builder/ zeta-makepkg — build engine
|
|
├── lib/ shared Lua modules
|
|
├── examples/ example .recipe files
|
|
└── Makefile
|
|
```
|
|
|
|
## Requirements
|
|
|
|
- Lua 5.1+
|
|
- `curl` or `wget` (source downloads)
|
|
- `tar`, `sha256sum` (packaging)
|
|
- Build tools for your chosen `build_system` (gcc, meson, cmake, cargo, etc.)
|
|
|
|
## License
|
|
|
|
MIT
|