diff --git a/pkgs/development/python-modules/tesserocr/default.nix b/pkgs/development/python-modules/tesserocr/default.nix index f1b795fb641c..b7322f07b473 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="; + sha256 = "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)";