From 1f6bdeaa97b14ec5b282182c9ff39bc7dc472e9e Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 20 Dec 2017 06:53:09 +0100 Subject: [PATCH 1/3] =?UTF-8?q?poppler:=200.56.0=20=E2=86=92=200.62.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../development/libraries/poppler/default.nix | 45 ++++++------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix index 5fcb7d386faf..9a3d24fc0b28 100644 --- a/pkgs/development/libraries/poppler/default.nix +++ b/pkgs/development/libraries/poppler/default.nix @@ -1,24 +1,22 @@ -{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, libiconv, libintlOrEmpty +{ stdenv, lib, fetchurl, cmake, ninja, pkgconfig, libiconv, libintlOrEmpty , 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.62.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 = "1ii9ly1pngyvs0aiq2wxpya08hidpl54y7nsb8b1vxnnskgp76jv"; }; outputs = [ "out" "dev" ]; @@ -29,36 +27,19 @@ stdenv.mkDerivation rec { 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" ]; - - 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/; From 10a4edb927ea9abee6dd952b2335649d6786ef29 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 2 Feb 2018 23:48:04 +0100 Subject: [PATCH 2/3] =?UTF-8?q?poppler=5Fqt4:=20downgrade=200.62.0=20?= =?UTF-8?q?=E2=86=92=200.61.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Poppler 0.62 removes QT4 support. We would drop it but unfortunately, some things still rely on it. --- pkgs/development/libraries/poppler/qt4.nix | 44 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 +-- 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 pkgs/development/libraries/poppler/qt4.nix diff --git a/pkgs/development/libraries/poppler/qt4.nix b/pkgs/development/libraries/poppler/qt4.nix new file mode 100644 index 000000000000..c82a543413e2 --- /dev/null +++ b/pkgs/development/libraries/poppler/qt4.nix @@ -0,0 +1,44 @@ +# TODO: get rid of this (https://github.com/NixOS/nixpkgs/issues/32883) +{ stdenv, lib, fetchurl, cmake, ninja, pkgconfig, libiconv, libintlOrEmpty +, zlib, curl, cairo, freetype, fontconfig, lcms2, libjpeg, openjpeg +, poppler_data, qt4 +}: + +let + # Last version supporting QT4 + version = "0.61.1"; +in +stdenv.mkDerivation rec { + name = "poppler-qt4-${version}"; + + src = fetchurl { + url = "${meta.homepage}/poppler-${version}.tar.xz"; + sha256 = "1afdrxxkaivvviazxkg5blsf2x24sjkfj92ib0d3q5pm8dihjrhj"; + }; + + outputs = [ "out" "dev" ]; + + buildInputs = [ libiconv poppler_data ] ++ libintlOrEmpty; + + propagatedBuildInputs = [ zlib freetype fontconfig libjpeg openjpeg cairo lcms2 curl qt4 ]; + + nativeBuildInputs = [ cmake ninja pkgconfig ]; + + cmakeFlags = [ + "-DENABLE_XPDF_HEADERS=on" + "-DENABLE_UTILS=off" + ]; + + meta = with lib; { + homepage = https://poppler.freedesktop.org/; + description = "A PDF rendering library"; + + longDescription = '' + Poppler is a PDF rendering library based on the xpdf-3.0 code base. + ''; + + license = licenses.gpl2; + platforms = platforms.all; + maintainers = with maintainers; [ ttuegel ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 84b01ae94222..0dfcda448847 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10573,10 +10573,7 @@ with pkgs; suffix = "min"; }; - poppler_qt4 = poppler.override { - qt4Support = true; - suffix = "qt4"; - }; + poppler_qt4 = callPackage ../development/libraries/poppler/qt4.nix { }; poppler_utils = poppler.override { suffix = "utils"; utils = true; }; From a711891a831e853f54d86878d0065ba6aba37f47 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 3 Feb 2018 01:01:44 +0100 Subject: [PATCH 3/3] =?UTF-8?q?poppler=5Fdata:=200.4.7=20=E2=86=92=200.4.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/data/misc/poppler-data/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/data/misc/poppler-data/default.nix b/pkgs/data/misc/poppler-data/default.nix index f0f6505cb247..5c8e0970518b 100644 --- a/pkgs/data/misc/poppler-data/default.nix +++ b/pkgs/data/misc/poppler-data/default.nix @@ -1,18 +1,14 @@ -{ fetchurl, stdenv }: +{ fetchurl, stdenv, cmake, ninja }: stdenv.mkDerivation rec { - name = "poppler-data-0.4.7"; + name = "poppler-data-0.4.8"; src = fetchurl { url = "http://poppler.freedesktop.org/${name}.tar.gz"; - sha256 = "1pm7wg6xqj4sppb5az4pa7psfdk4yxxkw52j85bm9fksibcb0lp7"; + sha256 = "0wi8yyynladny51r4q53z7ygh7y491ayp8nqqv6wqqzjc60s35hh"; }; - postPatch = '' - sed -i 's,$(datadir)/pkgconfig,$(prefix)/lib/pkgconfig,g' Makefile - ''; - - installFlags = [ "prefix=$(out)" ]; + nativeBuildInputs = [ cmake ninja ]; meta = with stdenv.lib; { homepage = https://poppler.freedesktop.org/;