letterassist-ai / flusseract

Flutter plugin for Tesseract OCR library.
MIT License
2 stars 1 forks source link

Some ambiguity around SRCROOT when building for macOS #5

Open 6bangs opened 1 month ago

6bangs commented 1 month ago

May be related to #4

I think the build is supposed to work by copying include and library files to macos/Pods/flusseract/include and macos/Pods/flusseract/lib, respectively. However, SRCROOT is macos/Pods. So code like this doesn't work as expected:

    :output_files => [
      '${SRCROOT}/Pods/flusseract/libzstd.a',
      '${SRCROOT}/Pods/flusseract/libjpeg.a',
      '${SRCROOT}/Pods/flusseract/libpng.a',
      '${SRCROOT}/Pods/flusseract/libtiff.a',
      '${SRCROOT}/Pods/flusseract/libleptonica.a',
      '${SRCROOT}/Pods/flusseract/libtesseract.a'
    ],

The directory resolves to macos/Pods/Pods/flusseract, and the files don't actually get output. Interestingly, I do end up with an empty macos/Pods/Pods/flusseract directory.

This also shows up here:

'LIBRARY_SEARCH_PATHS' => '$(inherited) ${SRCROOT}/flusseract/lib ${SRCROOT}/Pods/flusseract/lib'

I've gotten it to work temporarily by adding /opt/homebrew/include and /opt/homebrew/lib to my SYSTEM_HEADER_SEARCH_PATHS and LIBRARY_SEARCH_PATHS, but this should be unnecessary.