2012-01-03 18:50:10 +01:00
|
|
|
{ stdenv, fetchurl, libjpeg, libpng, libtiff, zlib, pkgconfig, fontconfig, openssl, lcms, freetype
|
2005-08-30 15:50:14 +02:00
|
|
|
, x11Support, x11 ? null
|
2009-01-17 14:08:51 +01:00
|
|
|
, cupsSupport ? false, cups ? null
|
2011-05-24 17:35:38 +02:00
|
|
|
, gnuFork ? true
|
2005-08-30 15:50:14 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert x11Support -> x11 != null;
|
2009-01-17 14:08:51 +01:00
|
|
|
assert cupsSupport -> cups != null;
|
2005-04-29 15:23:15 +02:00
|
|
|
|
2011-05-24 17:35:38 +02:00
|
|
|
let
|
|
|
|
meta = {
|
2012-09-06 18:34:18 +02:00
|
|
|
homepage = "http://www.gnu.org/software/ghostscript/";
|
2011-05-24 17:35:38 +02:00
|
|
|
description = "GNU Ghostscript, a PostScript interpreter";
|
2010-09-17 16:46:49 +02:00
|
|
|
|
2011-05-24 17:35:38 +02:00
|
|
|
longDescription = ''
|
|
|
|
Ghostscript is the name of a set of tools that provides (i) an
|
|
|
|
interpreter for the PostScript language and the PDF file format,
|
|
|
|
(ii) a set of C procedures (the Ghostscript library) that
|
|
|
|
implement the graphics capabilities that appear as primitive
|
|
|
|
operations in the PostScript language, and (iii) a wide variety
|
|
|
|
of output drivers for various file formats and printers.
|
|
|
|
'';
|
|
|
|
|
|
|
|
license = "GPLv3+";
|
2009-01-17 14:08:51 +01:00
|
|
|
|
2011-05-24 17:35:38 +02:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.viric ];
|
2005-04-29 15:23:15 +02:00
|
|
|
};
|
|
|
|
|
2012-09-06 18:32:59 +02:00
|
|
|
gnuForkSrc = rec {
|
2012-01-03 18:50:10 +01:00
|
|
|
name = "ghostscript-9.04.1";
|
2011-05-24 17:35:38 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/ghostscript/gnu-${name}.tar.bz2";
|
2012-01-03 18:50:10 +01:00
|
|
|
sha256 = "0zqa6ggbkdqiszsywgrra4ij0sddlmrfa50bx2mh568qid4ga0a2";
|
2011-05-24 17:35:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit meta;
|
2012-03-08 23:28:26 +01:00
|
|
|
patches = [ ./purity.patch ];
|
2011-05-24 17:35:38 +02:00
|
|
|
};
|
|
|
|
|
2012-09-06 18:32:59 +02:00
|
|
|
mainlineSrc = {
|
2012-03-08 23:28:26 +01:00
|
|
|
name = "ghostscript-9.05";
|
2011-05-24 17:35:38 +02:00
|
|
|
src = fetchurl {
|
2012-09-06 18:34:18 +02:00
|
|
|
url = "http://downloads.ghostscript.com/public/ghostscript-9.05.tar.bz2";
|
2012-03-08 23:28:26 +01:00
|
|
|
sha256 = "1b6fi76x6pn9dmr9k9lh8kimn968dmh91k824fmm59d5ycm22h8g";
|
2011-05-24 17:35:38 +02:00
|
|
|
};
|
|
|
|
meta = meta // {
|
2012-09-06 18:34:18 +02:00
|
|
|
homepage = "http://www.ghostscript.com/";
|
2011-05-24 17:35:38 +02:00
|
|
|
description = "GPL Ghostscript, a PostScript interpreter";
|
|
|
|
};
|
2012-03-09 18:15:11 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
rm -R libpng jpeg lcms tiff freetype
|
|
|
|
'';
|
2012-03-08 23:28:26 +01:00
|
|
|
patches = [ ./purity-9.05.patch ];
|
2011-05-24 17:35:38 +02:00
|
|
|
};
|
|
|
|
|
2012-09-06 18:32:59 +02:00
|
|
|
variant = if gnuFork then gnuForkSrc else mainlineSrc;
|
2011-05-24 17:35:38 +02:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit (variant) name src meta;
|
|
|
|
|
2005-04-29 15:23:15 +02:00
|
|
|
fonts = [
|
|
|
|
(fetchurl {
|
2012-09-06 18:34:18 +02:00
|
|
|
url = "mirror://gnu/ghostscript/gnu-gs-fonts-std-6.0.tar.gz";
|
2008-07-17 21:37:18 +02:00
|
|
|
sha256 = "1lxr1y52r26qjif8kdqkfhsb5llakdcx3f5b9ppdyn59bb83ivsc";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
2012-09-06 18:34:18 +02:00
|
|
|
url = "mirror://gnu/ghostscript/gnu-gs-fonts-other-6.0.tar.gz";
|
2008-07-17 21:37:18 +02:00
|
|
|
sha256 = "1cxaah3r52qq152bbkiyj2f7dx1rf38vsihlhjmrvzlr8v6cqil1";
|
2005-04-29 15:23:15 +02:00
|
|
|
})
|
|
|
|
# ... add other fonts here
|
|
|
|
];
|
|
|
|
|
2012-01-03 18:50:10 +01:00
|
|
|
buildInputs = [libjpeg libpng libtiff zlib pkgconfig fontconfig openssl lcms]
|
|
|
|
++ stdenv.lib.optionals x11Support [x11 freetype]
|
2009-01-17 14:08:51 +01:00
|
|
|
++ stdenv.lib.optional cupsSupport cups;
|
2005-04-29 15:23:15 +02:00
|
|
|
|
2010-09-20 22:46:27 +02:00
|
|
|
CFLAGS = "-fPIC";
|
2012-03-16 15:27:58 +01:00
|
|
|
NIX_LDFLAGS =
|
|
|
|
"-lz -rpath${ if stdenv.isDarwin then " " else "="}${freetype}/lib";
|
2012-01-03 18:50:10 +01:00
|
|
|
|
2012-03-08 23:28:26 +01:00
|
|
|
patches = variant.patches ++ [ ./urw-font-files.patch ];
|
2010-09-20 22:46:27 +02:00
|
|
|
|
2012-01-03 18:50:10 +01:00
|
|
|
preConfigure = ''
|
|
|
|
# "ijs" is impure: it contains symlinks to /usr/share/automake etc.!
|
|
|
|
rm -rf ijs/ltmain.sh
|
|
|
|
|
|
|
|
# Don't install stuff in the Cups store path.
|
|
|
|
makeFlagsArray=(CUPSSERVERBIN=$out/lib/cups CUPSSERVERROOT=$out/etc/cups CUPSDATA=$out/share/cups)
|
2012-03-09 18:15:11 +01:00
|
|
|
'' + stdenv.lib.optionalString (variant ? preConfigure) variant.preConfigure;
|
2012-01-03 18:50:10 +01:00
|
|
|
|
2012-01-12 00:14:07 +01:00
|
|
|
configureFlags =
|
|
|
|
(if x11Support then [ "--with-x" ] else [ "--without-x" ]) ++
|
|
|
|
(if cupsSupport then [ "--enable-cups" "--with-install-cups" ] else [ "--disable-cups" ]);
|
2008-07-17 21:37:18 +02:00
|
|
|
|
|
|
|
doCheck = true;
|
2012-01-03 18:50:10 +01:00
|
|
|
|
2012-01-12 00:14:12 +01:00
|
|
|
installTargets="install soinstall";
|
2012-01-04 01:26:48 +01:00
|
|
|
|
2012-01-03 18:50:10 +01:00
|
|
|
postInstall = ''
|
|
|
|
for i in $fonts; do
|
|
|
|
(cd $out/share/ghostscript && tar xvfz $i)
|
|
|
|
done
|
|
|
|
'';
|
2005-04-29 15:23:15 +02:00
|
|
|
}
|