2021-11-21 12:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2023-08-12 23:38:19 +00:00
|
|
|
, fetchpatch
|
2023-02-11 17:07:57 +00:00
|
|
|
, ghostscript
|
2021-11-21 12:52:07 +00:00
|
|
|
, imagemagick
|
2023-02-11 17:07:57 +00:00
|
|
|
, poppler_utils
|
2021-11-21 12:52:07 +00:00
|
|
|
, python3
|
2023-02-11 17:07:57 +00:00
|
|
|
, 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";
|
2023-02-11 17:07:57 +00:00
|
|
|
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}";
|
2023-08-12 23:38:19 +00:00
|
|
|
hash = "sha256-ss2h8cg0sga+lzJyQHckrZB/Eb63Oj3FkqmGqWCzCQ8=";
|
2018-05-30 12:58:34 +00:00
|
|
|
};
|
|
|
|
|
2023-08-12 23:38:19 +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
|
2022-05-25 04:20:00 +00:00
|
|
|
pdfminer-six
|
2021-11-21 12:52:07 +00:00
|
|
|
pillow
|
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
|
|
|
makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [
|
2023-02-11 17:07:57 +00:00
|
|
|
ghostscript
|
2021-11-21 12:52:07 +00:00
|
|
|
imagemagick
|
2023-02-11 17:07:57 +00:00
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-05-30 12:58:34 +00:00
|
|
|
description = "Data extractor for PDF invoices";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/invoice-x/invoice2data";
|
2018-05-30 12:58:34 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ psyanticy ];
|
|
|
|
};
|
|
|
|
}
|