Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pdf2image / default.nix
blob19353e781a6789ed1311f2929404d5ea3417bd18
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , pillow
5 , poppler_utils
6 , pythonOlder
7 }:
9 buildPythonPackage rec {
10   pname = "pdf2image";
11   version = "1.16.3";
12   format = "setuptools";
14   disabled = pythonOlder "3.7";
16   src = fetchPypi {
17     inherit pname version;
18     hash = "sha256-dCCIEMLO9NnjR3abjmKlIwOYLdtPLf10THq0uUCuKH4=";
19   };
21   postPatch = ''
22     # Only replace first match in file
23     sed -i '0,/poppler_path=None/s||poppler_path="${poppler_utils}/bin"|' pdf2image/pdf2image.py
24   '';
26   propagatedBuildInputs = [
27     pillow
28   ];
30   pythonImportsCheck = [
31     "pdf2image"
32   ];
34   meta = with lib; {
35     description = "Module that wraps the pdftoppm utility to convert PDF to PIL Image object";
36     homepage = "https://github.com/Belval/pdf2image";
37     changelog = "https://github.com/Belval/pdf2image/releases/tag/v${version}";
38     license = licenses.mit;
39     maintainers = with maintainers; [ gerschtli ];
40     platforms = platforms.all;
41   };