42 lines
903 B
Nix
42 lines
903 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, mupdf
|
|
, swig
|
|
, freetype
|
|
, harfbuzz
|
|
, openjpeg
|
|
, jbig2dec
|
|
, libjpeg_turbo
|
|
, gumbo
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pymupdf";
|
|
version = "1.18.17";
|
|
|
|
src = fetchPypi {
|
|
pname = "PyMuPDF";
|
|
inherit version;
|
|
sha256 = "fa39ee5e91eae77818e07b6bb7e0cb0b402ad88e39a74b08626ce1c2150c5414";
|
|
};
|
|
|
|
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;
|
|
};
|
|
}
|