agda: postprocess and defaults need not be in the scope of args

This commit is contained in:
John Ericson 2015-05-30 19:22:32 +00:00
parent c1f5748983
commit 21b10ab44f

View file

@ -14,15 +14,6 @@ let
concatMapStrings = stdenv.lib.strings.concatMapStrings;
unwords = stdenv.lib.strings.concatStringsSep " ";
mapInside = xs: unwords (map (x: x + "/*") xs);
in
{ mkDerivation = args:
let
postprocess = x: x // {
sourceDirectories = filter (y: !(y == null)) x.sourceDirectories;
propagatedBuildInputs = filter (y : ! (y == null)) x.propagatedBuildInputs;
propagatedUserEnvPkgs = filter (y : ! (y == null)) x.propagatedUserEnvPkgs;
everythingFile = if x.everythingFile == "" then "Everything.agda" else x.everythingFile;
};
defaults = self : {
# There is no Hackage for Agda so we require src.
@ -93,8 +84,16 @@ in
};
};
};
in stdenv.mkDerivation
(postprocess (let super = defaults self // args self;
postprocess = x: x // {
sourceDirectories = filter (y: !(y == null)) x.sourceDirectories;
propagatedBuildInputs = filter (y : ! (y == null)) x.propagatedBuildInputs;
propagatedUserEnvPkgs = filter (y : ! (y == null)) x.propagatedUserEnvPkgs;
everythingFile = if x.everythingFile == "" then "Everything.agda" else x.everythingFile;
};
in
{ mkDerivation = args: let
super = defaults self // args self;
self = super // extension self super;
in self));
in stdenv.mkDerivation (postprocess self);
}