texlive: use lists instead of sets to represent dependencies (#217230)
This commit is contained in:
parent
417dd2ad16
commit
ef15288944
|
@ -15,7 +15,7 @@ let
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
pkgList = rec {
|
pkgList = rec {
|
||||||
all = lib.filter pkgFilter (combinePkgs pkgSet);
|
all = lib.filter pkgFilter (combinePkgs (lib.attrValues pkgSet));
|
||||||
splitBin = builtins.partition (p: p.tlType == "bin") all;
|
splitBin = builtins.partition (p: p.tlType == "bin") all;
|
||||||
bin = mkUniqueOutPaths splitBin.right
|
bin = mkUniqueOutPaths splitBin.right
|
||||||
++ lib.optional
|
++ lib.optional
|
||||||
|
|
|
@ -30,9 +30,9 @@ let
|
||||||
|
|
||||||
# the set of TeX Live packages, collections, and schemes; using upstream naming
|
# the set of TeX Live packages, collections, and schemes; using upstream naming
|
||||||
tl = let
|
tl = let
|
||||||
orig = import ./pkgs.nix tl;
|
orig = import ./pkgs.nix;
|
||||||
removeSelfDep = lib.mapAttrs
|
removeSelfDep = lib.mapAttrs
|
||||||
(n: p: if p ? deps then p // { deps = lib.filterAttrs (dn: _: n != dn) p.deps; }
|
(n: p: if p ? deps then p // { deps = lib.filter (dn: n != dn) p.deps; }
|
||||||
else p);
|
else p);
|
||||||
clean = removeSelfDep (orig // {
|
clean = removeSelfDep (orig // {
|
||||||
# overrides of texlive.tlpdb
|
# overrides of texlive.tlpdb
|
||||||
|
@ -42,24 +42,24 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
xdvi = orig.xdvi // { # it seems to need it to transform fonts
|
xdvi = orig.xdvi // { # it seems to need it to transform fonts
|
||||||
deps = (orig.xdvi.deps or {}) // { inherit (tl) metafont; };
|
deps = (orig.xdvi.deps or []) ++ [ "metafont" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# remove dependency-heavy packages from the basic collections
|
# remove dependency-heavy packages from the basic collections
|
||||||
collection-basic = orig.collection-basic // {
|
collection-basic = orig.collection-basic // {
|
||||||
deps = removeAttrs orig.collection-basic.deps [ "metafont" "xdvi" ];
|
deps = lib.filter (n: n != "metafont" && n != "xdvi") orig.collection-basic.deps;
|
||||||
};
|
};
|
||||||
# add them elsewhere so that collections cover all packages
|
# add them elsewhere so that collections cover all packages
|
||||||
collection-metapost = orig.collection-metapost // {
|
collection-metapost = orig.collection-metapost // {
|
||||||
deps = orig.collection-metapost.deps // { inherit (tl) metafont; };
|
deps = orig.collection-metapost.deps ++ [ "metafont" ];
|
||||||
};
|
};
|
||||||
collection-plaingeneric = orig.collection-plaingeneric // {
|
collection-plaingeneric = orig.collection-plaingeneric // {
|
||||||
deps = orig.collection-plaingeneric.deps // { inherit (tl) xdvi; };
|
deps = orig.collection-plaingeneric.deps ++ [ "xdvi" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# override cyclic dependency until #167226 is fixed
|
# override cyclic dependency until #167226 is fixed
|
||||||
xecjk = orig.xecjk // {
|
xecjk = orig.xecjk // {
|
||||||
deps = removeAttrs orig.xecjk.deps [ "ctex" ];
|
deps = lib.remove "ctex" orig.xecjk.deps;
|
||||||
};
|
};
|
||||||
|
|
||||||
texdoc = orig.texdoc // {
|
texdoc = orig.texdoc // {
|
||||||
|
@ -82,8 +82,11 @@ let
|
||||||
};
|
};
|
||||||
}); # overrides
|
}); # overrides
|
||||||
|
|
||||||
# tl =
|
linkDeps = lib.mapAttrs (_: attrs: attrs // lib.optionalAttrs (attrs ? deps) {
|
||||||
in lib.mapAttrs flatDeps clean;
|
deps = builtins.map (n: tl.${n}) attrs.deps;
|
||||||
|
}); # transform [ "dep1" "dep2" ... ] into [ tl."dep1" ... ]
|
||||||
|
|
||||||
|
in lib.mapAttrs flatDeps (linkDeps clean);
|
||||||
# TODO: texlive.infra for web2c config?
|
# TODO: texlive.infra for web2c config?
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,7 +116,7 @@ let
|
||||||
++ lib.optional (attrs.sha512 ? source) (mkPkgV "source")
|
++ lib.optional (attrs.sha512 ? source) (mkPkgV "source")
|
||||||
++ lib.optional (bin ? ${pname})
|
++ lib.optional (bin ? ${pname})
|
||||||
( bin.${pname} // { inherit pname; tlType = "bin"; } )
|
( bin.${pname} // { inherit pname; tlType = "bin"; } )
|
||||||
++ combinePkgs (attrs.deps or {});
|
++ combinePkgs (attrs.deps or []);
|
||||||
};
|
};
|
||||||
|
|
||||||
# for daily snapshots
|
# for daily snapshots
|
||||||
|
@ -183,8 +186,8 @@ let
|
||||||
);
|
);
|
||||||
|
|
||||||
# combine a set of TL packages into a single TL meta-package
|
# combine a set of TL packages into a single TL meta-package
|
||||||
combinePkgs = pkgSet: lib.concatLists # uniqueness is handled in `combine`
|
combinePkgs = pkgList: lib.concatLists # uniqueness is handled in `combine`
|
||||||
(lib.mapAttrsToList (_n: a: a.pkgs) pkgSet);
|
(builtins.map (a: a.pkgs) pkgList);
|
||||||
|
|
||||||
in
|
in
|
||||||
tl // {
|
tl // {
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
||||||
# wrap whole file into an attrset
|
# wrap whole file into an attrset
|
||||||
1itl: { # no indentation
|
1i{ # no indentation
|
||||||
$a}
|
$a}
|
||||||
|
|
||||||
# form an attrmap per package
|
# form an attrmap per package
|
||||||
|
@ -28,16 +28,16 @@ $a}
|
||||||
|
|
||||||
# extract deps
|
# extract deps
|
||||||
/^depend [^.]+$/{
|
/^depend [^.]+$/{
|
||||||
s/^depend (.+)$/ deps."\1" = tl."\1";/
|
s/^depend (.+)$/ deps = [\n "\1"/
|
||||||
|
|
||||||
# loop through following depend lines
|
# loop through following depend lines
|
||||||
:next
|
:next
|
||||||
h ; N # save & read next line
|
h ; N # save & read next line
|
||||||
s/\ndepend (.+)\.(.+)$//
|
s/\ndepend (.+)\.(.+)$//
|
||||||
s/\ndepend (.+)$/\n deps."\1" = tl."\1";/
|
s/\ndepend (.+)$/\n "\1"/
|
||||||
t next # loop if the previous lines matched
|
t next # loop if the previous lines matched
|
||||||
|
|
||||||
x; p; x # print saved deps
|
x; s/$/\n ];/p ; x # print saved deps
|
||||||
s/^.*\n// # remove deps, resume processing
|
s/^.*\n// # remove deps, resume processing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue