2024-05-02 00:46:19 +00:00
|
|
|
# legacy texlive.combine wrapper
|
2024-06-30 08:16:52 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
toTLPkgList,
|
|
|
|
toTLPkgSets,
|
|
|
|
buildTeXEnv,
|
|
|
|
}:
|
2024-05-02 00:46:19 +00:00
|
|
|
args@{
|
2024-06-30 08:16:52 +00:00
|
|
|
pkgFilter ? (
|
|
|
|
pkg: pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "core" || pkg.hasManpages or false
|
|
|
|
),
|
|
|
|
extraName ? "combined",
|
|
|
|
extraVersion ? "",
|
|
|
|
...
|
2024-05-02 00:46:19 +00:00
|
|
|
}:
|
|
|
|
let
|
2024-06-30 08:16:52 +00:00
|
|
|
pkgSet = removeAttrs args [
|
|
|
|
"pkgFilter"
|
|
|
|
"extraName"
|
|
|
|
"extraVersion"
|
|
|
|
];
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
# combine a set of TL packages into a single TL meta-package
|
2024-06-30 08:16:52 +00:00
|
|
|
combinePkgs =
|
|
|
|
pkgList:
|
|
|
|
lib.catAttrs "pkg" (
|
|
|
|
let
|
|
|
|
# a TeX package used to be 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 =
|
|
|
|
drv:
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
) (drv.pkgs or (toTLPkgList drv));
|
|
|
|
pkgListToSets = lib.concatMap tlPkgToSets;
|
|
|
|
in
|
|
|
|
builtins.genericClosure {
|
|
|
|
startSet = pkgListToSets pkgList;
|
|
|
|
operator = { pkg, ... }: pkgListToSets (pkg.tlDeps or [ ]);
|
|
|
|
}
|
|
|
|
);
|
2024-05-02 00:46:19 +00:00
|
|
|
combined = combinePkgs (lib.attrValues pkgSet);
|
|
|
|
|
|
|
|
# convert to specified outputs
|
2024-06-30 08:16:52 +00:00
|
|
|
tlTypeToOut = {
|
|
|
|
run = "tex";
|
|
|
|
doc = "texdoc";
|
|
|
|
source = "texsource";
|
|
|
|
bin = "out";
|
|
|
|
tlpkg = "tlpkg";
|
|
|
|
};
|
|
|
|
toSpecified =
|
|
|
|
{ tlType, ... }@drv:
|
|
|
|
drv
|
|
|
|
// {
|
|
|
|
outputSpecified = true;
|
|
|
|
tlOutputName = tlTypeToOut.${tlType};
|
|
|
|
};
|
2024-05-02 00:46:19 +00:00
|
|
|
all = lib.filter pkgFilter combined ++ lib.filter (pkg: pkg.tlType == "tlpkg") combined;
|
|
|
|
converted = builtins.map toSpecified all;
|
|
|
|
in
|
|
|
|
buildTeXEnv {
|
|
|
|
__extraName = extraName;
|
|
|
|
__extraVersion = extraVersion;
|
|
|
|
requiredTeXPackages = _: converted;
|
|
|
|
__combine = true;
|
|
|
|
__fromCombineWrapper = true;
|
|
|
|
}
|