Overview
Recipes are TOML files that define how to download, build, and package software for Redox OS. Each recipe is stored inrecipes/<category>/<package>/recipe.toml.
Recipe Structure
A recipe consists of up to four main sections:Source Section
Defines where and how to download the source code.Git Source
Clone from a Git repository:string
required
URL to the Git repository
string
Git branch to track (recommended for reproducibility)
string
Specific Git commit SHA (recommended for reproducible builds)
string
URL to upstream repository for reference
boolean
Use treeless clone for faster downloads (default: true if
rev specified)array
List of patch files to apply after cloning
string
Shell script to run after cloning and patching
Tar Source
Download from a tarball:string
required
URL to the tarball (supports .tar.gz, .tar.xz, .tar.bz2, .zip)
string
BLAKE3 checksum of the tarball (strongly recommended for reproducibility)
array
List of patch files to apply after extraction
string
Shell script to run after extraction and patching
Path Source
Use a local directory:Shared Source
Reuse another package’s source:No Source
For meta-packages with no source code:Build Section
Defines how to compile the source code.Template Field
All build sections must specify a template:None Template
No build process (meta-packages):Remote Template
Download pre-built binary package:The build system automatically downloads packages from the official Redox package repository.
Cargo Template
For Rust projects using Cargo:string
Path to Cargo.toml relative to source root (default: “Cargo.toml”)
array
Additional flags passed to
cargo buildarray
Specific packages to build from a workspace
array
Example binaries to build and install
Configure Template
For autotools-based projects:array
Flags passed to the
./configure script- Runs
./configure --host=${TARGET} --prefix=/usr ${configureflags} - Runs
make -j${COOKBOOK_MAKE_JOBS} - Runs
make DESTDIR=${COOKBOOK_STAGE} install
CMake Template
For CMake-based projects:array
Flags passed to the
cmake commandMeson Template
For Meson build system:array
Flags passed to the
meson setup commandCustom Template
For projects requiring custom build logic:string
required
Shell script executed in the build directory
Build Dependencies
Libraries and tools required at build time:array
Runtime libraries and build tools required during compilation
array
Additional development tools (compilers, build systems, etc.)
Package Section
Metadata about the resulting package.array
Packages required at runtime
string
Package version (auto-detected from source if possible)
string
Brief description of the package
Optional Packages
Create additional packages from the same source:string
required
Suffix for the package name (creates
package-name-suffix)array
Additional dependencies for this optional package
array
File patterns to include (supports glob patterns)
Build Script Environment
Available environment variables in custom build scripts:Directory Variables
Tool Variables
Target Variables
Compiler Variables
Helper Functions
The Cookbook provides helper functions in build scripts:DYNAMIC_INIT
Initialize for dynamic linking:DYNAMIC_STATIC_INIT
Support both static and dynamic linking:cookbook_cargo
Standard Cargo build and install:cookbook_configure
Standard configure, make, install:cookbook_meson
Standard Meson build:Complete Examples
Minimal Rust Package
Library with Dependencies
Complex Build Script
Meta Package
Package Naming
Regular Packages
Package name is the directory name:Optional Packages
Optional packages append the name:zlib-dev.
Host Packages
Packages for the host system use-host suffix internally:
Validation
The recipe system validates:Well-formed TOML syntax
Required fields present
Valid template names
Dependency packages exist
Best Practices
Always Use Checksums
Specify
blake3 for all tarball sources to ensure reproducible builds.Pin Git Revisions
Specify
branch and rev for Git sources to enable reproducible builds.Minimal Dependencies
Only list dependencies actually required - extras slow down builds.
Use Standard Templates
Prefer
cargo, configure, cmake, or meson over custom when possible.See Also
- Application Porting Guide - How to port software
- Cookbook System - Build system architecture
- Build System Reference - Full build system guide