1 { lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
2 , leptonica, libpng, libtiff, icu, pango, opencl-headers }:
4 stdenv.mkDerivation rec {
8 src = fetchFromGitHub {
9 owner = "tesseract-ocr";
12 hash = "sha256-28osuZnVwkJpNTYkU+5D5PI8xtViFzGCMScHzkS2H20=";
15 # leptonica 1.83 made internal structures private. using internal headers isn't
16 # great, but tesseract3's days are numbered anyway
18 for f in textord/devanagari_processing.cpp cube/cube_line_object.h cube/cube_line_segmenter.h cube/cube_utils.h ; do
19 sed -i '/allheaders.h/a#include "pix_internal.h"' "$f"
23 enableParallelBuilding = true;
39 LIBLEPT_HEADERSDIR = "${leptonica}/include";
42 description = "OCR engine";
43 homepage = "https://github.com/tesseract-ocr/tesseract";
44 license = lib.licenses.asl20;
45 maintainers = with lib.maintainers; [ viric erikarvstedt ];
46 platforms = with lib.platforms; linux ++ darwin;
47 mainProgram = "tesseract";