summary refs log tree commit diff
path: root/pkgs/test
diff options
context:
space:
mode:
authorMalte Brandy <malte.brandy@maralorn.de>2021-05-07 15:03:54 +0200
committerMalte Brandy <malte.brandy@maralorn.de>2021-05-07 15:03:54 +0200
commit2a11f1f5cc1c4680b49240203db18ecbb19b9cc5 (patch)
treedf44c5fcd797c97297ab663b63167e9b4bc06a72 /pkgs/test
parentf73c2278d07e674233040422b71d965a0587756f (diff)
parentae1c8ede09b53007ba9b3c32f926c9c03547ae8b (diff)
downloadnixpkgs-2a11f1f5cc1c4680b49240203db18ecbb19b9cc5.tar
nixpkgs-2a11f1f5cc1c4680b49240203db18ecbb19b9cc5.tar.gz
nixpkgs-2a11f1f5cc1c4680b49240203db18ecbb19b9cc5.tar.bz2
nixpkgs-2a11f1f5cc1c4680b49240203db18ecbb19b9cc5.tar.lz
nixpkgs-2a11f1f5cc1c4680b49240203db18ecbb19b9cc5.tar.xz
nixpkgs-2a11f1f5cc1c4680b49240203db18ecbb19b9cc5.tar.zst
nixpkgs-2a11f1f5cc1c4680b49240203db18ecbb19b9cc5.zip
Merge branch 'master' into haskell-updates
Diffstat (limited to 'pkgs/test')
-rw-r--r--pkgs/test/texlive/default.nix113
1 files changed, 57 insertions, 56 deletions
diff --git a/pkgs/test/texlive/default.nix b/pkgs/test/texlive/default.nix
index 7a6affd6cbe..d8420d99136 100644
--- a/pkgs/test/texlive/default.nix
+++ b/pkgs/test/texlive/default.nix
@@ -1,4 +1,4 @@
-{ runCommandNoCC, fetchurl, file, texlive, writeShellScript }:
+{ lib, runCommandNoCC, fetchurl, file, texlive, writeShellScript }:
 
 {
   chktex = runCommandNoCC "texlive-test-chktex" {
@@ -16,68 +16,69 @@
     grep "One warning printed" "$out"
   '';
 
-  # https://github.com/NixOS/nixpkgs/issues/75605
-  dvipng.basic = runCommandNoCC "texlive-test-dvipng-basic" {
-    nativeBuildInputs = [ file texlive.combined.scheme-medium ];
-    input = fetchurl {
-      name = "test_dvipng.tex";
-      url = "http://git.savannah.nongnu.org/cgit/dvipng.git/plain/test_dvipng.tex?id=b872753590a18605260078f56cbd6f28d39dc035";
-      sha256 = "1pjpf1jvwj2pv5crzdgcrzvbmn7kfmgxa39pcvskl4pa0c9hl88n";
-    };
-  } ''
-    cp "$input" ./document.tex
-
-    latex document.tex
-    dvipng -T tight -strict -picky document.dvi
-    for f in document*.png; do
-      file "$f" | tee output
-      grep PNG output
-    done
+  dvipng = lib.recurseIntoAttrs {
+    # https://github.com/NixOS/nixpkgs/issues/75605
+    basic = runCommandNoCC "texlive-test-dvipng-basic" {
+      nativeBuildInputs = [ file texlive.combined.scheme-medium ];
+      input = fetchurl {
+        name = "test_dvipng.tex";
+        url = "http://git.savannah.nongnu.org/cgit/dvipng.git/plain/test_dvipng.tex?id=b872753590a18605260078f56cbd6f28d39dc035";
+        sha256 = "1pjpf1jvwj2pv5crzdgcrzvbmn7kfmgxa39pcvskl4pa0c9hl88n";
+      };
+    } ''
+      cp "$input" ./document.tex
 
-    mkdir "$out"
-    mv document*.png "$out"/
-  '';
+      latex document.tex
+      dvipng -T tight -strict -picky document.dvi
+      for f in document*.png; do
+        file "$f" | tee output
+        grep PNG output
+      done
 
-  # test dvipng's limited capability to render postscript specials via GS
-  dvipng.ghostscript = runCommandNoCC "texlive-test-ghostscript" {
-    nativeBuildInputs = [ file (with texlive; combine { inherit scheme-small dvipng; }) ];
-    input = builtins.toFile "postscript-sample.tex" ''
-      \documentclass{minimal}
-      \begin{document}
-        Ni
-        \special{ps:
-          newpath
-          0 0 moveto
-          7 7 rlineto
-          0 7 moveto
-          7 -7 rlineto
-          stroke
-          showpage
-        }
-      \end{document}
-    '';
-    gs_trap = writeShellScript "gs_trap.sh" ''
-      exit 1
+      mkdir "$out"
+      mv document*.png "$out"/
     '';
-  } ''
-    cp "$gs_trap" ./gs
-    export PATH=$PWD:$PATH
-    # check that the trap works
-    gs && exit 1
 
-    cp "$input" ./document.tex
+    # test dvipng's limited capability to render postscript specials via GS
+    ghostscript = runCommandNoCC "texlive-test-ghostscript" {
+      nativeBuildInputs = [ file (with texlive; combine { inherit scheme-small dvipng; }) ];
+      input = builtins.toFile "postscript-sample.tex" ''
+        \documentclass{minimal}
+        \begin{document}
+          Ni
+          \special{ps:
+            newpath
+            0 0 moveto
+            7 7 rlineto
+            0 7 moveto
+            7 -7 rlineto
+            stroke
+            showpage
+          }
+        \end{document}
+      '';
+      gs_trap = writeShellScript "gs_trap.sh" ''
+        exit 1
+      '';
+    } ''
+      cp "$gs_trap" ./gs
+      export PATH=$PWD:$PATH
+      # check that the trap works
+      gs && exit 1
 
-    latex document.tex
-    dvipng -T 1in,1in -strict -picky document.dvi
-    for f in document*.png; do
-      file "$f" | tee output
-      grep PNG output
-    done
+      cp "$input" ./document.tex
 
-    mkdir "$out"
-    mv document*.png "$out"/
-  '';
+      latex document.tex
+      dvipng -T 1in,1in -strict -picky document.dvi
+      for f in document*.png; do
+        file "$f" | tee output
+        grep PNG output
+      done
 
+      mkdir "$out"
+      mv document*.png "$out"/
+    '';
+  };
 
   # https://github.com/NixOS/nixpkgs/issues/75070
   dvisvgm = runCommandNoCC "texlive-test-dvisvgm" {