ghc-wrapper: install the GHC documentation into the user's profile
The freaky implementation was done that way in order to avoid unnecessary re-builds of all Haskell packages by changing the wrapper script used internally in those builds. See <https://github.com/NixOS/nixpkgs/pull/466> for further details.
This commit is contained in:
committed by
Peter Simons
parent
65b95b159e
commit
3bf0d2b960
@@ -1,4 +1,4 @@
|
||||
{ stdenv, ghc, makeWrapper, coreutils }:
|
||||
{ stdenv, ghc, makeWrapper, coreutils, forUserEnv ? false }:
|
||||
|
||||
let
|
||||
ghc761OrLater = !stdenv.lib.versionOlder ghc.version "7.6.1";
|
||||
@@ -54,4 +54,11 @@ stdenv.mkDerivation ({
|
||||
inherit ghc;
|
||||
inherit (ghc) meta;
|
||||
ghcVersion = ghc.version;
|
||||
} // (stdenv.lib.optionalAttrs ghc761OrLater { preFixup = "sed -i -e 's|-package-conf|${packageDBFlag}|' $out/bin/ghc-get-packages.sh"; }))
|
||||
} // (stdenv.lib.optionalAttrs ghc761OrLater { preFixup = "sed -i -e 's|-package-conf|${packageDBFlag}|' $out/bin/ghc-get-packages.sh"; })
|
||||
// (stdenv.lib.optionalAttrs forUserEnv {
|
||||
postFixup= ''
|
||||
ln -s $ghc/lib $out/lib;
|
||||
mkdir -p $out/share/doc
|
||||
ln -s $ghc/share/doc/ghc $out/share/doc/ghc-${ghc.version}
|
||||
'';
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user