2022-05-06 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, isPy3k
|
|
|
|
, cryptography
|
|
|
|
, charset-normalizer
|
|
|
|
, pytestCheckHook
|
|
|
|
, ocrmypdf
|
|
|
|
}:
|
2018-05-29 00:15:40 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-05-25 04:20:00 +00:00
|
|
|
pname = "pdfminer-six";
|
2022-05-25 04:20:00 +00:00
|
|
|
version = "20220524";
|
2020-04-01 09:20:00 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
2018-05-29 00:15:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pdfminer";
|
|
|
|
repo = "pdfminer.six";
|
2019-09-08 23:38:31 +00:00
|
|
|
rev = version;
|
2022-05-25 04:20:00 +00:00
|
|
|
sha256 = "sha256-XO9sdHeS/8MgVW0mxbTe2AY5BDfnBSDNzZwLsSKmQh0=";
|
2018-05-29 00:15:40 +00:00
|
|
|
};
|
|
|
|
|
2022-05-06 04:20:00 +00:00
|
|
|
propagatedBuildInputs = [ charset-normalizer cryptography ];
|
2019-03-13 01:55:52 +00:00
|
|
|
|
2021-10-22 22:14:20 +00:00
|
|
|
postInstall = ''
|
|
|
|
for file in $out/bin/*.py; do
|
|
|
|
ln $file ''${file//.py/}
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-03-23 17:19:27 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Verion is not stored in repo, gets added by a GitHub action after tag is created
|
|
|
|
# https://github.com/pdfminer/pdfminer.six/pull/727
|
|
|
|
substituteInPlace pdfminer/__init__.py --replace "__VERSION__" ${version}
|
|
|
|
'';
|
|
|
|
|
2022-05-06 04:20:00 +00:00
|
|
|
pythonImportsCheck = [ "pdfminer" ];
|
|
|
|
|
2022-03-19 04:20:00 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
2018-05-29 00:15:40 +00:00
|
|
|
|
2022-05-06 04:20:00 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
inherit ocrmypdf;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 09:20:00 +00:00
|
|
|
description = "PDF parser and analyzer";
|
|
|
|
homepage = "https://github.com/pdfminer/pdfminer.six";
|
2018-05-29 00:15:40 +00:00
|
|
|
license = licenses.mit;
|
2019-12-15 09:21:00 +00:00
|
|
|
maintainers = with maintainers; [ psyanticy marsam ];
|
2018-05-29 00:15:40 +00:00
|
|
|
};
|
|
|
|
}
|