Skip to content

Commit

Permalink
Merge branch 'conan-io:master' into minhook_recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Jan 14, 2024
2 parents cf62fb1 + 43f8bb1 commit fc01f67
Show file tree
Hide file tree
Showing 193 changed files with 2,126 additions and 1,368 deletions.
1 change: 1 addition & 0 deletions .c3i/authorized_users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1265,3 +1265,4 @@ authorized_users:
- pgrossomoreira
- wu-vincent
- Inujel
- keszegrobert
2 changes: 1 addition & 1 deletion .c3i/config_v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ cppstd:
apple-clang:
"13": ["17", "gnu17", "20", "gnu20"]
gcc:
"11": ["17", "gnu17", "20", "gnu20"]
"11": ["17", "gnu17", "20", "gnu20", "23", "gnu23"]
msvc:
"192": ["14", "17", "20"]
"193": ["14", "17", "20"]
Expand Down
7 changes: 0 additions & 7 deletions recipes/andreasbuhr-cppcoro/all/CMakeLists.txt

This file was deleted.

6 changes: 3 additions & 3 deletions recipes/andreasbuhr-cppcoro/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sources:
"cci.20210113":
url: "https://github.com/andreasbuhr/cppcoro/archive/7cc9433436fe8f2482138019cfaafce8e1d7a896.zip"
sha256: "5edc72bb19616ae5b794c7d83f9a5d4973f32c966f1966ab81779d3a38b36a2c"
"cci.20230629":
url: "https://github.com/andreasbuhr/cppcoro/archive/a3082f56ba135a659f7386b00ff797ba441207ba.zip"
sha256: "8c3283dd7587cdd18b871b290fda9394f262110140685e6de3760ede3b505736"
139 changes: 83 additions & 56 deletions recipes/andreasbuhr-cppcoro/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import os
from conans import ConanFile, tools, CMake
from conans.errors import ConanInvalidConfiguration
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import rmdir, get, copy
from conan.tools.microsoft import is_msvc
from conan.tools.scm import Version
from conan.errors import ConanInvalidConfiguration

required_conan_version = ">=1.33.0"
required_conan_version = ">=1.53.0"

class AndreasbuhrCppCoroConan(ConanFile):
name = "andreasbuhr-cppcoro"
description = "A library of C++ coroutine abstractions for the coroutines TS"
topics = ("conan", "cpp", "async", "coroutines")
topics = ("cpp", "async", "coroutines")
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/andreasbuhr/cppcoro"
license = "MIT"
settings = "os", "compiler", "build_type", "arch"
provides = "cppcoro"

exports_sources = "CMakeLists.txt"
generators = "cmake"
package_type = "library"

options = {
"shared": [True, False],
Expand All @@ -26,87 +29,111 @@ class AndreasbuhrCppCoroConan(ConanFile):
"fPIC": True,
}

_cmake = None

@property
def _source_subfolder(self):
return "source_subfolder"

@property
def _minimum_compilers_version(self):
return {
"Visual Studio": "15",
"msvc": "191",
"gcc": "10",
"clang": "8",
"apple-clang": "10",
}

@property
def _min_cppstd(self):
# Clang with libstdc++ always requires C++20
# Clang 17+ always requires C++20
# Otherwise, require C++17
compiler = self.settings.compiler
requires_cpp20 = compiler == "clang" and ("libstdc++" in compiler.get_safe("libcxx", "") or compiler.version >= Version("17"))
return 20 if requires_cpp20 else 17

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

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")

def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, self._min_cppstd)

# We can't simply check for C++20, because clang and MSVC support the coroutine TS despite not having labeled (__cplusplus macro) C++20 support
min_version = self._minimum_compilers_version.get(str(self.settings.compiler))
if not min_version:
self.output.warn("{} recipe lacks information about the {} compiler support.".format(
self.name, self.settings.compiler))
self.output.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.")
else:
if tools.Version(self.settings.compiler.version) < min_version:
raise ConanInvalidConfiguration("{} requires coroutine TS support. The current compiler {} {} does not support it.".format(
self.name, self.settings.compiler, self.settings.compiler.version))

# Currently clang expects coroutine to be implemented in a certain way (under std::experiemental::), while libstdc++ puts them under std::
# There are also other inconsistencies, see https://bugs.llvm.org/show_bug.cgi?id=48172
# This should be removed after both gcc and clang implements the final coroutine TS
if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libstdc++":
raise ConanInvalidConfiguration("{} does not support clang with libstdc++. Use libc++ instead.".format(self.name))
if Version(self.settings.compiler.version) < min_version:
raise ConanInvalidConfiguration(
f"{self.name} requires coroutine TS support. The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it."
)

# Older versions of clang expects coroutine to be put under std::experimental::, while libstdc++ puts them under std::,
# See https://bugs.llvm.org/show_bug.cgi?id=48172 for more context.
if self.settings.compiler == "clang" and "libstdc++" in self.settings.compiler.get_safe("libcxx", ""):
if self.settings.compiler.version < Version("14"):
raise ConanInvalidConfiguration("{self.name} does not support clang<14 with libstdc++. Use libc++ or upgrade to clang 14+ instead.")
if self.settings.compiler.version == Version("14"):
self.output.warning("This build may fail if using libstdc++13 or greater")

def configure(self):
if self.options.shared:
del self.options.fPIC
self.options.rm_safe("fPIC")

def source(self):
tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def _configure_cmake(self):
if not self._cmake:
self._cmake = CMake(self)
if self.settings.os == "Windows" and self.options.shared:
self._cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = "ON"
self._cmake.configure()
return self._cmake
def generate(self):
tc = CMakeToolchain(self)
tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = "ON"
tc.generate()

def build(self):
cmake = self._configure_cmake()
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
cmake = CMake(self)
cmake.install()
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))

def package_info(self):
self.cpp_info.filenames["cmake_find_package"] = "cppcoro"
self.cpp_info.filenames["cmake_find_package_multi"] = "cppcoro"
self.cpp_info.names["cmake_find_package"] = "cppcoro"
self.cpp_info.names["cmake_find_package_multi"] = "cppcoro"
@property
def _needs_fcoroutines_ts_flag(self):
version = Version(self.settings.compiler.version)
if self.settings.compiler == "clang":
# clang 5: Coroutines support added
# somewhere between clang 5 and 11: the requirement to add -fcoroutines-ts was dropped, at least in the context of this recipe.
return version < 11
elif self.settings.compiler == "apple-clang":
# At some point before apple-clang 13, in the context of this recipe, the requirement for this flag was dropped.
return version < 13
else:
return False

comp = self.cpp_info.components["cppcoro"]
comp.names["cmake_find_package"] = "cppcoro"
comp.names["cmake_find_package_multi"] = "cppcoro"
comp.libs = ["cppcoro"]
def package_info(self):
self.cpp_info.libs = ["cppcoro"]

if self.settings.os == "Linux" and self.options.shared:
comp.system_libs = ["pthread"]
if self.settings.os in ["Linux", "FreeBSD"] and self.options.shared:
self.cpp_info.system_libs = ["pthread", "m"]
if self.settings.os == "Windows":
comp.system_libs = ["synchronization"]
self.cpp_info.system_libs = ["synchronization", "ws2_32", "mswsock"]

if self.settings.compiler == "Visual Studio":
comp.cxxflags.append("/await")
if is_msvc(self):
self.cpp_info.cxxflags.append("/await")
elif self.settings.compiler == "gcc":
comp.cxxflags.append("-fcoroutines")
comp.defines.append("CPPCORO_COMPILER_SUPPORTS_SYMMETRIC_TRANSFER=1")
elif self.settings.compiler == "clang" or self.settings.compiler == "apple-clang":
comp.cxxflags.append("-fcoroutines-ts")
self.cpp_info.cxxflags.append("-fcoroutines")
self.cpp_info.defines.append("CPPCORO_COMPILER_SUPPORTS_SYMMETRIC_TRANSFER=1")
elif self._needs_fcoroutines_ts_flag:
self.cpp_info.cxxflags.append("-fcoroutines-ts")

self.cpp_info.set_property("cmake_file_name", "cppcoro")
self.cpp_info.set_property("cmake_target_name", "cppcoro::cppcoro")

# TODO: to remove in conan v2 once cmake_find_package_* generators removed
self.cpp_info.filenames["cmake_find_package"] = "cppcoro"
self.cpp_info.filenames["cmake_find_package_multi"] = "cppcoro"
self.cpp_info.names["cmake_find_package"] = "cppcoro"
self.cpp_info.names["cmake_find_package_multi"] = "cppcoro"
5 changes: 1 addition & 4 deletions recipes/andreasbuhr-cppcoro/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.15)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

find_package(cppcoro CONFIG REQUIRED)

add_executable(${PROJECT_NAME} test_package.cpp)
Expand Down
22 changes: 16 additions & 6 deletions recipes/andreasbuhr-cppcoro/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os
from conans import ConanFile, CMake, tools


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")
2 changes: 1 addition & 1 deletion recipes/andreasbuhr-cppcoro/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
versions:
"cci.20210113":
"cci.20230629":
folder: "all"
2 changes: 2 additions & 0 deletions recipes/at-spi2-core/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ versions:
folder: new
"2.50.0":
folder: new
"2.51.0":
folder: new
3 changes: 3 additions & 0 deletions recipes/at-spi2-core/new/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.51.0":
sha256: 8dd07c6160e3115f4f77e2205963449def6822a3dc85d495c5db389f56663037
url: https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.51/at-spi2-core-2.51.0.tar.xz
"2.50.0":
sha256: e9f5a8c8235c9dd963b2171de9120301129c677dde933955e1df618b949c4adc
url: https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.50/at-spi2-core-2.50.0.tar.xz
Expand Down
3 changes: 3 additions & 0 deletions recipes/base64/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.5.2":
url: "https://github.com/aklomp/base64/archive/v0.5.2.tar.gz"
sha256: "723a0f9f4cf44cf79e97bcc315ec8f85e52eb104c8882942c3f2fba95acc080d"
"0.5.1":
url: "https://github.com/aklomp/base64/archive/v0.5.1.tar.gz"
sha256: "35fd9400ce85ba5fc5455b3f1c8d0078d084ad246bd808315fd01ea8f2876dbf"
Expand Down
2 changes: 2 additions & 0 deletions recipes/base64/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.5.2":
folder: all
"0.5.1":
folder: all
"0.5.0":
Expand Down
26 changes: 26 additions & 0 deletions recipes/bazel/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,32 @@ sources:
url: "https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-windows-arm64.exe"
sha256: "3c23fccd3815933452c859e8482864598b6903d3143f9f18589915bf2c0dd2d4"

"5.4.1":
license:
url: "https://raw.githubusercontent.com/bazelbuild/bazel/5.4.1/LICENSE"
sha256: "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
Macos:
x86_64:
url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-darwin-x86_64"
sha256: "e8f796d67e9e4b54183c465443158dfb38bfe7df3626c1cfa0a6a3d9866047f9"
armv8:
url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-darwin-arm64"
sha256: "f2443a2131e832c2f12d448e673be7dad9cd2822066b4e2d4bd2d634bb2495e6"
Linux:
x86_64:
url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-linux-x86_64"
sha256: "5d90515f84b5ee1fd6ec22ee9e83103e77ed1a907ee5eec198fef3a5b45abf13"
armv8:
url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-linux-arm64"
sha256: "431dfaf5c0bd264b5753ae7a57f262137394c214c5e83651218887a9155dd010"
Windows:
x86_64:
url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-windows-x86_64.exe"
sha256: "f44329c91ee0ca2ea8526f9c0fecb65f1aa483e658f9b09831b16a0e70e16b51"
armv8:
url: "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-windows-arm64.exe"
sha256: "1e273c20dfa8493bf21b002614592a6cb3aa9eabe8b30eda96f8a517fca1a619"

"4.0.0":
license:
url: "https://raw.githubusercontent.com/bazelbuild/bazel/4.0.0/LICENSE"
Expand Down
2 changes: 2 additions & 0 deletions recipes/bazel/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ versions:
folder: all
"6.2.0":
folder: all
"5.4.1":
folder: all
"4.0.0":
folder: all
4 changes: 4 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ patches:
- patch_file: "patches/1.82.0-locale-iconv-library-option.patch"
patch_description: "Optional flag to specify iconv from either libc of libiconv"
patch_type: "conan"
- patch_file: "patches/1.83.0-locale-msvc.patch"
patch_description: "Fix compilation on windows when NOMINMAX is not defined"
patch_type: "official"
patch_source: "https://github.com/boostorg/locale/pull/189"
"1.82.0":
- patch_file: "patches/1.82.0-locale-iconv-library-option.patch"
patch_description: "Optional flag to specify iconv from either libc of libiconv"
Expand Down
22 changes: 22 additions & 0 deletions recipes/boost/all/patches/1.83.0-locale-msvc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 0552ffc29ff11e4fe130b7143ea6ac2bee7b15c6 Mon Sep 17 00:00:00 2001
From: wevsty <ty@wevs.org>
Date: Sat, 12 Aug 2023 22:13:48 +0800
Subject: [PATCH] fix build error on MSVC

---
boost/locale/util/string.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boost/locale/util/string.hpp b/boost/locale/util/string.hpp
index 9ab9521c..ba066bd4 100644
--- a/boost/locale/util/string.hpp
+++ b/boost/locale/util/string.hpp
@@ -38,7 +38,7 @@ namespace boost { namespace locale { namespace util {
/// Cast an unsigned char to a (possibly signed) char avoiding implementation defined behavior
constexpr char to_char(unsigned char c)
{
- return static_cast<char>((c - std::numeric_limits<char>::min()) + std::numeric_limits<char>::min());
+ return static_cast<char>((c - (std::numeric_limits<char>::min)()) + (std::numeric_limits<char>::min)());
}

}}} // namespace boost::locale::util
2 changes: 1 addition & 1 deletion recipes/c-blosc2/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def requirements(self):
if self.options.with_lz4:
self.requires("lz4/1.9.4")
if self.options.with_zlib in ["zlib-ng", "zlib-ng-compat"]:
self.requires("zlib-ng/2.1.5")
self.requires("zlib-ng/2.1.6")
elif self.options.with_zlib == "zlib":
self.requires("zlib/[>=1.2.11 <2]")
if self.options.with_zstd:
Expand Down
3 changes: 3 additions & 0 deletions recipes/cargs/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.1.0":
url: "https://github.com/likle/cargs/archive/v1.1.0.tar.gz"
sha256: "87e7da5b539f574d48529870cb0620ef5a244a5ee2eac73cc7559dedc04128ca"
"1.0.3":
url: "https://github.com/likle/cargs/archive/v1.0.3.tar.gz"
sha256: "ddba25bd35e9c6c75bc706c126001b8ce8e084d40ef37050e6aa6963e836eb8b"
Expand Down
2 changes: 2 additions & 0 deletions recipes/cargs/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.1.0":
folder: all
"1.0.3":
folder: all
"1.0.1":
Expand Down
Loading

0 comments on commit fc01f67

Please sign in to comment.