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