Linux now gets gtk4/libadwaita declared as nix devbox packages (scoped to linux platforms, with the dev output requested explicitly - nixpkgs splits runtime libs from headers/pkgconfig, and devbox only installs the default output unless told otherwise). macOS keeps using Homebrew's build exactly as before (nixpkgs' GTK build is much rockier there). PKG_CONFIG_PATH moved out of the static env block (which can't be platform-conditional) into init_hook, which can branch on uname. Verified building clean with 0 warnings on both this machine (Linux) and apfel (macOS).
48 lines
1.4 KiB
JSON
48 lines
1.4 KiB
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",
|
|
"gtk4": {
|
|
"version": "latest",
|
|
"platforms": ["x86_64-linux", "aarch64-linux"],
|
|
"outputs": ["out", "dev"]
|
|
},
|
|
"libadwaita": {
|
|
"version": "latest",
|
|
"platforms": ["x86_64-linux", "aarch64-linux"],
|
|
"outputs": ["out", "dev"]
|
|
}
|
|
},
|
|
"env": {
|
|
"PATH": "/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
|
|
},
|
|
"shell": {
|
|
"init_hook": [
|
|
"export PKG_CONFIG_PATH=\"$DEVBOX_PACKAGES_DIR/lib/pkgconfig:$PKG_CONFIG_PATH\"",
|
|
"if [[ \"$(uname)\" == \"Darwin\" ]]; then export PKG_CONFIG_PATH=\"/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH\"; export PKG_CONFIG_PATH_arm64_apple_darwin=\"/opt/homebrew/lib/pkgconfig\"; fi"
|
|
],
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
}
|