81047829ea
GitOrigin-RevId: 48d63e924a2666baf37f4f14a18f19347fbd54a2
42 lines
902 B
Nix
42 lines
902 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, mupdf
|
|
, swig
|
|
, freetype
|
|
, harfbuzz
|
|
, openjpeg
|
|
, jbig2dec
|
|
, libjpeg_turbo
|
|
, gumbo
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pymupdf";
|
|
version = "1.19.4";
|
|
|
|
src = fetchPypi {
|
|
pname = "PyMuPDF";
|
|
inherit version;
|
|
sha256 = "125783986da87fe1a5372d621e90fa49e454454af0b3d0f894858c146c712f81";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace setup.py \
|
|
--replace '/usr/include/mupdf' ${mupdf.dev}/include/mupdf
|
|
'';
|
|
nativeBuildInputs = [ swig ];
|
|
buildInputs = [ mupdf freetype harfbuzz openjpeg jbig2dec libjpeg_turbo gumbo ];
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "fitz" ];
|
|
|
|
meta = with lib; {
|
|
description = "Python bindings for MuPDF's rendering library.";
|
|
homepage = "https://github.com/pymupdf/PyMuPDF";
|
|
maintainers = with maintainers; [ teto ];
|
|
license = licenses.agpl3Only;
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|