2021-04-13 19:44:15 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, pdfminer, 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";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "metachris";
|
|
|
|
repo = "pdfx";
|
|
|
|
rev = "v${version}";
|
2021-04-13 19:44:15 +00:00
|
|
|
sha256 = "sha256-POpP6XwcqwvImrtIiDjpnHoNE0MKapuPjxojo+ocBK0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace "chardet==4.0.0" "chardet"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ pdfminer chardet ];
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
checkInputs = [ 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 ];
|
|
|
|
};
|
|
|
|
}
|