about summary refs log tree commit diff
path: root/pkgs/applications/graphics/tesseract
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2023-01-28 16:19:10 +0000
committerRobert Scott <code@humanleg.org.uk>2023-01-28 16:20:52 +0000
commitc623309976b707a9c6e8c02b566f4239779ce4ac (patch)
tree2e4baf194c7da9b5338bf72a2859deddb07f490f /pkgs/applications/graphics/tesseract
parent3b77f6c31be895c12b1938d06ee052da2463b3d7 (diff)
tesseract: 3.05.00 -> 3.05.02
fix build with leptonica 1.83
Diffstat (limited to 'pkgs/applications/graphics/tesseract')
-rw-r--r--pkgs/applications/graphics/tesseract/tesseract3.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/applications/graphics/tesseract/tesseract3.nix b/pkgs/applications/graphics/tesseract/tesseract3.nix
index 16365674706ed..bf19d0f77eb6f 100644
--- a/pkgs/applications/graphics/tesseract/tesseract3.nix
+++ b/pkgs/applications/graphics/tesseract/tesseract3.nix
@@ -3,15 +3,23 @@
 
 stdenv.mkDerivation rec {
   pname = "tesseract";
-  version = "3.05.00";
+  version = "3.05.02";
 
   src = fetchFromGitHub {
     owner = "tesseract-ocr";
     repo = "tesseract";
     rev = version;
-    hash = "sha256-YHj00gG/3SW0ILTiQwphiCxuP9OCDya27hyFQB27mYc=";
+    hash = "sha256-28osuZnVwkJpNTYkU+5D5PI8xtViFzGCMScHzkS2H20=";
   };
 
+  # leptonica 1.83 made internal structures private. using internal headers isn't
+  # great, but tesseract3's days are numbered anyway
+  postPatch = ''
+    for f in textord/devanagari_processing.cpp cube/cube_line_object.h cube/cube_line_segmenter.h cube/cube_utils.h ; do
+      sed -i '/allheaders.h/a#include "pix_internal.h"' "$f"
+    done
+  '';
+
   enableParallelBuilding = true;
 
   nativeBuildInputs = [