summary refs log tree commit diff
path: root/pkgs/lib
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-01-19 22:29:26 +0000
committerLudovic Courtès <ludo@gnu.org>2012-01-19 22:29:26 +0000
commit5cd82587aa6708b076fedb44c333f27c78ce6aa1 (patch)
treed29dace4df0860f02991eb0b09e8d628b9cb921e /pkgs/lib
parentbf71d12fd42d7cbeca323576ac53bbc08eaf3fda (diff)
overrideDerivation: Check whether `hostDrv' and `buildDrv' are present.
svn path=/nixpkgs/trunk/; revision=31727
Diffstat (limited to 'pkgs/lib')
-rw-r--r--pkgs/lib/customisation.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/lib/customisation.nix b/pkgs/lib/customisation.nix
index 49ae440a72997..54965ffb58045 100644
--- a/pkgs/lib/customisation.nix
+++ b/pkgs/lib/customisation.nix
@@ -42,9 +42,14 @@ rec {
     in newDrv //
       { meta = if drv ? meta then drv.meta else {};
         passthru = if drv ? passthru then drv.passthru else {};
-        hostDrv = overrideDerivation drv.hostDrv f;
-        buildDrv = overrideDerivation drv.buildDrv f;
-      };
+      }
+      //
+      (if (drv ? hostDrv && drv ? buildDrv)
+       then {
+         hostDrv = overrideDerivation drv.hostDrv f;
+         buildDrv = overrideDerivation drv.buildDrv f;
+       }
+       else { });
 
 
   # usage: (you can use override multiple times)