3
0
Fork 0
forked from mirrors/nixpkgs

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:
Thomas Tuegel 2015-04-02 09:50:37 -05:00
parent da74e8c317
commit c0d5cd0ff9
13 changed files with 63 additions and 99 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, qt4, popplerQt4, zlib}: { stdenv, fetchurl, qt4, poppler_qt4, zlib}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "texstudio"; pname = "texstudio";
@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
sha256 = "167d78nfk265jjvl129nr70v8ladb2rav2qyhw7ngr6m54gak831"; sha256 = "167d78nfk265jjvl129nr70v8ladb2rav2qyhw7ngr6m54gak831";
}; };
buildInputs = [ qt4 popplerQt4 zlib ]; buildInputs = [ qt4 poppler_qt4 zlib ];
preConfigure = '' preConfigure = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${popplerQt4}/include/poppler/qt4) " export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${poppler_qt4}/include/poppler/qt4) "
qmake PREFIX=$out texstudio.pro qmake PREFIX=$out texstudio.pro
''; '';

View file

@ -107,7 +107,7 @@ let
OggVorbis = libvorbis; OggVorbis = libvorbis;
OpenAL = openal; OpenAL = openal;
OpenEXR = openexr; OpenEXR = openexr;
Poppler = poppler.poppler_qt4; Poppler = poppler_qt4;
Prison = prison; Prison = prison;
PulseAudio = pulseaudio; PulseAudio = pulseaudio;
PythonLibrary = python; PythonLibrary = python;

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl, qt4, pkgconfig, popplerQt4, djvulibre, libspectre, cups {stdenv, fetchurl, qt4, pkgconfig, poppler_qt4, djvulibre, libspectre, cups
, file, ghostscript , file, ghostscript
}: }:
let let
@ -11,7 +11,7 @@ let
sha256 = "15d88xzqvrcp9szmz8d1lj65yrdx90j6fp78gia5c8kra2z8bik9"; sha256 = "15d88xzqvrcp9szmz8d1lj65yrdx90j6fp78gia5c8kra2z8bik9";
}; };
buildInputs = [ buildInputs = [
qt4 popplerQt4 pkgconfig djvulibre libspectre cups file ghostscript qt4 poppler_qt4 pkgconfig djvulibre libspectre cups file ghostscript
]; ];
in in
stdenv.mkDerivation { stdenv.mkDerivation {

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, cmake, kdelibs, attica, perl, zlib, libpng, boost, mesa { stdenv, fetchurl, cmake, kdelibs, attica, perl, zlib, libpng, boost, mesa
, kdepimlibs, createresources ? null, eigen, qca2, exiv2, soprano, marble, lcms2 , kdepimlibs, createresources ? null, eigen, qca2, exiv2, soprano, marble, lcms2
, fontconfig, freetype, sqlite, icu, libwpd, libwpg, pkgconfig, popplerQt4 , fontconfig, freetype, sqlite, icu, libwpd, libwpg, pkgconfig, poppler_qt4
, libkdcraw, libxslt, fftw, glew, gsl, shared_desktop_ontologies, okular , libkdcraw, libxslt, fftw, glew, gsl, shared_desktop_ontologies, okular
, libvisio, kactivities, mysql, postgresql, freetds, xbase, openexr, ilmbase , libvisio, kactivities, mysql, postgresql, freetds, xbase, openexr, ilmbase
, libodfgen, opencolorio, openjpeg, pstoedit, librevenge , libodfgen, opencolorio, openjpeg, pstoedit, librevenge
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
buildInputs = [ kdelibs attica zlib libpng boost mesa kdepimlibs buildInputs = [ kdelibs attica zlib libpng boost mesa kdepimlibs
createresources eigen qca2 exiv2 soprano marble lcms2 fontconfig freetype createresources eigen qca2 exiv2 soprano marble lcms2 fontconfig freetype
sqlite icu libwpd libwpg popplerQt4 libkdcraw libxslt fftw glew gsl sqlite icu libwpd libwpg poppler_qt4 libkdcraw libxslt fftw glew gsl
shared_desktop_ontologies okular libodfgen opencolorio openjpeg shared_desktop_ontologies okular libodfgen opencolorio openjpeg
libvisio kactivities mysql.lib postgresql freetds xbase openexr pstoedit libvisio kactivities mysql.lib postgresql freetds xbase openexr pstoedit
librevenge librevenge

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, kdelibs, libxslt, popplerQt4 }: { stdenv, fetchurl, kdelibs, libxslt, poppler_qt4 }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "kbibtex"; pname = "kbibtex";
@ -14,5 +14,5 @@ stdenv.mkDerivation rec {
sed -e '25i#include <QModelIndex>' -i src/gui/preferences/settingsabstractwidget.h sed -e '25i#include <QModelIndex>' -i src/gui/preferences/settingsabstractwidget.h
''; '';
buildInputs = [ kdelibs libxslt popplerQt4 ]; buildInputs = [ kdelibs libxslt poppler_qt4 ];
} }

View file

@ -1,11 +1,11 @@
{ stdenv, chmlib, djvulibre, ebook_tools, kde, kdelibs, libspectre, popplerQt4, qca2 { stdenv, chmlib, djvulibre, ebook_tools, kde, kdelibs, libspectre, poppler_qt4, qca2
, qimageblitz, libtiff, kactivities, pkgconfig, libkexiv2 }: , qimageblitz, libtiff, kactivities, pkgconfig, libkexiv2 }:
kde { kde {
# TODO: package activeapp, qmobipocket # TODO: package activeapp, qmobipocket
buildInputs = [ kdelibs chmlib djvulibre ebook_tools libspectre popplerQt4 buildInputs = [ kdelibs chmlib djvulibre ebook_tools libspectre poppler_qt4
qca2 qimageblitz libtiff kactivities libkexiv2 ]; qca2 qimageblitz libtiff kactivities libkexiv2 ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];

View file

@ -1,8 +1,8 @@
{ stdenv, kde, kdelibs, pkgconfig, doxygen, popplerQt4, taglib, exiv2, ffmpeg }: { stdenv, kde, kdelibs, pkgconfig, doxygen, poppler_qt4, taglib, exiv2, ffmpeg }:
kde { kde {
buildInputs = [ buildInputs = [
kdelibs popplerQt4 taglib exiv2 ffmpeg kdelibs poppler_qt4 taglib exiv2 ffmpeg
]; ];
nativeBuildInputs = [ pkgconfig doxygen ]; nativeBuildInputs = [ pkgconfig doxygen ];

View file

@ -1,4 +1,4 @@
{ stdenv, kde, kdelibs, soprano, shared_desktop_ontologies, exiv2, ffmpeg, taglib, popplerQt4 { stdenv, kde, kdelibs, soprano, shared_desktop_ontologies, exiv2, ffmpeg, taglib, poppler_qt4
, pkgconfig, doxygen, ebook_tools , pkgconfig, doxygen, ebook_tools
}: }:
@ -8,7 +8,7 @@ kde {
buildInputs = [ buildInputs = [
kdelibs soprano shared_desktop_ontologies taglib exiv2 ffmpeg kdelibs soprano shared_desktop_ontologies taglib exiv2 ffmpeg
popplerQt4 ebook_tools poppler_qt4 ebook_tools
]; ];
nativeBuildInputs = [ pkgconfig doxygen ]; nativeBuildInputs = [ pkgconfig doxygen ];

View file

@ -38,7 +38,7 @@ let
{ {
LibBlueDevil = pkgs.libbluedevil; LibBlueDevil = pkgs.libbluedevil;
PolkitQt5-1 = pkgs.polkit_qt5.override { inherit qt5; }; PolkitQt5-1 = pkgs.polkit_qt5.override { inherit qt5; };
PopplerQt5 = (pkgs.poppler.override { inherit qt5; }).poppler_qt5; PopplerQt5 = pkgs.poppler_qt.override { inherit qt5; };
} // } //
# packages from nixpkgs # packages from nixpkgs
(with pkgs; (with pkgs;

View file

@ -1,79 +1,50 @@
{ stdenv, fetchurl, fetchpatch, pkgconfig, libiconv, libintlOrEmpty { stdenv, fetchurl, fetchpatch, pkgconfig, libiconv, libintlOrEmpty
, zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg , 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 let
version = "0.32.0"; # even major numbers are stable version = "0.32.0"; # even major numbers are stable
sha256 = "162vfbvbz0frvqyk00ldsbl49h4bj8i8wn0ngfl30xg1lldy6qs9"; sha256 = "162vfbvbz0frvqyk00ldsbl49h4bj8i8wn0ngfl30xg1lldy6qs9";
in
stdenv.mkDerivation rec {
name = "poppler-${suffix}-${version}";
poppler_drv = nameSuff: merge: stdenv.mkDerivation (stdenv.lib.mergeAttrsByFuncDefaultsClean [ src = fetchurl {
rec { url = "${meta.homepage}/poppler-${version}.tar.xz";
name = "poppler-${nameSuff}-${version}"; inherit sha256;
};
src = fetchurl { patches = [ ./datadir_env.patch ];
url = "${meta.homepage}/poppler-${version}.tar.xz";
inherit sha256;
};
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-xpdf-headers"
"--enable-libcurl" "--enable-libcurl"
"--enable-zlib" "--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 meta = {
# such as `../../../test/unittestcases/UseNone.pdf'. homepage = http://poppler.freedesktop.org/;
#doCheck = !qt4Support; description = "A PDF rendering library";
checkTarget = "test";
enableParallelBuilding = true; longDescription = ''
Poppler is a PDF rendering library based on the xpdf-3.0 code base.
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
''; '';
};
poppler_qt5 = poppler_drv "qt5" { license = stdenv.lib.licenses.gpl2;
propagatedBuildInputs = [ qt5.base poppler_glib ]; platforms = stdenv.lib.platforms.all;
postConfigure = '' maintainers = with stdenv.lib.maintainers; [ ttuegel ];
mkdir -p "$out/lib/pkgconfig"
install -c -m 644 poppler-qt5.pc "$out/lib/pkgconfig"
cd qt5
'';
}; };
}
in { inherit poppler_glib poppler_qt4 poppler_qt5; } // poppler_glib

View file

@ -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
+

View file

@ -7230,9 +7230,21 @@ let
policykit = callPackage ../development/libraries/policykit { }; policykit = callPackage ../development/libraries/policykit { };
poppler = callPackage ../development/libraries/poppler { lcms = lcms2; qt5 = qt54; }; poppler = callPackage ../development/libraries/poppler { lcms = lcms2; };
popplerQt4 = poppler.poppler_qt4;
poppler_qt5 = poppler.poppler_qt5; poppler_qt4 = poppler.override {
inherit qt4;
qt4Support = true;
suffix = "qt4";
};
poppler_qt5 = poppler.override {
qt5 = qt54;
qt5Support = true;
suffix = "qt5";
};
poppler_utils = poppler.override { suffix = "utils"; utils = true; };
popt = callPackage ../development/libraries/popt { }; popt = callPackage ../development/libraries/popt { };

View file

@ -3361,10 +3361,10 @@ let
md5 = "9c4c5a59b878aed78e96a6ae58c6c185"; md5 = "9c4c5a59b878aed78e96a6ae58c6c185";
}; };
propagatedBuildInputs = [ pkgs.pyqt4 pkgs.pkgconfig pkgs.popplerQt4 ]; propagatedBuildInputs = [ pkgs.pyqt4 pkgs.pkgconfig pkgs.poppler_qt4 ];
preBuild = "${python}/bin/${python.executable} setup.py build_ext" + preBuild = "${python}/bin/${python.executable} setup.py build_ext" +
" --include-dirs=${pkgs.popplerQt4}/include/poppler/"; " --include-dirs=${pkgs.poppler_qt4}/include/poppler/";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A Python binding to Poppler-Qt4"; description = "A Python binding to Poppler-Qt4";