From c270fe7e418ce0fc517df74619c256450133def8 Mon Sep 17 00:00:00 2001 From: Morwenn Date: Tue, 23 Jan 2024 23:10:33 +0100 Subject: [PATCH 1/6] Bump timsort to 3.0.0 --- recipes/timsort/all/conandata.yml | 3 +++ recipes/timsort/all/conanfile.py | 4 +++- recipes/timsort/config.yml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/timsort/all/conandata.yml b/recipes/timsort/all/conandata.yml index 494ae5cf97b30..0a421d85bab63 100644 --- a/recipes/timsort/all/conandata.yml +++ b/recipes/timsort/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.0": + url: "https://github.com/timsort/cpp-TimSort/archive/v3.0.0.tar.gz" + sha256: "d61b92850996305e5248d1621c8ac437c31b474f74907e223019739e2e556b1f" "2.1.0": url: "https://github.com/timsort/cpp-TimSort/archive/v2.1.0.tar.gz" sha256: "b16606f85316d9a3cfde638c02dd9ce23324b0a904bb020e4ad2497cb8cf9ebd" diff --git a/recipes/timsort/all/conanfile.py b/recipes/timsort/all/conanfile.py index 9df11dc1a164c..4a891d5c3149e 100644 --- a/recipes/timsort/all/conanfile.py +++ b/recipes/timsort/all/conanfile.py @@ -27,7 +27,9 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - if Version(self.version) >= "2.0.0": + if Version(self.version) >= "3.0.0": + check_min_cppstd(self, 20) + elif Version(self.version) >= "2.0.0": check_min_cppstd(self, 11) def source(self): diff --git a/recipes/timsort/config.yml b/recipes/timsort/config.yml index 798460e5d36d8..81269db497bd6 100644 --- a/recipes/timsort/config.yml +++ b/recipes/timsort/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.0": + folder: all "2.1.0": folder: all "2.0.2": From 6e794f0678fbf8ff6bfbf43b11666dc85186fd1f Mon Sep 17 00:00:00 2001 From: Morwenn Date: Thu, 25 Jan 2024 21:36:32 +0100 Subject: [PATCH 2/6] Try to fix timsort in CI (thanks @toge) --- recipes/timsort/all/conanfile.py | 35 +++++++++++++++---- .../timsort/all/test_package/CMakeLists.txt | 9 ++++- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/recipes/timsort/all/conanfile.py b/recipes/timsort/all/conanfile.py index 4a891d5c3149e..586e24d45b315 100644 --- a/recipes/timsort/all/conanfile.py +++ b/recipes/timsort/all/conanfile.py @@ -11,14 +11,34 @@ class TimsortConan(ConanFile): name = "timsort" description = "A C++ implementation of timsort" - topics = ("sorting", "algorithms") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/timsort/cpp-TimSort" - license = "MIT" + topics = ("sorting", "algorithms", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + if Version(self.version) < "2.0.0": + return "98" + if Version(self.version) < "3.0.0": + return "11" + return "20" + + @property + def _compilers_minimum_version(self): + return { + "20": { + "gcc": "11", + "clang": "12", + "apple-clang": "13", + "Visual Studio": "16", + "msvc": "192", + } + }.get(self._min_cppstd, {}) + def layout(self): basic_layout(self, src_folder="src") @@ -27,10 +47,13 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - if Version(self.version) >= "3.0.0": - check_min_cppstd(self, 20) - elif Version(self.version) >= "2.0.0": - check_min_cppstd(self, 11) + if Version(self.version) >= "2.0.0": + 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." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/timsort/all/test_package/CMakeLists.txt b/recipes/timsort/all/test_package/CMakeLists.txt index 0e39263ef4095..b8973a1bd5c0a 100644 --- a/recipes/timsort/all/test_package/CMakeLists.txt +++ b/recipes/timsort/all/test_package/CMakeLists.txt @@ -5,4 +5,11 @@ find_package(gfx-timsort REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE gfx::timsort) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(gfx-timsort_VERSION VERSION_LESS "2.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_98) +elseif(gfx-timsort_VERSION VERSION_LESS "3.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +endif() From e157ad3c70ad5aac2f75f54d06a30ec889300bc5 Mon Sep 17 00:00:00 2001 From: Morwenn Date: Thu, 25 Jan 2024 21:42:03 +0100 Subject: [PATCH 3/6] Add missing import --- recipes/timsort/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/timsort/all/conanfile.py b/recipes/timsort/all/conanfile.py index 586e24d45b315..d14ff8066e45a 100644 --- a/recipes/timsort/all/conanfile.py +++ b/recipes/timsort/all/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.files import copy, get from conan.tools.layout import basic_layout from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.50.0" From 7ce8c8a2d1b86bb9d1bbc143880322789cbf6be5 Mon Sep 17 00:00:00 2001 From: Morwenn Date: Sat, 27 Jan 2024 17:36:21 +0100 Subject: [PATCH 4/6] Bump support AppleClang version --- recipes/timsort/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/timsort/all/conanfile.py b/recipes/timsort/all/conanfile.py index d14ff8066e45a..e3cc6d6b95a84 100644 --- a/recipes/timsort/all/conanfile.py +++ b/recipes/timsort/all/conanfile.py @@ -34,7 +34,7 @@ def _compilers_minimum_version(self): "20": { "gcc": "11", "clang": "12", - "apple-clang": "13", + "apple-clang": "14", "Visual Studio": "16", "msvc": "192", } From 023332db9163dbb12ced8a69cf0288a1ff81847a Mon Sep 17 00:00:00 2001 From: Morwenn Date: Sat, 3 Feb 2024 13:34:06 +0100 Subject: [PATCH 5/6] Remove target_compile_features --- recipes/timsort/all/test_package/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/recipes/timsort/all/test_package/CMakeLists.txt b/recipes/timsort/all/test_package/CMakeLists.txt index b8973a1bd5c0a..8e38ce34a7629 100644 --- a/recipes/timsort/all/test_package/CMakeLists.txt +++ b/recipes/timsort/all/test_package/CMakeLists.txt @@ -5,11 +5,3 @@ find_package(gfx-timsort REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE gfx::timsort) - -if(gfx-timsort_VERSION VERSION_LESS "2.0.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_98) -elseif(gfx-timsort_VERSION VERSION_LESS "3.0.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -else() - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) -endif() From f68d79894f1ec0063f3c3d94881e702454164547 Mon Sep 17 00:00:00 2001 From: Morwenn Date: Wed, 19 Jun 2024 19:39:21 +0200 Subject: [PATCH 6/6] Update recipes/timsort/all/test_package/CMakeLists.txt Co-authored-by: Uilian Ries --- recipes/timsort/all/test_package/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/timsort/all/test_package/CMakeLists.txt b/recipes/timsort/all/test_package/CMakeLists.txt index 8e38ce34a7629..a73e92bb7c600 100644 --- a/recipes/timsort/all/test_package/CMakeLists.txt +++ b/recipes/timsort/all/test_package/CMakeLists.txt @@ -5,3 +5,4 @@ find_package(gfx-timsort REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE gfx::timsort) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)