diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index 6d1aa245d833b..c5eb35c8bdfe6 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.18.2": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.18.2.tar.gz" + sha256: "7dc9be587e7432b75a892832df33d6819460b5462ccd59fc462ba012fef5bf72" "0.18.1": url: "https://github.com/yhirose/cpp-httplib/archive/v0.18.1.tar.gz" sha256: "405abd8170f2a446fc8612ac635d0db5947c0d2e156e32603403a4496255ff00" diff --git a/recipes/cpp-httplib/all/conanfile.py b/recipes/cpp-httplib/all/conanfile.py index 4e28d01766a72..acf164da9f9fc 100644 --- a/recipes/cpp-httplib/all/conanfile.py +++ b/recipes/cpp-httplib/all/conanfile.py @@ -2,9 +2,10 @@ from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=2.1" class CpphttplibConan(ConanFile): @@ -20,17 +21,27 @@ class CpphttplibConan(ConanFile): "with_openssl": [True, False], "with_zlib": [True, False], "with_brotli": [True, False], + "use_macos_keychain_certs": [True, False], } default_options = { "with_openssl": False, "with_zlib": False, "with_brotli": False, + "use_macos_keychain_certs": True, } no_copy_source = True + def config_options(self): + if self.settings.os != "Macos": + del self.options.use_macos_keychain_certs + def requirements(self): if self.options.with_openssl: - self.requires("openssl/[>=1.1 <4]") + if Version(self.version) < "0.15": + self.requires("openssl/[>=1.1 <4]") + else: + # New version of httplib.h requires OpenSSL 3 + self.requires("openssl/[>=3 <4]") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") if self.options.with_brotli: @@ -40,8 +51,7 @@ def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def layout(self): basic_layout(self, src_folder="src") @@ -69,7 +79,6 @@ def package_info(self): self.cpp_info.system_libs = ["pthread"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["crypt32", "cryptui", "ws2_32"] - - # TODO: to remove in conan v2 once legacy generators removed - self.cpp_info.names["cmake_find_package"] = "httplib" - self.cpp_info.names["cmake_find_package_multi"] = "httplib" + elif self.settings.os == "Macos" and self.options.with_openssl and self.options.get_safe("use_macos_keychain_certs"): + self.cpp_info.frameworks = ["CoreFoundation", "Security"] + self.cpp_info.defines.append("CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN") diff --git a/recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt b/recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cpp-httplib/all/test_v1_package/conanfile.py b/recipes/cpp-httplib/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpp-httplib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index edcd017dbed1b..62a26096a9a50 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,4 +1,6 @@ versions: + "0.18.2": + folder: all "0.18.1": folder: all "0.18.0":