Improve CCUtil::main_setup (fixes issue #4230)#4239
Improve CCUtil::main_setup (fixes issue #4230)#4239stweil merged 2 commits intotesseract-ocr:mainfrom
Conversation
Conda installations patch TESSDATA_PREFIX in the binary. That does not work for std::string because the length won't be patched, so use a normal C string which can be patched. Simplify also the code which checks the last character of datadir. Signed-off-by: Stefan Weil <sw@weilnetz.de>
What ??? https://docs.conda.io/projects/conda-build/en/stable/resources/make-relocatable.html That's crazy! |
|
Do we really want to bend our code just because some distro is doing crazy things? |
|
They really patch all binaries which contain a lengthy magic string (which they configure as prefix). In most cases that allows an installation to a different prefix. |
|
Example: lib/pkgconfig/tesseract.pc is generated with this first line: The installed file has this first line: |
I think we would not bend our code in most cases, but in this case our workaround only requires a single code line with an explaining comment. That is less work for us than handling future issue reports if we don't adapt the Tesseract code. |
|
In general don't follow it. |
Conda installations patch TESSDATA_PREFIX in the binary. That does not work for std::string because the length won't be patched, so use a normal C string which can be patched.
Simplify also the code which checks the last character of datadir.