poppler: fix build of Qt 4 and Qt 5 wrappers
The autoconf build system for poppler does not support building the wrappers separately, so this slightly enlarges the size of closures. To compensate, the command-line utilities have been separated into their own package.
This commit is contained in:
@@ -1,79 +1,50 @@
|
||||
{ stdenv, fetchurl, fetchpatch, pkgconfig, libiconv, libintlOrEmpty
|
||||
, zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg
|
||||
, qt4Support ? false, qt4 ? null, qt5
|
||||
, qt4Support ? false, qt4 ? null, qt5Support ? false, qt5 ? null
|
||||
, utils ? false, suffix ? "glib"
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.32.0"; # even major numbers are stable
|
||||
sha256 = "162vfbvbz0frvqyk00ldsbl49h4bj8i8wn0ngfl30xg1lldy6qs9";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "poppler-${suffix}-${version}";
|
||||
|
||||
poppler_drv = nameSuff: merge: stdenv.mkDerivation (stdenv.lib.mergeAttrsByFuncDefaultsClean [
|
||||
rec {
|
||||
name = "poppler-${nameSuff}-${version}";
|
||||
src = fetchurl {
|
||||
url = "${meta.homepage}/poppler-${version}.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
src = fetchurl {
|
||||
url = "${meta.homepage}/poppler-${version}.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
patches = [ ./datadir_env.patch ];
|
||||
|
||||
propagatedBuildInputs = [ zlib cairo freetype fontconfig libjpeg lcms curl openjpeg ];
|
||||
propagatedBuildInputs = with stdenv.lib;
|
||||
[ zlib cairo freetype fontconfig libjpeg lcms curl openjpeg ]
|
||||
++ optional qt4Support qt4
|
||||
++ optional qt5Support qt5.base;
|
||||
|
||||
nativeBuildInputs = [ pkgconfig libiconv ] ++ libintlOrEmpty;
|
||||
nativeBuildInputs = [ pkgconfig libiconv ] ++ libintlOrEmpty;
|
||||
|
||||
configureFlags = [
|
||||
configureFlags =
|
||||
[
|
||||
"--enable-xpdf-headers"
|
||||
"--enable-libcurl"
|
||||
"--enable-zlib"
|
||||
];
|
||||
]
|
||||
++ stdenv.lib.optional (!utils) "--disable-utils";
|
||||
|
||||
patches = [ ./datadir_env.patch ./poppler-glib.patch ];
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# XXX: The Poppler/Qt4 test suite refers to non-existent PDF files
|
||||
# such as `../../../test/unittestcases/UseNone.pdf'.
|
||||
#doCheck = !qt4Support;
|
||||
checkTarget = "test";
|
||||
meta = {
|
||||
homepage = http://poppler.freedesktop.org/;
|
||||
description = "A PDF rendering library";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
homepage = http://poppler.freedesktop.org/;
|
||||
description = "A PDF rendering library";
|
||||
|
||||
longDescription = ''
|
||||
Poppler is a PDF rendering library based on the xpdf-3.0 code base.
|
||||
'';
|
||||
|
||||
license = stdenv.lib.licenses.gpl2;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} merge ]); # poppler_drv
|
||||
|
||||
/* 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).
|
||||
*/
|
||||
|
||||
poppler_glib = poppler_drv "glib" { };
|
||||
|
||||
poppler_qt4 = poppler_drv "qt4" {
|
||||
#patches = [ qtcairo_patch ]; # text rendering artifacts in recent versions
|
||||
propagatedBuildInputs = [ qt4 poppler_glib ];
|
||||
NIX_LDFLAGS = "-lpoppler";
|
||||
postConfigure = ''
|
||||
mkdir -p "$out/lib/pkgconfig"
|
||||
install -c -m 644 poppler-qt4.pc "$out/lib/pkgconfig"
|
||||
cd qt4
|
||||
longDescription = ''
|
||||
Poppler is a PDF rendering library based on the xpdf-3.0 code base.
|
||||
'';
|
||||
};
|
||||
|
||||
poppler_qt5 = poppler_drv "qt5" {
|
||||
propagatedBuildInputs = [ qt5.base poppler_glib ];
|
||||
postConfigure = ''
|
||||
mkdir -p "$out/lib/pkgconfig"
|
||||
install -c -m 644 poppler-qt5.pc "$out/lib/pkgconfig"
|
||||
cd qt5
|
||||
'';
|
||||
license = stdenv.lib.licenses.gpl2;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
maintainers = with stdenv.lib.maintainers; [ ttuegel ];
|
||||
};
|
||||
|
||||
in { inherit poppler_glib poppler_qt4 poppler_qt5; } // poppler_glib
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
diff -rupN a/poppler-glib.pc.cmake b/poppler-glib.pc.cmake
|
||||
--- a/poppler-glib.pc.cmake 2013-08-17 01:20:41.000000001 +0200
|
||||
+++ b/poppler-glib.pc.cmake 2014-01-01 09:30:50.000000001 +0100
|
||||
@@ -10,4 +10,4 @@ Requires: glib-2.0 >= @GLIB_REQUIRED@ go
|
||||
@PC_REQUIRES_PRIVATE@
|
||||
|
||||
Libs: -L${libdir} -lpoppler-glib
|
||||
-Cflags: -I${includedir}/poppler/glib
|
||||
+Cflags: -I${includedir}/poppler/glib -I${includedir}/poppler
|
||||
diff -rupN a/poppler-glib.pc.in b/poppler-glib.pc.in
|
||||
--- a/poppler-glib.pc.in 2013-08-17 01:20:41.000000001 +0200
|
||||
+++ b/poppler-glib.pc.in 2014-01-01 09:27:17.000000001 +0100
|
||||
@@ -10,4 +10,5 @@ Requires: glib-2.0 >= @GLIB_REQUIRED@ go
|
||||
@PC_REQUIRES_PRIVATE@
|
||||
|
||||
Libs: -L${libdir} -lpoppler-glib
|
||||
-Cflags: -I${includedir}/poppler/glib
|
||||
+Cflags: -I${includedir}/poppler/glib -I${includedir}/poppler
|
||||
+
|
||||
Reference in New Issue
Block a user