summary refs log tree commit diff
path: root/pkgs/misc/ghostscript/default.nix
blob: 62ed5ef526b96a1abd1e40c76b22704580d487cc (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, fetchurl, libjpeg, libpng, zlib
, x11Support, x11 ? null
}:

assert x11Support -> x11 != null;

stdenv.mkDerivation {
  name = "ghostscript-8.56";
  builder = ./builder.sh;
  
  src = fetchurl {
    url = mirror://gnu/ghostscript/gnu-ghostscript-8.56.0.tar.bz2;
    sha256 = "0pfcf59jfl6h8bhwypzxw0zwljssja14d3jc6gczbkab37d33c1x";
  };

  fonts = [
    (fetchurl {
      url = http://nix.cs.uu.nl/dist/tarballs/ghostscript-fonts-std-8.11.tar.gz;
      md5 = "6865682b095f8c4500c54b285ff05ef6";
    })
    # ... add other fonts here
  ];

  buildInputs = [
    libjpeg libpng zlib
    (if x11Support then x11 else null)
  ];

  configureFlags = "
    ${if x11Support then "--with-x" else "--without-x"}
  ";

  # This patch is required to make Ghostscript at least build in a pure 
  # environment (like NixOS).  Ghostscript's build process performs 
  # various tests for the existence of files in /usr/include.
  patches = [ ./purity.patch ];
}