Skip to content

Commit

Permalink
Revert "Revert "Revert "Revert "overrideDerivation: Simplify""""
Browse files Browse the repository at this point in the history
This reverts commit abf2d36.

I will fix the breakage in upcoming commits.

Signed-off-by: Shea Levy <shea@shealevy.com>
  • Loading branch information
shlevy committed May 15, 2013
1 parent 880a386 commit 05a02c6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkgs/lib/customisation.nix
Expand Up @@ -33,17 +33,14 @@ rec {

overrideDerivation = drv: f:
let
# Filter out special attributes.
drop = [ "meta" "passthru" "outPath" "drvPath" "crossDrv" "nativeDrv" "type" "override" "deepOverride" "origArgs" "drvAttrs" "outputName" "all" "out" ]
# also drop functions such as .merge .override etc
++ lib.filter (n: isFunction (getAttr n drv)) (attrNames drv);
attrs = removeAttrs drv drop;
newDrv = derivation (attrs // (f drv));
newDrv = derivation (drv.drvAttrs // (f drv));
in newDrv //
{ meta = if drv ? meta then drv.meta else {};
{ meta = drv.meta or {};
passthru = if drv ? passthru then drv.passthru else {};
}
//
(drv.passthru or {})
//
(if (drv ? crossDrv && drv ? nativeDrv)
then {
crossDrv = overrideDerivation drv.crossDrv f;
Expand Down

0 comments on commit 05a02c6

Please sign in to comment.