hare: add setupHook to configure HAREPATH

Add a setupHook so the HAREPATH environment variable is correctly set to
point to the hare stdlib and any third-party libraries.
This commit is contained in:
Michael Auchter 2022-06-22 15:08:55 +00:00
parent f514ac5a4a
commit 8ecf252eda
2 changed files with 10 additions and 0 deletions

View file

@ -37,6 +37,7 @@ stdenv.mkDerivation rec {
qbe
];
setupHook = ./setup-hook.sh;
strictDeps = true;
configurePhase =

View file

@ -0,0 +1,9 @@
addHarepath () {
for haredir in third-party stdlib; do
if [[ -d "$1/src/hare/$haredir" ]]; then
addToSearchPath HAREPATH "$1/src/hare/$haredir"
fi
done
}
addEnvHooks "$hostOffset" addHarepath