ghcWithPackages: call this derivation exactly like the compiler it's based on

Furthermore, export "name" and "version" attributes that match those of the
underlying compiler. These changes make a ghcWithPackages-generated wrapper
look exactly like a normal GHC derivation and it can be used anywhere in
Nixpkgs where a normal GHC would be used.
This commit is contained in:
Peter Simons 2015-01-09 19:27:47 +01:00
parent 96ae5d58bf
commit 38e2e8702c

View File

@ -33,8 +33,8 @@ let
isHaskellPkg = x: (x ? pname) && (x ? version); isHaskellPkg = x: (x ? pname) && (x ? version);
in in
if packages == [] then ghc else if packages == [] then ghc else
buildEnv { stdenv.lib.addPassthru (buildEnv {
name = "haskell-env-${ghc.name}"; inherit (ghc) name;
paths = stdenv.lib.filter isHaskellPkg (stdenv.lib.closePropagation packages) ++ [ghc]; paths = stdenv.lib.filter isHaskellPkg (stdenv.lib.closePropagation packages) ++ [ghc];
inherit ignoreCollisions; inherit ignoreCollisions;
postBuild = '' postBuild = ''
@ -76,4 +76,4 @@ buildEnv {
$out/bin/ghc-pkg recache $out/bin/ghc-pkg recache
$out/bin/ghc-pkg check $out/bin/ghc-pkg check
''; '';
} }) { inherit (ghc) version; }