1{ lib 2, buildPythonPackage 3, fetchPypi 4, pillow 5, poppler_utils 6, pythonOlder 7}: 8 9buildPythonPackage rec { 10 pname = "pdf2image"; 11 version = "1.16.3"; 12 format = "setuptools"; 13 14 disabled = pythonOlder "3.7"; 15 16 src = fetchPypi { 17 inherit pname version; 18 hash = "sha256-dCCIEMLO9NnjR3abjmKlIwOYLdtPLf10THq0uUCuKH4="; 19 }; 20 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 ''; 25 26 propagatedBuildInputs = [ 27 pillow 28 ]; 29 30 pythonImportsCheck = [ 31 "pdf2image" 32 ]; 33 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 }; 42}