1{ stdenv, buildPythonPackage, fetchFromGitHub, pdfminer, chardet, pytest }:
2
3buildPythonPackage rec {
4 pname = "pdfx";
5 version = "1.3.1";
6
7 src = fetchFromGitHub {
8 owner = "metachris";
9 repo = "pdfx";
10 rev = "v${version}";
11 sha256 = "1183k4h5qdf8y0imbir9ja3yzzsvdmqgbv3bi6dnkgr1wy2xfr0v";
12 };
13
14 # Remove after https://github.com/metachris/pdfx/pull/28
15 prePatch = ''
16 sed -i -e "s|pdfminer2|pdfminer.six|" setup.py
17 '';
18
19 propagatedBuildInputs = [ pdfminer chardet ];
20
21 checkInputs = [ pytest ];
22
23 checkPhase = ''
24 py.test
25 '';
26
27 meta = with stdenv.lib; {
28 inherit (src.meta) homepage;
29 description = "Extract references (pdf, url, doi, arxiv) and metadata from a PDF";
30 license = licenses.asl20;
31 maintainers = with maintainers; [ marsam ];
32 };
33}