tests.texlive: replace texlive.combine with texlive.withPackages

This commit is contained in:
Vincenzo Mantova 2023-11-04 20:02:26 +00:00
parent ae7102b8d7
commit 9a5095a537

View file

@ -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 = lib.head texlive.hyphen-base.pkgs; texLive = texliveFull; in
lib.recurseIntoAttrs {
# language.def
etex = mkTeXTest {
@ -290,8 +287,8 @@ 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;
schemeFull = texliveFull;
schemeInfraOnly = texliveInfraOnly;
} ''
mkdir -p "$out"/{scheme-infraonly,scheme-full}
@ -323,7 +320,7 @@ 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;
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)"