From 31654fc1530eada011873d19ba8db0f91638b975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andres=20L=C3=B6h?= Date: Tue, 9 Aug 2011 14:55:53 +0000 Subject: [PATCH] Filter null elements from dependency lists to keep hashes stable. svn path=/nixpkgs/trunk/; revision=28434 --- pkgs/development/libraries/haskell/cabal/cabal.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/haskell/cabal/cabal.nix b/pkgs/development/libraries/haskell/cabal/cabal.nix index 575b0d45b47..3f5bac4d7e4 100644 --- a/pkgs/development/libraries/haskell/cabal/cabal.nix +++ b/pkgs/development/libraries/haskell/cabal/cabal.nix @@ -11,6 +11,15 @@ "isLibrary" "isExecutable" ]; + # Stuff happening after the user preferences have been processed. We remove + # internal attributes and strip null elements from the dependency lists, all + # in the interest of keeping hashes stable. + postprocess = + x : (removeAttrs x internalAttrs) // { + buildInputs = stdenv.lib.filter (y : ! (y == null)) x.buildInputs; + propagatedBuildInputs = stdenv.lib.filter (y : ! (y == null)) x.propagatedBuildInputs; + }; + defaults = self : { # self is the final version of the attribute set @@ -142,5 +151,5 @@ # in Cabal derivations. inherit stdenv ghc; }; - in stdenv.mkDerivation (removeAttrs ((rec { f = defaults f // args f; }).f) internalAttrs) ; + in stdenv.mkDerivation (postprocess ((rec { f = defaults f // args f; }).f)) ; }