Updated tesseract to version 3.00

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
master
Kerry Wright 2011-04-01 22:24:01 -07:00 committed by Adam Vandenberg
parent b21412b84c
commit c927c04a1e
1 changed files with 17 additions and 10 deletions

View File

@ -1,27 +1,34 @@
require 'formula'
require 'download_strategy'
# Normal strategy tries to untar as well
class GzipOnlyDownloadStrategy < CurlDownloadStrategy
def stage
FileUtils.mv @tarball_path, File.basename(@url)
safe_system '/usr/bin/gunzip', '-f', File.basename(@url)
end
end
class TesseractEnglishData < Formula
url 'http://tesseract-ocr.googlecode.com/files/tesseract-2.00.eng.tar.gz'
md5 'b8291d6b3a63ce7879d688e845e341a9'
version '2.00'
url 'http://tesseract-ocr.googlecode.com/files/eng.traineddata.gz',
:using => GzipOnlyDownloadStrategy
md5 'd91041ad156cf2db36664e91ef799451'
version '3.00'
end
class Tesseract < Formula
url 'http://tesseract-ocr.googlecode.com/files/tesseract-2.04.tar.gz'
url 'http://tesseract-ocr.googlecode.com/files/tesseract-3.00.tar.gz'
homepage 'http://code.google.com/p/tesseract-ocr/'
md5 'b44eba1a9f4892ac62e484c807fe0533'
md5 'cc812a261088ea0c3d2da735be35d09f'
depends_on 'libtiff'
fails_with_llvm "Executable 'tesseract' segfaults on 10.6 when compiled with llvm-gcc", :build => "2206"
def install
# 'make install' expects the language data files in the build directory
d = Dir.getwd
TesseractEnglishData.new.brew { cp Dir["*"], "#{d}/tessdata/" }
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
system "make install"
TesseractEnglishData.new.brew { mv "eng.traineddata", "#{share}/tessdata/" }
end
def caveats; <<-EOF.undent