Skip to content

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

Open
stweil wants to merge 2 commits into
conda-forge:mainfrom
stweil:add_curl
Open

Add libcurl to required packages (partially fixes issue #63)#66
stweil wants to merge 2 commits into
conda-forge:mainfrom
stweil:add_curl

Conversation

@stweil

@stweil stweil commented Jun 12, 2024

Copy link
Copy Markdown

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-webservices

Copy link
Copy Markdown

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

stweil commented Jun 12, 2024

Copy link
Copy Markdown
Author

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

@carlodri

Copy link
Copy Markdown
Contributor

My two cents:

  • I think that this will not work unless the appropriate configure options are used
  • could we test libcurl in the tests with some command using a URL?

@stweil

stweil commented Jun 13, 2024

Copy link
Copy Markdown
Author
  • configure checks for available libraries (using pkg-config) and uses available ones by default, so typically no configure options are required
  • configure --with-archive --with-curl will fail if the required libraries are not available
  • run tesseract 'https://github.com/tesseract-ocr/test/blob/main/testing/HelloGoogle.tif?raw=true' - and expect the result Hello Google

@scw

scw commented Jun 13, 2024

Copy link
Copy Markdown

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

stweil commented Jun 13, 2024

Copy link
Copy Markdown
Author

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

scw commented Jun 13, 2024

Copy link
Copy Markdown

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 conda-forge/libiconv-feedstock#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 stweil force-pushed the add_curl branch 2 times, most recently from 5fcdedb to a8a00c0 Compare June 14, 2024 06:08
@stweil

stweil commented Jun 14, 2024

Copy link
Copy Markdown
Author

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

@scw

scw commented Jun 14, 2024

Copy link
Copy Markdown

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

…n review)

This adds libarchive for macOS, too.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil

stweil commented Jun 14, 2024

Copy link
Copy Markdown
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants