Recipes
A recipe is a directory at
zignos-recipes/<channel>/{core,main,desktop}/<package>/. The package name is
the directory name; the channel and category come from the path.
Packages that do not belong in the official tree can live in the official
ZIGNOS MENU overlay under
apps/, games/ or tools/. The format is identical, and the overlay is
installed with zpkg overlay add zignos-menu. See
ZIGNOS MENU (overlays) for details.
| File | Required | Contents |
|---|---|---|
version |
Required | Upstream version |
sources |
Required | Source URLs (one URL per line) |
checksums |
Required | SHA-256 values in the same order as sources |
build |
Required | Shell script that builds and installs into the destroot |
revision |
Optional | Revision number within the same version (default 0) |
slot |
Optional | Slot (default 0) |
depends |
Optional | Runtime dependencies |
makedepends |
Optional | Build-time dependencies |
postdepends |
Optional | Runtime dependencies required for selection but not build ordering (PDEPEND-like) |
rebuild_after |
Optional | Rebuild the package after all installs when this package is in the same plan |
iuse |
Optional | USE flags the package understands |
provides |
Optional | Virtual packages |
conflicts |
Optional | Conflicts |
build_network |
Optional | Network access during the build (default from the sandbox settings) |
update.conf |
Optional | Upstream detection metadata for zpkg bump; without it, detection is inferred from version and sources |
upgrade_warning |
Optional | Warning shown during zpkg upgrade |
post_install |
Optional | Hook after install |
post_remove |
Optional | Hook after removal |
*.patch |
Optional | Patches applied from the build script |
The update.conf format and the zpkg bump safety model are documented in
Version bumps (zpkg bump).
license / maintainer / homepage / test / patches/ + series are not
standardized yet. They are candidates for a future recipe specification
extension.
Sources and checksums
Section titled “Sources and checksums”# sourceshttps://example.invalid/foo-1.2.3.tar.xz
# checksums<64-character SHA-256>With multiple sources, list the sources and checksums lines in the same
order. zpkg checks the fetched files against checksums before building.
Build contract
Section titled “Build contract”zpkg runs build with bash. By convention the shebang is #!/bin/sh,
but it is safest to write within POSIX and avoid bash-specific features. The
following environment variables are available.
| Variable | Contents |
|---|---|
ZPKG_SRC |
Parent directory of the unpacked sources |
ZPKG_VERSION |
The value of version |
ZPKG_RECIPE_DIR |
The recipe directory |
ZPKG_DESTROOT |
Temporary root for the install |
ZPKG_ROOT |
The actual installation root |
ZPKG_USE |
Effective USE flags |
Typical example:
#!/bin/shset -ecd "$ZPKG_SRC/foo-$ZPKG_VERSION"./configure --prefix=/usrmake -j"$(nproc)"make DESTDIR="$ZPKG_DESTROOT" installRunning make check / ctest / meson test and so on inside build runs
tests at build time.
Dependencies
Section titled “Dependencies”depends lists packages needed at runtime; makedepends lists packages
needed only at build time. Atoms can include version constraints and
provides. See zpkg design for dependency resolution
details.
Two-phase builds (postdepends / rebuild_after)
Section titled “Two-phase builds (postdepends / rebuild_after)”When two packages need each other at build time (for example elogind and
polkit), postdepends can express the selection dependency without adding a
build-order edge. rebuild_after then rebuilds the owner after every install
once the trigger package is present in the same plan.
- The first build runs without the trigger; the second is the final artifact
- The first build’s binpkg is not cached
post_installruns for both builds, so hooks must be idempotent- Triggers are limited to the current plan; this is for runtime feature detection, not header/ABI changes
zpkg build(no install) does not run the second phase
elogind uses only rebuild_after=polkit; Plasma pulls polkit, so the
stage3/base system does not get polkit forced in.
USE flags
Section titled “USE flags”List the flags the package understands in iuse. The actual values are
decided by /etc/zpkg/use.conf and package.use, and passed to build as
ZPKG_USE.
post_install / post_remove run after the package is installed or removed.
They are used for creating service users, setting directory ownership,
refreshing caches and similar tasks.
#!/bin/shinstall -d -m755 -o foo -g foo "$ZPKG_ROOT/var/lib/foo"Do not replace /etc/passwd / /etc/group wholesale from a package.
initscripts owns the base accounts and merges only the missing entries from
/usr/share/zignos/base-accounts/. See
System accounts for details.
Patches
Section titled “Patches”Current recipes place patch files in the recipe directory and apply them
explicitly inside build.
patch -p1 -d "$ZPKG_SRC/foo-$ZPKG_VERSION" \ < "$ZPKG_RECIPE_DIR/fix-build.patch"There is no patches/ directory or automatic application via series yet.
How to manage patches is under consideration together with standardizing the
recipe specification.
