2012-01-03 17:50:10 +00:00
|
|
|
{ stdenv, fetchurl, libjpeg, libpng, libtiff, zlib, pkgconfig, fontconfig, openssl, lcms, freetype
|
2005-08-30 14:50:14 +01:00
|
|
|
, x11Support, x11 ? null
|
2009-01-17 13:08:51 +00:00
|
|
|
, cupsSupport ? false, cups ? null
|
2011-05-24 16:35:38 +01:00
|
|
|
, gnuFork ? true
|
2005-08-30 14:50:14 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert x11Support -> x11 != null;
|
2009-01-17 13:08:51 +00:00
|
|
|
assert cupsSupport -> cups != null;
|
2005-04-29 14:23:15 +01:00
|
|
|
|
2011-05-24 16:35:38 +01:00
|
|
|
let
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.gnu.org/software/ghostscript/;
|
|
|
|
description = "GNU Ghostscript, a PostScript interpreter";
|
2010-09-17 15:46:49 +01:00
|
|
|
|
2011-05-24 16:35:38 +01: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 13:08:51 +00:00
|
|
|
|
2011-05-24 16:35:38 +01:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.viric ];
|
2005-04-29 14:23:15 +01:00
|
|
|
};
|
|
|
|
|
2011-05-24 16:35:38 +01:00
|
|
|
gnuForkData = rec {
|
2012-01-03 17:50:10 +00:00
|
|
|
name = "ghostscript-9.04.1";
|
2011-05-24 16:35:38 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/ghostscript/gnu-${name}.tar.bz2";
|
2012-01-03 17:50:10 +00:00
|
|
|
sha256 = "0zqa6ggbkdqiszsywgrra4ij0sddlmrfa50bx2mh568qid4ga0a2";
|
2011-05-24 16:35:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit meta;
|
2012-03-08 22:28:26 +00:00
|
|
|
patches = [ ./purity.patch ];
|
2011-05-24 16:35:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
mainlineData = {
|
2012-03-08 22:28:26 +00:00
|
|
|
name = "ghostscript-9.05";
|
2011-05-24 16:35:38 +01:00
|
|
|
src = fetchurl {
|
2012-03-08 22:28:26 +00:00
|
|
|
url = http://downloads.ghostscript.com/public/ghostscript-9.05.tar.bz2;
|
|
|
|
sha256 = "1b6fi76x6pn9dmr9k9lh8kimn968dmh91k824fmm59d5ycm22h8g";
|
2011-05-24 16:35:38 +01:00
|
|
|
};
|
|
|
|
meta = meta // {
|
|
|
|
homepage = http://www.ghostscript.com/;
|
|
|
|
description = "GPL Ghostscript, a PostScript interpreter";
|
|
|
|
};
|
2012-03-09 17:15:11 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
rm -R libpng jpeg lcms tiff freetype
|
|
|
|
'';
|
2012-03-08 22:28:26 +00:00
|
|
|
patches = [ ./purity-9.05.patch ];
|
2011-05-24 16:35:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
variant = if gnuFork then gnuForkData else mainlineData;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit (variant) name src meta;
|
|
|
|
|
2005-04-29 14:23:15 +01:00
|
|
|
fonts = [
|
|
|
|
(fetchurl {
|
2008-07-17 20:37:18 +01:00
|
|
|
url = mirror://gnu/ghostscript/gnu-gs-fonts-std-6.0.tar.gz;
|
|
|
|
sha256 = "1lxr1y52r26qjif8kdqkfhsb5llakdcx3f5b9ppdyn59bb83ivsc";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = mirror://gnu/ghostscript/gnu-gs-fonts-other-6.0.tar.gz;
|
|
|
|
sha256 = "1cxaah3r52qq152bbkiyj2f7dx1rf38vsihlhjmrvzlr8v6cqil1";
|
2005-04-29 14:23:15 +01:00
|
|
|
})
|
|
|
|
# ... add other fonts here
|
|
|
|
];
|
|
|
|
|
2012-01-03 17:50:10 +00:00
|
|
|
buildInputs = [libjpeg libpng libtiff zlib pkgconfig fontconfig openssl lcms]
|
|
|
|
++ stdenv.lib.optionals x11Support [x11 freetype]
|
2009-01-17 13:08:51 +00:00
|
|
|
++ stdenv.lib.optional cupsSupport cups;
|
2005-04-29 14:23:15 +01:00
|
|
|
|
2010-09-20 21:46:27 +01:00
|
|
|
CFLAGS = "-fPIC";
|
2012-03-16 14:27:58 +00:00
|
|
|
NIX_LDFLAGS =
|
|
|
|
"-lz -rpath${ if stdenv.isDarwin then " " else "="}${freetype}/lib";
|
2012-01-03 17:50:10 +00:00
|
|
|
|
2012-03-08 22:28:26 +00:00
|
|
|
patches = variant.patches ++ [ ./urw-font-files.patch ];
|
2010-09-20 21:46:27 +01:00
|
|
|
|
2012-01-03 17:50:10 +00: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 17:15:11 +00:00
|
|
|
'' + stdenv.lib.optionalString (variant ? preConfigure) variant.preConfigure;
|
2012-01-03 17:50:10 +00:00
|
|
|
|
2012-01-11 23:14:07 +00:00
|
|
|
configureFlags =
|
|
|
|
(if x11Support then [ "--with-x" ] else [ "--without-x" ]) ++
|
|
|
|
(if cupsSupport then [ "--enable-cups" "--with-install-cups" ] else [ "--disable-cups" ]);
|
2008-07-17 20:37:18 +01:00
|
|
|
|
|
|
|
doCheck = true;
|
2012-01-03 17:50:10 +00:00
|
|
|
|
2012-01-11 23:14:12 +00:00
|
|
|
installTargets="install soinstall";
|
2012-01-04 00:26:48 +00:00
|
|
|
|
2012-01-03 17:50:10 +00:00
|
|
|
postInstall = ''
|
|
|
|
for i in $fonts; do
|
|
|
|
(cd $out/share/ghostscript && tar xvfz $i)
|
|
|
|
done
|
|
|
|
'';
|
2005-04-29 14:23:15 +01:00
|
|
|
}
|