2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2024-01-02 11:29:13 +00:00
|
|
|
, importlib-metadata
|
2022-05-18 14:49:53 +00:00
|
|
|
, isPy3k
|
|
|
|
, cryptography
|
|
|
|
, charset-normalizer
|
2022-11-04 12:27:35 +00:00
|
|
|
, pythonOlder
|
|
|
|
, typing-extensions
|
2022-05-18 14:49:53 +00:00
|
|
|
, pytestCheckHook
|
2024-01-02 11:29:13 +00:00
|
|
|
, setuptools
|
|
|
|
, substituteAll
|
2022-05-18 14:49:53 +00:00
|
|
|
, ocrmypdf
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "pdfminer-six";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "20231228";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pdfminer";
|
|
|
|
repo = "pdfminer.six";
|
|
|
|
rev = version;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-LXPECQQojD3IY9zRkrDBufy4A8XUuYiRpryqUx/I3qo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./disable-setuptools-git-versioning.patch;
|
|
|
|
inherit version;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
charset-normalizer
|
|
|
|
cryptography
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
typing-extensions
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
postInstall = ''
|
|
|
|
for file in $out/bin/*.py; do
|
|
|
|
ln $file ''${file//.py/}
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pdfminer"
|
|
|
|
"pdfminer.high_level"
|
|
|
|
];
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-04 12:27:35 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
inherit ocrmypdf;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "PDF parser and analyzer";
|
|
|
|
homepage = "https://github.com/pdfminer/pdfminer.six";
|
|
|
|
license = licenses.mit;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ psyanticy ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|