80 lines
1.4 KiB
Nix
80 lines
1.4 KiB
Nix
{ lib
|
|
, attrs
|
|
, buildPythonPackage
|
|
, defusedxml
|
|
, fetchPypi
|
|
, hypothesis
|
|
, isPy3k
|
|
, jbig2dec
|
|
, lxml
|
|
, mupdf
|
|
, pillow
|
|
, psutil
|
|
, pybind11
|
|
, pytest-xdist
|
|
, pytestCheckHook
|
|
, python-dateutil
|
|
, python-xmp-toolkit
|
|
, qpdf
|
|
, setuptools
|
|
, setuptools-scm
|
|
, setuptools-scm-git-archive
|
|
, substituteAll
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pikepdf";
|
|
version = "3.2.0";
|
|
disabled = ! isPy3k;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "a0582f00440668c07edb8403e82724961c7812c8e6c30655e34825b2645f15cd";
|
|
};
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
src = ./paths.patch;
|
|
jbig2dec = "${lib.getBin jbig2dec}/bin/jbig2dec";
|
|
mudraw = "${lib.getBin mupdf}/bin/mudraw";
|
|
})
|
|
];
|
|
|
|
buildInputs = [
|
|
pybind11
|
|
qpdf
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
setuptools-scm-git-archive
|
|
setuptools-scm
|
|
];
|
|
|
|
checkInputs = [
|
|
attrs
|
|
hypothesis
|
|
pytest-xdist
|
|
psutil
|
|
pytestCheckHook
|
|
python-dateutil
|
|
python-xmp-toolkit
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
defusedxml
|
|
lxml
|
|
pillow
|
|
setuptools
|
|
];
|
|
|
|
pythonImportsCheck = [ "pikepdf" ];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/pikepdf/pikepdf";
|
|
description = "Read and write PDFs with Python, powered by qpdf";
|
|
license = licenses.mpl20;
|
|
maintainers = with maintainers; [ kiwi dotlambda ];
|
|
changelog = "https://github.com/pikepdf/pikepdf/blob/${version}/docs/release_notes.rst";
|
|
};
|
|
}
|