2021-08-10 14:31:46 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, mupdf
|
|
|
|
, swig
|
|
|
|
, freetype
|
|
|
|
, harfbuzz
|
|
|
|
, openjpeg
|
|
|
|
, jbig2dec
|
|
|
|
, libjpeg_turbo
|
|
|
|
, gumbo
|
2022-12-17 10:02:37 +00:00
|
|
|
, pythonOlder
|
2021-08-10 14:31:46 +00:00
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
2020-11-19 00:13:47 +00:00
|
|
|
pname = "pymupdf";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "1.21.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2020-11-19 00:13:47 +00:00
|
|
|
pname = "PyMuPDF";
|
|
|
|
inherit version;
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-pj38KJ4SeharYDEO5gBf6DEhx6l/fBINtoj5KByeXQ8=";
|
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
|
|
|
'';
|
2022-12-17 10:02:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
swig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
mupdf
|
|
|
|
freetype
|
|
|
|
harfbuzz
|
|
|
|
openjpeg
|
|
|
|
jbig2dec
|
|
|
|
libjpeg_turbo
|
|
|
|
gumbo
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"fitz"
|
|
|
|
];
|
2021-08-10 14:31:46 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-12-17 10:02:37 +00:00
|
|
|
description = "Python bindings for MuPDF's rendering library";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/pymupdf/PyMuPDF";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/pymupdf/PyMuPDF/releases/tag/${version}";
|
2021-08-10 14:31:46 +00:00
|
|
|
license = licenses.agpl3Only;
|
2022-12-17 10:02:37 +00:00
|
|
|
maintainers = with maintainers; [ teto ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|