Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 runCommand, 4 junicode, 5 texliveBasic, 6}: 7let 8 texliveWithJunicode = texliveBasic.withPackages (p: [ 9 p.xetex 10 junicode 11 ]); 12 13 texTest = 14 { 15 package, 16 tex, 17 fonttype, 18 file, 19 }: 20 lib.attrsets.nameValuePair "${package}-${tex}-${fonttype}" ( 21 runCommand "${package}-test-${tex}-${fonttype}.pdf" 22 { 23 nativeBuildInputs = [ texliveWithJunicode ]; 24 inherit tex fonttype file; 25 } 26 '' 27 substituteAll $file test.tex 28 HOME=$PWD $tex test.tex 29 cp test.pdf $out 30 '' 31 ); 32in 33builtins.listToAttrs ( 34 lib.mapCartesianProduct texTest { 35 tex = [ 36 "xelatex" 37 "lualatex" 38 ]; 39 fonttype = [ 40 "ttf" 41 "otf" 42 ]; 43 package = [ "junicode" ]; 44 file = [ ./test.tex ]; 45 } 46 ++ [ 47 (texTest { 48 package = "junicodevf"; 49 fonttype = "ttf"; 50 tex = "lualatex"; 51 file = ./test-vf.tex; 52 }) 53 ] 54)