3
0
Fork 0
forked from mirrors/nixpkgs

texlive: move fastUnique from default.nix to combine.nix

This commit is contained in:
Dmitry Kalinkin 2019-03-03 21:06:10 -05:00
parent fdfcc4c292
commit a1505f3c6a
No known key found for this signature in database
GPG key ID: 5157B3EC8B2CA333
2 changed files with 7 additions and 7 deletions

View file

@ -31,6 +31,12 @@ let
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
};
# TODO: replace by buitin once it exists
fastUnique = comparator: list: with lib;
let un_adj = l: if length l < 2 then l
else optional (head l != elemAt l 1) (head l) ++ un_adj (tail l);
in un_adj (lib.sort comparator list);
mkUniquePkgs = pkgs: fastUnique (a: b: a < b) # highlighting hack: >
# here we deal with those dummy packages needed for hyphenation filtering
(map (p: if lib.isDerivation p then p.outPath else "") pkgs);

View file

@ -24,7 +24,7 @@ let
# function for creating a working environment from a set of TL packages
combine = import ./combine.nix {
inherit bin combinePkgs buildEnv fastUnique lib makeWrapper writeText
inherit bin combinePkgs buildEnv lib makeWrapper writeText
stdenv python ruby perl;
ghostscript = ghostscriptX; # could be without X, probably, but we use X above
};
@ -171,12 +171,6 @@ let
combinePkgs = pkgSet: lib.concatLists # uniqueness is handled in `combine`
(lib.mapAttrsToList (_n: a: a.pkgs) pkgSet);
# TODO: replace by buitin once it exists
fastUnique = comparator: list: with lib;
let un_adj = l: if length l < 2 then l
else optional (head l != elemAt l 1) (head l) ++ un_adj (tail l);
in un_adj (lib.sort comparator list);
in
tl // {
inherit bin combine;