mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 05:43:50 +03:00
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:
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}
|
||||
'';
|
||||
}))
|
||||
|
@ -89,6 +89,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
|
||||
ghc = ghc; # refers to ghcPlain
|
||||
};
|
||||
|
||||
# The normal GHC wrapper doesn't create links to the documentation in
|
||||
# ~/.nix-profile. Having this second wrapper allows us to remedy the
|
||||
# situation without re-building all Haskell packages. At the next
|
||||
# stdenv-updates merge, this second wrapper will go away.
|
||||
|
||||
ghcUserEnvWrapper = pkgs.appendToName "new" (callPackage ../development/compilers/ghc/wrapper.nix {
|
||||
ghc = ghc; # refers to ghcPlain
|
||||
forUserEnv = true;
|
||||
});
|
||||
|
||||
# An experimental wrapper around ghcPlain that does not automatically
|
||||
# pick up packages from the profile, but instead has a fixed set of packages
|
||||
# in its global database. The set of packages can be specified as an
|
||||
|
Loading…
Reference in New Issue
Block a user