From 71f189f26f07bafb775132c9ef5c8e44a8375412 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 2 Mar 2019 02:21:32 -0500 Subject: [PATCH] stack-hook: deduplicate better No need to check for duplicates as it is now handled by setup.sh deduplication. Also should use targetOffset here instead of hostOffset because we are using stack-hook natively. --- pkgs/development/haskell-modules/stack-hook.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/stack-hook.sh b/pkgs/development/haskell-modules/stack-hook.sh index d942662294c..44c184a5624 100644 --- a/pkgs/development/haskell-modules/stack-hook.sh +++ b/pkgs/development/haskell-modules/stack-hook.sh @@ -1,11 +1,11 @@ addStackArgs () { - if [ -d "$1/lib" ] && [[ "$STACK_IN_NIX_EXTRA_ARGS" != *"--extra-lib-dirs=$1/lib"* ]]; then + if [ -n "$(echo $1/lib/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 + if [ -d "$1/include" ]; then STACK_IN_NIX_EXTRA_ARGS+=" --extra-include-dirs=$1/include" fi } -addEnvHooks "$hostOffset" addStackArgs +addEnvHooks "$targetOffset" addStackArgs