b4e89fc316
GitOrigin-RevId: 70088dc29994c32f8520150e34c6e57e8453f895
79 lines
1.4 KiB
Nix
79 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.1.1";
|
|
disabled = ! isPy3k;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "sha256-klSUszWsIIz7o0/Ql8K4CWYujBH0mAbqyUcabpn1SkQ=";
|
|
};
|
|
|
|
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";
|
|
};
|
|
}
|