Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tesseract: remove options. #36293

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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