From ba3c9df01aea8405ba803db13aca4ebb27d1a460 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 30 Oct 2017 00:54:48 -0400 Subject: [PATCH] texlive: fix evaluation on Nix 1.11 The problem was in builtins.partition call. I've tried to rewrite it with builtins.foldl', but that doesn't help. However replacing it with a pair of builtins.filter calls works. diff --git a/lib/lists.nix b/lib/lists.nix --- a/lib/lists.nix +++ b/lib/lists.nix @@ -242,10 +242,10 @@ rec { => { right = [ 5 3 4 ]; wrong = [ 1 2 ]; } */ partition = builtins.partition or (pred: - foldr (h: t: + builtins.foldl' (t: h: if pred h - then { right = [h] ++ t.right; wrong = t.wrong; } - else { right = t.right; wrong = [h] ++ t.wrong; } + then { right = t.right ++ [h]; wrong = t.wrong; } + else { right = t.right; wrong = t.wrong ++ [h]; } ) { right = []; wrong = []; }); /* Merges two lists of the same size together. If the sizes aren't the same --- pkgs/tools/typesetting/tex/texlive/combine.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix index 07a4196bfb5..35fee64ba54 100644 --- a/pkgs/tools/typesetting/tex/texlive/combine.nix +++ b/pkgs/tools/typesetting/tex/texlive/combine.nix @@ -12,9 +12,11 @@ let (bin.core.doc // { pname = "core"; tlType = "doc"; }) ]; }; + partition = builtins.partition or (pred: l: + { right = builtins.filter pred l; wrong = builtins.filter (e: !(pred e)) l; }); pkgList = rec { all = lib.filter pkgFilter (combinePkgs pkgSet); - splitBin = lib.partition (p: p.tlType == "bin") all; + splitBin = partition (p: p.tlType == "bin") all; bin = mkUniquePkgs splitBin.right ++ lib.optional (lib.any (p: p.tlType == "run" && p.pname == "pdfcrop") splitBin.wrong)