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

libcurl: add version 8.10.0 #25221

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions recipes/libcurl/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
sources:
"8.10.0":
url:
- "https://curl.se/download/curl-8.10.0.tar.xz"
- "https://github.com/curl/curl/releases/download/curl-8_10_0/curl-8.10.0.tar.xz"
sha256: "e6b142f0e85e954759d37e26a3627e2278137595be80e3a860c4353e4335e5a0"
"8.9.1":
url:
- "https://curl.se/download/curl-8.9.1.tar.xz"
Expand Down
44 changes: 32 additions & 12 deletions recipes/libcurl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,33 +339,53 @@ def _patch_cmake(self):
# Use upstream FindZstd.cmake because check_symbol_exists() is called
# afterwards and it would fail with zstd_LIBRARIES generated by CMakeDeps
replace_in_file(self, cmakelists, "find_package(Zstd REQUIRED)", "find_package(Zstd REQUIRED MODULE)")
replace_in_file(self, os.path.join(self.source_folder, "CMake", "FindZstd.cmake"), "if(UNIX)", "if(0)")
if Version(self.version) < "8.10.0":
replace_in_file(self, os.path.join(self.source_folder, "CMake", "FindZstd.cmake"), "if(UNIX)", "if(0)")

# c-ares
replace_in_file(self, cmakelists, "find_package(CARES REQUIRED)", "find_package(c-ares REQUIRED CONFIG)")
replace_in_file(self, cmakelists, "${CARES_LIBRARY}", "c-ares::cares")
if Version(self.version) < "8.10.0":
replace_in_file(self, cmakelists, "find_package(CARES REQUIRED)", "find_package(c-ares REQUIRED CONFIG)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ErniGH, @AbrilRBS
did we consider doing the overrides in the generate() method to avoid this patching?
https://docs.conan.io/2/reference/tools/cmake/cmakedeps.html#overwrite-properties-from-the-consumer-side-using-cmakedeps-set-property

note that we may be able to also set CARES_LIBRARY via tc.cache_variables instead of patching the anything

I suspect the same could be done for a lot of the other dependencies

Alternative consider following the pattern of injecting a cmake file during project() so that we locate and define the relevant variables ahead of time? we could clean this up by A LOT :D

not critical...

replace_in_file(self, cmakelists, "${CARES_LIBRARY}", "c-ares::cares")
else:
replace_in_file(self, cmakelists, "find_package(Cares REQUIRED)", "find_package(c-ares REQUIRED CONFIG)")
replace_in_file(self, cmakelists, "${CARES_LIBRARIES}", "c-ares::cares")

# libpsl
replace_in_file(self, cmakelists, "find_package(LibPSL)", "find_package(libpsl REQUIRED CONFIG)")
if Version(self.version) < "8.10.0":
replace_in_file(self, cmakelists, "find_package(LibPSL)", "find_package(libpsl REQUIRED CONFIG)")
replace_in_file(self, cmakelists, "${LIBPSL_LIBRARY}", "libpsl::libpsl")
replace_in_file(self, cmakelists, "${LIBPSL_INCLUDE_DIR}", "${libpsl_INCLUDE_DIRS}")
else:
replace_in_file(self, cmakelists, "${LIBPSL_LIBRARIES}", "libpsl::libpsl")
replace_in_file(self, cmakelists, "${LIBPSL_INCLUDE_DIRS}", "${libpsl_INCLUDE_DIRS}")
replace_in_file(self, cmakelists, "if(LIBPSL_FOUND)", "if(libpsl_FOUND)")
replace_in_file(self, cmakelists, "${LIBPSL_LIBRARY}", "libpsl::libpsl")
replace_in_file(self, cmakelists, "${LIBPSL_INCLUDE_DIR}", "${libpsl_INCLUDE_DIRS}")

# libssh2
replace_in_file(self, cmakelists, "find_package(LibSSH2)", "find_package(Libssh2 REQUIRED CONFIG)")
if Version(self.version) < "8.10.0":
replace_in_file(self, cmakelists, "find_package(LibSSH2)", "find_package(Libssh2 REQUIRED CONFIG)")
replace_in_file(self, cmakelists, "${LIBSSH2_LIBRARY}", "Libssh2::libssh2")
replace_in_file(self, cmakelists, "${LIBSSH2_INCLUDE_DIR}", "${Libssh2_INCLUDE_DIRS}")
else:
replace_in_file(self, cmakelists, "${LIBSSH2_LIBRARIES}", "Libssh2::libssh2")
replace_in_file(self, cmakelists, "${LIBSSH2_INCLUDE_DIRS}", "${Libssh2_INCLUDE_DIRS}")
replace_in_file(self, cmakelists, "if(LIBSSH2_FOUND)", "if(Libssh2_FOUND)")
replace_in_file(self, cmakelists, "${LIBSSH2_LIBRARY}", "Libssh2::libssh2")
replace_in_file(self, cmakelists, "${LIBSSH2_INCLUDE_DIR}", "${Libssh2_INCLUDE_DIRS}")

# libnghttp2
replace_in_file(self, cmakelists, "find_package(NGHTTP2 REQUIRED)", "find_package(libnghttp2 REQUIRED CONFIG)")
if Version(self.version) < "8.10.0":
replace_in_file(self, cmakelists, "find_package(NGHTTP2 REQUIRED)", "find_package(libnghttp2 REQUIRED CONFIG)")
else:
replace_in_file(self, cmakelists, "find_package(NGHTTP2)", "find_package(libnghttp2 REQUIRED CONFIG)")
replace_in_file(self, cmakelists, "${NGHTTP2_INCLUDE_DIRS}", "${libnghttp2_INCLUDE_DIRS}")
replace_in_file(self, cmakelists, "${NGHTTP2_LIBRARIES}", "libnghttp2::nghttp2")

# wolfssl
replace_in_file(self, cmakelists, "find_package(WolfSSL REQUIRED)", "find_package(wolfssl REQUIRED CONFIG)")
replace_in_file(self, cmakelists, "${WolfSSL_LIBRARIES}", "${wolfssl_LIBRARIES}")
replace_in_file(self, cmakelists, "${WolfSSL_INCLUDE_DIRS}", "${wolfssl_INCLUDE_DIRS}")
if Version(self.version) < "8.10.0":
replace_in_file(self, cmakelists, "${WolfSSL_LIBRARIES}", "${wolfssl_LIBRARIES}")
replace_in_file(self, cmakelists, "${WolfSSL_INCLUDE_DIRS}", "${wolfssl_INCLUDE_DIRS}")
else:
replace_in_file(self, cmakelists, "${WOLFSSL_LIBRARIES}", "${wolfssl_LIBRARIES}")
replace_in_file(self, cmakelists, "${WOLFSSL_INCLUDE_DIRS}", "${wolfssl_INCLUDE_DIRS}")

# INTERFACE_LIBRARY (generated by the cmake_find_package generator) targets doesn't have the LOCATION property.
# So skipp the LOCATION check in the CMakeLists.txt
Expand Down
2 changes: 2 additions & 0 deletions recipes/libcurl/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"8.10.0":
folder: all
"8.9.1":
folder: all
"8.8.0":
Expand Down
Loading