mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 01:53:09 +09:00
Merge pull request #268613 from xworld21/texlive-tldeps
texlive: fix dependency bug, add docs and release notes
This commit is contained in:
commit
a126a8545a
3 changed files with 37 additions and 18 deletions
|
@ -98,24 +98,30 @@ Release 23.11 ships with a new interface that will eventually replace `texlive.c
|
||||||
|
|
||||||
## Custom packages {#sec-language-texlive-custom-packages}
|
## 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`.
|
||||||
|
|
||||||
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; }`.
|
The functions `texlive.combine` and `texlive.withPackages` recognise the following 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.
|
- `"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.
|
||||||
|
|
||||||
|
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
|
```nix
|
||||||
with import <nixpkgs> {};
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
let
|
let
|
||||||
foiltex = stdenvNoCC.mkDerivation (finalAttrs: {
|
foiltex = stdenvNoCC.mkDerivation {
|
||||||
pname = "latex-foiltex";
|
pname = "latex-foiltex";
|
||||||
version = "2.1.4b";
|
version = "2.1.4b";
|
||||||
passthru = {
|
|
||||||
pkgs = [ finalAttrs.finalPackage ];
|
outputs = [ "tex" "texdoc" ];
|
||||||
tlDeps = with texlive; [ latex ];
|
passthru.tlDeps = with texlive; [ latex ];
|
||||||
tlType = "run";
|
|
||||||
};
|
|
||||||
|
|
||||||
srcs = [
|
srcs = [
|
||||||
(fetchurl {
|
(fetchurl {
|
||||||
|
@ -138,7 +144,13 @@ let
|
||||||
runHook postUnpack
|
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;
|
dontConfigure = true;
|
||||||
|
|
||||||
|
@ -148,15 +160,23 @@ let
|
||||||
# Generate the style files
|
# Generate the style files
|
||||||
latex foiltex.ins
|
latex foiltex.ins
|
||||||
|
|
||||||
|
# Generate the documentation
|
||||||
|
export HOME=.
|
||||||
|
latexmk -pdf foiltex.dtx
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
path="$out/tex/latex/foiltex"
|
path="$tex/tex/latex/foiltex"
|
||||||
mkdir -p "$path"
|
mkdir -p "$path"
|
||||||
cp *.{cls,def,clo} "$path/"
|
cp *.{cls,def,clo,sty} "$path/"
|
||||||
|
|
||||||
|
path="$texdoc/doc/tex/latex/foiltex"
|
||||||
|
mkdir -p "$path"
|
||||||
|
cp *.pdf "$path/"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
@ -167,12 +187,9 @@ let
|
||||||
maintainers = with maintainers; [ veprbl ];
|
maintainers = with maintainers; [ veprbl ];
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
});
|
|
||||||
|
|
||||||
latex_with_foiltex = texlive.combine {
|
|
||||||
inherit (texlive) scheme-small;
|
|
||||||
inherit foiltex;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
latex_with_foiltex = texliveSmall.withPackages (_: [ foiltex ]);
|
||||||
in
|
in
|
||||||
runCommand "test.pdf" {
|
runCommand "test.pdf" {
|
||||||
nativeBuildInputs = [ latex_with_foiltex ];
|
nativeBuildInputs = [ latex_with_foiltex ];
|
||||||
|
|
|
@ -553,6 +553,8 @@ The module update takes care of the new config syntax and the data itself (user
|
||||||
|
|
||||||
- The argument `vendorSha256` of `buildGoModule` is deprecated. Use `vendorHash` instead. ([\#259999](https://github.com/NixOS/nixpkgs/pull/259999))
|
- 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}
|
## 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**.
|
- 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**.
|
||||||
|
|
|
@ -58,7 +58,7 @@ let
|
||||||
keySet = p: {
|
keySet = p: {
|
||||||
key = ((p.name or "${p.pname}-${p.version}") + "-" + p.tlOutputName or p.outputName or "");
|
key = ((p.name or "${p.pname}-${p.version}") + "-" + p.tlOutputName or p.outputName or "");
|
||||||
inherit p;
|
inherit p;
|
||||||
tlDeps = p.tlDeps or (p.requiredTeXPackages or (_: [ ]) [ ]);
|
tlDeps = if p ? tlDeps then ensurePkgSets p.tlDeps else (p.requiredTeXPackages or (_: [ ]) tl);
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# texlive.combine: the wrapper already resolves all dependencies
|
# texlive.combine: the wrapper already resolves all dependencies
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue