2012-06-11 11:28:28 +01:00
|
|
|
{ stdenv, fetchurl, autoconf, automake, libtool, leptonica, libpng, libtiff }:
|
2011-04-24 19:04:07 +01:00
|
|
|
|
2011-04-24 21:01:19 +01:00
|
|
|
let
|
2013-06-11 18:22:30 +01:00
|
|
|
majVersion = "3.02";
|
|
|
|
version = "${majVersion}.02";
|
|
|
|
|
2011-04-24 21:01:19 +01:00
|
|
|
f = lang : sha256 : let
|
2013-06-11 18:22:30 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://tesseract-ocr.googlecode.com/files/tesseract-ocr-${majVersion}.${lang}.tar.gz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
"tar xfvz ${src} -C $out/share/ --strip=1";
|
|
|
|
|
2011-04-24 21:01:19 +01:00
|
|
|
extraLanguages = ''
|
2013-06-11 23:50:52 +01:00
|
|
|
${f "cat" "0d1smiv1b3k9ay2s05sl7q08mb3ln4w5iiiymv2cs8g8333z8jl9"}
|
|
|
|
${f "rus" "059336mkhsj9m3hwfb818xjlxkcdpy7wfgr62qwz65cx914xl709"}
|
|
|
|
${f "spa" "1c9iza5mbahd9pa7znnq8yv09v5kz3gbd2sarcgcgc1ps1jc437l"}
|
|
|
|
${f "nld" "162acxp1yb6gyki2is3ay2msalmfcsnrlsd9wml2ja05k94m6bjy"}
|
|
|
|
${f "eng" "1y5xf794n832s3lymzlsdm2s9nlrd2v27jjjp0fd9xp7c2ah4461"}
|
|
|
|
${f "slv" "0rqng43435cly32idxm1lvxkcippvc3xpxbfizwq5j0155ym00dr"}
|
2011-04-24 21:01:19 +01:00
|
|
|
'';
|
|
|
|
in
|
|
|
|
|
2013-06-11 18:22:30 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "tesseract-${version}";
|
2011-04-24 19:04:07 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-06-11 18:22:30 +01:00
|
|
|
url = "http://tesseract-ocr.googlecode.com/files/tesseract-ocr-${version}.tar.gz";
|
|
|
|
sha256 = "0g81m9y4iydp7kgr56mlkvjdwpp3mb01q385yhdnyvra7z5kkk96";
|
2011-04-24 19:04:07 +01:00
|
|
|
};
|
|
|
|
|
2012-06-11 11:28:28 +01:00
|
|
|
buildInputs = [ autoconf automake libtool leptonica libpng libtiff ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
./autogen.sh
|
|
|
|
substituteInPlace "configure" \
|
|
|
|
--replace 'LIBLEPT_HEADERSDIR="/usr/local/include /usr/include"' \
|
|
|
|
'LIBLEPT_HEADERSDIR=${leptonica}/include'
|
|
|
|
'';
|
2011-04-24 19:04:07 +01:00
|
|
|
|
2011-04-24 21:01:19 +01:00
|
|
|
postInstall = extraLanguages;
|
|
|
|
|
2011-04-24 19:04:07 +01:00
|
|
|
meta = {
|
|
|
|
description = "OCR engine";
|
|
|
|
homepage = http://code.google.com/p/tesseract-ocr/;
|
|
|
|
license = "Apache2.0";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [viric];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
};
|
|
|
|
}
|