1{ lib, buildPythonPackage, fetchFromGitHub, pdfminer-six, 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 --replace "pdfminer.six==20201018" "pdfminer.six"
18 '';
19
20 propagatedBuildInputs = [ pdfminer-six chardet ];
21
22 checkInputs = [ pytestCheckHook ];
23
24 meta = with lib; {
25 inherit (src.meta) homepage;
26 description = "Extract references (pdf, url, doi, arxiv) and metadata from a PDF";
27 license = licenses.asl20;
28 maintainers = with maintainers; [ marsam ];
29 };
30}