2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchPypi, poppler }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pdftotext";
|
2021-10-04 12:37:57 +00:00
|
|
|
version = "2.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-10-04 12:37:57 +00:00
|
|
|
sha256 = "a067c121654917ecbe07fbd71c807c34bbdb1ea029e269ddd11925ee7e191d3f";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '= brew_poppler_include()' '= "${lib.getDev poppler}/include", "${lib.getLib poppler}/lib"'
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ poppler ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple PDF text extraction";
|
|
|
|
homepage = "https://github.com/jalan/pdftotext";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ earvstedt ];
|
|
|
|
};
|
|
|
|
}
|