2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-05-28 09:39:13 +00:00
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
2021-06-28 23:13:55 +00:00
|
|
|
, cairo
|
2021-05-28 09:39:13 +00:00
|
|
|
, cmake
|
2021-06-28 23:13:55 +00:00
|
|
|
, pcre
|
|
|
|
, boost
|
|
|
|
, cups-filters
|
2021-05-28 09:39:13 +00:00
|
|
|
, curl
|
|
|
|
, fontconfig
|
2021-06-28 23:13:55 +00:00
|
|
|
, freetype
|
|
|
|
, inkscape
|
2021-05-28 09:39:13 +00:00
|
|
|
, lcms
|
2021-06-28 23:13:55 +00:00
|
|
|
, libiconv
|
|
|
|
, libintl
|
2021-05-28 09:39:13 +00:00
|
|
|
, libjpeg
|
2021-06-28 23:13:55 +00:00
|
|
|
, ninja
|
2021-05-28 09:39:13 +00:00
|
|
|
, openjpeg
|
2021-06-28 23:13:55 +00:00
|
|
|
, pkg-config
|
2022-03-30 09:31:56 +00:00
|
|
|
, python3
|
2022-06-16 17:23:12 +00:00
|
|
|
, scribus
|
2021-06-28 23:13:55 +00:00
|
|
|
, texlive
|
|
|
|
, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
, withData ? true, poppler_data
|
|
|
|
, qt5Support ? false, qtbase ? null
|
|
|
|
, introspectionSupport ? false, gobject-introspection ? null
|
|
|
|
, utils ? false, nss ? null
|
2021-05-28 09:39:13 +00:00
|
|
|
, minimal ? false
|
|
|
|
, suffix ? "glib"
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
|
|
|
|
in
|
2021-05-28 09:39:13 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "poppler-${suffix}";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "22.08.0"; # beware: updates often break cups-filters build, check texlive and scribus too!
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "https://poppler.freedesktop.org/poppler-${version}.tar.xz";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-tJMyhyFALyXLdSP5zcL318WfRa2Zm951xjyQYE2w8gs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pkg-config
|
2022-03-30 09:31:56 +00:00
|
|
|
python3
|
2021-05-28 09:39:13 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
buildInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
boost
|
|
|
|
pcre
|
2021-05-28 09:39:13 +00:00
|
|
|
libiconv
|
|
|
|
libintl
|
|
|
|
] ++ lib.optional withData [
|
|
|
|
poppler_data
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# TODO: reduce propagation to necessary libs
|
2021-05-28 09:39:13 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
zlib
|
|
|
|
freetype
|
|
|
|
fontconfig
|
|
|
|
libjpeg
|
|
|
|
openjpeg
|
|
|
|
] ++ lib.optionals (!minimal) [
|
|
|
|
cairo
|
|
|
|
lcms
|
|
|
|
curl
|
|
|
|
nss
|
|
|
|
] ++ lib.optionals qt5Support [
|
|
|
|
qtbase
|
|
|
|
] ++ lib.optionals introspectionSupport [
|
|
|
|
gobject-introspection
|
|
|
|
];
|
2021-02-19 19:06:45 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
(mkFlag true "UNSTABLE_API_ABI_HEADERS") # previously "XPDF_HEADERS"
|
|
|
|
(mkFlag (!minimal) "GLIB")
|
|
|
|
(mkFlag (!minimal) "CPP")
|
|
|
|
(mkFlag (!minimal) "LIBCURL")
|
|
|
|
(mkFlag utils "UTILS")
|
|
|
|
(mkFlag qt5Support "QT5")
|
|
|
|
];
|
|
|
|
|
2021-05-28 09:39:13 +00: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.
|
2022-06-16 17:23:12 +00:00
|
|
|
inherit inkscape cups-filters texlive scribus;
|
2021-05-28 09:39:13 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://poppler.freedesktop.org/";
|
|
|
|
description = "A PDF rendering library";
|
|
|
|
longDescription = ''
|
2021-06-28 23:13:55 +00: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.
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-05-28 09:39:13 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ ttuegel ] ++ teams.freedesktop.members;
|
|
|
|
};
|
2021-05-28 09:39:13 +00:00
|
|
|
}
|