From ff51f58e1d14f6a66c37e2d523e77ab9a55144d3 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 5 Nov 2024 21:16:42 +0100 Subject: [PATCH 1/4] tesseract: format --- .../graphics/tesseract/tesseract5.nix | 50 ++++++++++++------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/graphics/tesseract/tesseract5.nix b/pkgs/applications/graphics/tesseract/tesseract5.nix index a8563a09e4c0..9edae016961e 100644 --- a/pkgs/applications/graphics/tesseract/tesseract5.nix +++ b/pkgs/applications/graphics/tesseract/tesseract5.nix @@ -1,6 +1,20 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config -, curl, leptonica, libarchive, libpng, libtiff, icu, pango, opencl-headers -, Accelerate, CoreGraphics, CoreVideo +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + pkg-config, + curl, + leptonica, + libarchive, + libpng, + libtiff, + icu, + pango, + opencl-headers, + Accelerate, + CoreGraphics, + CoreVideo, }: stdenv.mkDerivation rec { @@ -21,20 +35,22 @@ stdenv.mkDerivation rec { autoreconfHook ]; - buildInputs = [ - curl - leptonica - libarchive - libpng - libtiff - icu - pango - opencl-headers - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Accelerate - CoreGraphics - CoreVideo - ]; + buildInputs = + [ + curl + leptonica + libarchive + libpng + libtiff + icu + pango + opencl-headers + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + Accelerate + CoreGraphics + CoreVideo + ]; meta = { description = "OCR engine"; From 936c762b8e8c3907109af8e9203896baefaa8c58 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Nov 2024 18:01:40 +0100 Subject: [PATCH 2/4] tesseract: add patrickdag as maintainer --- pkgs/applications/graphics/tesseract/tesseract5.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/tesseract/tesseract5.nix b/pkgs/applications/graphics/tesseract/tesseract5.nix index 9edae016961e..4915c759287a 100644 --- a/pkgs/applications/graphics/tesseract/tesseract5.nix +++ b/pkgs/applications/graphics/tesseract/tesseract5.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { description = "OCR engine"; homepage = "https://github.com/tesseract-ocr/tesseract"; license = lib.licenses.asl20; - maintainers = [ ]; + maintainers = with lib.maintainers; [ patrickdag ]; platforms = lib.platforms.unix; mainProgram = "tesseract"; }; From 494d5c1958a9e27043bf3c3341fea01b107cd91b Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 22 Nov 2024 14:49:21 +0100 Subject: [PATCH 3/4] pytesseract: disable tests broken on tesseract 5.5.0 --- pkgs/development/python-modules/pytesseract/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/pytesseract/default.nix b/pkgs/development/python-modules/pytesseract/default.nix index 23a26fd52a1b..a12730c9f584 100644 --- a/pkgs/development/python-modules/pytesseract/default.nix +++ b/pkgs/development/python-modules/pytesseract/default.nix @@ -37,6 +37,11 @@ buildPythonPackage rec { packaging pillow ]; + disabledTests = [ + # https://github.com/madmaze/pytesseract/pull/559 + "incorrect_tessdata_dir" + "invalid_tessdata_dir" + ]; nativeCheckInputs = [ pytestCheckHook ]; From efad6261977a853c42bc262e695fa11f6c56b900 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 5 Nov 2024 21:20:51 +0100 Subject: [PATCH 4/4] tesseract: 5.3.4 -> 5.5.0 --- pkgs/applications/graphics/tesseract/tesseract5.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/graphics/tesseract/tesseract5.nix b/pkgs/applications/graphics/tesseract/tesseract5.nix index 4915c759287a..22059873e4bb 100644 --- a/pkgs/applications/graphics/tesseract/tesseract5.nix +++ b/pkgs/applications/graphics/tesseract/tesseract5.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + nix-update-script, autoreconfHook, pkg-config, curl, @@ -11,7 +12,6 @@ libtiff, icu, pango, - opencl-headers, Accelerate, CoreGraphics, CoreVideo, @@ -19,13 +19,13 @@ stdenv.mkDerivation rec { pname = "tesseract"; - version = "5.3.4"; + version = "5.5.0"; src = fetchFromGitHub { owner = "tesseract-ocr"; repo = "tesseract"; rev = version; - sha256 = "sha256-IKxzDhSM+BPsKyQP3mADAkpRSGHs4OmdFIA+Txt084M="; + sha256 = "sha256-qyckAQZs3gR1NBqWgE+COSKXhv3kPF+iHVQrt6OPi8s="; }; enableParallelBuilding = true; @@ -44,7 +44,6 @@ stdenv.mkDerivation rec { libtiff icu pango - opencl-headers ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Accelerate @@ -52,6 +51,7 @@ stdenv.mkDerivation rec { CoreVideo ]; + passthru.updateScript = nix-update-script { }; meta = { description = "OCR engine"; homepage = "https://github.com/tesseract-ocr/tesseract";