diff options
author | Peter Simons <simons@cryp.to> | 2015-01-10 09:12:37 +0100 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2015-01-10 15:55:47 +0100 |
commit | afca6145d4ff723e38a0f8311906a966a6d52105 (patch) | |
tree | 1e077b8a68019f421e6b7c0433c7a984a95ad9ff /pkgs/development/haskell-modules/with-packages-wrapper.nix | |
parent | fa27f2af5b3220ba8ff987fedbb46c4c953e3477 (diff) | |
download | nixlib-afca6145d4ff723e38a0f8311906a966a6d52105.tar nixlib-afca6145d4ff723e38a0f8311906a966a6d52105.tar.gz nixlib-afca6145d4ff723e38a0f8311906a966a6d52105.tar.bz2 nixlib-afca6145d4ff723e38a0f8311906a966a6d52105.tar.lz nixlib-afca6145d4ff723e38a0f8311906a966a6d52105.tar.xz nixlib-afca6145d4ff723e38a0f8311906a966a6d52105.tar.zst nixlib-afca6145d4ff723e38a0f8311906a966a6d52105.zip |
haskell-generic-builder: simplify "package.conf.d" management
The builder creates a temporary package.conf.d database in $TMP that contains everything required to build the current package (i.e. the transitive closure of the package's propagated build inputs). These files are no longer installed, however, we just install the package.conf file for the package we're actually building. This means that package.conf.d directory in $out won't have collisions anymore, which simplifies the with-packages-wrapper.nix a bit.
Diffstat (limited to 'pkgs/development/haskell-modules/with-packages-wrapper.nix')
-rw-r--r-- | pkgs/development/haskell-modules/with-packages-wrapper.nix | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index dbe6871d38b8..4648050dd739 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -31,11 +31,12 @@ let docDir = "$out/share/doc/ghc/html"; packageCfgDir = "${libDir}/package.conf.d"; isHaskellPkg = x: (x ? pname) && (x ? version); + paths = stdenv.lib.filter isHaskellPkg (stdenv.lib.closePropagation packages); in -if packages == [] then ghc else -stdenv.lib.addPassthru (buildEnv { +if paths == [] then ghc else +buildEnv { inherit (ghc) name; - paths = stdenv.lib.filter isHaskellPkg (stdenv.lib.closePropagation packages) ++ [ghc]; + paths = paths ++ [ghc]; inherit ignoreCollisions; postBuild = '' . ${makeWrapper}/nix-support/setup-hook @@ -72,15 +73,10 @@ stdenv.lib.addPassthru (buildEnv { makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}" done - rm $out/lib/${ghc.name}/package.conf.d - mkdir $out/lib/${ghc.name}/package.conf.d - for pkg in $paths; do - for file in "$pkg/nix-support/${ghc.name}-package.conf.d/"*.conf "$pkg/lib/${ghc.name}/package.conf.d/"*.conf; do - ln -sf $file $out/lib/${ghc.name}/package.conf.d/ - done - done - $out/bin/ghc-pkg recache $out/bin/ghc-pkg check ''; -}) { inherit (ghc) version; } +} // { + preferLocalBuild = true; + inherit (ghc) version meta; +} |