2013-06-19 01:42:25 +04:00
|
|
|
{ stdenv, fetchurl, fetchgit, pkgconfig, cmake, libiconvOrEmpty, libintlOrEmpty
|
2013-06-29 18:07:15 +04:00
|
|
|
, zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg
|
2011-07-11 17:04:38 +04:00
|
|
|
, qt4Support ? false, qt4 ? null
|
|
|
|
}:
|
2008-07-17 19:02:57 +04:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
let
|
2013-06-05 00:11:33 +04:00
|
|
|
version = "0.22.4"; # even major numbers are stable
|
|
|
|
sha256 = "0fz1vk0rbxvnv7ssj8l910k1rx0gjhzl5wr7hkdf4r9jwqs8yhsg";
|
2007-11-11 19:00:51 +03:00
|
|
|
|
2013-04-18 22:54:47 +04: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-22 00:15:38 +04:00
|
|
|
poppler_drv = nameSuff: merge: stdenv.mkDerivation (stdenv.lib.mergeAttrsByFuncDefaultsClean [
|
|
|
|
rec {
|
|
|
|
name = "poppler-${nameSuff}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2013-06-05 00:11:33 +04:00
|
|
|
url = "${meta.homepage}/poppler-${version}.tar.gz";
|
2013-04-22 00:15:38 +04:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2013-06-29 18:07:15 +04:00
|
|
|
propagatedBuildInputs = [ zlib cairo freetype fontconfig libjpeg lcms curl openjpeg ];
|
2013-04-22 00:15:38 +04:00
|
|
|
|
2013-06-19 01:42:25 +04:00
|
|
|
nativeBuildInputs = [ pkgconfig cmake ] ++ libiconvOrEmpty ++ libintlOrEmpty;
|
2013-04-18 22:54:47 +04:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
cmakeFlags = "-DENABLE_XPDF_HEADERS=ON -DENABLE_LIBCURL=ON -DENABLE_ZLIB=ON";
|
2007-11-11 19:00:51 +03:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
patches = [ ./datadir_env.patch ];
|
2007-11-11 19:00:51 +03:00
|
|
|
|
2013-04-22 00:15:38 +04: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 19:02:57 +04:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
enableParallelBuilding = true;
|
2011-09-19 12:35:30 +04:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
meta = {
|
|
|
|
homepage = http://poppler.freedesktop.org/;
|
|
|
|
description = "A PDF rendering library";
|
2008-07-17 19:02:57 +04:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
longDescription = ''
|
|
|
|
Poppler is a PDF rendering library based on the xpdf-3.0 code base.
|
|
|
|
'';
|
2011-07-11 17:04:38 +04:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
license = "GPLv2";
|
2013-06-19 00:02:52 +04:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2013-04-22 00:15:38 +04:00
|
|
|
};
|
|
|
|
} merge ]); # poppler_drv
|
2009-02-21 02:43:29 +03:00
|
|
|
|
2013-04-22 00:15:38 +04: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 02:43:29 +03:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
poppler_glib = poppler_drv "glib" { };
|
2010-12-14 16:30:06 +03:00
|
|
|
|
2013-04-22 00:15:38 +04:00
|
|
|
poppler_qt4 = poppler_drv "qt4" {
|
|
|
|
propagatedBuildInputs = [ qt4 poppler_glib ];
|
|
|
|
patches = qtcairo_patches;
|
2013-05-26 17:12:21 +04:00
|
|
|
NIX_LDFLAGS = "-lpoppler";
|
2013-04-22 00:15:38 +04:00
|
|
|
postConfigure = "cd qt4";
|
2008-07-17 19:02:57 +04:00
|
|
|
};
|
2007-11-11 19:00:51 +03:00
|
|
|
}
|