nixpkgs/pkgs/tools/text/invoice2data/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.1 KiB
Nix
Raw Normal View History

2021-11-21 12:52:07 +00:00
{ lib
, fetchFromGitHub
, ghostscript
2021-11-21 12:52:07 +00:00
, imagemagick
, poppler_utils
2021-11-21 12:52:07 +00:00
, python3
, tesseract5
2021-11-21 12:52:07 +00:00
}:
2018-05-30 12:58:34 +00:00
2021-11-21 12:52:07 +00:00
python3.pkgs.buildPythonApplication rec {
2018-05-30 12:58:34 +00:00
pname = "invoice2data";
version = "0.4.2";
2021-11-21 12:52:07 +00:00
format = "setuptools";
2018-05-30 12:58:34 +00:00
2021-11-21 12:52:07 +00:00
src = fetchFromGitHub {
owner = "invoice-x";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ss2h8cg0sga+lzJyQHckrZB/Eb63Oj3FkqmGqWCzCQ8=";
2018-05-30 12:58:34 +00:00
};
buildInputs = with python3.pkgs; [ setuptools-git ];
2018-05-30 12:58:34 +00:00
2021-11-21 12:52:07 +00:00
propagatedBuildInputs = with python3.pkgs; [
chardet
dateparser
pdfminer-six
2021-11-21 12:52:07 +00:00
pillow
pyyaml
setuptools
2021-11-21 12:52:07 +00:00
unidecode
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "pytest-runner" ""
'';
makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [
ghostscript
2021-11-21 12:52:07 +00:00
imagemagick
tesseract5
poppler_utils
2021-11-21 12:52:07 +00:00
])];
2018-05-30 12:58:34 +00:00
# Tests fails even when ran manually on my ubuntu machine !!
doCheck = false;
2021-11-21 12:52:07 +00:00
pythonImportsCheck = [
"invoice2data"
];
meta = with lib; {
2018-05-30 12:58:34 +00:00
description = "Data extractor for PDF invoices";
homepage = "https://github.com/invoice-x/invoice2data";
2018-05-30 12:58:34 +00:00
license = licenses.mit;
maintainers = with maintainers; [ psyanticy ];
};
}