diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix index ea292674819..d2608f89787 100644 --- a/pkgs/tools/typesetting/tex/texlive/combine.nix +++ b/pkgs/tools/typesetting/tex/texlive/combine.nix @@ -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); diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index 4904a60822a..05e078f8be8 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -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;