68bc260ca2
From the upstream changelog: * Tesseract development is now done with Git and hosted at github.com (Previously we used Subversion as a VCS and code.google.com for hosting). So let's move over to the GitHub repository, where the organisation also includes a full repository for tessdata, so we no longer need to fetch it one-by-one. The build also got significantly simpler, because we no longer need to run autoconf, neither do we need to patch the configure script for Leptonica headers. This also has the advantage that we don't need to use the enableLanguages attribute for the test runner anymore. Full upstream changelog can be found at: https://github.com/tesseract-ocr/tesseract/blob/c4d273d33cc36e/ChangeLog Tested against all NixOS tests with enabled OCR (chromium, emacs-daemon, installer.luksroot and lightdm). Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @viric
38 lines
1.0 KiB
Nix
38 lines
1.0 KiB
Nix
{ stdenv, fetchFromGitHub, pkgconfig, leptonica, libpng, libtiff
|
|
, icu, pango, opencl-headers
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "tesseract-${version}";
|
|
version = "3.04.01";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tesseract-ocr";
|
|
repo = "tesseract";
|
|
rev = version;
|
|
sha256 = "0h1x4z1h86n2gwknd0wck6gykkp99bmm02lg4a47a698g4az6ybv";
|
|
};
|
|
|
|
tessdata = fetchFromGitHub {
|
|
owner = "tesseract-ocr";
|
|
repo = "tessdata";
|
|
rev = "3cf1e2df1fe1d1da29295c9ef0983796c7958b7d";
|
|
sha256 = "1v4b63v5nzcxr2y3635r19l7lj5smjmc9vfk0wmxlryxncb4vpg7";
|
|
};
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
buildInputs = [ leptonica libpng libtiff icu pango opencl-headers ];
|
|
|
|
LIBLEPT_HEADERSDIR = "${leptonica}/include";
|
|
|
|
postInstall = "cp -Rt \"$out/share/tessdata\" \"$tessdata/\"*";
|
|
|
|
meta = {
|
|
description = "OCR engine";
|
|
homepage = http://code.google.com/p/tesseract-ocr/;
|
|
license = stdenv.lib.licenses.asl20;
|
|
maintainers = with stdenv.lib.maintainers; [viric];
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
};
|
|
}
|