conda-forge / tesseract-feedstock

A conda-smithy repository for tesseract.
BSD 3-Clause "New" or "Revised" License
5 stars 17 forks source link

Add libcurl to required packages (partially fixes issue #63) #66

Open stweil opened 2 months ago

stweil commented 2 months ago

Checklist

conda-forge-webservices[bot] commented 2 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

stweil commented 2 months ago

tesseract with curl can directly process images in the web (by using their URL) without the need of a local copy.

carlodri commented 2 months ago

My two cents:

stweil commented 2 months ago
scw commented 2 months ago

I think building with --with-archive --with-curl is best for consistency with the Windows builds and makes explicit the dependencies that will be picked up from the host section.

stweil commented 2 months ago

I think building with --with-archive --with-curl is best for consistency with the Windows builds [...]

This would work for Windows and Linux, but currently fail for macOS where libarchive is not found.

scw commented 2 months ago

This would work for Windows and Linux, but currently fail for macOS where libarchive is not found.

OK, I did some digging on this. This is because libarchive on MacOS depends on libiconv, which the package correctly resolves as a dependency, but currently libiconv does not expose pkg-config information. This is logged as https://github.com/conda-forge/libiconv-feedstock/issues/36. Manually running the command ./configure calls of pkg-config --exists --print-errors "libarchive" shows:

./pkg-config --exists --print-errors "libarchive"
Package iconv was not found in the pkg-config search path.
Perhaps you should add the directory containing `iconv.pc'
to the PKG_CONFIG_PATH environment variable
Package 'iconv', required by 'libarchive', not found

I think the better fix is to address libiconv, but I did confirm that locally changing the command to:

libarchive_CFLAGS="-I${CONDA_PREFIX}/include" libarchive_LIBS="-I${CONDA_PREFIX}/lib" ./configure --with-archive --with-curl

Was able to address the issue as a workaround if you'd like to take that tack until libiconv is addressed:

checking for pkg-config... /usr/local/miniconda/envs/tesseract-build/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libcurl... yes
checking for lept >= 1.74... yes
checking for libarchive... yes
checking for icu-uc >= 52.1... yes
checking for icu-i18n >= 52.1... yes
stweil commented 2 months ago

Thanks. I added your suggestions in a 2nd commit. Now the macOS builds use libarchive, too.

scw commented 2 months ago

@stweil could you try again with $PREFIX instead of $CONDA_PREFIX? I had run that locally on an environment rather than via conda-build.

stweil commented 2 months ago

@stweil could you try again with $PREFIX instead of $CONDA_PREFIX? I had run that locally on an environment rather than via conda-build.

Now all builds fail with a linker error because of a missing symbol from libarchive.