lean4-htt/nix/leanpkg-dev.in
2021-01-19 19:06:01 +01:00

18 lines
545 B
Bash

#!@bash@/bin/bash
set -euo pipefail
[[ $# -gt 0 && "$1" == print-paths && ( -f flake.nix || -d Lean && -f ../flake.nix ) ]] || exec @leanpkg@/bin/leanpkg "$@"
shift
deps="$@"
target=".#print-paths"
args=()
# HACK: use stage 0 instead of 1 inside Lean's own `src/`
[[ -d Lean && -f ../flake.nix ]] && target="@srcTarget@print-paths" && args=@srcArgs@
for dep in $deps; do
target="$target.\"$dep\""
done
# -v only has "built ...", but "-vv" is a bit too verbose
echo "Building dependencies..." >&2
@nix@/bin/nix run "$target" ${args[*]} -v