vifm: 0.13 -> 0.14 (#380559)
[NixPkgs.git] / pkgs / by-name / ha / hare / setup-hook.sh
blob388ed9bcf25f4d6c59d38a4f39d12384d7ac15a6
1 # shellcheck disable=SC2154,SC2034,SC2016
3 addHarepath() {
4 local -r thirdparty="${1-}/src/hare/third-party"
5 if [[ -d "$thirdparty" ]]; then
6 addToSearchPath HAREPATH "$thirdparty"
7 fi
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-}"
29 exit 1
31 esac
33 HARECACHE="$(mktemp -d)"
34 export HARECACHE
36 addEnvHooks "$hostOffset" addHarepath