Skip to content

Commit

Permalink
Merge pull request #250621 from apfelkuchen6/texlive-noop-refactors
Browse files Browse the repository at this point in the history
texlive: some small refactors
  • Loading branch information
veprbl authored Aug 27, 2023
2 parents a999c1c + babce2f commit bf6e5e7
Show file tree
Hide file tree
Showing 3 changed files with 440 additions and 419 deletions.
20 changes: 19 additions & 1 deletion pkgs/tools/typesetting/tex/texlive/combine.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
params: with params;
{ lib, buildEnv, runCommand, writeText, makeWrapper, libfaketime, makeFontsConf
, perl, bash, coreutils, gnused, gnugrep, gawk, ghostscript
, bin, tl }:
# combine =
args@{
pkgFilter ? (pkg: pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "core"
Expand All @@ -8,6 +10,22 @@ args@{
, ...
}:
let
# combine a set of TL packages into a single TL meta-package
combinePkgs = pkgList: lib.catAttrs "pkg" (
let
# a TeX package is an attribute set { pkgs = [ ... ]; ... } where pkgs is a list of derivations
# the derivations make up the TeX package and optionally (for backward compatibility) its dependencies
tlPkgToSets = { pkgs, ... }: map ({ tlType, version ? "", outputName ? "", ... }@pkg: {
# outputName required to distinguish among bin.core-big outputs
key = "${pkg.pname or pkg.name}.${tlType}-${version}-${outputName}";
inherit pkg;
}) pkgs;
pkgListToSets = lib.concatMap tlPkgToSets; in
builtins.genericClosure {
startSet = pkgListToSets pkgList;
operator = { pkg, ... }: pkgListToSets (pkg.tlDeps or []);
});

pkgSet = removeAttrs args [ "pkgFilter" "extraName" "extraVersion" ];
pkgList = rec {
combined = combinePkgs (lib.attrValues pkgSet);
Expand Down
Loading

0 comments on commit bf6e5e7

Please sign in to comment.