2013-06-18 23:42:25 +02:00
|
|
|
{ stdenv, fetchurl, fetchgit, pkgconfig, cmake, libiconvOrEmpty, libintlOrEmpty
|
2013-06-29 16:07:15 +02:00
|
|
|
, zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg
|
2011-07-11 15:04:38 +02:00
|
|
|
, qt4Support ? false, qt4 ? null
|
|
|
|
}:
|
2008-07-17 17:02:57 +02:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
let
|
2013-08-03 10:46:48 +02:00
|
|
|
version = "0.22.5"; # even major numbers are stable
|
|
|
|
sha256 = "0678frlr39xvrbva490hk0mqyfnx3bk7i5pma8j6hjmzy68a6hpp";
|
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-04-21 22:15:38 +02:00
|
|
|
poppler_drv = nameSuff: merge: stdenv.mkDerivation (stdenv.lib.mergeAttrsByFuncDefaultsClean [
|
|
|
|
rec {
|
|
|
|
name = "poppler-${nameSuff}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2013-06-04 22:11:33 +02:00
|
|
|
url = "${meta.homepage}/poppler-${version}.tar.gz";
|
2013-04-21 22:15:38 +02:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2013-06-29 16:07:15 +02:00
|
|
|
propagatedBuildInputs = [ zlib cairo freetype fontconfig libjpeg lcms curl openjpeg ];
|
2013-04-21 22:15:38 +02:00
|
|
|
|
2013-06-18 23:42:25 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig cmake ] ++ libiconvOrEmpty ++ libintlOrEmpty;
|
2013-04-18 20:54:47 +02:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
cmakeFlags = "-DENABLE_XPDF_HEADERS=ON -DENABLE_LIBCURL=ON -DENABLE_ZLIB=ON";
|
2007-11-11 17:00:51 +01:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
patches = [ ./datadir_env.patch ];
|
2007-11-11 17:00:51 +01:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
# XXX: The Poppler/Qt4 test suite refers to non-existent PDF files
|
|
|
|
# such as `../../../test/unittestcases/UseNone.pdf'.
|
|
|
|
#doCheck = !qt4Support;
|
|
|
|
checkTarget = "test";
|
2008-07-17 17:02:57 +02:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
enableParallelBuilding = true;
|
2011-09-19 10:35:30 +02:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://poppler.freedesktop.org/;
|
|
|
|
description = "A PDF rendering library";
|
2008-07-17 17:02:57 +02:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
longDescription = ''
|
|
|
|
Poppler is a PDF rendering library based on the xpdf-3.0 code base.
|
|
|
|
'';
|
2011-07-11 15:04:38 +02:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
license = "GPLv2";
|
2013-06-18 22:02:52 +02:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2013-04-21 22:15:38 +02:00
|
|
|
};
|
|
|
|
} merge ]); # poppler_drv
|
2009-02-21 00:43:29 +01:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
in rec {
|
|
|
|
/* We always use cairo in poppler, so we always depend on glib,
|
|
|
|
so we always build the glib wrapper (~350kB).
|
|
|
|
We also always build the cpp wrapper (<100kB).
|
|
|
|
ToDo: around half the size could be saved by splitting out headers and tools (1.5 + 0.5 MB).
|
|
|
|
*/
|
2009-02-21 00:43:29 +01:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
poppler_glib = poppler_drv "glib" { };
|
2010-12-14 14:30:06 +01:00
|
|
|
|
2013-04-21 22:15:38 +02:00
|
|
|
poppler_qt4 = poppler_drv "qt4" {
|
|
|
|
propagatedBuildInputs = [ qt4 poppler_glib ];
|
|
|
|
patches = qtcairo_patches;
|
2013-05-26 15:12:21 +02:00
|
|
|
NIX_LDFLAGS = "-lpoppler";
|
2013-04-21 22:15:38 +02:00
|
|
|
postConfigure = "cd qt4";
|
2008-07-17 17:02:57 +02:00
|
|
|
};
|
2007-11-11 17:00:51 +01:00
|
|
|
}
|