1{ lib, stdenv, buildPythonPackage, fetchPypi, poppler }: 2 3buildPythonPackage rec { 4 pname = "pdftotext"; 5 version = "2.2.1"; 6 7 src = fetchPypi { 8 inherit pname version; 9 sha256 = "a067c121654917ecbe07fbd71c807c34bbdb1ea029e269ddd11925ee7e191d3f"; 10 }; 11 12 postPatch = lib.optionalString stdenv.isDarwin '' 13 substituteInPlace setup.py \ 14 --replace '= brew_poppler_include()' '= "${lib.getDev poppler}/include", "${lib.getLib poppler}/lib"' 15 ''; 16 17 buildInputs = [ poppler ]; 18 19 meta = with lib; { 20 description = "Simple PDF text extraction"; 21 homepage = "https://github.com/jalan/pdftotext"; 22 license = licenses.mit; 23 maintainers = with maintainers; [ earvstedt ]; 24 }; 25}