depot/third_party/nixpkgs/pkgs/development/python-modules/pdfx/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

42 lines
875 B
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pdfminer-six,
chardet,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pdfx";
version = "1.4.1";
format = "setuptools";
src = fetchFromGitHub {
owner = "metachris";
repo = "pdfx";
rev = "v${version}";
hash = "sha256-POpP6XwcqwvImrtIiDjpnHoNE0MKapuPjxojo+ocBK0=";
};
postPatch = ''
substituteInPlace requirements.txt \
--replace "chardet==4.0.0" "chardet" \
--replace "pdfminer.six==20201018" "pdfminer.six"
'';
propagatedBuildInputs = [
pdfminer-six
chardet
];
nativeCheckInputs = [ pytestCheckHook ];
meta = with lib; {
inherit (src.meta) homepage;
description = "Extract references (pdf, url, doi, arxiv) and metadata from a PDF";
mainProgram = "pdfx";
license = licenses.asl20;
maintainers = with maintainers; [ ];
};
}