Skip to content

Commit

Permalink
tesseract: remove options.
Browse files Browse the repository at this point in the history
See #31510.

Closes #36293.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
  • Loading branch information
MikeMcQuaid authored and fxcoudert committed Jan 22, 2019
1 parent 0cc0510 commit 012aea3
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions Formula/tesseract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ class Tesseract < Formula
sha256 "ca1d2d2c38cc2f3054bf3b9692977b217dc060dcfe77af5f84f767d0dbac5150" => :sierra
end

option "with-all-languages", "Install recognition data for all languages"
option "with-training-tools", "Install OCR training tools"
option "with-serial-num-pack", "Install serial number recognition pack"

deprecated_option "all-languages" => "with-all-languages"

depends_on "autoconf" => :build
depends_on "autoconf-archive" => :build
depends_on "automake" => :build
Expand All @@ -27,15 +21,6 @@ class Tesseract < Formula
depends_on "leptonica"
depends_on "libtiff"

if build.with? "training-tools"
depends_on "libtool" => :build
depends_on "icu4c"
depends_on "glib"
depends_on "cairo"
depends_on "pango"
depends_on :x11
end

resource "tessdata" do
url "https://github.com/tesseract-ocr/tessdata_fast/archive/4.0.0.tar.gz"
sha256 "f1b71e97f27bafffb6a730ee66fd9dc021afc38f318fdc80a464a84a519227fe"
Expand All @@ -59,12 +44,6 @@ class Tesseract < Formula
needs :cxx11

def install
if build.with? "training-tools"
icu4c = Formula["icu4c"]
ENV.append "CFLAGS", "-I#{icu4c.opt_include}"
ENV.append "LDFLAGS", "-L#{icu4c.opt_lib}"
end

# explicitly state leptonica header location, as the makefile defaults to /usr/local/include,
# which doesn't work for non-default homebrew location
ENV["LIBLEPT_HEADERSDIR"] = HOMEBREW_PREFIX/"include"
Expand All @@ -75,19 +54,9 @@ def install
system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking"

system "make", "install"
if build.with? "serial-num-pack"
resource("snum").stage { mv "snum.traineddata", share/"tessdata" }
end
if build.with? "training-tools"
system "make", "training"
system "make", "training-install"
end
if build.with? "all-languages"
resource("tessdata").stage { mv Dir["*"], share/"tessdata" }
else
resource("eng").stage { mv "eng.traineddata", share/"tessdata" }
resource("osd").stage { mv "osd.traineddata", share/"tessdata" }
end

resource("snum").stage { mv "snum.traineddata", share/"tessdata" }
resource("tessdata").stage { mv Dir["*"], share/"tessdata" }
end

test do
Expand Down

0 comments on commit 012aea3

Please sign in to comment.