1{ lib, buildPythonPackage, fetchPypi, mupdf, swig }:
2buildPythonPackage rec {
3 pname = "pymupdf";
4 version = "1.18.0";
5
6 src = fetchPypi {
7 pname = "PyMuPDF";
8 inherit version;
9 sha256 = "64ce58f92d9edd2631e447175fa13b4024ac3b6dce6e718e0b003c41de6f7952";
10 };
11
12 patchPhase = ''
13 substituteInPlace setup.py \
14 --replace '/usr/include/mupdf' ${mupdf.dev}/include/mupdf
15 '';
16 nativeBuildInputs = [ swig ];
17 buildInputs = [ mupdf ];
18
19 doCheck = false;
20
21 meta = with lib; {
22 description = "Python bindings for MuPDF's rendering library.";
23 homepage = "https://github.com/pymupdf/PyMuPDF";
24 maintainers = with maintainers; [ teto ];
25 license = licenses.agpl3;
26 platforms = platforms.linux;
27 };
28}