From 475c8bfb7d13de76d6e0ff1c052ad95b2754d7e2 Mon Sep 17 00:00:00 2001 From: Christian Gram Kalhauge Date: Wed, 20 Jul 2016 14:21:53 +0200 Subject: [PATCH] Fix DLYD problem with haskell libraries on Darwin This commit fixes a problem that occurs with externally linked haskell libraries on Darwin. It does this by adding the libraries to the --extra-lib-dirs flag and the DYLD_LIBRARY_PATH environment variable. --- pkgs/development/haskell-modules/generic-builder.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 72110227140..2bcf6ee854f 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -193,6 +193,9 @@ stdenv.mkDerivation ({ fi if [ -d "$p/lib" ]; then configureFlags+=" --extra-lib-dirs=$p/lib" + if [[ ${ if stdenv.isDarwin then "yes" else "no"} = "yes" ]]; then + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$p/lib; + fi fi done ${ghcCommand}-pkg --${packageDbFlag}="$packageConfDir" recache