From 4ca42ad0a78017199ae6bf91b8ce90a9e35c5641 Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Sat, 11 Feb 2023 18:07:57 +0100 Subject: [PATCH] invoice2data: 0.3.6 -> 0.4.2 Update invoice2data to version v0.4.2 [released on 2023-02-11](https://github.com/invoice-x/invoice2data/releases/tag/v0.4.2). This change also * Installs `ghostscript`, which is used to convert pdfs to images used as input for tesseract * Uses tesseract 5 instead of tesseract 3 * Switches from `xpdf` (which is also marked as insecure) to `poppler_utils`, which is the recommended provider of `pdftotext` according to the `invoice2data` repo. --- pkgs/tools/text/invoice2data/default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/text/invoice2data/default.nix b/pkgs/tools/text/invoice2data/default.nix index d23486159013..acb4e373e809 100644 --- a/pkgs/tools/text/invoice2data/default.nix +++ b/pkgs/tools/text/invoice2data/default.nix @@ -1,26 +1,25 @@ { lib , fetchFromGitHub +, ghostscript , imagemagick +, poppler_utils , python3 -, tesseract -, xpdf +, tesseract5 }: python3.pkgs.buildPythonApplication rec { pname = "invoice2data"; - version = "0.3.6"; + version = "0.4.2"; format = "setuptools"; src = fetchFromGitHub { owner = "invoice-x"; repo = pname; rev = "v${version}"; - sha256 = "sha256-t1jgLyKtQsLINlnkCdSbVfTM6B/EiD1yGtx9UHjyZVE="; + sha256 = "sha256-ss2h8cg0sga+lzJyQHckrZB/Eb63Oj3FkqmGqWCzCQ8="; }; - nativeBuildInputs = with python3.pkgs; [ - setuptools-git - ]; + buildInputs = with python3.pkgs; [ setuptools-git ]; propagatedBuildInputs = with python3.pkgs; [ chardet @@ -28,6 +27,7 @@ python3.pkgs.buildPythonApplication rec { pdfminer-six pillow pyyaml + setuptools unidecode ]; @@ -37,9 +37,10 @@ python3.pkgs.buildPythonApplication rec { ''; makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [ + ghostscript imagemagick - tesseract - xpdf + tesseract5 + poppler_utils ])]; # Tests fails even when ran manually on my ubuntu machine !!