From 2065ce0aae808914c04562b342cbff2162b7c06b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:57:19 +0100 Subject: [PATCH 01/17] (#20260) openssl: fix build with non-cl like compiler on Windows * fix logic of zlib detection for Windows when compiler is not a cl like compiler * better conversion of paths * fix call to perl with configdata.pm for mingw * typo * also adjust path of DESTDIR * add package_type --- recipes/openssl/1.x.x/conanfile.py | 11 ++-- recipes/openssl/3.x.x/conanfile.py | 93 +++++++++++++++--------------- 2 files changed, 51 insertions(+), 53 deletions(-) diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index 32cb51fff1cec5..073a01dcd3cdc1 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -95,8 +95,9 @@ class OpenSSLConan(ConanFile): default_options["openssldir"] = None @property - def _is_clangcl(self): - return self.settings.compiler == "clang" and self.settings.os == "Windows" + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") @property def _is_mingw(self): @@ -104,7 +105,7 @@ def _is_mingw(self): @property def _use_nmake(self): - return self._is_clangcl or is_msvc(self) + return self._is_clang_cl or is_msvc(self) @property def _settings_build(self): @@ -374,7 +375,7 @@ def _configure_args(self): if self.settings.os == "Neutrino": args.append("no-asm -lsocket -latomic") - if self._is_clangcl: + if self._is_clang_cl: # #error is not yet supported when compiling as C, but this is planned for a future release. args.append("-D__STDC_NO_ATOMICS__") @@ -500,7 +501,7 @@ def build(self): with self._make_context(): with chdir(self, self.source_folder): # workaround for clang-cl not producing .pdb files - if self._is_clangcl: + if self._is_clang_cl: save(self, "ossl_static.pdb", "") args = " ".join(self._configure_args) self.output.info(self._configure_args) diff --git a/recipes/openssl/3.x.x/conanfile.py b/recipes/openssl/3.x.x/conanfile.py index c9d0f55fd43887..82d58e0af07f6c 100644 --- a/recipes/openssl/3.x.x/conanfile.py +++ b/recipes/openssl/3.x.x/conanfile.py @@ -16,12 +16,13 @@ class OpenSSLConan(ConanFile): name = "openssl" - settings = "os", "arch", "compiler", "build_type" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/openssl/openssl" license = "Apache-2.0" topics = ("ssl", "tls", "encryption", "security") description = "A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -90,6 +91,19 @@ class OpenSSLConan(ConanFile): default_options["no_md2"] = True default_options["openssldir"] = None + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _use_nmake(self): + return self._is_clang_cl or is_msvc(self) + @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -112,10 +126,21 @@ def configure(self): 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 self.options.no_zlib: self.requires("zlib/[>=1.2.11 <2]") + def validate(self): + if self.settings.os == "Emscripten": + if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio)): + raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio}=True") + + if self.settings.os == "iOS" and self.options.shared: + raise ConanInvalidConfiguration("OpenSSL 3 does not support building shared libraries for iOS") + def build_requirements(self): if self._settings_build.os == "Windows": if not self.options.no_asm: @@ -127,32 +152,8 @@ def build_requirements(self): if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") - def validate(self): - if self.settings.os == "Emscripten": - if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio)): - raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio}=True") - - if self.settings.os == "iOS" and self.options.shared: - raise ConanInvalidConfiguration("OpenSSL 3 does not support building shared libraries for iOS") - - def layout(self): - basic_layout(self, src_folder="src") - - @property - def _is_clangcl(self): - return self.settings.compiler == "clang" and self.settings.os == "Windows" - - @property - def _is_mingw(self): - return self.settings.os == "Windows" and self.settings.compiler == "gcc" - - @property - def _use_nmake(self): - return self._is_clangcl or is_msvc(self) - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) @property def _target(self): @@ -339,6 +340,11 @@ def _get_default_openssl_dir(self): return "/etc/ssl" return os.path.join(self.package_folder, "res") + def _adjust_path(self, path): + if self._use_nmake: + return path.replace("\\", "/") + return unix_path(self, path) + @property def _configure_args(self): openssldir = self.options.openssldir or self._get_default_openssl_dir() @@ -375,17 +381,13 @@ def _configure_args(self): args.append("no-asm -lsocket -latomic") if not self.options.no_zlib: - zlib_info = self.dependencies["zlib"].cpp_info.aggregated_components() - include_path = zlib_info.includedirs[0] - if self.settings.os == "Windows": - lib_path = "%s/%s.lib" % (zlib_info.libdirs[0], zlib_info.libs[0]) + zlib_cpp_info = self.dependencies["zlib"].cpp_info.aggregated_components() + include_path = self._adjust_path(zlib_cpp_info.includedirs[0]) + if self._use_nmake: + lib_path = self._adjust_path(os.path.join(zlib_cpp_info.libdirs[0], f"{zlib_cpp_info.libs[0]}.lib")) else: - # Just path, linux will find the right file - lib_path = zlib_info.libdirs[0] - if self._settings_build.os == "Windows": - # clang-cl doesn't like backslashes in #define CFLAGS (builldinf.h -> cversion.c) - include_path = include_path.replace("\\", "/") - lib_path = lib_path.replace("\\", "/") + # Just path, GNU like compilers will find the right file + lib_path = self._adjust_path(zlib_cpp_info.libdirs[0]) if self.dependencies["zlib"].options.shared: args.append("zlib-dynamic") @@ -393,8 +395,8 @@ def _configure_args(self): args.append("zlib") args.extend([ - '--with-zlib-include="%s"' % include_path, - '--with-zlib-lib="%s"' % lib_path + f'--with-zlib-include="{include_path}"', + f'--with-zlib-lib="{lib_path}"', ]) for option_name in self.default_options.keys(): @@ -402,7 +404,7 @@ def _configure_args(self): self.output.info(f"Activated option: {option_name}") args.append(option_name.replace("_", "-")) return args - + def generate(self): tc = AutotoolsToolchain(self) env = tc.environment() @@ -439,9 +441,6 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): defines = " ".join(defines) defines = 'defines => add("%s"),' % defines if defines else "" targets = "my %targets" - includes = "" - if self.settings.os == "Windows": - includes = includes.replace("\\", "/") # OpenSSL doesn't like backslashes if self._asm_target: ancestor = '[ "%s", asm("%s") ]' % (self._ancestor_target, self._asm_target) @@ -482,8 +481,7 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): def _run_make(self, targets=None, parallel=True, install=False): command = [self._make_program] if install: - package_folder = self.package_folder.replace("\\", "/") # needed for MinGW build - command.append(f"DESTDIR={package_folder}") + command.append(f"DESTDIR={self._adjust_path(self.package_folder)}") if targets: command.extend(targets) if not self._use_nmake: @@ -499,7 +497,7 @@ def _perl(self): def _make(self): with chdir(self, self.source_folder): # workaround for clang-cl not producing .pdb files - if self._is_clangcl: + if self._is_clang_cl: save(self, "ossl_static.pdb", "") args = " ".join(self._configure_args) @@ -519,8 +517,8 @@ def _make_install(self): def build(self): self._make() - source_folder = self.source_folder.replace("\\", "/") # Necessary for MinGW build - self.run(f"{self._perl} {source_folder}/configdata.pm --dump") + configdata_pm = self._adjust_path(os.path.join(self.source_folder, "configdata.pm")) + self.run(f"{self._perl} {configdata_pm} --dump") @property def _make_program(self): @@ -677,4 +675,3 @@ def package_info(self): # For legacy 1.x downstream consumers, remove once recipe is 2.0 only: self.env_info.OPENSSL_MODULES = openssl_modules_dir - From e80938c310da42509093c94694df411d9d42f800 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 6 Nov 2023 16:50:07 +0200 Subject: [PATCH 02/17] (#18353) tcsbank-uconfig: migrate to Conan v2 --- recipes/tcsbank-uconfig/all/conandata.yml | 6 +- recipes/tcsbank-uconfig/all/conanfile.py | 97 +++++++++++-------- .../all/test_package/CMakeLists.txt | 7 +- .../all/test_package/conanfile.py | 22 +++-- .../all/test_package/test_package.cpp | 10 +- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 ++++ recipes/tcsbank-uconfig/config.yml | 4 +- 8 files changed, 110 insertions(+), 62 deletions(-) create mode 100644 recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tcsbank-uconfig/all/test_v1_package/conanfile.py diff --git a/recipes/tcsbank-uconfig/all/conandata.yml b/recipes/tcsbank-uconfig/all/conandata.yml index c292824b18361d..2bda12ab987588 100644 --- a/recipes/tcsbank-uconfig/all/conandata.yml +++ b/recipes/tcsbank-uconfig/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "2.0.3": - url: "https://github.com/TinkoffCreditSystems/uconfig/archive/refs/tags/v2.0.3.tar.gz" - sha256: "a1f6278ebd6c0c7ba391651ab6f0aceeb9cb77dc6936d45dc0e6fee3f27dfcbf" "2.1.0": url: "https://github.com/TinkoffCreditSystems/uconfig/archive/refs/tags/v2.1.0.tar.gz" sha256: "1a7a8ab97b6de7fa039031caa83d8ab889d874822b06c920af3e8ddd794ab9c6" + "2.0.3": + url: "https://github.com/TinkoffCreditSystems/uconfig/archive/refs/tags/v2.0.3.tar.gz" + sha256: "a1f6278ebd6c0c7ba391651ab6f0aceeb9cb77dc6936d45dc0e6fee3f27dfcbf" diff --git a/recipes/tcsbank-uconfig/all/conanfile.py b/recipes/tcsbank-uconfig/all/conanfile.py index cf5ea147a4f0e6..a4005d4ad03ba3 100644 --- a/recipes/tcsbank-uconfig/all/conanfile.py +++ b/recipes/tcsbank-uconfig/all/conanfile.py @@ -1,20 +1,24 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration - import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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.scm import Version + +required_conan_version = ">=1.52.0" class TCSBankUconfigConan(ConanFile): name = "tcsbank-uconfig" description = "Lightweight, header-only, C++17 configuration library" - topics = ("conan", "configuration", "env", "json") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/TinkoffCreditSystems/uconfig" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tinkoff/uconfig" + topics = ("configuration", "env", "json", "header-only") - generators = "cmake", "cmake_find_package_multi" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_rapidjson": [True, False], @@ -22,59 +26,70 @@ class TCSBankUconfigConan(ConanFile): default_options = { "with_rapidjson": True, } + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7.3", + "clang": "6.0", + "apple-clang": "10.0" + } + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_rapidjson: - self.requires("rapidjson/1.1.0") + self.requires("rapidjson/cci.20220822") + + def package_id(self): + self.info.clear() def validate(self): compiler = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) + compiler_version = Version(self.settings.compiler.version) - min_req_cppstd = "17" if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, min_req_cppstd) - else: - self.output.warn("%s recipe lacks information about the %s compiler" - " standard version support." % (self.name, compiler)) + check_min_cppstd(self, self._min_cppstd) - minimal_version = { - "Visual Studio": "16", - "gcc": "7.3", - "clang": "6.0", - "apple-clang": "10.0", - } - # Exclude not supported compilers - if compiler not in minimal_version: - self.output.info("%s requires a compiler that supports at least C++%s" % (self.name, min_req_cppstd)) - return - if compiler_version < minimal_version[compiler]: + if compiler_version < self._compilers_minimum_version[compiler]: raise ConanInvalidConfiguration( - "%s requires a compiler that supports at least C++%s. %s %s is not supported." % - (self.name, min_req_cppstd, compiler, compiler_version)) + f"{self.name} requires a compiler that supports at least C++{self._min_cppstd}. " + f"{compiler} {compiler_version} is not supported." + ) 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 package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.ipp", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*.ipp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.names["pkg_config"] = "uconfig" - self.cpp_info.names["cmake_find_package"] = "uconfig" - self.cpp_info.names["cmake_find_package_multi"] = "uconfig" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "uconfig") + self.cpp_info.set_property("cmake_target_name", "uconfig::uconfig") + self.cpp_info.set_property("pkg_config_name", "uconfig") + if self.options.with_rapidjson: self.cpp_info.defines = ["RAPIDJSON_HAS_STDSTRING=1"] - def package_id(self): - self.info.header_only() + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "uconfig" + self.cpp_info.names["cmake_find_package_multi"] = "uconfig" diff --git a/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt b/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt index 6b713d97dfd9dd..5f357d4371c773 100644 --- a/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt +++ b/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(uconfig CONFIG REQUIRED) diff --git a/recipes/tcsbank-uconfig/all/test_package/conanfile.py b/recipes/tcsbank-uconfig/all/test_package/conanfile.py index 49a3a66ea5bad4..e77da04fcdfc58 100644 --- a/recipes/tcsbank-uconfig/all/test_package/conanfile.py +++ b/recipes/tcsbank-uconfig/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +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", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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) @@ -12,6 +21,7 @@ def build(self): 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) + if can_run(self): + os.environ["APP_VARIABLE"] = "123456" + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tcsbank-uconfig/all/test_package/test_package.cpp b/recipes/tcsbank-uconfig/all/test_package/test_package.cpp index fb3f52a80922c5..c69d651b882578 100644 --- a/recipes/tcsbank-uconfig/all/test_package/test_package.cpp +++ b/recipes/tcsbank-uconfig/all/test_package/test_package.cpp @@ -1,7 +1,9 @@ -#include #include #include +#include +#include + struct AppConfig: public uconfig::Config { uconfig::Variable variable; @@ -15,8 +17,6 @@ struct AppConfig: public uconfig::Config }; int main() { - setenv("APP_VARIABLE", "123456", 1); - AppConfig app_config; uconfig::EnvFormat formatter; @@ -24,8 +24,8 @@ int main() { std::map config_map; app_config.Emit(formatter, "APP", &config_map); - for (const auto& [name, vlaue] : config_map) { - std::cout << name << "=" << vlaue << std::endl; + for (const auto& [name, value] : config_map) { + std::cout << name << "=" << value << std::endl; } return 0; } diff --git a/recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt b/recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +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/tcsbank-uconfig/all/test_v1_package/conanfile.py b/recipes/tcsbank-uconfig/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6bbeeb230e6b04 --- /dev/null +++ b/recipes/tcsbank-uconfig/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +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): + os.environ["APP_VARIABLE"] = "123456" + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tcsbank-uconfig/config.yml b/recipes/tcsbank-uconfig/config.yml index 14f04caec446d9..d149ea7c80af72 100644 --- a/recipes/tcsbank-uconfig/config.yml +++ b/recipes/tcsbank-uconfig/config.yml @@ -1,5 +1,5 @@ versions: - "2.0.3": - folder: all "2.1.0": folder: all + "2.0.3": + folder: all From e6b9f8058d692dbdbbb3d5e6a1d5e6b101f4ad87 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 6 Nov 2023 17:34:49 +0200 Subject: [PATCH 03/17] (#20315) dlib: add version 19.24.2 * dlib: add version 19.24.2 Generated and committed by [Conan Center Bot](https://github.com/qchateau/conan-center-bot) Find more updatable recipes in the [GitHub Pages](https://qchateau.github.io/conan-center-bot/) * dlib: bump sqlite3 * dlib: v19.24.2 requires C++14 https://github.com/davisking/dlib/commit/29288e5d895b21f5508c15294f1303b367534a63 * dlib: update C++ standard in test_package --------- Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/dlib/all/conandata.yml | 3 ++ recipes/dlib/all/conanfile.py | 29 ++++++++++++++++++-- recipes/dlib/all/test_package/CMakeLists.txt | 7 ++++- recipes/dlib/config.yml | 2 ++ 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/recipes/dlib/all/conandata.yml b/recipes/dlib/all/conandata.yml index 8896193f464de3..845293d979b051 100644 --- a/recipes/dlib/all/conandata.yml +++ b/recipes/dlib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "19.24.2": + url: "https://github.com/davisking/dlib/archive/v19.24.2.tar.gz" + sha256: "0f5c7e3de6316a513635052c5f0a16a84e1cef26a7d233bf00c21348462b6d6f" "19.24": url: "https://github.com/davisking/dlib/archive/refs/tags/v19.24.tar.gz" sha256: "3cc42e84c7b1bb926c6451a21ad1595f56c5b10be3a1d7aa2f3c716a25b7ae39" diff --git a/recipes/dlib/all/conanfile.py b/recipes/dlib/all/conanfile.py index dd3241419e6d17..39ff8fcf414f80 100644 --- a/recipes/dlib/all/conanfile.py +++ b/recipes/dlib/all/conanfile.py @@ -47,6 +47,24 @@ class DlibConan(ConanFile): "with_openblas": True, } + @property + def _min_cppstd(self): + if Version(self.version) < "19.24.2": + return 11 + return 14 + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "19.24.2": + return {} + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "6", + "clang": "5", + "apple-clang": "10", + } + @property def _has_with_webp_option(self): return Version(self.version) >= "19.24" @@ -78,13 +96,18 @@ def requirements(self): if self.options.get_safe("with_webp"): self.requires("libwebp/1.3.2") if self.options.with_sqlite3: - self.requires("sqlite3/3.43.1") + self.requires("sqlite3/3.43.2") if self.options.with_openblas: self.requires("openblas/0.3.20") def validate(self): - if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, "11") + if self.settings.compiler.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." + ) if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} does not support shared on Windows. See https://github.com/davisking/dlib/issues/1483.") diff --git a/recipes/dlib/all/test_package/CMakeLists.txt b/recipes/dlib/all/test_package/CMakeLists.txt index 9ce5dccc129836..a2e5f6c5bb3a5a 100644 --- a/recipes/dlib/all/test_package/CMakeLists.txt +++ b/recipes/dlib/all/test_package/CMakeLists.txt @@ -5,4 +5,9 @@ find_package(dlib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE dlib::dlib) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(dlib_VERSION VERSION_GREATER_EQUAL 19.24.2) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/dlib/config.yml b/recipes/dlib/config.yml index 4d03ed4f4b36da..8c827a6db181e4 100644 --- a/recipes/dlib/config.yml +++ b/recipes/dlib/config.yml @@ -1,4 +1,6 @@ versions: + "19.24.2": + folder: all "19.24": folder: all "19.23": From 1ccd56d73b08647ca753da69fcc7172d578cba11 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 6 Nov 2023 12:04:11 -0600 Subject: [PATCH 04/17] (#20856) Minor clean up of template packages * Bump Meson version * Use LANGUAGES keyword in CMake project commands * Alphabetize self.settings.rm_safe in configure * Remove keywords for pattern, src, and dst from calls to copy This keeps things consistent and simple. * Use _compilers_minimum_version for MSVC in CMake package This makes it consistent with other template packages. * Alphabetize compilers in _compilers_minimum_version * Use _min_cppstd in Autoools package for consistency * Add _compilers_minimum_version check to Autotools package * Alphabetize imports * Update docs/package_templates/autotools_package/all/conanfile.py Co-authored-by: Uilian Ries * Make min cppstd consistent with compiler minimum version --------- Co-authored-by: Uilian Ries --- .../autotools_package/all/conanfile.py | 29 +++++++++++++++--- .../cmake_package/all/conanfile.py | 30 +++++++++---------- .../all/test_package/CMakeLists.txt | 4 +-- .../header_only/all/conanfile.py | 18 +++++------ .../meson_package/all/conanfile.py | 4 +-- .../all/test_package/conanfile.py | 2 +- .../msbuild_package/all/conanfile.py | 12 ++++---- .../all/test_package/CMakeLists.txt | 4 +-- .../prebuilt_tool_package/all/conanfile.py | 10 +++---- 9 files changed, 67 insertions(+), 46 deletions(-) diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 0719baa9da7700..0d8464ec8e6f0e 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -4,9 +4,10 @@ from conan.tools.build import check_min_cppstd, cross_building from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir -from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version import os @@ -41,6 +42,21 @@ class PackageConan(ConanFile): "with_foobar": True, } + @property + def _min_cppstd(self): + return 14 + + # in case the project requires C++14/17/20/... the minimum compiler version should be listed + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -58,8 +74,8 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") # for plain C projects only - self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): # src_folder must use the same source folder name the project @@ -74,7 +90,12 @@ def requirements(self): def validate(self): # validate the minimum cpp standard supported. Only for C++ projects if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + 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." + ) if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") @@ -155,7 +176,7 @@ def build(self): autotools.make() def package(self): - copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) autotools.install() diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index 47f9a403b5cf1b..9635abc398ca9a 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file from conan.tools.build import check_min_cppstd -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os @@ -40,15 +40,17 @@ class PackageConan(ConanFile): @property def _min_cppstd(self): - return 17 + return 14 # in case the project requires C++14/17/20/... the minimum compiler version should be listed @property def _compilers_minimum_version(self): return { - "gcc": "7", - "clang": "7", "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", } # no exports_sources attribute, but export_sources(self) method instead @@ -64,8 +66,8 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") # for plain C projects only - self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): # src_folder must use the same source folder name the project @@ -79,13 +81,11 @@ def validate(self): # validate the minimum cpp standard supported. For C++ projects only if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - check_min_vs(self, 191) - if not is_msvc(self): - 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." - ) + 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." + ) # in case it does not work in another configuration, it should validated here too if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") @@ -131,7 +131,7 @@ def build(self): cmake.build() def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() diff --git a/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt index d742678fc6e672..b1b30db795a848 100644 --- a/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package C) # if the project is pure C -# project(test_package CXX) # if the project uses c++ +project(test_package LANGUAGES C) # if the project is pure C +# project(test_package LANGUAGES CXX) # if the project uses c++ find_package(package REQUIRED CONFIG) diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index 6414c6f49c028f..6e443b60249632 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.layout import basic_layout from conan.tools.scm import Version import os @@ -35,11 +35,11 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "Visual Studio": "15", + "apple-clang": "10", + "clang": "7", + "gcc": "7", "msvc": "191", - "gcc": "5", - "clang": "5", - "apple-clang": "5.1", + "Visual Studio": "15", } # Use the export_sources(self) method instead of the exports_sources attribute. @@ -85,12 +85,12 @@ def build(self): # Copy all files to the package folder def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) copy( self, - pattern="*.h", - dst=os.path.join(self.package_folder, "include"), - src=os.path.join(self.source_folder, "include"), + "*.h", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), ) def package_info(self): diff --git a/docs/package_templates/meson_package/all/conanfile.py b/docs/package_templates/meson_package/all/conanfile.py index 1d2b29f90aa8b8..617e18d12f4ad3 100644 --- a/docs/package_templates/meson_package/all/conanfile.py +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -45,7 +45,7 @@ class PackageConan(ConanFile): @property def _min_cppstd(self): - return 17 + return 14 # in case the project requires C++14/17/20/... the minimum compiler version should be listed @property @@ -98,7 +98,7 @@ def validate(self): # if another tool than the compiler or Meson is required to build the project (pkgconf, bison, flex etc) def build_requirements(self): # CCI policy assumes that Meson may not be installed on consumers machine - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.2.3") # pkgconf is largely used by Meson, it should be added in build requirement when there are dependencies if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.0.3") diff --git a/docs/package_templates/meson_package/all/test_package/conanfile.py b/docs/package_templates/meson_package/all/test_package/conanfile.py index 10b1dcc87c7f64..8adddf3b7b73cf 100644 --- a/docs/package_templates/meson_package/all/test_package/conanfile.py +++ b/docs/package_templates/meson_package/all/test_package/conanfile.py @@ -18,7 +18,7 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.2.3") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.0.3") diff --git a/docs/package_templates/msbuild_package/all/conanfile.py b/docs/package_templates/msbuild_package/all/conanfile.py index 5fd9fc9251d3e7..ca164fc1620f84 100644 --- a/docs/package_templates/msbuild_package/all/conanfile.py +++ b/docs/package_templates/msbuild_package/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, MSBuild, MSBuildDeps, MSBuildToolchain +from conan.tools.microsoft import MSBuild, MSBuildDeps, MSBuildToolchain, is_msvc import os @@ -44,8 +44,8 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") # for plain C projects only - self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): basic_layout(self, src_folder="src") @@ -125,10 +125,10 @@ def build(self): msbuild.build(sln="project_2017.sln") def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) - copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) - copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.lib", self.source_folder, os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", self.source_folder, os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.h", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.libs = ["package_lib"] diff --git a/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt b/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt index 15b25667576d63..69086f9b189e8c 100644 --- a/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package C) # if the project is pure C -project(test_package CXX) # if the project uses c++ +project(test_package LANGUAGES C) # if the project is pure C +# project(test_package LANGUAGES CXX) # if the project uses C++ find_package(package REQUIRED CONFIG) diff --git a/docs/package_templates/prebuilt_tool_package/all/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/conanfile.py index 8a52bdeb5c74f9..aa042fd087498c 100644 --- a/docs/package_templates/prebuilt_tool_package/all/conanfile.py +++ b/docs/package_templates/prebuilt_tool_package/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile -from conan.tools.files import get, copy -from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get +from conan.tools.scm import Version import os @@ -48,9 +48,9 @@ def build(self): # copy all needed files to the package folder def package(self): # a license file is always mandatory - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - copy(self, pattern="*.exe", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) - copy(self, pattern="foo", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.exe", self.source_folder, os.path.join(self.package_folder, "bin")) + copy(self, "foo", self.source_folder, os.path.join(self.package_folder, "bin")) def package_info(self): # folders not used for pre-built binaries From c5aabcb07d50ff772df30ca2544c884792371f3f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 6 Nov 2023 21:39:54 +0200 Subject: [PATCH 05/17] (#18668) libdispatch: migrate to Conan v2 * libdispatch: migrate to Conan v2 * libdispatch: use is_apple_os() * libdispatch: fix test_v1_package --- recipes/libdispatch/all/CMakeLists.txt | 7 -- recipes/libdispatch/all/conanfile.py | 87 +++++++++++-------- .../all/test_package/CMakeLists.txt | 7 +- .../libdispatch/all/test_package/conanfile.py | 20 +++-- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 16 ++++ 6 files changed, 92 insertions(+), 53 deletions(-) delete mode 100644 recipes/libdispatch/all/CMakeLists.txt create mode 100644 recipes/libdispatch/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdispatch/all/test_v1_package/conanfile.py diff --git a/recipes/libdispatch/all/CMakeLists.txt b/recipes/libdispatch/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d4..00000000000000 --- a/recipes/libdispatch/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/libdispatch/all/conanfile.py b/recipes/libdispatch/all/conanfile.py index e88fe5b5ab8e0d..e5d4766a026004 100644 --- a/recipes/libdispatch/all/conanfile.py +++ b/recipes/libdispatch/all/conanfile.py @@ -1,66 +1,81 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.32.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, replace_in_file + +required_conan_version = ">=1.53.0" + class LibDispatchConan(ConanFile): name = "libdispatch" - homepage = "https://github.com/apple/swift-corelibs-libdispatch" - description = "Grand Central Dispatch (GCD or libdispatch) provides comprehensive support for concurrent code execution on multicore hardware." - topics = ("conan", "libdispatch", "apple", "GCD", "concurrency") - url = "https://github.com/conan-io/conan-center-index" + description = ( + "Grand Central Dispatch (GCD or libdispatch) provides comprehensive support " + "for concurrent code execution on multicore hardware." + ) license = "Apache-2.0" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - settings = "os", "compiler", "build_type", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/apple/swift-corelibs-libdispatch" + topics = ("apple", "GCD", "concurrency") - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - _cmake = None + 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") + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): if self.settings.compiler != "clang": raise ConanInvalidConfiguration("Clang compiler is required.") - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "swift-corelibs-{}-swift-{}-RELEASE".format(self.name, self.version) - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "cmake", "modules", "DispatchCompilerWarnings.cmake"), + "-Werror", "") def build(self): - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", 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, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - if self.settings.os == "Macos": + if is_apple_os(self): self.cpp_info.libs = ["dispatch"] else: self.cpp_info.libs = ["dispatch", "BlocksRuntime"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "rt"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["shlwapi", "ws2_32", "winmm", "synchronization"] diff --git a/recipes/libdispatch/all/test_package/CMakeLists.txt b/recipes/libdispatch/all/test_package/CMakeLists.txt index d66f5d5a5a432d..3bc47f2c45cd7e 100644 --- a/recipes/libdispatch/all/test_package/CMakeLists.txt +++ b/recipes/libdispatch/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1.2) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(libdispatch REQUIRED) +find_package(libdispatch REQUIRED CONFIG) # TEST_PACKAGE ################################################################# add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) diff --git a/recipes/libdispatch/all/test_package/conanfile.py b/recipes/libdispatch/all/test_package/conanfile.py index 9294e135668952..ef5d7042163ecc 100644 --- a/recipes/libdispatch/all/test_package/conanfile.py +++ b/recipes/libdispatch/all/test_package/conanfile.py @@ -1,10 +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", "compiler", "build_type", "arch" - generators = "cmake_find_package", "cmake" + 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) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin","test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdispatch/all/test_v1_package/CMakeLists.txt b/recipes/libdispatch/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libdispatch/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +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/libdispatch/all/test_v1_package/conanfile.py b/recipes/libdispatch/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..b6f313836cc054 --- /dev/null +++ b/recipes/libdispatch/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) From 0177ef01053100abba097abfef2fcd2e13589a7f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 7 Nov 2023 00:16:35 +0200 Subject: [PATCH 06/17] (#18747) dime: migrate to Conan v2 * dime: migrate to Conan v2 * dime: remove register keyword --- recipes/dime/all/CMakeLists.txt | 7 -- recipes/dime/all/conanfile.py | 100 ++++++++++-------- recipes/dime/all/test_package/CMakeLists.txt | 5 +- recipes/dime/all/test_package/conanfile.py | 22 ++-- .../dime/all/test_v1_package/CMakeLists.txt | 8 ++ recipes/dime/all/test_v1_package/conanfile.py | 17 +++ 6 files changed, 97 insertions(+), 62 deletions(-) delete mode 100644 recipes/dime/all/CMakeLists.txt create mode 100644 recipes/dime/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dime/all/test_v1_package/conanfile.py diff --git a/recipes/dime/all/CMakeLists.txt b/recipes/dime/all/CMakeLists.txt deleted file mode 100644 index 8977c3f43d6f8d..00000000000000 --- a/recipes/dime/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/dime/all/conanfile.py b/recipes/dime/all/conanfile.py index 4c72fb275c2457..a157a6f7cfc1ae 100644 --- a/recipes/dime/all/conanfile.py +++ b/recipes/dime/all/conanfile.py @@ -1,96 +1,106 @@ -from conans import ConanFile, CMake, tools -from conan.tools.microsoft import is_msvc import os -import functools -required_conan_version = ">=1.33.0" +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 copy, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class DimeConan(ConanFile): name = "dime" description = "DXF (Data eXchange Format) file format support library." - topics = ("dxf", "coin3d", "opengl", "graphics") - homepage = "https://github.com/coin3d/dime" - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" - exports_sources = ["CMakeLists.txt"] - generators = "cmake", - settings = "os", "arch", "compiler", "build_type", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/coin3d/dime" + topics = ("dxf", "coin3d", "opengl", "graphics") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False], "shared": [True, False], + "fPIC": [True, False], "fixbig": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, "fixbig": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, "11") 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) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["DIME_BUILD_SHARED_LIBS"] = self.options.shared + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DIME_BUILD_SHARED_LIBS"] = self.options.shared if self.options.fixbig: - cmake.definitions["CMAKE_CXX_FLAGS"] = "-DDIME_FIXBIG" - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.preprocessor_definitions["DIME_FIXBIG"] = "" + # Remove register keyword for C++17 + tc.preprocessor_definitions["register"] = "" + tc.generate() + + def _patch_sources(self): + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + ("configure_file(${CMAKE_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in" + " ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)"), + ("configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in" + " ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)") + ) def build(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "configure_file(${CMAKE_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)", - "configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)") - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", + 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")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.settings.os == "Windows" and is_msvc(self): - tools.remove_files_by_mask(self.package_folder, "*.pdb") + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): libname = "dime" if self.settings.os == "Windows" and is_msvc(self): libname = "{}{}{}{}".format( libname, - tools.Version(self.version).major, + Version(self.version).major, "" if self.options.shared else "s", "d" if self.settings.build_type == "Debug" else "", - ) + ) self.cpp_info.libs = [libname] if self.settings.os == "Windows": - self.cpp_info.cxxflags.append("-DDIME_DLL" if self.options.shared else "-DDIME_NOT_DLL") + self.cpp_info.defines.append("DIME_DLL" if self.options.shared else "DIME_NOT_DLL") if self.options.fixbig: - self.cpp_info.cxxflags.append("-DDIME_FIXBIG") + self.cpp_info.defines.append("DIME_FIXBIG") bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.output.info(f"Appending PATH environment variable: {bindir}") self.env_info.PATH.append(bindir) diff --git a/recipes/dime/all/test_package/CMakeLists.txt b/recipes/dime/all/test_package/CMakeLists.txt index 78a1ddc2ab6be7..419ecb0dafce71 100644 --- a/recipes/dime/all/test_package/CMakeLists.txt +++ b/recipes/dime/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_package(dime CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/dime/all/test_package/conanfile.py b/recipes/dime/all/test_package/conanfile.py index 17d1e9ed261a6c..f8b1e568167750 100644 --- a/recipes/dime/all/test_package/conanfile.py +++ b/recipes/dime/all/test_package/conanfile.py @@ -1,9 +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", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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) @@ -11,7 +21,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") dxf_path = os.path.join(self.source_folder, "testFile_Bug01.dxf") - self.run("{} {}".format(bin_path, dxf_path), run_environment=True) + self.run(f"{bin_path} {dxf_path}", env="conanrun") diff --git a/recipes/dime/all/test_v1_package/CMakeLists.txt b/recipes/dime/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/dime/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +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/dime/all/test_v1_package/conanfile.py b/recipes/dime/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c1e0ae2f456f09 --- /dev/null +++ b/recipes/dime/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") + dxf_path = os.path.join(self.source_folder, os.pardir, "test_package", "testFile_Bug01.dxf") + self.run(f"{bin_path} {dxf_path}", run_environment=True) From 6b1463aed50b76a93a2890421416c779e482a076 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 7 Nov 2023 02:01:47 +0200 Subject: [PATCH 07/17] (#18761) libcoap: migrate to Conan v2 * libcoap: migrate to Conan v2 * libcoap: restore VirtualRunEnv in test_package * libcoap: fix test_v1_package * libcoap: add version 4.3.3 Generated and committed by [Conan Center Bot](https://github.com/qchateau/conan-center-bot) Find more updatable recipes in the [GitHub Pages](https://qchateau.github.io/conan-center-bot/) * libcoap: fix invalid hash --------- Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/libcoap/all/CMakeLists.txt | 7 -- recipes/libcoap/all/conandata.yml | 13 +- recipes/libcoap/all/conanfile.py | 113 +++++++++--------- .../libcoap/all/test_package/CMakeLists.txt | 10 +- recipes/libcoap/all/test_package/conanfile.py | 35 ++++-- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../libcoap/all/test_v1_package/conanfile.py | 20 ++++ recipes/libcoap/config.yml | 9 +- 8 files changed, 123 insertions(+), 92 deletions(-) delete mode 100644 recipes/libcoap/all/CMakeLists.txt create mode 100644 recipes/libcoap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcoap/all/test_v1_package/conanfile.py diff --git a/recipes/libcoap/all/CMakeLists.txt b/recipes/libcoap/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb93..00000000000000 --- a/recipes/libcoap/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/libcoap/all/conandata.yml b/recipes/libcoap/all/conandata.yml index 933f8a2810d533..0cce54484d005b 100644 --- a/recipes/libcoap/all/conandata.yml +++ b/recipes/libcoap/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "cci.20200424": - sha256: 8402bf2dd9979d6d5f823a050cd3533619fe9b21e76be8c69a9b7d8b8ea175ab - url: https://github.com/obgm/libcoap/archive/17957e1e687c2218b7752a8a959eac36dbf5cb62.zip + "4.3.3": + url: "https://github.com/obgm/libcoap/archive/v4.3.3.tar.gz" + sha256: "3df6e1a51e42ef8fd45f16276505a47ed32aef150d348d60f251a0b470dda379" "4.3.0": - url: https://github.com/obgm/libcoap/archive/refs/tags/v4.3.0.tar.gz - sha256: 1a195adacd6188d3b71c476e7b21706fef7f3663ab1fb138652e8da49a9ec556 + url: "https://github.com/obgm/libcoap/archive/refs/tags/v4.3.0.tar.gz" + sha256: "1a195adacd6188d3b71c476e7b21706fef7f3663ab1fb138652e8da49a9ec556" + "cci.20200424": + url: "https://github.com/obgm/libcoap/archive/17957e1e687c2218b7752a8a959eac36dbf5cb62.zip" + sha256: "8402bf2dd9979d6d5f823a050cd3533619fe9b21e76be8c69a9b7d8b8ea175ab" diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 016cb1a3f6f02d..73ba749ccb3bfd 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -1,17 +1,24 @@ import os -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir + +required_conan_version = ">=1.53.0" class LibCoapConan(ConanFile): name = "libcoap" + description = "A CoAP (RFC 7252) implementation in C" license = "BSD-2-Clause" - homepage = "https://github.com/obgm/libcoap" url = "https://github.com/conan-io/conan-center-index" - description = """A CoAP (RFC 7252) implementation in C""" - topics = ("coap") - exports_sources = "CMakeLists.txt" - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/obgm/libcoap" + topics = "coap" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -24,86 +31,78 @@ class LibCoapConan(ConanFile): "with_epoll": False, "dtls_backend": "openssl", } - generators = "cmake", "cmake_find_package" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def requirements(self): - if self.options.dtls_backend == "openssl": - self.requires("openssl/1.1.1q") - elif self.options.dtls_backend == "mbedtls": - self.requires("mbedtls/2.25.0") - elif self.options.dtls_backend == "gnutls": - raise ConanInvalidConfiguration("gnu tls not available yet") - elif self.options.dtls_backend == "tinydtls": - raise ConanInvalidConfiguration("tinydtls not available yet") def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.settings.os in ("Windows", "Macos"): + if self.settings.os == "Windows" or is_apple_os(self): raise ConanInvalidConfiguration("Platform is currently not supported") if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.dtls_backend == "openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.dtls_backend == "mbedtls": + self.requires("mbedtls/3.2.1") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["WITH_EPOLL"] = self.options.with_epoll - self._cmake.definitions["ENABLE_DTLS"] = self.options.dtls_backend != None - self._cmake.definitions["DTLS_BACKEND"] = self.options.dtls_backend + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.options.dtls_backend in ["gnutls", "tinydtls"]: + raise ConanInvalidConfiguration(f"{self.options.dtls_backend} not available yet") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_EPOLL"] = self.options.with_epoll + tc.variables["ENABLE_DTLS"] = self.options.dtls_backend is not None + tc.variables["DTLS_BACKEND"] = self.options.dtls_backend if self.version != "cci.20200424": - self._cmake.definitions["ENABLE_DOCS"] = False - self._cmake.definitions["ENABLE_EXAMPLES"] = False + tc.variables["ENABLE_DOCS"] = False + tc.variables["ENABLE_EXAMPLES"] = False + tc.generate() - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc = CMakeDeps(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() 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.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): - library_name = "" - pkgconfig_name = "" if self.version == "cci.20200424": library_name = "coap" - pkgconfig_name = "libcoap-2" + pkgconfig_filename = "libcoap-2" else: library_name = "coap-3" - pkgconfig_name = "libcoap-3" + pkgconfig_filename = "libcoap-3" + + if self.options.dtls_backend: + pkgconfig_filename += f"-{self.options.dtls_backend}" self.cpp_info.components["coap"].names["cmake_find_package"] = "coap" self.cpp_info.components["coap"].names["cmake_find_package_multi"] = "coap" - pkgconfig_filename = "{}{}".format(pkgconfig_name, "-{}".format(self.options.dtls_backend) if self.options.dtls_backend else "") - self.cpp_info.components["coap"].names["pkg_config"] = pkgconfig_filename + self.cpp_info.components["coap"].set_property("pkg_config_name", pkgconfig_filename) self.cpp_info.components["coap"].libs = [library_name] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["coap"].system_libs = ["pthread"] if self.options.dtls_backend == "openssl": self.cpp_info.components["coap"].requires = ["openssl::openssl"] diff --git a/recipes/libcoap/all/test_package/CMakeLists.txt b/recipes/libcoap/all/test_package/CMakeLists.txt index b81eef988f5b58..56a2af225094f3 100644 --- a/recipes/libcoap/all/test_package/CMakeLists.txt +++ b/recipes/libcoap/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(libcoap REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} libcoap::coap) +target_link_libraries(${PROJECT_NAME} libcoap::libcoap) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) -target_compile_definitions(${PROJECT_NAME} PUBLIC LIB_VERSION=${LIB_VERSION}) diff --git a/recipes/libcoap/all/test_package/conanfile.py b/recipes/libcoap/all/test_package/conanfile.py index 8bd5d5d915f3db..e1b4c4f5f3efb5 100644 --- a/recipes/libcoap/all/test_package/conanfile.py +++ b/recipes/libcoap/all/test_package/conanfile.py @@ -1,24 +1,35 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os -from conans import ConanFile, CMake, tools -class TestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build(self): - cmake = CMake(self) + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) - version = self.deps_cpp_info["libcoap"].version; + def generate(self): + tc = CMakeToolchain(self) + version = self.dependencies["libcoap"].ref.version if version == "cci.20200424": - cmake.definitions["LIB_VERSION"] = 2 + tc.preprocessor_definitions["LIB_VERSION"] = "2" else: - cmake.definitions["LIB_VERSION"] = 3 + tc.preprocessor_definitions["LIB_VERSION"] = "3" + tc.generate() + 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") - bin_path = self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libcoap/all/test_v1_package/CMakeLists.txt b/recipes/libcoap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libcoap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +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/libcoap/all/test_v1_package/conanfile.py b/recipes/libcoap/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..0e1f34afd83e4e --- /dev/null +++ b/recipes/libcoap/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + version = self.deps_cpp_info["libcoap"].version + lib_version = 2 if version == "cci.20200424" else 3 + cmake.definitions["CMAKE_CXX_FLAGS"] = f"-DLIB_VERSION={lib_version}" + 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) diff --git a/recipes/libcoap/config.yml b/recipes/libcoap/config.yml index 2b90fe3a049b96..4bddf9ef347cfb 100644 --- a/recipes/libcoap/config.yml +++ b/recipes/libcoap/config.yml @@ -1,6 +1,7 @@ ---- versions: - "cci.20200424": - folder: "all" + "4.3.3": + folder: all "4.3.0": - folder: "all" + folder: all + "cci.20200424": + folder: all From eccf43dc841fd437ff332ed8d2f6afaa4786387b Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 7 Nov 2023 03:05:34 +0200 Subject: [PATCH 08/17] (#18954) guetzli: migrate to Conan v2 * guetzli: migrate to Conan v2 * guetzli: fix MSVC build * guetzli: fix test_v1_package * guetzli: remove *.pdb * guetzli: no need to modify PATH --- recipes/guetzli/all/conandata.yml | 4 - recipes/guetzli/all/conanfile.py | 131 +++++++++++------- .../guetzli/all/patches/0001-no-debug.patch | 24 ---- recipes/guetzli/all/test_package/conanfile.py | 22 +-- .../guetzli/all/test_v1_package/conanfile.py | 12 ++ recipes/guetzli/config.yml | 1 - 6 files changed, 104 insertions(+), 90 deletions(-) delete mode 100644 recipes/guetzli/all/patches/0001-no-debug.patch create mode 100644 recipes/guetzli/all/test_v1_package/conanfile.py diff --git a/recipes/guetzli/all/conandata.yml b/recipes/guetzli/all/conandata.yml index d051b6e10260b0..0581848785da00 100644 --- a/recipes/guetzli/all/conandata.yml +++ b/recipes/guetzli/all/conandata.yml @@ -2,7 +2,3 @@ sources: "1.0.1": url: "https://github.com/google/guetzli/archive/v1.0.1.tar.gz" sha256: "e52eb417a5c0fb5a3b08a858c8d10fa797627ada5373e203c196162d6a313697" -patches: - "1.0.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-no-debug.patch" diff --git a/recipes/guetzli/all/conanfile.py b/recipes/guetzli/all/conanfile.py index acf147558e0f4e..55d0965a2f54bf 100644 --- a/recipes/guetzli/all/conanfile.py +++ b/recipes/guetzli/all/conanfile.py @@ -1,76 +1,105 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import chdir, copy, get, replace_in_file, rm +from conan.tools.gnu import AutotoolsToolchain, Autotools, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, MSBuildToolchain, is_msvc, MSBuildDeps + +required_conan_version = ">=1.47.0" + class GoogleGuetzliConan(ConanFile): name = "guetzli" + description = "Perceptual JPEG encoder" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://opensource.google/projects/guetzli" - description = "Perceptual JPEG encoder" - topics = "jpeg", "compression" - exports_sources = "patches/**" - settings = "os", "compiler", "arch" - generators = "pkg_config" - requires = ["libpng/1.6.37"] + topics = ("jpeg", "compression") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" - @property - def _is_msvc(self): - return self.settings.compiler == "Visual Studio" + def layout(self): + basic_layout(self, src_folder="src") - def configure(self): - if self.settings.os not in ["Linux", "Windows"]: - raise ConanInvalidConfiguration("conan recipe for guetzli v{0} is not \ - available in {1}.".format(self.version, self.settings.os)) - - if self.settings.compiler.get_safe("libcxx") == "libc++": - raise ConanInvalidConfiguration("conan recipe for guetzli v{0} cannot be\ - built with libc++".format(self.version)) + def requirements(self): + self.requires("libpng/1.6.40") + + def package_id(self): + del self.info.settings.compiler + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD", "Windows"]: + raise ConanInvalidConfiguration( + f"conan recipe for {self.ref} is not available in {self.settings.os}." + ) + if str(self.settings.compiler.get_safe("libcxx")) == "libc++": + raise ConanInvalidConfiguration( + f"conan recipe for {self.ref} cannot be built with libc++" + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "guetzli-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = "Debug" if self.settings.build_type == "Debug" else "Release" + tc.generate() + deps = MSBuildDeps(self) + deps.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + if is_msvc(self): + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + platform_toolset = MSBuildToolchain(self).toolset + import_conan_generators = "" + for props_file in ["conantoolchain.props", "conandeps.props"]: + props_path = os.path.join(self.generators_folder, props_file) + if os.path.exists(props_path): + import_conan_generators += f"" + vcxproj_file = os.path.join(self.source_folder, "guetzli.vcxproj") + replace_in_file(self, vcxproj_file, + "v140", + f"{platform_toolset}") + if props_path: + replace_in_file(self, vcxproj_file, + '', + f'{import_conan_generators}') + else: + if self.settings.build_type not in ["Debug", "RelWithDebInfo"]: + replace_in_file(self, os.path.join(self.source_folder, "guetzli.make"), " -g ", " ") def build(self): self._patch_sources() - if self._is_msvc: + if is_msvc(self): msbuild = MSBuild(self) - with tools.chdir(self._source_subfolder): - msbuild.build("guetzli.sln", build_type="Release") + with chdir(self, self.source_folder): + msbuild.build("guetzli.sln") else: - autotools = AutoToolsBuildEnvironment(self) - with tools.chdir(self._source_subfolder): - env_vars = {"PKG_CONFIG_PATH": self.build_folder} - env_vars.update(autotools.vars) - with tools.environment_append(env_vars): - make_args = [ - "config=release", - "verbose=1'," - ] - autotools.make(args=make_args) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make() def package(self): - if self._is_msvc: - self.copy(os.path.join(self._source_subfolder, "bin", str(self.settings.arch), "Release", "guetzli.exe"), dst="bin", keep_path=False) - else: - self.copy(os.path.join(self._source_subfolder, "bin", "Release", "guetzli"), dst="bin", keep_path=False) - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - - def package_id(self): - del self.info.settings.compiler + for path in (self.source_path / "bin").rglob("guetzli*"): + copy(self, path.name, + dst=os.path.join(self.package_folder, "bin"), + src=path.parent) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] diff --git a/recipes/guetzli/all/patches/0001-no-debug.patch b/recipes/guetzli/all/patches/0001-no-debug.patch deleted file mode 100644 index e3d119caf2292b..00000000000000 --- a/recipes/guetzli/all/patches/0001-no-debug.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- guetzli.make -+++ guetzli.make -@@ -19,8 +19,8 @@ - INCLUDES += -I. -Ithird_party/butteraugli - FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 -g `pkg-config --cflags libpng` -- ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -g -std=c++11 `pkg-config --cflags libpng` -+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 `pkg-config --cflags libpng` -+ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -std=c++11 `pkg-config --cflags libpng` - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - LIBS += - LDDEPS += -@@ -46,8 +46,8 @@ - INCLUDES += -I. -Ithird_party/butteraugli - FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g `pkg-config --cflags libpng` -- ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++11 `pkg-config --cflags libpng` -+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) `pkg-config --cflags libpng` -+ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++11 `pkg-config --cflags libpng` - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - LIBS += - LDDEPS += diff --git a/recipes/guetzli/all/test_package/conanfile.py b/recipes/guetzli/all/test_package/conanfile.py index 49abdec5576721..addf429c286460 100644 --- a/recipes/guetzli/all/test_package/conanfile.py +++ b/recipes/guetzli/all/test_package/conanfile.py @@ -1,16 +1,18 @@ import os -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run -class GoogleguetzliTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - bees_path = os.path.join(self.source_folder, "bees.png") - if not tools.cross_building(self.settings): - app = "guetzli" - if self.settings.os == "Windows": - app += ".exe" - self.run("{} --quality 84 {} bees.jpg".format(app, bees_path), - run_environment=True) + if can_run(self): + bees_path = os.path.join(self.source_folder, "bees.png") + self.run(f"guetzli --quality 84 {bees_path} bees.jpg") diff --git a/recipes/guetzli/all/test_v1_package/conanfile.py b/recipes/guetzli/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c30ef97cb4cf1c --- /dev/null +++ b/recipes/guetzli/all/test_v1_package/conanfile.py @@ -0,0 +1,12 @@ +import os + +from conans import ConanFile, tools + + +class GoogleguetzliTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def test(self): + bees_path = os.path.join(self.source_folder, os.pardir, "test_package", "bees.png") + if not tools.cross_building(self.settings): + self.run(f"guetzli --quality 84 {bees_path} bees.jpg", run_environment=True) diff --git a/recipes/guetzli/config.yml b/recipes/guetzli/config.yml index 312ec85b4db117..67af1aea3aa55a 100644 --- a/recipes/guetzli/config.yml +++ b/recipes/guetzli/config.yml @@ -1,4 +1,3 @@ versions: "1.0.1": folder: "all" - From ced9e560b5b0a65dd4fc44f30a92b7b7d767a640 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 7 Nov 2023 10:28:50 +0900 Subject: [PATCH 09/17] (#20735) zeromq: add version 4.3.5, change license, add package_type * zeromq: add version 4.3.5, change license, add package_type * fix rpath issue on 4.3.5, fix license files name on 4.3.5 * make license attribute dual Co-authored-by: Jordan Williams * update license under 4.3.5 Co-authored-by: Jordan Williams * copy license file for each versions Co-authored-by: Jordan Williams --------- Co-authored-by: Jordan Williams --- recipes/zeromq/all/conandata.yml | 26 +++++++++++++++++++ recipes/zeromq/all/conanfile.py | 26 ++++++++++++++----- .../all/patches/0003-rpath-macos-4.3.5.patch | 22 ++++++++++++++++ recipes/zeromq/config.yml | 2 ++ 4 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 recipes/zeromq/all/patches/0003-rpath-macos-4.3.5.patch diff --git a/recipes/zeromq/all/conandata.yml b/recipes/zeromq/all/conandata.yml index 099a8577c05d99..7060e3ef64de2b 100644 --- a/recipes/zeromq/all/conandata.yml +++ b/recipes/zeromq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.5": + url: "https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz" + sha256: "6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43" "4.3.4": url: "https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.tar.gz" sha256: "c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5" @@ -9,14 +12,37 @@ sources: url: "https://github.com/zeromq/libzmq/releases/download/v4.3.2/zeromq-4.3.2.tar.gz" sha256: "ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763" patches: + "4.3.5": + - patch_file: "patches/0003-rpath-macos-4.3.5.patch" + patch_description: "hardcoded full install path on local machine" + patch_type: "portability" + - patch_file: "patches/0004-cmake-minimum-required-first.patch" + patch_description: "exchange positions between project and cmake_minimum_required" + patch_type: "portability" "4.3.4": - patch_file: "patches/0003-rpath-macos-4.3.3.patch" + patch_description: "hardcoded full install path on local machine" + patch_type: "portability" - patch_file: "patches/0004-cmake-minimum-required-first.patch" + patch_description: "exchange positions between project and cmake_minimum_required" + patch_type: "portability" "4.3.3": - patch_file: "patches/0003-rpath-macos-4.3.3.patch" + patch_description: "hardcoded full install path on local machine" + patch_type: "portability" - patch_file: "patches/0004-cmake-minimum-required-first.patch" + patch_description: "exchange positions between project and cmake_minimum_required" + patch_type: "portability" "4.3.2": - patch_file: "patches/0001-problem-__try-and-__except-isn-t-universally-supported-on-windows.patch" + patch_description: "__try and __except isn't universally supported on windows" + patch_type: "portability" - patch_file: "patches/0002-problem-invalid-syntax-for-calling-convention-on-function.patch" + patch_description: "invalid syntax for calling convention on function pointer" + patch_type: "portability" - patch_file: "patches/0003-rpath-macos-4.3.2.patch" + patch_description: "hardcoded full install path on local machine" + patch_type: "portability" - patch_file: "patches/0004-cmake-minimum-required-first.patch" + patch_description: "exchange positions between project and cmake_minimum_required" + patch_type: "portability" diff --git a/recipes/zeromq/all/conanfile.py b/recipes/zeromq/all/conanfile.py index 128a7c91716bd1..24e21533e207ea 100644 --- a/recipes/zeromq/all/conanfile.py +++ b/recipes/zeromq/all/conanfile.py @@ -12,12 +12,12 @@ class ZeroMQConan(ConanFile): name = "zeromq" - homepage = "https://github.com/zeromq/libzmq" description = "ZeroMQ is a community of projects focused on decentralized messaging and computing" - topics = ("zmq", "libzmq", "message-queue", "asynchronous") + license = ("DocumentRef-ZeroMQ:LicenseRef-LGPL-3.0-or-later-ZeroMQ-Linking-Exception", "MPL-2.0") url = "https://github.com/conan-io/conan-center-index" - license = "LGPL-3.0" - + homepage = "https://github.com/zeromq/libzmq" + topics = ("zmq", "libzmq", "message-queue", "asynchronous") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -46,6 +46,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) >= "4.3.5": + self.license = "MPL-2.0" + else: + self.license = "DocumentRef-ZeroMQ:LicenseRef-LGPL-3.0-or-later-ZeroMQ-Linking-Exception" def configure(self): if self.options.shared: @@ -56,7 +60,7 @@ def layout(self): def requirements(self): if self.options.encryption == "libsodium": - self.requires("libsodium/1.0.18") + self.requires("libsodium/1.0.19") if self.options.with_norm: self.requires("norm/1.5.9") @@ -100,7 +104,12 @@ def _patch_sources(self): cpp_info_sodium = self.dependencies["libsodium"].cpp_info sodium_config = cpp_info_sodium.get_property("cmake_file_name") or "libsodium" sodium_target = cpp_info_sodium.get_property("cmake_target_name") or "libsodium::libsodium" - find_sodium = "find_package(Sodium)" if Version(self.version) < "4.3.3" else "find_package(\"Sodium\")" + if Version(self.version) < "4.3.3": + find_sodium = "find_package(Sodium)" + elif Version(self.version) < "4.3.5": + find_sodium = "find_package(\"Sodium\")" + else: + find_sodium = "find_package(\"sodium\")" replace_in_file(self, cmakelists, find_sodium, f"find_package({sodium_config} REQUIRED CONFIG)") replace_in_file(self, cmakelists, "SODIUM_FOUND", f"{sodium_config}_FOUND") replace_in_file(self, cmakelists, "SODIUM_INCLUDE_DIRS", f"{sodium_config}_INCLUDE_DIRS") @@ -113,7 +122,10 @@ def build(self): cmake.build() def package(self): - copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) >= "4.3.5": + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + else: + copy(self, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) diff --git a/recipes/zeromq/all/patches/0003-rpath-macos-4.3.5.patch b/recipes/zeromq/all/patches/0003-rpath-macos-4.3.5.patch new file mode 100644 index 00000000000000..05cc02222a9e2c --- /dev/null +++ b/recipes/zeromq/all/patches/0003-rpath-macos-4.3.5.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0346227..6c231b1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + # CMake build script for ZeroMQ + project(ZeroMQ) + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) ++if(1) + cmake_minimum_required(VERSION 3.0.2) + else() + cmake_minimum_required(VERSION 2.8.12) +@@ -95,7 +95,7 @@ set(ZMQ_OUTPUT_BASENAME + "zmq" + CACHE STRING "Output zmq library base name") + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) ++if(0) + # Find more information: https://cmake.org/Wiki/CMake_RPATH_handling + + # Apply CMP0042: MACOSX_RPATH is enabled by default diff --git a/recipes/zeromq/config.yml b/recipes/zeromq/config.yml index 218db624c1eea6..492566041769bf 100644 --- a/recipes/zeromq/config.yml +++ b/recipes/zeromq/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.5": + folder: all "4.3.4": folder: all "4.3.3": From 0289c0cfffd439467f63649379ee625fd985a5d7 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Tue, 7 Nov 2023 06:23:40 +0400 Subject: [PATCH 10/17] (#20785) openvino: ported upstream patch for C++23 support --- recipes/openvino/all/conandata.yml | 4 ++ .../2023.1.0/0007-compilation-c++23.patch | 38 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch diff --git a/recipes/openvino/all/conandata.yml b/recipes/openvino/all/conandata.yml index 814349b52f916a..9793599fa9b8d1 100644 --- a/recipes/openvino/all/conandata.yml +++ b/recipes/openvino/all/conandata.yml @@ -49,3 +49,7 @@ patches: patch_description: "Support macos 14" patch_type: "portability" patch_source: "https://github.com/openvinotoolkit/openvino/pull/19946" + - patch_file: "patches/2023.1.0/0007-compilation-c++23.patch" + patch_description: "Compilation with C++23" + patch_type: "portability" + patch_source: "https://github.com/openvinotoolkit/openvino/pull/20724" diff --git a/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch b/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch new file mode 100644 index 00000000000000..552078a68bae76 --- /dev/null +++ b/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch @@ -0,0 +1,38 @@ +diff --git a/src/core/src/type.cpp b/src/core/src/type.cpp +index 7d6aef2c46..c75d9a7476 100644 +--- a/src/core/src/type.cpp ++++ b/src/core/src/type.cpp +@@ -37,7 +37,7 @@ std::string DiscreteTypeInfo::get_version() const { + if (version_id) { + return std::string(version_id); + } +- return nullptr; ++ return {}; + } + + DiscreteTypeInfo::operator std::string() const { +diff --git a/src/frontends/onnx/frontend/src/ops_bridge.hpp b/src/frontends/onnx/frontend/src/ops_bridge.hpp +index bbd6bfd129..4e2d2edb2b 100644 +--- a/src/frontends/onnx/frontend/src/ops_bridge.hpp ++++ b/src/frontends/onnx/frontend/src/ops_bridge.hpp +@@ -5,6 +5,7 @@ + #pragma once + + #include ++#include + #include + #include + #include +diff --git a/src/inference/src/dev/make_tensor.cpp b/src/inference/src/dev/make_tensor.cpp +index 2e319c04c5..5e3fa241ea 100644 +--- a/src/inference/src/dev/make_tensor.cpp ++++ b/src/inference/src/dev/make_tensor.cpp +@@ -520,7 +520,7 @@ public: + } + + void allocate() noexcept override { +- if (ie::TBlob::buffer() != tensor->data()) { ++ if ((void*)ie::TBlob::buffer() != tensor->data()) { + ie::TBlob::_allocator = + ie::details::make_pre_allocator(static_cast(tensor->data()), tensor->get_byte_size()); + ie::TBlob::allocate(); From 83fb2ed4a5804ff43b848fd278830ae2abda2a15 Mon Sep 17 00:00:00 2001 From: technoyes <76265781+technoyes@users.noreply.github.com> Date: Tue, 7 Nov 2023 03:32:15 +0100 Subject: [PATCH 11/17] (#20934) iconfontcppheaders: bump version to cci.20231102 with added Lucide font --- recipes/iconfontcppheaders/all/conandata.yml | 3 +++ recipes/iconfontcppheaders/all/conanfile.py | 2 +- recipes/iconfontcppheaders/config.yml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/iconfontcppheaders/all/conandata.yml b/recipes/iconfontcppheaders/all/conandata.yml index ff2972012bdc3b..9cba4ae5061fd3 100644 --- a/recipes/iconfontcppheaders/all/conandata.yml +++ b/recipes/iconfontcppheaders/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231102": + sha256: 7618e844dcbfea2404c209e8b52158a37c2368a79cc77e94087375a8186442c4 + url: https://github.com/juliettef/IconFontCppHeaders/archive/41b304750e83c0a89375cc1834f65c1204308b4a/main.zip "cci.20231026": sha256: b65a0256820ce24541247eeb22843968164acc40786c017392e53c5aa5a58996 url: https://github.com/juliettef/IconFontCppHeaders/archive/b1700cdf6ca2f78f8d27321dfecdafd7c2d8ef08/main.zip diff --git a/recipes/iconfontcppheaders/all/conanfile.py b/recipes/iconfontcppheaders/all/conanfile.py index ba1e590ee75f08..5541ed9fd754df 100644 --- a/recipes/iconfontcppheaders/all/conanfile.py +++ b/recipes/iconfontcppheaders/all/conanfile.py @@ -9,7 +9,7 @@ class FireHppConan(ConanFile): name = "iconfontcppheaders" - description = "Headers for icon fonts Font Awesome, Fork Awesome, Google Material Design, Kenney game icons, Fontaudio, Codicons, Pictogrammers Material Design icons." + description = "Headers for icon fonts Font Awesome, Fork Awesome, Google Material Design, Pictogrammers Material Design icons, Kenney game icons, Fontaudio, Codicons and Lucide." license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/juliettef/IconFontCppHeaders" diff --git a/recipes/iconfontcppheaders/config.yml b/recipes/iconfontcppheaders/config.yml index 8269ec2c3a4ef0..4c1b72279193a2 100644 --- a/recipes/iconfontcppheaders/config.yml +++ b/recipes/iconfontcppheaders/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20231102": + folder: all "cci.20231026": folder: all From cb9c57a1e9bff2513082cbcd0208f939fb077ab9 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 7 Nov 2023 11:40:10 +0900 Subject: [PATCH 12/17] (#20938) nanosvg: add version cci.20231025 * nanosvg: add version cci.20231025 * small improvements --- recipes/nanosvg/all/conandata.yml | 3 +++ recipes/nanosvg/all/conanfile.py | 16 +++++++--------- recipes/nanosvg/all/test_package/conanfile.py | 1 + recipes/nanosvg/config.yml | 2 ++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/recipes/nanosvg/all/conandata.yml b/recipes/nanosvg/all/conandata.yml index 8191482a0d6006..2efbe78b92b517 100644 --- a/recipes/nanosvg/all/conandata.yml +++ b/recipes/nanosvg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231025": + url: "https://github.com/memononen/nanosvg/archive/cb0ae54e6b147ccdf85401ef3ef20f2c761252c0.tar.gz" + sha256: "33d743c4e6a2c2cd223c2d9a0ceffe9fb735198fc52ea1ac6140bed10959fdcd" "cci.20210904": url: "https://github.com/memononen/nanosvg/archive/ccdb1995134d340a93fb20e3a3d323ccb3838dd0.zip" sha256: "d45fb75b9652f45f3ab4e23e76d77c4a4db02939702d36def6fcd244fb0a44c6" diff --git a/recipes/nanosvg/all/conanfile.py b/recipes/nanosvg/all/conanfile.py index 907d8771861b87..5e4dbdbbe3aa81 100644 --- a/recipes/nanosvg/all/conanfile.py +++ b/recipes/nanosvg/all/conanfile.py @@ -10,21 +10,21 @@ class NanosvgConan(ConanFile): name = "nanosvg" description = "NanoSVG is a simple stupid single-header-file SVG parser." license = "Zlib" - topics = ("nanosvg", "svg", "parser", "header-only") - homepage = "https://github.com/memononen/nanosvg" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/memononen/nanosvg" + topics = ("nanosvg", "svg", "parser", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def package_id(self): - self.info.clear() - def layout(self): basic_layout(self, src_folder="src") + def package_id(self): + self.info.clear() + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -36,8 +36,6 @@ def package(self): def package_info(self): self.cpp_info.includedirs.append(os.path.join("include", "nanosvg")) self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/nanosvg/all/test_package/conanfile.py b/recipes/nanosvg/all/test_package/conanfile.py index 621a8ff8e6daf3..959fb3ca5317ad 100644 --- a/recipes/nanosvg/all/test_package/conanfile.py +++ b/recipes/nanosvg/all/test_package/conanfile.py @@ -7,6 +7,7 @@ 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) diff --git a/recipes/nanosvg/config.yml b/recipes/nanosvg/config.yml index 4cfe8bfdf0bc47..376415f6ab6cf0 100644 --- a/recipes/nanosvg/config.yml +++ b/recipes/nanosvg/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20231025": + folder: all "cci.20210904": folder: all "20190405": From 9418a2c337ff3de29dda77a136849f65e322a219 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 7 Nov 2023 11:48:42 +0900 Subject: [PATCH 13/17] (#20944) c-blosc2: add version 2.11.1, remove older versions * c-blosc2: add version 2.11.1, remove older versions * disable avx512 default --- recipes/c-blosc2/all/conandata.yml | 28 +--- recipes/c-blosc2/all/conanfile.py | 15 ++- .../all/patches/2.11.1-0001-fix-cmake.patch | 124 +++++++++++++++++ .../all/patches/2.2.0-0001-fix-cmake.patch | 127 ------------------ recipes/c-blosc2/config.yml | 8 +- 5 files changed, 144 insertions(+), 158 deletions(-) create mode 100644 recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch delete mode 100644 recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 24cbfc41731fdf..7d653c5cb32477 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.11.1": + url: "https://github.com/Blosc/c-blosc2/archive/v2.11.1.tar.gz" + sha256: "1e9923e0f026eb6e6caee608b4b9a523837806076fc79409055a6386cf5de1ea" "2.10.5": url: "https://github.com/Blosc/c-blosc2/archive/v2.10.5.tar.gz" sha256: "a88f94bf839c1371aab8207a6a43698ceb92c72f65d0d7fe5b6e59f24c138b4d" @@ -20,16 +23,11 @@ sources: "2.4.3": url: "https://github.com/Blosc/c-blosc2/archive/v2.4.3.tar.gz" sha256: "d4aa5e0794598794f20ab950e973d44f0d0d9c133ea1a5a07cb200fa54d2e036" - "2.4.2": - url: "https://github.com/Blosc/c-blosc2/archive/v2.4.2.tar.gz" - sha256: "763ded7a6286abd248a79b1560ce8bfda11018b699a450b3e43c529f284a5232" - "2.4.1": - url: "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.4.1.tar.gz" - sha256: "f09a43bfac563ceda611a213c799ca5359c3b629281e0a4f3a543e692a64a931" - "2.2.0": - url: "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.2.0.tar.gz" - sha256: "66f9977de26d6bc9ea1c0e623d873c3225e4fff709aa09b3335fd09d41d57c0e" patches: + "2.11.1": + - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.10.5": - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" @@ -58,15 +56,3 @@ patches: - patch_file: "patches/2.4.1-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "2.4.2": - - patch_file: "patches/2.4.1-0001-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" - "2.4.1": - - patch_file: "patches/2.4.1-0001-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" - "2.2.0": - - patch_file: "patches/2.2.0-0001-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" diff --git a/recipes/c-blosc2/all/conanfile.py b/recipes/c-blosc2/all/conanfile.py index 0c8d3e2c2406f7..591fa3d30b1d62 100644 --- a/recipes/c-blosc2/all/conanfile.py +++ b/recipes/c-blosc2/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rm, rmdir @@ -23,7 +24,7 @@ class CBlosc2Conan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "simd_intrinsics": [None, "sse2", "avx2"], + "simd_intrinsics": [None, "sse2", "avx2", "avx512"], "with_lz4": [True, False], "with_zlib": [None, "zlib", "zlib-ng", "zlib-ng-compat"], "with_zstd": [True, False], @@ -73,9 +74,14 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.5") + def validate(self): + if Version(self.version) < "2.11.0" \ + and self.info.settings.arch in ["x86", "x86_64"] \ + and self.options.simd_intrinsics == "avx512": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support 'avx512' SIMD intrinsics") + def build_requirements(self): - if Version(self.version) >= "2.4.1": - self.tool_requires("cmake/[>=3.16.3 <4]") + self.tool_requires("cmake/[>=3.16.3 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -94,7 +100,8 @@ def generate(self): tc.cache_variables["BUILD_BENCHMARKS"] = False tc.cache_variables["BUILD_EXAMPLES"] = False simd_intrinsics = self.options.get_safe("simd_intrinsics", False) - tc.cache_variables["DEACTIVATE_AVX2"] = simd_intrinsics != "avx2" + tc.cache_variables["DEACTIVATE_AVX2"] = simd_intrinsics not in ["avx2", "avx512"] + tc.cache_variables["DEACTIVATE_AVX512"] = simd_intrinsics != "avx512" tc.cache_variables["DEACTIVATE_LZ4"] = not bool(self.options.with_lz4) tc.cache_variables["PREFER_EXTERNAL_LZ4"] = True tc.cache_variables["DEACTIVATE_ZLIB"] = self.options.with_zlib is None diff --git a/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch new file mode 100644 index 00000000000000..5a88b5696c4af0 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch @@ -0,0 +1,124 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bff2f36..581f189 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,26 +171,26 @@ else() + endif() + + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4) + else() + message(STATUS "Using LZ4 internal sources.") + endif() + + if(NOT DEACTIVATE_ZLIB) + if(PREFER_EXTERNAL_ZLIB) +- find_package(ZLIB_NG) +- if(ZLIB_NG_FOUND) ++ find_package(zlib-ng) ++ if(zlib-ng_FOUND) + set(HAVE_ZLIB_NG TRUE) + else() + find_package(ZLIB) + endif() + +- if(NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) ++ if(NOT (zlib-ng_FOUND OR ZLIB_FOUND)) + message(STATUS "No ZLIB found. Using ZLIB-NG internal sources.") + endif() + endif() + +- if(NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) ++ if(0) + message(STATUS "Using ZLIB-NG internal sources for ZLIB support.") + set(HAVE_ZLIB_NG TRUE) + add_definitions(-DZLIB_COMPAT) +@@ -211,8 +211,8 @@ endif() + + if(NOT DEACTIVATE_ZSTD) + if(PREFER_EXTERNAL_ZSTD) +- find_package(ZSTD) +- if(NOT ZSTD_FOUND) ++ find_package(zstd) ++ if(NOT zstd_FOUND) + message(STATUS "No ZSTD library found. Using internal sources.") + endif() + else() +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index bf8527d..d467346 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -79,15 +79,15 @@ set(INTERNAL_LIBS ${PROJECT_SOURCE_DIR}/internal-complibs) + # link dependencies + # "link" dependent targets via target_link_libraries (preferred) and + # manually add includes / libs for others +-if(LZ4_FOUND) ++if(lz4_FOUND) + if(BUILD_SHARED) +- target_include_directories(blosc2_shared PUBLIC ${LZ4_INCLUDE_DIR}) ++ target_include_directories(blosc2_shared PUBLIC ${lz4_INCLUDE_DIR}) + endif() + if(BUILD_STATIC) +- target_include_directories(blosc2_static PUBLIC ${LZ4_INCLUDE_DIR}) ++ target_include_directories(blosc2_static PUBLIC ${lz4_INCLUDE_DIR}) + endif() + if(BUILD_TESTS) +- target_include_directories(blosc_testing PUBLIC ${LZ4_INCLUDE_DIR}) ++ target_include_directories(blosc_testing PUBLIC ${lz4_INCLUDE_DIR}) + endif() + else() + set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.4) +@@ -138,14 +138,14 @@ if(NOT DEACTIVATE_ZLIB) + endif() + + if(NOT DEACTIVATE_ZSTD) +- if(ZSTD_FOUND) ++ if(zstd_FOUND) + if(BUILD_SHARED) +- target_include_directories(blosc2_shared PUBLIC ${ZSTD_INCLUDE_DIR}) +- target_link_libraries(blosc2_shared PUBLIC ${ZSTD_LIBRARY}) ++ target_include_directories(blosc2_shared PUBLIC ${zstd_INCLUDE_DIR}) ++ target_link_libraries(blosc2_shared PUBLIC ${zstd_LIBRARIES}) + endif() + if(BUILD_STATIC) +- target_include_directories(blosc2_static PUBLIC ${ZSTD_INCLUDE_DIR}) +- target_link_libraries(blosc2_static PUBLIC ${ZSTD_LIBRARY}) ++ target_include_directories(blosc2_static PUBLIC ${zstd_INCLUDE_DIR}) ++ target_link_libraries(blosc2_static PUBLIC ${zstd_LIBRARIES}) + endif() + if(BUILD_TESTS) + target_include_directories(blosc_testing PUBLIC ${ZSTD_INCLUDE_DIR}) +@@ -184,8 +184,8 @@ if(NOT WIN32) + set(LIBS ${LIBS} ${CMAKE_DL_LIBS}) + endif() + +-if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++if(lz4_FOUND) ++ set(LIBS ${LIBS} ${lz4_LIBRARIES}) + else() + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + list(APPEND SOURCES ${LZ4_FILES}) +@@ -193,8 +193,8 @@ else() + endif() + + if(NOT DEACTIVATE_ZLIB) +- if(ZLIB_NG_FOUND) +- set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) ++ if(zlib-ng_FOUND) ++ set(LIBS ${LIBS} ${zlib-ng_LIBRARIES}) + elseif(ZLIB_FOUND) + set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) + else() +@@ -206,8 +206,8 @@ if(NOT DEACTIVATE_ZLIB) + endif() + + if(NOT DEACTIVATE_ZSTD) +- if(ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ if(zstd_FOUND) ++ set(LIBS ${LIBS} ${zstd_LIBRARIES}) + else() + # Enable assembly code only when not using MSVC *and* x86 is there + if((NOT MSVC) AND COMPILER_SUPPORT_SSE2) # if SSE2 is here, this is an x86 platform diff --git a/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch deleted file mode 100644 index cef3c154b1ab2c..00000000000000 --- a/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch +++ /dev/null @@ -1,127 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bd8cb34..9c4cfe0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -68,7 +68,8 @@ if(NOT WIN32) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") - endif() - --cmake_minimum_required(VERSION 3.16.3) -+## TODO: dirty fix. -+cmake_minimum_required(VERSION 3.15) - if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.4) - cmake_policy(SET CMP0063 NEW) - endif() -@@ -144,26 +145,26 @@ if(BUILD_LITE) - endif() - - if(PREFER_EXTERNAL_LZ4) -- find_package(LZ4) -+ find_package(lz4) - else() - message(STATUS "Using LZ4 internal sources.") - endif() - - if(NOT DEACTIVATE_ZLIB) - if(PREFER_EXTERNAL_ZLIB) -- find_package(ZLIB_NG) -- if (ZLIB_NG_FOUND) -+ find_package(zlib-ng) -+ if (zlib-ng_FOUND) - set(HAVE_ZLIB_NG TRUE) - else() - find_package(ZLIB) - endif() - -- if(NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) -+ if(NOT (zlib-ng_FOUND OR ZLIB_FOUND)) - message(STATUS "No ZLIB found. Using ZLIB-NG internal sources.") - endif() - endif() - -- if (NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) -+ if (0) - message(STATUS "Using ZLIB-NG internal sources for ZLIB support.") - set(HAVE_ZLIB_NG TRUE) - add_definitions(-DZLIB_COMPAT) -@@ -184,7 +185,7 @@ endif() - - if(NOT DEACTIVATE_ZSTD) - if(PREFER_EXTERNAL_ZSTD) -- find_package(ZSTD) -+ find_package(zstd) - if(NOT ZSTD_FOUND) - message(STATUS "No ZSTD library found. Using internal sources.") - endif() -diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt -index 7f3eac6..c7afecd 100644 ---- a/blosc/CMakeLists.txt -+++ b/blosc/CMakeLists.txt -@@ -10,16 +10,16 @@ set(CMAKE_C_VISIBILITY_PRESET hidden) - - # includes - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) --if(LZ4_FOUND) -- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_INCLUDE_DIR}) -+if(lz4_FOUND) -+ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${lz4_INCLUDE_DIR}) - else() - set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.3) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_LOCAL_DIR}) - endif() - - if(NOT DEACTIVATE_ZLIB) -- if(ZLIB_NG_FOUND) -- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_NG_INCLUDE_DIR}) -+ if(zlib-ng_FOUND) -+ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${zlib-ng_INCLUDE_DIR}) - elseif(ZLIB_FOUND) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - else() -@@ -29,8 +29,8 @@ if(NOT DEACTIVATE_ZLIB) - endif() - - if(NOT DEACTIVATE_ZSTD) -- if(ZSTD_FOUND) -- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_INCLUDE_DIR}) -+ if(zstd_FOUND) -+ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${zstd_INCLUDE_DIR}) - else() - set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.5.2) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} -@@ -90,8 +90,8 @@ else() - endif() - endif() - --if(LZ4_FOUND) -- set(LIBS ${LIBS} ${LZ4_LIBRARY}) -+if(lz4_FOUND) -+ set(LIBS ${LIBS} ${lz4_LIBRARIES}) - else() - file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) - set(SOURCES ${SOURCES} ${LZ4_FILES}) -@@ -99,10 +99,10 @@ else() - endif() - - if(NOT DEACTIVATE_ZLIB) -- if(ZLIB_NG_FOUND) -- set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) -+ if(zlib-ng_FOUND) -+ set(LIBS ${LIBS} ${zlib-ng_LIBRARIES}) - elseif(ZLIB_FOUND) -- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) -+ set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) - else() - set(ZLIB_LOCAL_DIR ${INTERNAL_LIBS}/${ZLIB_NG_DIR}) - file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) -@@ -112,8 +112,8 @@ if(NOT DEACTIVATE_ZLIB) - endif() - - if(NOT DEACTIVATE_ZSTD) -- if(ZSTD_FOUND) -- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) -+ if(zstd_FOUND) -+ set(LIBS ${LIBS} ${zstd_LIBRARIES}) - else() - # Enable assembly code only when not using MSVC *and* x86 is there - if((NOT MSVC) AND COMPILER_SUPPORT_SSE2) # if SSE2 is here, this is an x86 platform diff --git a/recipes/c-blosc2/config.yml b/recipes/c-blosc2/config.yml index 6ed411197f509d..f16864f76c9633 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,6 @@ versions: + "2.11.1": + folder: all "2.10.5": folder: all "2.10.2": @@ -13,9 +15,3 @@ versions: folder: all "2.4.3": folder: all - "2.4.2": - folder: all - "2.4.1": - folder: all - "2.2.0": - folder: all From 16d287068fb6c009703c242b1e9c4c2c892b7a46 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 7 Nov 2023 12:27:42 +0900 Subject: [PATCH 14/17] (#20948) openexr: add version 3.2.1 * openexr: add version 3.2.1 * link math lib * fix overwrite system_libs --- recipes/openexr/3.x/conandata.yml | 23 ++++++++++++++++--- recipes/openexr/3.x/conanfile.py | 22 ++++++++++++++---- ....patch => 3.1.4-gcc5-bug-workaround.patch} | 0 .../patches/3.2.1-gcc5-bug-workaround.patch | 13 +++++++++++ recipes/openexr/3.x/test_package/conanfile.py | 1 + recipes/openexr/config.yml | 2 ++ 6 files changed, 53 insertions(+), 8 deletions(-) rename recipes/openexr/3.x/patches/{v3.1.4-gcc5-bug-workaround.patch => 3.1.4-gcc5-bug-workaround.patch} (100%) create mode 100644 recipes/openexr/3.x/patches/3.2.1-gcc5-bug-workaround.patch diff --git a/recipes/openexr/3.x/conandata.yml b/recipes/openexr/3.x/conandata.yml index 40ca93a043145b..2a41f1e247f6ed 100644 --- a/recipes/openexr/3.x/conandata.yml +++ b/recipes/openexr/3.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.1": + url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.2.1.tar.gz" + sha256: "61e175aa2203399fb3c8c2288752fbea3c2637680d50b6e306ea5f8ffdd46a9b" "3.1.9": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.9.tar.gz" sha256: "103e902d3902800ab07b5f3a298be7afd2755312737b2cdbfa01326ff99dac07" @@ -9,9 +12,23 @@ sources: url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.5.tar.gz" sha256: "93925805c1fc4f8162b35f0ae109c4a75344e6decae5a240afdfce25f8a433ec" patches: + "3.2.1": + - patch_file: "patches/3.2.1-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" "3.1.9": - - patch_file: "patches/v3.1.4-gcc5-bug-workaround.patch" + - patch_file: "patches/3.1.4-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" "3.1.7": - - patch_file: "patches/v3.1.4-gcc5-bug-workaround.patch" + - patch_file: "patches/3.1.4-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" "3.1.5": - - patch_file: "patches/v3.1.4-gcc5-bug-workaround.patch" + - patch_file: "patches/3.1.4-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" diff --git a/recipes/openexr/3.x/conanfile.py b/recipes/openexr/3.x/conanfile.py index 8d58713defa5c3..71838c85f0a045 100644 --- a/recipes/openexr/3.x/conanfile.py +++ b/recipes/openexr/3.x/conanfile.py @@ -12,10 +12,10 @@ class OpenEXRConan(ConanFile): name = "openexr" description = "OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & " \ "Magic for use in computer imaging applications." - topics = ("openexr", "hdr", "image", "picture") license = "BSD-3-Clause" - homepage = "https://github.com/AcademySoftwareFoundation/openexr" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AcademySoftwareFoundation/openexr" + topics = ("openexr", "hdr", "image", "picture") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -27,6 +27,10 @@ class OpenEXRConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 11 + def export_sources(self): export_conandata_patches(self) @@ -47,8 +51,8 @@ def requirements(self): self.requires("imath/3.1.9", transitive_headers=True) def validate(self): - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -118,6 +122,8 @@ def package_info(self): Iex = self._add_component("Iex") Iex.libs = [f"Iex{lib_suffix}"] Iex.requires = [self._conan_comp("IexConfig")] + if self.settings.os in ["Linux", "FreeBSD"]: + Iex.system_libs = ["m"] # OpenEXR::IlmThread IlmThread = self._add_component("IlmThread") @@ -126,12 +132,14 @@ def package_info(self): self._conan_comp("IlmThreadConfig"), self._conan_comp("Iex"), ] if self.settings.os in ["Linux", "FreeBSD"]: - IlmThread.system_libs = ["pthread"] + IlmThread.system_libs = ["pthread", "m"] # OpenEXR::OpenEXRCore OpenEXRCore = self._add_component("OpenEXRCore") OpenEXRCore.libs = [f"OpenEXRCore{lib_suffix}"] OpenEXRCore.requires = [self._conan_comp("OpenEXRConfig"), "zlib::zlib"] + if self.settings.os in ["Linux", "FreeBSD"]: + OpenEXRCore.system_libs = ["m"] # OpenEXR::OpenEXR OpenEXR = self._add_component("OpenEXR") @@ -140,11 +148,15 @@ def package_info(self): self._conan_comp("OpenEXRCore"), self._conan_comp("IlmThread"), self._conan_comp("Iex"), "imath::imath", ] + if self.settings.os in ["Linux", "FreeBSD"]: + OpenEXR.system_libs = ["m"] # OpenEXR::OpenEXRUtil OpenEXRUtil = self._add_component("OpenEXRUtil") OpenEXRUtil.libs = [f"OpenEXRUtil{lib_suffix}"] OpenEXRUtil.requires = [self._conan_comp("OpenEXR")] + if self.settings.os in ["Linux", "FreeBSD"]: + OpenEXRUtil.system_libs = ["m"] # Add tools directory to PATH self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/openexr/3.x/patches/v3.1.4-gcc5-bug-workaround.patch b/recipes/openexr/3.x/patches/3.1.4-gcc5-bug-workaround.patch similarity index 100% rename from recipes/openexr/3.x/patches/v3.1.4-gcc5-bug-workaround.patch rename to recipes/openexr/3.x/patches/3.1.4-gcc5-bug-workaround.patch diff --git a/recipes/openexr/3.x/patches/3.2.1-gcc5-bug-workaround.patch b/recipes/openexr/3.x/patches/3.2.1-gcc5-bug-workaround.patch new file mode 100644 index 00000000000000..fbf062e5d01849 --- /dev/null +++ b/recipes/openexr/3.x/patches/3.2.1-gcc5-bug-workaround.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/OpenEXR/ImfAttribute.h b/src/lib/OpenEXR/ImfAttribute.h +index bccd980..c8438f3 100644 +--- a/src/lib/OpenEXR/ImfAttribute.h ++++ b/src/lib/OpenEXR/ImfAttribute.h +@@ -108,7 +108,7 @@ public: + // that the type T is copyable/assignable/moveable. + //------------------------------------------------------------ + +- TypedAttribute () = default; ++ TypedAttribute () {}; + TypedAttribute (const T& value); + TypedAttribute (const TypedAttribute& other) = default; + TypedAttribute (TypedAttribute&& other) = default; diff --git a/recipes/openexr/3.x/test_package/conanfile.py b/recipes/openexr/3.x/test_package/conanfile.py index e5475f6ba16570..96999743e2fb99 100644 --- a/recipes/openexr/3.x/test_package/conanfile.py +++ b/recipes/openexr/3.x/test_package/conanfile.py @@ -7,6 +7,7 @@ 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) diff --git a/recipes/openexr/config.yml b/recipes/openexr/config.yml index 99e37b9e0ffaa9..60f47136f648e1 100644 --- a/recipes/openexr/config.yml +++ b/recipes/openexr/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.1": + folder: "3.x" "3.1.9": folder: "3.x" "3.1.7": From 89d834847422596de54adc961ac0d4ffa1a6a1ad Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 7 Nov 2023 12:57:27 +0900 Subject: [PATCH 15/17] (#20950) sfml: add version 2.6.1, update stb --- recipes/sfml/all/conandata.yml | 19 ++++++++++++++++ recipes/sfml/all/conanfile.py | 6 ++--- .../2.6.1-0006-disable-warning-flags.patch | 22 +++++++++++++++++++ recipes/sfml/config.yml | 2 ++ 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 recipes/sfml/all/patches/2.6.1-0006-disable-warning-flags.patch diff --git a/recipes/sfml/all/conandata.yml b/recipes/sfml/all/conandata.yml index 500295e6f5fafb..37e057f517a7d4 100644 --- a/recipes/sfml/all/conandata.yml +++ b/recipes/sfml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.1": + url: "https://www.sfml-dev.org/files/SFML-2.6.1-sources.zip" + sha256: "5bf19e5c303516987f7f54d4ff1b208a0f9352ffa1cd55f992527016de0e8cb7" "2.6.0": url: "https://www.sfml-dev.org/files/SFML-2.6.0-sources.zip" sha256: "dc477fc7266641709046bd38628c909f5748bd2564b388cf6c750a9e20cdfef1" @@ -6,6 +9,22 @@ sources: url: "https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip" sha256: "bf1e0643acb92369b24572b703473af60bac82caf5af61e77c063b779471bb7f" patches: + "2.6.1": + - patch_file: "patches/2.6.0-0001-cmake-robust-find-deps.patch" + patch_description: "Robust discovery of dependencies" + patch_type: "conan" + - patch_file: "patches/2.6.0-0003-allow-shared-MT.patch" + patch_description: "Allow to build shared SFML with MT runtime" + patch_type: "portability" + - patch_file: "patches/2.6.0-0004-fix-ios.patch" + patch_description: "Fix iOS detection logic in CMakeLists" + patch_type: "portability" + - patch_file: "patches/2.6.1-0006-disable-warning-flags.patch" + patch_description: "Disable warning flags which may cause compilation errors" + patch_type: "portability" + - patch_file: "patches/2.6.0-0007-use-cci-minimp3.patch" + patch_description: "use cci minimp3 recipe" + patch_type: "conan" "2.6.0": - patch_file: "patches/2.6.0-0001-cmake-robust-find-deps.patch" patch_description: "Robust discovery of dependencies" diff --git a/recipes/sfml/all/conanfile.py b/recipes/sfml/all/conanfile.py index 87a8da53f965fe..3ec973dc4a9064 100644 --- a/recipes/sfml/all/conanfile.py +++ b/recipes/sfml/all/conanfile.py @@ -15,9 +15,9 @@ class SfmlConan(ConanFile): name = "sfml" description = "Simple and Fast Multimedia Library." license = "Zlib" - topics = ("multimedia", "games", "graphics", "audio") - homepage = "https://www.sfml-dev.org" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.sfml-dev.org" + topics = ("multimedia", "games", "graphics", "audio") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -61,7 +61,7 @@ def requirements(self): self.requires("xorg/system") if self.options.graphics: self.requires("freetype/2.13.0") - self.requires("stb/cci.20220909") + self.requires("stb/cci.20230920") if self.options.audio: self.requires("flac/1.4.2") self.requires("openal-soft/1.22.2") diff --git a/recipes/sfml/all/patches/2.6.1-0006-disable-warning-flags.patch b/recipes/sfml/all/patches/2.6.1-0006-disable-warning-flags.patch new file mode 100644 index 00000000000000..5d44e698e2bfbf --- /dev/null +++ b/recipes/sfml/all/patches/2.6.1-0006-disable-warning-flags.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake +index 65f6977..645fa20 100644 +--- a/cmake/Macros.cmake ++++ b/cmake/Macros.cmake +@@ -61,7 +61,7 @@ macro(sfml_add_library target) + add_library(${target} ${THIS_SOURCES}) + endif() + +- set_file_warnings(${THIS_SOURCES}) ++# set_file_warnings(${THIS_SOURCES}) + + # define the export symbol of the module + string(REPLACE "-" "_" NAME_UPPER "${target}") +@@ -260,7 +260,7 @@ macro(sfml_add_example target) + add_executable(${target} ${target_input}) + endif() + +- set_file_warnings(${target_input}) ++# set_file_warnings(${target_input}) + + # set the debug suffix + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) diff --git a/recipes/sfml/config.yml b/recipes/sfml/config.yml index a8b7c0e911e630..7ce3d994f27a79 100644 --- a/recipes/sfml/config.yml +++ b/recipes/sfml/config.yml @@ -1,4 +1,6 @@ versions: + "2.6.1": + folder: all "2.6.0": folder: all "2.5.1": From 80d278ff56db79fabee86ca6de97d579808ba6fa Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Tue, 7 Nov 2023 05:17:26 +0100 Subject: [PATCH 16/17] (#20951) function2: add version 4.2.4 --- recipes/function2/all/conandata.yml | 3 +++ recipes/function2/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/function2/all/conandata.yml b/recipes/function2/all/conandata.yml index ef31d20ffc3552..ae317e99a1e7ed 100644 --- a/recipes/function2/all/conandata.yml +++ b/recipes/function2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.2.4": + url: "https://github.com/Naios/function2/archive/refs/tags/4.2.4.tar.gz" + sha256: "6081d0f7011ddb8555bd846caf1245d4bce62d83fee1403b9d247b66ed617a67" "4.2.3": url: "https://github.com/Naios/function2/archive/refs/tags/4.2.3.tar.gz" sha256: "097333b05e596280d3bc7a4769f1262931716cd8cc31ca7337b7af714085f3fc" diff --git a/recipes/function2/config.yml b/recipes/function2/config.yml index 0be889b562c58c..a3a96ea0ace3a1 100644 --- a/recipes/function2/config.yml +++ b/recipes/function2/config.yml @@ -1,4 +1,6 @@ versions: + "4.2.4": + folder: all "4.2.3": folder: all "4.2.2": From 0077d7611afe40d03066d789379520be4165654a Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 7 Nov 2023 18:48:54 +0900 Subject: [PATCH 17/17] (#20958) trompeloeil: add version 46 --- recipes/trompeloeil/all/conandata.yml | 3 +++ recipes/trompeloeil/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/trompeloeil/all/conandata.yml b/recipes/trompeloeil/all/conandata.yml index 6aebe5771a442e..aa78e9ef74461b 100644 --- a/recipes/trompeloeil/all/conandata.yml +++ b/recipes/trompeloeil/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "46": + url: "https://github.com/rollbear/trompeloeil/archive/v46.tar.gz" + sha256: "dc2c856ab7716ef659f8df7fc5f6740a40e736089f05e0a8251d4ad3ad17ad83" "45": url: "https://github.com/rollbear/trompeloeil/archive/v45.tar.gz" sha256: "124b0aa45d84415193719376b6557fc1f1180cbfebf4dc4f7ca247cb404d6bd8" diff --git a/recipes/trompeloeil/config.yml b/recipes/trompeloeil/config.yml index 2353875452e464..4cd5ba1f148f2a 100644 --- a/recipes/trompeloeil/config.yml +++ b/recipes/trompeloeil/config.yml @@ -1,4 +1,6 @@ versions: + "46": + folder: all "45": folder: all "43":