summary refs log tree commit diff
path: root/pkgs/development/libraries/poppler/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/poppler/default.nix')
-rw-r--r--pkgs/development/libraries/poppler/default.nix48
1 files changed, 16 insertions, 32 deletions
diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index 5fcb7d386fa..a96de20ccfe 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -1,64 +1,48 @@
-{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, libiconv, libintlOrEmpty
+{ stdenv, lib, fetchurl, cmake, ninja, pkgconfig, libiconv, libintl
 , zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg
 , withData ? true, poppler_data
-, qt4Support ? false, qt4 ? null
 , qt5Support ? false, qtbase ? null
 , introspectionSupport ? false, gobjectIntrospection ? null
 , utils ? false
 , minimal ? false, suffix ? "glib"
-, hostPlatform
 }:
 
 let # beware: updates often break cups-filters build
-  version = "0.56.0";
-  sha256 = "0wviayidfv2ix2ql0d4nl9r1ia6qi5kc1nybd9vjx27dk7gvm7c6";
+  version = "0.64.0";
+  mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
 in
 stdenv.mkDerivation rec {
   name = "poppler-${suffix}-${version}";
 
   src = fetchurl {
     url = "${meta.homepage}/poppler-${version}.tar.xz";
-    inherit sha256;
+    sha256 = "1cb4gz3h7cfqyphhx71qc9mp417bdphchbfghmvhcy4zm4ngj7dj";
   };
 
   outputs = [ "out" "dev" ];
 
-  buildInputs = [ libiconv ] ++ libintlOrEmpty ++ lib.optional withData poppler_data;
+  buildInputs = [ libiconv libintl ] ++ lib.optional withData poppler_data;
 
   # TODO: reduce propagation to necessary libs
   propagatedBuildInputs = with lib;
     [ zlib freetype fontconfig libjpeg openjpeg ]
     ++ optionals (!minimal) [ cairo lcms curl ]
-    ++ optional qt4Support qt4
     ++ optional qt5Support qtbase
     ++ optional introspectionSupport gobjectIntrospection;
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ cmake ninja pkgconfig ];
 
-  NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ];
+  # Not sure when and how to pass it.  It seems an upstream bug anyway.
+  CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11";
 
-  CXXFLAGS = lib.optional qt5Support "-std=c++11";
-
-  configureFlags = with lib;
-    [
-      "--enable-xpdf-headers"
-      "--enable-libcurl"
-      "--enable-zlib"
-      "--enable-build-type=release"
-    ]
-    ++ optionals minimal [
-      "--disable-poppler-glib" "--disable-poppler-cpp"
-      "--disable-libcurl"
-    ]
-    ++ optional (!utils) "--disable-utils"
-    ++ optional introspectionSupport "--enable-introspection";
-
-  enableParallelBuilding = true;
-
-  crossAttrs.postPatch =
-    # there are tests using `strXXX_s` functions that are missing apparently
-    stdenv.lib.optionalString (hostPlatform.libc or null == "msvcrt")
-      "sed '/^SUBDIRS =/s/ test / /' -i Makefile.in";
+  cmakeFlags = [
+    (mkFlag true "XPDF_HEADERS")
+    (mkFlag (!minimal) "GLIB")
+    (mkFlag (!minimal) "CPP")
+    (mkFlag (!minimal) "LIBCURL")
+    (mkFlag utils "UTILS")
+    (mkFlag qt5Support "QT5")
+  ];
 
   meta = with lib; {
     homepage = https://poppler.freedesktop.org/;