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