I tried to install opencv on Mac using Homebrew and edited the opencv.rb file using brew edit
opencv to change -DBUILD_opencv_text=OFF to -DBUILD_opencv_text=ON. However, it seems that the
installation process used the opencv.rb file configured in git instead of the edited one.
As a result, I cannot find the "/usr/local/Cellar/opencv/4.7.0_3/share/java" folder after the
installation completed.
Below are the results of the brew info and brew doctor commands: MacBookPro ~ % brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run the brew link
on these:
opencv
Warning: You have uncommitted modifications to Homebrew/homebrew-core. If this is a surprise to you, then you should stash these modifications. Stashing returns Homebrew to a pristine state but can be undone should you later need to do so for some reason. cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash -u && git clean -d -f
Uncommitted files: M Formula/opencv.rb
Warning: Homebrew's "sbin" was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin. Consider setting your PATH for example like so: echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
Warning: Your Xcode (14.2) is outdated. Please update to Xcode 14.3 (or delete it). Xcode can be updated from the App Store.
What can I do to solve this problem?
Basically, every time you edit the formula with brew edit formula
and then reinstall from source, it downloads again a new formula so it won't take in considerations your edit of -DBUILD_opencv_text=ON
.
So, what you can do is install opencv with homebrew with by providing a local formula.