blob: b18981d2ab620c36fbcdda0d848f23fd7427cc43 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
{
lib,
buildPythonPackage,
fetchPypi,
pillow,
poppler-utils,
}:
buildPythonPackage rec {
pname = "pdf2image";
version = "1.17.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-6qlZvBFrQg3X7EFfyuSbmBAN2j3RjNL9+obQnxEvbVc=";
};
postPatch = ''
# replace all default values of paths to poppler-utils
substituteInPlace pdf2image/pdf2image.py \
--replace-fail 'poppler_path: Union[str, PurePath] = None' \
'poppler_path: Union[str, PurePath] = "${poppler-utils}/bin"'
'';
propagatedBuildInputs = [ pillow ];
pythonImportsCheck = [ "pdf2image" ];
meta = {
description = "Module that wraps the pdftoppm utility to convert PDF to PIL Image object";
homepage = "https://github.com/Belval/pdf2image";
changelog = "https://github.com/Belval/pdf2image/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ gerschtli ];
platforms = lib.platforms.all;
};
}
|