at 24.11-pre 1.9 kB view raw
1{ 2 lib, 3 attrs, 4 buildPythonPackage, 5 fetchFromGitHub, 6 hypothesis, 7 pythonOlder, 8 jbig2dec, 9 deprecated, 10 lxml, 11 mupdf-headless, 12 numpy, 13 packaging, 14 pillow, 15 psutil, 16 pybind11, 17 pytest-xdist, 18 pytestCheckHook, 19 python-dateutil, 20 python-xmp-toolkit, 21 qpdf, 22 setuptools, 23 substituteAll, 24}: 25 26buildPythonPackage rec { 27 pname = "pikepdf"; 28 version = "8.14.0"; 29 pyproject = true; 30 31 disabled = pythonOlder "3.8"; 32 33 src = fetchFromGitHub { 34 owner = "pikepdf"; 35 repo = "pikepdf"; 36 rev = "v${version}"; 37 # The content of .git_archival.txt is substituted upon tarball creation, 38 # which creates indeterminism if master no longer points to the tag. 39 # See https://github.com/jbarlow83/OCRmyPDF/issues/841 40 postFetch = '' 41 rm "$out/.git_archival.txt" 42 ''; 43 hash = "sha256-3ORvbhO3eLu/NIE0Lwdf93QtUHUmyMf7LmdMBJpkYIg="; 44 }; 45 46 patches = [ 47 (substituteAll { 48 src = ./paths.patch; 49 jbig2dec = lib.getExe' jbig2dec "jbig2dec"; 50 mutool = lib.getExe' mupdf-headless "mutool"; 51 }) 52 ]; 53 54 postPatch = '' 55 substituteInPlace setup.py \ 56 --replace "shims_enabled = not cflags_defined" "shims_enabled = False" 57 ''; 58 59 buildInputs = [ qpdf ]; 60 61 nativeBuildInputs = [ 62 pybind11 63 setuptools 64 ]; 65 66 nativeCheckInputs = [ 67 attrs 68 hypothesis 69 numpy 70 pytest-xdist 71 psutil 72 pytestCheckHook 73 python-dateutil 74 python-xmp-toolkit 75 ]; 76 77 propagatedBuildInputs = [ 78 deprecated 79 lxml 80 packaging 81 pillow 82 ]; 83 84 pythonImportsCheck = [ "pikepdf" ]; 85 86 meta = with lib; { 87 homepage = "https://github.com/pikepdf/pikepdf"; 88 description = "Read and write PDFs with Python, powered by qpdf"; 89 license = licenses.mpl20; 90 maintainers = with maintainers; [ 91 kiwi 92 dotlambda 93 ]; 94 changelog = "https://github.com/pikepdf/pikepdf/blob/${src.rev}/docs/releasenotes/version${lib.versions.major version}.rst"; 95 }; 96}