From 796ed405580346a0bea8288f8c24a7b5d2170ed5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 4 Feb 2023 06:10:40 +0100 Subject: [PATCH] (#15666) mongo-cxx-driver: fix source code url of 3.6.7 + modernize more * modernize more * fix url of 3.6.7 --- recipes/mongo-cxx-driver/all/conandata.yml | 4 +-- recipes/mongo-cxx-driver/all/conanfile.py | 25 ++++++++----------- .../all/test_package/conanfile.py | 7 +++--- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/recipes/mongo-cxx-driver/all/conandata.yml b/recipes/mongo-cxx-driver/all/conandata.yml index 980b0b45c7e8e..63919e45005aa 100644 --- a/recipes/mongo-cxx-driver/all/conandata.yml +++ b/recipes/mongo-cxx-driver/all/conandata.yml @@ -3,8 +3,8 @@ sources: url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.0/mongo-cxx-driver-r3.7.0.tar.gz" sha256: "fb2da11178db728f63147fe4b0c7509eb49b1b02c5cb55f9bee5f927e451a0c7" "3.6.7": - url: "https://github.com/mongodb/mongo-cxx-driver/archive/debian/3.6.7-1.tar.gz" - sha256: "62a0a16e4a35289e1692f60cf07a7f6957485446b7bc1d82306b731ad6763fb9" + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.7/mongo-cxx-driver-r3.6.7.tar.gz" + sha256: "2c58005d4fe46f1973352fba821f7bb37e818cefc922377ce979a9fd1bff38ac" "3.6.6": url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.6/mongo-cxx-driver-r3.6.6.tar.gz" sha256: "d5906b9e308a8a353a2ef92b699c9b27ae28ec6b34fdda94e15d2981b27e64ca" diff --git a/recipes/mongo-cxx-driver/all/conanfile.py b/recipes/mongo-cxx-driver/all/conanfile.py index e6cf5fad743e8..118ad3a647540 100644 --- a/recipes/mongo-cxx-driver/all/conanfile.py +++ b/recipes/mongo-cxx-driver/all/conanfile.py @@ -7,7 +7,7 @@ import os import shutil -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.54.0" class MongoCxxConan(ConanFile): @@ -43,6 +43,9 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): self.requires("mongo-c-driver/1.23.2") if self.options.polyfill == "boost": @@ -89,33 +92,29 @@ def _compilers_minimum_version(self): ) def validate(self): - if self.info.options.with_ssl and not bool(self.dependencies["mongo-c-driver"].options.with_ssl): + if self.options.with_ssl and not bool(self.dependencies["mongo-c-driver"].options.with_ssl): raise ConanInvalidConfiguration("mongo-cxx-driver with_ssl=True requires mongo-c-driver with a ssl implementation") - if self.info.options.polyfill == "mnmlstc": + if self.options.polyfill == "mnmlstc": # TODO: add mnmlstc polyfill support # Cannot model mnmlstc (not packaged, is pulled dynamically) polyfill dependencies raise ConanInvalidConfiguration("mnmlstc polyfill is not yet supported") - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimal_std_version) - compiler = str(self.info.settings.compiler) - if self.info.options.polyfill == "experimental" and compiler == "apple-clang": + compiler = str(self.settings.compiler) + if self.options.polyfill == "experimental" and compiler == "apple-clang": raise ConanInvalidConfiguration("experimental polyfill is not supported for apple-clang") - version = Version(self.info.settings.compiler.version) + version = Version(self.settings.compiler.version) if compiler in self._compilers_minimum_version and version < self._compilers_minimum_version[compiler]: raise ConanInvalidConfiguration( f"{self.name} {self.version} requires a compiler that supports at least C++{self._minimal_std_version}", ) - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -130,8 +129,6 @@ def generate(self): if not valid_min_cppstd(self, self._minimal_std_version): tc.variables["CMAKE_CXX_STANDARD"] = self._minimal_std_version tc.variables["ENABLE_TESTS"] = False - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) diff --git a/recipes/mongo-cxx-driver/all/test_package/conanfile.py b/recipes/mongo-cxx-driver/all/test_package/conanfile.py index a650aa79a9355..00f1cae8925b9 100644 --- a/recipes/mongo-cxx-driver/all/test_package/conanfile.py +++ b/recipes/mongo-cxx-driver/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def generate(self): tc = CMakeToolchain(self) tc.variables["MONGO-CXX-DRIVER_POLYFILL"] = self.dependencies["mongo-cxx-driver"].options.polyfill