2022-06-16 17:23:12 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, pdfminer-six, chardet, pytestCheckHook }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pdfx";
|
2021-04-13 19:44:15 +00:00
|
|
|
version = "1.4.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "metachris";
|
|
|
|
repo = "pdfx";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-POpP6XwcqwvImrtIiDjpnHoNE0MKapuPjxojo+ocBK0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
2022-03-30 09:31:56 +00:00
|
|
|
--replace "chardet==4.0.0" "chardet" \
|
|
|
|
--replace "pdfminer.six==20201018" "pdfminer.six"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [ pdfminer-six chardet ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Extract references (pdf, url, doi, arxiv) and metadata from a PDF";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ marsam ];
|
|
|
|
};
|
|
|
|
}
|