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.
This commit is contained in:
Matthew Bauer 2019-03-02 02:21:32 -05:00
parent ee35de1861
commit 71f189f26f

View file

@ -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