Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, buildPythonPackage 4, pythonOlder 5, fetchPypi 6, swig 7, xcbuild 8, mupdf 9, freetype 10, harfbuzz 11, openjpeg 12, jbig2dec 13, libjpeg_turbo 14, gumbo 15, memstreamHook 16}: 17 18buildPythonPackage rec { 19 pname = "pymupdf"; 20 version = "1.21.1"; 21 format = "setuptools"; 22 23 disabled = pythonOlder "3.7"; 24 25 src = fetchPypi { 26 pname = "PyMuPDF"; 27 inherit version; 28 hash = "sha256-+BV0GkNcYqADa7y/X6bFM1Z71pxTONQTcU/FeyLbk+A="; 29 }; 30 31 postPatch = '' 32 substituteInPlace setup.py \ 33 --replace '/usr/include/mupdf' ${mupdf.dev}/include/mupdf 34 ''; 35 nativeBuildInputs = [ 36 swig 37 ] ++ lib.optionals stdenv.isDarwin [ 38 xcbuild 39 ]; 40 41 buildInputs = [ 42 mupdf 43 freetype 44 harfbuzz 45 openjpeg 46 jbig2dec 47 libjpeg_turbo 48 gumbo 49 ] ++ lib.optionals (stdenv.system == "x86_64-darwin") [ 50 memstreamHook 51 ]; 52 53 doCheck = false; 54 55 pythonImportsCheck = [ 56 "fitz" 57 ]; 58 59 meta = with lib; { 60 description = "Python bindings for MuPDF's rendering library"; 61 homepage = "https://github.com/pymupdf/PyMuPDF"; 62 changelog = "https://github.com/pymupdf/PyMuPDF/releases/tag/${version}"; 63 license = licenses.agpl3Only; 64 maintainers = with maintainers; [ teto ]; 65 platforms = platforms.unix; 66 }; 67}