about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/ghostscript/test-corpus-render.nix
blob: 26cad916e209100bd5e580fa08873fa0633d09e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ stdenv
, fetchgit
, ghostscript
}:

stdenv.mkDerivation {
  pname = "ghostscript-test-corpus-render";
  version = "unstable-2022-12-01";

  src = fetchgit {
    url = "git://git.ghostscript.com/tests.git";
    rev = "e81c3a1d7c679aab8230e9152165d8cffb687242";
    hash = "sha256-h+UHpCHASYOhf4xG6gkVJK9TEG85kE3jNx5cD1I3LQg=";
  };

  dontConfigure = true;
  dontBuild = true;

  doCheck = true;
  checkPhase = ''
    find . -iregex '.*\.\(ps\|eps\|pdf\)' | while read f; do
      echo "Rendering $f"
      ${ghostscript}/bin/gs \
        -dNOPAUSE \
        -dBATCH \
        -sDEVICE=bitcmyk \
        -sOutputFile=/dev/null \
        -r600 \
        -dBufferSpace=100000 \
        $f
    done
  '';

  installPhase = ''
    touch $out
  '';
}