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