git.iko.soy/typeable/nixpkgs
on master help sign in
haskell: Fix with-packages-wrapper MacOS linker hack for GHC 8.8

`with-packages-wrapper.nix` has a hack to workaround the linker limit in MacOS Sierra. However that is now broken with GHC 8.8, because of slight change in the format of the package config. In short, the package config produced by GHC 8.8 has a new line between the key and list of values, while earlier versions have them separated by a single space. This PR fixes the linker hack by modifying the `grep` and `sed` commands to pattern match on either space or new line, so that the hack can work on all versions of GHC.

commit32d2de8e0092864cb0a9dfe68ea67a813e0e600e authorSoares Chen <soares.chen@gmail.com> dateThu 28 May 2020, 22:10 (6 years ago) parent53594c6
1 file changed+2−2
pkgs/development/haskell-modules/with-packages-wrapper.nix+2−2
pkgs/development/haskell-modules/with-packages-wrapper.nix+2−2
@@ -113,7 +113,7 @@ symlinkJoin {
113113 # Clean up the old links that may have been (transitively) included by
114114 # symlinkJoin:
115115 rm -f $dynamicLinksDir/*
116− for d in $(grep dynamic-library-dirs $packageConfDir/*|awk '{print $2}'|sort -u); do
116+ for d in $(grep -Poz "dynamic-library-dirs:\s*\K .+\n" $packageConfDir/*|awk '{print $2}'|sort -u); do
117117 ln -s $d/*.dylib $dynamicLinksDir
118118 done
119119 for f in $packageConfDir/*.conf; do
@@ -123,7 +123,7 @@ symlinkJoin {
123123 # $dynamicLinksDir
124124 cp $f $f-tmp
125125 rm $f
126− sed "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f
126+ sed "N;s,dynamic-library-dirs:\s*.*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f
127127 rm $f-tmp
128128 done
129129 '') + ''