Merge pull request #133211 from luhuaei/master

pymupdf: add patches for nix

authored by Sandro and committed by GitHub 782f764c ec81333c

+32 -7
+32 -7
pkgs/development/python-modules/pymupdf/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, mupdf, swig }: 2 buildPythonPackage 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 }
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchPypi 4 + , fetchpatch 5 + , mupdf 6 + , swig 7 + , freetype 8 + , harfbuzz 9 + , openjpeg 10 + , jbig2dec 11 + , libjpeg_turbo 12 + , gumbo 13 + }: 14 + 15 buildPythonPackage rec { 16 pname = "pymupdf"; 17 + version = "1.18.16"; 18 19 src = fetchPypi { 20 pname = "PyMuPDF"; 21 inherit version; 22 + sha256 = "b21e39098fbbe0fdf269fdb2d1dd25a3847bbf22785ee8903d3a5637c2d0b9d7"; 23 }; 24 25 + patchFlags = [ "--binary" "--ignore-whitespace" ]; 26 + patches = [ 27 + # Add NIX environment support. 28 + # Should be removed next pyMuPDF release. 29 + (fetchpatch { 30 + url = "https://github.com/pymupdf/PyMuPDF/commit/d9b2d42019e5705a1c6621ea0cdfa26da1ce9ad5.patch"; 31 + sha256 = "fc3f6ad88c8f3933ed9ab9d4db9ebec8bc30ed5113f6ca9d72080b56dfa52ad6"; 32 + }) 33 + ]; 34 + 35 + postPatch = '' 36 substituteInPlace setup.py \ 37 --replace '/usr/include/mupdf' ${mupdf.dev}/include/mupdf 38 + ''; 39 nativeBuildInputs = [ swig ]; 40 + buildInputs = [ mupdf freetype harfbuzz openjpeg jbig2dec libjpeg_turbo gumbo ]; 41 42 doCheck = false; 43 44 + pythonImportsCheck = [ "fitz" ]; 45 + 46 meta = with lib; { 47 description = "Python bindings for MuPDF's rendering library."; 48 homepage = "https://github.com/pymupdf/PyMuPDF"; 49 maintainers = with maintainers; [ teto ]; 50 + license = licenses.agpl3Only; 51 platforms = platforms.linux; 52 }; 53 }