From 59134519eefd1bc2b855b7e918e3f380e8c222dc Mon Sep 17 00:00:00 2001
From: Tomas Hlavaty <tom@logand.com>
Date: Wed, 7 Dec 2016 17:58:36 +0100
Subject: [PATCH] fix win-dll-link.sh setup hook (#20925)

if a dll is symlink then dll files from the symlinked
directory need to be taken
---
 pkgs/build-support/setup-hooks/win-dll-link.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/build-support/setup-hooks/win-dll-link.sh b/pkgs/build-support/setup-hooks/win-dll-link.sh
index be63f69ca10b..634a9d18f00d 100644
--- a/pkgs/build-support/setup-hooks/win-dll-link.sh
+++ b/pkgs/build-support/setup-hooks/win-dll-link.sh
@@ -33,7 +33,7 @@ _linkDLLs() {
         # That DLL might have its own (transitive) dependencies,
         # so add also all DLLs from its directory to be sure.
         local dllPath2
-        for dllPath2 in "$dllPath" "$(dirname "$dllPath")"/*.dll; do
+        for dllPath2 in "$dllPath" "$(dirname $(readlink "$dllPath" || echo "$dllPath"))"/*.dll; do
             if [ -e ./"$(basename "$dllPath2")" ]; then continue; fi
             ln -sr "$dllPath2" .
             linkCount=$(($linkCount+1))