Skip to content
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

libtiff >= 4.5.1: fix case sensitiity issue for discovery of jbig, lzma and zstd #26209

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Dec 16, 2024

Summary

Changes to recipe: libtiff >= 4.5.1

Motivation

lzma may not be enabled during CMake configuration due to case sensitivity issue (in the CMake config file name and NAME_FOUND variable) coming from the logic of the recipe since libtiff 4.5.1. jbig and zstd may suffer from the same issue.

Details

Since 4.5.1, this recipe renames target name of several dependencies (and config file name for few of them) instead of using a more intrusive patch. But it's partially broken, several dependencies are discovered upstream with a name in find_package() whose casing is slightly different from official one, so it has to be changed as well (well technically find_package() also try to find<lowercaseName>-config.cmake when nameConfig.cmake is not found, but I prefer to be conservative here, it's quite easy to make a mistake).
In the specific case of lzma, we have to be careful since upstream calls find_package(liblzma), therefore we set cmake_file_name of xz_utils to liblzma, but afterwards upstream relies on a LIBLZMA_FOUND variable expected to be set to TRUE by lzma config file, but CMakeDeps defines liblzma_FOUND (<cmake_file_name>_FOUND) in generated config file, therefore a patch is needed.

See:
https://gitlab.com/libtiff/libtiff/-/blob/v4.5.1/cmake/JBIGCodec.cmake#L30
https://gitlab.com/libtiff/libtiff/-/blob/v4.5.1/cmake/LZMACodec.cmake#L29-32
https://gitlab.com/libtiff/libtiff/-/blob/v4.5.1/cmake/ZSTDCodec.cmake#L31

closes #26197


check_symbol_exists() is broken with old CMakeDeps generator, so this patch is still required
@SpaceIm
Copy link
Contributor Author

SpaceIm commented Dec 16, 2024

Ok, I see that some patches of 4.5.0 related to checks of dependencies and still needed in 4.5.1+ have not been propagated in offended PR #17946 (see some issues of features discovery in https://c3i.jfrog.io/c3i/misc-v2/logs/pr/17946/6-linux-gcc/libtiff/4.5.1//c8e091d122e92e6b94a7b875fb0b03e5b7d485fc-build.txt, like -- Looking for jbg_newlen - not found )

@jcar87
Copy link
Contributor

jcar87 commented Dec 18, 2024

cmake_file_name of xz_utils to liblzma, but afterwards upstream relies on a LIBLZMA_FOUND variable expected to be set to TRUE by lzma config file, but CMakeDeps defines liblzma_FOUND (<cmake_file_name>_FOUND) in generated config file, therefore a patch is needed.

The file conan-official-xz_utils-variables.cmake which is set in the xz-utils recipe

- is already defining this variable, so regardless of the name of the generated files by Conan, it will be set - it's not necessarily bad to re-enforce it, but the issue on its own should be solved by deps.set_property("xz_utils", "cmake_file_name", "liblzma")

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.

[package] libtiff/4.7.0: liblzma isn't used on Linux
2 participants