From df43c18b2002f45a6f667bea79911e9c8e56b755 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 31 Dec 2024 17:15:25 +0200 Subject: [PATCH] confu_json: add v1.1.1 (#25374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * confu_json: add v1.1.0 * confu_json: drop all existing versions * confu_json: use boost/1.85.0 * Update recipes/confu_json/all/conanfile.py * confu_json 1.1.1 * remove unused import --------- Co-authored-by: Abril Rincón Blanco Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> --- recipes/confu_json/all/conandata.yml | 15 +---- recipes/confu_json/all/conanfile.py | 61 +++---------------- .../all/test_package/CMakeLists.txt | 8 +-- .../all/test_v1_package/CMakeLists.txt | 8 --- .../all/test_v1_package/conanfile.py | 17 ------ recipes/confu_json/config.yml | 8 +-- 6 files changed, 16 insertions(+), 101 deletions(-) delete mode 100644 recipes/confu_json/all/test_v1_package/CMakeLists.txt delete mode 100644 recipes/confu_json/all/test_v1_package/conanfile.py diff --git a/recipes/confu_json/all/conandata.yml b/recipes/confu_json/all/conandata.yml index 5d78ae9d25a41..96bebd1cc3eab 100644 --- a/recipes/confu_json/all/conandata.yml +++ b/recipes/confu_json/all/conandata.yml @@ -1,13 +1,4 @@ sources: - "1.0.0": - url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.0.0.tar.gz" - sha256: "f165172220b440d37a7a8301e490cf791b3b25b0cc3f2a08b355609c5f777db0" - "0.0.10": - url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.10.tar.gz" - sha256: "b31aab1bce952c0dc0bfc1f955a7b88be5103350b5a5eee1a4586ccec0e51fc1" - "0.0.9": - url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.9.tar.gz" - sha256: "29b2940b939cb04f11fdab4964c86bcb23ac75c588550bf54048e024444d2718" - "0.0.5": - url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.5.tar.gz" - sha256: "bc506d4b7836a7689b1c6a2d89bb0c3441f774c8f845fef79d85c71099df5bf9" + "1.1.1": + url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.1.1.tar.gz" + sha256: "6b302c7c4b926db8ff0de65254eb0422eab04385a389715b88297bebf5378c35" diff --git a/recipes/confu_json/all/conanfile.py b/recipes/confu_json/all/conanfile.py index 3137417ca016a..496405f1bc15d 100644 --- a/recipes/confu_json/all/conanfile.py +++ b/recipes/confu_json/all/conanfile.py @@ -3,85 +3,44 @@ 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.microsoft import is_msvc -from conan.tools.scm import Version import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=2.0" class ConfuJson(ConanFile): name = "confu_json" homepage = "https://github.com/werto87/confu_json" - description = "uses boost::fusion to help with serialization; json <-> user defined type" - topics = ("json parse", "serialization", "user defined type") + description = "Uses boost::fusion to help with serialization; json <-> user defined type" + topics = ("json", "serialization", "user-defined-type", "header-only") license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True - @property - def _min_cppstd(self): - return "20" if Version(self.version) < "1.0.0" else "17" - - @property - def _compilers_minimum_version(self): - return { - "17": { - "Visual Studio": "17", - "msvc": "193", - "gcc": "7", - "clang": "7", - }, - "20": { - "Visual Studio": "17", - "msvc": "193", - "gcc": "10", - "clang": "10", - }, - }.get(self._min_cppstd, {}) def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") - self.requires("magic_enum/0.8.2") + self.requires("boost/1.85.0") + self.requires("magic_enum/0.9.6") def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler == "apple-clang": - raise ConanInvalidConfiguration("apple-clang is not supported. Pull request welcome") - - if self.settings.compiler == "gcc" and Version(self.version) < "1.0.0": - raise ConanInvalidConfiguration("gcc is only supported in versions greater than or equal 1.0.0.") - - if is_msvc(self) and Version(self.version) < "0.0.9": - raise ConanInvalidConfiguration("Visual Studio is not supported in versions before confu_json/0.0.9") - - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) - - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version and Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." - ) + check_min_cppstd(self, 20) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - pass - def package(self): - copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "*.h*", src=os.path.join(self.source_folder, "confu_json"), - dst=os.path.join(self.package_folder, "include", "confu_json")) + copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.h*", os.path.join(self.source_folder, "confu_json"), + os.path.join(self.package_folder, "include", "confu_json")) def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + self.cpp_info.requires = ["boost::headers", "magic_enum::magic_enum"] diff --git a/recipes/confu_json/all/test_package/CMakeLists.txt b/recipes/confu_json/all/test_package/CMakeLists.txt index cbb13e9d5f0af..eb6d533e601eb 100644 --- a/recipes/confu_json/all/test_package/CMakeLists.txt +++ b/recipes/confu_json/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(confu_json REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE confu_json::confu_json) -if(confu_json_VERSION VERSION_LESS "1.0.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) -else() - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/confu_json/all/test_v1_package/CMakeLists.txt b/recipes/confu_json/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/confu_json/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/confu_json/all/test_v1_package/conanfile.py b/recipes/confu_json/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/confu_json/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/confu_json/config.yml b/recipes/confu_json/config.yml index 337baede02ad0..60d31991f5141 100644 --- a/recipes/confu_json/config.yml +++ b/recipes/confu_json/config.yml @@ -1,9 +1,3 @@ versions: - "1.0.0": - folder: all - "0.0.10": - folder: all - "0.0.9": - folder: all - "0.0.5": + "1.1.1": folder: all