2013-04-18 20:54:47 +02:00
|
|
|
{ stdenv, fetchurl, fetchgit, cairo, freetype, fontconfig, zlib
|
2013-02-12 21:40:20 +01:00
|
|
|
, libjpeg, curl, libpthreadstubs, xorg, openjpeg
|
|
|
|
, libxml2, pkgconfig, cmake, lcms2
|
2013-04-18 20:54:47 +02:00
|
|
|
, glibSupport ? false, glib, gtk3Support ? false, gtk3 # gtk2 no longer accepted
|
2011-07-11 15:04:38 +02:00
|
|
|
, qt4Support ? false, qt4 ? null
|
|
|
|
}:
|
2008-07-17 17:02:57 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-04-18 20:54:47 +02:00
|
|
|
name = "poppler-0.22.3";
|
2008-07-17 17:02:57 +02:00
|
|
|
|
2009-02-21 00:43:29 +01:00
|
|
|
src = fetchurl {
|
2010-12-14 14:30:06 +01:00
|
|
|
url = "${meta.homepage}${name}.tar.gz";
|
2013-04-18 20:54:47 +02:00
|
|
|
sha256 = "0ca4jci8xmbdz4fhahdcck0cqms6ax55yggi2ih3clgrpqf96sli";
|
2009-02-21 00:43:29 +01:00
|
|
|
};
|
2007-11-11 17:00:51 +01:00
|
|
|
|
2013-04-18 20:54:47 +02:00
|
|
|
qtcairo_patches =
|
|
|
|
let qtcairo = fetchgit { # the version for poppler-0.22
|
|
|
|
url = "git://github.com/giddie/poppler-qt4-cairo-backend.git";
|
|
|
|
rev = "7a12c58e5cefc2b7a5179c53b387fca8963195c0";
|
|
|
|
sha256 = "1jg2d5y62d0bv206nijb63x426zfb2awy70505nx22d0fx1v1p9k";
|
|
|
|
}; in
|
|
|
|
[ "${qtcairo}/0001-Cairo-backend-added-to-Qt4-wrapper.patch"
|
|
|
|
"${qtcairo}/0002-Setting-default-Qt4-backend-to-Cairo.patch"
|
|
|
|
"${qtcairo}/0003-Forcing-subpixel-rendering-in-Cairo-backend.patch" ];
|
|
|
|
|
|
|
|
|
2013-02-12 21:40:20 +01:00
|
|
|
propagatedBuildInputs = with xorg;
|
|
|
|
[ zlib cairo freetype fontconfig libjpeg lcms2 curl
|
|
|
|
libpthreadstubs libxml2 stdenv.gcc.libc
|
|
|
|
libXau libXdmcp libxcb libXrender libXext
|
2013-04-18 20:54:47 +02:00
|
|
|
openjpeg
|
2011-07-11 15:04:38 +02:00
|
|
|
]
|
2013-04-18 20:54:47 +02:00
|
|
|
++ stdenv.lib.optional glibSupport glib
|
|
|
|
++ stdenv.lib.optional gtk3Support gtk3
|
2011-07-11 15:04:38 +02:00
|
|
|
++ stdenv.lib.optional qt4Support qt4;
|
2007-11-11 17:00:51 +01:00
|
|
|
|
2012-12-28 19:20:09 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig cmake ];
|
2007-11-11 17:00:51 +01:00
|
|
|
|
2010-12-14 14:30:06 +01:00
|
|
|
cmakeFlags = "-DENABLE_XPDF_HEADERS=ON -DENABLE_LIBCURL=ON -DENABLE_ZLIB=ON";
|
2008-07-17 17:02:57 +02:00
|
|
|
|
2013-04-18 20:54:47 +02:00
|
|
|
patches = [ ./datadir_env.patch ] ++ stdenv.lib.optionals qt4Support qtcairo_patches;
|
2011-09-19 10:35:30 +02:00
|
|
|
|
2009-02-21 22:53:50 +01:00
|
|
|
# XXX: The Poppler/Qt4 test suite refers to non-existent PDF files
|
|
|
|
# such as `../../../test/unittestcases/UseNone.pdf'.
|
2011-07-11 15:04:38 +02:00
|
|
|
#doCheck = !qt4Support;
|
2010-12-14 14:30:06 +01:00
|
|
|
checkTarget = "test";
|
2008-07-17 17:02:57 +02:00
|
|
|
|
2011-07-11 15:04:38 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2008-07-17 17:02:57 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://poppler.freedesktop.org/;
|
|
|
|
description = "Poppler, a PDF rendering library";
|
2009-02-21 00:43:29 +01:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Poppler is a PDF rendering library based on the xpdf-3.0 code base.
|
|
|
|
'';
|
|
|
|
|
2010-12-14 14:30:06 +01:00
|
|
|
platforms = if qt4Support
|
|
|
|
then qt4.meta.platforms
|
|
|
|
else stdenv.lib.platforms.all;
|
|
|
|
|
2008-07-17 17:02:57 +02:00
|
|
|
license = "GPLv2";
|
|
|
|
};
|
2007-11-11 17:00:51 +01:00
|
|
|
}
|