From 663048f37849667f84bb1d941132369eff6e630f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 3 Jan 2017 23:09:14 +0100 Subject: [PATCH] Revert "haskell: workaround for bug with dynamic libraries on darwin" This reverts commit 19e2e7290a25819bd66a94db389e7e0d268f7fc0. See the correct fix in aa64994b48a29ea8d12323942f1743fa4133527a General purpose solution will be once we implement https://github.com/NixOS/nixpkgs/issues/21624 --- .../haskell-modules/generic-builder.nix | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index b15b4ad0bec8..092d4ae45242 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -244,41 +244,9 @@ stdenv.mkDerivation ({ runHook postConfigure ''; - # The darwin pre/post build sections are a workaround https://github.com/haskell/cabal/issues/4183 - # It seems like --extra-lib-dirs from the previous steps is not detected properly, - # to work around this we build using a DYLD_LIBRARY_PATH and fixup the build afterwards. buildPhase = '' runHook preBuild - ${optionalString stdenv.isDarwin '' - local inputClosure="" - for i in $propagatedNativeBuildInputs $nativeBuildInputs; do - findInputs $i inputClosure propagated-native-build-inputs - done - local -a inputLibs=() - for p in $inputClosure; do - if [ -d "$p/lib/${ghc.name}/package.conf.d" ]; then - continue - fi - if [ -d "$p/lib" ]; then - inputLibs+="$p/lib" - fi - done - - for lib in $inputLibs; do - export DYLD_LIBRARY_PATH="$lib:''${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}" - done - ''} ${setupCommand} build ${buildTarget}${crossCabalFlagsString} - ${optionalString stdenv.isDarwin '' - unset DYLD_LIBRARY_PATH - - local outputLib=dist/build/*-ghc${ghc.version}.dylib - for lib in $inputLib/*.dylib; do - for name in $(otool -L $outputLib | awk '$1 ~ /^'$(basename lib)'/ {print $1}' | cat); do - install_name_tool -change $name $lib $outputLib - done - done - ''} runHook postBuild '';