2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2023-08-22 20:05:09 +00:00
|
|
|
, fetchpatch
|
2023-02-22 10:55:15 +00:00
|
|
|
, ghostscript
|
2021-12-06 16:07:01 +00:00
|
|
|
, imagemagick
|
2023-02-22 10:55:15 +00:00
|
|
|
, poppler_utils
|
2021-12-06 16:07:01 +00:00
|
|
|
, python3
|
2023-02-22 10:55:15 +00:00
|
|
|
, tesseract5
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "invoice2data";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.4.4";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "invoice-x";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-pAvkp8xkHYi/7ymbxaT7/Jhu44j2P8emm8GyXC6IBnI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +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
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
dateparser
|
2022-06-16 17:23:12 +00:00
|
|
|
pdfminer-six
|
2021-12-06 16:07:01 +00:00
|
|
|
pillow
|
|
|
|
pyyaml
|
2024-01-02 11:29:13 +00:00
|
|
|
setuptools
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [
|
2023-02-22 10:55:15 +00:00
|
|
|
ghostscript
|
2021-12-06 16:07:01 +00:00
|
|
|
imagemagick
|
2023-02-22 10:55:15 +00:00
|
|
|
tesseract5
|
|
|
|
poppler_utils
|
2021-12-06 16:07:01 +00:00
|
|
|
])];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Tests fails even when ran manually on my ubuntu machine !!
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"invoice2data"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Data extractor for PDF invoices";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "invoice2data";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/invoice-x/invoice2data";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ psyanticy ];
|
|
|
|
};
|
|
|
|
}
|