2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cryptography,
|
|
|
|
charset-normalizer,
|
|
|
|
pythonOlder,
|
|
|
|
pytestCheckHook,
|
|
|
|
setuptools,
|
|
|
|
substituteAll,
|
|
|
|
ocrmypdf,
|
2022-05-18 14:49:53 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "pdfminer-six";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "20240706";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pdfminer";
|
|
|
|
repo = "pdfminer.six";
|
2024-07-27 06:49:29 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-aY7GQADRxeiclr6/G3RRgrPcl8rGiC85JYEIjIa+vG0=";
|
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;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dependencies = [
|
|
|
|
charset-normalizer
|
|
|
|
cryptography
|
|
|
|
];
|
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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ 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; {
|
2024-07-27 06:49:29 +00:00
|
|
|
changelog = "https://github.com/pdfminer/pdfminer.six/blob/${src.rev}/CHANGELOG.md";
|
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
|
|
|
};
|
|
|
|
}
|