From 1770b01f3e0bdfecd73d2983f111dca6103703af Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Fri, 7 Jun 2013 21:38:41 -0700 Subject: tesseract: use resources --- Library/Formula/tesseract.rb | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/tesseract.rb b/Library/Formula/tesseract.rb index dbcbd4e04..1c9cedfed 100644 --- a/Library/Formula/tesseract.rb +++ b/Library/Formula/tesseract.rb @@ -1,12 +1,5 @@ require 'formula' -# This stays around for the English-only build option -class TesseractEnglishData < Formula - url 'http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz' - version '3.02' - sha1 '989ed4c3a5b246d7353893e466c353099d8b73a1' -end - class Tesseract < Formula homepage 'http://code.google.com/p/tesseract-ocr/' url 'http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz' @@ -22,6 +15,21 @@ class Tesseract < Formula cause "Executable 'tesseract' segfaults on 10.6 when compiled with llvm-gcc" end + LANGS = { + 'eng' => '989ed4c3a5b246d7353893e466c353099d8b73a1', + 'heb' => '67e10e616caf62545eacd436e85f89436687e22b', + 'hin' => '4ceef97ffb8b4ab5ac79ee4bad5b5be0885f228f', + 'ara' => 'e15cf6b7a027454db56ecedab0038c7739ab29cc', + 'tha' => '04a35c04585a887662dc668e54f5368dabf31f50' + } + + LANGS.each do |name, sha| + resource name do + url "http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.#{name}.tar.gz" + sha1 sha + end + end + def install # explicitly state leptonica header location, as the makefile defaults to /usr/local/include, # which doesn't work for non-default homebrew location @@ -32,7 +40,7 @@ class Tesseract < Formula if build.include? "all-languages" install_language_data else - TesseractEnglishData.new.brew { mv Dir['tessdata/*'], "#{share}/tessdata/" } + resource('eng').stage { mv Dir['tessdata/*'], "#{share}/tessdata/" } end end -- cgit v1.2.3