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

Bump timsort to 3.0.0 #22516

Merged
merged 7 commits into from
Nov 21, 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
3 changes: 3 additions & 0 deletions recipes/timsort/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
28 changes: 13 additions & 15 deletions recipes/timsort/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,36 @@
from conan.tools.scm import Version
import os

required_conan_version = ">=1.50.0"
required_conan_version = ">=2.0.9"


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"

def layout(self):
basic_layout(self, src_folder="src")

def package_id(self):
self.info.clear()

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
if Version(self.version) >= "2.0.0":
check_min_cppstd(self, 11)
check_min_cppstd(self, self._min_cppstd)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand All @@ -43,14 +49,6 @@ def package(self):
def package_info(self):
self.cpp_info.set_property("cmake_file_name", "gfx-timsort")
self.cpp_info.set_property("cmake_target_name", "gfx::timsort")
self.cpp_info.components["gfx-timsort"].set_property("cmake_target_name", "gfx::timsort")
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.filenames["cmake_find_package"] = "gfx-timsort"
self.cpp_info.filenames["cmake_find_package_multi"] = "gfx-timsort"
self.cpp_info.names["cmake_find_package"] = "gfx"
self.cpp_info.names["cmake_find_package_multi"] = "gfx"
self.cpp_info.components["gfx-timsort"].names["cmake_find_package"] = "timsort"
self.cpp_info.components["gfx-timsort"].names["cmake_find_package_multi"] = "timsort"
self.cpp_info.components["gfx-timsort"].set_property("cmake_target_name", "gfx::timsort")
2 changes: 1 addition & 1 deletion recipes/timsort/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ find_package(gfx-timsort REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE gfx::timsort)
Morwenn marked this conversation as resolved.
Show resolved Hide resolved
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
8 changes: 0 additions & 8 deletions recipes/timsort/all/test_v1_package/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/timsort/all/test_v1_package/conanfile.py

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/timsort/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.0.0":
folder: all
"2.1.0":
folder: all
"2.0.2":
Expand Down