Author: andres
Date: Tue Aug  9 14:55:53 2011
New Revision: 28434
URL: https://svn.nixos.org/websvn/nix/?rev=28434&sc=1

Log:
Filter null elements from dependency lists to keep hashes stable.

Modified:
   nixpkgs/trunk/pkgs/development/libraries/haskell/cabal/cabal.nix

Modified: nixpkgs/trunk/pkgs/development/libraries/haskell/cabal/cabal.nix
==============================================================================
--- nixpkgs/trunk/pkgs/development/libraries/haskell/cabal/cabal.nix    Tue Aug 
 9 14:32:20 2011        (r28433)
+++ nixpkgs/trunk/pkgs/development/libraries/haskell/cabal/cabal.nix    Tue Aug 
 9 14:55:53 2011        (r28434)
@@ -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)) ;
 }
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to