2021-08-09 01:45:06 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, mupdf
|
|
|
|
, swig
|
|
|
|
, freetype
|
|
|
|
, harfbuzz
|
|
|
|
, openjpeg
|
|
|
|
, jbig2dec
|
|
|
|
, libjpeg_turbo
|
|
|
|
, gumbo
|
|
|
|
}:
|
|
|
|
|
2019-09-19 09:14:27 +00:00
|
|
|
buildPythonPackage rec {
|
2020-11-10 09:13:13 +00:00
|
|
|
pname = "pymupdf";
|
2022-03-07 05:41:25 +00:00
|
|
|
version = "1.19.6";
|
2019-09-19 09:14:27 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2020-11-10 09:13:13 +00:00
|
|
|
pname = "PyMuPDF";
|
|
|
|
inherit version;
|
2022-03-07 05:41:25 +00:00
|
|
|
sha256 = "sha256-7z0T4n8Vhdd29qJZfxE6q9KNNrZIuYOnKFCyHFOZqwg=";
|
2019-09-19 09:14:27 +00:00
|
|
|
};
|
|
|
|
|
2021-08-09 01:45:06 +00:00
|
|
|
postPatch = ''
|
2019-09-19 09:14:27 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '/usr/include/mupdf' ${mupdf.dev}/include/mupdf
|
2021-08-09 01:45:06 +00:00
|
|
|
'';
|
2019-09-19 09:14:27 +00:00
|
|
|
nativeBuildInputs = [ swig ];
|
2021-08-09 01:45:06 +00:00
|
|
|
buildInputs = [ mupdf freetype harfbuzz openjpeg jbig2dec libjpeg_turbo gumbo ];
|
2019-09-19 09:14:27 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-08-09 01:45:06 +00:00
|
|
|
pythonImportsCheck = [ "fitz" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-09-19 09:14:27 +00:00
|
|
|
description = "Python bindings for MuPDF's rendering library.";
|
2020-02-29 16:30:00 +00:00
|
|
|
homepage = "https://github.com/pymupdf/PyMuPDF";
|
2019-09-19 09:14:27 +00:00
|
|
|
maintainers = with maintainers; [ teto ];
|
2021-08-09 01:45:06 +00:00
|
|
|
license = licenses.agpl3Only;
|
2019-09-19 09:14:27 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|