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