Files
depot/tools/meson/cargo-build.sh
T
SFG545 9953d4b2ee feat: add repo planning/binary repo support and Meson build integration
- add repos.toml source/binary repo configuration with arch overrides and priorities
- add dependency planner/execution plan flow with interactive provider selection and --yes support
- expand binary repo DB metadata (sha512, dependencies, file lists) and repo owns/search helpers
- add rootfs-scoped fd locking and minisign detached signing/verification helpers
- add Meson build/test support for the project with builddir-local CARGO_HOME/CARGO_TARGET_DIR
- install contrib example configs into sysconfdir (/etc/depot.d layout) via Meson
- improve builder env handling (sanitized PATH, tool env passthrough, CXXFLAGS support)
- support += appends in package specs and add build.flags.cxxflags parsing
- prompt for git credentials when private repo auth is required
- update docs/examples and dependency setup (system libs, zstdmt, tempfile pin)
2026-02-24 21:38:12 -06:00

39 lines
867 B
Bash

#!/bin/sh
set -eu
if [ "$#" -ne 6 ]; then
echo "usage: $0 <cargo> <src_root> <build_root> <profile> <release_flag> <output>" >&2
exit 2
fi
cargo_bin="$1"
src_root="$2"
build_root="$3"
profile="$4"
release_flag="$5"
output="$6"
cargo_home="$build_root/cargo-home"
cargo_target_dir="$build_root/cargo-target"
mkdir -p "$cargo_home" "$cargo_target_dir"
export CARGO_HOME="$cargo_home"
export CARGO_TARGET_DIR="$cargo_target_dir"
if [ "$release_flag" = "1" ]; then
"$cargo_bin" build --locked --manifest-path "$src_root/Cargo.toml" --release
else
"$cargo_bin" build --locked --manifest-path "$src_root/Cargo.toml"
fi
src_bin="$cargo_target_dir/$profile/depot"
if [ ! -f "$src_bin" ]; then
echo "cargo build finished but binary not found: $src_bin" >&2
exit 1
fi
mkdir -p "$(dirname "$output")"
cp "$src_bin" "$output"
chmod 0755 "$output"