2021-08-10 14:31:46 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, mupdf
|
|
|
|
, swig
|
|
|
|
, freetype
|
|
|
|
, harfbuzz
|
|
|
|
, openjpeg
|
|
|
|
, jbig2dec
|
|
|
|
, libjpeg_turbo
|
|
|
|
, gumbo
|
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
2020-11-19 00:13:47 +00:00
|
|
|
pname = "pymupdf";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "1.19.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2020-11-19 00:13:47 +00:00
|
|
|
pname = "PyMuPDF";
|
|
|
|
inherit version;
|
2022-03-05 16:20:37 +00:00
|
|
|
sha256 = "sha256-OTybnLJmmoaRoBew/bmuDs86Smbypc6jfQqqGikKVaU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '/usr/include/mupdf' ${mupdf.dev}/include/mupdf
|
2021-08-10 14:31:46 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ swig ];
|
2021-08-10 14:31:46 +00:00
|
|
|
buildInputs = [ mupdf freetype harfbuzz openjpeg jbig2dec libjpeg_turbo gumbo ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
pythonImportsCheck = [ "fitz" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python bindings for MuPDF's rendering library.";
|
|
|
|
homepage = "https://github.com/pymupdf/PyMuPDF";
|
|
|
|
maintainers = with maintainers; [ teto ];
|
2021-08-10 14:31:46 +00:00
|
|
|
license = licenses.agpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|