From 87093ddebbb4924ce926702b0104b8ee5b80be5e Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Thu, 26 Jan 2023 10:47:19 +0100 Subject: [PATCH 01/11] (#15337) [doc] Update supported platforms and configurations (2023-01-17) From 8810cd3a662cd2a723e3d761f0cd1b4707ced079 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 26 Jan 2023 19:08:43 +0900 Subject: [PATCH 02/11] (#15409) simdjson: add version 3.1.0, remove older versions --- recipes/simdjson/all/conandata.yml | 15 +++------------ recipes/simdjson/all/conanfile.py | 16 ++++++++-------- .../simdjson/all/test_v1_package/CMakeLists.txt | 9 +++------ recipes/simdjson/config.yml | 10 ++-------- 4 files changed, 16 insertions(+), 34 deletions(-) diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index e013ffe19b37c..73e2b2c6139dd 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.0": + url: "https://github.com/simdjson/simdjson/archive/refs/tags/3.1.0.tar.gz" + sha256: "14d17ba7139d27c1e1bf01e765f5c26e84cc9e9be6a316c977638e01c7de85fa" "3.0.1": url: "https://github.com/simdjson/simdjson/archive/v3.0.1.tar.gz" sha256: "156b1bc5eb0561b2bd166b46d191fd3d95a3e709cc63761477d3b7aec2b6e9ed" @@ -8,24 +11,12 @@ sources: "2.2.3": url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" - "2.2.2": - url: "https://github.com/simdjson/simdjson/archive/v2.2.2.tar.gz" - sha256: "b0e36beab240bd827c1103b4c66672491595930067871e20946d67b07758c010" - "2.2.0": - url: "https://github.com/simdjson/simdjson/archive/v2.2.0.tar.gz" - sha256: "011974352049e986bdcdf64fc807cf3ab901865240f4ae8e3de670dd42aab099" "2.1.0": url: "https://github.com/simdjson/simdjson/archive/v2.1.0.tar.gz" sha256: "051b90427ddd1eac319f4eb34b973592728a6d8608fbac61e8aaa5a2dee4b693" "2.0.4": url: "https://github.com/simdjson/simdjson/archive/v2.0.4.tar.gz" sha256: "c8a12cf60f6ce8c0e556f68bd80e7bd9f11f5876e198ed3637da8ccf182eaa24" - "2.0.3": - url: "https://github.com/simdjson/simdjson/archive/v2.0.3.tar.gz" - sha256: "c1bcf65b3bd830bf8f747b8dd7126edd4bb7562bebb92698c1750acf4c979df6" - "2.0.1": - url: "https://github.com/simdjson/simdjson/archive/v2.0.1.tar.gz" - sha256: "581e508210614a5024edf79e0b65db943ab5711cc42163826bcbf3df6a5e34d1" "1.1.0": url: "https://github.com/simdjson/simdjson/archive/v1.1.0.tar.gz" sha256: "9effcb21fe48e4bcc9b96031e60c3911c58aa656ad8c78212d269c0db9e0133e" diff --git a/recipes/simdjson/all/conanfile.py b/recipes/simdjson/all/conanfile.py index e8b764c5b7dc2..2c915245a6822 100644 --- a/recipes/simdjson/all/conanfile.py +++ b/recipes/simdjson/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" +required_conan_version = ">=1.53" class SimdjsonConan(ConanFile): @@ -33,9 +33,9 @@ class SimdjsonConan(ConanFile): @property def _compilers_minimum_version(self): return { - # In simdjson/2.0.1, several AVX-512 instructions are not support by GCC < 9.0 - "gcc": "8" if Version(self.version) != "2.0.1" else "9", + "gcc": "8", "Visual Studio": "16", + "msvc": "192", "clang": "6", "apple-clang": "9.4", } @@ -46,7 +46,7 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def validate(self): if self.info.settings.compiler.cppstd: @@ -60,17 +60,17 @@ def loose_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) if not minimum_version: - self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + self.output.warn(f"{self.ref} requires C++17. Your compiler is unknown. Assuming it supports C++17.") elif loose_lt_semver(str(self.info.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not fully support.".format(self.name)) + raise ConanInvalidConfiguration(f"{self.ref} requires C++17, which your compiler does not fully support.") if Version(self.version) >= "2.0.0" and \ self.info.settings.compiler == "gcc" and \ Version(self.info.settings.compiler.version).major == "9": if self.settings.compiler.get_safe("libcxx") == "libstdc++11": - raise ConanInvalidConfiguration("{}/{} doesn't support GCC 9 with libstdc++11.".format(self.name, self.version)) + raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC 9 with libstdc++11.") if self.info.settings.build_type == "Debug": - raise ConanInvalidConfiguration("{}/{} doesn't support GCC 9 with Debug build type.".format(self.name, self.version)) + raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC 9 with Debug build type.") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/simdjson/all/test_v1_package/CMakeLists.txt b/recipes/simdjson/all/test_v1_package/CMakeLists.txt index 88b5f3a330d2f..be00a8c7f57c7 100644 --- a/recipes/simdjson/all/test_v1_package/CMakeLists.txt +++ b/recipes/simdjson/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(simdjson REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE simdjson::simdjson) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/simdjson/config.yml b/recipes/simdjson/config.yml index 3e7ad49018ff0..bf3633db56013 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,22 +1,16 @@ versions: + "3.1.0": + folder: all "3.0.1": folder: all "3.0.0": folder: all "2.2.3": folder: all - "2.2.2": - folder: all - "2.2.0": - folder: all "2.1.0": folder: all "2.0.4": folder: all - "2.0.3": - folder: all - "2.0.1": - folder: all "1.1.0": folder: all "1.0.2": From 6bd4a223a6c05eaf6e42dff99c3e6d684b2ff21a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 26 Jan 2023 11:47:57 +0100 Subject: [PATCH 03/11] (#15465) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/adding_packages/conanfile_attributes.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/adding_packages/conanfile_attributes.md b/docs/adding_packages/conanfile_attributes.md index 1bc6affbddc93..eda630630ccb1 100644 --- a/docs/adding_packages/conanfile_attributes.md +++ b/docs/adding_packages/conanfile_attributes.md @@ -9,8 +9,9 @@ or are known by ConanCenter's build service and have special meaning. * [Attributes](#attributes) * [Name](#name) * [Version](#version) - * [ConanCenter specific releases format](#conancenter-specific-releases-format) - * [License Attribute](#license) + * [ConanCenter specific releases format](#conancenter-specific-releases-format) + * [License Attribute](#license-attribute) + * [Order of methods and attributes](#order-of-methods-and-attributes) * [Settings](#settings) * [Options](#options) * [Recommended Names](#recommended-names) From f4dbb80706ad80a0a74690e8cb6238f337e89a5e Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 26 Jan 2023 11:48:24 +0100 Subject: [PATCH 04/11] [config] Update conan versions (#15374) --- .c3i/config_v1.yml | 2 +- .c3i/config_v2.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index 870d10c9cf172..ffbf2b54e5ebb 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 1.56.0 + version: 1.57.0 artifactory: url: "https://c3i.jfrog.io/c3i" diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index 20dcee62abb55..db50857fe792d 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index-staging-v2' conan: - version: 2.0.0-beta7 + version: 2.0.0-beta8 artifactory: url: "https://c3i.jfrog.io/c3i" From e9ef19d6af39fb254508a2e2be21b5fedd06e1b5 Mon Sep 17 00:00:00 2001 From: Fernando Pelliccioni Date: Thu, 26 Jan 2023 08:07:48 -0300 Subject: [PATCH 05/11] (#15470) [jfalcou-eve] Support for apple-clang v14 --- recipes/jfalcou-eve/all/conanfile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/jfalcou-eve/all/conanfile.py b/recipes/jfalcou-eve/all/conanfile.py index d79178dde59e1..6761b154e37b6 100644 --- a/recipes/jfalcou-eve/all/conanfile.py +++ b/recipes/jfalcou-eve/all/conanfile.py @@ -35,7 +35,7 @@ def _compilers_minimum_version(self): "Visual Studio": "16.9", "msvc": "1928", "clang": "13", - "apple-clang": "13"} + "apple-clang": "14"} def configure(self): version = Version(self.version.strip("v")) @@ -53,8 +53,6 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) if is_msvc(self): raise ConanInvalidConfiguration("EVE does not support MSVC yet (https://github.com/jfalcou/eve/issues/1022).") - if self.settings.compiler == "apple-clang": - raise ConanInvalidConfiguration("EVE does not support apple Clang due to an incomplete libcpp.") def lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] From ad666793547315ec296ae77859014424d3ff7617 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 26 Jan 2023 14:46:53 +0100 Subject: [PATCH 06/11] (#14873) [gnutls] Add new recipe with Conan v1 & v2 support * Add GNU TLS Signed-off-by: Uilian Ries * export vars Signed-off-by: Uilian Ries * prepare gnutls for Conan v2 Signed-off-by: Uilian Ries * Fix yaml format Signed-off-by: Uilian Ries * Fix optional logic Signed-off-by: Uilian Ries * Fix yaml format Signed-off-by: Uilian Ries * remove .la files Signed-off-by: Uilian Ries * Update recipes/gnutls/all/test_v1_package/conanfile.py Co-authored-by: Chris Mc * Update recipes/gnutls/all/conanfile.py Co-authored-by: Chris Mc * Update recipes/gnutls/all/conanfile.py Co-authored-by: Chris Mc * Remove pkgconfig folder Signed-off-by: Uilian Ries * fix copy license Signed-off-by: Uilian Ries * fix test_v1_package Signed-off-by: Uilian Ries * Fix license file name Signed-off-by: Uilian Ries * Disable rpath Signed-off-by: Uilian Ries * Fix licenses Signed-off-by: Uilian Ries * Add workaround for Mac framework Signed-off-by: Uilian Ries * Remove workaround Signed-off-by: Uilian Ries * Requires Conan 1.55 Signed-off-by: Uilian Ries * Skip apple debug Signed-off-by: Uilian Ries * Fix Mac debug build Signed-off-by: Uilian Ries * Try to fix cross-building on ARM Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/gnutls/all/conandata.yml | 13 ++ recipes/gnutls/all/conanfile.py | 150 ++++++++++++++++++ .../gnutls/all/patches/0001-fix-isdigit.patch | 149 +++++++++++++++++ .../gnutls/all/test_package/CMakeLists.txt | 7 + recipes/gnutls/all/test_package/conanfile.py | 27 ++++ .../gnutls/all/test_package/test_package.c | 16 ++ .../gnutls/all/test_v1_package/CMakeLists.txt | 8 + .../gnutls/all/test_v1_package/conanfile.py | 17 ++ recipes/gnutls/config.yml | 3 + 9 files changed, 390 insertions(+) create mode 100644 recipes/gnutls/all/conandata.yml create mode 100644 recipes/gnutls/all/conanfile.py create mode 100644 recipes/gnutls/all/patches/0001-fix-isdigit.patch create mode 100644 recipes/gnutls/all/test_package/CMakeLists.txt create mode 100644 recipes/gnutls/all/test_package/conanfile.py create mode 100644 recipes/gnutls/all/test_package/test_package.c create mode 100644 recipes/gnutls/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gnutls/all/test_v1_package/conanfile.py create mode 100644 recipes/gnutls/config.yml diff --git a/recipes/gnutls/all/conandata.yml b/recipes/gnutls/all/conandata.yml new file mode 100644 index 0000000000000..ffbcf3dfbc66a --- /dev/null +++ b/recipes/gnutls/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "3.7.8": + url: + - "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz" + - "http://www.ring.gr.jp/pub/net/gnupg/gnutls/v3.7/gnutls-3.7.8.tar.xz" + - "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz" + sha256: "c58ad39af0670efe6a8aee5e3a8b2331a1200418b64b7c51977fb396d4617114" +patches: + "3.7.8": + - patch_description: "Fix Mac OS build when linking to libtasn1" + patch_type: "portability" + patch_source: "https://github.com/xbmc/inputstream.ffmpegdirect/blob/Matrix/depends/common/gnutls/03-undo-libtasn1-cisdigit.patch" + patch_file: "patches/0001-fix-isdigit.patch" diff --git a/recipes/gnutls/all/conanfile.py b/recipes/gnutls/all/conanfile.py new file mode 100644 index 0000000000000..6c54fe7b1a38d --- /dev/null +++ b/recipes/gnutls/all/conanfile.py @@ -0,0 +1,150 @@ +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, rmdir, rm, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.layout import basic_layout +from conan.tools.gnu import AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps, Autotools +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.apple import is_apple_os +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.55.0" + + +class GnuTLSConan(ConanFile): + name = "gnutls" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnutls.org" + description = "GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols" + topics = ("tls", "ssl", "secure communications") + license = ("LGPL-2.1-or-later", "GPL-3-or-later") + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], + "fPIC": [True, False], + "enable_cxx": [True, False], + "enable_tools": [True, False], + "enable_openssl_compatibility": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + "with_brotli": [True, False],} + default_options = {"shared": False, + "fPIC": True, + "enable_cxx": True, + "enable_tools": True, + "enable_openssl_compatibility": False, + "with_zlib": True, + "with_zstd": True, + "with_brotli": True,} + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + del self.options.fPIC + if not self.options.enable_cxx: + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("nettle/3.8.1") + self.requires("gmp/6.2.1") + self.requires("libiconv/1.17") + if self.options.with_zlib: + self.requires("zlib/1.2.13") + if self.options.with_zstd: + self.requires("zstd/1.5.2") + if self.options.with_brotli: + self.requires("brotli/1.0.9") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} cannot be deployed by Visual Studio.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + yes_no = lambda v: "yes" if v else "no" + autotoolstc = AutotoolsToolchain(self) + autotoolstc.configure_args.extend([ + "--disable-tests", + "--disable-doc", + "--disable-guile", + "--disable-libdane", + "--disable-manpages", + "--disable-silent-rules", + "--disable-full-test-suite", + "--disable-maintainer-mode", + "--disable-option-checking", + "--disable-dependency-tracking", + "--disable-heartbeat-support", + "--disable-gtk-doc-html", + "--without-p11-kit", + "--disable-rpath", + "--without-idn", + "--with-included-unistring", + "--with-included-libtasn1", + "--with-libiconv-prefix={}".format(self.dependencies["libiconv"].package_folder), + "--enable-shared={}".format(yes_no(self.options.shared)), + "--enable-static={}".format(yes_no(not self.options.shared)), + "--with-cxx={}".format(yes_no(self.options.enable_cxx)), + "--with-zlib={}".format(yes_no(self.options.with_zlib)), + "--with-brotli={}".format(yes_no(self.options.with_brotli)), + "--with-zstd={}".format(yes_no(self.options.with_zstd)), + "--enable-tools={}".format(yes_no(self.options.enable_tools)), + "--enable-openssl-compatibility={}".format(yes_no(self.options.enable_openssl_compatibility)), + ]) + env = autotoolstc.environment() + if cross_building(self): + # INFO: Undefined symbols for architecture Mac arm64 rpl_malloc and rpl_realloc + env.define("ac_cv_func_malloc_0_nonnull", "yes") + env.define("ac_cv_func_realloc_0_nonnull", "yes") + autotoolstc.generate(env) + autodeps = AutotoolsDeps(self) + autodeps.generate() + pkgdeps = PkgConfigDeps(self) + pkgdeps.generate() + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["gnutls", "gnutlsxx"] if self.options.enable_cxx else ["gnutls"] + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "GnuTLS") + self.cpp_info.set_property("cmake_target_name", "GnuTLS::GnuTLS") + self.cpp_info.set_property("pkg_config_name", "gnutls") + + if is_apple_os(self): + self.cpp_info.frameworks = ["Security", "CoreFoundation"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "GnuTLS" + self.cpp_info.names["cmake_find_package_multi"] = "GnuTLS" + if self.options.enable_tools: + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH env var with : {}".format(bin_path)) + self.env_info.PATH.append(bin_path) diff --git a/recipes/gnutls/all/patches/0001-fix-isdigit.patch b/recipes/gnutls/all/patches/0001-fix-isdigit.patch new file mode 100644 index 0000000000000..64c04ca78c4c2 --- /dev/null +++ b/recipes/gnutls/all/patches/0001-fix-isdigit.patch @@ -0,0 +1,149 @@ +diff --git a/lib/minitasn1/decoding.c b/lib/minitasn1/decoding.c +index 378219c..f75baa7 100644 +--- a/lib/minitasn1/decoding.c ++++ b/lib/minitasn1/decoding.c +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include "c-ctype.h" + + #ifdef DEBUG + # define warn() fprintf(stderr, "%s: %d\n", __func__, __LINE__) +@@ -353,7 +352,7 @@ _asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int *r + p = &der[len_len]; + for (i=0;i<(unsigned)(str_len-1);i++) + { +- if (c_isdigit(p[i]) == 0) ++ if (isdigit(p[i]) == 0) + { + if (type == ASN1_ETYPE_GENERALIZED_TIME) + { +diff --git a/lib/minitasn1/element.c b/lib/minitasn1/element.c +index 550fdb2..58d9243 100644 +--- a/lib/minitasn1/element.c ++++ b/lib/minitasn1/element.c +@@ -30,7 +30,6 @@ + #include "parser_aux.h" + #include + #include "structure.h" +-#include "c-ctype.h" + #include "element.h" + + void +@@ -380,7 +379,7 @@ asn1_write_value (asn1_node node_root, const char *name, + case ASN1_ETYPE_ENUMERATED: + if (len == 0) + { +- if ((c_isdigit (value[0])) || (value[0] == '-')) ++ if ((isdigit (value[0])) || (value[0] == '-')) + { + value_temp = malloc (SIZEOF_UNSIGNED_LONG_INT); + if (value_temp == NULL) +@@ -453,7 +452,7 @@ asn1_write_value (asn1_node node_root, const char *name, + p = node->down; + while (type_field (p->type) != ASN1_ETYPE_DEFAULT) + p = p->right; +- if ((c_isdigit (p->value[0])) || (p->value[0] == '-')) ++ if ((isdigit (p->value[0])) || (p->value[0] == '-')) + { + default_temp = malloc (SIZEOF_UNSIGNED_LONG_INT); + if (default_temp == NULL) +@@ -519,7 +518,7 @@ asn1_write_value (asn1_node node_root, const char *name, + break; + case ASN1_ETYPE_OBJECT_ID: + for (i = 0; i < _asn1_strlen (value); i++) +- if ((!c_isdigit (value[i])) && (value[i] != '.') && (value[i] != '+')) ++ if ((!isdigit (value[i])) && (value[i] != '.') && (value[i] != '+')) + return ASN1_VALUE_NOT_VALID; + if (node->type & CONST_DEFAULT) + { +@@ -540,7 +539,7 @@ asn1_write_value (asn1_node node_root, const char *name, + if (len < 11) + return ASN1_VALUE_NOT_VALID; + for (k = 0; k < 10; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + switch (len) + { +@@ -549,7 +548,7 @@ asn1_write_value (asn1_node node_root, const char *name, + return ASN1_VALUE_NOT_VALID; + break; + case 13: +- if ((!c_isdigit (value[10])) || (!c_isdigit (value[11])) || ++ if ((!isdigit (value[10])) || (!isdigit (value[11])) || + (value[12] != 'Z')) + return ASN1_VALUE_NOT_VALID; + break; +@@ -557,16 +556,16 @@ asn1_write_value (asn1_node node_root, const char *name, + if ((value[10] != '+') && (value[10] != '-')) + return ASN1_VALUE_NOT_VALID; + for (k = 11; k < 15; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + break; + case 17: +- if ((!c_isdigit (value[10])) || (!c_isdigit (value[11]))) ++ if ((!isdigit (value[10])) || (!isdigit (value[11]))) + return ASN1_VALUE_NOT_VALID; + if ((value[12] != '+') && (value[12] != '-')) + return ASN1_VALUE_NOT_VALID; + for (k = 13; k < 17; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + break; + default: +@@ -890,7 +889,7 @@ asn1_read_value_type (asn1_node_const root, const char *name, void *ivalue, + p = node->down; + while (type_field (p->type) != ASN1_ETYPE_DEFAULT) + p = p->right; +- if ((c_isdigit (p->value[0])) || (p->value[0] == '-') ++ if ((isdigit (p->value[0])) || (p->value[0] == '-') + || (p->value[0] == '+')) + { + result = _asn1_convert_integer +diff --git a/lib/minitasn1/int.h b/lib/minitasn1/int.h +index 57f1efd..8e3e2e4 100644 +--- a/lib/minitasn1/int.h ++++ b/lib/minitasn1/int.h +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + + #ifdef HAVE_SYS_TYPES_H +diff --git a/lib/minitasn1/parser_aux.c b/lib/minitasn1/parser_aux.c +index bb88ab9..c01b3fa 100644 +--- a/lib/minitasn1/parser_aux.c ++++ b/lib/minitasn1/parser_aux.c +@@ -26,7 +26,6 @@ + #include "gstr.h" + #include "structure.h" + #include "element.h" +-#include "c-ctype.h" + + char _asn1_identifierMissing[ASN1_MAX_NAME_SIZE + 1]; /* identifier name not found */ + +@@ -755,7 +754,7 @@ _asn1_expand_object_id (list_type **list, asn1_node node) + p2 = p->down; + if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT)) + { +- if (p2->value && !c_isdigit (p2->value[0])) ++ if (p2->value && !isdigit (p2->value[0])) + { + _asn1_str_cpy (name2, sizeof (name2), name_root); + _asn1_str_cat (name2, sizeof (name2), "."); +@@ -1067,7 +1066,7 @@ _asn1_check_identifier (asn1_node_const node) + p2 = p->down; + if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT)) + { +- if (p2->value && !c_isdigit (p2->value[0])) ++ if (p2->value && !isdigit (p2->value[0])) + { + _asn1_str_cpy (name2, sizeof (name2), node->name); + _asn1_str_cat (name2, sizeof (name2), "."); diff --git a/recipes/gnutls/all/test_package/CMakeLists.txt b/recipes/gnutls/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6d57019b23f0b --- /dev/null +++ b/recipes/gnutls/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +find_package(GnuTLS REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GnuTLS::GnuTLS) diff --git a/recipes/gnutls/all/test_package/conanfile.py b/recipes/gnutls/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c4b7c357ad04a --- /dev/null +++ b/recipes/gnutls/all/test_package/conanfile.py @@ -0,0 +1,27 @@ + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gnutls/all/test_package/test_package.c b/recipes/gnutls/all/test_package/test_package.c new file mode 100644 index 0000000000000..e40be9a5950ff --- /dev/null +++ b/recipes/gnutls/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include + +int main (void) { + int result = 0; + gnutls_session_t session; + + gnutls_global_init(); + gnutls_global_set_log_level(0); + + gnutls_init(&session, GNUTLS_SERVER); + gnutls_deinit(session); + gnutls_global_deinit(); + + return EXIT_SUCCESS; +} diff --git a/recipes/gnutls/all/test_v1_package/CMakeLists.txt b/recipes/gnutls/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de3b75d9538de --- /dev/null +++ b/recipes/gnutls/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +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/gnutls/all/test_v1_package/conanfile.py b/recipes/gnutls/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..90eb89e3f2f46 --- /dev/null +++ b/recipes/gnutls/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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/gnutls/config.yml b/recipes/gnutls/config.yml new file mode 100644 index 0000000000000..c993c311a349d --- /dev/null +++ b/recipes/gnutls/config.yml @@ -0,0 +1,3 @@ +versions: + "3.7.8": + folder: "all" From 77eb4e771938b1d5b361568b7ba6df2cb42af4a7 Mon Sep 17 00:00:00 2001 From: Nicolai Grodzitski Date: Thu, 26 Jan 2023 15:06:08 +0100 Subject: [PATCH 07/11] (#14878) Update logr to v0.6.0 * Update logr to v0.6.0 * Comply to new practices * Account for different backends * Review guided polishing Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/logr/all/conandata.yml | 3 + recipes/logr/all/conanfile.py | 135 +++++++++--------- recipes/logr/all/test_package/CMakeLists.txt | 15 +- recipes/logr/all/test_package/conanfile.py | 22 ++- .../logr/all/test_v1_package/CMakeLists.txt | 11 ++ recipes/logr/all/test_v1_package/conanfile.py | 16 +++ recipes/logr/config.yml | 2 + 7 files changed, 115 insertions(+), 89 deletions(-) create mode 100644 recipes/logr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/logr/all/test_v1_package/conanfile.py diff --git a/recipes/logr/all/conandata.yml b/recipes/logr/all/conandata.yml index 9076e1decadad..46dc2294ce601 100644 --- a/recipes/logr/all/conandata.yml +++ b/recipes/logr/all/conandata.yml @@ -14,3 +14,6 @@ sources: "0.5.1": url: "https://github.com/ngrodzitski/logr/archive/v0.5.1.tar.gz" sha256: "674be6a53d5b3f40273b1b5710ac9e32d870827032b5008c41621db47f4b3b0e" + "0.6.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.6.0.tar.gz" + sha256: "2ecb40396add33f2120a79957633533381f3df13cb3b53278eb9dec3a1230eb2" diff --git a/recipes/logr/all/conanfile.py b/recipes/logr/all/conanfile.py index ee7363a51c446..a5e869c032b2e 100644 --- a/recipes/logr/all/conanfile.py +++ b/recipes/logr/all/conanfile.py @@ -1,7 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps +from conan.tools.files import get, copy, rmdir +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version import os +required_conan_version = ">=1.50.0" class LogrConan(ConanFile): name = "logr" @@ -13,110 +20,96 @@ class LogrConan(ConanFile): "for server/desktop applications" ) topics = ("logger", "development", "util", "utils") - generators = "cmake" + settings = "os", "compiler", "build_type", "arch" - no_copy_source = True options = {"backend": ["spdlog", "glog", "log4cplus", "boostlog", None]} default_options = {"backend": "spdlog"} - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/8.1.1") + if Version(self.version) >= "0.6.0": + fmt_ref = "fmt/9.1.0" + spdlog_ref = "spdlog/1.11.0" + else: + fmt_ref = "fmt/8.1.1" + spdlog_ref = "spdlog/1.9.2" + + self.requires(fmt_ref) if self.options.backend == "spdlog": - self.requires("spdlog/1.9.2") + self.requires(spdlog_ref) elif self.options.backend == "glog": - self.requires("glog/0.5.0") + self.requires("glog/0.6.0") elif self.options.backend == "log4cplus": self.requires("log4cplus/2.0.5") elif self.options.backend == "boostlog": self.requires("boost/1.77.0") - def configure(self): + def package_id(self): + self.info.settings.clear() + self.info.requires.clear() + + def validate(self): minimal_cpp_standard = "17" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, minimal_cpp_standard) minimal_version = { - "gcc": "7", - "clang": "7", - "apple-clang": "10", - "Visual Studio": "16", + "gcc": "10", + "clang": "11", + "apple-clang": "12", } - compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - ( - "%s recipe lacks information about the %s compiler " - "standard version support" + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = minimal_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires minimum {self.settings.compiler}-{minimum_version}." ) - % (self.name, compiler) - ) - self.output.warn( - "%s requires a compiler that supports at least C++%s" - % (self.name, minimal_cpp_standard) - ) - return - - version = tools.Version(self.settings.compiler.version) - if version < minimal_version[compiler]: - raise ConanInvalidConfiguration( - "%s requires a compiler that supports at least C++%s" - % (self.name, minimal_cpp_standard) - ) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["LOGR_WITH_SPDLOG_BACKEND"] = ( + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LOGR_WITH_SPDLOG_BACKEND"] = ( self.options.backend == "spdlog" ) - self._cmake.definitions["LOGR_WITH_GLOG_BACKEND"] = ( + tc.variables["LOGR_WITH_GLOG_BACKEND"] = ( self.options.backend == "glog" ) - self._cmake.definitions["LOGR_WITH_LOG4CPLUS_BACKEND"] = ( + tc.variables["LOGR_WITH_LOG4CPLUS_BACKEND"] = ( self.options.backend == "log4cplus" ) - self._cmake.definitions["LOGR_WITH_BOOSTLOG_BACKEND"] = ( + tc.variables["LOGR_WITH_BOOSTLOG_BACKEND"] = ( self.options.backend == "boostlog" ) + tc.variables["LOGR_INSTALL"] = True + tc.variables["LOGR_CONAN_PACKAGING"] = True + tc.variables["LOGR_BUILD_TESTS"] = False + tc.variables["LOGR_BUILD_EXAMPLES"] = False + tc.variables["LOGR_BUILD_BENCHMARKS"] = False + tc.generate() - self._cmake.definitions["LOGR_INSTALL"] = True - self._cmake.definitions["LOGR_CONAN_PACKAGING"] = True - self._cmake.definitions["LOGR_BUILD_TESTS"] = False - self._cmake.definitions["LOGR_BUILD_EXAMPLES"] = False - self._cmake.definitions["LOGR_BUILD_BENCHMARKS"] = False - - self._cmake.configure(source_folder=self._source_subfolder) - return self._cmake + deps = CMakeDeps(self) + deps.generate() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "logr")) cmake.install() - - tools.rmdir(os.path.join(self.package_folder, "lib")) - - def package_id(self): - self.info.settings.clear() + rmdir(self, os.path.join(self.package_folder, "lib")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "logr") + self.cpp_info.names["cmake_find_package"] = "logr" self.cpp_info.names["cmake_find_package_multi"] = "logr" diff --git a/recipes/logr/all/test_package/CMakeLists.txt b/recipes/logr/all/test_package/CMakeLists.txt index e76b63abc7322..866a0cc839d26 100644 --- a/recipes/logr/all/test_package/CMakeLists.txt +++ b/recipes/logr/all/test_package/CMakeLists.txt @@ -1,15 +1,8 @@ cmake_minimum_required(VERSION 3.8) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package CXX) find_package(logr REQUIRED) -add_executable(example example.cpp) -target_link_libraries(example logr::logr) +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} logr::logr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/all/test_package/conanfile.py b/recipes/logr/all/test_package/conanfile.py index cdeff684590d2..a9fb96656f203 100644 --- a/recipes/logr/all/test_package/conanfile.py +++ b/recipes/logr/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class LogrTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "example") - 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") diff --git a/recipes/logr/all/test_v1_package/CMakeLists.txt b/recipes/logr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7a2102f144a4f --- /dev/null +++ b/recipes/logr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(logr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/example.cpp) +target_link_libraries(${PROJECT_NAME} logr::logr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/all/test_v1_package/conanfile.py b/recipes/logr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..923245bfa853d --- /dev/null +++ b/recipes/logr/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class LogrTestConan(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): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/logr/config.yml b/recipes/logr/config.yml index c1a11eb732221..2642be9922766 100644 --- a/recipes/logr/config.yml +++ b/recipes/logr/config.yml @@ -11,3 +11,5 @@ versions: folder: all "0.5.1": folder: all + "0.6.0": + folder: all From bbe381a303d67083d88bb7f3bc8ae43899bd84ea Mon Sep 17 00:00:00 2001 From: Vladimir Bieleny Date: Thu, 26 Jan 2023 22:07:49 +0100 Subject: [PATCH 08/11] (#15426) iso8601lib: add new recipe, version cci.20230123 * iso8601lib: add new recipe, version cci.20230123 * iso8601lib: Replace options and settings del with rm_safe * iso8601: Remove cmake_find_package --- recipes/iso8601lib/all/conandata.yml | 4 ++ recipes/iso8601lib/all/conanfile.py | 63 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 7 +++ .../iso8601lib/all/test_package/conanfile.py | 26 ++++++++ .../all/test_package/test_package.cpp | 27 ++++++++ .../all/test_v1_package/CMakeLists.txt | 8 +++ .../all/test_v1_package/conanfile.py | 18 ++++++ recipes/iso8601lib/config.yml | 3 + 8 files changed, 156 insertions(+) create mode 100644 recipes/iso8601lib/all/conandata.yml create mode 100644 recipes/iso8601lib/all/conanfile.py create mode 100644 recipes/iso8601lib/all/test_package/CMakeLists.txt create mode 100644 recipes/iso8601lib/all/test_package/conanfile.py create mode 100644 recipes/iso8601lib/all/test_package/test_package.cpp create mode 100644 recipes/iso8601lib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/iso8601lib/all/test_v1_package/conanfile.py create mode 100644 recipes/iso8601lib/config.yml diff --git a/recipes/iso8601lib/all/conandata.yml b/recipes/iso8601lib/all/conandata.yml new file mode 100644 index 0000000000000..8eea2b2330999 --- /dev/null +++ b/recipes/iso8601lib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230123": + url: "https://github.com/TimSC/iso8601lib/archive/7a0cd0ff1bffd3f7a436e25860f5b461f4c35dc6.zip" + sha256: "2d6363eda2ec958bd7da735ca9520d658df11666326e96f20f278db565b9af73" diff --git a/recipes/iso8601lib/all/conanfile.py b/recipes/iso8601lib/all/conanfile.py new file mode 100644 index 0000000000000..76c226dbda05f --- /dev/null +++ b/recipes/iso8601lib/all/conanfile.py @@ -0,0 +1,63 @@ +from conan import ConanFile +from conan.tools.files import get, copy, collect_libs +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + + +class Iso8601LibConan(ConanFile): + name = "iso8601lib" + description = "Parsing a subset of ISO 8601 datetimes, dates and times in C." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/TimSC/iso8601lib" + topics = ("iso8601", "date", "time", "timezone") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # 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() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + + self.cpp_info.defines.append("ISO8601LIB_EXPORT") diff --git a/recipes/iso8601lib/all/test_package/CMakeLists.txt b/recipes/iso8601lib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1b48f1b1d59ba --- /dev/null +++ b/recipes/iso8601lib/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(iso8601lib REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE iso8601lib::iso8601lib) diff --git a/recipes/iso8601lib/all/test_package/conanfile.py b/recipes/iso8601lib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/iso8601lib/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/iso8601lib/all/test_package/test_package.cpp b/recipes/iso8601lib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..65ca7d176e2f7 --- /dev/null +++ b/recipes/iso8601lib/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include +#include +#include "iso8601.h" + +int main(void) +{ + const char* dateTime = "1997-07-16T19:20:30.45+01:00"; + + struct tm isoDateTime; + int timezoneOffsetMin; + if (ParseIso8601Datetime(dateTime, &isoDateTime, &timezoneOffsetMin)) + { + std::cout << "Year: " << isoDateTime.tm_year + 1900 << "\n"; + std::cout << "Month: " << isoDateTime.tm_mon + 1 << "\n"; + std::cout << "Day: " << isoDateTime.tm_mday << "\n"; + std::cout << "Hour: " << isoDateTime.tm_hour << "\n"; + std::cout << "Minute: " << isoDateTime.tm_min << "\n"; + std::cout << "Second: " << isoDateTime.tm_sec << "\n"; + std::cout << "Timezone offset: " << timezoneOffsetMin << "\n"; + } + else + { + std::cout << "Could not parse datetime " << dateTime << "\n"; + } + return EXIT_SUCCESS; +} diff --git a/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt b/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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/iso8601lib/all/test_v1_package/conanfile.py b/recipes/iso8601lib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/iso8601lib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/iso8601lib/config.yml b/recipes/iso8601lib/config.yml new file mode 100644 index 0000000000000..0d07bd41f0619 --- /dev/null +++ b/recipes/iso8601lib/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230123": + folder: all From 9a0840a93d06fe57360da1a3280339951822d1c4 Mon Sep 17 00:00:00 2001 From: David Aceituno Date: Fri, 27 Jan 2023 06:46:38 +0100 Subject: [PATCH 09/11] (#15077) Update to h5pp/1.11.0 * Update to h5pp/1.11.0 * use hdf5/1.12.1 for h5pp/1.10.0 and older * made changes suggested by the conan v2 migration linter * made more changes suggested by the conan v2 migration linter * Update recipes/h5pp/all/conanfile.py Co-authored-by: Jordan Williams * Update recipes/h5pp/all/conanfile.py Co-authored-by: Jordan Williams * Dummy commit to re-run the pr checks Co-authored-by: Jordan Williams --- recipes/h5pp/all/conandata.yml | 3 +++ recipes/h5pp/all/conanfile.py | 38 ++++++++++++++++++++-------------- recipes/h5pp/config.yml | 2 ++ 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/recipes/h5pp/all/conandata.yml b/recipes/h5pp/all/conandata.yml index 2aa0b94704f12..dd08f4511c3dd 100644 --- a/recipes/h5pp/all/conandata.yml +++ b/recipes/h5pp/all/conandata.yml @@ -17,3 +17,6 @@ sources: "1.10.0": sha256: 27a3e42ed02d8d9341229d58a517134753e1ea46dab4c40d01bb309098c32f13 url: https://github.com/DavidAce/h5pp/archive/v1.10.0.tar.gz + "1.11.0": + sha256: 1c4171275eb50a26ed9da8055397f03a726896c4c49ad0380b16dcb13574ecff + url: https://github.com/DavidAce/h5pp/archive/v1.11.0.tar.gz diff --git a/recipes/h5pp/all/conanfile.py b/recipes/h5pp/all/conanfile.py index 7179031345df5..ac11c70a03a29 100644 --- a/recipes/h5pp/all/conanfile.py +++ b/recipes/h5pp/all/conanfile.py @@ -1,10 +1,12 @@ +from conan import ConanFile from conan.tools.microsoft import is_msvc -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conan.tools.files import get +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.45.0" - +required_conan_version = ">=1.50.0" class H5ppConan(ConanFile): name = "h5pp" @@ -39,7 +41,7 @@ def _compilers_minimum_version(self): } def config_options(self): - if tools.Version(self.version) < "1.10.0": + if Version(self.version) < "1.10.0": # These dependencies are always required before h5pp 1.10.0: # * h5pp < 1.10.0 includes any version of headers indiscriminately (e.g. system headers), # and can't tell if the the corresponding library will be linked. This makes the, @@ -50,32 +52,36 @@ def config_options(self): del self.options.with_spdlog def requirements(self): - self.requires("hdf5/1.12.1") - if tools.Version(self.version) < "1.10.0" or self.options.get_safe('with_eigen'): + if Version(self.version) < "1.10.0": + self.requires("hdf5/1.12.1") + else: + self.requires("hdf5/1.13.1") + + if Version(self.version) < "1.10.0" or self.options.get_safe('with_eigen'): self.requires("eigen/3.4.0") - if tools.Version(self.version) < "1.10.0" or self.options.get_safe('with_spdlog'): - self.requires("spdlog/1.10.0") + if Version(self.version) < "1.10.0" or self.options.get_safe('with_spdlog'): + self.requires("spdlog/1.11.0") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, 17) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: + if Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("h5pp requires C++17, which your compiler does not support.") else: self.output.warn("h5pp requires C++17. Your compiler is unknown. Assuming it supports C++17.") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self,**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def package(self): self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - if tools.Version(self.version) < "1.9.0": + if Version(self.version) < "1.9.0": includedir = os.path.join(self._source_subfolder, "h5pp", "include") else: includedir = os.path.join(self._source_subfolder, "include") @@ -89,7 +95,7 @@ def package_info(self): self.cpp_info.components["h5pp_flags"].set_property("cmake_target_name", "h5pp::flags") self.cpp_info.components["h5pp_deps"].requires = ["hdf5::hdf5"] - if tools.Version(self.version) >= "1.10.0": + if Version(self.version) >= "1.10.0": if self.options.with_eigen: self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen") self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_EIGEN3") @@ -101,7 +107,7 @@ def package_info(self): self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen") self.cpp_info.components["h5pp_deps"].requires.append("spdlog::spdlog") - if (self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "9") or \ + if (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9") or \ (self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") in ["libstdc++", "libstdc++11"]): self.cpp_info.components["h5pp_flags"].system_libs = ["stdc++fs"] if is_msvc(self): diff --git a/recipes/h5pp/config.yml b/recipes/h5pp/config.yml index a0e0d5427545b..2a1bf3aae7487 100644 --- a/recipes/h5pp/config.yml +++ b/recipes/h5pp/config.yml @@ -11,3 +11,5 @@ versions: folder: "all" "1.10.0": folder: "all" + "1.11.0": + folder: "all" From 81f6f1c341027000c21a802d83bd687eda6760ba Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 27 Jan 2023 15:06:53 +0900 Subject: [PATCH 10/11] (#14981) uwebsockets: add version 20.36.0 * uwebsockets: add version 20.33.0 * update 20.36.0 --- recipes/uwebsockets/all/conandata.yml | 3 +++ recipes/uwebsockets/all/conanfile.py | 4 +++- recipes/uwebsockets/config.yml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/uwebsockets/all/conandata.yml b/recipes/uwebsockets/all/conandata.yml index fd940478e8566..d0d6f814547b2 100644 --- a/recipes/uwebsockets/all/conandata.yml +++ b/recipes/uwebsockets/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20.36.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.36.0.tar.gz" + sha256: "cda266f7ed6abe67ef3cae6e223a580fe5091db9156c1f4123ee328ae21511c9" "20.17.0": url: "https://github.com/uNetworking/uWebSockets/archive/v20.17.0.tar.gz" sha256: "62027b0b847563bcc65a760045dc4233328229fc551f97fe5814e518e272141c" diff --git a/recipes/uwebsockets/all/conanfile.py b/recipes/uwebsockets/all/conanfile.py index 4f786027696a4..13c1e737124b8 100644 --- a/recipes/uwebsockets/all/conanfile.py +++ b/recipes/uwebsockets/all/conanfile.py @@ -54,7 +54,9 @@ def requirements(self): if self.options.get_safe("with_libdeflate"): self.requires("libdeflate/1.14") - if Version(self.version) >= "20.15.0": + if Version(self.version) > "20.17.0": + self.requires("usockets/0.8.5") + elif Version(self.version) >= "20.15.0": self.requires("usockets/0.8.2") elif Version(self.version) >= "19.0.0": self.requires("usockets/0.8.1") diff --git a/recipes/uwebsockets/config.yml b/recipes/uwebsockets/config.yml index f1e4d88dc8fdf..be1e8815a9c32 100644 --- a/recipes/uwebsockets/config.yml +++ b/recipes/uwebsockets/config.yml @@ -1,4 +1,6 @@ versions: + "20.36.0": + folder: all "20.17.0": folder: all "20.14.0": From ec7a07ad033c72488b20f505f534d6c4a8482d1b Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 27 Jan 2023 18:06:57 +0900 Subject: [PATCH 11/11] (#12152) libxls: add recipe * libxls: add recipe * fix KB of cci * skip pylint in test_V1_package * set HAVE_XLOCALE * link libiconv * don't link iconv on macos * link iconv in CMakeLists.txt * fix package name * support ssize_t in MSVC * follow conan v2 * fix self.options.shared wrong usage * replace restrict for msvc 15 * use autotools Signed-off-by: Uilian Ries * not autoreconf Signed-off-by: Uilian Ries * Windows build Signed-off-by: Uilian Ries * license Signed-off-by: Uilian Ries * update conan 1.52.0 * fix rpl_malloc undefined eerror * drop support windows * removed unused import Co-authored-by: Chris Mc * remove replace_in_file Co-authored-by: Chris Mc * remove unused import Co-authored-by: Chris Mc * improve validation error message Co-authored-by: Chris Mc Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/libxls/all/conandata.yml | 9 ++ recipes/libxls/all/conanfile.py | 113 ++++++++++++++++++ .../patches/1.6.2-0001-fix-ssize_t-msvc.patch | 14 +++ .../libxls/all/test_package/CMakeLists.txt | 7 ++ recipes/libxls/all/test_package/conanfile.py | 26 ++++ .../libxls/all/test_package/test_package.c | 12 ++ .../libxls/all/test_v1_package/CMakeLists.txt | 8 ++ .../libxls/all/test_v1_package/conanfile.py | 16 +++ recipes/libxls/config.yml | 3 + 9 files changed, 208 insertions(+) create mode 100644 recipes/libxls/all/conandata.yml create mode 100644 recipes/libxls/all/conanfile.py create mode 100644 recipes/libxls/all/patches/1.6.2-0001-fix-ssize_t-msvc.patch create mode 100644 recipes/libxls/all/test_package/CMakeLists.txt create mode 100644 recipes/libxls/all/test_package/conanfile.py create mode 100644 recipes/libxls/all/test_package/test_package.c create mode 100644 recipes/libxls/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libxls/all/test_v1_package/conanfile.py create mode 100644 recipes/libxls/config.yml diff --git a/recipes/libxls/all/conandata.yml b/recipes/libxls/all/conandata.yml new file mode 100644 index 0000000000000..73215812f5900 --- /dev/null +++ b/recipes/libxls/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.6.2": + url: "https://github.com/libxls/libxls/releases/download/v1.6.2/libxls-1.6.2.tar.gz" + sha256: "5dacc34d94bf2115926c80c6fb69e4e7bd2ed6403d51cff49041a94172f5e371" +patches: + "1.6.2": + - patch_file: "patches/1.6.2-0001-fix-ssize_t-msvc.patch" + patch_description: "Solve ssize_t when building on Windows" + patch_type: "conan" diff --git a/recipes/libxls/all/conanfile.py b/recipes/libxls/all/conanfile.py new file mode 100644 index 0000000000000..007beb8962389 --- /dev/null +++ b/recipes/libxls/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, rmdir, copy, save, get, rm +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building + +import os + +required_conan_version = ">=1.53.0" + +class LibxlsConan(ConanFile): + name = "libxls" + description = "a C library which can read Excel (xls) files." + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libxls/libxls/" + topics = ("excel", "xls") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_cli": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_cli": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder='src') + + def requirements(self): + if not is_apple_os(self): + self.requires("libiconv/1.17") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Windows (yet). Contributions are always welcomed") + + def build_requirements(self): + if self.settings.os == "Windows": + self.tool_requires("msys2/cci.latest") + self.win_bash = True + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + toolchain = AutotoolsToolchain(self) + if cross_building(self): + toolchain.configure_args.append("ac_cv_func_malloc_0_nonnull=yes") + toolchain.configure_args.append("ac_cv_func_realloc_0_nonnull=yes") + toolchain.generate() + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + config_h_content = """ +#define HAVE_ICONV 1 +#define ICONV_CONST +#define PACKAGE_VERSION "{}" +""".format(self.version) + if self.settings.os == "Macos": + config_h_content += "#define HAVE_XLOCALE_H 1\n" + save(self, os.path.join(self.source_folder, "include", "config.h"), config_h_content) + apply_conandata_patches(self) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["xlsreader"] + + if is_apple_os(self): + self.cpp_info.system_libs.append("iconv") + + self.cpp_info.set_property("cmake_file_name", "libxls") + self.cpp_info.set_property("cmake_target_name", "libxls::libxls") + self.cpp_info.set_property("pkg_config_name", "libxls") + + if not is_apple_os(self): + self.cpp_info.requires.append("libiconv::libiconv") + + # TODO: Remove in Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "libxls" + self.cpp_info.names["cmake_find_package_multi"] = "libxls" diff --git a/recipes/libxls/all/patches/1.6.2-0001-fix-ssize_t-msvc.patch b/recipes/libxls/all/patches/1.6.2-0001-fix-ssize_t-msvc.patch new file mode 100644 index 0000000000000..028e50681cc68 --- /dev/null +++ b/recipes/libxls/all/patches/1.6.2-0001-fix-ssize_t-msvc.patch @@ -0,0 +1,14 @@ +diff --git a/include/libxls/xlstypes.h b/include/libxls/xlstypes.h +index 52da772..3efba21 100644 +--- a/include/libxls/xlstypes.h ++++ b/include/libxls/xlstypes.h +@@ -53,4 +53,9 @@ typedef unsigned __int64 unsigned64_t; + typedef uint64_t unsigned64_t; + #endif + ++#ifdef _MSC_VER ++#include ++typedef SSIZE_T ssize_t; ++#endif ++ + #endif diff --git a/recipes/libxls/all/test_package/CMakeLists.txt b/recipes/libxls/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a4b50bc78de77 --- /dev/null +++ b/recipes/libxls/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libxls REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libxls::libxls) diff --git a/recipes/libxls/all/test_package/conanfile.py b/recipes/libxls/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/libxls/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libxls/all/test_package/test_package.c b/recipes/libxls/all/test_package/test_package.c new file mode 100644 index 0000000000000..09d94a0eaa57d --- /dev/null +++ b/recipes/libxls/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include "xls.h" + +int main() { + struct xlsWorkBook* wb; + struct xlsWorkSheet* ws; + + printf("libxls version : %s\n", xls_getVersion()); + + return 0; +} diff --git a/recipes/libxls/all/test_v1_package/CMakeLists.txt b/recipes/libxls/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libxls/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +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/libxls/all/test_v1_package/conanfile.py b/recipes/libxls/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/libxls/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +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/libxls/config.yml b/recipes/libxls/config.yml new file mode 100644 index 0000000000000..9b1f6cb9f3642 --- /dev/null +++ b/recipes/libxls/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.2": + folder: "all"