21

Is it possible to give options to a Homebrew installation package from the command line, something like this (which does not seem to work):

brew install tesseract --all-languages

Or do you have to use brew edit tesseract and actually edit your desired options into the file that opens?

(If the latter is the only way, why did they choose to do it like this? It seems very cumbersome.)

EDIT: I did uninstall, then install again with the option added, and now it seems to react. 1. Homebrew should have been able to understand the change without uninstalling first. 2. I can't see the option thing documented or mentioned anywhere.

1
  • If you don't want to end up with 1.2 Gb of languages for the sake of having one, you can manually download one language from the wiki and then mv <lang>.traineddata /usr/local/Cellar/tesseract/<version>/share/tessdata Aug 8, 2018 at 9:31

5 Answers 5

20

As of 2 February 2019, Homebrew no longer supports options link.

So you would need to edit the install file.

brew edit tesseract

(Hopefully someone finds an easier way to accomplish this behavior. But, for now, it seems like is gone for the time being.)

2
16

brew info lists options:

$ brew info tesseract
tesseract: stable 3.02.02, HEAD
http://code.google.com/p/tesseract-ocr/
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/tesseract.rb
==> Dependencies
Required: libtiff, leptonica
==> Options
--all-languages
    Install recognition data for all languages
--HEAD
    install HEAD version

Like the edit to the question says, if you have already installed a package and want to install the package with different options, you have to uninstall it first.

1
6

brew options <program_package> will list all the available options to flag with the install & yes, as far as I know if you want to install with any options posthumously then you'll first need to uninstall. If you don't remember the installation "formula" you used, then, use brew info <program_package> prior to uninstalling. info will also inform you of any dependencies, but brew uninstall <program_package> will tell you the specific command to force the removal of dependencies if there are any. Lastly, prior to re-installing with brew install <program_package> <--options> it's a good idea to run brew update twice and brew doctor twice... brew prune, brew cleanup & brew missing are also not a terrible idea to run before or after install/re-installs.

5

yes, you have to uninstall, then:

brew edit tesseract to change your config options and args in the tesseract.rb file which may be located here:

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/

the other responders don't really answer your question …

2
  • to anyone who just came here.. this post really contains the actual answer! :)
    – ufk
    Jun 7, 2018 at 7:54
  • Can you please tell me what to write into the formula to get the option working? Jan 9, 2022 at 19:36
0

Install all languages:
brew install tesseract-lang
Note: the package has 651.8 MB

Install a specific language(s):
1. Download the language e.g. "deu.traineddata" from "https://github.com/tesseract-ocr/tessdata_fast"
2. Copy "deu.traineddata" into "/usr/local/Cellar/tesseract/4.0.0_1/share/tessdata"
Note: brew edit tesseract didn't work for me!

Test:
Now tesseract --list-langs should show the new language.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .