Skip to main content

Overview

The Redox OS recipe system, called Cookbook, is a package management and build system that handles compilation, installation, and dependency resolution for all userspace software. It’s similar to ports systems on BSD or package build systems like Gentoo’s Portage.

What is a Recipe?

A recipe is a specification for building and installing a software package. Each recipe contains:

Source

Where to fetch the source code (Git, tarball, etc.)

Dependencies

Build and runtime dependencies on other recipes

Build Instructions

How to configure, compile, and install the software

Patches

Modifications needed for Redox OS compatibility

Recipe Location

Recipes are stored in the recipes/ directory with this structure:

Recipe Structure

Each recipe is a directory containing:

Recipe Definition (recipe.toml)

The recipe.toml file defines how to build a package:

Basic Recipe Example

recipes/other/nano/recipe.toml

Recipe Sections

Defines where to get the source code:

Build Templates

Cookbook provides templates for common build systems:

Configure Template

For autotools-based projects:

Cargo Template

For Rust projects:

CMake Template

For CMake-based projects:

Custom Template

For unique build systems:

Build Variables

These variables are available in build scripts:
string
Target triple (e.g., x86_64-unknown-redox)
string
Root directory of the cookbook system
string
Installation destination directory
string
Path to current recipe directory
string
Source code directory
string
Build directory
string
Staging directory for installation
integer
Number of parallel jobs for make
string
Host system triple

Recipe Commands

The build system provides shorthand commands for working with recipes:

Basic Commands

Build (cook) a recipe and its dependencies:
Build multiple recipes:
Clean build artifacts:
Clean specific recipe including sysroot:
Download source code without building:
Remove downloaded sources:

Combined Commands

Query Commands

Working with Recipes

Building a Single Package

1

Find the Recipe

2

Check Dependencies

3

Build the Recipe

4

Install to Image

Modifying an Existing Recipe

1

Edit Recipe

Modify the recipe.toml file:
2

Clean and Rebuild

3

Test in Image

Creating a New Recipe

1

Create Recipe Directory

2

Create recipe.toml

recipe.toml
3

Test Build

4

Add to Configuration

Add to your TOML config:
config/mycustom.toml

Dependencies

Build Dependencies

Required to build the package:

Runtime Dependencies

Required to run the package:

Dependency Chains

Cookbook automatically resolves dependency chains:

Patches

Patches modify source code for Redox compatibility:

Applying Patches

Place .patch files in the recipe directory:
Cookbook automatically applies patches in alphabetical order.

Creating Patches

Patch Format

Use unified diff format:
fix-issue.patch

Repository Operations

Building All Packages

Cleaning Repository

Offline Builds

Build without internet access:

Advanced Topics

Binary Packages

Use pre-built packages:
.config
Cookbook will download pre-built packages from:

Debug Builds

Enable debug symbols:
.config
This sets these environment variables:

Continuing on Errors

Don’t stop on recipe failures:
.config
Useful for CI or finding all broken recipes.

AppStream Metadata

Generate application metadata:
.config

Cross-Compilation

Recipes support multiple architectures:

Recipe Best Practices

Prefer built-in templates (cargo, configure, etc.) over custom scripts when possible.
Try to upstream changes rather than maintaining patches. Keep patches small and well-documented.
Explicitly list all dependencies, including transitive ones that might be needed.
Test recipes in isolation before adding to system configuration.
Add comments explaining non-obvious build steps or workarounds.
Use specific Git revisions or tags rather than branches for reproducibility.

Troubleshooting Recipes

Check logs:
Verify dependency tree:
Check source version:
Check toolchain:

Recipe Repository

Browse available recipes:
  • Core recipes: recipes/core/
  • Drivers: recipes/drivers/
  • GNU tools: recipes/gnu/
  • Applications: recipes/other/
  • Games: recipes/games/
Online recipe browser: recipes.redox-os.org

Next Steps

Configuration

Learn about configuration files

Build System Overview

Understand the complete build system