1 # shellcheck disable=SC2154,SC2034,SC2016
4 local -r thirdparty
="${1-}/src/hare/third-party"
5 if [[ -d "$thirdparty" ]]; then
6 addToSearchPath HAREPATH
"$thirdparty"
10 # Hare's stdlib should come after its third party libs, since the latter may
11 # expand or shadow the former.
12 readonly hareSetStdlibPhase
='
13 addToSearchPath HAREPATH "@hare_stdlib@"
15 readonly hareInfoPhase
='
16 echoCmd "HARECACHE" "$HARECACHE"
17 echoCmd "HAREPATH" "$HAREPATH"
18 echoCmd "hare" "$(command -v hare)"
19 echoCmd "hare-native" "$(command -v hare-native)"
21 appendToVar prePhases hareSetStdlibPhase hareInfoPhase
23 readonly hare_unconditional_flags
="@hare_unconditional_flags@"
24 case "${hareBuildType:-"release"}" in
25 "release") export NIX_HAREFLAGS
="-R $hare_unconditional_flags" ;;
26 "debug") export NIX_HAREFLAGS
="$hare_unconditional_flags" ;;
28 printf -- 'Invalid hareBuildType: "%s"\n' "${hareBuildType-}"
33 HARECACHE
="$(mktemp -d)"
36 addEnvHooks
"$hostOffset" addHarepath