>
> Hi
>

For me none of above worked for Tesseract v 4.0. So I took an unorthodox 
approach as follows:

- Got a MAC Virtual machine up and running
- Install Homebrew
- Install Tesseract using Homebrew (4.0)
- Copied the whole Cellar folder (as it contains all dependencies for 
tesseract)

Then comes the fun part.

- All libs in the various folders refer to each other via a path convention 
as "/usr/loca/Cellar/leptonica/lib/lebt5.dylib"
- The output libtesseract.4.dylib refers to leptonica and leptonica refers 
to jpg, tiff etc libs
- So we have to update all libs so that the paths being referred from 
"usr/local/Cellar/leptonica..." should change to "../../../leptonica" for 
all libs
- We can use otool -L <dylib path> to get that (otoll is part of XCode 
command line tools)
- Then we can use install_name_tool -change to change references to dylibs
- It was a hard process but I did that one by one and here are the command 
(provided you are in the pwd of CopyOfCellar/tesseract/bin )

install_name_tool -change /usr/local/opt/leptonica/lib/liblept.5.dylib 
../../../leptonica/1.78.0/lib/liblept.5.dylib  tesseract 

install_name_tool -change /usr/local/opt/leptonica/lib/liblept.5.dylib 
../../../leptonica/1.78.0/lib/liblept.5.dylib  
/LocalPathofCopyOfCellar/tesseract/4.0.0_1/lib/libtesseract.4.dylib

install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib 
../../../libpng/1.6.36/lib/libpng16.16.dylib 
/LocalPathofCopyOfCellar/leptonica/1.78.0/lib/liblept.5.dylib

install_name_tool -change /usr/local/opt/jpeg/lib/libjpeg.9.dylib 
../../../jpeg/9c/lib/libjpeg.9.dylib 
/LocalPathofCopyOfCellar/leptonica/1.78.0/lib/liblept.5.dylib

install_name_tool -change /usr/local/opt/giflib/lib/libgif.7.dylib 
../../../giflib/5.1.4_1/lib/libgif.7.dylib 
/LocalPathofCopyOfCellar/leptonica/1.78.0/lib/liblept.5.dylib

install_name_tool -change /usr/local/opt/libtiff/lib/libtiff.5.dylib 
../../../libtiff/4.0.10_1/lib/libtiff.5.dylib 
/LocalPathofCopyOfCellar/leptonica/1.78.0/lib/liblept.5.dylib

install_name_tool -change /usr/local/opt/webp/lib/libwebp.7.dylib 
../../../webp/1.0.2/lib/libwebp.7.dylib 
/LocalPathofCopyOfCellar/leptonica/1.78.0/lib/liblept.5.dylib

install_name_tool -change /usr/local/opt/openjpeg/lib/libopenjp2.7.dylib 
../../../openjpeg/2.3.0/lib/libopenjp2.2.3.0.dylib 
/LocalPathofCopyOfCellar/leptonica/1.78.0/lib/liblept.5.dylib

install_name_tool -change /usr/local/opt/jpeg/lib/libjpeg.9.dylib 
../../../jpeg/9c/lib/libjpeg.9.dylib 
/LocalPathofCopyOfCellar/libtiff/4.0.10_1/lib/libtiff.5.dylib

Once all above is done the tesseract becomes standalone provide you keep 
all the libs and includes in the folder structure as in original Cellar.

export TESSDATA_PREFIX=../share/tessdata

Now if some body can make all that into a bash script that will be great.

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tesseract-ocr+unsubscr...@googlegroups.com.
To post to this group, send email to tesseract-ocr@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/18fdea77-2337-4862-b60e-8adf164626a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to