haskell.buildStackProject: use setup hook

This makes things easier and hopefully fixes the arg too long issue.

Fixes #49206.
This commit is contained in:
Matthew Bauer
2019-01-07 21:28:53 -06:00
parent 04beae0979
commit 0dabacae00
2 changed files with 46 additions and 28 deletions

View File

@@ -0,0 +1,11 @@
addStackArgs () {
if [ -d "$1/lib" ] && [[ "$STACK_IN_NIX_EXTRA_ARGS" != *"--extra-lib-dirs=$1/lib"* ]]; then
STACK_IN_NIX_EXTRA_ARGS+=" --extra-lib-dirs=$1/lib"
fi
if [ -d "$1/include" ] && [[ "$STACK_IN_NIX_EXTRA_ARGS" != *"--extra-include-dirs=$1/include"* ]]; then
STACK_IN_NIX_EXTRA_ARGS+=" --extra-include-dirs=$1/include"
fi
}
addEnvHooks "$hostOffset" addStackArgs