1{ lib, buildPythonPackage, fetchFromGitHub, pdfminer, chardet, pytestCheckHook }:
2
3buildPythonPackage rec {
4 pname = "pdfx";
5 version = "1.4.1";
6
7 src = fetchFromGitHub {
8 owner = "metachris";
9 repo = "pdfx";
10 rev = "v${version}";
11 sha256 = "sha256-POpP6XwcqwvImrtIiDjpnHoNE0MKapuPjxojo+ocBK0=";
12 };
13
14 postPatch = ''
15 substituteInPlace requirements.txt \
16 --replace "chardet==4.0.0" "chardet"
17 '';
18
19 propagatedBuildInputs = [ pdfminer chardet ];
20
21 checkInputs = [ pytestCheckHook ];
22
23 meta = with lib; {
24 inherit (src.meta) homepage;
25 description = "Extract references (pdf, url, doi, arxiv) and metadata from a PDF";
26 license = licenses.asl20;
27 maintainers = with maintainers; [ marsam ];
28 };
29}