2021-02-13 14:23:35 +00:00
|
|
|
{ lib
|
|
|
|
, attrs
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, defusedxml
|
|
|
|
, fetchPypi
|
|
|
|
, hypothesis
|
|
|
|
, isPy3k
|
2021-09-22 15:38:15 +00:00
|
|
|
, jbig2dec
|
2020-04-24 23:36:52 +00:00
|
|
|
, lxml
|
2021-09-22 15:38:15 +00:00
|
|
|
, mupdf
|
2020-04-24 23:36:52 +00:00
|
|
|
, pillow
|
2021-02-13 14:23:35 +00:00
|
|
|
, psutil
|
2020-04-24 23:36:52 +00:00
|
|
|
, pybind11
|
2021-02-13 14:23:35 +00:00
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
2020-12-07 07:45:13 +00:00
|
|
|
, python-dateutil
|
2020-04-24 23:36:52 +00:00
|
|
|
, python-xmp-toolkit
|
|
|
|
, qpdf
|
2021-04-15 00:37:46 +00:00
|
|
|
, setuptools
|
2021-02-13 14:23:35 +00:00
|
|
|
, setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
, setuptools-scm-git-archive
|
2021-09-22 15:38:15 +00:00
|
|
|
, substituteAll
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pikepdf";
|
2021-09-26 12:46:18 +00:00
|
|
|
version = "3.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = ! isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-09-26 12:46:18 +00:00
|
|
|
sha256 = "aeb813b5f36534d2bedf08487ab2b022c43f4c8a3e86e611c5f7c8fb97309db5";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-22 15:38:15 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./paths.patch;
|
|
|
|
jbig2dec = "${lib.getBin jbig2dec}/bin/jbig2dec";
|
|
|
|
mudraw = "${lib.getBin mupdf}/bin/mudraw";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
pybind11
|
|
|
|
qpdf
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm-git-archive
|
2021-02-13 14:23:35 +00:00
|
|
|
setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
attrs
|
|
|
|
hypothesis
|
2021-02-13 14:23:35 +00:00
|
|
|
pytest-xdist
|
|
|
|
psutil
|
|
|
|
pytestCheckHook
|
2020-12-07 07:45:13 +00:00
|
|
|
python-dateutil
|
2020-04-24 23:36:52 +00:00
|
|
|
python-xmp-toolkit
|
|
|
|
];
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
defusedxml
|
|
|
|
lxml
|
|
|
|
pillow
|
2021-04-15 00:37:46 +00:00
|
|
|
setuptools
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
pythonImportsCheck = [ "pikepdf" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/pikepdf/pikepdf";
|
|
|
|
description = "Read and write PDFs with Python, powered by qpdf";
|
|
|
|
license = licenses.mpl20;
|
2021-09-22 15:38:15 +00:00
|
|
|
maintainers = with maintainers; [ kiwi dotlambda ];
|
2021-04-15 00:37:46 +00:00
|
|
|
changelog = "https://github.com/pikepdf/pikepdf/blob/${version}/docs/release_notes.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|