2007-08-26 23:59:31 +02:00
|
|
|
args:
|
|
|
|
with args;
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
inherit (builtins)
|
|
|
|
head tail isList;
|
2007-10-29 11:52:04 +01:00
|
|
|
in
|
2007-08-26 23:59:31 +02: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 11:52:04 +01:00
|
|
|
textClosureDupList = arg:
|
2007-08-26 23:59:31 +02:00
|
|
|
(
|
|
|
|
if isList arg then
|
|
|
|
textClosureDupList {text = ""; deps = arg;}
|
|
|
|
else
|
2007-10-29 11:52:04 +01:00
|
|
|
(concatLists (map textClosureDupList arg.deps)) ++ [arg]
|
2007-08-26 23:59:31 +02:00
|
|
|
);
|
|
|
|
|
2007-10-29 11:52:04 +01:00
|
|
|
textClosureList = arg:
|
|
|
|
(map (x : x.text)
|
|
|
|
(uniqList {inputList = textClosureDupList arg;}));
|
|
|
|
textClosure = arg: concatStringsSep "\n" (textClosureList arg);
|
2007-08-26 23:59:31 +02:00
|
|
|
|
2007-11-08 15:34:54 +01:00
|
|
|
textClosureMap = f: arg: concatStringsSep "\n" (map f (textClosureList arg));
|
|
|
|
|
2007-10-29 11:52:04 +01:00
|
|
|
noDepEntry = text : {inherit text;deps = [];};
|
|
|
|
FullDepEntry = text : deps: {inherit text deps;};
|
2007-08-29 01:29:23 +02:00
|
|
|
PackEntry = deps: {inherit deps; text="";};
|
2007-08-26 23:59:31 +02:00
|
|
|
}
|