summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/with-packages-wrapper.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-01-07 23:51:27 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-08 00:25:04 +0000
commit096ca241d9505c265fe46cacec7b316eecb401ad (patch)
tree1c4f5daadf7a0f2544ef9b1d219ddcca6867df0d /pkgs/development/haskell-modules/with-packages-wrapper.nix
parent1acfa8ff79fd8895ebc7ca9954830ace0577fff2 (diff)
parent5f6df74f66246a2eb198b0bc3fe1f7d2dff57062 (diff)
downloadnixpkgs-096ca241d9505c265fe46cacec7b316eecb401ad.tar
nixpkgs-096ca241d9505c265fe46cacec7b316eecb401ad.tar.gz
nixpkgs-096ca241d9505c265fe46cacec7b316eecb401ad.tar.bz2
nixpkgs-096ca241d9505c265fe46cacec7b316eecb401ad.tar.lz
nixpkgs-096ca241d9505c265fe46cacec7b316eecb401ad.tar.xz
nixpkgs-096ca241d9505c265fe46cacec7b316eecb401ad.tar.zst
nixpkgs-096ca241d9505c265fe46cacec7b316eecb401ad.zip
Merge remote-tracking branch 'nixpkgs/master' into master
Diffstat (limited to 'pkgs/development/haskell-modules/with-packages-wrapper.nix')
-rw-r--r--pkgs/development/haskell-modules/with-packages-wrapper.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix
index 49beed8549d..404fd0d9440 100644
--- a/pkgs/development/haskell-modules/with-packages-wrapper.nix
+++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
+{ lib, stdenv, ghc, llvmPackages, packages, buildEnv, makeWrapper
 , withLLVM ? false
 , postBuild ? ""
 , ghcLibdir ? null # only used by ghcjs, when resolving plugins
@@ -51,15 +51,25 @@ let
                    ++ lib.optional stdenv.targetPlatform.isDarwin llvmPackages.clang);
 in
 if paths == [] && !withLLVM then ghc else
-symlinkJoin {
+buildEnv {
   # this makes computing paths from the name attribute impossible;
   # if such a feature is needed, the real compiler name should be saved
   # as a dedicated drv attribute, like `compiler-name`
   name = ghc.name + "-with-packages";
   paths = paths ++ [ghc];
+  extraOutputsToInstall = ["doc"];
   postBuild = ''
     . ${makeWrapper}/nix-support/setup-hook
 
+    # We make changes to ghc binaries in $out/bin. buildEnv gives a
+    # symlink if only one of the paths has the subdirectory. If so,
+    # we need to remove it for our new wrappers.
+
+    if [ -L "$out/bin" ]; then
+      rm -f "$out/bin"
+      mkdir -p "$out/bin"
+    fi
+
     # wrap compiler executables with correct env variables
 
     for prg in ${ghcCommand} ${ghcCommand}i ${ghcCommand}-${ghc.version} ${ghcCommand}i-${ghc.version}; do