Skip to main content
Rockbox Daemon is built by three tools in series:
  1. Make — compiles the Rockbox C firmware into static libraries.
  2. Cargo — compiles the Rust crates into static libraries (crate-type = ["staticlib"]).
  3. Zig — links everything (plus CPAL) into a single executable.

Dependencies

You’ll also need:
  • Zig ≥ 0.16 — ziglang.org/download
  • Rust stablerustup update stable
  • Deno — for the web UI build

Full build

The binary lands at zig/zig-out/bin/rockboxd.

Iterating on changes

Zig only re-links when the static libraries are newer than the binary. After editing C, run make lib first. After editing Rust, run cargo build --release first.
Stale binary pitfall. If behaviour doesn’t match the source, check mtimes:
If rockboxd is newer than every .a file, Zig considered the link up-to-date and your change wasn’t picked up.

Verifying symbols

Headless build (CPAL / no SDL)

The recommended build path for desktop use is the headless target, which uses CPAL for audio instead of SDL. A convenience script handles all three steps:
This configures and builds the firmware against build-headless/, compiles the Rust crates with the cpal feature, and links the result with Zig.

Embeddable library (librockboxd.a)

zig build lib produces zig/zig-out/lib/librockboxd.a — a fat archive that desktop GUIs (GPUI, macOS Swift, Qt, …) can link against to boot the Rockbox daemon in-process. The public C header is include/rockboxd.h.

Don’t re-run tools/configure

build-lib/ is pre-configured for the sdlapp target; build-headless/ is pre-configured for the headless target. Re-running tools/configure regenerates the Makefile and overwrites local edits. If you really need to reconfigure, do it knowingly and review the resulting diff.