about summary refs log tree commit diff
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, 16 insertions, 8 deletions
diff --git a/pkgs/development/python-modules/tesserocr/default.nix b/pkgs/development/python-modules/tesserocr/default.nix
index f1b795fb641ce..cfc4922eccf7a 100644
--- a/pkgs/development/python-modules/tesserocr/default.nix
+++ b/pkgs/development/python-modules/tesserocr/default.nix
@@ -3,13 +3,16 @@
   fetchPypi,
   lib,
 
-  # build dependencies
+  # build-system
   cython,
-  leptonica,
   pkg-config,
+  setuptools,
+
+  # native dependencies
+  leptonica,
   tesseract4,
 
-  # propagates
+  # dependencies
   pillow,
 
   # tests
@@ -18,22 +21,23 @@
 
 buildPythonPackage rec {
   pname = "tesserocr";
-  version = "2.6.3";
+  version = "2.7.0";
   format = "setuptools";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "sha256-RMHE73vcKGz6FEzhoJfoHDMp9KQ1CbyElKGrhSM4xuE=";
+    hash = "sha256-RcCTYwM30Bpqj5d6JGrW1zLrEfLgcrsibVmtPSR4HJk=";
   };
 
   # https://github.com/sirfz/tesserocr/issues/314
   postPatch = ''
-    sed -i '/allheaders.h/a\    pass\n\ncdef extern from "leptonica/pix_internal.h" nogil:' tesseract.pxd
+    sed -i '/allheaders.h/a\    pass\n\ncdef extern from "leptonica/pix_internal.h" nogil:' tesserocr/tesseract.pxd
   '';
 
-  nativeBuildInputs = [
+  build-system = [
     cython
     pkg-config
+    setuptools
   ];
 
   buildInputs = [
@@ -41,12 +45,16 @@ buildPythonPackage rec {
     tesseract4
   ];
 
-  propagatedBuildInputs = [ pillow ];
+  dependencies = [ pillow ];
 
   pythonImportsCheck = [ "tesserocr" ];
 
   nativeCheckInputs = [ unittestCheckHook ];
 
+  preCheck = ''
+    rm -rf tesserocr
+  '';
+
   meta = with lib; {
     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)";