-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Improve CCUtil::main_setup (fixes issue #4230) #4239
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 <[email protected]>
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.