Merge pull request #268613 from xworld21/texlive-tldeps

texlive: fix dependency bug, add docs and release notes

Changed files
+37 -18
doc
languages-frameworks
nixos
doc
manual
release-notes
pkgs
tools
typesetting
tex
+34 -17
doc/languages-frameworks/texlive.section.md
···
## Custom packages {#sec-language-texlive-custom-packages}
-
You may find that you need to use an external TeX package. A derivation for such package has to provide the contents of the "texmf" directory in its output and provide the appropriate `tlType` attribute (one of `"run"`, `"bin"`, `"doc"`, `"source"`). Dependencies on other TeX packages can be listed in the attribute `tlDeps`.
+
You may find that you need to use an external TeX package. A derivation for such package has to provide the contents of the "texmf" directory in its `"tex"` output, according to the [TeX Directory Structure](https://tug.ctan.org/tds/tds.html). Dependencies on other TeX packages can be listed in the attribute `tlDeps`.
+
+
The functions `texlive.combine` and `texlive.withPackages` recognise the following outputs:
-
Such derivation must then be listed in the attribute `pkgs` of an attribute set passed to `texlive.combine`, for instance by passing `extraPkgs = { pkgs = [ custom_package ]; };`. Within Nixpkgs, `pkgs` should be part of the derivation itself, allowing users to call `texlive.combine { inherit (texlive) scheme-small; inherit some_tex_package; }`.
+
- `"out"`: contents are linked in the TeX Live environment, and binaries in the `$out/bin` folder are wrapped;
+
- `"tex"`: linked in `$TEXMFDIST`; files should follow the TDS (for instance `$tex/tex/latex/foiltex/foiltex.cls`);
+
- `"texdoc"`, `"texsource"`: ignored by default, treated as `"tex"`;
+
- `"tlpkg"`: linked in `$TEXMFROOT/tlpkg`;
+
- `"man"`, `"info"`, ...: the other outputs are combined into separate outputs.
-
Here is a (very verbose) example where the attribute `pkgs` is attached to the derivation itself, which requires creating a fixed point. See also the packages `auctex`, `eukleides`, `mftrace` for more examples.
+
When using `pkgFilter`, `texlive.combine` will assign `tlType` respectively `"bin"`, `"run"`, `"doc"`, `"source"`, `"tlpkg"` to the above outputs.
+
+
Here is a (very verbose) example. See also the packages `auctex`, `eukleides`, `mftrace` for more examples.
```nix
with import <nixpkgs> {};
let
-
foiltex = stdenvNoCC.mkDerivation (finalAttrs: {
+
foiltex = stdenvNoCC.mkDerivation {
pname = "latex-foiltex";
version = "2.1.4b";
-
passthru = {
-
pkgs = [ finalAttrs.finalPackage ];
-
tlDeps = with texlive; [ latex ];
-
tlType = "run";
-
};
+
+
outputs = [ "tex" "texdoc" ];
+
passthru.tlDeps = with texlive; [ latex ];
srcs = [
(fetchurl {
···
runHook postUnpack
'';
-
nativeBuildInputs = [ texlive.combined.scheme-small ];
+
nativeBuildInputs = [
+
(texliveSmall.withPackages (ps: with ps; [ cm-super hypdoc latexmk ]))
+
# multiple-outputs.sh fails if $out is not defined
+
(writeShellScript "force-tex-output.sh" ''
+
out="''${tex-}"
+
'')
+
];
dontConfigure = true;
···
# Generate the style files
latex foiltex.ins
+
# Generate the documentation
+
export HOME=.
+
latexmk -pdf foiltex.dtx
+
runHook postBuild
'';
installPhase = ''
runHook preInstall
-
path="$out/tex/latex/foiltex"
+
path="$tex/tex/latex/foiltex"
+
mkdir -p "$path"
+
cp *.{cls,def,clo,sty} "$path/"
+
+
path="$texdoc/doc/tex/latex/foiltex"
mkdir -p "$path"
-
cp *.{cls,def,clo} "$path/"
+
cp *.pdf "$path/"
runHook postInstall
'';
···
maintainers = with maintainers; [ veprbl ];
platforms = platforms.all;
};
-
});
+
};
-
latex_with_foiltex = texlive.combine {
-
inherit (texlive) scheme-small;
-
inherit foiltex;
-
};
+
latex_with_foiltex = texliveSmall.withPackages (_: [ foiltex ]);
in
runCommand "test.pdf" {
nativeBuildInputs = [ latex_with_foiltex ];
+2
nixos/doc/manual/release-notes/rl-2311.section.md
···
- The argument `vendorSha256` of `buildGoModule` is deprecated. Use `vendorHash` instead. ([\#259999](https://github.com/NixOS/nixpkgs/pull/259999))
+
- TeX Live environments can now be built with the new `texlive.withPackages`. The procedure for creating custom TeX packages has been changed, see the [Nixpkgs manual](https://nixos.org/manual/nixpkgs/stable/#sec-language-texlive-custom-packages) for more details.
+
## Nixpkgs internals {#sec-release-23.11-nixpkgs-internals}
- Node.js v14, v16 has been removed as they were end of life. Any dependent packages that contributors were not able to reasonably upgrade were dropped after a month of notice to their maintainers, were **removed**.
+1 -1
pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
···
keySet = p: {
key = ((p.name or "${p.pname}-${p.version}") + "-" + p.tlOutputName or p.outputName or "");
inherit p;
-
tlDeps = p.tlDeps or (p.requiredTeXPackages or (_: [ ]) [ ]);
+
tlDeps = if p ? tlDeps then ensurePkgSets p.tlDeps else (p.requiredTeXPackages or (_: [ ]) tl);
};
in
# texlive.combine: the wrapper already resolves all dependencies