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

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

64 lines
1.4 KiB
Nix
Raw Normal View History

2021-11-21 12:52:07 +00:00
{ lib
, fetchFromGitHub
, fetchpatch
, 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}";
hash = "sha256-ss2h8cg0sga+lzJyQHckrZB/Eb63Oj3FkqmGqWCzCQ8=";
2018-05-30 12:58:34 +00:00
};
patches = [
# https://github.com/invoice-x/invoice2data/pull/522
(fetchpatch {
name = "clean-up-build-dependencies.patch";
url = "https://github.com/invoice-x/invoice2data/commit/ccea3857c7c8295ca51dc24de6cde78774ea7e64.patch";
hash = "sha256-BhqPW4hWG/EaR3qBv5a68dcvIMrCCT74GdDHr0Mss5Q=";
})
];
nativeBuildInputs = 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; [
dateparser
pdfminer-six
2021-11-21 12:52:07 +00:00
pillow
pyyaml
];
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 ];
};
}