diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2023-11-06 16:47:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-06 16:47:04 -0500 |
commit | 93b63a2cabbd80a7c7727b447664714757defa6a (patch) | |
tree | 84a5b7cdbaae36f211fa8af9a351bd42b9abc133 /pkgs/test | |
parent | 61a70ae22d3cf4ed3ad5229e7f4b0804c63ac104 (diff) | |
parent | f5edeac421435433eb651ae520ae0b9994c2d07b (diff) |
Merge pull request #265514 from xworld21/treewide-texlive-with-packages
treewide: switch to texlive.withPackages
Diffstat (limited to 'pkgs/test')
-rw-r--r-- | pkgs/test/texlive/default.nix | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/pkgs/test/texlive/default.nix b/pkgs/test/texlive/default.nix index 7081346688261..12fdd5c45f8b1 100644 --- a/pkgs/test/texlive/default.nix +++ b/pkgs/test/texlive/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildEnv, runCommand, fetchurl, file, texlive, writeShellScript, writeText }: +{ lib, stdenv, buildEnv, runCommand, fetchurl, file, texlive, writeShellScript, writeText, texliveInfraOnly, texliveSmall, texliveMedium, texliveFull }: rec { @@ -6,7 +6,7 @@ rec { { name , format , text - , texLive ? texlive.combined.scheme-small + , texLive ? texliveSmall , options ? "-interaction=errorstopmode" , preTest ? "" , postTest ? "" @@ -43,7 +43,7 @@ rec { lualatex = mkTeXTest { name = "opentype-fonts-lualatex"; format = "lualatex"; - texLive = texlive.combine { inherit (texlive) scheme-small libertinus-fonts; }; + texLive = texliveSmall.withPackages (ps: [ ps.libertinus-fonts ]); text = '' \documentclass{article} \usepackage{fontspec} @@ -61,7 +61,7 @@ rec { chktex = runCommand "texlive-test-chktex" { nativeBuildInputs = [ - (texlive.combine { inherit (texlive) scheme-infraonly chktex; }) + (texlive.withPackages (ps: [ ps.chktex ])) ]; input = builtins.toFile "chktex-sample.tex" '' \documentclass{article} @@ -77,7 +77,7 @@ rec { dvipng = lib.recurseIntoAttrs { # https://github.com/NixOS/nixpkgs/issues/75605 basic = runCommand "texlive-test-dvipng-basic" { - nativeBuildInputs = [ file texlive.combined.scheme-medium ]; + nativeBuildInputs = [ file texliveMedium ]; input = fetchurl { name = "test_dvipng.tex"; url = "http://git.savannah.nongnu.org/cgit/dvipng.git/plain/test_dvipng.tex?id=b872753590a18605260078f56cbd6f28d39dc035"; @@ -99,7 +99,7 @@ rec { # test dvipng's limited capability to render postscript specials via GS ghostscript = runCommand "texlive-test-ghostscript" { - nativeBuildInputs = [ file (texlive.combine { inherit (texlive) scheme-small dvipng; }) ]; + nativeBuildInputs = [ file (texliveSmall.withPackages (ps: [ ps.dvipng ])) ]; input = builtins.toFile "postscript-sample.tex" '' \documentclass{minimal} \begin{document} @@ -140,7 +140,7 @@ rec { # https://github.com/NixOS/nixpkgs/issues/75070 dvisvgm = runCommand "texlive-test-dvisvgm" { - nativeBuildInputs = [ file texlive.combined.scheme-medium ]; + nativeBuildInputs = [ file texliveMedium ]; input = builtins.toFile "dvisvgm-sample.tex" '' \documentclass{article} \begin{document} @@ -166,10 +166,7 @@ rec { texdoc = runCommand "texlive-test-texdoc" { nativeBuildInputs = [ - (texlive.combine { - inherit (texlive) scheme-infraonly luatex texdoc; - pkgFilter = pkg: lib.elem pkg.tlType [ "run" "bin" "doc" ]; - }) + (texlive.withPackages (ps: with ps; [ luatex ps.texdoc ps.texdoc.texdoc ])) ]; } '' texdoc --version @@ -214,7 +211,7 @@ rec { }; # check that all languages are available, including synonyms - allLanguages = let hyphenBase = lib.head texlive.hyphen-base.pkgs; texLive = texlive.combined.scheme-full; in + allLanguages = let hyphenBase = texlive.pkgs.hyphen-base; texLive = texliveFull; in lib.recurseIntoAttrs { # language.def etex = mkTeXTest { @@ -289,9 +286,9 @@ rec { # test that language files are generated as expected hyphen-base = runCommand "texlive-test-hyphen-base" { - hyphenBase = lib.head texlive.hyphen-base.pkgs; - schemeFull = texlive.combined.scheme-full; - schemeInfraOnly = texlive.combined.scheme-infraonly; + hyphenBase = texlive.pkgs.hyphen-base; + schemeFull = texliveFull; + schemeInfraOnly = texliveInfraOnly; } '' mkdir -p "$out"/{scheme-infraonly,scheme-full} @@ -322,8 +319,8 @@ rec { # test that fmtutil.cnf is fully regenerated on scheme-full fmtutilCnf = runCommand "texlive-test-fmtutil.cnf" { - kpathsea = lib.head texlive.kpathsea.pkgs; - schemeFull = texlive.combined.scheme-full; + kpathsea = texlive.pkgs.kpathsea.tex; + schemeFull = texliveFull; } '' mkdir -p "$out" @@ -335,7 +332,7 @@ rec { # verify that the restricted mode gets enabled when # needed (detected by checking if it disallows --gscmd) repstopdf = runCommand "texlive-test-repstopdf" { - nativeBuildInputs = [ (texlive.combine { inherit (texlive) scheme-infraonly epstopdf; }) ]; + nativeBuildInputs = [ (texlive.withPackages (ps: [ ps.epstopdf ])) ]; } '' ! (epstopdf --gscmd echo /dev/null 2>&1 || true) | grep forbidden >/dev/null (repstopdf --gscmd echo /dev/null 2>&1 || true) | grep forbidden >/dev/null @@ -345,7 +342,7 @@ rec { # verify that the restricted mode gets enabled when # needed (detected by checking if it disallows --gscmd) rpdfcrop = runCommand "texlive-test-rpdfcrop" { - nativeBuildInputs = [ (texlive.combine { inherit (texlive) scheme-infraonly pdfcrop; }) ]; + nativeBuildInputs = [ (texlive.withPackages (ps: [ ps.pdfcrop ])) ]; } '' ! (pdfcrop --gscmd echo $(command -v pdfcrop) 2>&1 || true) | grep 'restricted mode' >/dev/null (rpdfcrop --gscmd echo $(command -v pdfcrop) 2>&1 || true) | grep 'restricted mode' >/dev/null @@ -460,7 +457,7 @@ rec { runCommand "texlive-test-binaries" { inherit binaries contextTestTex latexTestTex texTestTex; - texliveScheme = texlive.combined.scheme-full; + texliveScheme = texliveFull; } '' loadables="$(command -v bash)" @@ -623,7 +620,7 @@ rec { (savedLicensesAttrNames scheme) != (correctLicensesAttrNames scheme); incorrectSchemes = lib.filterAttrs (n: hasLicenseMismatch) - texlive.combined; + (texlive.combined // texlive.schemes); prettyPrint = name: scheme: '' license info for ${name} is incorrect! Note that order is enforced. @@ -647,7 +644,7 @@ rec { # ease of testing fixedHashes = with lib; let fods = lib.concatMap - (p: lib.optional (p ? tex) p.tex + (p: lib.optional (p ? tex && isDerivation p.tex) p.tex ++ lib.optional (p ? texdoc) p.texdoc ++ lib.optional (p ? texsource) p.texsource ++ lib.optional (p ? tlpkg) p.tlpkg) |