summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/tesserocr/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/tesserocr/default.nix')
-rw-r--r--pkgs/development/python-modules/tesserocr/default.nix24
1 files changed, 18 insertions, 6 deletions
diff --git a/pkgs/development/python-modules/tesserocr/default.nix b/pkgs/development/python-modules/tesserocr/default.nix
index d091eb08f57d..40c5dbfb49af 100644
--- a/pkgs/development/python-modules/tesserocr/default.nix
+++ b/pkgs/development/python-modules/tesserocr/default.nix
@@ -1,6 +1,7 @@
{
buildPythonPackage,
fetchPypi,
+ fetchpatch,
lib,
# build-system
@@ -21,14 +22,25 @@
buildPythonPackage rec {
pname = "tesserocr";
- version = "2.7.1";
+ version = "2.8.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
- hash = "sha256-N0TFyLur8YFyhJx3Mb4A3C5eRPjFVtN8hQ54h5SuCvQ=";
+ hash = "sha256-vlGNGxtf9UwRqtoeD9EpQlCepwWB4KizmipHOgstvTY=";
};
+ patches = [
+ # Fix a broken test. The issue has been reported upstream at
+ # https://github.com/sirfz/tesserocr/issues/363
+ # Check the status of the issue before removing this patch at the next
+ # update.
+ (fetchpatch {
+ url = "https://github.com/sirfz/tesserocr/commit/78d9e8187bd4d282d572bd5221db2c69e560e017.patch";
+ hash = "sha256-s51s9EIV9AZT6UoqwTuQ8lOjToqwIIUkDLjsvCsyYFU=";
+ })
+ ];
+
# https://github.com/sirfz/tesserocr/issues/314
postPatch = ''
sed -i '/allheaders.h/a\ pass\n\ncdef extern from "leptonica/pix_internal.h" nogil:' tesserocr/tesseract.pxd
@@ -55,12 +67,12 @@ buildPythonPackage rec {
rm -rf tesserocr
'';
- meta = with lib; {
+ meta = {
changelog = "https://github.com/sirfz/tesserocr/releases/tag/v${version}";
description = "Simple, Pillow-friendly, wrapper around the tesseract-ocr API for Optical Character Recognition (OCR)";
homepage = "https://github.com/sirfz/tesserocr";
- license = licenses.mit;
- maintainers = with maintainers; [ mtrsk ];
- platforms = platforms.unix;
+ license = lib.licenses.mit;
+ maintainers = with lib.maintainers; [ mtrsk ];
+ platforms = lib.platforms.unix;
};
}