lol

Merge remote-tracking branch 'takt/sierra-haskell'

+39 -1
+17
pkgs/development/haskell-modules/generic-builder.nix
··· 228 228 configureFlags+=" --extra-lib-dirs=$p/lib" 229 229 fi 230 230 done 231 + '' + (optionalString stdenv.isDarwin '' 232 + # Work around a limit in the Mac OS X Sierra linker on the number of paths 233 + # referenced by any one dynamic library: 234 + # 235 + # Create a local directory with symlinks of the *.dylib (Mac OS X shared 236 + # libraries) from all the dependencies. 237 + local dynamicLinksDir="$out/lib/links" 238 + mkdir -p $dynamicLinksDir 239 + local foundDylib=false 240 + for d in $(grep dynamic-library-dirs $packageConfDir/*|awk '{print $2}'); do 241 + ln -s $d/*.dylib $dynamicLinksDir 242 + done 243 + # Edit the local package DB to reference the links directory. 244 + for f in $packageConfDir/*.conf; do 245 + sed -i "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f 246 + done 247 + '') + '' 231 248 ${ghcCommand}-pkg --${packageDbFlag}="$packageConfDir" recache 232 249 233 250 runHook postSetupCompilerEnvironment
+22 -1
pkgs/development/haskell-modules/with-packages-wrapper.nix
··· 96 96 makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}" 97 97 fi 98 98 done 99 - 99 + '' + (lib.optionalString stdenv.isDarwin '' 100 + # Work around a linker limit in Mac OS X Sierra (see generic-builder.nix): 101 + local packageConfDir="$out/lib/${ghc.name}/package.conf.d"; 102 + local dynamicLinksDir="$out/lib/links" 103 + mkdir -p $dynamicLinksDir 104 + # Clean up the old links that may have been (transitively) included by 105 + # symlinkJoin: 106 + rm -f $dynamicLinksDir/* 107 + for d in $(grep dynamic-library-dirs $packageConfDir/*|awk '{print $2}'); do 108 + ln -s $d/*.dylib $dynamicLinksDir 109 + done 110 + for f in $packageConfDir/*.conf; do 111 + # Initially, $f is a symlink to a read-only file in one of the inputs 112 + # (as a result of this symlinkJoin derivation). 113 + # Replace it with a copy whose dynamic-library-dirs points to 114 + # $dynamicLinksDir 115 + cp $f $f-tmp 116 + rm $f 117 + sed "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f 118 + rm $f-tmp 119 + done 120 + '') + '' 100 121 ${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"} 101 122 ${# ghcjs will read the ghc_libdir file when resolving plugins. 102 123 lib.optionalString (isGhcjs && ghcLibdir != null) ''