2021-05-11 00:39:06 -07:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, libiconv
|
|
|
|
, libintl
|
|
|
|
, zlib
|
|
|
|
, curl
|
|
|
|
, cairo
|
|
|
|
, freetype
|
|
|
|
, fontconfig
|
|
|
|
, lcms
|
|
|
|
, libjpeg
|
|
|
|
, openjpeg
|
2017-05-25 18:09:22 -07:00
|
|
|
, withData ? true, poppler_data
|
2016-08-01 16:06:10 -07:00
|
|
|
, qt5Support ? false, qtbase ? null
|
2018-12-02 03:41:15 -08:00
|
|
|
, introspectionSupport ? false, gobject-introspection ? null
|
2017-10-02 14:19:29 -07:00
|
|
|
, utils ? false, nss ? null
|
2021-05-11 00:39:06 -07:00
|
|
|
, minimal ? false
|
|
|
|
, suffix ? "glib"
|
|
|
|
, inkscape
|
|
|
|
, cups-filters
|
|
|
|
, texlive
|
|
|
|
, scribusUnstable
|
2011-07-11 06:04:38 -07:00
|
|
|
}:
|
2008-07-17 08:02:57 -07:00
|
|
|
|
2019-10-24 00:49:35 -07:00
|
|
|
let
|
2017-12-19 21:53:09 -08:00
|
|
|
mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
|
2015-04-02 07:50:37 -07:00
|
|
|
in
|
2021-04-27 18:44:38 -07:00
|
|
|
stdenv.mkDerivation (rec {
|
2015-04-02 07:50:37 -07:00
|
|
|
name = "poppler-${suffix}-${version}";
|
2021-05-11 00:47:45 -07:00
|
|
|
version = "21.05.0"; # beware: updates often break cups-filters build, check texlive and scribusUnstable too!
|
2013-04-18 11:54:47 -07:00
|
|
|
|
2021-05-11 00:39:06 -07:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2015-04-02 07:50:37 -07:00
|
|
|
src = fetchurl {
|
|
|
|
url = "${meta.homepage}/poppler-${version}.tar.xz";
|
2021-05-11 00:47:45 -07:00
|
|
|
sha256 = "sha256-2v1Te2gPrRIVvED8U9HzjoRJ18GFvGDVqJ4dJskNvYw=";
|
2015-04-02 07:50:37 -07:00
|
|
|
};
|
2013-04-21 13:15:38 -07:00
|
|
|
|
2021-05-11 00:39:06 -07:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
2015-07-26 04:43:49 -07:00
|
|
|
|
2021-05-11 00:39:06 -07:00
|
|
|
buildInputs = [
|
|
|
|
libiconv
|
|
|
|
libintl
|
|
|
|
] ++ lib.optional withData [
|
|
|
|
poppler_data
|
|
|
|
];
|
2013-04-21 13:15:38 -07:00
|
|
|
|
2015-09-17 08:54:32 -07:00
|
|
|
# TODO: reduce propagation to necessary libs
|
2021-05-11 00:39:06 -07:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
zlib
|
|
|
|
freetype
|
|
|
|
fontconfig
|
|
|
|
libjpeg
|
|
|
|
openjpeg
|
|
|
|
] ++ lib.optionals (!minimal) [
|
|
|
|
cairo
|
|
|
|
lcms
|
|
|
|
curl
|
|
|
|
] ++ lib.optionals qt5Support [
|
|
|
|
qtbase
|
|
|
|
] ++ lib.optionals utils [
|
|
|
|
nss
|
|
|
|
] ++ lib.optionals introspectionSupport [
|
|
|
|
gobject-introspection
|
|
|
|
];
|
2021-01-12 03:50:23 -08:00
|
|
|
|
2017-12-19 21:53:09 -08:00
|
|
|
cmakeFlags = [
|
2019-01-08 10:11:10 -08:00
|
|
|
(mkFlag true "UNSTABLE_API_ABI_HEADERS") # previously "XPDF_HEADERS"
|
2017-12-19 21:53:09 -08:00
|
|
|
(mkFlag (!minimal) "GLIB")
|
|
|
|
(mkFlag (!minimal) "CPP")
|
|
|
|
(mkFlag (!minimal) "LIBCURL")
|
|
|
|
(mkFlag utils "UTILS")
|
|
|
|
(mkFlag qt5Support "QT5")
|
|
|
|
];
|
2016-02-10 03:08:23 -08:00
|
|
|
|
2021-05-11 00:39:06 -07:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
|
|
|
# Workaround #54606
|
|
|
|
preConfigure = lib.optionalString stdenv.isDarwin ''
|
|
|
|
sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
# These depend on internal poppler code that frequently changes.
|
|
|
|
inherit inkscape cups-filters texlive scribusUnstable;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2015-09-17 08:54:32 -07:00
|
|
|
meta = with lib; {
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://poppler.freedesktop.org/";
|
2015-04-02 07:50:37 -07:00
|
|
|
description = "A PDF rendering library";
|
2009-02-20 15:43:29 -08:00
|
|
|
|
2015-04-02 07:50:37 -07:00
|
|
|
longDescription = ''
|
2017-10-02 14:19:29 -07:00
|
|
|
Poppler is a PDF rendering library based on the xpdf-3.0 code
|
|
|
|
base. In addition it provides a number of tools that can be
|
|
|
|
installed separately.
|
2014-04-24 01:52:42 -07:00
|
|
|
'';
|
2013-10-24 09:08:48 -07:00
|
|
|
|
2021-05-11 00:39:06 -07:00
|
|
|
license = licenses.gpl2Plus;
|
2015-09-17 08:54:32 -07:00
|
|
|
platforms = platforms.all;
|
2020-04-15 19:54:58 -07:00
|
|
|
maintainers = with maintainers; [ ttuegel ] ++ teams.freedesktop.members;
|
2015-01-19 09:12:04 -08:00
|
|
|
};
|
2021-04-27 18:44:38 -07:00
|
|
|
} // lib.optionalAttrs stdenv.isDarwin {
|
|
|
|
patches = [
|
|
|
|
# Fix build due to improperly used volatile in poppler-glib.
|
|
|
|
# https://gitlab.freedesktop.org/poppler/poppler/merge_requests/836
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.freedesktop.org/poppler/poppler/commit/47de887d7658cfd68df44b3acf710971054f957b.patch";
|
|
|
|
sha256 = "uvYibBn2fOEqdotxK0Wpf8KhGYZXrpHdmS4jjlRNCj8=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.freedesktop.org/poppler/poppler/commit/bdd110b45a38e8a4f80f522892e4c4a9e432abd5.patch";
|
|
|
|
sha256 = "WDUYXX6v5zk7tusz7DGBP58yFzgEvoBlNSLbfk7+QTc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
})
|