ghcWithPackages: more robust searching for dylib to link on macOS (#411741)

This commit is contained in:
Nick Cao 2025-05-30 08:04:05 -04:00 committed by GitHub
commit 1c7b92be21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -156,11 +156,11 @@ else
# Boot libraries are located differently than other libraries since GHC 9.6, so handle them separately.
if [[ -x "${bootLibDir}" ]]; then
ln -s "${bootLibDir}"/*.dylib $dynamicLinksDir
find "${bootLibDir}" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \;
fi
for d in $(grep -Poz "dynamic-library-dirs:\s*\K .+\n" $packageConfDir/*|awk '{print $2}'|sort -u); do
ln -s $d/*.dylib $dynamicLinksDir
find "$d" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \;
done
for f in $packageConfDir/*.conf; do
# Initially, $f is a symlink to a read-only file in one of the inputs