2007-08-26 15:59:31 -06:00
|
|
|
args:
|
|
|
|
with args;
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
inherit (builtins)
|
|
|
|
head tail isList;
|
2007-10-29 04:52:04 -06:00
|
|
|
in
|
2007-08-26 15:59:31 -06:00
|
|
|
rec {
|
|
|
|
|
|
|
|
/*
|
|
|
|
let shelllib = rec {
|
|
|
|
a= {
|
|
|
|
text = "aaaa";
|
|
|
|
deps = [b c];
|
|
|
|
};
|
|
|
|
b = {
|
|
|
|
text = "b";
|
|
|
|
};
|
|
|
|
c = {
|
|
|
|
text = "c";
|
|
|
|
deps = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
[textClosure [shelllib.a]
|
|
|
|
textclosure shelllib.a];
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2007-10-29 04:52:04 -06:00
|
|
|
textClosureDupList = arg:
|
2007-08-26 15:59:31 -06:00
|
|
|
(
|
|
|
|
if isList arg then
|
|
|
|
textClosureDupList {text = ""; deps = arg;}
|
|
|
|
else
|
2007-10-29 04:52:04 -06:00
|
|
|
(concatLists (map textClosureDupList arg.deps)) ++ [arg]
|
2007-08-26 15:59:31 -06:00
|
|
|
);
|
|
|
|
|
2007-10-29 04:52:04 -06:00
|
|
|
textClosureList = arg:
|
|
|
|
(map (x : x.text)
|
|
|
|
(uniqList {inputList = textClosureDupList arg;}));
|
|
|
|
textClosure = arg: concatStringsSep "\n" (textClosureList arg);
|
2007-08-26 15:59:31 -06:00
|
|
|
|
2007-11-08 07:34:54 -07:00
|
|
|
textClosureMap = f: arg: concatStringsSep "\n" (map f (textClosureList arg));
|
|
|
|
|
2007-10-29 04:52:04 -06:00
|
|
|
noDepEntry = text : {inherit text;deps = [];};
|
|
|
|
FullDepEntry = text : deps: {inherit text deps;};
|
2007-08-28 17:29:23 -06:00
|
|
|
PackEntry = deps: {inherit deps; text="";};
|
2007-08-26 15:59:31 -06:00
|
|
|
}
|