From 5cd82587aa6708b076fedb44c333f27c78ce6aa1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 19 Jan 2012 22:29:26 +0000 Subject: overrideDerivation: Check whether `hostDrv' and `buildDrv' are present. svn path=/nixpkgs/trunk/; revision=31727 --- pkgs/lib/customisation.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pkgs/lib') 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) -- cgit 1.4.1