2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, autoconf-archive, pkg-config
|
2021-11-12 17:09:14 +00:00
|
|
|
, leptonica, libpng, libtiff, icu, pango, opencl-headers, fetchpatch }:
|
2017-04-11 01:30:45 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "tesseract";
|
2020-01-17 12:04:34 +00:00
|
|
|
version = "4.1.1";
|
2017-04-11 01:30:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tesseract-ocr";
|
|
|
|
repo = "tesseract";
|
2018-11-24 23:23:18 +00:00
|
|
|
rev = version;
|
2022-05-02 11:38:49 +01:00
|
|
|
hash = "sha256-lu/Y5mlCI8AajhiWaID0fGo5PghEQZdgt2X0K9c/QrE=";
|
2017-04-11 01:30:45 +01:00
|
|
|
};
|
|
|
|
|
2021-11-12 17:09:14 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/tesseract-ocr/tesseract/issues/3447
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tesseract-ocr/tesseract/commit/dbc79b09d195490dfa3f7d338eadac07ad6683f7.patch";
|
|
|
|
sha256 = "sha256-lGlg0etuU4RXfdq1QH2bYObdeGrFHKf9O8zMUAbfNIQ=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tesseract-ocr/tesseract/commit/6dc4b184b1ebf2e68461f6b63f63a033bc7245f7.patch";
|
|
|
|
sha256 = "sha256-DwIX3r5NmeajI6WgIVHDbkhLH/ygJIjPO5XrbzWQhSw=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-12-18 18:02:13 +00:00
|
|
|
enableParallelBuilding = true;
|
2017-04-11 01:30:45 +01:00
|
|
|
|
2022-05-02 11:38:50 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
autoreconfHook
|
|
|
|
autoconf-archive
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
leptonica
|
|
|
|
libpng
|
|
|
|
libtiff
|
|
|
|
icu
|
|
|
|
pango
|
|
|
|
opencl-headers
|
|
|
|
];
|
2017-04-11 01:30:45 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "OCR engine";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/tesseract-ocr/tesseract";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.asl20;
|
2022-06-26 18:12:18 +01:00
|
|
|
maintainers = with lib.maintainers; [ viric erikarvstedt ];
|
2021-01-15 13:21:58 +00:00
|
|
|
platforms = with lib.platforms; linux ++ darwin;
|
2017-04-11 01:30:45 +01:00
|
|
|
};
|
|
|
|
}
|