Open risicle opened 1 year ago
There already is a version check on the tesseract version passed as compile-time environment variables that yields different cpp code based on some cython macro checks, you should be able to apply the same concept for leptonica version-specific changes.
Leptonica 1.83 moved a number of
struct
definitions into "private" headers, notablyPix
andBox
et al.This results in a build failure:
which requires the inclusion of the header
leptonica/pix_internal.h
to overcome. This can be done with a supplementalcdef extern from
statement as detailed in https://cython.readthedocs.io/en/latest/src/userguide/external_C_code.html#referencing-c-header-files @tesseract.pxd
I haven't made this a PR with the suggested change because it will presumably need to be conditionally done based on the result of a version test, but the above fix does seem to work.