On Apple Silicon Macs, many GTK-related nixpkgs packages are marked as unsupported on aarch64-darwin. Instead of using nixpkgs for the GUI stack, use Homebrew which provides pre-built bottles for gtk4, libadwaita, and all their dependencies (glib, pango, cairo, gdk-pixbuf, graphene, etc.). The devbox config now provides only the Rust toolchain (rustc, cargo, pkg-config, rustfmt) and sets environment variables to locate the Homebrew-installed libraries: - PKG_CONFIG_PATH: /opt/homebrew/lib/pkgconfig - PKG_CONFIG_PATH_arm64_apple_darwin: /opt/homebrew/lib/pkgconfig - PATH: Includes /opt/homebrew/bin and /opt/homebrew/sbin This allows building the project with: devbox run build All 16 tests pass with: devbox run check Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
37 lines
965 B
JSON
37 lines
965 B
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.17.2/.schema/devbox.schema.json",
|
|
"packages": [
|
|
"rustc@latest",
|
|
"cargo@latest",
|
|
"pkg-config@latest",
|
|
"rustfmt@latest"
|
|
],
|
|
"env": {
|
|
"PATH": "/opt/homebrew/bin:/opt/homebrew/sbin:$PATH",
|
|
"PKG_CONFIG_PATH": "/opt/homebrew/lib/pkgconfig",
|
|
"PKG_CONFIG_PATH_arm64_apple_darwin": "/opt/homebrew/lib/pkgconfig"
|
|
},
|
|
"shell": {
|
|
"init_hook": [],
|
|
"scripts": {
|
|
"build": [
|
|
"cargo build --release"
|
|
],
|
|
"run": [
|
|
"cargo build --release && ./target/release/carrier"
|
|
],
|
|
"dev": [
|
|
"cargo build && ./target/debug/carrier"
|
|
],
|
|
"test": [
|
|
"cargo test"
|
|
],
|
|
"check": [
|
|
"cargo fmt --check && cargo build && cargo test"
|
|
],
|
|
"package": [
|
|
"flatpak-builder --force-clean --user --install-deps-from=flathub --install .flatpak com.randogoth.carrier.json"
|
|
]
|
|
}
|
|
}
|
|
}
|