2021-06-22 22:33:23 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-05-11 08:39:06 +01:00
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
2021-06-22 22:33:23 +01:00
|
|
|
, cairo
|
2021-05-11 08:39:06 +01:00
|
|
|
, cmake
|
2021-06-22 22:33:23 +01:00
|
|
|
, pcre
|
|
|
|
, boost
|
|
|
|
, cups-filters
|
2021-05-11 08:39:06 +01:00
|
|
|
, curl
|
|
|
|
, fontconfig
|
2021-06-22 22:33:23 +01:00
|
|
|
, freetype
|
|
|
|
, inkscape
|
2021-05-11 08:39:06 +01:00
|
|
|
, lcms
|
2021-06-22 22:33:23 +01:00
|
|
|
, libiconv
|
|
|
|
, libintl
|
2021-05-11 08:39:06 +01:00
|
|
|
, libjpeg
|
2021-06-22 22:33:23 +01:00
|
|
|
, ninja
|
2021-05-11 08:39:06 +01:00
|
|
|
, openjpeg
|
2021-06-22 22:33:23 +01:00
|
|
|
, pkg-config
|
|
|
|
, scribusUnstable
|
|
|
|
, texlive
|
|
|
|
, zlib
|
2017-05-26 02:09:22 +01:00
|
|
|
, withData ? true, poppler_data
|
2016-08-02 00:06:10 +01:00
|
|
|
, qt5Support ? false, qtbase ? null
|
2018-12-02 11:41:15 +00:00
|
|
|
, introspectionSupport ? false, gobject-introspection ? null
|
2017-10-02 22:19:29 +01:00
|
|
|
, utils ? false, nss ? null
|
2021-05-11 08:39:06 +01:00
|
|
|
, minimal ? false
|
|
|
|
, suffix ? "glib"
|
2011-07-11 14:04:38 +01:00
|
|
|
}:
|
2008-07-17 16:02:57 +01:00
|
|
|
|
2019-10-24 08:49:35 +01:00
|
|
|
let
|
2017-12-20 05:53:09 +00:00
|
|
|
mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
|
2015-04-02 15:50:37 +01:00
|
|
|
in
|
2021-05-21 08:09:20 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-06-22 22:33:23 +01:00
|
|
|
pname = "poppler-${suffix}";
|
2021-12-08 09:04:04 +00:00
|
|
|
version = "22.01.0"; # beware: updates often break cups-filters build, check texlive and scribusUnstable too!
|
2013-04-18 19:54:47 +01:00
|
|
|
|
2021-05-11 08:39:06 +01:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2015-04-02 15:50:37 +01:00
|
|
|
src = fetchurl {
|
2021-06-22 22:33:23 +01:00
|
|
|
url = "https://poppler.freedesktop.org/poppler-${version}.tar.xz";
|
2021-12-08 09:04:04 +00:00
|
|
|
sha256 = "sha256-fTSTBWtbhkE+XGk8LK4CxcBs2OYY0UwsMeLIS2eyMT4=";
|
2015-04-02 15:50:37 +01:00
|
|
|
};
|
2013-04-21 21:15:38 +01:00
|
|
|
|
2021-05-11 08:39:06 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
2015-07-26 12:43:49 +01:00
|
|
|
|
2021-05-11 08:39:06 +01:00
|
|
|
buildInputs = [
|
2021-06-22 22:33:23 +01:00
|
|
|
boost
|
|
|
|
pcre
|
2021-05-11 08:39:06 +01:00
|
|
|
libiconv
|
|
|
|
libintl
|
|
|
|
] ++ lib.optional withData [
|
|
|
|
poppler_data
|
|
|
|
];
|
2013-04-21 21:15:38 +01:00
|
|
|
|
2015-09-17 16:54:32 +01:00
|
|
|
# TODO: reduce propagation to necessary libs
|
2021-05-11 08:39:06 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
zlib
|
|
|
|
freetype
|
|
|
|
fontconfig
|
|
|
|
libjpeg
|
|
|
|
openjpeg
|
|
|
|
] ++ lib.optionals (!minimal) [
|
|
|
|
cairo
|
|
|
|
lcms
|
|
|
|
curl
|
2021-05-26 20:57:38 +01:00
|
|
|
nss
|
2021-05-11 08:39:06 +01:00
|
|
|
] ++ lib.optionals qt5Support [
|
|
|
|
qtbase
|
|
|
|
] ++ lib.optionals introspectionSupport [
|
|
|
|
gobject-introspection
|
|
|
|
];
|
2021-01-12 11:50:23 +00:00
|
|
|
|
2017-12-20 05:53:09 +00:00
|
|
|
cmakeFlags = [
|
2019-01-08 18:11:10 +00:00
|
|
|
(mkFlag true "UNSTABLE_API_ABI_HEADERS") # previously "XPDF_HEADERS"
|
2017-12-20 05:53:09 +00:00
|
|
|
(mkFlag (!minimal) "GLIB")
|
|
|
|
(mkFlag (!minimal) "CPP")
|
|
|
|
(mkFlag (!minimal) "LIBCURL")
|
|
|
|
(mkFlag utils "UTILS")
|
|
|
|
(mkFlag qt5Support "QT5")
|
|
|
|
];
|
2016-02-10 11:08:23 +00:00
|
|
|
|
2021-05-11 08:39:06 +01: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 16:54:32 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://poppler.freedesktop.org/";
|
2015-04-02 15:50:37 +01:00
|
|
|
description = "A PDF rendering library";
|
|
|
|
longDescription = ''
|
2021-06-22 22:33:23 +01: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 09:52:42 +01:00
|
|
|
'';
|
2021-05-11 08:39:06 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2015-09-17 16:54:32 +01:00
|
|
|
platforms = platforms.all;
|
2020-04-16 03:54:58 +01:00
|
|
|
maintainers = with maintainers; [ ttuegel ] ++ teams.freedesktop.members;
|
2015-01-19 17:12:04 +00:00
|
|
|
};
|
2021-05-21 08:09:20 +01:00
|
|
|
}
|