1{ lib
2, buildPythonPackage
3, fetchPypi
4, mupdf
5, swig
6, freetype
7, harfbuzz
8, openjpeg
9, jbig2dec
10, libjpeg_turbo
11, gumbo
12}:
13
14buildPythonPackage rec {
15 pname = "pymupdf";
16 version = "1.18.17";
17
18 src = fetchPypi {
19 pname = "PyMuPDF";
20 inherit version;
21 sha256 = "fa39ee5e91eae77818e07b6bb7e0cb0b402ad88e39a74b08626ce1c2150c5414";
22 };
23
24 postPatch = ''
25 substituteInPlace setup.py \
26 --replace '/usr/include/mupdf' ${mupdf.dev}/include/mupdf
27 '';
28 nativeBuildInputs = [ swig ];
29 buildInputs = [ mupdf freetype harfbuzz openjpeg jbig2dec libjpeg_turbo gumbo ];
30
31 doCheck = false;
32
33 pythonImportsCheck = [ "fitz" ];
34
35 meta = with lib; {
36 description = "Python bindings for MuPDF's rendering library.";
37 homepage = "https://github.com/pymupdf/PyMuPDF";
38 maintainers = with maintainers; [ teto ];
39 license = licenses.agpl3Only;
40 platforms = platforms.linux;
41 };
42}