about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-01 11:51:02 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-01 11:51:02 +0000
commitaa4353b499e6950b7333578f936455a628145c31 (patch)
treec6332cedece2327a18d08794755b3fc0f9f1905b /nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix
parentac456d475f4e50818499b804359355c0f3b4bbf7 (diff)
parent52185f4d76c18d8348f963795dfed1de018e8dfe (diff)
downloadnixlib-aa4353b499e6950b7333578f936455a628145c31.tar
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.gz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.bz2
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.lz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.xz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.zst
nixlib-aa4353b499e6950b7333578f936455a628145c31.zip
Merge https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix')
-rw-r--r--nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix b/nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix
index 1821d1c090de..8a3265727168 100644
--- a/nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix
+++ b/nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix
@@ -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"
@@ -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);