From dc309dc096015fc124de611f9c592b7607d84d84 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Mon, 5 Sep 2022 15:04:06 +0200 Subject: [PATCH 001/561] Added support for conan v2 Use modern Autotools toolchain and add buildenv_info Simplified test_package No need to actually compile something with this tool we simply need to know if it runs. The win_bash for the run in the test_package needs to be set explicitly due to the conf not working properly in the test_package see conan-io/conan#11975 --- recipes/automake/all/conandata.yml | 60 ++---- recipes/automake/all/conanfile.py | 172 ++++++++---------- recipes/automake/all/test_package/Makefile.am | 4 - .../automake/all/test_package/conanfile.py | 86 ++------- .../automake/all/test_package/configure.ac | 28 --- recipes/automake/all/test_package/extra.m4 | 14 -- .../all/test_package/test_package.cpp | 9 - .../all/test_package/test_package_1.c | 7 - 8 files changed, 110 insertions(+), 270 deletions(-) delete mode 100644 recipes/automake/all/test_package/Makefile.am delete mode 100644 recipes/automake/all/test_package/configure.ac delete mode 100644 recipes/automake/all/test_package/extra.m4 delete mode 100644 recipes/automake/all/test_package/test_package.cpp delete mode 100644 recipes/automake/all/test_package/test_package_1.c diff --git a/recipes/automake/all/conandata.yml b/recipes/automake/all/conandata.yml index 24df7aa715c72..29d48a6c87604 100644 --- a/recipes/automake/all/conandata.yml +++ b/recipes/automake/all/conandata.yml @@ -16,47 +16,27 @@ sources: sha256: "608a97523f97db32f1f5d5615c98ca69326ced2054c9f82e65bade7fc4c9dea8" patches: "1.16.5": - - base_path: "source_subfolder" - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.4.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.4.patch" - - base_path: "source_subfolder" - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.3.patch" - - base_path: "source_subfolder" - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.3.patch" + - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.4.patch" + - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.4.patch" + - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.3.patch" + - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.3.patch" "1.16.4": - - base_path: "source_subfolder" - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.4.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.4.patch" - - base_path: "source_subfolder" - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.3.patch" - - base_path: "source_subfolder" - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.3.patch" + - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.4.patch" + - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.4.patch" + - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.3.patch" + - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.3.patch" "1.16.3": - - base_path: "source_subfolder" - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.3.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.3.patch" - - base_path: "source_subfolder" - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.3.patch" - - base_path: "source_subfolder" - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.3.patch" + - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.3.patch" + - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.3.patch" + - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.3.patch" + - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.3.patch" "1.16.2": - - base_path: "source_subfolder" - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.2.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.2.patch" - - base_path: "source_subfolder" - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.2.patch" - - base_path: "source_subfolder" - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.2.patch" + - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.2.patch" + - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.2.patch" + - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.2.patch" + - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.2.patch" "1.16.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.1.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.1.patch" - - base_path: "source_subfolder" - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.1.patch" - - base_path: "source_subfolder" - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.1.patch" + - patch_file: "patches/0001-help2man-no-discard-stderr-0.16.1.patch" + - patch_file: "patches/0002-no-perl-path-in-shebang-0.16.1.patch" + - patch_file: "patches/0003-remove-embedded-datadirs-introduce-automake-conan-includes-0.16.1.patch" + - patch_file: "patches/0004-introduce-automake_perllibdir-0.16.1.patch" diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 472f84cf07d88..759b66398e071 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -1,7 +1,14 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import os +from functools import lru_cache +from os import environ, path -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.files import get, apply_conandata_patches, rmdir, copy, replace_in_file +from conan.tools.gnu import Autotools +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path +from conan.tools.scm import Version + +required_conan_version = ">=1.50.0" class AutomakeConan(ConanFile): @@ -12,20 +19,11 @@ class AutomakeConan(ConanFile): topics = ("conan", "automake", "configure", "build") license = ("GPL-2.0-or-later", "GPL-3.0-or-later") settings = "os", "arch", "compiler", "build_type" + generators = "AutotoolsDeps", "AutotoolsToolchain", "VirtualBuildEnv" + win_bash = True exports_sources = "patches/*" - _autotools = None - - @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "source_subfolder") - - @property - def _version_major_minor(self): - [major, minor, _] = self.version.split(".", 2) - return '{}.{}'.format(major, minor) - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -34,107 +32,91 @@ def configure(self): del self.settings.compiler.cppstd del self.settings.compiler.libcxx - def requirements(self): - self.requires("autoconf/2.71") - # automake requires perl-Thread-Queue package - def build_requirements(self): if hasattr(self, "settings_build"): - self.build_requires("autoconf/2.71") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("autoconf/2.71") + if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + self.tool_requires("msys2/cci.latest") def package_id(self): del self.info.settings.arch del self.info.settings.compiler del self.info.settings.build_type + def layout(self): + basic_layout(self, src_folder="source") + self.cpp.package.includedirs = [] # KB-H071: It is a tool that doesn't contain headers, removing the include directory. + 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) @property def _datarootdir(self): - return os.path.join(self.package_folder, "res") + return path.join(self.package_folder, "bin", "share") @property def _automake_libdir(self): - return os.path.join(self._datarootdir, "automake-{}".format(self._version_major_minor)) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - conf_args = [ - "--datarootdir={}".format(tools.unix_path(self._datarootdir)), - "--prefix={}".format(tools.unix_path(self.package_folder)), - ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools - - def _patch_files(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - if self.settings.os == "Windows": - # tracing using m4 on Windows returns Windows paths => use cygpath to convert to unix paths - tools.replace_in_file(os.path.join(self._source_subfolder, "bin", "aclocal.in"), - " $map_traced_defs{$arg1} = $file;", - " $file = `cygpath -u $file`;\n" - " $file =~ s/^\\s+|\\s+$//g;\n" - " $map_traced_defs{$arg1} = $file;") + version = Version(self.version) + return path.join(self._datarootdir, f"automake-{version.major}.{version.minor}") - def build(self): - self._patch_files() - autotools = self._configure_autotools() - autotools.make() - - def package(self): - self.copy("COPYING*", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self._datarootdir, "info")) - tools.rmdir(os.path.join(self._datarootdir, "man")) - tools.rmdir(os.path.join(self._datarootdir, "doc")) + @lru_cache(1) + def _autotools(self): + autotool = Autotools(self) + autotool.configure() + autotool.make() + return autotool + def build(self): + apply_conandata_patches(self) if self.settings.os == "Windows": - binpath = os.path.join(self.package_folder, "bin") - for filename in os.listdir(binpath): - fullpath = os.path.join(binpath, filename) - if not os.path.isfile(fullpath): - continue - os.rename(fullpath, fullpath + ".exe") - - def package_info(self): - self.cpp_info.libdirs = [] - self.cpp_info.includedirs = [] - - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable:: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) - - bin_ext = ".exe" if self.settings.os == "Windows" else "" - - aclocal = tools.unix_path(os.path.join(self.package_folder, "bin", "aclocal" + bin_ext)) - self.output.info("Appending ACLOCAL environment variable with: {}".format(aclocal)) - self.env_info.ACLOCAL.append(aclocal) - - automake_datadir = tools.unix_path(self._datarootdir) - self.output.info("Setting AUTOMAKE_DATADIR to {}".format(automake_datadir)) - self.env_info.AUTOMAKE_DATADIR = automake_datadir + # tracing using m4 on Windows returns Windows paths => use cygpath to convert to unix paths + replace_in_file(self, path.join(self.source_path, "bin", "aclocal.in"), + " $map_traced_defs{$arg1} = $file;", + " $file = `cygpath -u $file`;\n" + " $file =~ s/^\\s+|\\s+$//g;\n" + " $map_traced_defs{$arg1} = $file;") - automake_libdir = tools.unix_path(self._automake_libdir) - self.output.info("Setting AUTOMAKE_LIBDIR to {}".format(automake_libdir)) - self.env_info.AUTOMAKE_LIBDIR = automake_libdir + _ = self._autotools() - automake_perllibdir = tools.unix_path(self._automake_libdir) - self.output.info("Setting AUTOMAKE_PERLLIBDIR to {}".format(automake_perllibdir)) - self.env_info.AUTOMAKE_PERLLIBDIR = automake_perllibdir + def package(self): + autotools = self._autotools() + # KB-H013 we're packaging an application, place everything under bin + autotools.install(args=[f"DESTDIR={unix_path(self, path.join(self.package_folder, 'bin'))}"]) - automake = tools.unix_path(os.path.join(self.package_folder, "bin", "automake" + bin_ext)) - self.output.info("Setting AUTOMAKE to {}".format(automake)) - self.env_info.AUTOMAKE = automake + copy(self, "COPYING*", src=self.source_folder, dst=path.join(self.package_folder, "licenses")) + rmdir(self, path.join(self._datarootdir, "info")) + rmdir(self, path.join(self._datarootdir, "man")) + rmdir(self, path.join(self._datarootdir, "doc")) - self.output.info("Append M4 include directories to AUTOMAKE_CONAN_INCLUDES environment variable") + def _set_env(self, var_name, var_path): + self.output.info(f"Setting {var_name} to {var_path}") + self.buildenv_info.define_path(var_name, var_path) + setattr(self.env_info, var_name, unix_path(self, var_path)) - self.user_info.compile = os.path.join(self._automake_libdir, "compile") - self.user_info.ar_lib = os.path.join(self._automake_libdir, "ar-lib") + def package_info(self): + # KB-H013 we're packaging an application, hence the nested bin + bin_dir = path.join(self.package_folder, "bin", "bin") + self.output.info(f"Appending PATH environment variable:: {bin_dir}") + self.buildenv_info.prepend_path("PATH", bin_dir) + self.env_info.PATH.append(bin_dir) + + for var in [("ACLOCAL", path.join(self.package_folder, "bin", "aclocal")), + ("AUTOMAKE_DATADIR", self._datarootdir), + ("AUTOMAKE_LIBDIR", self._automake_libdir), + ("AUTOMAKE_PERLLIBDIR", self._automake_libdir), + ("AUTOMAKE", path.join(self.package_folder, "bin", "automake"))]: + self._set_env(*var) + + compile_bin = path.join(self._automake_libdir, "compile") + self.output.info(f"Define path to `compile` binary in user_info as: {compile_bin}") + self.user_info.compile = compile_bin + compile_conf_key = "user.automake:compile" + self.output.info(f"Defining path to `compile` binary in configuration as `{compile_conf_key}` with value: {compile_bin}") + self.conf_info.define(compile_conf_key, compile_bin) + + ar_lib_bin = path.join(self._automake_libdir, "ar-lib") + self.output.info(f"Define path to `ar_lib` binary in user_info as: {ar_lib_bin}") + self.user_info.ar_lib = ar_lib_bin + ar_lib_conf_key = "user.automake:ar-lib" + self.output.info(f"Defining path to `ar-lib` binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") + self.conf_info.define(ar_lib_conf_key, ar_lib_bin) diff --git a/recipes/automake/all/test_package/Makefile.am b/recipes/automake/all/test_package/Makefile.am deleted file mode 100644 index 655db7f1876cb..0000000000000 --- a/recipes/automake/all/test_package/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -# @configure_input@ - -bin_PROGRAMS = test_package -test_package_SOURCES = test_package.cpp diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index 8362800620a5a..27cee6b4a0618 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -1,89 +1,29 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conan.tools.microsoft import is_msvc -from contextlib import contextmanager -import os -import shutil +from os import environ -required_conan_version = ">=1.45.0" +from conan import ConanFile +from conan.tools.build import can_run + +required_conan_version = ">=1.50.0" class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" - # DON'T COPY extra.m4 TO BUILD FOLDER!!! + generators = "VirtualBuildEnv" test_type = "explicit" + win_bash = True @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - def requirements(self): - self.requires(self.tested_reference_str) - def build_requirements(self): - self.build_requires(self.tested_reference_str) - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - - @contextmanager - def _build_context(self): - if is_msvc(self): - with tools.vcvars(self): - with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): - yield - else: - yield - - _default_cc = { - "gcc": "gcc", - "clang": "clang", - "Visual Studio": "cl -nologo", - "apple-clang": "clang", - } - - @property - def _system_cc(self): - system_cc = os.environ.get("CC", None) - if not system_cc: - system_cc = self._default_cc.get(str(self.settings.compiler)) - return system_cc - - @property - def _user_info(self): - return getattr(self, "user_info_build", self.deps_user_info) - - def _build_scripts(self): - """Test compile script of automake""" - compile_script = self._user_info["automake"].compile - ar_script = self._user_info["automake"].ar_lib - assert os.path.isfile(ar_script) - assert os.path.isfile(compile_script) - - if self._system_cc: - with tools.vcvars(self) if is_msvc(self) else tools.no_op(): - self.run("{} {} test_package_1.c -o script_test".format(tools.unix_path(compile_script), self._system_cc), win_bash=tools.os_info.is_windows) - - def _build_autotools(self): - """Test autoreconf + configure + make""" - with tools.environment_append({"AUTOMAKE_CONAN_INCLUDES": [tools.unix_path(self.source_folder)]}): - self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) - self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), win_bash=tools.os_info.is_windows) - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - with self._build_context(): - autotools.configure() - autotools.make() + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + self.tool_requires("msys2/cci.latest") def build(self): - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), self.build_folder) - - self._build_scripts() - self._build_autotools() + pass def test(self): - if self._system_cc: - if not tools.cross_building(self): - self.run(os.path.join(".", "script_test"), run_environment=True) - - if not tools.cross_building(self): - self.run(os.path.join(".", "test_package"), run_environment=True) + if can_run(self): + self.run("automake --version", run_environment=True, env="conanbuild", win_bash=self.settings.os == "Windows") diff --git a/recipes/automake/all/test_package/configure.ac b/recipes/automake/all/test_package/configure.ac deleted file mode 100644 index 8a7ae1dc34e7f..0000000000000 --- a/recipes/automake/all/test_package/configure.ac +++ /dev/null @@ -1,28 +0,0 @@ -AC_PREREQ([2.69]) -AC_INIT([test_package], [1.0]) -AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) - -# Safety checks in case user overwritten --srcdir -AC_CONFIG_SRCDIR([test_package.cpp]) - -AC_CANONICAL_HOST - -# Test includes of extra including directories using conan -AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) -AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) - -AC_CONFIG_HEADER([config.h]) - -# Check for CC and CXX compiler -AC_PROG_CC -AC_PROG_CXX -## We can add more checks in this section -# -## Tells automake to create a Makefile -## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html -AC_CONFIG_FILES([Makefile]) -# -## Generate the output -AC_OUTPUT -# diff --git a/recipes/automake/all/test_package/extra.m4 b/recipes/automake/all/test_package/extra.m4 deleted file mode 100644 index 69c85f5ac945d..0000000000000 --- a/recipes/automake/all/test_package/extra.m4 +++ /dev/null @@ -1,14 +0,0 @@ -dnl This file contains a macro to test adding extra include dirs using conan - -AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ - m4_define([CONAN_MACRO_VERSION], [1.3]) - m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), - -1, - [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] - ) -])dnl AUTOMAKE_TEST_PACKAGE_PREREQ - -AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ - echo "Hello world from the extra.m4 script!" - echo "My args were: $*" -])dnl diff --git a/recipes/automake/all/test_package/test_package.cpp b/recipes/automake/all/test_package/test_package.cpp deleted file mode 100644 index cd8c2f27c3587..0000000000000 --- a/recipes/automake/all/test_package/test_package.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "config.h" - -#include -#include - -int main(int argc, char** argv) { - std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; - return EXIT_SUCCESS; -} diff --git a/recipes/automake/all/test_package/test_package_1.c b/recipes/automake/all/test_package/test_package_1.c deleted file mode 100644 index 9aaff6c18e30d..0000000000000 --- a/recipes/automake/all/test_package/test_package_1.c +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -int main() { - puts("test_package.c says 'Hello World'!\n"); - return EXIT_SUCCESS; -} From 1c3140e0acec5b771395d2afa0e1ce0316be490b Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Mon, 5 Sep 2022 17:29:54 +0200 Subject: [PATCH 002/561] Don't use unix_path for setting variable subsystem isn't know at this time --- recipes/automake/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 759b66398e071..9bad4a86a37b9 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -91,7 +91,7 @@ def package(self): def _set_env(self, var_name, var_path): self.output.info(f"Setting {var_name} to {var_path}") self.buildenv_info.define_path(var_name, var_path) - setattr(self.env_info, var_name, unix_path(self, var_path)) + setattr(self.env_info, var_name, self, var_path) def package_info(self): # KB-H013 we're packaging an application, hence the nested bin From 8af95dfcaacfa8ac78f85209fe9eb042422000c1 Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Mon, 5 Sep 2022 17:38:02 +0200 Subject: [PATCH 003/561] Fix wrong setattr call --- recipes/automake/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 9bad4a86a37b9..0900f5e3e3f07 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -91,7 +91,7 @@ def package(self): def _set_env(self, var_name, var_path): self.output.info(f"Setting {var_name} to {var_path}") self.buildenv_info.define_path(var_name, var_path) - setattr(self.env_info, var_name, self, var_path) + setattr(self.env_info, var_name, var_path) def package_info(self): # KB-H013 we're packaging an application, hence the nested bin From f50f40a01636f6bc2552177f8c2ed2e1390cc170 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 7 Sep 2022 15:19:40 +0200 Subject: [PATCH 004/561] partial revert simplified test_package --- recipes/automake/all/test_package/Makefile.am | 4 + .../automake/all/test_package/conanfile.py | 86 ++++++++++++++++--- .../automake/all/test_package/configure.ac | 28 ++++++ recipes/automake/all/test_package/extra.m4 | 14 +++ .../all/test_package/test_package.cpp | 9 ++ .../all/test_package/test_package_1.c | 7 ++ 6 files changed, 135 insertions(+), 13 deletions(-) create mode 100644 recipes/automake/all/test_package/Makefile.am create mode 100644 recipes/automake/all/test_package/configure.ac create mode 100644 recipes/automake/all/test_package/extra.m4 create mode 100644 recipes/automake/all/test_package/test_package.cpp create mode 100644 recipes/automake/all/test_package/test_package_1.c diff --git a/recipes/automake/all/test_package/Makefile.am b/recipes/automake/all/test_package/Makefile.am new file mode 100644 index 0000000000000..655db7f1876cb --- /dev/null +++ b/recipes/automake/all/test_package/Makefile.am @@ -0,0 +1,4 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.cpp diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index 27cee6b4a0618..16c28dcbce38d 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -1,29 +1,89 @@ -from os import environ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conan.tools.microsoft import is_msvc +from contextlib import contextmanager +import os +import shutil -from conan import ConanFile -from conan.tools.build import can_run - -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.45.0" class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "VirtualBuildEnv" + exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" + # DON'T COPY extra.m4 TO BUILD FOLDER!!! test_type = "explicit" - win_bash = True @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def requirements(self): + self.requires(self.tested_reference_str) + def build_requirements(self): - self.tool_requires(self.tested_reference_str) - if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - self.tool_requires("msys2/cci.latest") + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextmanager + def _build_context(self): + if is_msvc(self): + with tools.vcvars(self): + with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): + yield + else: + yield + + _default_cc = { + "gcc": "gcc", + "clang": "clang", + "Visual Studio": "cl -nologo", + "apple-clang": "clang", + } + + @property + def _system_cc(self): + system_cc = os.environ.get("CC", None) + if not system_cc: + system_cc = self._default_cc.get(str(self.settings.compiler)) + return system_cc + + @property + def _user_info(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def _build_scripts(self): + """Test compile script of automake""" + compile_script = self._user_info["automake"].compile + ar_script = self._user_info["automake"].ar_lib + assert os.path.isfile(ar_script) + assert os.path.isfile(compile_script) + + if self._system_cc: + with tools.vcvars(self) if is_msvc(self) else tools.no_op(): + self.run("{} {} test_package_1.c -o script_test".format(tools.unix_path(compile_script), self._system_cc), win_bash=tools.os_info.is_windows) + + def _build_autotools(self): + """Test autoreconf + configure + make""" + with tools.environment_append({"AUTOMAKE_CONAN_INCLUDES": [tools.unix_path(self.source_folder)]}): + self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) + self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), win_bash=tools.os_info.is_windows) + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools.configure() + autotools.make() def build(self): - pass + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + + self._build_scripts() + self._build_autotools() def test(self): - if can_run(self): - self.run("automake --version", run_environment=True, env="conanbuild", win_bash=self.settings.os == "Windows") + if self._system_cc: + if not tools.cross_building(self): + self.run(os.path.join(".", "script_test"), run_environment=True) + + if not tools.cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/automake/all/test_package/configure.ac b/recipes/automake/all/test_package/configure.ac new file mode 100644 index 0000000000000..8a7ae1dc34e7f --- /dev/null +++ b/recipes/automake/all/test_package/configure.ac @@ -0,0 +1,28 @@ +AC_PREREQ([2.69]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.cpp]) + +AC_CANONICAL_HOST + +# Test includes of extra including directories using conan +AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) + +AC_CONFIG_HEADER([config.h]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) +# +## Generate the output +AC_OUTPUT +# diff --git a/recipes/automake/all/test_package/extra.m4 b/recipes/automake/all/test_package/extra.m4 new file mode 100644 index 0000000000000..69c85f5ac945d --- /dev/null +++ b/recipes/automake/all/test_package/extra.m4 @@ -0,0 +1,14 @@ +dnl This file contains a macro to test adding extra include dirs using conan + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ + m4_define([CONAN_MACRO_VERSION], [1.3]) + m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), + -1, + [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] + ) +])dnl AUTOMAKE_TEST_PACKAGE_PREREQ + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ + echo "Hello world from the extra.m4 script!" + echo "My args were: $*" +])dnl diff --git a/recipes/automake/all/test_package/test_package.cpp b/recipes/automake/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cd8c2f27c3587 --- /dev/null +++ b/recipes/automake/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "config.h" + +#include +#include + +int main(int argc, char** argv) { + std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/automake/all/test_package/test_package_1.c b/recipes/automake/all/test_package/test_package_1.c new file mode 100644 index 0000000000000..9aaff6c18e30d --- /dev/null +++ b/recipes/automake/all/test_package/test_package_1.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + puts("test_package.c says 'Hello World'!\n"); + return EXIT_SUCCESS; +} From efb20267b870251b9c6dbbbef70d442fa3851726 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 7 Sep 2022 15:19:54 +0200 Subject: [PATCH 005/561] use real-life test_package scenario Contributes to CURA-9595 --- .../automake/all/test_v1_package/Makefile.am | 4 + .../automake/all/test_v1_package/conanfile.py | 89 +++++++++++++++++++ .../automake/all/test_v1_package/configure.ac | 28 ++++++ recipes/automake/all/test_v1_package/extra.m4 | 14 +++ .../all/test_v1_package/test_package.cpp | 9 ++ .../all/test_v1_package/test_package_1.c | 7 ++ 6 files changed, 151 insertions(+) create mode 100644 recipes/automake/all/test_v1_package/Makefile.am create mode 100644 recipes/automake/all/test_v1_package/conanfile.py create mode 100644 recipes/automake/all/test_v1_package/configure.ac create mode 100644 recipes/automake/all/test_v1_package/extra.m4 create mode 100644 recipes/automake/all/test_v1_package/test_package.cpp create mode 100644 recipes/automake/all/test_v1_package/test_package_1.c diff --git a/recipes/automake/all/test_v1_package/Makefile.am b/recipes/automake/all/test_v1_package/Makefile.am new file mode 100644 index 0000000000000..655db7f1876cb --- /dev/null +++ b/recipes/automake/all/test_v1_package/Makefile.am @@ -0,0 +1,4 @@ +# @configure_input@ + +bin_PROGRAMS = test_package +test_package_SOURCES = test_package.cpp diff --git a/recipes/automake/all/test_v1_package/conanfile.py b/recipes/automake/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..16c28dcbce38d --- /dev/null +++ b/recipes/automake/all/test_v1_package/conanfile.py @@ -0,0 +1,89 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conan.tools.microsoft import is_msvc +from contextlib import contextmanager +import os +import shutil + +required_conan_version = ">=1.45.0" + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" + # DON'T COPY extra.m4 TO BUILD FOLDER!!! + test_type = "explicit" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + self.build_requires("msys2/cci.latest") + + @contextmanager + def _build_context(self): + if is_msvc(self): + with tools.vcvars(self): + with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): + yield + else: + yield + + _default_cc = { + "gcc": "gcc", + "clang": "clang", + "Visual Studio": "cl -nologo", + "apple-clang": "clang", + } + + @property + def _system_cc(self): + system_cc = os.environ.get("CC", None) + if not system_cc: + system_cc = self._default_cc.get(str(self.settings.compiler)) + return system_cc + + @property + def _user_info(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def _build_scripts(self): + """Test compile script of automake""" + compile_script = self._user_info["automake"].compile + ar_script = self._user_info["automake"].ar_lib + assert os.path.isfile(ar_script) + assert os.path.isfile(compile_script) + + if self._system_cc: + with tools.vcvars(self) if is_msvc(self) else tools.no_op(): + self.run("{} {} test_package_1.c -o script_test".format(tools.unix_path(compile_script), self._system_cc), win_bash=tools.os_info.is_windows) + + def _build_autotools(self): + """Test autoreconf + configure + make""" + with tools.environment_append({"AUTOMAKE_CONAN_INCLUDES": [tools.unix_path(self.source_folder)]}): + self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) + self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), win_bash=tools.os_info.is_windows) + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools.configure() + autotools.make() + + def build(self): + for src in self.exports_sources: + shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + + self._build_scripts() + self._build_autotools() + + def test(self): + if self._system_cc: + if not tools.cross_building(self): + self.run(os.path.join(".", "script_test"), run_environment=True) + + if not tools.cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/automake/all/test_v1_package/configure.ac b/recipes/automake/all/test_v1_package/configure.ac new file mode 100644 index 0000000000000..8a7ae1dc34e7f --- /dev/null +++ b/recipes/automake/all/test_v1_package/configure.ac @@ -0,0 +1,28 @@ +AC_PREREQ([2.69]) +AC_INIT([test_package], [1.0]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Safety checks in case user overwritten --srcdir +AC_CONFIG_SRCDIR([test_package.cpp]) + +AC_CANONICAL_HOST + +# Test includes of extra including directories using conan +AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) + +AC_CONFIG_HEADER([config.h]) + +# Check for CC and CXX compiler +AC_PROG_CC +AC_PROG_CXX +## We can add more checks in this section +# +## Tells automake to create a Makefile +## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html +AC_CONFIG_FILES([Makefile]) +# +## Generate the output +AC_OUTPUT +# diff --git a/recipes/automake/all/test_v1_package/extra.m4 b/recipes/automake/all/test_v1_package/extra.m4 new file mode 100644 index 0000000000000..69c85f5ac945d --- /dev/null +++ b/recipes/automake/all/test_v1_package/extra.m4 @@ -0,0 +1,14 @@ +dnl This file contains a macro to test adding extra include dirs using conan + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ + m4_define([CONAN_MACRO_VERSION], [1.3]) + m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), + -1, + [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] + ) +])dnl AUTOMAKE_TEST_PACKAGE_PREREQ + +AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ + echo "Hello world from the extra.m4 script!" + echo "My args were: $*" +])dnl diff --git a/recipes/automake/all/test_v1_package/test_package.cpp b/recipes/automake/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..cd8c2f27c3587 --- /dev/null +++ b/recipes/automake/all/test_v1_package/test_package.cpp @@ -0,0 +1,9 @@ +#include "config.h" + +#include +#include + +int main(int argc, char** argv) { + std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/automake/all/test_v1_package/test_package_1.c b/recipes/automake/all/test_v1_package/test_package_1.c new file mode 100644 index 0000000000000..9aaff6c18e30d --- /dev/null +++ b/recipes/automake/all/test_v1_package/test_package_1.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + puts("test_package.c says 'Hello World'!\n"); + return EXIT_SUCCESS; +} From 05d9d10d126db56bdf180f79dfa2be3506ff6d55 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 7 Sep 2022 15:35:31 +0200 Subject: [PATCH 006/561] use define or define_path depending on context Contributes to CURA-9575 --- recipes/automake/all/conanfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 0900f5e3e3f07..53e2f5bd1a0cf 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -90,8 +90,11 @@ def package(self): def _set_env(self, var_name, var_path): self.output.info(f"Setting {var_name} to {var_path}") - self.buildenv_info.define_path(var_name, var_path) - setattr(self.env_info, var_name, var_path) + if path.isfile(var_path): + self.buildenv_info.define(var_name, var_path) + else: + self.buildenv_info.define_path(var_name, var_path) + setattr(self.env_info, var_name, self, var_path) def package_info(self): # KB-H013 we're packaging an application, hence the nested bin From e82180c9434eecb7fec8b999653685bf63d32e26 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 7 Sep 2022 15:35:49 +0200 Subject: [PATCH 007/561] modernized test_package Contributes to CURA-9575 --- .../automake/all/test_package/conanfile.py | 143 +++++++++--------- 1 file changed, 75 insertions(+), 68 deletions(-) diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index 16c28dcbce38d..2fea664852572 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -1,89 +1,96 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conan.tools.microsoft import is_msvc -from contextlib import contextmanager -import os import shutil -required_conan_version = ">=1.45.0" +from os import environ, path + +from conan import ConanFile +from conan.tools.gnu import Autotools +from conan.tools.build import cross_building + + +class AutotoolsWinBash(Autotools): + def configure(self, build_script_folder=None, args=None): + # Workaround for conan-io/conan#11975 + if self._conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + from conans.tools import args_to_string + from conans.client.subsystems import subsystem_path + script_folder = path.join(self._conanfile.source_folder, build_script_folder) \ + if build_script_folder else self._conanfile.source_folder + + configure_args = [] + configure_args.extend(args or []) + + self._configure_args = "{} {}".format(self._configure_args, args_to_string(configure_args)) + + configure_cmd = "{}/configure".format(script_folder) + if self._conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + subsystem = "msys" + else: + subsystem = None + configure_cmd = subsystem_path(subsystem, configure_cmd) + cmd = '"{}" {}'.format(configure_cmd, self._configure_args) + self._conanfile.output.info("Calling:\n > %s" % cmd) + self._conanfile.run('"{}" {}'.format(subsystem_path(subsystem, path.join(self._conanfile.build_folder, "configure")), self._configure_args), run_environment=True, win_bash=True) + else: + super(AutotoolsWinBash, self).configure(build_script_folder=build_script_folder, args=args) + + def make(self, target=None, args=None): + # Workaround for conan-io/conan#11975 + if self._conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + from conan.tools.build import build_jobs + make_program = self._conanfile.conf.get("tools.gnu:make_program", + default="mingw32-make" if self._use_win_mingw() else "make") + str_args = self._make_args + str_extra_args = " ".join(args) if args is not None else "" + jobs = "" + if "-j" not in str_args and "nmake" not in make_program.lower(): + njobs = build_jobs(self._conanfile) + if njobs: + jobs = "-j{}".format(njobs) + command = " ".join(filter(None, [make_program, target, str_args, str_extra_args, jobs])) + self._conanfile.run(command, run_environment=True, win_bash=True) + else: + super(AutotoolsWinBash, self).make(target=target, args=args) + + +required_conan_version = ">=1.50.0" class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" # DON'T COPY extra.m4 TO BUILD FOLDER!!! + generators = "AutotoolsDeps", "AutotoolsToolchain", "VirtualBuildEnv" + win_bash = True test_type = "explicit" @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - def requirements(self): - self.requires(self.tested_reference_str) - def build_requirements(self): - self.build_requires(self.tested_reference_str) - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - - @contextmanager - def _build_context(self): - if is_msvc(self): - with tools.vcvars(self): - with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): - yield - else: - yield - - _default_cc = { - "gcc": "gcc", - "clang": "clang", - "Visual Studio": "cl -nologo", - "apple-clang": "clang", - } - - @property - def _system_cc(self): - system_cc = os.environ.get("CC", None) - if not system_cc: - system_cc = self._default_cc.get(str(self.settings.compiler)) - return system_cc - - @property - def _user_info(self): - return getattr(self, "user_info_build", self.deps_user_info) - - def _build_scripts(self): - """Test compile script of automake""" - compile_script = self._user_info["automake"].compile - ar_script = self._user_info["automake"].ar_lib - assert os.path.isfile(ar_script) - assert os.path.isfile(compile_script) - - if self._system_cc: - with tools.vcvars(self) if is_msvc(self) else tools.no_op(): - self.run("{} {} test_package_1.c -o script_test".format(tools.unix_path(compile_script), self._system_cc), win_bash=tools.os_info.is_windows) - - def _build_autotools(self): - """Test autoreconf + configure + make""" - with tools.environment_append({"AUTOMAKE_CONAN_INCLUDES": [tools.unix_path(self.source_folder)]}): - self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) - self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), win_bash=tools.os_info.is_windows) - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - with self._build_context(): - autotools.configure() - autotools.make() + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + self.tool_requires("msys2/cci.latest") def build(self): for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), self.build_folder) + shutil.copy(path.join(self.source_folder, src), self.build_folder) - self._build_scripts() - self._build_autotools() + # Workaround for conan-io/conan#11975 + autotools = AutotoolsWinBash(self) + autotools.configure() + autotools.make() def test(self): - if self._system_cc: - if not tools.cross_building(self): - self.run(os.path.join(".", "script_test"), run_environment=True) - - if not tools.cross_building(self): - self.run(os.path.join(".", "test_package"), run_environment=True) + if not cross_building(self): + ext = ".exe" if self.settings.os == "Windows" else "" + + # Workaround for conan-io/conan#11975 + from conans.client.subsystems import subsystem_path + if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + subsystem = "msys" + else: + subsystem = None + test_cmd = subsystem_path(subsystem, path.join(self.build_folder, f"test_package{ext}")) + + self.run(test_cmd, run_environment=True, win_bash=self.settings.os == "Windows") From 082b4ecc1b102e66ac7c82026d7a5db039f76dc7 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 7 Sep 2022 18:07:43 +0200 Subject: [PATCH 008/561] fix setattr call Contributes to CURA-9575 --- recipes/automake/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 53e2f5bd1a0cf..29fce4c5c8340 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -94,7 +94,7 @@ def _set_env(self, var_name, var_path): self.buildenv_info.define(var_name, var_path) else: self.buildenv_info.define_path(var_name, var_path) - setattr(self.env_info, var_name, self, var_path) + setattr(self.env_info, var_name, var_path) def package_info(self): # KB-H013 we're packaging an application, hence the nested bin From 9c76ee118fb856cd01431afa5f1cc975b11211b0 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 8 Sep 2022 05:49:39 +0200 Subject: [PATCH 009/561] fix subsystems on Windows Using some duck typing and inheritance to work around GH issue conan-io/conan#11980 Contributes to CURA-9575 --- recipes/automake/all/conanfile.py | 105 ++++++++++++++++-- .../automake/all/test_package/conanfile.py | 58 +++++++--- .../automake/all/test_package/configure.ac | 4 +- 3 files changed, 140 insertions(+), 27 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 29fce4c5c8340..e40e9fd249a0d 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -2,15 +2,100 @@ from os import environ, path from conan import ConanFile -from conan.tools.files import get, apply_conandata_patches, rmdir, copy, replace_in_file +from conan.errors import ConanException +from conan.tools.build import build_jobs +from conan.tools.files import get, apply_conandata_patches, copy, rmdir, replace_in_file from conan.tools.gnu import Autotools from conan.tools.layout import basic_layout from conan.tools.microsoft import unix_path from conan.tools.scm import Version +from conans.client import subsystems +from conans.client.build import join_arguments +from conans.client.subsystems import subsystem_path, deduce_subsystem, MSYS2, _escape_windows_cmd +from conans.tools import args_to_string required_conan_version = ">=1.50.0" +# Duck typing the subsystems._windows_bash_wrapper method, so it wil use the correct path for activation of the environments in the bash subsystem +# issue conan-io/conan#11980 +def _windows_bash_wrapper_fix(conanfile, command, env, envfiles_folder): + from conan.tools.env import Environment + from conan.tools.env.environment import environment_wrap_command + """ Will wrap a unix command inside a bash terminal It requires to have MSYS2, CYGWIN, or WSL""" + + subsystem = conanfile.conf.get("tools.microsoft.bash:subsystem") + shell_path = conanfile.conf.get("tools.microsoft.bash:path") + if not subsystem or not shell_path: + raise ConanException("The config 'tools.microsoft.bash:subsystem' and " + "'tools.microsoft.bash:path' are " + "needed to run commands in a Windows subsystem") + env = env or [] + if subsystem == MSYS2: + # Configure MSYS2 to inherith the PATH + msys2_mode_env = Environment() + _msystem = {"x86": "MINGW32"}.get(conanfile.settings.get_safe("arch"), "MINGW64") + msys2_mode_env.define("MSYSTEM", _msystem) + msys2_mode_env.define("MSYS2_PATH_TYPE", "inherit") + msys2_mode_bat = path.join(conanfile.generators_folder, "msys2_mode.bat") + msys2_mode_env.vars(conanfile, "build").save_bat(msys2_mode_bat) + env.append(msys2_mode_bat) + + wrapped_shell = '"%s"' % shell_path if " " in shell_path else shell_path + wrapped_shell = environment_wrap_command(env, envfiles_folder, wrapped_shell, + accepted_extensions=("bat", "ps1")) + + # Wrapping the inside_command enable to prioritize our environment, otherwise /usr/bin go + # first and there could be commands that we want to skip + wrapped_user_cmd = environment_wrap_command(env, envfiles_folder, command, + subsystem=subsystem, # Fix from main branch, see issue conan-io/conan#11980 + accepted_extensions=("sh",)) + wrapped_user_cmd = _escape_windows_cmd(wrapped_user_cmd) + + final_command = '{} -c {}'.format(wrapped_shell, wrapped_user_cmd) + return final_command + + +subsystems._windows_bash_wrapper = _windows_bash_wrapper_fix + + +# Fixing Autotools on Windows with a subsystem +class AutotoolsWinBash(Autotools): + + def configure(self, build_script_folder=None, args=None): + """ + http://jingfenghanmax.blogspot.com.es/2010/09/configure-with-host-target-and-build.html + https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html + """ + script_folder = path.join(self._conanfile.source_folder, build_script_folder) \ + if build_script_folder else self._conanfile.source_folder + + configure_args = [] + configure_args.extend(args or []) + + self._configure_args = "{} {}".format(self._configure_args, args_to_string(configure_args)) + + configure_cmd = "{}/configure".format(script_folder) + subsystem = deduce_subsystem(self._conanfile, scope="build") + configure_cmd = subsystem_path(subsystem, configure_cmd) + cmd = '"{}" {}'.format(configure_cmd, self._configure_args) + self._conanfile.output.info("Calling:\n > %s" % cmd) + self._conanfile.run(cmd, run_environment=True) + + def make(self, target=None, args=None): + make_program = self._conanfile.conf.get("tools.gnu:make_program", + default="mingw32-make" if self._use_win_mingw() else "make") + str_args = self._make_args + str_extra_args = " ".join(args) if args is not None else "" + jobs = "" + if "-j" not in str_args and "nmake" not in make_program.lower(): + njobs = build_jobs(self._conanfile) + if njobs: + jobs = "-j{}".format(njobs) + command = join_arguments([make_program, target, str_args, str_extra_args, jobs]) + self._conanfile.run(command, run_environment=True) + + class AutomakeConan(ConanFile): name = "automake" url = "https://github.com/conan-io/conan-center-index" @@ -32,9 +117,14 @@ def configure(self): del self.settings.compiler.cppstd del self.settings.compiler.libcxx + def requirements(self): + self.requires("autoconf/2.71") + self.requires("m4/1.4.19") + def build_requirements(self): if hasattr(self, "settings_build"): self.tool_requires("autoconf/2.71") + self.tool_requires("m4/1.4.19") if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): self.tool_requires("msys2/cci.latest") @@ -61,7 +151,7 @@ def _automake_libdir(self): @lru_cache(1) def _autotools(self): - autotool = Autotools(self) + autotool = AutotoolsWinBash(self) autotool.configure() autotool.make() return autotool @@ -90,10 +180,8 @@ def package(self): def _set_env(self, var_name, var_path): self.output.info(f"Setting {var_name} to {var_path}") - if path.isfile(var_path): - self.buildenv_info.define(var_name, var_path) - else: - self.buildenv_info.define_path(var_name, var_path) + self.buildenv_info.define_path(var_name, var_path) + self.runenv_info.define_path(var_name, var_path) setattr(self.env_info, var_name, var_path) def package_info(self): @@ -101,13 +189,14 @@ def package_info(self): bin_dir = path.join(self.package_folder, "bin", "bin") self.output.info(f"Appending PATH environment variable:: {bin_dir}") self.buildenv_info.prepend_path("PATH", bin_dir) + self.runenv_info.prepend_path("PATH", bin_dir) self.env_info.PATH.append(bin_dir) - for var in [("ACLOCAL", path.join(self.package_folder, "bin", "aclocal")), + for var in [("ACLOCAL", path.join(bin_dir, "aclocal")), ("AUTOMAKE_DATADIR", self._datarootdir), ("AUTOMAKE_LIBDIR", self._automake_libdir), ("AUTOMAKE_PERLLIBDIR", self._automake_libdir), - ("AUTOMAKE", path.join(self.package_folder, "bin", "automake"))]: + ("AUTOMAKE", path.join(bin_dir, "automake"))]: self._set_env(*var) compile_bin = path.join(self._automake_libdir, "compile") diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index 2fea664852572..5bbb1d5b06484 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -1,10 +1,24 @@ import shutil - from os import environ, path from conan import ConanFile -from conan.tools.gnu import Autotools from conan.tools.build import cross_building +from conan.tools.files import chdir +from conan.tools.gnu import Autotools +from conan.tools.microsoft import is_msvc +from conans.client.build import join_arguments +from conans.client.subsystems import subsystem_path +from conans.tools import vcvars, no_op, args_to_string + + +def _subsystem(conanfile): + if conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + return "msys2" + return None + + +def _env_activate_sh_path(conanfile): + return subsystem_path(_subsystem(conanfile), path.join(conanfile.build_folder, "conanbuild.sh")) class AutotoolsWinBash(Autotools): @@ -22,14 +36,13 @@ def configure(self, build_script_folder=None, args=None): self._configure_args = "{} {}".format(self._configure_args, args_to_string(configure_args)) configure_cmd = "{}/configure".format(script_folder) - if self._conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - subsystem = "msys" - else: - subsystem = None - configure_cmd = subsystem_path(subsystem, configure_cmd) + configure_cmd = subsystem_path(_subsystem(self._conanfile), configure_cmd) cmd = '"{}" {}'.format(configure_cmd, self._configure_args) self._conanfile.output.info("Calling:\n > %s" % cmd) - self._conanfile.run('"{}" {}'.format(subsystem_path(subsystem, path.join(self._conanfile.build_folder, "configure")), self._configure_args), run_environment=True, win_bash=True) + with vcvars(self._conanfile) if is_msvc(self._conanfile) else no_op(): + self._conanfile.run( + '. "{}" && "{}" {}'.format(_env_activate_sh_path(self._conanfile), subsystem_path(_subsystem(self._conanfile), path.join(self._conanfile.build_folder, "configure")), + self._configure_args), run_environment=True, win_bash=True) else: super(AutotoolsWinBash, self).configure(build_script_folder=build_script_folder, args=args) @@ -47,17 +60,29 @@ def make(self, target=None, args=None): if njobs: jobs = "-j{}".format(njobs) command = " ".join(filter(None, [make_program, target, str_args, str_extra_args, jobs])) - self._conanfile.run(command, run_environment=True, win_bash=True) + with vcvars(self._conanfile) if is_msvc(self._conanfile) else no_op(): + self._conanfile.run(f". {_env_activate_sh_path(self._conanfile)} && {command}", run_environment=True, win_bash=True) else: super(AutotoolsWinBash, self).make(target=target, args=args) + def autoreconf(self, args=None): + # Workaround for conan-io/conan#11975 + if self._conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): + args = args or [] + command = join_arguments(["autoreconf", self._autoreconf_args, args_to_string(args)]) + with chdir(self, self._conanfile.build_folder): + with vcvars(self._conanfile) if is_msvc(self._conanfile) else no_op(): + self._conanfile.run(f". {_env_activate_sh_path(self._conanfile)} && {command}", run_environment=True, win_bash=True) + else: + super(AutotoolsWinBash, self).autoreconf(args=args) + required_conan_version = ">=1.50.0" class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" + exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp", "extra.m4" # DON'T COPY extra.m4 TO BUILD FOLDER!!! generators = "AutotoolsDeps", "AutotoolsToolchain", "VirtualBuildEnv" win_bash = True @@ -68,16 +93,19 @@ def _settings_build(self): return getattr(self, "settings_build", self.settings) def build_requirements(self): - self.tool_requires(self.tested_reference_str) if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): self.tool_requires("msys2/cci.latest") + self.tool_requires(self.tested_reference_str) def build(self): for src in self.exports_sources: shutil.copy(path.join(self.source_folder, src), self.build_folder) + # self.run(f". {_env_activate_sh_path(self)} && autoreconf --verbose", run_environment=True, win_bash=self._settings_build.os == "Windows") + # Workaround for conan-io/conan#11975 autotools = AutotoolsWinBash(self) + autotools.autoreconf() autotools.configure() autotools.make() @@ -87,10 +115,6 @@ def test(self): # Workaround for conan-io/conan#11975 from conans.client.subsystems import subsystem_path - if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - subsystem = "msys" - else: - subsystem = None - test_cmd = subsystem_path(subsystem, path.join(self.build_folder, f"test_package{ext}")) + test_cmd = subsystem_path(_subsystem(self), path.join(self.build_folder, f"test_package{ext}")) - self.run(test_cmd, run_environment=True, win_bash=self.settings.os == "Windows") + self.run(test_cmd, run_environment=True, win_bash=self.settings.os == "Windows") diff --git a/recipes/automake/all/test_package/configure.ac b/recipes/automake/all/test_package/configure.ac index 8a7ae1dc34e7f..43511104591b2 100644 --- a/recipes/automake/all/test_package/configure.ac +++ b/recipes/automake/all/test_package/configure.ac @@ -9,8 +9,8 @@ AC_CONFIG_SRCDIR([test_package.cpp]) AC_CANONICAL_HOST # Test includes of extra including directories using conan -AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) -AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) +#AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) +#AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) AC_CONFIG_HEADER([config.h]) From 1a1da0ec0440fa489e58c042ab02ed0c65b53618 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 9 Sep 2022 12:36:20 +0200 Subject: [PATCH 010/561] Use exe extension for bins Contribute to CURA-9575 --- recipes/automake/all/conanfile.py | 21 +++++++++++++------ .../automake/all/test_package/conanfile.py | 2 -- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index e40e9fd249a0d..633e2ddf5b8d1 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -1,10 +1,10 @@ from functools import lru_cache -from os import environ, path +from os import environ, path, listdir from conan import ConanFile from conan.errors import ConanException from conan.tools.build import build_jobs -from conan.tools.files import get, apply_conandata_patches, copy, rmdir, replace_in_file +from conan.tools.files import get, apply_conandata_patches, rmdir, copy, replace_in_file, rename from conan.tools.gnu import Autotools from conan.tools.layout import basic_layout from conan.tools.microsoft import unix_path @@ -173,6 +173,14 @@ def package(self): # KB-H013 we're packaging an application, place everything under bin autotools.install(args=[f"DESTDIR={unix_path(self, path.join(self.package_folder, 'bin'))}"]) + if self._settings_build.os == "Windows": + bin_dir = path.join(self.package_folder, "bin", "bin") + for filename in listdir(bin_dir): + fullpath = path.join(bin_dir, filename) + if not path.isfile(fullpath): + continue + rename(self, fullpath, f"{fullpath}.exe") + copy(self, "COPYING*", src=self.source_folder, dst=path.join(self.package_folder, "licenses")) rmdir(self, path.join(self._datarootdir, "info")) rmdir(self, path.join(self._datarootdir, "man")) @@ -192,23 +200,24 @@ def package_info(self): self.runenv_info.prepend_path("PATH", bin_dir) self.env_info.PATH.append(bin_dir) - for var in [("ACLOCAL", path.join(bin_dir, "aclocal")), + bin_ext = ".exe" if self.settings.os == "Windows" else "" + for var in [("ACLOCAL", path.join(bin_dir, f"aclocal{bin_ext}")), ("AUTOMAKE_DATADIR", self._datarootdir), ("AUTOMAKE_LIBDIR", self._automake_libdir), ("AUTOMAKE_PERLLIBDIR", self._automake_libdir), - ("AUTOMAKE", path.join(bin_dir, "automake"))]: + ("AUTOMAKE", path.join(bin_dir, f"automake{bin_ext}"))]: self._set_env(*var) compile_bin = path.join(self._automake_libdir, "compile") self.output.info(f"Define path to `compile` binary in user_info as: {compile_bin}") self.user_info.compile = compile_bin - compile_conf_key = "user.automake:compile" + compile_conf_key = "tools.automake:compile" self.output.info(f"Defining path to `compile` binary in configuration as `{compile_conf_key}` with value: {compile_bin}") self.conf_info.define(compile_conf_key, compile_bin) ar_lib_bin = path.join(self._automake_libdir, "ar-lib") self.output.info(f"Define path to `ar_lib` binary in user_info as: {ar_lib_bin}") self.user_info.ar_lib = ar_lib_bin - ar_lib_conf_key = "user.automake:ar-lib" + ar_lib_conf_key = "tools.automake:ar-lib" self.output.info(f"Defining path to `ar-lib` binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") self.conf_info.define(ar_lib_conf_key, ar_lib_bin) diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index 5bbb1d5b06484..1573e718f8ca2 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -101,8 +101,6 @@ def build(self): for src in self.exports_sources: shutil.copy(path.join(self.source_folder, src), self.build_folder) - # self.run(f". {_env_activate_sh_path(self)} && autoreconf --verbose", run_environment=True, win_bash=self._settings_build.os == "Windows") - # Workaround for conan-io/conan#11975 autotools = AutotoolsWinBash(self) autotools.autoreconf() From a973261f95c586379c4064d990745fe47b00751c Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Sun, 11 Sep 2022 19:07:14 +0200 Subject: [PATCH 011/561] Cleaned up code Contributes to CURA-8831 --- recipes/automake/all/conanfile.py | 299 ++++++++---------- .../automake/all/test_package/conanfile.py | 117 ++----- 2 files changed, 154 insertions(+), 262 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 633e2ddf5b8d1..041ac727d7e55 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -1,223 +1,174 @@ -from functools import lru_cache -from os import environ, path, listdir - from conan import ConanFile -from conan.errors import ConanException -from conan.tools.build import build_jobs -from conan.tools.files import get, apply_conandata_patches, rmdir, copy, replace_in_file, rename -from conan.tools.gnu import Autotools +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain from conan.tools.layout import basic_layout -from conan.tools.microsoft import unix_path +from conan.tools.microsoft import is_msvc, unix_path from conan.tools.scm import Version -from conans.client import subsystems -from conans.client.build import join_arguments -from conans.client.subsystems import subsystem_path, deduce_subsystem, MSYS2, _escape_windows_cmd -from conans.tools import args_to_string - -required_conan_version = ">=1.50.0" - - -# Duck typing the subsystems._windows_bash_wrapper method, so it wil use the correct path for activation of the environments in the bash subsystem -# issue conan-io/conan#11980 -def _windows_bash_wrapper_fix(conanfile, command, env, envfiles_folder): - from conan.tools.env import Environment - from conan.tools.env.environment import environment_wrap_command - """ Will wrap a unix command inside a bash terminal It requires to have MSYS2, CYGWIN, or WSL""" - - subsystem = conanfile.conf.get("tools.microsoft.bash:subsystem") - shell_path = conanfile.conf.get("tools.microsoft.bash:path") - if not subsystem or not shell_path: - raise ConanException("The config 'tools.microsoft.bash:subsystem' and " - "'tools.microsoft.bash:path' are " - "needed to run commands in a Windows subsystem") - env = env or [] - if subsystem == MSYS2: - # Configure MSYS2 to inherith the PATH - msys2_mode_env = Environment() - _msystem = {"x86": "MINGW32"}.get(conanfile.settings.get_safe("arch"), "MINGW64") - msys2_mode_env.define("MSYSTEM", _msystem) - msys2_mode_env.define("MSYS2_PATH_TYPE", "inherit") - msys2_mode_bat = path.join(conanfile.generators_folder, "msys2_mode.bat") - msys2_mode_env.vars(conanfile, "build").save_bat(msys2_mode_bat) - env.append(msys2_mode_bat) - - wrapped_shell = '"%s"' % shell_path if " " in shell_path else shell_path - wrapped_shell = environment_wrap_command(env, envfiles_folder, wrapped_shell, - accepted_extensions=("bat", "ps1")) - - # Wrapping the inside_command enable to prioritize our environment, otherwise /usr/bin go - # first and there could be commands that we want to skip - wrapped_user_cmd = environment_wrap_command(env, envfiles_folder, command, - subsystem=subsystem, # Fix from main branch, see issue conan-io/conan#11980 - accepted_extensions=("sh",)) - wrapped_user_cmd = _escape_windows_cmd(wrapped_user_cmd) - - final_command = '{} -c {}'.format(wrapped_shell, wrapped_user_cmd) - return final_command - - -subsystems._windows_bash_wrapper = _windows_bash_wrapper_fix - - -# Fixing Autotools on Windows with a subsystem -class AutotoolsWinBash(Autotools): - - def configure(self, build_script_folder=None, args=None): - """ - http://jingfenghanmax.blogspot.com.es/2010/09/configure-with-host-target-and-build.html - https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html - """ - script_folder = path.join(self._conanfile.source_folder, build_script_folder) \ - if build_script_folder else self._conanfile.source_folder - - configure_args = [] - configure_args.extend(args or []) - - self._configure_args = "{} {}".format(self._configure_args, args_to_string(configure_args)) - - configure_cmd = "{}/configure".format(script_folder) - subsystem = deduce_subsystem(self._conanfile, scope="build") - configure_cmd = subsystem_path(subsystem, configure_cmd) - cmd = '"{}" {}'.format(configure_cmd, self._configure_args) - self._conanfile.output.info("Calling:\n > %s" % cmd) - self._conanfile.run(cmd, run_environment=True) - - def make(self, target=None, args=None): - make_program = self._conanfile.conf.get("tools.gnu:make_program", - default="mingw32-make" if self._use_win_mingw() else "make") - str_args = self._make_args - str_extra_args = " ".join(args) if args is not None else "" - jobs = "" - if "-j" not in str_args and "nmake" not in make_program.lower(): - njobs = build_jobs(self._conanfile) - if njobs: - jobs = "-j{}".format(njobs) - command = join_arguments([make_program, target, str_args, str_extra_args, jobs]) - self._conanfile.run(command, run_environment=True) + +required_conan_version = ">=1.51.3" class AutomakeConan(ConanFile): name = "automake" + description = "Automake is a tool for automatically generating Makefile.in files compliant with the GNU Coding Standards." + license = ("GPL-2.0-or-later", "GPL-3.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gnu.org/software/automake/" - description = "Automake is a tool for automatically generating Makefile.in files compliant with the GNU Coding Standards." topics = ("conan", "automake", "configure", "build") - license = ("GPL-2.0-or-later", "GPL-3.0-or-later") settings = "os", "arch", "compiler", "build_type" - generators = "AutotoolsDeps", "AutotoolsToolchain", "VirtualBuildEnv" - win_bash = True - - exports_sources = "patches/*" @property def _settings_build(self): + # TODO: Remove for Conan v2 return getattr(self, "settings_build", self.settings) + @property + def win_bash(self): + return self._settings_build.os == "Windows" + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + def configure(self): - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.settings.compiler.libcxx # for plain C projects only + except ValueError: + pass + try: + del self.settings.compiler.cppstd # for plain C projects only + except ValueError: + pass + + def layout(self): + basic_layout(self, src_folder="automake") def requirements(self): self.requires("autoconf/2.71") self.requires("m4/1.4.19") - def build_requirements(self): - if hasattr(self, "settings_build"): - self.tool_requires("autoconf/2.71") - self.tool_requires("m4/1.4.19") - if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - self.tool_requires("msys2/cci.latest") - def package_id(self): - del self.info.settings.arch - del self.info.settings.compiler - del self.info.settings.build_type + try: + del self.info.settings.arch + except ValueError: + pass + try: + del self.info.settings.compiler + except ValueError: + pass + try: + del self.info.settings.build_type + except ValueError: + pass - def layout(self): - basic_layout(self, src_folder="source") - self.cpp.package.includedirs = [] # KB-H071: It is a tool that doesn't contain headers, removing the include directory. + def build_requirements(self): + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - @property - def _datarootdir(self): - return path.join(self.package_folder, "bin", "share") - - @property - def _automake_libdir(self): - version = Version(self.version) - return path.join(self._datarootdir, f"automake-{version.major}.{version.minor}") - - @lru_cache(1) - def _autotools(self): - autotool = AutotoolsWinBash(self) - autotool.configure() - autotool.make() - return autotool + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--datarootdir=${prefix}/res", + ]) + + if is_msvc(self): + build = "{}-{}-{}".format( + "x86_64" if self._settings_build.arch == "x86_64" else "i686", + "pc" if self._settings_build.arch == "x86" else "win64", + "mingw32") + host = "{}-{}-{}".format( + "x86_64" if self.settings.arch == "x86_64" else "i686", + "pc" if self.settings.arch == "x86" else "win64", + "mingw32") + tc.configure_args.append(f"--build={build}") + tc.configure_args.append(f"--host={host}") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + ms = VirtualBuildEnv(self) + ms.generate(scope="build") def build(self): apply_conandata_patches(self) if self.settings.os == "Windows": # tracing using m4 on Windows returns Windows paths => use cygpath to convert to unix paths - replace_in_file(self, path.join(self.source_path, "bin", "aclocal.in"), + replace_in_file(self, self.source_path.joinpath("bin", "aclocal.in"), " $map_traced_defs{$arg1} = $file;", " $file = `cygpath -u $file`;\n" " $file =~ s/^\\s+|\\s+$//g;\n" " $map_traced_defs{$arg1} = $file;") - _ = self._autotools() + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - autotools = self._autotools() - # KB-H013 we're packaging an application, place everything under bin - autotools.install(args=[f"DESTDIR={unix_path(self, path.join(self.package_folder, 'bin'))}"]) - - if self._settings_build.os == "Windows": - bin_dir = path.join(self.package_folder, "bin", "bin") - for filename in listdir(bin_dir): - fullpath = path.join(bin_dir, filename) - if not path.isfile(fullpath): - continue - rename(self, fullpath, f"{fullpath}.exe") - - copy(self, "COPYING*", src=self.source_folder, dst=path.join(self.package_folder, "licenses")) - rmdir(self, path.join(self._datarootdir, "info")) - rmdir(self, path.join(self._datarootdir, "man")) - rmdir(self, path.join(self._datarootdir, "doc")) - - def _set_env(self, var_name, var_path): - self.output.info(f"Setting {var_name} to {var_path}") - self.buildenv_info.define_path(var_name, var_path) - self.runenv_info.define_path(var_name, var_path) - setattr(self.env_info, var_name, var_path) + autotools = Autotools(self) + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) # Need to specify the `DESTDIR` as a Unix path, aware of the subsystem + + copy(self, "COPYING*", src=self.source_folder, dst=self.package_path.joinpath("licenses")) + rmdir(self, self.package_path.joinpath("res", "info")) + rmdir(self, self.package_path.joinpath("res", "man")) + rmdir(self, self.package_path.joinpath("res", "doc")) def package_info(self): - # KB-H013 we're packaging an application, hence the nested bin - bin_dir = path.join(self.package_folder, "bin", "bin") - self.output.info(f"Appending PATH environment variable:: {bin_dir}") - self.buildenv_info.prepend_path("PATH", bin_dir) - self.runenv_info.prepend_path("PATH", bin_dir) - self.env_info.PATH.append(bin_dir) - - bin_ext = ".exe" if self.settings.os == "Windows" else "" - for var in [("ACLOCAL", path.join(bin_dir, f"aclocal{bin_ext}")), - ("AUTOMAKE_DATADIR", self._datarootdir), - ("AUTOMAKE_LIBDIR", self._automake_libdir), - ("AUTOMAKE_PERLLIBDIR", self._automake_libdir), - ("AUTOMAKE", path.join(bin_dir, f"automake{bin_ext}"))]: - self._set_env(*var) - - compile_bin = path.join(self._automake_libdir, "compile") + self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] + + bin_path = self.package_path.joinpath("bin") + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.PATH.append(str(bin_path)) + + dataroot_path = self.package_path.joinpath("res") + self.output.info(f"Defining AUTOMAKE_DATADIR environment variable: {dataroot_path}") + self.env_info.AUTOMAKE_DATADIR = str(dataroot_path) + self.buildenv_info.define_path("AUTOMAKE_DATADIR", str(dataroot_path)) + + version = Version(self.version) + automake_dataroot_path = dataroot_path.joinpath(f"automake-{version.major}.{version.minor}") + self.output.info(f"Defining AUTOMAKE_LIBDIR environment variable: {automake_dataroot_path}") + self.env_info.AUTOMAKE_LIBDIR = str(automake_dataroot_path) + self.buildenv_info.define_path("AUTOMAKE_LIBDIR", str(automake_dataroot_path)) + + self.output.info(f"Defining AUTOMAKE_PERLLIBDIR environment variable: {automake_dataroot_path}") + self.env_info.AUTOMAKE_PERLLIBDIR = str(automake_dataroot_path) + self.buildenv_info.define_path("AUTOMAKE_PERLLIBDIR", str(automake_dataroot_path)) + + aclocal_bin = bin_path.joinpath("aclocal") + self.output.info(f"Defining ACLOCAL environment variable: {aclocal_bin}") + self.env_info.ACLOCAL = str(aclocal_bin) + self.buildenv_info.define_path("ACLOCAL", str(aclocal_bin)) + + aclocal_bin_conf_key = "tools.automake:aclocal" + self.output.info(f"Defining path to aclocal binary in configuration as `{aclocal_bin_conf_key}` with value: {aclocal_bin}") + self.conf_info.define(aclocal_bin_conf_key, str(aclocal_bin)) + + automake_bin = bin_path.joinpath("automake") + self.output.info(f"Defining AUTOMAKE environment variable: {automake_bin}") + self.env_info.AUTOMAKE = str(automake_bin) + self.buildenv_info.define_path("AUTOMAKE", str(automake_bin)) + + automake_bin_conf_key = "tools.automake:automake" + self.output.info(f"Defining path to automake binary in configuration as `{automake_bin_conf_key}` with value: {automake_bin}") + self.conf_info.define(automake_bin_conf_key, str(automake_bin)) + + compile_bin = bin_path.joinpath("compile") self.output.info(f"Define path to `compile` binary in user_info as: {compile_bin}") self.user_info.compile = compile_bin compile_conf_key = "tools.automake:compile" self.output.info(f"Defining path to `compile` binary in configuration as `{compile_conf_key}` with value: {compile_bin}") self.conf_info.define(compile_conf_key, compile_bin) - ar_lib_bin = path.join(self._automake_libdir, "ar-lib") - self.output.info(f"Define path to `ar_lib` binary in user_info as: {ar_lib_bin}") + ar_lib_bin = bin_path.joinpath("ar-lib") + self.output.info(f"Define path to ar_lib binary in user_info as: {ar_lib_bin}") self.user_info.ar_lib = ar_lib_bin ar_lib_conf_key = "tools.automake:ar-lib" - self.output.info(f"Defining path to `ar-lib` binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") + self.output.info(f"Defining path to ar-lib binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") self.conf_info.define(ar_lib_conf_key, ar_lib_bin) diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index 1573e718f8ca2..24b74dd7637f4 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -1,81 +1,10 @@ import shutil -from os import environ, path from conan import ConanFile -from conan.tools.build import cross_building -from conan.tools.files import chdir +from conan.tools.build import can_run from conan.tools.gnu import Autotools -from conan.tools.microsoft import is_msvc -from conans.client.build import join_arguments -from conans.client.subsystems import subsystem_path -from conans.tools import vcvars, no_op, args_to_string - - -def _subsystem(conanfile): - if conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - return "msys2" - return None - - -def _env_activate_sh_path(conanfile): - return subsystem_path(_subsystem(conanfile), path.join(conanfile.build_folder, "conanbuild.sh")) - - -class AutotoolsWinBash(Autotools): - def configure(self, build_script_folder=None, args=None): - # Workaround for conan-io/conan#11975 - if self._conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - from conans.tools import args_to_string - from conans.client.subsystems import subsystem_path - script_folder = path.join(self._conanfile.source_folder, build_script_folder) \ - if build_script_folder else self._conanfile.source_folder - - configure_args = [] - configure_args.extend(args or []) - - self._configure_args = "{} {}".format(self._configure_args, args_to_string(configure_args)) - - configure_cmd = "{}/configure".format(script_folder) - configure_cmd = subsystem_path(_subsystem(self._conanfile), configure_cmd) - cmd = '"{}" {}'.format(configure_cmd, self._configure_args) - self._conanfile.output.info("Calling:\n > %s" % cmd) - with vcvars(self._conanfile) if is_msvc(self._conanfile) else no_op(): - self._conanfile.run( - '. "{}" && "{}" {}'.format(_env_activate_sh_path(self._conanfile), subsystem_path(_subsystem(self._conanfile), path.join(self._conanfile.build_folder, "configure")), - self._configure_args), run_environment=True, win_bash=True) - else: - super(AutotoolsWinBash, self).configure(build_script_folder=build_script_folder, args=args) - - def make(self, target=None, args=None): - # Workaround for conan-io/conan#11975 - if self._conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - from conan.tools.build import build_jobs - make_program = self._conanfile.conf.get("tools.gnu:make_program", - default="mingw32-make" if self._use_win_mingw() else "make") - str_args = self._make_args - str_extra_args = " ".join(args) if args is not None else "" - jobs = "" - if "-j" not in str_args and "nmake" not in make_program.lower(): - njobs = build_jobs(self._conanfile) - if njobs: - jobs = "-j{}".format(njobs) - command = " ".join(filter(None, [make_program, target, str_args, str_extra_args, jobs])) - with vcvars(self._conanfile) if is_msvc(self._conanfile) else no_op(): - self._conanfile.run(f". {_env_activate_sh_path(self._conanfile)} && {command}", run_environment=True, win_bash=True) - else: - super(AutotoolsWinBash, self).make(target=target, args=args) - - def autoreconf(self, args=None): - # Workaround for conan-io/conan#11975 - if self._conanfile._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - args = args or [] - command = join_arguments(["autoreconf", self._autoreconf_args, args_to_string(args)]) - with chdir(self, self._conanfile.build_folder): - with vcvars(self._conanfile) if is_msvc(self._conanfile) else no_op(): - self._conanfile.run(f". {_env_activate_sh_path(self._conanfile)} && {command}", run_environment=True, win_bash=True) - else: - super(AutotoolsWinBash, self).autoreconf(args=args) - +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path required_conan_version = ">=1.50.0" @@ -85,34 +14,46 @@ class TestPackageConan(ConanFile): exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp", "extra.m4" # DON'T COPY extra.m4 TO BUILD FOLDER!!! generators = "AutotoolsDeps", "AutotoolsToolchain", "VirtualBuildEnv" - win_bash = True test_type = "explicit" @property def _settings_build(self): + # TODO: Remove for Conan v2 return getattr(self, "settings_build", self.settings) + @property + def win_bash(self): + return self._settings_build.os == "Windows" + + def layout(self): + basic_layout(self, src_folder=".") + self.folders.build = "build" + self.folders.generators = "build/conan" + + def build_requirements(self): - if self._settings_build.os == "Windows" and not environ.get("CONAN_BASH_PATH"): - self.tool_requires("msys2/cci.latest") + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") # The conf `tools.microsoft.bash:path` and `tools.microsoft.bash:subsystem` aren't injected for test_package self.tool_requires(self.tested_reference_str) def build(self): + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + return # autoconf needs a bash if there isn't a bash no need to build + for src in self.exports_sources: - shutil.copy(path.join(self.source_folder, src), self.build_folder) + shutil.copy(self.source_path.joinpath(src), self.build_folder) - # Workaround for conan-io/conan#11975 - autotools = AutotoolsWinBash(self) - autotools.autoreconf() - autotools.configure() + autotools = Autotools(self) + self.run("autoreconf -fiv", cwd = self.build_path) # Workaround for since the method `autoreconf()` will always run from source + autotools.configure(build_script_folder=self.build_path) autotools.make() def test(self): - if not cross_building(self): - ext = ".exe" if self.settings.os == "Windows" else "" + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + return # autoconf needs a bash if there isn't a bash no need to build - # Workaround for conan-io/conan#11975 - from conans.client.subsystems import subsystem_path - test_cmd = subsystem_path(_subsystem(self), path.join(self.build_folder, f"test_package{ext}")) + if can_run(self): + ext = ".exe" if self.settings.os == "Windows" else "" + test_cmd = unix_path(self, self.build_path.joinpath(f"test_package{ext}")) - self.run(test_cmd, run_environment=True, win_bash=self.settings.os == "Windows") + self.run(test_cmd, run_environment=True) From de8b1ce1b0bfd1e7f94a795ffd0e722020ba221e Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Sun, 11 Sep 2022 19:13:39 +0200 Subject: [PATCH 012/561] Removed etxra.m4 Wasn't used Contributes to CURA-8831 --- recipes/automake/all/test_package/conanfile.py | 3 +-- recipes/automake/all/test_package/configure.ac | 4 ---- recipes/automake/all/test_package/extra.m4 | 14 -------------- 3 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 recipes/automake/all/test_package/extra.m4 diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index 24b74dd7637f4..7e24687c36af8 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -11,8 +11,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp", "extra.m4" - # DON'T COPY extra.m4 TO BUILD FOLDER!!! + exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" generators = "AutotoolsDeps", "AutotoolsToolchain", "VirtualBuildEnv" test_type = "explicit" diff --git a/recipes/automake/all/test_package/configure.ac b/recipes/automake/all/test_package/configure.ac index 43511104591b2..3c6beb812917f 100644 --- a/recipes/automake/all/test_package/configure.ac +++ b/recipes/automake/all/test_package/configure.ac @@ -8,10 +8,6 @@ AC_CONFIG_SRCDIR([test_package.cpp]) AC_CANONICAL_HOST -# Test includes of extra including directories using conan -#AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) -#AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) - AC_CONFIG_HEADER([config.h]) # Check for CC and CXX compiler diff --git a/recipes/automake/all/test_package/extra.m4 b/recipes/automake/all/test_package/extra.m4 deleted file mode 100644 index 69c85f5ac945d..0000000000000 --- a/recipes/automake/all/test_package/extra.m4 +++ /dev/null @@ -1,14 +0,0 @@ -dnl This file contains a macro to test adding extra include dirs using conan - -AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ - m4_define([CONAN_MACRO_VERSION], [1.3]) - m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), - -1, - [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] - ) -])dnl AUTOMAKE_TEST_PACKAGE_PREREQ - -AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ - echo "Hello world from the extra.m4 script!" - echo "My args were: $*" -])dnl From ebac519459be3fbb58f26ba4578f355a8bfeb5b4 Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Mon, 12 Sep 2022 09:19:09 +0200 Subject: [PATCH 013/561] fixed paths to compile, ar-lib and added install-sh Contributes to CURA-8831 --- recipes/automake/all/conanfile.py | 11 +++++++++-- recipes/automake/all/test_v1_package/conanfile.py | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 041ac727d7e55..53b125bdb258e 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -159,16 +159,23 @@ def package_info(self): self.output.info(f"Defining path to automake binary in configuration as `{automake_bin_conf_key}` with value: {automake_bin}") self.conf_info.define(automake_bin_conf_key, str(automake_bin)) - compile_bin = bin_path.joinpath("compile") + compile_bin = automake_dataroot_path.joinpath("compile") self.output.info(f"Define path to `compile` binary in user_info as: {compile_bin}") self.user_info.compile = compile_bin compile_conf_key = "tools.automake:compile" self.output.info(f"Defining path to `compile` binary in configuration as `{compile_conf_key}` with value: {compile_bin}") self.conf_info.define(compile_conf_key, compile_bin) - ar_lib_bin = bin_path.joinpath("ar-lib") + ar_lib_bin = automake_dataroot_path.joinpath("ar-lib") self.output.info(f"Define path to ar_lib binary in user_info as: {ar_lib_bin}") self.user_info.ar_lib = ar_lib_bin ar_lib_conf_key = "tools.automake:ar-lib" self.output.info(f"Defining path to ar-lib binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") self.conf_info.define(ar_lib_conf_key, ar_lib_bin) + + install_sh_bin = automake_dataroot_path.joinpath("install-sh") + self.output.info(f"Define path to install_sh binary in user_info as: {install_sh_bin}") + self.user_info.install_sh = install_sh_bin + install_sh_conf_key = "tools.automake:install-sh" + self.output.info(f"Defining path to install_sh binary in configuration as `{install_sh_conf_key}` with value: {install_sh_bin}") + self.conf_info.define(install_sh_conf_key, install_sh_bin) diff --git a/recipes/automake/all/test_v1_package/conanfile.py b/recipes/automake/all/test_v1_package/conanfile.py index 16c28dcbce38d..5f9c7dc93448a 100644 --- a/recipes/automake/all/test_v1_package/conanfile.py +++ b/recipes/automake/all/test_v1_package/conanfile.py @@ -1,4 +1,5 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conan import ConanFile +from conans import AutoToolsBuildEnvironment, tools from conan.tools.microsoft import is_msvc from contextlib import contextmanager import os From 2a570578e5f92f71a00dea76722e8a4b55d1bc45 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 13 Sep 2022 08:20:58 +0200 Subject: [PATCH 014/561] Use conanbuild env as scope for testing Contribute to CURA-8831 --- recipes/automake/all/test_package/conanfile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/automake/all/test_package/conanfile.py b/recipes/automake/all/test_package/conanfile.py index 7e24687c36af8..c23f7e240514c 100644 --- a/recipes/automake/all/test_package/conanfile.py +++ b/recipes/automake/all/test_package/conanfile.py @@ -29,7 +29,6 @@ def layout(self): self.folders.build = "build" self.folders.generators = "build/conan" - def build_requirements(self): if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): self.tool_requires("msys2/cci.latest") # The conf `tools.microsoft.bash:path` and `tools.microsoft.bash:subsystem` aren't injected for test_package @@ -43,7 +42,7 @@ def build(self): shutil.copy(self.source_path.joinpath(src), self.build_folder) autotools = Autotools(self) - self.run("autoreconf -fiv", cwd = self.build_path) # Workaround for since the method `autoreconf()` will always run from source + self.run("autoreconf -fiv", cwd=self.build_path, env="conanbuild") # Workaround for since the method `autoreconf()` will always run from source autotools.configure(build_script_folder=self.build_path) autotools.make() @@ -55,4 +54,4 @@ def test(self): ext = ".exe" if self.settings.os == "Windows" else "" test_cmd = unix_path(self, self.build_path.joinpath(f"test_package{ext}")) - self.run(test_cmd, run_environment=True) + self.run(test_cmd, run_environment=True, env="conanbuild") From 7f7dd663712b0a3bcaed528828055a98440de4ff Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 13 Sep 2022 08:21:26 +0200 Subject: [PATCH 015/561] Convert Path to string in conf_info and env_info Contribute to CURA-8831 --- recipes/automake/all/conanfile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 53b125bdb258e..b2fac7a9600be 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -161,21 +161,21 @@ def package_info(self): compile_bin = automake_dataroot_path.joinpath("compile") self.output.info(f"Define path to `compile` binary in user_info as: {compile_bin}") - self.user_info.compile = compile_bin + self.user_info.compile = str(compile_bin) compile_conf_key = "tools.automake:compile" self.output.info(f"Defining path to `compile` binary in configuration as `{compile_conf_key}` with value: {compile_bin}") - self.conf_info.define(compile_conf_key, compile_bin) + self.conf_info.define(compile_conf_key, str(compile_bin)) ar_lib_bin = automake_dataroot_path.joinpath("ar-lib") self.output.info(f"Define path to ar_lib binary in user_info as: {ar_lib_bin}") - self.user_info.ar_lib = ar_lib_bin + self.user_info.ar_lib = str(ar_lib_bin) ar_lib_conf_key = "tools.automake:ar-lib" self.output.info(f"Defining path to ar-lib binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") - self.conf_info.define(ar_lib_conf_key, ar_lib_bin) + self.conf_info.define(ar_lib_conf_key, str(ar_lib_bin)) install_sh_bin = automake_dataroot_path.joinpath("install-sh") self.output.info(f"Define path to install_sh binary in user_info as: {install_sh_bin}") - self.user_info.install_sh = install_sh_bin + self.user_info.install_sh = str(install_sh_bin) install_sh_conf_key = "tools.automake:install-sh" self.output.info(f"Defining path to install_sh binary in configuration as `{install_sh_conf_key}` with value: {install_sh_bin}") - self.conf_info.define(install_sh_conf_key, install_sh_bin) + self.conf_info.define(install_sh_conf_key, str(install_sh_bin)) From 9f24b5b7ead7db1f64329a7098bf6eeab63f9e99 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Sep 2022 11:45:06 +0200 Subject: [PATCH 016/561] (#12383) cocoyaxi: conan v2 support & update tarball url * conan v2 support * fix url & sha256 project seems to have been renamed coost --- recipes/cocoyaxi/all/CMakeLists.txt | 7 -- recipes/cocoyaxi/all/conandata.yml | 4 +- recipes/cocoyaxi/all/conanfile.py | 94 +++++++++---------- .../cocoyaxi/all/test_package/CMakeLists.txt | 13 +-- .../cocoyaxi/all/test_package/conanfile.py | 21 +++-- .../{test_package.cc => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 11 +++ .../cocoyaxi/all/test_v1_package/conanfile.py | 17 ++++ 8 files changed, 93 insertions(+), 74 deletions(-) delete mode 100644 recipes/cocoyaxi/all/CMakeLists.txt rename recipes/cocoyaxi/all/test_package/{test_package.cc => test_package.cpp} (100%) create mode 100644 recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cocoyaxi/all/test_v1_package/conanfile.py diff --git a/recipes/cocoyaxi/all/CMakeLists.txt b/recipes/cocoyaxi/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- a/recipes/cocoyaxi/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/cocoyaxi/all/conandata.yml b/recipes/cocoyaxi/all/conandata.yml index 35afe0f87d2da..535de47c89a52 100644 --- a/recipes/cocoyaxi/all/conandata.yml +++ b/recipes/cocoyaxi/all/conandata.yml @@ -1,4 +1,4 @@ sources: "2.0.3": - url: "https://github.com/idealvin/cocoyaxi/archive/refs/tags/v2.0.3.tar.gz" - sha256: "c112fafed5e45a3cac27e4b1b5b9f7483df267d510dd03c5dd8272e6405ea61f" + url: "https://github.com/idealvin/coost/archive/refs/tags/v2.0.3.tar.gz" + sha256: "afb5219e56cbcfae1211590e01ad9d9d7f61287e76d9dea5c5f68c432f85bf30" diff --git a/recipes/cocoyaxi/all/conanfile.py b/recipes/cocoyaxi/all/conanfile.py index 86c549c1080d0..217d2d1b7c4e1 100644 --- a/recipes/cocoyaxi/all/conanfile.py +++ b/recipes/cocoyaxi/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class CocoyaxiConan(ConanFile): @@ -12,8 +16,6 @@ class CocoyaxiConan(ConanFile): license = "MIT" description = "A go-style coroutine library in C++11 and more." topics = ("cocoyaxi", "coroutine", "c++11") - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" settings = "os", "arch", "compiler", "build_type" options = { @@ -29,16 +31,6 @@ class CocoyaxiConan(ConanFile): "with_openssl": False, } - _cmake = None - - @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 @@ -51,55 +43,55 @@ def requirements(self): if self.options.with_libcurl: self.requires("libcurl/7.80.0") if self.options.with_libcurl or self.options.with_openssl: - self.requires("openssl/1.1.1m") + self.requires("openssl/1.1.1q") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if self.info.options.with_libcurl: + if not self.info.options.with_openssl: + raise ConanInvalidConfiguration(f"{self.name} requires with_openssl=True when using with_libcurl=True") + if self.dependencies["libcurl"].options.with_ssl != "openssl": + raise ConanInvalidConfiguration(f"{self.name} requires libcurl:with_ssl='openssl' to be enabled") + if not self.dependencies["libcurl"].options.with_zlib: + raise ConanInvalidConfiguration(f"{self.name} requires libcurl:with_zlib=True to be enabled") - def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # The OSX_ARCHITECTURES target property is now respected for the ASM language - self.build_requires("cmake/3.20.1") + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if is_msvc(self): + tc.variables["STATIC_VS_CRT"] = is_msvc_static_runtime(self) + tc.variables["WITH_LIBCURL"] = self.options.with_libcurl + tc.variables["WITH_OPENSSL"] = self.options.with_openssl + tc.generate() + cd = CMakeDeps(self) + cd.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - runtime = self.settings.get_safe("compiler.runtime") - if runtime: - self._cmake.definitions["STATIC_VS_CRT"] = "MT" in runtime - self._cmake.definitions["WITH_LIBCURL"] = self.options.with_libcurl - self._cmake.definitions["WITH_OPENSSL"] = self.options.with_openssl - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def package(self): - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): self.cpp_info.set_property("cmake_file_name", "cocoyaxi") self.cpp_info.set_property("cmake_target_name", "cocoyaxi::co") - self.cpp_info.names["cmake_find_package"] = "cocoyaxi" - self.cpp_info.names["cmake_find_package_multi"] = "cocoyaxi" - self.cpp_info.components["co"].names["cmake_find_package"] = "co" - self.cpp_info.components["co"].names["cmake_find_package_multi"] = "co" - self.cpp_info.components["co"].set_property("cmake_target_name", "cocoyaxi::co") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["co"].libs = ["co"] - def validate(self): + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.components["co"].set_property("cmake_target_name", "cocoyaxi::co") if self.options.with_libcurl: - if not self.options.with_openssl: - raise ConanInvalidConfiguration(f"{self.name} requires with_openssl=True when using with_libcurl=True") - if self.options["libcurl"].with_ssl != "openssl": - raise ConanInvalidConfiguration(f"{self.name} requires libcurl:with_ssl='openssl' to be enabled") - if not self.options["libcurl"].with_zlib: - raise ConanInvalidConfiguration(f"{self.name} requires libcurl:with_zlib=True to be enabled") + self.cpp_info.components["co"].requires.append("libcurl::libcurl") + if self.options.with_libcurl or self.options.with_openssl: + self.cpp_info.components["co"].requires.append("openssl::openssl") diff --git a/recipes/cocoyaxi/all/test_package/CMakeLists.txt b/recipes/cocoyaxi/all/test_package/CMakeLists.txt index 64ca7d418e69d..2d0878488574e 100644 --- a/recipes/cocoyaxi/all/test_package/CMakeLists.txt +++ b/recipes/cocoyaxi/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -set(CMAKE_CXX_STANDARD 11) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(cocoyaxi REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cc) -target_link_libraries(${PROJECT_NAME} cocoyaxi::co) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cocoyaxi::co) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cocoyaxi/all/test_package/conanfile.py b/recipes/cocoyaxi/all/test_package/conanfile.py index 1bf1c7e26255d..3a8c6c5442b33 100644 --- a/recipes/cocoyaxi/all/test_package/conanfile.py +++ b/recipes/cocoyaxi/all/test_package/conanfile.py @@ -1,9 +1,18 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout import os + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +20,6 @@ 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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cocoyaxi/all/test_package/test_package.cc b/recipes/cocoyaxi/all/test_package/test_package.cpp similarity index 100% rename from recipes/cocoyaxi/all/test_package/test_package.cc rename to recipes/cocoyaxi/all/test_package/test_package.cpp diff --git a/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt b/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..882cedffb12e9 --- /dev/null +++ b/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cocoyaxi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cocoyaxi::co) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cocoyaxi/all/test_v1_package/conanfile.py b/recipes/cocoyaxi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cocoyaxi/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 3d6939e99eb2401a621eade7e7859d31e6408d77 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 14 Sep 2022 04:30:47 -0600 Subject: [PATCH 017/561] (#12704) docs: update documentation for handling recipe changes * docs: make sure to link `enable_revisions` so it's more obvious * docs: move instructions to one place.... * docs: use latest language around possible solutions * Update consuming_recipes.md * update link from FAQs * update with another review :smile: * Update docs/consuming_recipes.md Co-authored-by: James Co-authored-by: James --- docs/consuming_recipes.md | 122 ++++++++++---------------------------- docs/faqs.md | 17 +----- 2 files changed, 34 insertions(+), 105 deletions(-) diff --git a/docs/consuming_recipes.md b/docs/consuming_recipes.md index c58bbc2e2991c..76ca03884f40f 100644 --- a/docs/consuming_recipes.md +++ b/docs/consuming_recipes.md @@ -1,8 +1,8 @@ # Consuming recipes -Recipes in this repository are evolving continuously, contributors are creating pull-requests -fixing issues and adding new features every day. It is expected that from time to time these -new recipe revisions stop to work in your project. +ConanCenter has always maintained recipes consumers need to have an up to date client for the best experience. +The reason is there are constantly improvements and fixes being made, sometimes those require new Conan features +to be possible. There are usually waves of new features, patches and fixes that allow for even better quality recipes. ## Contents @@ -14,115 +14,57 @@ new recipe revisions stop to work in your project. ## Breaking changes -There can be several root causes if a recipe (a new revision) stopped to work in your project: +There can be several causes if a recipe (a new revision) might stopped to work in your project: - * **Fixes in recipes** that modify the libraries they are creating: exported symbols, +- **Fixes in recipes** that modify the libraries they are creating: exported symbols, compiler flags, generated files for your build system, CMake target names,... Every contributor tries to do their best and reviewers do an amazing work checking that the changes are really improving recipes. - - * **New Conan features (breaking syntax)**: sometimes Conan introduces a new feature that - requires new attributes or statements in recipes. If your Conan client is not new enough, +- **New Conan features (breaking syntax)** sometimes requires new attributes or statements in recipes. + If your Conan client is not new enough, Conan will fail to parse the recipe and will raise a cryptic Python syntax error. - This use case is covered by the [`required_conan_version`](https://docs.conan.io/en/latest/reference/conanfile/other.html?highlight=required_conan_version#requiring-a-conan-version-for-the-recipe) feature. It will - substitute the syntax error by one nicer error provided by Conan client. - - * **New Conan features**: Conan keeps evolving and adding new features in its road to Conan v2, - and ConanCenter is committed in this roadmap as well, and tries to push the user base to these +- **New Conan Version**: Conan keeps evolving and adding new features, especially on its road to Conan 2.0, + and ConanCenter is committed in this [roadmap](v2_roadmap) as well, and tries to prepare the user base to these new features in order to ease the migration to new versions. New recipe revisions can take into account changes that are introduced in new Conan client version, sometimes these changes modify some experimental behavior without modifying recipe syntax. - When these changes are in the critical path to Conan v2 we can introduce the - `required_conan_version` statement to be sure that people using these new experimental - features are using the required Conan version and testing the actual behavior of those - features (feedback about them is very important to Conan). +This use case is covered by the [`required_conan_version`](https://docs.conan.io/en/latest/reference/conanfile/other.html?highlight=required_conan_version#requiring-a-conan-version-for-the-recipe) feature. It will +substitute the syntax error by one nicer error provided by Conan client. + +To be sure that people using these new experimental features are using the required Conan version and testing the actual behavior +of those features (feedback about them is very important to Conan). ## Isolate your project from upstream changes -There are two main ways you can isolate your project from changes in recipes: - - * **Cache recipes in your own Artifactory**: your project should use only this remote and - new recipe revisions are only pushed to your Artifactory after they have been validated - in your project. - * **Pin the version of every reference you consume in your project** using recipe revisions - and lockfiles. - -### Use your own Artifactory instance - -Using your own Artifactory instance is not as complicated as it sounds. You can [deploy it -on-premise](https://conan.io/downloads.html) or use a [cloud provided solution](https://jfrog.com/start-free/?isConan=true) for free. - -Once you have configured your Artifactory instance, you should ensure that your project is -using only that remote (`conan remote list`). Conan makes it easy to use different configurations -per project (check `CONAN_USER_HOME` env variable) or to store the configuration in some external -file or repository so you can shared and install it using one command (`conan config install ...`). - -### Use recipe revisions and lockfiles - -If you don't want to deploy and maintain your own Artifactory instance, you can isolate from -changes in upstream recipes in ConanCenter using [recipe revisions](https://docs.conan.io/en/latest/versioning/revisions.html) -and [lockfiles](https://docs.conan.io/en/latest/versioning/lockfiles.html) (please, read linked Conan documentation for more detailed -explanation). - -Recipe revisions and lockfiles can be used to define exactly the binary you want to use in -your project. **Nothing is removed from ConanCenter**, even if the recipe is modified and new -binaries are generated for the same configurations, existing binaries are still there, you -just need to instruct Conan to use them even if new ones are available. - -**Recipe revisions** are the way to tell Conan to use a specific snapshot of the recipe. It -is a hash added to the reference and can be used in Conan at the same place as regular -revisions: - - * In the command line: - - ```sh - conan install openssl/3.0.1@#1955937e88f13a02aa4fdae98c3f9fb8 - ``` - - * In a `conanfile.txt` file: - - ```txt - [requires] - openssl/3.0.1@#1955937e88f13a02aa4fdae98c3f9fb8 - ``` - -If you use explicit recipe revisions in your project you can be sure that Conan will always use -the same recipe revision of those references. You might get new binaries if the same -configuration (same packageID) is built again for the same recipe revision, but that is not -going to be a _compatibility problem_. - -This might not be enough for some projects, where you want -to be sure nothing is modified, not just the revisions you are listing explicitly but also any -other transitive dependency, this is what lockfiles are for. - -**Lockfiles** are files where all the information about requirements is written: recipe -revisions, package IDs and package revisions. You can create a lockfile with all the -dependencies for your project once you are happy with them, and use that same lockfile -with every Conan command. Conan will always build the same graph (the locked one) and -will always retrieve the same recipes and binaries. +This has always been a concern from ConanCenter consumers. -Then, it would be up to you to generate a new lockfile if you want to introduce new revisions -for existing references. +Conan is very flexible; you can add your own remote or modify your client’s configuration for more granularity. We see the majority of Conan users hosting their own remote, and only consuming packages from there. For production this is the recommended way to add some infrastructure to ensure stability. This is generally a good practice when relying on package managers - not just Conan. -The two basic commands you need to know ([full docs here](https://docs.conan.io/en/latest/versioning/lockfiles.html)): +Here are a few choices: - * Create lockfile from `conanfile.txt` file: +- [Running your own Conan Server](https://docs.conan.io/en/latest/uploading_packages/running_your_server.html) - great for local ad-hoc setups +- [Cache recipes in your own ArtifactoryCE](https://docs.conan.io/en/latest/uploading_packages/using_artifactory.html) - recommended for production environments - ```sh - conan lock create conanfile.txt --lockfile-out=locks/project.lock - ``` +Using your own ArtifactoryCE instance is easy. You can [deploy it on-premise](https://conan.io/downloads.html) or use a +[cloud provided solution](https://jfrog.com/community/start-free) for **free**. Your project should +[use only this remote](https://docs.conan.io/en/latest/reference/commands/misc/remote.html?highlight=add%20new) and new recipe +revisions are only pushed to your Artifactory after they have been validated in your project. - * Consume a lockfile: +The minimum solution, if still choosing to rely on ConanCenter directly, involves small changes to your client configuration by pinning the revision of every reference you consume in your project using using: - ```sh - conan install conanfile.txt --lockfile=locks/project.lock - ``` +- [recipe revision (RREV)](https://docs.conan.io/en/latest/versioning/revisions.html) can be added to each requirement. + Instead of `fmt/9.1.0` you can add a pound (or hashtag) to the end followed by the revision `fmt/9.1.0#c93359fba9fd21359d8db6f875d8a233`. + This feature needs to be enabled in Conan 1.x, see the [Activation Instructions](https://docs.conan.io/en/latest/versioning/revisions.html#how-to-activate-the-revisions) for details. +- [Lockfiles](https://docs.conan.io/en/latest/versioning/lockfiles.html) can be created with the `conan lock create` and read with by + adding `--lockfile=conan.lock` to `conan install` or `conan create` commands. See the [lockfile introduction](https://docs.conan.io/en/latest/versioning/lockfiles/introduction.html#) for more information. + +> **Warning** Please, be aware there are some known bugs related to lockfiles that are not being fixed in Conan v1.x - we are really excited for the 2.0 improvements to be widely used. -If your project is managing several configurations, you would probably like to have a look to [base lockfiles](https://docs.conan.io/en/latest/versioning/lockfiles/configurations.html#base-lockfiles) and [lockfile bundles](https://docs.conan.io/en/latest/versioning/lockfiles/bundle.html) in the documentation. +Both of these give you better control and will allow you to choose when to upgrade your Conan client. --- diff --git a/docs/faqs.md b/docs/faqs.md index dc593ab6cc44d..5590be0eed8b2 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -341,21 +341,8 @@ You should expect that latest revision of recipes can introduce breaking changes features that will be broken unless you also upgrade Conan client (and sometimes you will need to modify your project if the recipe changes the binaries, flags,... it provides). -To isolate from this changes there are different strategies you can follow: - -The minimum solution involves small changes to your Conan client configuration by - -* **Pin the version of every reference you consume in your project** using either: - * [recipe revision (RREV)](https://docs.conan.io/en/latest/versioning/revisions.html): `foo/1.0@#RREV` instead of `foo/1.0` in your conanfile. - * [lockfiles](https://docs.conan.io/en/latest/versioning/lockfiles/introduction.html) (please, be aware there are some [knowns bugs](https://github.com/conan-io/conan/issues?q=is%3Aissue+lockfile) related to lockfiles that are not being fixed in Conan v1.x). - -For larger projects and teams it is recommended to add some infrastructure to ensure stability by - - * **Cache recipes in your own Artifactory**: your project should use only this remote and - new recipe revisions are only pushed to your Artifactory after they have been validated - in your project. - -Keep reading in the [consuming recipes section](consuming_recipes.md). +To isolate from these changes there are different strategies you can follow. +Keep reading in the [consuming recipes section](consuming_recipes.md#isolate-your-project-from-upstream-changes). ## Why are version ranges not allowed? From b9250494fb3dc7dd6880b380940f433e56911130 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 12:37:14 +0200 Subject: [PATCH 018/561] (#12873) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/consuming_recipes.md | 4 +--- docs/faqs.md | 7 ++++--- docs/v2_linter.md | 7 ++++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/consuming_recipes.md b/docs/consuming_recipes.md index 76ca03884f40f..a33b280631cd0 100644 --- a/docs/consuming_recipes.md +++ b/docs/consuming_recipes.md @@ -8,9 +8,7 @@ to be possible. There are usually waves of new features, patches and fixes that ## Contents * [Breaking changes](#breaking-changes) - * [Isolate your project from upstream changes](#isolate-your-project-from-upstream-changes) - * [Use your own Artifactory instance](#use-your-own-artifactory-instance) - * [Use recipe revisions and lockfiles](#use-recipe-revisions-and-lockfiles) + * [Isolate your project from upstream changes](#isolate-your-project-from-upstream-changes) ## Breaking changes diff --git a/docs/faqs.md b/docs/faqs.md index 5590be0eed8b2..51f67dd65eab4 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -15,14 +15,15 @@ This section gathers the most common questions from the community related to pac * [What version should packages use for libraries without official releases?](#what-version-should-packages-use-for-libraries-without-official-releases) * [Is the Jenkins orchestration library publicly available?](#is-the-jenkins-orchestration-library-publicly-available) * [Why not x86 binaries?](#why-not-x86-binaries) - * [But if there are no packages available, what will the x86 validation look like?](#but-if-there-are-no-packages-available-what-will-the-x86-validation-look-like) + * [But if there are no packages available, what will the x86 validation look like?](#but-if-there-are-no-packages-available-what-will-the-x86-validation-look-like) * [Why PDB files are not allowed?](#why-pdb-files-are-not-allowed) - * [Why is there no option for PDB, as there is for fPIC?](#why-is-there-no-option-for-pdb-as-there-is-for-fpic) + * [Why is there no option for PDB, as there is for fPIC?](#why-is-there-no-option-for-pdb-as-there-is-for-fpic) * [Can I remove an option from a recipe?](#can-i-remove-an-option-from-a-recipe) * [Can I split a project into an installer and library package?](#can-i-split-a-project-into-an-installer-and-library-package) * [What license should I use for Public Domain?](#what-license-should-i-use-for-public-domain) * [What license should I use for a custom project specific license?](#what-license-should-i-use-for-a-custom-project-specific-license) - * [Why is a `tools.check_min_cppstd` call not enough?](#why-is-a-toolscheck_min_cppstd-call-not-enough) + * [How do I flag a problem to a recipe consumer?](#how-do-i-flag-a-problem-to-a-recipe-consumer) + * [Why is a `build.check_min_cppstd` call not enough?](#why-is-a-buildcheck_min_cppstd-call-not-enough) * [What is the policy for adding older versions of a package?](#what-is-the-policy-for-adding-older-versions-of-a-package) * [What is the policy for removing older versions of a package?](#what-is-the-policy-for-removing-older-versions-of-a-package) * [Can I install packages from the system package manager?](#can-i-install-packages-from-the-system-package-manager) diff --git a/docs/v2_linter.md b/docs/v2_linter.md index 54aa81f9edcc4..a048fd4fd2aa3 100644 --- a/docs/v2_linter.md +++ b/docs/v2_linter.md @@ -1,7 +1,12 @@ # Linter to help migration to Conan v2 - +## Contents + + * [Import ConanFile from `conan`](#import-conanfile-from-conan) + * [Import tools from `conan`](#import-tools-from-conan) + * [Disable linter for a specific conanfile](#disable-linter-for-a-specific-conanfile) + * [Running the linter locally](#running-the-linter-locally) On our [path to Conan v2](v2_roadmap.md) we are leveraging on custom Pylint rules. This linter will run for every pull-request that is submitted to the repository and will From a10e63147ecccad4bf0c9a61b6ff222f9f30fb6c Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 14 Sep 2022 12:51:27 +0200 Subject: [PATCH 019/561] (#12861) [tomlplusplus] Cross compatibility for Conan 1.x and 2.x * Update tomlcpp Signed-off-by: Uilian Ries * Remove old versions Signed-off-by: Uilian Ries * fix configuration path on Windows Signed-off-by: Uilian Ries * Linter fix Co-authored-by: Chris Mc Signed-off-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/tomlplusplus/all/conandata.yml | 42 +++------- recipes/tomlplusplus/all/conanfile.py | 77 ++++++++++--------- .../all/test_package/CMakeLists.txt | 9 +-- .../all/test_package/conanfile.py | 34 +++++--- .../all/test_package/test_package.cpp | 4 +- .../all/test_package/test_package_multi.cpp | 4 +- .../all/test_v1_package/CMakeLists.txt | 17 ++++ .../all/test_v1_package/conanfile.py | 29 +++++++ recipes/tomlplusplus/config.yml | 20 +---- 9 files changed, 130 insertions(+), 106 deletions(-) create mode 100644 recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tomlplusplus/all/test_v1_package/conanfile.py diff --git a/recipes/tomlplusplus/all/conandata.yml b/recipes/tomlplusplus/all/conandata.yml index 18f7762d37f25..87d4f28e27277 100644 --- a/recipes/tomlplusplus/all/conandata.yml +++ b/recipes/tomlplusplus/all/conandata.yml @@ -1,34 +1,16 @@ sources: - "1.2.3": - url: "https://github.com/marzer/tomlplusplus/archive/v1.2.3.tar.gz" - sha256: "ead2900cc1123e3c6eb61267396aa6358597366598d199ff62cae4fe22f1cca7" - "1.3.0": - url: "https://github.com/marzer/tomlplusplus/archive/v1.3.0.tar.gz" - sha256: "b857813083c7e8937cd559887c994f1df44bcb779d830af369dae46f379c3f57" - "1.3.3": - url: "https://github.com/marzer/tomlplusplus/archive/v1.3.3.tar.gz" - sha256: "1553cdecbfceb890da77895356ed471792e29362af701fe1f08b55c8a42ec746" - "2.0.0": - url: "https://github.com/marzer/tomlplusplus/archive/v2.0.0.tar.gz" - sha256: "01cf0f659bd70493dbe51c161feb598ffed68d67bcc7f2984aec4b544c368f91" - "2.1.0": - url: "https://github.com/marzer/tomlplusplus/archive/v2.1.0.tar.gz" - sha256: "c741c95ddc01ee7993c1a426db5cb4d2e35e16f3f240012efdebfdf55712ba38" - "2.2.0": - url: "https://github.com/marzer/tomlplusplus/archive/v2.2.0.tar.gz" - sha256: "b7d5878cb324582086435d81ec4498b7bc05feab8a89c51f9cf9a8bf7e07b704" - "2.3.0": - url: "https://github.com/marzer/tomlplusplus/archive/v2.3.0.tar.gz" - sha256: "2b832ef30fb4a1f5bcea831b126febd173f28381f7f37112865dd1bdc5e991e0" - "2.4.0": - url: "https://github.com/marzer/tomlplusplus/archive/v2.4.0.tar.gz" - sha256: "d7c28b25374241afa08c60183717d3025aa8abffe1030928dc7e1d2143852da1" - "2.5.0": - url: "https://github.com/marzer/tomlplusplus/archive/v2.5.0.tar.gz" - sha256: "2e246ee126cfb7bd68edd7285d5bb5c8c5296121ce809306ee71cfd6127c76a6" - "3.0.1": - url: "https://github.com/marzer/tomlplusplus/archive/v3.0.1.tar.gz" - sha256: "e05b2814b891e223d7546aa2408d6cba0628164a84ac453205c7743cb667b9cf" + "3.2.0": + url: "https://github.com/marzer/tomlplusplus/archive/v3.2.0.tar.gz" + sha256: "aeba776441df4ac32e4d4db9d835532db3f90fd530a28b74e4751a2915a55565" "3.1.0": url: "https://github.com/marzer/tomlplusplus/archive/v3.1.0.tar.gz" sha256: "dae72714fc356ca1b019298d9e6275cc41ba95546ae722ccdb6795e92f47762e" + "3.0.1": + url: "https://github.com/marzer/tomlplusplus/archive/v3.0.1.tar.gz" + sha256: "e05b2814b891e223d7546aa2408d6cba0628164a84ac453205c7743cb667b9cf" + "2.5.0": + url: "https://github.com/marzer/tomlplusplus/archive/v2.5.0.tar.gz" + sha256: "2e246ee126cfb7bd68edd7285d5bb5c8c5296121ce809306ee71cfd6127c76a6" + "1.3.3": + url: "https://github.com/marzer/tomlplusplus/archive/v1.3.3.tar.gz" + sha256: "1553cdecbfceb890da77895356ed471792e29362af701fe1f08b55c8a42ec746" diff --git a/recipes/tomlplusplus/all/conanfile.py b/recipes/tomlplusplus/all/conanfile.py index 79bdb14d5851c..c919e5fc7388e 100644 --- a/recipes/tomlplusplus/all/conanfile.py +++ b/recipes/tomlplusplus/all/conanfile.py @@ -1,27 +1,25 @@ -from conans import ConanFile, tools +from conan import ConanFile from conan.tools.microsoft import is_msvc -from conans.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.files import get, copy +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" + +required_conan_version = ">=1.51.3" + class TomlPlusPlusConan(ConanFile): name = "tomlplusplus" description = "Header-only TOML config file parser and serializer for modern C++." - topics = ("tomlformoderncpp", "toml++", "tomlplusplus", - "toml", "json", "header-only", "single-header") + topics = ("tomlformoderncpp", "tomlcpp", "toml", "json", "header-only") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/marzer/tomlplusplus" license = "MIT" - settings = ("compiler",) - options = {"multiple_headers": [True, False, "deprecated"]} - default_options = {"multiple_headers": "deprecated"} + settings = ("compiler", "arch", "os", "build_type") no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _minimum_cpp_standard(self): return 17 @@ -29,45 +27,48 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): return { - "Visual Studio": "16" if tools.Version(self.version) < "2.2.0" or tools.Version(self.version) >= "3.0.0" else "15", + "Visual Studio": "16" if Version(self.version) < "2.2.0" or Version(self.version) >= "3.0.0" else "15", + "msvc": "1913", "gcc": "7", "clang": "5", "apple-clang": "10", } def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): - if self.options.multiple_headers != "deprecated": - self.output.warn("The {} option 'multiple_headers' has been deprecated. Both formats are in the same package.") - - if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get( - str(self.settings.compiler)) + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + compiler = f"{self.settings.compiler} {self.settings.compiler.version}" if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler)) + self.output.warn(f"{self.ref} recipe lacks information about the {self.settings.compiler} compiler support.") else: - if tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires c++17 support. The current compiler {} {} does not support it.".format( - self.name, self.settings.compiler, self.settings.compiler.version)) + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.ref} requires c++{self._minimum_cpp_standard} support." + " The current compiler {compiler} does not support it.") - if self.settings.compiler == "apple-clang" and tools.Version(self.version) < "2.3.0": - raise ConanInvalidConfiguration("The current compiler {} {} is supported in version >= 2.3.0".format( - self.settings.compiler, self.settings.compiler.version)) + if self.settings.compiler == "apple-clang" and Version(self.version) < "2.3.0": + raise ConanInvalidConfiguration(f"The compiler {compiler} is supported in version >= 2.3.0") - if is_msvc(self) and tools.Version(self.version) == "2.1.0": - raise ConanInvalidConfiguration("The current compiler {} {} is unable to build version 2.1.0".format( - self.settings.compiler, self.settings.compiler.version)) + if is_msvc(self) and Version(self.version) == "2.1.0": + raise ConanInvalidConfiguration(f"The current compiler {compiler} is unable to build version 2.1.0") 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], destination=self.source_folder, strip_root=True) def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.h**", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="*.inl", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="toml.hpp", dst="include", src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h**", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.inl", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="toml.hpp", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + self.cpp_info.set_property("cmake_file_name", "tomlplusplus") + self.cpp_info.set_property("cmake_target_name", "tomlplusplus::tomlplusplus") diff --git a/recipes/tomlplusplus/all/test_package/CMakeLists.txt b/recipes/tomlplusplus/all/test_package/CMakeLists.txt index 8ae698cd63713..05dc03af86034 100644 --- a/recipes/tomlplusplus/all/test_package/CMakeLists.txt +++ b/recipes/tomlplusplus/all/test_package/CMakeLists.txt @@ -1,17 +1,14 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(tomlplusplus REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} tomlplusplus::tomlplusplus) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) if(NOT DEFINED TOMLPP_BUILD_SINGLE_ONLY) add_executable(${PROJECT_NAME}_multi test_package_multi.cpp) target_link_libraries(${PROJECT_NAME}_multi tomlplusplus::tomlplusplus) - set_property(TARGET ${PROJECT_NAME}_multi PROPERTY CXX_STANDARD 17) + target_compile_features(${PROJECT_NAME}_multi PRIVATE cxx_std_17) endif() diff --git a/recipes/tomlplusplus/all/test_package/conanfile.py b/recipes/tomlplusplus/all/test_package/conanfile.py index 8f87945239e5b..db279683bd8cc 100644 --- a/recipes/tomlplusplus/all/test_package/conanfile.py +++ b/recipes/tomlplusplus/all/test_package/conanfile.py @@ -1,26 +1,36 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.scm import Version import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) - if tools.Version(self.deps_cpp_info["tomlplusplus"].version) < "1.3.0": + if Version(self.deps_cpp_info["tomlplusplus"].version) < "1.3.0": self.single_header_only = True - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "8": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": self.single_header_only = True - if hasattr(self, "single_header_only"): - cmake.definitions["TOMLPP_BUILD_SINGLE_ONLY"] = True - cmake.configure() + variables = {"TOMLPP_BUILD_SINGLE_ONLY": True} if hasattr(self, "single_header_only") else None + cmake.configure(variables=variables) 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + conf_path = os.path.join(self.recipe_folder, "configuration.toml") + self.run(f"{bin_path} {conf_path}", env="conanrun") if not hasattr(self, "single_header_only"): - bin_path_multi = os.path.join("bin", "test_package_multi") - self.run(bin_path_multi, run_environment=True) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_multi") + self.run(f"{bin_path} {conf_path}", env="conanrun") diff --git a/recipes/tomlplusplus/all/test_package/test_package.cpp b/recipes/tomlplusplus/all/test_package/test_package.cpp index 77de87f488b35..d50b3c6469741 100644 --- a/recipes/tomlplusplus/all/test_package/test_package.cpp +++ b/recipes/tomlplusplus/all/test_package/test_package.cpp @@ -5,8 +5,8 @@ using namespace std::string_view_literals; -int main() { - auto config = toml::parse_file( "../../configuration.toml" ); +int main(int argc, char* argv[]) { + auto config = toml::parse_file(argv[1]); // get key-value pairs std::string_view library_name = config["library"]["name"].value_or(""sv); diff --git a/recipes/tomlplusplus/all/test_package/test_package_multi.cpp b/recipes/tomlplusplus/all/test_package/test_package_multi.cpp index 42a9220443b6e..df195938cfdee 100644 --- a/recipes/tomlplusplus/all/test_package/test_package_multi.cpp +++ b/recipes/tomlplusplus/all/test_package/test_package_multi.cpp @@ -5,8 +5,8 @@ using namespace std::string_view_literals; -int main() { - auto config = toml::parse_file( "../../configuration.toml" ); +int main(int argc, char* argv[]) { + auto config = toml::parse_file(argv[1]); // get key-value pairs std::string_view library_name = config["library"]["name"].value_or(""sv); diff --git a/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt b/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..784a2cef5f284 --- /dev/null +++ b/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tomlplusplus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} tomlplusplus::tomlplusplus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +if(NOT DEFINED TOMLPP_BUILD_SINGLE_ONLY) + add_executable(${PROJECT_NAME}_multi ../test_package/test_package_multi.cpp) + target_link_libraries(${PROJECT_NAME}_multi tomlplusplus::tomlplusplus) + target_compile_features(${PROJECT_NAME}_multi PRIVATE cxx_std_17) +endif() diff --git a/recipes/tomlplusplus/all/test_v1_package/conanfile.py b/recipes/tomlplusplus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..aba957cc3efa9 --- /dev/null +++ b/recipes/tomlplusplus/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, CMake +from conan.tools.scm import Version +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + if Version(self.deps_cpp_info["tomlplusplus"].version) < "1.3.0": + self.single_header_only = True + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": + self.single_header_only = True + if hasattr(self, "single_header_only"): + cmake.definitions["TOMLPP_BUILD_SINGLE_ONLY"] = True + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + conf_path = os.path.join(self.recipe_folder, "..", "test_package", "configuration.toml") + self.run(f"{bin_path} {conf_path}", run_environment=True) + if not hasattr(self, "single_header_only"): + bin_path = os.path.join("bin", "test_package_multi") + self.run(f"{bin_path} {conf_path}", run_environment=True) diff --git a/recipes/tomlplusplus/config.yml b/recipes/tomlplusplus/config.yml index 954a0985e0476..88f0048a82e4a 100644 --- a/recipes/tomlplusplus/config.yml +++ b/recipes/tomlplusplus/config.yml @@ -1,23 +1,11 @@ versions: - "1.2.3": + "3.2.0": folder: all - "1.3.0": - folder: all - "1.3.3": - folder: all - "2.0.0": - folder: all - "2.1.0": - folder: all - "2.2.0": - folder: all - "2.3.0": + "3.1.0": folder: all - "2.4.0": + "3.0.1": folder: all "2.5.0": folder: all - "3.0.1": - folder: all - "3.1.0": + "1.3.3": folder: all From 5213cc3bf8995438e9aca72a0fab9a3918ec8bc4 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Sep 2022 20:25:17 +0900 Subject: [PATCH 020/561] (#12865) cpp-peglib: add version 1.8.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/cpp-peglib/1.x.x/conandata.yml | 3 +++ recipes/cpp-peglib/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cpp-peglib/1.x.x/conandata.yml b/recipes/cpp-peglib/1.x.x/conandata.yml index 192ad7d819240..10e024d656124 100644 --- a/recipes/cpp-peglib/1.x.x/conandata.yml +++ b/recipes/cpp-peglib/1.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.1": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.1.tar.gz" + sha256: "15d7c39d01780bb6f27db511722936d82d04cb1f5a6c63025021ff5dfe5fe1b2" "1.8.0": url: "https://github.com/yhirose/cpp-peglib/archive/refs/tags/v1.8.0.tar.gz" sha256: "63dc755afb5072ba58468fa39d1037ebadc1206c489b0493d635147524cf5379" diff --git a/recipes/cpp-peglib/config.yml b/recipes/cpp-peglib/config.yml index 6205ac1f0d16f..9d1386b25f649 100644 --- a/recipes/cpp-peglib/config.yml +++ b/recipes/cpp-peglib/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.1": + folder: "1.x.x" "1.8.0": folder: "1.x.x" "1.6.1": From be3dcda9ffc20ee7c9c92fa375cf80dcf6a1cec1 Mon Sep 17 00:00:00 2001 From: Alejandro Ramallo Date: Wed, 14 Sep 2022 07:46:16 -0400 Subject: [PATCH 021/561] (#12795) fixes android-ndk regression with CMakeToolchain * fixes #12723 * added comment explaining ndk toolchain --- recipes/android-ndk/all/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/android-ndk/all/conanfile.py b/recipes/android-ndk/all/conanfile.py index 5e792a8a7deac..290a4f0c04da2 100644 --- a/recipes/android-ndk/all/conanfile.py +++ b/recipes/android-ndk/all/conanfile.py @@ -286,7 +286,10 @@ def package_info(self): self.env_info.CONAN_CMAKE_PROGRAM = cmake_wrapper toolchain = os.path.join(self.package_folder, "build", "cmake", "android.toolchain.cmake") - self.conf_info.prepend("tools.cmake.cmaketoolchain:user_toolchain", toolchain) + + #CMakeToolchain automatically adds the standard Android toolchain file that ships with the NDK + #when `tools.android:ndk_path` is provided, so there's no need to add it as a `user_toolchain` + self.conf_info.define("tools.android:ndk_path", self.package_folder) self.buildenv_info.define_path("CC", self._define_tool_var("CC", "clang")) self.buildenv_info.define_path("CXX", self._define_tool_var("CXX", "clang++")) @@ -319,7 +322,6 @@ def package_info(self): libcxx_str = str(self.settings_target.compiler.libcxx) self.buildenv_info.define("ANDROID_STL", libcxx_str if libcxx_str.startswith("c++_") else "c++_shared") - self.conf_info.define("tools.android:ndk_path", self.package_folder) # TODO: conan v1 stuff to remove later self.env_info.PATH.append(self.package_folder) From 0e3f2c581a4c6d3eca2491b33fcfa1a33ca3ec83 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Wed, 14 Sep 2022 16:58:56 +0200 Subject: [PATCH 022/561] (#12870) [bot] Add Access Request users (2022-09-08) --- .c3i/authorized_users.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 3c20b5b172cd0..69a646218d260 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -931,3 +931,5 @@ authorized_users: - "JorgenPo" - "AlexRamallo" - "kissandras" + - "scandyna" + - "jave27" From c93e5d5835433cadcaee258a966e96f590fa1bcb Mon Sep 17 00:00:00 2001 From: Artem Vasiliev Date: Wed, 14 Sep 2022 19:44:33 +0300 Subject: [PATCH 023/561] (#12003) opencore-amr/0.1.6: bump library version * opencore-amr: Added version 0.1.6 of the library * Fixed warning and started migration for conan 2.0 * Revert rename function path * Bump automake version * Modernize * Fix imports * fix rm command arguments --- recipes/opencore-amr/all/conandata.yml | 3 ++ recipes/opencore-amr/all/conanfile.py | 54 +++++++++++++++++--------- recipes/opencore-amr/config.yml | 2 + 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/recipes/opencore-amr/all/conandata.yml b/recipes/opencore-amr/all/conandata.yml index dabe33b6467ab..44a009a38d2e0 100644 --- a/recipes/opencore-amr/all/conandata.yml +++ b/recipes/opencore-amr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.6": + url: "https://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.6.tar.gz" + sha256: "483eb4061088e2b34b358e47540b5d495a96cd468e361050fae615b1809dc4a1" "0.1.5": url: "https://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz" sha256: "2c006cb9d5f651bfb5e60156dbff6af3c9d35c7bbcc9015308c0aff1e14cd341" diff --git a/recipes/opencore-amr/all/conanfile.py b/recipes/opencore-amr/all/conanfile.py index 0db57e278a137..3c1ebbcb2a163 100644 --- a/recipes/opencore-amr/all/conanfile.py +++ b/recipes/opencore-amr/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conan import ConanFile +from conan.tools import files +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment +from conans.tools import environment_append, get_env, os_info, vcvars, unix_path from contextlib import contextmanager import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class OpencoreAmrConan(ConanFile): @@ -18,7 +23,7 @@ class OpencoreAmrConan(ConanFile): "fPIC": [True, False], } default_options = { - "shared": False, + "shared": False, "fPIC": True, } @@ -41,26 +46,26 @@ def configure(self): del self.options.fPIC def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + if self._settings_build.os == "Windows" and not get_env("CONAN_BASH_PATH"): self.build_requires("msys2/cci.latest") if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.4") + self.build_requires("automake/1.16.5") def source(self): - tools.get(**self.conan_data["sources"][self.version], + files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) @contextmanager def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): + if is_msvc(self): + with vcvars(self): env = { "CC": "cl -nologo", "CXX": "cl -nologo", "LD": "link -nologo", - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), + "AR": "{} lib".format(unix_path(self.deps_user_info["automake"].ar_lib)), } - with tools.environment_append(env): + with environment_append(env): yield else: yield @@ -68,17 +73,20 @@ def _build_context(self): def _configure_autotools(self): if self._autotools: return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - yes_no = lambda v: "yes" if v else "no" + self._autotools = AutoToolsBuildEnvironment( + self, win_bash=os_info.is_windows) + + def yes_no(v): return "yes" if v else "no" args = [ "--enable-shared={}".format(yes_no(self.options.shared)), "--enable-static={}".format(yes_no(not self.options.shared)), ] - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self._autotools.cxx_flags.append("-EHsc") - if tools.Version(self.settings.compiler.version) >= "12": + if Version(self.settings.compiler.version) >= "12": self._autotools.flags.append("-FS") - self._autotools.configure(args=args, configure_dir=self._source_subfolder) + self._autotools.configure( + args=args, configure_dir=self._source_subfolder) return self._autotools def build(self): @@ -89,14 +97,22 @@ def build(self): def package(self): self._autotools.install() self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + files.rm(self, "*.la", os.path.join(self.package_folder, "lib")) + files.rmdir(self, os.path.join( + self.package_folder, "lib", "pkgconfig")) if self.settings.compiler == "Visual Studio" and self.options.shared: for lib in ("opencore-amrwb", "opencore-amrnb"): - tools.rename(os.path.join(self.package_folder, "lib", "{}.dll.lib".format(lib)), + files.rename(self, os.path.join(self.package_folder, "lib", "{}.dll.lib".format(lib)), os.path.join(self.package_folder, "lib", "{}.lib".format(lib))) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "opencore-amr") + self.cpp_info.set_property( + "cmake_target_name", "opencore-amr::opencore-amr") for lib in ("opencore-amrwb", "opencore-amrnb"): - self.cpp_info.components[lib].names["pkg_config"] = lib + self.cpp_info.components[lib].set_property( + "cmake_target_name", f'opencore-amr::{lib}') + self.cpp_info.components[lib].set_property("pkg_config_name", lib) self.cpp_info.components[lib].libs = [lib] + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generator removed + self.cpp_info.components[lib].names["pkg_config"] = lib diff --git a/recipes/opencore-amr/config.yml b/recipes/opencore-amr/config.yml index 08750607a91c8..b59a632b1da64 100644 --- a/recipes/opencore-amr/config.yml +++ b/recipes/opencore-amr/config.yml @@ -1,3 +1,5 @@ versions: + "0.1.6": + folder: "all" "0.1.5": folder: "all" From 82767ad0a134c4e7caca0cc3beb50eb2279b184d Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 14 Sep 2022 19:04:56 +0200 Subject: [PATCH 024/561] (#12386) [libpng] Conan v2 support * Conan v2 support Signed-off-by: Uilian Ries * update generators Signed-off-by: Uilian Ries * Link libpng Signed-off-by: Uilian Ries * required conan version Signed-off-by: Uilian Ries * use self.conf Signed-off-by: Uilian Ries * Add 1.5.30 Signed-off-by: Uilian Ries * Remove symlink Signed-off-by: Uilian Ries * Remove symlink Signed-off-by: Uilian Ries * Use symlink as main library Signed-off-by: Uilian Ries * add lib prefix and suffix Signed-off-by: Uilian Ries * remove suffix Signed-off-by: Uilian Ries * Fix patch file name Signed-off-by: Uilian Ries * skip Mac m1 for 1.5 Signed-off-by: Uilian Ries * skip cross build on mac Signed-off-by: Uilian Ries * Improve message error Signed-off-by: Uilian Ries * fix lib name on Windows^ Signed-off-by: Uilian Ries * Support cross on Mac Signed-off-by: Uilian Ries * Fix debug suffix on Windows Signed-off-by: Uilian Ries * skip Mac M1 on 1.5 Signed-off-by: Uilian Ries * fix build_type Signed-off-by: Uilian Ries * Requires Conan 1.51.3 Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Remove pkg_config_name legacy Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Enforce source folder Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/libpng/all/CMakeLists.txt | 11 -- recipes/libpng/all/conandata.yml | 20 ++- recipes/libpng/all/conanfile.py | 134 +++++++++--------- .../patches/0001-1.5.30-cmakefile-zlib.patch | 49 +++++++ ...patch => 0001-1.6.37-cmakefile-zlib.patch} | 0 .../all/patches/CMakeLists-ext-zlib.patch | 53 ------- .../all/patches/CMakeLists-symlink.patch | 90 ------------ .../libpng/all/test_package/CMakeLists.txt | 7 +- recipes/libpng/all/test_package/conanfile.py | 30 ++-- .../libpng/all/test_package/test_package.c | 18 +-- .../libpng/all/test_v1_package/CMakeLists.txt | 10 ++ .../libpng/all/test_v1_package/conanfile.py | 29 ++++ recipes/libpng/config.yml | 2 +- 13 files changed, 193 insertions(+), 260 deletions(-) delete mode 100644 recipes/libpng/all/CMakeLists.txt create mode 100644 recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch rename recipes/libpng/all/patches/{CMakeLists-zlib.patch => 0001-1.6.37-cmakefile-zlib.patch} (100%) delete mode 100644 recipes/libpng/all/patches/CMakeLists-ext-zlib.patch delete mode 100644 recipes/libpng/all/patches/CMakeLists-symlink.patch create mode 100644 recipes/libpng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpng/all/test_v1_package/conanfile.py diff --git a/recipes/libpng/all/CMakeLists.txt b/recipes/libpng/all/CMakeLists.txt deleted file mode 100644 index 0aeaf02f84c88..0000000000000 --- a/recipes/libpng/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -if(NOT CMAKE_SYSTEM_PROCESSOR) - set(CMAKE_SYSTEM_PROCESSOR ${CONAN_LIBPNG_SYSTEM_PROCESSOR}) -endif() - -add_subdirectory("source_subfolder") diff --git a/recipes/libpng/all/conandata.yml b/recipes/libpng/all/conandata.yml index f76e631ded6c4..e9cde1c021d15 100644 --- a/recipes/libpng/all/conandata.yml +++ b/recipes/libpng/all/conandata.yml @@ -2,19 +2,15 @@ sources: "1.6.37": url: "https://github.com/glennrp/libpng/archive/v1.6.37.tar.gz" sha256: "ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307" - "1.5.2": - url: "https://github.com/glennrp/libpng/archive/v1.5.2.tar.gz" - sha256: "6b27e93ff12993fc76c6c7bee4f4be49eac71984af55f0dee45ab2b70fa090e7" + "1.5.30": + url: "https://github.com/glennrp/libpng/archive/v1.5.30.tar.gz" + sha256: "738e2eb31abc1140f2d6c914f0f69748b49f2ae7ffc05e7a073abafc08f37441" patches: "1.6.37": - - patch_file: "patches/CMakeLists-zlib.patch" - base_path: "source_subfolder" - "1.5.2": - - patch_file: "patches/CMakeLists-symlink.patch" - patch_description: "Fix symlink macro call for Linux debug builds. Previously it was attempting to symlink libpng to libpng15 that did not exist in debug builds." - patch_type: "portability" - base_path: "source_subfolder" - - patch_file: "patches/CMakeLists-ext-zlib.patch" + - patch_file: "patches/0001-1.6.37-cmakefile-zlib.patch" + patch_description: "Update ZLib include and library paths for conan to provide lib. Remove Zlib dll definition." + patch_type: "backport" + "1.5.30": + - patch_file: "patches/0001-1.5.30-cmakefile-zlib.patch" patch_description: "Update ZLib include and library paths for conan to provide lib. Remove Zlib dll definition." patch_type: "backport" - base_path: "source_subfolder" diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index 7ef447e90217c..1db57c71fff2b 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/all/conanfile.py @@ -1,11 +1,15 @@ -import os -from conans import CMake, tools from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.scm import Version -from conan.tools.files import apply_conandata_patches, get, rm, rmdir, replace_in_file +from conan.tools.files import apply_conandata_patches, get, rmdir, replace_in_file, copy, rm +from conan.tools.microsoft import is_msvc from conan.tools.build.cross_building import cross_building +from conan.tools.apple import is_apple_os +from conan.errors import ConanInvalidConfiguration +import os + -required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" +required_conan_version = ">=1.51.3" class LibpngConan(ConanFile): @@ -14,7 +18,7 @@ class LibpngConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.libpng.org" license = "libpng-2.0" - topics = ("png", "libpng") + topics = ("png", "graphics", "image") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,7 +27,7 @@ class LibpngConan(ConanFile): "msa": [True, False], "sse": [True, False], "vsx": [True, False], - "api_prefix": "ANY", + "api_prefix": ["ANY"], } default_options = { "shared": False, @@ -35,17 +39,6 @@ class LibpngConan(ConanFile): "api_prefix": "", } - generators = ["cmake", "cmake_find_package"] - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _has_neon_support(self): return "arm" in self.settings.arch @@ -63,9 +56,8 @@ def _has_vsx_support(self): return "ppc" in self.settings.arch def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -81,35 +73,39 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass def requirements(self): self.requires("zlib/1.2.12") def source(self): get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch(self): - if Version(self.version) > "1.5.2": - replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), - "find_library(M_LIBRARY m)", - "set(M_LIBRARY m)") + destination=self.source_folder, strip_root=True) - if tools.os_info.is_windows: - if self._is_msvc: + def _patch_source(self): + if self.settings.os == "Windows": + if is_msvc(self): if Version(self.version) <= "1.5.2": - replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)', 'set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME})') else: - replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), 'OUTPUT_NAME "${PNG_LIB_NAME}_static', 'OUTPUT_NAME "${PNG_LIB_NAME}') else: - replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE}', 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $/$ $/${DEST_FILE}') @@ -131,38 +127,47 @@ def _libpng_cmake_system_processor(self): return "powerpc" return str(self.settings.arch) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["PNG_TESTS"] = False - self._cmake.definitions["PNG_SHARED"] = self.options.shared - self._cmake.definitions["PNG_STATIC"] = not self.options.shared - self._cmake.definitions["PNG_DEBUG"] = self.settings.build_type == "Debug" - self._cmake.definitions["PNG_PREFIX"] = self.options.api_prefix - self._cmake.definitions["CMAKE_MACOSX_BUNDLE"] = False # prevents configure error on shared iOS/tvOS/watchOS + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PNG_TESTS"] = False + tc.variables["PNG_SHARED"] = self.options.shared + tc.variables["PNG_STATIC"] = not self.options.shared + tc.variables["PNG_DEBUG"] = self.settings.build_type == "Debug" + tc.variables["PNG_PREFIX"] = self.options.api_prefix if cross_building(self): - self._cmake.definitions["CONAN_LIBPNG_SYSTEM_PROCESSOR"] = self._libpng_cmake_system_processor + system_processor = self.conf.get("tools.cmake.cmaketoolchain:system_processor", + self._libpng_cmake_system_processor, check_type=str) + tc.cache_variables["CMAKE_SYSTEM_PROCESSOR"] = system_processor if self._has_neon_support: - self._cmake.definitions["PNG_ARM_NEON"] = self._neon_msa_sse_vsx_mapping[str(self.options.neon)] + tc.variables["PNG_ARM_NEON"] = self._neon_msa_sse_vsx_mapping[str(self.options.neon)] if self._has_msa_support: - self._cmake.definitions["PNG_MIPS_MSA"] = self._neon_msa_sse_vsx_mapping[str(self.options.msa)] + tc.variables["PNG_MIPS_MSA"] = self._neon_msa_sse_vsx_mapping[str(self.options.msa)] if self._has_sse_support: - self._cmake.definitions["PNG_INTEL_SSE"] = self._neon_msa_sse_vsx_mapping[str(self.options.sse)] + tc.variables["PNG_INTEL_SSE"] = self._neon_msa_sse_vsx_mapping[str(self.options.sse)] if self._has_vsx_support: - self._cmake.definitions["PNG_POWERPC_VSX"] = self._neon_msa_sse_vsx_mapping[str(self.options.vsx)] - self._cmake.configure() - return self._cmake + tc.variables["PNG_POWERPC_VSX"] = self._neon_msa_sse_vsx_mapping[str(self.options.vsx)] + tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def validate(self): + if Version(self.version) < "1.6" and self.info.settings.arch == "armv8" and is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} could not be cross build on Mac.") def build(self): apply_conandata_patches(self) - self._patch() - cmake = self._configure_cmake() + self._patch_source() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() if self.options.shared: rm(self, "*[!.dll]", os.path.join(self.package_folder, "bin")) @@ -173,19 +178,20 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_file_name", "PNG") - self.cpp_info.set_property("cmake_target_name", "PNG::PNG") - self.cpp_info.set_property("pkg_config_name", "libpng") # TODO: we should also create libpng16.pc file + major_min_version = f"{Version(self.version).major}{Version(self.version).minor}" + # TODO: Remove after Conan 2.0 self.cpp_info.names["cmake_find_package"] = "PNG" self.cpp_info.names["cmake_find_package_multi"] = "PNG" - prefix = "lib" if self._is_msvc else "" - major_min_version = f"{Version(self.version).major}{Version(self.version).minor}" - suffix = major_min_version if self._is_msvc else "" - suffix += "d" if self._is_msvc and self.settings.build_type == "Debug" else "" + self.cpp_info.set_property("cmake_file_name", "PNG") + self.cpp_info.set_property("cmake_target_name", "PNG::PNG") + self.cpp_info.set_property("pkg_config_name", "libpng") + self.cpp_info.set_property("pkg_config_aliases", [f"libpng{major_min_version}"]) + prefix = "lib" if is_msvc(self) else "" + suffix = major_min_version if is_msvc(self) else "" + suffix += "d" if is_msvc(self) and self.settings.build_type == "Debug" else "" self.cpp_info.libs = [f"{prefix}png{suffix}"] if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch b/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch new file mode 100644 index 0000000000000..d78bd326e5e4c --- /dev/null +++ b/recipes/libpng/all/patches/0001-1.5.30-cmakefile-zlib.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b861195..8e3d2ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,7 +41,7 @@ set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) + + # needed packages + find_package(ZLIB REQUIRED) +-include_directories(${ZLIB_INCLUDE_DIR}) ++include_directories(${ZLIB_INCLUDE_DIRS}) + + if(NOT WIN32) + find_library(M_LIBRARY +@@ -312,7 +312,7 @@ if(PNG_DEBUG) + endif() + + # NOW BUILD OUR TARGET +-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) + + unset(PNG_LIB_TARGETS) + +@@ -326,7 +326,7 @@ if(PNG_SHARED) + set_target_properties(png PROPERTIES PREFIX "lib") + set_target_properties(png PROPERTIES IMPORT_PREFIX "lib") + endif() +- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY}) + + if(UNIX AND AWK) + if(HAVE_LD_VERSION_SCRIPT) +@@ -361,7 +361,7 @@ if(PNG_STATIC) + # msvc does not append 'lib' - do it here to have consistent name + set_target_properties(png_static PROPERTIES PREFIX "lib") + endif() +- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY}) + endif() + + if(PNG_FRAMEWORK) +@@ -378,7 +378,7 @@ if(PNG_FRAMEWORK) + XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" + PUBLIC_HEADER "${libpng_public_hdrs}" + OUTPUT_NAME png) +- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY}) ++ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY}) + endif() + + if(NOT PNG_LIB_TARGETS) diff --git a/recipes/libpng/all/patches/CMakeLists-zlib.patch b/recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch similarity index 100% rename from recipes/libpng/all/patches/CMakeLists-zlib.patch rename to recipes/libpng/all/patches/0001-1.6.37-cmakefile-zlib.patch diff --git a/recipes/libpng/all/patches/CMakeLists-ext-zlib.patch b/recipes/libpng/all/patches/CMakeLists-ext-zlib.patch deleted file mode 100644 index 2f5247bac91ef..0000000000000 --- a/recipes/libpng/all/patches/CMakeLists-ext-zlib.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8f2b7e8b4..9cc8ece16 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -39,7 +39,7 @@ set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) - - # needed packages - find_package(ZLIB REQUIRED) --include_directories(${ZLIB_INCLUDE_DIR}) -+include_directories(${ZLIB_INCLUDE_DIRS}) - - if(NOT WIN32) - find_library(M_LIBRARY -@@ -155,12 +155,6 @@ if(MSVC) - add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE) - endif(MSVC) - --if(PNG_SHARED OR NOT MSVC) -- #if building msvc static this has NOT to be defined -- add_definitions(-DZLIB_DLL) --endif() -- -- - if(PNG_CONSOLE_IO_SUPPORTED) - add_definitions(-DPNG_CONSOLE_IO_SUPPORTED) - endif() -@@ -182,7 +176,7 @@ if(NOT M_LIBRARY AND NOT WIN32) - endif() - - # NOW BUILD OUR TARGET --include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) -+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS}) - - if(PNG_SHARED) - add_library(${PNG_LIB_NAME} SHARED ${libpng_sources}) -@@ -191,7 +185,7 @@ if(PNG_SHARED) - set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib") - set_target_properties(${PNG_LIB_NAME} PROPERTIES IMPORT_PREFIX "lib") - endif() -- target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - if(PNG_STATIC) -@@ -202,7 +196,7 @@ if(PNG_STATIC) - # msvc does not append 'lib' - do it here to have consistent name - set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib") - endif() -- target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARY} ${M_LIBRARY}) -+ target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARIES} ${M_LIBRARY}) - endif() - - diff --git a/recipes/libpng/all/patches/CMakeLists-symlink.patch b/recipes/libpng/all/patches/CMakeLists-symlink.patch deleted file mode 100644 index 5fb66b3052596..0000000000000 --- a/recipes/libpng/all/patches/CMakeLists-symlink.patch +++ /dev/null @@ -1,90 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8f2b7e8b4..503aa0149 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -298,33 +298,32 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - -+ get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE}) -+ get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME) - # Create a symlink for libpng.dll.a => libpng15.dll.a on Cygwin - if(CYGWIN) - _png_generate_symlink_code(PNG_SHARED_IMPLIB_INSTALL_CODE -- ${PNGLIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX} -- libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}) -+ ${BUILD_TARGET_FILE} -+ libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}) - install(CODE ${PNG_SHARED_IMPLIB_INSTALL_CODE}) -- install(FILES -- ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} -- DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - - if(NOT WIN32) - IF(CMAKE_LIBRARY_OUTPUT_DIRECTORY) - _png_generate_symlink_code(PNG_SHARED_INSTALL_CODE -- ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${PNGLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} -- ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}) -- install(CODE ${PNG_SHARED_INSTALL_CODE}) -- install(FILES -- ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} -+ ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BUILD_TARGET_FILE} -+ ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ install(CODE ${PNG_SHARED_INSTALL_CODE}) -+ install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ELSE(CMAKE_LIBRARY_OUTPUT_DIRECTORY) - _png_generate_symlink_code(PNG_SHARED_INSTALL_CODE -- ${PNGLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} -- libpng${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ ${BUILD_TARGET_FILE} -+ libpng${CMAKE_SHARED_LIBRARY_SUFFIX}) - install(CODE ${PNG_SHARED_INSTALL_CODE}) -- install(FILES -- ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF(CMAKE_LIBRARY_OUTPUT_DIRECTORY) - endif() -@@ -332,26 +331,27 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) - - if(PNG_STATIC) - install(TARGETS ${PNG_LIB_NAME_STATIC} -- ${PNG_EXPORT_RULE} -+ ${PNG_EXPORT_RULE} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ -+ get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME_STATIC} LOCATION_${CMAKE_BUILD_TYPE}) -+ get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME) - if(NOT WIN32 OR CYGWIN) - IF(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) - _png_generate_symlink_code(PNG_STATIC_INSTALL_CODE --${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${PNGLIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} -- ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}) -+ ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${BUILD_TARGET_FILE} -+ ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}) - install(CODE ${PNG_STATIC_INSTALL_CODE}) -- install(FILES -- ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} -- DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ELSE(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) - _png_generate_symlink_code(PNG_STATIC_INSTALL_CODE -- ${PNGLIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} -- libpng${CMAKE_STATIC_LIBRARY_SUFFIX}) -+ ${BUILD_TARGET_FILE} -+ libpng${CMAKE_STATIC_LIBRARY_SUFFIX}) - install(CODE ${PNG_STATIC_INSTALL_CODE}) -- install(FILES -- ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} -- DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) - endif() - endif() diff --git a/recipes/libpng/all/test_package/CMakeLists.txt b/recipes/libpng/all/test_package/CMakeLists.txt index aec951b3486ef..11d99ac92402e 100644 --- a/recipes/libpng/all/test_package/CMakeLists.txt +++ b/recipes/libpng/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(PNG REQUIRED) +find_package(PNG CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PNG::PNG) +target_link_libraries(${PROJECT_NAME} PRIVATE PNG::PNG) diff --git a/recipes/libpng/all/test_package/conanfile.py b/recipes/libpng/all/test_package/conanfile.py index 5a3015b3b56a9..8a5bb47f50c4c 100644 --- a/recipes/libpng/all/test_package/conanfile.py +++ b/recipes/libpng/all/test_package/conanfile.py @@ -1,12 +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, cmake_layout import os -import re -import subprocess class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -14,15 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - if "arm" in self.settings.arch and not tools.os_info.is_macos: - self.test_arm() - else: - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - - def test_arm(self): - file_ext = "so" if self.options["libpng"].shared else "a" - lib_path = os.path.join(self.deps_cpp_info["libpng"].libdirs[0], "libpng.%s" % file_ext) - output = subprocess.check_output(["readelf", "-h", lib_path]).decode() - assert re.search(r"Machine:\s+ARM", output) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libpng/all/test_package/test_package.c b/recipes/libpng/all/test_package/test_package.c index f91843e1fe3f2..1f4c2a28428ab 100644 --- a/recipes/libpng/all/test_package/test_package.c +++ b/recipes/libpng/all/test_package/test_package.c @@ -1,14 +1,16 @@ #include #include +#include #include "png.h" -#include "zlib.h" -int main(void) -{ - fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n", - PNG_LIBPNG_VER_STRING, png_libpng_ver); - fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n", - ZLIB_VERSION, zlib_version); - return 0; +int main(void) { + png_structp png_ptr; + png_infop info_ptr; + + fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n", PNG_LIBPNG_VER_STRING, png_libpng_ver); + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info_ptr = png_create_info_struct(png_ptr); + + return EXIT_SUCCESS; } diff --git a/recipes/libpng/all/test_v1_package/CMakeLists.txt b/recipes/libpng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3dae6c3559392 --- /dev/null +++ b/recipes/libpng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(PNG CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PNG::PNG) diff --git a/recipes/libpng/all/test_v1_package/conanfile.py b/recipes/libpng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3f4d2daa51cd6 --- /dev/null +++ b/recipes/libpng/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, CMake, tools +from conan.tools.build import cross_building +import os +import re +import subprocess + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + if "arm" in self.settings.arch and not tools.os_info.is_macos: + self.test_arm() + else: + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + + def test_arm(self): + file_ext = "so" if self.options["libpng"].shared else "a" + lib_path = os.path.join(self.deps_cpp_info["libpng"].libdirs[0], "libpng.%s" % file_ext) + output = subprocess.check_output(["readelf", "-h", lib_path]).decode() + assert re.search(r"Machine:\s+ARM", output) diff --git a/recipes/libpng/config.yml b/recipes/libpng/config.yml index 48f07e0fd148c..958422ec0b042 100644 --- a/recipes/libpng/config.yml +++ b/recipes/libpng/config.yml @@ -1,5 +1,5 @@ versions: "1.6.37": folder: all - "1.5.2": + "1.5.30": folder: all From 24dd912790f6904c72a566d9e1ae6c7d89e2e13c Mon Sep 17 00:00:00 2001 From: chausner <15180557+chausner@users.noreply.github.com> Date: Wed, 14 Sep 2022 19:25:11 +0200 Subject: [PATCH 025/561] (#12479) cryptopp: update to 8.7.0 * Add cryptopp 8.7.0 * Add CMake build requirement * Update to latest cryptopp-cmake commit * Minor tweaks * Update to latest commit, add CMake tool dependencies again * Delete share folder * Switch to temporary branch with fixes * Switch back to abdes/cryptopp-cmake * Remove license again Co-authored-by: chausner --- recipes/cryptopp/all/conandata.yml | 7 +++ recipes/cryptopp/all/conanfile.py | 88 ++++++++++++++++++++---------- recipes/cryptopp/config.yml | 2 + 3 files changed, 69 insertions(+), 28 deletions(-) diff --git a/recipes/cryptopp/all/conandata.yml b/recipes/cryptopp/all/conandata.yml index 4b9948cbfa771..9aafaf5664ca7 100644 --- a/recipes/cryptopp/all/conandata.yml +++ b/recipes/cryptopp/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "8.7.0": + source: + url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_7_0.tar.gz" + sha256: "8d6a4064b8e9f34cd3e838f5a12c40067ee7b95ee37d9173ec273cb0913e7ca2" + cmake: + url: "https://github.com/abdes/cryptopp-cmake/archive/ff211af98505c260c1d3a36a8e36e563727b11ee.tar.gz" + sha256: "5a966e8a1af4aa39a4bc1f223562b4af97bd55385e9385b48b1f15fd0dc26b38" "8.6.0": source: url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_6_0.tar.gz" diff --git a/recipes/cryptopp/all/conanfile.py b/recipes/cryptopp/all/conanfile.py index 0b5197c10fa18..308cf2651bcac 100644 --- a/recipes/cryptopp/all/conanfile.py +++ b/recipes/cryptopp/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, collect_libs, copy, get, rename, replace_in_file, rmdir, save from conan.tools.scm import Version @@ -35,6 +36,14 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + def build_requirements(self): + if Version(self.version) >= "8.7.0": + self.tool_requires("cmake/3.21.0") + + def validate(self): + if self.options.shared and Version(self.version) >= "8.7.0": + raise ConanInvalidConfiguration("cryptopp 8.7.0 and higher do not support shared builds") + def configure(self): if self.options.shared: del self.options.fPIC @@ -43,36 +52,49 @@ def layout(self): cmake_layout(self, src_folder="src") def source(self): - # Get sources + # Get cryptopp sources get(self, **self.conan_data["sources"][self.version]["source"], destination=self.source_folder, strip_root=True) - # Get CMakeLists - base_source_dir = os.path.join(self.source_folder, os.pardir) - get(self, **self.conan_data["sources"][self.version]["cmake"], destination=base_source_dir) - src_folder = os.path.join( - base_source_dir, - f"cryptopp-cmake-CRYPTOPP_{self.version.replace('.', '_')}", - ) - for file in ("CMakeLists.txt", "cryptopp-config.cmake"): - rename(self, src=os.path.join(src_folder, file), dst=os.path.join(self.source_folder, file)) - rmdir(self, src_folder) + if Version(self.version) < "8.7.0": + # Get CMakeLists + base_source_dir = os.path.join(self.source_folder, os.pardir) + get(self, **self.conan_data["sources"][self.version]["cmake"], destination=base_source_dir) + src_folder = os.path.join( + base_source_dir, + f"cryptopp-cmake-CRYPTOPP_{self.version.replace('.', '_')}", + ) + for file in ("CMakeLists.txt", "cryptopp-config.cmake"): + rename(self, src=os.path.join(src_folder, file), dst=os.path.join(self.source_folder, file)) + rmdir(self, src_folder) + else: + # Get cryptopp-cmake sources + get(self, **self.conan_data["sources"][self.version]["cmake"], + destination=os.path.join(self.source_folder, "cryptopp-cmake"), strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.variables["BUILD_STATIC"] = not self.options.shared - tc.variables["BUILD_SHARED"] = self.options.shared - tc.variables["BUILD_TESTING"] = False - tc.variables["BUILD_DOCUMENTATION"] = False - tc.variables["USE_INTERMEDIATE_OBJECTS_TARGET"] = False - if self.settings.os == "Android": - tc.variables["CRYPTOPP_NATIVE_ARCH"] = True - if self.settings.os == "Macos" and self.settings.arch == "armv8" and Version(self.version) <= "8.4.0": - tc.variables["CMAKE_CXX_FLAGS"] = "-march=armv8-a" - # For msvc shared - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - # Relocatable shared libs on macOS - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "8.7.0": + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["USE_INTERMEDIATE_OBJECTS_TARGET"] = False + if self.settings.os == "Android": + tc.variables["CRYPTOPP_NATIVE_ARCH"] = True + if self.settings.os == "Macos" and self.settings.arch == "armv8" and Version(self.version) <= "8.4.0": + tc.variables["CMAKE_CXX_FLAGS"] = "-march=armv8-a" + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + else: + tc.cache_variables["CRYPTOPP_SOURCES"] = self.source_folder + tc.cache_variables["CRYPTOPP_BUILD_TESTING"] = False + tc.cache_variables["CRYPTOPP_BUILD_DOCUMENTATION"] = False + tc.cache_variables["CRYPTOPP_USE_INTERMEDIATE_OBJECTS_TARGET"] = False + if self.settings.os == "Android": + tc.cache_variables["CRYPTOPP_NATIVE_ARCH"] = True tc.generate() def _patch_sources(self): @@ -88,20 +110,30 @@ def _patch_sources(self): dst=self.source_folder, ) # Honor fPIC option - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "SET(CMAKE_POSITION_INDEPENDENT_CODE 1)", "") + if Version(self.version) < "8.7.0": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "SET(CMAKE_POSITION_INDEPENDENT_CODE 1)", "") + else: + replace_in_file(self, os.path.join(self.source_folder, "cryptopp-cmake", "cryptopp", "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE 1)", "") def build(self): self._patch_sources() cmake = CMake(self) - cmake.configure() + if Version(self.version) < "8.7.0": + cmake.configure() + else: + cmake.configure(build_script_folder="cryptopp-cmake") cmake.build() def package(self): copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + if Version(self.version) < "8.7.0": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + rmdir(self, os.path.join(self.package_folder, "share")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), diff --git a/recipes/cryptopp/config.yml b/recipes/cryptopp/config.yml index a125b6d12d4c5..0cf6dab66b6c7 100644 --- a/recipes/cryptopp/config.yml +++ b/recipes/cryptopp/config.yml @@ -1,4 +1,6 @@ versions: + "8.7.0": + folder: "all" "8.6.0": folder: "all" "8.5.0": From f8181c537c2ddf3821801277c1d3e530424928dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D0=BE=D1=80=D0=B3=D0=B8=D0=B9=20=D0=9F=D0=BE?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2?= Date: Wed, 14 Sep 2022 21:26:26 +0300 Subject: [PATCH 026/561] (#12735) jwt-cpp: fix building without picojson * jwt-cpp: fix building without picojson * jwt-cpp: add missing traits header to test package * Adapt for Conan 2.0 Signed-off-by: Uilian Ries * Fix building test_package for older jwt-cpp versions * Conanfile review fixes * Add endline to the end of files Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/jwt-cpp/all/conandata.yml | 37 +++++---- recipes/jwt-cpp/all/conanfile.py | 40 ++++++---- .../jwt-cpp/all/test_package/CMakeLists.txt | 21 +++-- recipes/jwt-cpp/all/test_package/conanfile.py | 17 +++-- .../{example.cpp => test_package.cpp} | 9 +++ .../all/test_package/traits/defaults.h | 58 ++++++++++++++ .../jwt-cpp/all/test_package/traits/traits.h | 76 +++++++++++++++++++ .../all/test_v1_package/CMakeLists.txt | 20 +++++ .../jwt-cpp/all/test_v1_package/conanfile.py | 21 +++++ 9 files changed, 256 insertions(+), 43 deletions(-) rename recipes/jwt-cpp/all/test_package/{example.cpp => test_package.cpp} (77%) create mode 100644 recipes/jwt-cpp/all/test_package/traits/defaults.h create mode 100644 recipes/jwt-cpp/all/test_package/traits/traits.h create mode 100644 recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jwt-cpp/all/test_v1_package/conanfile.py diff --git a/recipes/jwt-cpp/all/conandata.yml b/recipes/jwt-cpp/all/conandata.yml index 46e564e445665..bf093248fb260 100644 --- a/recipes/jwt-cpp/all/conandata.yml +++ b/recipes/jwt-cpp/all/conandata.yml @@ -6,27 +6,32 @@ sources: url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.5.1.tar.gz" sha256: "d8f5ffb361824630b3b6f4aad26c730c915081071040c232ac57947d6177ef4f" "0.5.0": - url: https://github.com/Thalhammer/jwt-cpp/archive/v0.5.0.tar.gz - sha256: 079a273f070dd11213e301712319a65881e51ab81535cc436d5313191df852a2 + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.5.0.tar.gz" + sha256: "079a273f070dd11213e301712319a65881e51ab81535cc436d5313191df852a2" "0.4.0": - url: https://github.com/Thalhammer/jwt-cpp/archive/v0.4.0.tar.gz - sha256: f0dcc7b0e8bef8f9c3f434e7121f9941145042c9fe3055a5bdd709085a4f2be4 + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.4.0.tar.gz" + sha256: "f0dcc7b0e8bef8f9c3f434e7121f9941145042c9fe3055a5bdd709085a4f2be4" "0.3.1": - url: https://github.com/Thalhammer/jwt-cpp/archive/v0.3.1.tar.gz - sha256: 399345e81883f2959df658cd945de39548ddfefdab2acf7b23ee07b9e9a02938 + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.3.1.tar.gz" + sha256: "399345e81883f2959df658cd945de39548ddfefdab2acf7b23ee07b9e9a02938" patches: "0.6.0": - - patch_file: patches/0005-fix-picojson-header-location-for-conan.patch - base_path: source_subfolder + - patch_file: "patches/0005-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" "0.5.1": - - patch_file: patches/0004-fix-picojson-header-location-for-conan.patch - base_path: source_subfolder + - patch_file: "patches/0004-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" "0.5.0": - - patch_file: patches/0004-fix-picojson-header-location-for-conan.patch - base_path: source_subfolder + - patch_file: "patches/0004-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" "0.4.0": - - patch_file: patches/0003-fix-picojson-header-location-for-conan.patch - base_path: source_subfolder + - patch_file: "patches/0003-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" "0.3.1": - - patch_file: patches/0002-fix-openssl-change-version.patch - base_path: source_subfolder + - patch_file: "patches/0002-fix-openssl-change-version.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" diff --git a/recipes/jwt-cpp/all/conanfile.py b/recipes/jwt-cpp/all/conanfile.py index 8e46b33c84079..d2f8f0e74f701 100644 --- a/recipes/jwt-cpp/all/conanfile.py +++ b/recipes/jwt-cpp/all/conanfile.py @@ -1,4 +1,7 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.scm import Version +from conan.tools.files import get, copy, apply_conandata_patches +from conan.tools.layout import basic_layout import os required_conan_version = ">=1.43.0" @@ -10,15 +13,12 @@ class JwtCppConan(ConanFile): homepage = "https://github.com/Thalhammer/jwt-cpp" description = "A C++ JSON Web Token library for encoding/decoding" topics = ("jwt-cpp", "json", "jwt", "jws", "jwe", "jwk", "jwks", "jose", "header-only") + settings = "arch", "build_type", "compiler", "os" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _supports_generic_json(self): - return tools.Version(self.version) >= "0.5.0" + return Version(self.version) >= "0.5.0" def export_sources(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): @@ -30,18 +30,22 @@ def requirements(self): self.requires("picojson/1.3.0") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def layout(self): + basic_layout(self, src_folder="src") + + def build(self): + apply_conandata_patches(self) def package(self): - header_dir = os.path.join(self._source_subfolder, "include") - self.copy(pattern="jwt-cpp/**.h", dst="include", src=header_dir, keep_path=True) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + header_dir = os.path.join(self.source_folder, "include", "jwt-cpp") + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include", "jwt-cpp"), src=header_dir, keep_path=True) + copy(self, "LICENSE", dst=os.path.join(self.package_folder,"licenses"), src=self.source_folder) def package_id(self): - self.info.header_only() + self.info.clear() def package_info(self): self.cpp_info.set_property("cmake_file_name", "jwt-cpp") @@ -50,3 +54,11 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "jwt-cpp" self.cpp_info.names["cmake_find_package_multi"] = "jwt-cpp" + + if self._supports_generic_json: + self.cpp_info.defines.append("JWT_DISABLE_PICOJSON") + + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/jwt-cpp/all/test_package/CMakeLists.txt b/recipes/jwt-cpp/all/test_package/CMakeLists.txt index 38de6e5ebf0d9..020cb1aab4c7d 100644 --- a/recipes/jwt-cpp/all/test_package/CMakeLists.txt +++ b/recipes/jwt-cpp/all/test_package/CMakeLists.txt @@ -1,12 +1,17 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) +find_package(jwt-cpp REQUIRED CONFIG) +find_package(picojson REQUIRED CONFIG) -find_package(jwt-cpp REQUIRED) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jwt-cpp::jwt-cpp picojson::picojson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -add_executable(example example.cpp) -set_property(TARGET example PROPERTY CXX_STANDARD 11) +if (jwt-cpp_VERSION VERSION_GREATER 0.4.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE JSON_TRAITS_NEEDED) +endif() -target_link_libraries(example jwt-cpp::jwt-cpp CONAN_PKG::picojson) +if (jwt-cpp_VERSION VERSION_GREATER_EQUAL 0.6.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAS_DEFAULT_TRAITS) +endif() diff --git a/recipes/jwt-cpp/all/test_package/conanfile.py b/recipes/jwt-cpp/all/test_package/conanfile.py index 97d34e6c6cd09..8c80e56ec63d3 100644 --- a/recipes/jwt-cpp/all/test_package/conanfile.py +++ b/recipes/jwt-cpp/all/test_package/conanfile.py @@ -1,20 +1,27 @@ -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 JsonCppTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): + self.requires(self.tested_reference_str) self.requires("picojson/1.3.0") + def layout(self): + cmake_layout(self) + 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", "example") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/jwt-cpp/all/test_package/example.cpp b/recipes/jwt-cpp/all/test_package/test_package.cpp similarity index 77% rename from recipes/jwt-cpp/all/test_package/example.cpp rename to recipes/jwt-cpp/all/test_package/test_package.cpp index d7082b8a374a1..a7af84c85dc7c 100644 --- a/recipes/jwt-cpp/all/test_package/example.cpp +++ b/recipes/jwt-cpp/all/test_package/test_package.cpp @@ -1,4 +1,13 @@ #include + +#ifdef JSON_TRAITS_NEEDED + #ifndef HAS_DEFAULT_TRAITS + #include "traits/defaults.h" + #else + #include + #endif +#endif + #include int main() { diff --git a/recipes/jwt-cpp/all/test_package/traits/defaults.h b/recipes/jwt-cpp/all/test_package/traits/defaults.h new file mode 100644 index 0000000000000..7ec119bedd233 --- /dev/null +++ b/recipes/jwt-cpp/all/test_package/traits/defaults.h @@ -0,0 +1,58 @@ +#ifndef JWT_CPP_KAZUHO_PICOJSON_DEFAULTS_H +#define JWT_CPP_KAZUHO_PICOJSON_DEFAULTS_H + +#include "traits.h" + +namespace jwt { + /** + * \brief a class to store a generic [picojson](https://github.com/kazuho/picojson) value as claim + * + * This type is the specialization of the \ref basic_claim class which + * uses the standard template types. + */ + using claim = basic_claim; + + /** + * Create a verifier using the default clock + * \return verifier instance + */ + inline verifier verify() { + return verify(default_clock{}); + } + + /** + * Return a builder instance to create a new token + */ + inline builder create() { return builder(); } + +#ifndef JWT_DISABLE_BASE64 + /** + * Decode a token + * \param token Token to decode + * \return Decoded token + * \throw std::invalid_argument Token is not in correct format + * \throw std::runtime_error Base64 decoding failed or invalid json + */ + inline decoded_jwt decode(const std::string& token) { + return decoded_jwt(token); + } +#endif + + /** + * Decode a token + * \tparam Decode is callabled, taking a string_type and returns a string_type. + * It should ensure the padding of the input and then base64url decode and + * return the results. + * \param token Token to decode + * \param decode The token to parse + * \return Decoded token + * \throw std::invalid_argument Token is not in correct format + * \throw std::runtime_error Base64 decoding failed or invalid json + */ + template + decoded_jwt decode(const std::string& token, Decode decode) { + return decoded_jwt(token, decode); + } +} // namespace jwt + +#endif // JWT_CPP_KAZUHO_PICOJSON_DEFAULTS_H diff --git a/recipes/jwt-cpp/all/test_package/traits/traits.h b/recipes/jwt-cpp/all/test_package/traits/traits.h new file mode 100644 index 0000000000000..099f0dc26ce34 --- /dev/null +++ b/recipes/jwt-cpp/all/test_package/traits/traits.h @@ -0,0 +1,76 @@ +#ifndef JWT_CPP_PICOJSON_TRAITS_H +#define JWT_CPP_PICOJSON_TRAITS_H + +#ifndef PICOJSON_USE_INT64 +#define PICOJSON_USE_INT64 +#endif +#include + +#ifndef JWT_DISABLE_PICOJSON +#define JWT_DISABLE_PICOJSON +#endif +#include "jwt-cpp/jwt.h" + +namespace jwt { + namespace traits { + struct kazuho_picojson { + using value_type = picojson::value; + using object_type = picojson::object; + using array_type = picojson::array; + using string_type = std::string; + using number_type = double; + using integer_type = int64_t; + using boolean_type = bool; + + static json::type get_type(const picojson::value& val) { + using json::type; + if (val.is()) return type::boolean; + if (val.is()) return type::integer; + if (val.is()) return type::number; + if (val.is()) return type::string; + if (val.is()) return type::array; + if (val.is()) return type::object; + + throw std::logic_error("invalid type"); + } + + static picojson::object as_object(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static std::string as_string(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static picojson::array as_array(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static int64_t as_int(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static bool as_bool(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static double as_number(const picojson::value& val) { + if (!val.is()) throw std::bad_cast(); + return val.get(); + } + + static bool parse(picojson::value& val, const std::string& str) { + return picojson::parse(val, str).empty(); + } + + static std::string serialize(const picojson::value& val) { return val.serialize(); } + }; + } // namespace traits +} // namespace jwt + +#endif diff --git a/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d58f9a64ba28e --- /dev/null +++ b/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(jwt-cpp REQUIRED CONFIG) +find_package(picojson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jwt-cpp::jwt-cpp picojson::picojson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if (jwt-cpp_VERSION VERSION_GREATER 0.4.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE JSON_TRAITS_NEEDED) +endif() + +if (jwt-cpp_VERSION VERSION_GREATER_EQUAL 0.6.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAS_DEFAULT_TRAITS) +endif() diff --git a/recipes/jwt-cpp/all/test_v1_package/conanfile.py b/recipes/jwt-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3f782b39bbd4f --- /dev/null +++ b/recipes/jwt-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def requirements(self): + self.requires("picojson/1.3.0") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 0024a5a3db0bdf743979f502d36656c0465b0127 Mon Sep 17 00:00:00 2001 From: Dennis Date: Wed, 14 Sep 2022 20:45:56 +0200 Subject: [PATCH 027/561] (#12846) asio-grpc: update to v2.1.0 * Update asio-grpc to v2.1.0 * asio-grpc: Fix packaging of older versions by switching back to CMake based build * asio-grpc: Add test_v1_package * asio-grpc: Remove duplicate test_package.cpp and test.proto files --- recipes/asio-grpc/all/conandata.yml | 3 ++ recipes/asio-grpc/all/conanfile.py | 45 ++++++++++++------- .../asio-grpc/all/test_package/CMakeLists.txt | 5 +-- .../asio-grpc/all/test_package/conanfile.py | 18 +++++--- .../all/test_v1_package/CMakeLists.txt | 34 ++++++++++++++ .../all/test_v1_package/conanfile.py | 19 ++++++++ recipes/asio-grpc/config.yml | 2 + 7 files changed, 101 insertions(+), 25 deletions(-) create mode 100644 recipes/asio-grpc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/asio-grpc/all/test_v1_package/conanfile.py diff --git a/recipes/asio-grpc/all/conandata.yml b/recipes/asio-grpc/all/conandata.yml index f34ff55643aa6..f6696b1252f27 100644 --- a/recipes/asio-grpc/all/conandata.yml +++ b/recipes/asio-grpc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.1.0.tar.gz" + sha256: "51da699eb442db3ec3af1caae5a29d78733ebbd9d1b781f75abe6ce2802fc7c1" "2.0.0": url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.0.0.tar.gz" sha256: "e36ab4f286dccfd6589b8001d6560e994c753539738680588264c1c0e0a6ce4f" diff --git a/recipes/asio-grpc/all/conanfile.py b/recipes/asio-grpc/all/conanfile.py index 75de28466abad..ada4cb6ee238a 100644 --- a/recipes/asio-grpc/all/conanfile.py +++ b/recipes/asio-grpc/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class AsioGrpcConan(ConanFile): @@ -38,10 +42,10 @@ def _compilers_minimum_version(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._min_cppstd) + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: + if Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration(f"{self.name} requires C++{self._min_cppstd}, which your compiler does not support.") else: self.output.warn(f"{self.name} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") @@ -49,38 +53,47 @@ def validate(self): def configure(self): if self.options.use_boost_container == "auto": libcxx = self.settings.compiler.get_safe("libcxx") - compiler_version = tools.Version(self.settings.compiler.version) + compiler_version = Version(self.settings.compiler.version) self.options.use_boost_container = libcxx and str(libcxx) == "libc++" or \ (self.settings.compiler == "gcc" and compiler_version < "9") or \ (self.settings.compiler == "clang" and compiler_version < "12" and libcxx and str(libcxx) == "libstdc++") def requirements(self): - self.requires("grpc/1.47.1") + self.requires("grpc/1.48.0") if self.options.use_boost_container or self.options.backend == "boost": self.requires("boost/1.79.0") if self.options.backend == "asio": - self.requires("asio/1.23.0") + self.requires("asio/1.24.0") if self.options.backend == "unifex": self.requires("libunifex/cci.20220430") def package_id(self): - self.info.header_only() + self.info.clear() self.info.options.use_boost_container = self.options.use_boost_container + def layout(self): + cmake_layout(self, src_folder="src") + def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def package(self): - self.copy(pattern="LICENSE", dst="licenses") + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ASIO_GRPC_USE_BOOST_CONTAINER"] = self.options.use_boost_container + tc.generate() + + def build(self): cmake = CMake(self) - cmake.definitions["ASIO_GRPC_USE_BOOST_CONTAINER"] = self.options.use_boost_container cmake.configure() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib", "cmake", "asio-grpc"), "asio-grpc*") + rm(self, "asio-grpc*", os.path.join(self.package_folder, "lib", "cmake", "asio-grpc")) def package_info(self): - self.cpp_info.builddirs = [os.path.join("lib", "cmake", "asio-grpc")] - build_modules = [os.path.join(self.cpp_info.builddirs[0], "AsioGrpcProtobufGenerator.cmake")] + build_modules = [os.path.join("lib", "cmake", "asio-grpc", "AsioGrpcProtobufGenerator.cmake")] self.cpp_info.requires = ["grpc::grpc++_unsecure"] if self.options.backend == "boost": diff --git a/recipes/asio-grpc/all/test_package/CMakeLists.txt b/recipes/asio-grpc/all/test_package/CMakeLists.txt index 24d2c280e32b6..3566d527f1ca9 100644 --- a/recipes/asio-grpc/all/test_package/CMakeLists.txt +++ b/recipes/asio-grpc/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.14) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(asio-grpc REQUIRED CONFIG) diff --git a/recipes/asio-grpc/all/test_package/conanfile.py b/recipes/asio-grpc/all/test_package/conanfile.py index 38f4483872d47..d120a992c06a6 100644 --- a/recipes/asio-grpc/all/test_package/conanfile.py +++ b/recipes/asio-grpc/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +20,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt b/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e68b2def0d618 --- /dev/null +++ b/recipes/asio-grpc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.14) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(asio-grpc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asio-grpc::asio-grpc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +# See https://github.com/chriskohlhoff/asio/issues/955 +target_compile_definitions(${PROJECT_NAME} + PRIVATE BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC) + +if(${asio-grpc_VERSION} VERSION_GREATER_EQUAL 2) + target_compile_definitions(${PROJECT_NAME} PRIVATE ASIO_GRPC_V2) +endif() + +if(CMAKE_CROSSCOMPILING) + # Assuming protoc plugins needed by `asio_grpc_protobuf_generate` are not + # available when cross compiling + target_compile_definitions(${PROJECT_NAME} PRIVATE CROSSCOMPILING) +else() + asio_grpc_protobuf_generate( + GENERATE_GRPC + TARGET + ${PROJECT_NAME} + OUT_DIR + "${CMAKE_CURRENT_BINARY_DIR}/generated" + PROTOS + "${CMAKE_CURRENT_LIST_DIR}/../test_package/test.proto") +endif() diff --git a/recipes/asio-grpc/all/test_v1_package/conanfile.py b/recipes/asio-grpc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2da76eac8dd35 --- /dev/null +++ b/recipes/asio-grpc/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/asio-grpc/config.yml b/recipes/asio-grpc/config.yml index a6ac7221e4d6f..f551acd515309 100644 --- a/recipes/asio-grpc/config.yml +++ b/recipes/asio-grpc/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.0": + folder: all "2.0.0": folder: all "1.7.0": From 24edc9564c6153da51ade85981e7b1539667e1f0 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 14 Sep 2022 21:05:04 +0200 Subject: [PATCH 028/561] (#12855) coin-cgl: generate gcc11 binaries --- recipes/coin-cgl/all/conanfile.py | 34 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/recipes/coin-cgl/all/conanfile.py b/recipes/coin-cgl/all/conanfile.py index 233e72b7ee4ab..152335302dd9a 100644 --- a/recipes/coin-cgl/all/conanfile.py +++ b/recipes/coin-cgl/all/conanfile.py @@ -1,11 +1,14 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from conan.tools.files import rename +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import rename, get, apply_conandata_patches, rmdir +from conan.tools.build import cross_building +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, tools from contextlib import contextmanager import os import shutil -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class CoinCglConan(ConanFile): name = "coin-cgl" @@ -61,22 +64,22 @@ def _user_info_build(self): return getattr(self, "user_info_build", self.deps_user_info) def build_requirements(self): - self.build_requires("gnu-config/cci.20201022") - self.build_requires("pkgconf/1.7.4") + self.tool_requires("gnu-config/cci.20201022") + self.tool_requires("pkgconf/1.7.4") if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("msys2/cci.latest") if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.4") + self.tool_requires("automake/1.16.5") def validate(self): if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("coin-cgl does not support shared builds on Windows") # FIXME: This issue likely comes from very old autotools versions used to produce configure. - if hasattr(self, "settings_build") and tools.cross_building(self) and self.options.shared: + if hasattr(self, "settings_build") and cross_building(self) and self.options.shared: raise ConanInvalidConfiguration("coin-cgl shared not supported yet when cross-building") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) @contextmanager @@ -107,15 +110,14 @@ def _configure_autotools(self): ] if self.settings.compiler == "Visual Studio": self._autotools.cxx_flags.append("-EHsc") - configure_args.append("--enable-msvc={}".format(self.settings.compiler.runtime)) - if tools.Version(self.settings.compiler.version) >= 12: + configure_args.append(f"--enable-msvc={self.settings.compiler.runtime}") + if Version(self.settings.compiler.version) >= 12: self._autotools.flags.append("-FS") self._autotools.configure(configure_dir=os.path.join(self.source_folder, self._source_subfolder), args=configure_args) return self._autotools def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, os.path.join(self._source_subfolder, "config.sub")) shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, @@ -137,8 +139,8 @@ def package(self): os.path.join(self.package_folder, "lib", "libCgl.a"), os.path.join(self.package_folder, "lib", "Cgl.lib")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["Cgl"] From 8e5e72c903d44c3debf90f2839cb40da0135f0a5 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 15 Sep 2022 04:24:55 +0900 Subject: [PATCH 029/561] (#12875) roaring: add version 0.7.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/roaring/all/conandata.yml | 3 +++ recipes/roaring/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/roaring/all/conandata.yml b/recipes/roaring/all/conandata.yml index c37388de9682a..e0979e1fcd734 100644 --- a/recipes/roaring/all/conandata.yml +++ b/recipes/roaring/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.1": + url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.7.1.tar.gz" + sha256: "77faa22b8c1226c9a7bdbca2dbb9c73ea6db9e98db9bfbb6391996cfa7a93d17" "0.6.0": url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v0.6.0.tar.gz" sha256: "b8e2499ca9ac6ba0d18dbbcde4bae3752acf81f08ea6309ea2a88d27972dffcf" diff --git a/recipes/roaring/config.yml b/recipes/roaring/config.yml index 0ecb98589cf3a..35ed9b73d563d 100644 --- a/recipes/roaring/config.yml +++ b/recipes/roaring/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.1": + folder: all "0.6.0": folder: all "0.5.0": From 8676a42cb63403d29f1a1d0844c69af23d1b98e3 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 14 Sep 2022 13:45:21 -0600 Subject: [PATCH 030/561] (#12876) ms-gsl: make sure it's declaring all the known settings --- recipes/ms-gsl/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ms-gsl/all/conanfile.py b/recipes/ms-gsl/all/conanfile.py index ddc0e0a316945..61ef355511a04 100644 --- a/recipes/ms-gsl/all/conanfile.py +++ b/recipes/ms-gsl/all/conanfile.py @@ -19,7 +19,7 @@ class MicrosoftGslConan(ConanFile): license = "MIT" topics = ("gsl", "guidelines", "core", "span") no_copy_source = True - settings = "compiler" + settings = "os", "arch", "compiler", "build_type" options = { "on_contract_violation": ["terminate", "throw", "unenforced"] } From 6e721f54bf7af689d04f3261e6d02ac056a68344 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 14 Sep 2022 22:04:40 +0200 Subject: [PATCH 031/561] (#12878) [docs] source subfolder is no longer used Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- docs/package_templates/autotools_package/all/conandata.yml | 2 -- docs/package_templates/cmake_package/all/conandata.yml | 2 -- docs/package_templates/header_only/all/conandata.yml | 2 -- docs/package_templates/msbuild_package/all/conandata.yml | 2 -- 4 files changed, 8 deletions(-) diff --git a/docs/package_templates/autotools_package/all/conandata.yml b/docs/package_templates/autotools_package/all/conandata.yml index 61b769f81b6fa..a5aa8737e0c0a 100644 --- a/docs/package_templates/autotools_package/all/conandata.yml +++ b/docs/package_templates/autotools_package/all/conandata.yml @@ -20,10 +20,8 @@ patches: patch_type: "backport" patch_source: "https://github.com/owner/package/pulls/42" sha256: "________________________________________________________________" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-linux.patch" patch_description: "add missing header to support linux" patch_type: "portability" patch_source: "https://github.com/owner/package/issues/0" sha256: "________________________________________________________________" - base_path: "source_subfolder" diff --git a/docs/package_templates/cmake_package/all/conandata.yml b/docs/package_templates/cmake_package/all/conandata.yml index 61b769f81b6fa..a5aa8737e0c0a 100644 --- a/docs/package_templates/cmake_package/all/conandata.yml +++ b/docs/package_templates/cmake_package/all/conandata.yml @@ -20,10 +20,8 @@ patches: patch_type: "backport" patch_source: "https://github.com/owner/package/pulls/42" sha256: "________________________________________________________________" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-linux.patch" patch_description: "add missing header to support linux" patch_type: "portability" patch_source: "https://github.com/owner/package/issues/0" sha256: "________________________________________________________________" - base_path: "source_subfolder" diff --git a/docs/package_templates/header_only/all/conandata.yml b/docs/package_templates/header_only/all/conandata.yml index 61b769f81b6fa..a5aa8737e0c0a 100644 --- a/docs/package_templates/header_only/all/conandata.yml +++ b/docs/package_templates/header_only/all/conandata.yml @@ -20,10 +20,8 @@ patches: patch_type: "backport" patch_source: "https://github.com/owner/package/pulls/42" sha256: "________________________________________________________________" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-linux.patch" patch_description: "add missing header to support linux" patch_type: "portability" patch_source: "https://github.com/owner/package/issues/0" sha256: "________________________________________________________________" - base_path: "source_subfolder" diff --git a/docs/package_templates/msbuild_package/all/conandata.yml b/docs/package_templates/msbuild_package/all/conandata.yml index 61b769f81b6fa..a5aa8737e0c0a 100644 --- a/docs/package_templates/msbuild_package/all/conandata.yml +++ b/docs/package_templates/msbuild_package/all/conandata.yml @@ -20,10 +20,8 @@ patches: patch_type: "backport" patch_source: "https://github.com/owner/package/pulls/42" sha256: "________________________________________________________________" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-linux.patch" patch_description: "add missing header to support linux" patch_type: "portability" patch_source: "https://github.com/owner/package/issues/0" sha256: "________________________________________________________________" - base_path: "source_subfolder" From cf3936eda71191efd0a9b54acaf7561b1cc51f43 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 14 Sep 2022 15:26:03 -0500 Subject: [PATCH 032/561] (#12882) xkbcommon: Small fixes * xkbcommon: Small fixes * Remove buildenv PATH --- recipes/xkbcommon/all/conanfile.py | 18 ++---------------- .../xkbcommon/all/test_package/conanfile.py | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 069c77a267a91..633209750e95b 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -34,7 +34,7 @@ class XkbcommonConan(ConanFile): "xkbregistry": True, } - generators = "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" + generators = "PkgConfigDeps", "VirtualBuildEnv" @property def _has_xkbregistry_option(self): @@ -68,7 +68,7 @@ def build_requirements(self): self.tool_requires("meson/0.63.1") self.tool_requires("bison/3.7.6") self.tool_requires("pkgconf/1.7.4") - if self.options.get_safe("with_wayland"): + if hasattr(self, "settings_build") and self.options.get_safe("with_wayland"): self.tool_requires("wayland/1.21.0") def layout(self): @@ -124,26 +124,14 @@ def package_info(self): self.cpp_info.components["libxkbcommon"].requires = ["xorg::xkeyboard-config"] self.cpp_info.components["libxkbcommon"].resdirs = ["res"] - # todo Remove in Conan version 1.50.0 where these are set by default for the PkgConfigDeps generator. - self.cpp_info.components["libxkbcommon"].includedirs = ["include"] - self.cpp_info.components["libxkbcommon"].libdirs = ["lib"] - if self.options.with_x11: self.cpp_info.components["libxkbcommon-x11"].set_property("pkg_config_name", "xkbcommon-x11") self.cpp_info.components["libxkbcommon-x11"].libs = ["xkbcommon-x11"] self.cpp_info.components["libxkbcommon-x11"].requires = ["libxkbcommon", "xorg::xcb", "xorg::xcb-xkb"] - - # todo Remove in Conan version 1.50.0 where these are set by default for the PkgConfigDeps generator. - self.cpp_info.components["libxkbcommon-x11"].includedirs = ["include"] - self.cpp_info.components["libxkbcommon-x11"].libdirs = ["lib"] if self.options.get_safe("xkbregistry"): self.cpp_info.components["libxkbregistry"].set_property("pkg_config_name", "xkbregistry") self.cpp_info.components["libxkbregistry"].libs = ["xkbregistry"] self.cpp_info.components["libxkbregistry"].requires = ["libxml2::libxml2"] - - # todo Remove in Conan version 1.50.0 where these are set by default for the PkgConfigDeps generator. - self.cpp_info.components["libxkbregistry"].includedirs = ["include"] - self.cpp_info.components["libxkbregistry"].libdirs = ["lib"] if self.options.get_safe("with_wayland", False): # FIXME: This generates just executable, but I need to use the requirements to pass Conan checks self.cpp_info.components["xkbcli-interactive-wayland"].libs = [] @@ -152,8 +140,6 @@ def package_info(self): if Version(self.version) >= "1.0.0": bindir = os.path.join(self.package_folder, "bin") - self.buildenv_info.prepend_path("PATH", bindir) - self.runenv_info.prepend_path("PATH", bindir) self.output.info(f"Appending PATH environment variable: {bindir}") self.env_info.PATH.append(bindir) diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py index eecad0444878e..622d31592b6f4 100644 --- a/recipes/xkbcommon/all/test_package/conanfile.py +++ b/recipes/xkbcommon/all/test_package/conanfile.py @@ -8,7 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" def requirements(self): self.requires(self.tested_reference_str) From d067ccb86569a1f5e4532fa2c0cddfb9cc9d1f57 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 15 Sep 2022 06:04:43 +0900 Subject: [PATCH 033/561] (#12886) earcut: add version 2.2.4 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/earcut/all/conandata.yml | 3 +++ recipes/earcut/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/earcut/all/conandata.yml b/recipes/earcut/all/conandata.yml index 87ccbe5b9a3f8..e7672ce5fb5f3 100644 --- a/recipes/earcut/all/conandata.yml +++ b/recipes/earcut/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.4": + url: "https://github.com/mapbox/earcut.hpp/archive/v2.2.4.tar.gz" + sha256: "fcfa6a47a52d4c94dc960bdb747f17e077609235517b0bb5ce8097d6b747695a" "2.2.3": url: "https://github.com/mapbox/earcut.hpp/archive/v2.2.3.tar.gz" sha256: "f382616de763289c698f37ec3a5b9fcd3d6d821cbef0b3c72e43bdd909c81b5a" diff --git a/recipes/earcut/config.yml b/recipes/earcut/config.yml index 9252671a6fdf5..dc295dd4a8376 100644 --- a/recipes/earcut/config.yml +++ b/recipes/earcut/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.4": + folder: "all" "2.2.3": folder: "all" "0.12.4": From 62df6e5b2b58525444d0c837b9d7a3c94f8c6f79 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Sep 2022 23:25:01 +0200 Subject: [PATCH 034/561] (#12894) magic_enum: conan v2 support --- recipes/magic_enum/all/conanfile.py | 77 +++++++++++-------- .../all/test_package/CMakeLists.txt | 9 +-- .../magic_enum/all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../all/test_v1_package/conanfile.py | 17 ++++ 5 files changed, 91 insertions(+), 44 deletions(-) create mode 100644 recipes/magic_enum/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/magic_enum/all/test_v1_package/conanfile.py diff --git a/recipes/magic_enum/all/conanfile.py b/recipes/magic_enum/all/conanfile.py index 4b7a9fa79b96f..ad2dd7598a2f6 100644 --- a/recipes/magic_enum/all/conanfile.py +++ b/recipes/magic_enum/all/conanfile.py @@ -1,29 +1,31 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +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 import os +required_conan_version = ">=1.50.0" + + class MagicEnumConan(ConanFile): name = "magic_enum" - description = "Header-only C++17 library provides static reflection for enums, work with any enum type without any macro or boilerplate code." - topics = ( - "conan", - "cplusplus", - "enum-to-string", - "string-to-enum" - "serialization", - "reflection", - "header-only", - "compile-time" + description = ( + "Header-only C++17 library provides static reflection for enums, work " + "with any enum type without any macro or boilerplate code." ) - url = "https://github.com/conan-io/conan-center-index " + topics = ("cplusplus", "enum-to-string", "string-to-enum", "serialization", + "reflection", "header-only", "compile-time") + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Neargye/magic_enum" license = "MIT" - settings = "compiler", "arch", "build_type", "os" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "17" @property def _compilers_minimum_version(self): @@ -34,25 +36,36 @@ def _compilers_minimum_version(self): "apple-clang": "10", } - def configure(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("magic_enum requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("magic_enum: Unsupported compiler: {}-{} " - "(https://github.com/Neargye/magic_enum#compiler-compatibility)." - .format(self.settings.compiler, self.settings.compiler.version)) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("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.", + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE", dst="licenses" , src=self._source_subfolder) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "magic_enum") + self.cpp_info.set_property("cmake_target_name", "magic_enum::magic_enum") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/magic_enum/all/test_package/CMakeLists.txt b/recipes/magic_enum/all/test_package/CMakeLists.txt index 60591d4de621c..c185d76435a4f 100644 --- a/recipes/magic_enum/all/test_package/CMakeLists.txt +++ b/recipes/magic_enum/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(magic_enum REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) -target_link_libraries(${PROJECT_NAME} magic_enum::magic_enum) +target_link_libraries(${PROJECT_NAME} PRIVATE magic_enum::magic_enum) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/magic_enum/all/test_package/conanfile.py b/recipes/magic_enum/all/test_package/conanfile.py index 7e2dfe859bb27..0a6bc68712d90 100644 --- a/recipes/magic_enum/all/test_package/conanfile.py +++ b/recipes/magic_enum/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/magic_enum/all/test_v1_package/CMakeLists.txt b/recipes/magic_enum/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..de886ea1bc291 --- /dev/null +++ b/recipes/magic_enum/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(magic_enum REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE magic_enum::magic_enum) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/magic_enum/all/test_v1_package/conanfile.py b/recipes/magic_enum/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/magic_enum/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 9f56615c4050b12a580600ce77ca6a7f027be350 Mon Sep 17 00:00:00 2001 From: chausner <15180557+chausner@users.noreply.github.com> Date: Wed, 14 Sep 2022 23:44:52 +0200 Subject: [PATCH 035/561] (#12895) lz4: Update to 1.9.4 * [lz4] Update to 1.9.4 * Fix CMake package installation * Keep backwards-compatibility for 1.9.3 * Fix indentation * Update test package Signed-off-by: Uilian Ries * Fix cmake_file_name Signed-off-by: Uilian Ries Co-authored-by: chausner Co-authored-by: Uilian Ries --- recipes/lz4/all/conandata.yml | 3 ++ recipes/lz4/all/conanfile.py | 36 +++++++++++++++++-- recipes/lz4/all/test_package/CMakeLists.txt | 16 +++++++-- recipes/lz4/all/test_package/conanfile.py | 8 +++-- .../lz4/all/test_v1_package/CMakeLists.txt | 16 +++++++-- recipes/lz4/all/test_v1_package/conanfile.py | 5 +-- recipes/lz4/config.yml | 2 ++ 7 files changed, 75 insertions(+), 11 deletions(-) diff --git a/recipes/lz4/all/conandata.yml b/recipes/lz4/all/conandata.yml index 3579b5186e78a..b795699823646 100644 --- a/recipes/lz4/all/conandata.yml +++ b/recipes/lz4/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.9.4": + sha256: 0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b + url: https://github.com/lz4/lz4/archive/v1.9.4.tar.gz "1.9.3": sha256: 030644df4611007ff7dc962d981f390361e6c97a34e5cbc393ddfbe019ffe2c1 url: https://github.com/lz4/lz4/archive/v1.9.3.tar.gz diff --git a/recipes/lz4/all/conanfile.py b/recipes/lz4/all/conanfile.py index 1bfaf60d3093c..8a675ed676050 100644 --- a/recipes/lz4/all/conanfile.py +++ b/recipes/lz4/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, get, rmdir, save from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os +import textwrap required_conan_version = ">=1.50.0" @@ -79,17 +80,48 @@ def build(self): cmake.configure(build_script_folder=self._cmakelists_folder) cmake.build() + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + if Version(self.version) >= "1.9.4": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) + if Version(self.version) >= "1.9.4": + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"lz4": "LZ4::lz4" if self.options.shared else "LZ4::lz4_static"} + ) + def package_info(self): self.cpp_info.set_property("pkg_config_name", "liblz4") + if Version(self.version) >= "1.9.4": + self.cpp_info.set_property("cmake_file_name", "lz4") + self.cpp_info.set_property("cmake_target_name", "LZ4::lz4" if self.options.shared else "LZ4::lz4_static") self.cpp_info.libs = ["lz4"] if is_msvc(self) and self.options.shared: self.cpp_info.defines.append("LZ4_DLL_IMPORT=1") - self.cpp_info.names["pkg_config"] = "liblz4" + + if Version(self.version) >= "1.9.4": + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/lz4/all/test_package/CMakeLists.txt b/recipes/lz4/all/test_package/CMakeLists.txt index 635cd8a81b70b..b008259cf04cb 100644 --- a/recipes/lz4/all/test_package/CMakeLists.txt +++ b/recipes/lz4/all/test_package/CMakeLists.txt @@ -4,10 +4,22 @@ project(test_package LANGUAGES C) find_package(lz4 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE lz4::lz4) +if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) +elseif(TARGET LZ4::lz4) + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4) +else() # version 1.9.3 and older + target_link_libraries(${PROJECT_NAME} PRIVATE lz4::lz4) +endif() option(TEST_SHARED_LIB "Use package in a shared library") if(TEST_AS_SHARED_LIB) add_library(${PROJECT_NAME}2 SHARED lib.c) - target_link_libraries(${PROJECT_NAME}2 PRIVATE lz4::lz4) + if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) + elseif(TARGET LZ4::lz4) + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4) + else() # version 1.9.3 and older + target_link_libraries(${PROJECT_NAME}2 PRIVATE lz4::lz4) + endif() endif() diff --git a/recipes/lz4/all/test_package/conanfile.py b/recipes/lz4/all/test_package/conanfile.py index e75f5178b45bc..e1a1aff777023 100644 --- a/recipes/lz4/all/test_package/conanfile.py +++ b/recipes/lz4/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) @@ -15,8 +16,9 @@ def layout(self): cmake_layout(self) def generate(self): + lz4 = self.dependencies["lz4"] tc = CMakeToolchain(self) - tc.variables["TEST_SHARED_LIB"] = dict(self.options["lz4"].items()).get("fPIC", True) + tc.variables["TEST_SHARED_LIB"] = lz4.options.get_safe("fPIC", True) tc.generate() def build(self): @@ -25,6 +27,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/lz4/all/test_v1_package/CMakeLists.txt b/recipes/lz4/all/test_v1_package/CMakeLists.txt index 027f3c1a4263e..88ef3fa80eee7 100644 --- a/recipes/lz4/all/test_v1_package/CMakeLists.txt +++ b/recipes/lz4/all/test_v1_package/CMakeLists.txt @@ -7,10 +7,22 @@ conan_basic_setup(TARGETS) find_package(lz4 REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE lz4::lz4) +if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) +elseif(TARGET LZ4::lz4) + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4) +else() # version 1.9.3 and older + target_link_libraries(${PROJECT_NAME} PRIVATE lz4::lz4) +endif() option(TEST_SHARED_LIB "Use package in a shared library") if(TEST_AS_SHARED_LIB) add_library(${PROJECT_NAME}2 SHARED ../test_package/lib.c) - target_link_libraries(${PROJECT_NAME}2 PRIVATE lz4::lz4) + if(TARGET LZ4::lz4_static) + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) + elseif(TARGET LZ4::lz4) + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4) + else() # version 1.9.3 and older + target_link_libraries(${PROJECT_NAME}2 PRIVATE lz4::lz4) + endif() endif() diff --git a/recipes/lz4/all/test_v1_package/conanfile.py b/recipes/lz4/all/test_v1_package/conanfile.py index 051325f9879dc..a2c12d9cb383d 100644 --- a/recipes/lz4/all/test_v1_package/conanfile.py +++ b/recipes/lz4/all/test_v1_package/conanfile.py @@ -1,5 +1,6 @@ # pylint: skip-file -from conans import ConanFile, CMake, tools +from conans import ConanFile, CMake +from conan.tools.build import cross_building import os @@ -14,6 +15,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if not cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) diff --git a/recipes/lz4/config.yml b/recipes/lz4/config.yml index 21112b10e25d5..f96920e268df8 100644 --- a/recipes/lz4/config.yml +++ b/recipes/lz4/config.yml @@ -1,4 +1,6 @@ versions: + "1.9.4": + folder: all "1.9.3": folder: all "1.9.2": From f4b4af5c0d3a3f3684c395e16fba3514ac77e18d Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 14 Sep 2022 17:05:33 -0500 Subject: [PATCH 036/561] (#12807) boost: Add 1.80.0 * boost: Add 1.80.0 * Tweak the local Jamfile diff slightly * Tweak Jamfile for locale again * Fix Locale Jamfile * Format diff * Revert iconv related changes in 1.80.0 Jamfile.v2 * Remove URL field for patches in conandata.yml This follows the documented practices for Conan Center. URL was removed in favor of the patch_source field. Co-authored-by: TheSalvator --- recipes/boost/all/conandata.yml | 36 ++- .../all/dependencies/dependencies-1.80.0.yml | 275 ++++++++++++++++++ ...-filesystem-win-fix-dir-it-net-share.patch | 31 ++ ...ystem-fix-weakly-canonical-long-path.patch | 171 +++++++++++ ...80.0-0003-unordered-valid-after-move.patch | 175 +++++++++++ ...posix-fix-no-at-apis-missing-include.patch | 21 ++ ....80.0-locale-fail-on-missing-backend.patch | 84 ++++++ recipes/boost/config.yml | 2 + 8 files changed, 794 insertions(+), 1 deletion(-) create mode 100644 recipes/boost/all/dependencies/dependencies-1.80.0.yml create mode 100644 recipes/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch create mode 100644 recipes/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch create mode 100644 recipes/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch create mode 100644 recipes/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch create mode 100644 recipes/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml index 3798685661eda..ca9313ee3988b 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -58,6 +58,12 @@ sources: "https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2" ] sha256: "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" + 1.80.0: + url: [ + "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.80.0/boost_1_80_0.tar.bz2" + ] + sha256: "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0" patches: 1.70.0: - patch_file: "patches/0001-beast-fix-moved-from-executor.patch" @@ -240,5 +246,33 @@ patches: - patch_file: "patches/1.79.0-geometry_no_rtti.patch" base_path: "source_subfolder" patch_type: "portability" - url: "https://github.com/boostorg/geometry/commit/b354162798749b3aaa539755e7b9be49d2b9a9c4.patch" patch_source: "https://github.com/boostorg/geometry/discussions/1041" + 1.80.0: + - patch_file: "patches/1.80.0-locale-fail-on-missing-backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" + base_path: "source_subfolder" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + base_path: "source_subfolder" + - patch_file: "patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch" + patch_description: "Directory iterators may fail to construct for a network share on Windows prior to 10" + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/245" + base_path: "source_subfolder" + - patch_file: "patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch" + patch_description: 'On Windows, weakly_canonical fails to process paths that start with the "\\?\" prefix' + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/247" + base_path: "source_subfolder" + - patch_file: "patches/1.80.0-0003-unordered-valid-after-move.patch" + patch_description: "Containers are not in a valid state after moving" + patch_type: "official" + patch_source: "https://github.com/boostorg/unordered/issues/139" + base_path: "source_subfolder" + - patch_file: "patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch" + patch_description: "On POSIX systems that don't support *at APIs, compilation fails due to a missing include" + patch_type: "official" + patch_source: "https://github.com/boostorg/filesystem/issues/250" + base_path: "source_subfolder" diff --git a/recipes/boost/all/dependencies/dependencies-1.80.0.yml b/recipes/boost/all/dependencies/dependencies-1.80.0.yml new file mode 100644 index 0000000000000..4cabd8ca5c44d --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.80.0.yml @@ -0,0 +1,275 @@ +configure_options: +- atomic +- chrono +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- wave +dependencies: + atomic: [] + chrono: + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - container + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: + - chrono + - system + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + chrono: + - boost_chrono + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.80.0 diff --git a/recipes/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch b/recipes/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch new file mode 100644 index 0000000000000..0d28b86bb670c --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0001-filesystem-win-fix-dir-it-net-share.patch @@ -0,0 +1,31 @@ +commit 9c9d127bddc2b72187c57f4933c49666255d7a4f +Author: Olavo Belloc +Date: Mon Aug 8 10:54:02 2022 +0200 + + Limit the buffer size for compatibility with previous versions of Windows + + The reported error was reproduced on Windows 7 and 8.1, but not on an early + version of Windows 10 (2004). + + Closes https://github.com/boostorg/filesystem/pull/246. + Likely fixes https://github.com/boostorg/filesystem/issues/245. + +diff --git a/libs/filesystem/src/directory.cpp b/libs/filesystem/src/directory.cpp +index 6a3e1dc..9334893 100644 +--- a/libs/filesystem/src/directory.cpp ++++ b/libs/filesystem/src/directory.cpp +@@ -599,9 +599,12 @@ extra_data_format g_extra_data_format = file_directory_information_format; + * \brief Extra buffer size for GetFileInformationByHandleEx-based or NtQueryDirectoryFile-based directory iterator. + * + * Must be large enough to accommodate at least one FILE_DIRECTORY_INFORMATION or *_DIR_INFO struct and one filename. +- * NTFS, VFAT, exFAT support filenames up to 255 UTF-16/UCS-2 characters. ReFS supports filenames up to 32768 UTF-16 characters. ++ * NTFS, VFAT, exFAT and ReFS support filenames up to 255 UTF-16/UCS-2 characters. (For ReFS, there is no information ++ * on the on-disk format, and it is possible that it supports longer filenames, up to 32768 UTF-16/UCS-2 characters.) ++ * The buffer cannot be larger than 64k, because up to Windows 8.1, NtQueryDirectoryFile and GetFileInformationByHandleEx ++ * fail with ERROR_INVALID_PARAMETER when trying to retrieve the filenames from a network share. + */ +-BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_extra_size = sizeof(file_id_extd_dir_info) + 65536u; ++BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_extra_size = 65536u; + + inline system::error_code dir_itr_close(dir_itr_imp& imp) BOOST_NOEXCEPT + { diff --git a/recipes/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch b/recipes/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch new file mode 100644 index 0000000000000..9312059a60000 --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0002-filesystem-fix-weakly-canonical-long-path.patch @@ -0,0 +1,171 @@ +commit 476ca7b6c1d37a5d796f8525813a9a64c9e54ffc +Author: Andrey Semashev +Date: Wed Aug 10 04:57:21 2022 +0300 + + Fix weakly_canonical on Windows with long paths prefix. + + During its operation, weakly_canonical would call status() on the path + consisting only from the root name of the input path. This would fail + with ERROR_INVALID_FUNCTION if the root name starts with the "\\?\" prefix, + as the root name path is not absolute. + + To fix this, we don't check the status of the root name path (which is + not the correct check anyways as it tests the current directory on the + corresponding drive for existence, which is not what we want). Additionally, + avoid calling status() on the paths containing dot and dot-dot elements + during the weakly_canonical execution for the same reason - the "\\?\" + prefix disables most of the path processing in Windows APIs, including + dot and dot-dot elements resolution. + + Fixes https://github.com/boostorg/filesystem/issues/247. + +diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp +index dd636e9..ca2fff3 100644 +--- a/libs/filesystem/src/operations.cpp ++++ b/libs/filesystem/src/operations.cpp +@@ -4434,7 +4434,7 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + path head(p); + for (; !head.empty(); --itr) + { +- file_status head_status = detail::status_impl(head, &local_ec); ++ file_status head_status(detail::status_impl(head, &local_ec)); + if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { + if (!ec) +@@ -4450,32 +4450,83 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + head.remove_filename(); + } + ++ if (head.empty()) ++ return p.lexically_normal(); ++ ++ path const& dot_p = dot_path(); ++ path const& dot_dot_p = dot_dot_path(); ++ + #else + +- // On Windows, filesystem APIs such as GetFileAttributesW perform lexical path normalization internally. +- // As a result, a path like "c:\a\.." can be reported as present even if "c:\a" is not. This would break +- // canonical, as symlink_status that it calls internally would report an error that the file at the intermediate +- // path does not exist. To avoid this, scan the initial path in the forward direction. +- // Also, operate on paths with preferred separators. This can be important on Windows since GetFileAttributesW, +- // which is called in status() may return "file not found" for paths to network shares and mounted cloud +- // storages that have forward slashes as separators. ++ // On Windows, filesystem APIs such as GetFileAttributesW and CreateFileW perform lexical path normalization ++ // internally. As a result, a path like "c:\a\.." can be reported as present even if "c:\a" is not. This would ++ // break canonical, as symlink_status that it calls internally would report an error that the file at the ++ // intermediate path does not exist. To avoid this, scan the initial path in the forward direction. ++ // Also, operate on paths with preferred separators. This can be important on Windows since GetFileAttributesW ++ // or CreateFileW, which is called in status() may return "file not found" for paths to network shares and ++ // mounted cloud storages that have forward slashes as separators. ++ // Also, avoid querying status of the root name such as \\?\c: as CreateFileW returns ERROR_INVALID_FUNCTION for ++ // such path. Querying the status of a root name such as c: is also not right as this path refers to the current ++ // directory on drive C:, which is not what we want to test for existence anyway. + path::iterator itr(p.begin()); + path head; +- for (; itr != p_end; ++itr) ++ if (p.has_root_name()) + { +- path const& p_elem = *itr; +- if (p_elem.size() == 1u && detail::is_directory_separator(p_elem.native()[0])) ++ BOOST_ASSERT(itr != p_end); ++ head = *itr; ++ ++itr; ++ } ++ ++ if (p.has_root_directory()) ++ { ++ BOOST_ASSERT(itr != p_end); ++ // Convert generic separator returned by the iterator for the root directory to ++ // the preferred separator. ++ head += path::preferred_separator; ++ ++itr; ++ } ++ ++ if (!head.empty()) ++ { ++ file_status head_status(detail::status_impl(head, &local_ec)); ++ if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { +- // Convert generic separator returned by the iterator for the root directory to +- // the preferred separator. +- head += path::preferred_separator; ++ if (!ec) ++ BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::weakly_canonical", head, local_ec)); ++ ++ *ec = local_ec; ++ return path(); + } +- else ++ ++ if (head_status.type() == fs::file_not_found) ++ { ++ // If the root path does not exist then no path element exists ++ return p.lexically_normal(); ++ } ++ } ++ ++ path const& dot_p = dot_path(); ++ path const& dot_dot_p = dot_dot_path(); ++ for (; itr != p_end; ++itr) ++ { ++ path const& p_elem = *itr; ++ ++ // Avoid querying status of paths containing dot and dot-dot elements, as this will break ++ // if the root name starts with "\\?\". ++ if (p_elem == dot_p) ++ continue; ++ ++ if (p_elem == dot_dot_p) + { +- head /= p_elem; ++ if (head.has_relative_path()) ++ head.remove_filename(); ++ ++ continue; + } + +- file_status head_status = detail::status_impl(head, &local_ec); ++ head /= p_elem; ++ ++ file_status head_status(detail::status_impl(head, &local_ec)); + if (BOOST_UNLIKELY(head_status.type() == fs::status_error)) + { + if (!ec) +@@ -4492,33 +4543,22 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec) + } + } + ++ if (head.empty()) ++ return p.lexically_normal(); ++ + #endif + +- path const& dot_p = dot_path(); +- path const& dot_dot_p = dot_dot_path(); + path tail; + bool tail_has_dots = false; + for (; itr != p_end; ++itr) + { + path const& tail_elem = *itr; +-#if defined(BOOST_WINDOWS_API) +- if (tail_elem.size() == 1u && detail::is_directory_separator(tail_elem.native()[0])) +- { +- // Convert generic separator returned by the iterator for the root directory to +- // the preferred separator. +- tail += path::preferred_separator; +- continue; +- } +-#endif + tail /= tail_elem; + // for a later optimization, track if any dot or dot-dot elements are present + if (!tail_has_dots && (tail_elem == dot_p || tail_elem == dot_dot_p)) + tail_has_dots = true; + } + +- if (head.empty()) +- return p.lexically_normal(); +- + head = detail::canonical(head, base, &local_ec); + if (BOOST_UNLIKELY(!!local_ec)) + { diff --git a/recipes/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch b/recipes/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch new file mode 100644 index 0000000000000..4245f23e76299 --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0003-unordered-valid-after-move.patch @@ -0,0 +1,175 @@ +diff -urN a/boost/unordered/detail/fca.hpp b/boost/unordered/detail/fca.hpp +--- a/boost/unordered/detail/fca.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/detail/fca.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -646,7 +646,7 @@ + + size_type bucket_count() const { return size_; } + +- iterator begin() const { return ++at(size_); } ++ iterator begin() const { return size_ == 0 ? end() : ++at(size_); } + + iterator end() const + { +@@ -660,6 +660,10 @@ + + local_iterator begin(size_type n) const + { ++ if (size_ == 0) { ++ return this->end(n); ++ } ++ + return local_iterator( + (buckets + static_cast(n))->next); + } +@@ -670,12 +674,16 @@ + + iterator at(size_type n) const + { +- std::size_t const N = group::N; ++ if (size_ > 0) { ++ std::size_t const N = group::N; + +- iterator pbg(buckets + static_cast(n), +- groups + static_cast(n / N)); ++ iterator pbg(buckets + static_cast(n), ++ groups + static_cast(n / N)); + +- return pbg; ++ return pbg; ++ } else { ++ return this->end(); ++ } + } + + span raw() +diff -urN a/boost/unordered/detail/implementation.hpp b/boost/unordered/detail/implementation.hpp +--- a/boost/unordered/detail/implementation.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/detail/implementation.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -2054,12 +2054,14 @@ + + std::size_t bucket_size(std::size_t index) const + { +- bucket_iterator itb = buckets_.at(index); +- node_pointer n = itb->next; + std::size_t count = 0; +- while (n) { +- ++count; +- n = n->next; ++ if (size_ > 0) { ++ bucket_iterator itb = buckets_.at(index); ++ node_pointer n = itb->next; ++ while (n) { ++ ++count; ++ n = n->next; ++ } + } + return count; + } +@@ -2420,11 +2422,14 @@ + node_pointer find_node_impl( + Key const& x, bucket_iterator itb) const + { +- key_equal const& pred = this->key_eq(); +- node_pointer p = itb->next; +- for (; p; p = p->next) { +- if (pred(x, extractor::extract(p->value()))) { +- break; ++ node_pointer p = node_pointer(); ++ if (itb != buckets_.end()) { ++ key_equal const& pred = this->key_eq(); ++ p = itb->next; ++ for (; p; p = p->next) { ++ if (pred(x, extractor::extract(p->value()))) { ++ break; ++ } + } + } + return p; +@@ -2453,11 +2458,13 @@ + inline iterator transparent_find( + Key const& k, Hash const& h, Pred const& pred) const + { +- std::size_t const key_hash = h(k); +- bucket_iterator itb = buckets_.at(buckets_.position(key_hash)); +- for (node_pointer p = itb->next; p; p = p->next) { +- if (BOOST_LIKELY(pred(k, extractor::extract(p->value())))) { +- return iterator(p, itb); ++ if (size_ > 0) { ++ std::size_t const key_hash = h(k); ++ bucket_iterator itb = buckets_.at(buckets_.position(key_hash)); ++ for (node_pointer p = itb->next; p; p = p->next) { ++ if (BOOST_LIKELY(pred(k, extractor::extract(p->value())))) { ++ return iterator(p, itb); ++ } + } + } + +@@ -2467,11 +2474,13 @@ + template + node_pointer* find_prev(Key const& key, bucket_iterator itb) + { +- key_equal pred = this->key_eq(); +- for (node_pointer* pp = boost::addressof(itb->next); *pp; +- pp = boost::addressof((*pp)->next)) { +- if (pred(key, extractor::extract((*pp)->value()))) { +- return pp; ++ if (size_ > 0) { ++ key_equal pred = this->key_eq(); ++ for (node_pointer* pp = boost::addressof(itb->next); *pp; ++ pp = boost::addressof((*pp)->next)) { ++ if (pred(key, extractor::extract((*pp)->value()))) { ++ return pp; ++ } + } + } + typedef node_pointer* node_pointer_pointer; +diff -urN a/boost/unordered/unordered_map.hpp b/boost/unordered/unordered_map.hpp +--- a/boost/unordered/unordered_map.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/unordered_map.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -2069,6 +2069,10 @@ + template + float unordered_map::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +@@ -2506,6 +2510,10 @@ + template + float unordered_multimap::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +diff -urN a/boost/unordered/unordered_set.hpp b/boost/unordered/unordered_set.hpp +--- a/boost/unordered/unordered_set.hpp 2022-08-03 22:47:16.000000000 -0400 ++++ b/boost/unordered/unordered_set.hpp 2022-08-24 19:44:43.139787681 -0400 +@@ -1586,6 +1586,10 @@ + template + float unordered_set::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); +@@ -1986,6 +1990,10 @@ + template + float unordered_multiset::load_factor() const BOOST_NOEXCEPT + { ++ if (table_.size_ == 0) { ++ return 0.0f; ++ } ++ + BOOST_ASSERT(table_.bucket_count() != 0); + return static_cast(table_.size_) / + static_cast(table_.bucket_count()); diff --git a/recipes/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch b/recipes/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch new file mode 100644 index 0000000000000..dfa4438d93acd --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-0004-filesystem-posix-fix-no-at-apis-missing-include.patch @@ -0,0 +1,21 @@ +commit 5864f397ccad30f6e73221b90bdac57a303b9752 +Author: Andrey Semashev +Date: Fri Aug 12 12:59:56 2022 +0300 + + Fixed a missing include on POSIX systems that don't support *at APIs. + + Fixes https://github.com/boostorg/filesystem/issues/250. + +diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp +index ca2fff3..e22967e 100644 +--- a/libs/filesystem/src/operations.cpp ++++ b/libs/filesystem/src/operations.cpp +@@ -70,7 +70,7 @@ + + #include + #include +-#if _POSIX_C_SOURCE < 200809L ++#if !defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS) + #include + #endif + #include diff --git a/recipes/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch b/recipes/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch new file mode 100644 index 0000000000000..e352396226710 --- /dev/null +++ b/recipes/boost/all/patches/1.80.0-locale-fail-on-missing-backend.patch @@ -0,0 +1,84 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index 3c517c884..0f521dbcf 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -20,6 +20,7 @@ project /boost/locale + # Features + + feature.feature boost.locale.iconv : on off : optional propagated ; ++feature.feature boost.locale.iconv.lib : libc libiconv : optional propagated ; + feature.feature boost.locale.icu : on off : optional propagated ; + feature.feature boost.locale.posix : on off : optional propagated ; + feature.feature boost.locale.std : on off : optional propagated ; +@@ -29,7 +30,8 @@ feature.feature boost.locale.winapi : on off : optional propagated ; + + ## iconv + +-exe has_iconv : $(TOP)/build/has_iconv.cpp ; ++obj has_iconv_libc_obj : $(TOP)/build/has_iconv.cpp ; ++exe has_iconv : has_iconv_libc_obj ; + explicit has_iconv ; + + ICONV_PATH = [ modules.peek : ICONV_PATH ] ; +@@ -43,7 +45,8 @@ lib iconv + + explicit iconv ; + +-exe has_external_iconv : $(TOP)/build/has_iconv.cpp iconv ; ++obj has_iconv_libc_ext : $(TOP)/build/has_iconv.cpp iconv ; ++exe has_external_iconv : has_iconv_libc_ext iconv ; + explicit has_external_iconv ; + + exe accepts_shared_option : $(TOP)/build/option.cpp +@@ -230,10 +233,37 @@ rule configure-full ( properties * : flags-only ) + if [ configure.builds has_iconv : $(properties) : "iconv (libc)" ] + { + found-iconv = true ; +- } else if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ if libiconv in $(properties) ++ { ++ if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ { ++ result += iconv ; ++ } ++ else ++ { ++ EXIT "- Boost.Locale found iconv (libc) instead of iconv (separate) library to be built." ; ++ } ++ } ++ } ++ else if libc in $(properties) + { +- found-iconv = true ; +- result += iconv ; ++ EXIT "- Boost.Locale failed to find iconv (libc) library to be built." ; ++ } ++ else ++ { ++ if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] ++ { ++ found-iconv = true ; ++ result += iconv ; ++ } ++ else if libiconv in $(properties) ++ { ++ EXIT "- Boost.Locale failed to find iconv (separate) library to be built." ; ++ } ++ } ++ if ! $(found-iconv) ++ { ++ EXIT "- Boost.Locale failed to find iconv library to be built." ; + } + } + if $(found-iconv) +@@ -273,6 +303,10 @@ rule configure-full ( properties * : flags-only ) + /boost/thread//boost_thread + ; + } ++ else ++ { ++ EXIT "- Boost.Locale failed to find ICU library to be built." ; ++ } + } + + if ! $(found-iconv) && ! $(found-icu) && ! windows in $(properties) && ! cygwin in $(properties) diff --git a/recipes/boost/config.yml b/recipes/boost/config.yml index a68be93f2ddb0..c2b37ebeaa9db 100644 --- a/recipes/boost/config.yml +++ b/recipes/boost/config.yml @@ -19,3 +19,5 @@ versions: folder: all 1.79.0: folder: all + 1.80.0: + folder: all From 612824fc3fbe6a7dfb53b448f091df1bc10e608e Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 15 Sep 2022 07:44:31 +0900 Subject: [PATCH 037/561] (#12897) msgpack-cxx: add version 4.1.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/msgpack-cxx/all/conandata.yml | 3 +++ recipes/msgpack-cxx/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/msgpack-cxx/all/conandata.yml b/recipes/msgpack-cxx/all/conandata.yml index 99a928cf90da3..8fec67c3baee4 100644 --- a/recipes/msgpack-cxx/all/conandata.yml +++ b/recipes/msgpack-cxx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.1.2": + url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.2.tar.gz" + sha256: "7460ad43552c9d9b56a75f20e1f4fedf18fff1c48715d6cfa91d779b26ca3795" "4.1.1": url: "https://github.com/msgpack/msgpack-c/archive/cpp-4.1.1.tar.gz" sha256: "221cc539e77f5ca02f4f0bbb1edafa9ca8c08de7ba8072d7baf2139930d99182" diff --git a/recipes/msgpack-cxx/config.yml b/recipes/msgpack-cxx/config.yml index d20f35fd44a6b..8bbe8410bb2b4 100644 --- a/recipes/msgpack-cxx/config.yml +++ b/recipes/msgpack-cxx/config.yml @@ -1,4 +1,6 @@ versions: + "4.1.2": + folder: all "4.1.1": folder: all "4.1.0": From 7cc71effda3a5ee5012121819bc25a4b378cedfa Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Thu, 15 Sep 2022 01:04:11 +0200 Subject: [PATCH 038/561] (#12905) [docs] `config.yml` file is mandatory * [docs] file is mandatory * Be more specific about date format and timezone --- docs/conandata_yml_format.md | 2 +- docs/faqs.md | 2 +- docs/how_to_add_packages.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conandata_yml_format.md b/docs/conandata_yml_format.md index a1222e4125c92..fed5e9e464396 100644 --- a/docs/conandata_yml_format.md +++ b/docs/conandata_yml_format.md @@ -212,7 +212,7 @@ Usually, the following kind of problems are good candidates for backports: - Data corruption. - Use of outdated or deprecated API or library. -As sources with backports don't act exactly the same as the version officially released, it may be a source of confusion for the consumers who are relying on the buggy behavior (even if it's completely wrong). Therefore, it's required to introduce a new `cci.` version for such backports, so consumers may choose to use either official version, or modified version with backport(s) included. +As sources with backports don't act exactly the same as the version officially released, it may be a source of confusion for the consumers who are relying on the buggy behavior (even if it's completely wrong). Therefore, it's required to introduce a new `cci.` version for such backports, so consumers may choose to use either official version, or modified version with backport(s) included. ##### portability diff --git a/docs/faqs.md b/docs/faqs.md index 51f67dd65eab4..e3a2e3e0fa87a 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -105,7 +105,7 @@ Unless they are a general and extended utility in recipes (in which case, we sho ## What version should packages use for libraries without official releases? -The notation shown below is used for publishing packages where the original library does not make official releases. Thus, we use a format which includes the datestamp corresponding to the date of a commit: `cci.`. In order to create reproducible builds, we also "commit-lock" to the latest commit on that day. Otherwise, users would get inconsistent results over time when rebuilding the package. An example of this is the [RapidJSON](https://github.com/Tencent/rapidjson) library, where its package reference is `rapidjson/cci.20200410` and its sources are locked the latest commit on that date in [config.yml](https://github.com/conan-io/conan-center-index/blob/master/recipes/rapidjson/config.yml#L4). The prefix `cci.` is mandatory to distinguish as a virtual version provided by CCI. If you are interested to know about the origin, please, read [here](https://github.com/conan-io/conan-center-index/pull/1464). +The notation shown below is used for publishing packages where the original library does not make official releases. Thus, we use a format which includes the datestamp corresponding to the date of a commit: `cci.`. In order to create reproducible builds, we also "commit-lock" to the latest commit on that day (use UTC+00). Otherwise, users would get inconsistent results over time when rebuilding the package. An example of this is the [RapidJSON](https://github.com/Tencent/rapidjson) library, where its package reference is `rapidjson/cci.20200410` and its sources are locked the latest commit on that date in [conandata.yml](https://github.com/conan-io/conan-center-index/blob/master/recipes/rapidjson/all/conandata.yml#L5). The prefix `cci.` is mandatory to distinguish as a virtual version provided by CCI. If you are interested to know about the origin, please, read [here](https://github.com/conan-io/conan-center-index/pull/1464). ## Is the Jenkins orchestration library publicly available? diff --git a/docs/how_to_add_packages.md b/docs/how_to_add_packages.md index a3d58c0bb19af..6f0363c08c986 100644 --- a/docs/how_to_add_packages.md +++ b/docs/how_to_add_packages.md @@ -93,7 +93,7 @@ same structure. ### `config.yml` -This file lists the versions and the folders where they are located (if there are more than a single `all` folder): +This file lists the versions and the folders where they are located: ```yml versions: From 4a586c4f27066bc9a61956716667e00dab1f0400 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 15 Sep 2022 01:24:42 +0200 Subject: [PATCH 039/561] (#12908) Use target_compile_features for package_templates/cmake_package/all/test_package/CMakeLists.txt --- .../cmake_package/all/test_v1_package/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt b/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt index e36cdfd024c40..9be7f293be0fc 100644 --- a/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt +++ b/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt @@ -13,5 +13,4 @@ add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) # don't link to ${CONAN_LIBS} or CONAN_PKG::package target_link_libraries(${PROJECT_NAME} PRIVATE package::package) # in case the target project requires a C++ standard -set_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) - +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) From b5b2825c28017b4567266a747cc53f9e80f4e6c6 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 15 Sep 2022 01:44:23 +0200 Subject: [PATCH 040/561] (#12912) Add libltc/1.3.2 version --- recipes/libltc/all/conandata.yml | 3 +++ recipes/libltc/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/libltc/all/conandata.yml b/recipes/libltc/all/conandata.yml index aac3e2964fcab..c5fe4d5f5d812 100644 --- a/recipes/libltc/all/conandata.yml +++ b/recipes/libltc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.2": + url: "https://github.com/x42/libltc/releases/download/v1.3.2/libltc-1.3.2.tar.gz" + sha256: "0a6d42cd6c21e925a27fa560dc45ac80057d275f23342102825909c02d3b1249" "1.3.1": url: "https://github.com/x42/libltc/releases/download/v1.3.1/libltc-1.3.1.tar.gz" sha256: "50e63eb3b767151bc0159a3cc5d426d03a42fd69029bc9b3b7c346555f4b709c" diff --git a/recipes/libltc/config.yml b/recipes/libltc/config.yml index 71bf3f0e1bada..27e13c88ce850 100644 --- a/recipes/libltc/config.yml +++ b/recipes/libltc/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.2": + folder: "all" "1.3.1": folder: "all" From 019ed27d4f6d616408cff941a5a54bcb6d84d316 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 15 Sep 2022 02:04:43 +0200 Subject: [PATCH 041/561] (#12913) [docs] Clarify Unexpected error restarting * Clarify Unexpected error restarting Signed-off-by: Uilian Ries * Fix typo Co-authored-by: SSE4 Signed-off-by: Uilian Ries Co-authored-by: SSE4 --- docs/labels.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/labels.md b/docs/labels.md index 129664ab09538..1f1a2cff71d50 100644 --- a/docs/labels.md +++ b/docs/labels.md @@ -52,7 +52,9 @@ any further activity. Label [`Unexpected Error`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Unexpected+Error%22) is assigned by the CI when the process finishes abnormally. It tries to signal all the pull requests that failed, but didn't provide any meaningful message to the user. Usually it is some _random_ internal error and it won't happen next -time the CI runs, don't hesitate to trigger a new build in this situation. +time the CI runs. The CI will re-start your build automatically, the Github check `continuous-integration/jenkins/pr-merge` will changed to the +status `Pending — This commit is being built` to signalize as running. In case you restart it manually, by closing/opening the PR, your +build will be restarted too, but it will be the last in the CI build queue. ## User-approval pending From 16899ec4c79764b717860023d790af16c8febe2d Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 15 Sep 2022 09:24:28 +0900 Subject: [PATCH 042/561] (#12914) etl: add version 20.34.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/etl/all/conandata.yml | 3 +++ recipes/etl/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/etl/all/conandata.yml b/recipes/etl/all/conandata.yml index 3b4ff0a1ede88..a2883e8b77a59 100644 --- a/recipes/etl/all/conandata.yml +++ b/recipes/etl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20.34.0": + url: "https://github.com/ETLCPP/etl/archive/20.34.0.tar.gz" + sha256: "56e25968f20167a161ee50c3eecda3daa91f696660ba59654c1afd22e502c465" "20.33.0": url: "https://github.com/ETLCPP/etl/archive/20.33.0.tar.gz" sha256: "46068e44cc3cbd626fc8adc5344101b4654c675b9a5faec0c80989176419cd7d" diff --git a/recipes/etl/config.yml b/recipes/etl/config.yml index dd0382811d331..d9aa5dd96d1e9 100644 --- a/recipes/etl/config.yml +++ b/recipes/etl/config.yml @@ -1,4 +1,6 @@ versions: + "20.34.0": + folder: all "20.33.0": folder: all "20.32.1": From 4de0e88cb195958d153ef71b7da9cf5ff561c3f8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 02:44:45 +0200 Subject: [PATCH 043/561] (#12917) voropp: conan v2 support + fix download of source code * conan v2 support * fix download of source code --- recipes/voropp/all/CMakeLists.txt | 11 ++---- recipes/voropp/all/conanfile.py | 37 +++++++++---------- .../voropp/all/test_package/CMakeLists.txt | 7 ++-- recipes/voropp/all/test_package/conanfile.py | 19 +++++++--- .../voropp/all/test_v1_package/CMakeLists.txt | 10 +++++ .../voropp/all/test_v1_package/conanfile.py | 17 +++++++++ 6 files changed, 65 insertions(+), 36 deletions(-) create mode 100644 recipes/voropp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/voropp/all/test_v1_package/conanfile.py diff --git a/recipes/voropp/all/CMakeLists.txt b/recipes/voropp/all/CMakeLists.txt index 5aaa1e0bd9de9..6f2c6b9d5757a 100644 --- a/recipes/voropp/all/CMakeLists.txt +++ b/recipes/voropp/all/CMakeLists.txt @@ -1,12 +1,7 @@ cmake_minimum_required(VERSION 3.4) -project(voro++) +project(voro++ LANGUAGES CXX) -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(VOROPP_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/src) - -add_library(${PROJECT_NAME} ${VOROPP_SRC_DIR}/voro++.cc) +add_library(${PROJECT_NAME} ${VOROPP_SRC_DIR}/src/voro++.cc) set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) include(GNUInstallDirs) @@ -16,5 +11,5 @@ install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) -file(GLOB VOROPP_HEADERS ${VOROPP_SRC_DIR}/*.hh) +file(GLOB VOROPP_HEADERS ${VOROPP_SRC_DIR}/src/*.hh) install(FILES ${VOROPP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/voro++) diff --git a/recipes/voropp/all/conanfile.py b/recipes/voropp/all/conanfile.py index f8ab267cbb9e9..1186fcf21f63b 100644 --- a/recipes/voropp/all/conanfile.py +++ b/recipes/voropp/all/conanfile.py @@ -1,6 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.46.0" class VoroppConan(ConanFile): @@ -26,12 +29,6 @@ class VoroppConan(ConanFile): } exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" def config_options(self): if self.settings.os == "Windows": @@ -41,24 +38,26 @@ def configure(self): if self.options.shared: del self.options.fPIC + def layout(self): + cmake_layout(self, src_folder="src") + 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], + destination=self.source_folder, strip_root=True, verify=False) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VOROPP_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/voropp/all/test_package/CMakeLists.txt b/recipes/voropp/all/test_package/CMakeLists.txt index 196188113685c..80445ad826690 100644 --- a/recipes/voropp/all/test_package/CMakeLists.txt +++ b/recipes/voropp/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(voropp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE voropp::voropp) diff --git a/recipes/voropp/all/test_package/conanfile.py b/recipes/voropp/all/test_package/conanfile.py index 5c09494bc67c0..0a6bc68712d90 100644 --- a/recipes/voropp/all/test_package/conanfile.py +++ b/recipes/voropp/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/voropp/all/test_v1_package/CMakeLists.txt b/recipes/voropp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5a80123211f89 --- /dev/null +++ b/recipes/voropp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(voropp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE voropp::voropp) diff --git a/recipes/voropp/all/test_v1_package/conanfile.py b/recipes/voropp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/voropp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 2128eb4104274092f13bd5fbed04fe2f39640f6b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 03:04:18 +0200 Subject: [PATCH 044/561] (#12918) ninja: conan v2 support & drop 1.9.0 * conan v2 support * drop 1.9.0 --- recipes/ninja/1.10.x/CMakeLists.txt | 7 -- recipes/ninja/1.10.x/conanfile.py | 50 -------------- recipes/ninja/1.9.x/conandata.yml | 4 -- recipes/ninja/1.9.x/conanfile.py | 69 ------------------- recipes/ninja/1.9.x/test_package/conanfile.py | 9 --- recipes/ninja/{1.10.x => all}/conandata.yml | 6 +- recipes/ninja/all/conanfile.py | 51 ++++++++++++++ recipes/ninja/all/test_package/conanfile.py | 13 ++++ .../test_v1_package}/conanfile.py | 10 ++- recipes/ninja/config.yml | 8 +-- 10 files changed, 74 insertions(+), 153 deletions(-) delete mode 100644 recipes/ninja/1.10.x/CMakeLists.txt delete mode 100644 recipes/ninja/1.10.x/conanfile.py delete mode 100644 recipes/ninja/1.9.x/conandata.yml delete mode 100644 recipes/ninja/1.9.x/conanfile.py delete mode 100644 recipes/ninja/1.9.x/test_package/conanfile.py rename recipes/ninja/{1.10.x => all}/conandata.yml (100%) create mode 100644 recipes/ninja/all/conanfile.py create mode 100644 recipes/ninja/all/test_package/conanfile.py rename recipes/ninja/{1.10.x/test_package => all/test_v1_package}/conanfile.py (71%) diff --git a/recipes/ninja/1.10.x/CMakeLists.txt b/recipes/ninja/1.10.x/CMakeLists.txt deleted file mode 100644 index 97030501e5bd7..0000000000000 --- a/recipes/ninja/1.10.x/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/ninja/1.10.x/conanfile.py b/recipes/ninja/1.10.x/conanfile.py deleted file mode 100644 index 0bfbdc2cb45a0..0000000000000 --- a/recipes/ninja/1.10.x/conanfile.py +++ /dev/null @@ -1,50 +0,0 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import os - -class NinjaConan(ConanFile): - name = "ninja" - description = "Ninja is a small build system with a focus on speed" - license = "Apache-2.0" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/ninja-build/ninja" - settings = "os", "arch", "compiler", "build_type" - exports_sources = ["CMakeLists.txt", "*.patch"] - generators = "cmake" - topics = ("conan", "ninja", "build") - - _source_subfolder = "source_subfolder" - _cmake = None - - def package_id(self): - del self.info.settings.compiler - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = "OFF" - self._cmake.configure() - return self._cmake - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("ninja-%s" % self.version, self._source_subfolder) - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - cmake = self._configure_cmake() - cmake.build() - - def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() - cmake.install() - - def package_info(self): - self.cpp_info.includedirs = [] - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) - self.env_info.CONAN_CMAKE_GENERATOR = "Ninja" diff --git a/recipes/ninja/1.9.x/conandata.yml b/recipes/ninja/1.9.x/conandata.yml deleted file mode 100644 index 5a52be9167a97..0000000000000 --- a/recipes/ninja/1.9.x/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "1.9.0": - url: "https://github.com/ninja-build/ninja/archive/v1.9.0.tar.gz" - sha256: "5d7ec75828f8d3fd1a0c2f31b5b0cea780cdfe1031359228c428c1a48bfcd5b9" diff --git a/recipes/ninja/1.9.x/conanfile.py b/recipes/ninja/1.9.x/conanfile.py deleted file mode 100644 index 972b81bc12166..0000000000000 --- a/recipes/ninja/1.9.x/conanfile.py +++ /dev/null @@ -1,69 +0,0 @@ -import os -import sys -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration - - -class NinjaConan(ConanFile): - name = "ninja" - description = "Ninja is a small build system with a focus on speed" - license = "Apache-2.0" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/ninja-build/ninja" - settings = "os", "arch", "compiler", "build_type" - topics = ("conan", "ninja", "build") - - _source_subfolder = "source_subfolder" - - def package_id(self): - del self.info.settings.compiler - - def validate(self): - if hasattr(self, 'settings_build') and tools.cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("Cross-building not implemented") - - def _build_vs(self): - with tools.chdir(self._source_subfolder): - with tools.vcvars(self.settings, filter_known_paths=False): - self.run("%s configure.py --bootstrap" % sys.executable) - - def _build_configure(self): - with tools.chdir(self._source_subfolder): - cxx = os.environ.get("CXX", "g++") - if self.settings.os == "Linux": - if self.settings.arch == "x86": - cxx += " -m32" - elif self.settings.arch == "x86_64": - cxx += " -m64" - env_build = AutoToolsBuildEnvironment(self) - env_build_vars = env_build.vars - env_build_vars.update({'CXX': cxx}) - with tools.environment_append(env_build_vars): - self.run("%s configure.py --bootstrap" % sys.executable) - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("ninja-%s" % self.version, self._source_subfolder) - - def build(self): - if self.settings.os == "Windows": - self._build_vs() - else: - self._build_configure() - - def package(self): - self.copy(pattern="COPYING", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="ninja*", dst="bin", src=self._source_subfolder) - pdb = os.path.join(self.package_folder, "bin", "ninja.pdb") - if os.path.isfile(pdb): - os.unlink(pdb) - - def package_info(self): - self.cpp_info.includedirs = [] - # ensure ninja is executable - if self.settings.os in ["Linux", "Macos"]: - name = os.path.join(self.package_folder, "bin", "ninja") - os.chmod(name, os.stat(name).st_mode | 0o111) - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) - self.env_info.CONAN_CMAKE_GENERATOR = "Ninja" diff --git a/recipes/ninja/1.9.x/test_package/conanfile.py b/recipes/ninja/1.9.x/test_package/conanfile.py deleted file mode 100644 index 379e60b03587f..0000000000000 --- a/recipes/ninja/1.9.x/test_package/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -from conans import ConanFile, tools -import os - - -class TestPackage(ConanFile): - - def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("ninja --version", run_environment=True) diff --git a/recipes/ninja/1.10.x/conandata.yml b/recipes/ninja/all/conandata.yml similarity index 100% rename from recipes/ninja/1.10.x/conandata.yml rename to recipes/ninja/all/conandata.yml index 85c6ec3022a97..2eabaa966d910 100644 --- a/recipes/ninja/1.10.x/conandata.yml +++ b/recipes/ninja/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "1.10.2": - url: "https://github.com/ninja-build/ninja/archive/v1.10.2.tar.gz" - sha256: "ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed" "1.11.0": url: "https://github.com/ninja-build/ninja/archive/v1.11.0.tar.gz" sha256: "3c6ba2e66400fe3f1ae83deb4b235faf3137ec20bd5b08c29bfc368db143e4c6" + "1.10.2": + url: "https://github.com/ninja-build/ninja/archive/v1.10.2.tar.gz" + sha256: "ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed" diff --git a/recipes/ninja/all/conanfile.py b/recipes/ninja/all/conanfile.py new file mode 100644 index 0000000000000..bd89cd7fe4427 --- /dev/null +++ b/recipes/ninja/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os + +required_conan_version = ">=1.46.0" + + +class NinjaConan(ConanFile): + name = "ninja" + description = "Ninja is a small build system with a focus on speed" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ninja-build/ninja" + topics = ("ninja", "build") + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.conf_info.define("tools.cmake.cmaketoolchain:generator", "Ninja") + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.CONAN_CMAKE_GENERATOR = "Ninja" diff --git a/recipes/ninja/all/test_package/conanfile.py b/recipes/ninja/all/test_package/conanfile.py new file mode 100644 index 0000000000000..18b4e003b1889 --- /dev/null +++ b/recipes/ninja/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +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): + self.run("ninja --version") diff --git a/recipes/ninja/1.10.x/test_package/conanfile.py b/recipes/ninja/all/test_v1_package/conanfile.py similarity index 71% rename from recipes/ninja/1.10.x/test_package/conanfile.py rename to recipes/ninja/all/test_v1_package/conanfile.py index bf4c31199d341..f520548c1be19 100644 --- a/recipes/ninja/1.10.x/test_package/conanfile.py +++ b/recipes/ninja/all/test_v1_package/conanfile.py @@ -1,14 +1,12 @@ from conans import ConanFile -import os -class TestPackage(ConanFile): - settings = "os", "arch" - +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" test_type = "explicit" - + def build_requirements(self): self.build_requires(self.tested_reference_str) - + def test(self): self.run("ninja --version", run_environment=True) diff --git a/recipes/ninja/config.yml b/recipes/ninja/config.yml index c071c04eddc6a..bd5566773f233 100644 --- a/recipes/ninja/config.yml +++ b/recipes/ninja/config.yml @@ -1,7 +1,5 @@ versions: - "1.9.0": - folder: 1.9.x - "1.10.2": - folder: 1.10.x "1.11.0": - folder: 1.10.x + folder: all + "1.10.2": + folder: all From a5fe3476f64a463f233b7925ae12ba3df2301703 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 03:24:51 +0200 Subject: [PATCH 045/561] (#12921) fast-cdr: conan v2 support --- recipes/fast-cdr/all/CMakeLists.txt | 7 -- recipes/fast-cdr/all/conanfile.py | 83 ++++++++----------- .../fast-cdr/all/test_package/CMakeLists.txt | 11 +-- .../fast-cdr/all/test_package/conanfile.py | 19 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../fast-cdr/all/test_v1_package/conanfile.py | 17 ++++ 6 files changed, 81 insertions(+), 67 deletions(-) delete mode 100644 recipes/fast-cdr/all/CMakeLists.txt create mode 100644 recipes/fast-cdr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fast-cdr/all/test_v1_package/conanfile.py diff --git a/recipes/fast-cdr/all/CMakeLists.txt b/recipes/fast-cdr/all/CMakeLists.txt deleted file mode 100644 index d17aaff199b4a..0000000000000 --- a/recipes/fast-cdr/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/fast-cdr/all/conanfile.py b/recipes/fast-cdr/all/conanfile.py index 9d48556480b99..b334d42bb6789 100644 --- a/recipes/fast-cdr/all/conanfile.py +++ b/recipes/fast-cdr/all/conanfile.py @@ -1,10 +1,13 @@ -from conan.tools.microsoft import msvc_runtime_flag -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rm, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" class FastCDRConan(ConanFile): @@ -25,18 +28,6 @@ class FastCDRConan(ConanFile): "fPIC": True, } - generators = "cmake" - exports_sources = ["CMakeLists.txt"] - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -45,10 +36,13 @@ def configure(self): if self.options.shared: del self.options.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) - if self._is_msvc and self.options.shared and "MT" in msvc_runtime_flag(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.info.options.shared and is_msvc(self) and is_msvc_static_runtime(self): # This combination leads to an fast-cdr error when linking # linking dynamic '*.dll' and static MT runtime # see https://github.com/eProsima/Fast-CDR/blob/v1.0.21/include/fastcdr/eProsima_auto_link.h#L37 @@ -56,35 +50,29 @@ def validate(self): raise ConanInvalidConfiguration("Mixing a dll eprosima library with a static runtime is a bad idea") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, - destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_STATIC"] = not self.options.shared - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC"] = not self.options.shared + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask( - directory=os.path.join(self.package_folder, "lib"), - pattern="*.pdb" - ) - tools.remove_files_by_mask( - directory=os.path.join(self.package_folder, "bin"), - pattern="*.pdb" - ) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( @@ -92,26 +80,25 @@ def package(self): {"fastcdr": "fastcdr::fastcdr"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "fastcdr") self.cpp_info.set_property("cmake_target_name", "fastcdr") - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("FASTCDR_DYN_LINK") diff --git a/recipes/fast-cdr/all/test_package/CMakeLists.txt b/recipes/fast-cdr/all/test_package/CMakeLists.txt index 1a53780608ec4..2a71d2d409cc4 100644 --- a/recipes/fast-cdr/all/test_package/CMakeLists.txt +++ b/recipes/fast-cdr/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(fastcdr REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} fastcdr) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE fastcdr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast-cdr/all/test_package/conanfile.py b/recipes/fast-cdr/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/fast-cdr/all/test_package/conanfile.py +++ b/recipes/fast-cdr/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt b/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..16d0cd412b0f9 --- /dev/null +++ b/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fastcdr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fastcdr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast-cdr/all/test_v1_package/conanfile.py b/recipes/fast-cdr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fast-cdr/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 28e2dd3545d61866a4f770a21f2a067a184b0ea8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 03:44:17 +0200 Subject: [PATCH 046/561] (#12925) add parson/1.4.0 * add parson/1.4.0 * export symbols for msvc shared --- recipes/parson/all/conandata.yml | 4 ++ recipes/parson/all/conanfile.py | 69 +++++++++++++++++++ .../parson/all/test_package/CMakeLists.txt | 7 ++ recipes/parson/all/test_package/conanfile.py | 26 +++++++ .../parson/all/test_package/test_package.c | 19 +++++ .../parson/all/test_v1_package/CMakeLists.txt | 10 +++ .../parson/all/test_v1_package/conanfile.py | 18 +++++ recipes/parson/config.yml | 3 + 8 files changed, 156 insertions(+) create mode 100644 recipes/parson/all/conandata.yml create mode 100644 recipes/parson/all/conanfile.py create mode 100644 recipes/parson/all/test_package/CMakeLists.txt create mode 100644 recipes/parson/all/test_package/conanfile.py create mode 100644 recipes/parson/all/test_package/test_package.c create mode 100644 recipes/parson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/parson/all/test_v1_package/conanfile.py create mode 100644 recipes/parson/config.yml diff --git a/recipes/parson/all/conandata.yml b/recipes/parson/all/conandata.yml new file mode 100644 index 0000000000000..a375832975a4d --- /dev/null +++ b/recipes/parson/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.0": + url: "https://github.com/kgabis/parson/archive/a34e72528224fe2a97fa89d8115fedc870df6fd3.tar.gz" + sha256: "ab37b30396e621246d05bdaafb2ab178adb92f5c599f9723cf1c9fbec6a8f037" diff --git a/recipes/parson/all/conanfile.py b/recipes/parson/all/conanfile.py new file mode 100644 index 0000000000000..41b29d5db87fd --- /dev/null +++ b/recipes/parson/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.47.0" + + +class ParsonConan(ConanFile): + name = "parson" + description = "Lightweight JSON library written in C." + license = "MIT" + topics = ("json", "parser") + homepage = "https://github.com/kgabis/parson" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "parson") + self.cpp_info.set_property("cmake_target_name", "parson::parson") + self.cpp_info.libs = ["parson"] diff --git a/recipes/parson/all/test_package/CMakeLists.txt b/recipes/parson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b79634dc14200 --- /dev/null +++ b/recipes/parson/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(parson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE parson::parson) diff --git a/recipes/parson/all/test_package/conanfile.py b/recipes/parson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..094bd40f27d12 --- /dev/null +++ b/recipes/parson/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/parson/all/test_package/test_package.c b/recipes/parson/all/test_package/test_package.c new file mode 100644 index 0000000000000..3ed5534e94a9d --- /dev/null +++ b/recipes/parson/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include + +int main() { + JSON_Value *root_value = json_value_init_object(); + JSON_Object *root_object = json_value_get_object(root_value); + json_object_set_string(root_object, "name", "John Smith"); + json_object_set_number(root_object, "age", 25); + json_object_dotset_string(root_object, "address.city", "Cupertino"); + json_object_dotset_value(root_object, "contact.emails", json_parse_string("[\"email@example.com\",\"email2@example.com\"]")); + char *serialized_string = json_serialize_to_string_pretty(root_value); + printf("%s\n", serialized_string); + + json_free_serialized_string(serialized_string); + json_value_free(root_value); + + return 0; +} diff --git a/recipes/parson/all/test_v1_package/CMakeLists.txt b/recipes/parson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4d6be1d02e55 --- /dev/null +++ b/recipes/parson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(parson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE parson::parson) diff --git a/recipes/parson/all/test_v1_package/conanfile.py b/recipes/parson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..75c0cd81d2d2f --- /dev/null +++ b/recipes/parson/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +# pylint: skip-file +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/parson/config.yml b/recipes/parson/config.yml new file mode 100644 index 0000000000000..c957e4bc2d3c7 --- /dev/null +++ b/recipes/parson/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all From 5c7f7a957468a6ad61feacf4514906b7c0aa13c3 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 04:04:24 +0200 Subject: [PATCH 047/561] (#12926) aws-c-compression: conan v2 support --- recipes/aws-c-compression/all/CMakeLists.txt | 7 --- recipes/aws-c-compression/all/conanfile.py | 53 ++++++++++--------- .../all/test_package/CMakeLists.txt | 5 +- .../all/test_package/conanfile.py | 19 +++++-- .../all/test_v1_package/CMakeLists.txt | 10 ++++ .../all/test_v1_package/conanfile.py | 17 ++++++ 6 files changed, 70 insertions(+), 41 deletions(-) delete mode 100644 recipes/aws-c-compression/all/CMakeLists.txt create mode 100644 recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-compression/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-compression/all/CMakeLists.txt b/recipes/aws-c-compression/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-c-compression/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-compression/all/conanfile.py b/recipes/aws-c-compression/all/conanfile.py index ad431bea82df0..5ab1922831568 100644 --- a/recipes/aws-c-compression/all/conanfile.py +++ b/recipes/aws-c-compression/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.47.0" class AwsCCompression(ConanFile): @@ -22,14 +24,6 @@ class AwsCCompression(ConanFile): "fPIC": True, } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -37,33 +31,42 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("aws-c-common/0.6.19") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - 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", "aws-c-compression")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-compression")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-compression") diff --git a/recipes/aws-c-compression/all/test_package/CMakeLists.txt b/recipes/aws-c-compression/all/test_package/CMakeLists.txt index 915167add7ecd..8efb2e9b0efa5 100644 --- a/recipes/aws-c-compression/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-compression/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-compression REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-compression) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-compression) diff --git a/recipes/aws-c-compression/all/test_package/conanfile.py b/recipes/aws-c-compression/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/aws-c-compression/all/test_package/conanfile.py +++ b/recipes/aws-c-compression/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e3ad5964d2a88 --- /dev/null +++ b/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-compression REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-compression) diff --git a/recipes/aws-c-compression/all/test_v1_package/conanfile.py b/recipes/aws-c-compression/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aws-c-compression/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From aed3a542873b247ceb9b7aa45d1b8251ced2a81a Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 04:25:06 +0200 Subject: [PATCH 048/561] (#12927) aws-checksums: conan v2 support --- recipes/aws-checksums/all/CMakeLists.txt | 7 --- recipes/aws-checksums/all/conandata.yml | 9 +-- recipes/aws-checksums/all/conanfile.py | 61 ++++++++++--------- ...make => 0001-use-PROJECT_SOURCE_DIR.patch} | 0 .../all/test_package/CMakeLists.txt | 5 +- .../all/test_package/conanfile.py | 19 ++++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../all/test_v1_package/conanfile.py | 17 ++++++ 8 files changed, 76 insertions(+), 52 deletions(-) delete mode 100644 recipes/aws-checksums/all/CMakeLists.txt rename recipes/aws-checksums/all/patches/{0001-use-PROJECT_SOURCE_DIR.cmake => 0001-use-PROJECT_SOURCE_DIR.patch} (100%) create mode 100644 recipes/aws-checksums/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-checksums/all/test_v1_package/conanfile.py diff --git a/recipes/aws-checksums/all/CMakeLists.txt b/recipes/aws-checksums/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-checksums/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-checksums/all/conandata.yml b/recipes/aws-checksums/all/conandata.yml index 88de28be65063..9b15346931da6 100644 --- a/recipes/aws-checksums/all/conandata.yml +++ b/recipes/aws-checksums/all/conandata.yml @@ -10,9 +10,6 @@ sources: sha256: "6e6bed6f75cf54006b6bafb01b3b96df19605572131a2260fddaf0e87949ced0" patches: "0.1.5": - - base_path: "source_subfolder" - patch_file: "patches/0001-use-PROJECT_SOURCE_DIR.cmake" - - base_path: "source_subfolder" - patch_file: "patches/0002-disable-overriding-fPIC.patch" - - base_path: "source_subfolder" - patch_file: "patches/0003-disable-building-tests.patch" + - patch_file: "patches/0001-use-PROJECT_SOURCE_DIR.patch" + - patch_file: "patches/0002-disable-overriding-fPIC.patch" + - patch_file: "patches/0003-disable-building-tests.patch" diff --git a/recipes/aws-checksums/all/conanfile.py b/recipes/aws-checksums/all/conanfile.py index 0cc74755103d4..2c30304453327 100644 --- a/recipes/aws-checksums/all/conanfile.py +++ b/recipes/aws-checksums/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.47.0" class AwsChecksums(ConanFile): @@ -25,17 +27,9 @@ class AwsChecksums(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -44,36 +38,43 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("aws-c-common/0.6.19") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - 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", "aws-checksums")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-checksums")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-checksums") diff --git a/recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.cmake b/recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch similarity index 100% rename from recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.cmake rename to recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch diff --git a/recipes/aws-checksums/all/test_package/CMakeLists.txt b/recipes/aws-checksums/all/test_package/CMakeLists.txt index 5032e04785efc..9922744f24e3f 100644 --- a/recipes/aws-checksums/all/test_package/CMakeLists.txt +++ b/recipes/aws-checksums/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-checksums REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-checksums) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-checksums) diff --git a/recipes/aws-checksums/all/test_package/conanfile.py b/recipes/aws-checksums/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/aws-checksums/all/test_package/conanfile.py +++ b/recipes/aws-checksums/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt b/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..915af9f83a60f --- /dev/null +++ b/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-checksums REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-checksums) diff --git a/recipes/aws-checksums/all/test_v1_package/conanfile.py b/recipes/aws-checksums/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/aws-checksums/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 28bac59ddbd91750bb19946fe7a3d2723d2dfb13 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 04:44:47 +0200 Subject: [PATCH 049/561] (#12932) aws-c-cal: add 0.5.19 + conan v2 support + improve build on Apple * conan v2 support * link to CoreFoundation on Apple * add aws-c-cal/0.5.19 --- recipes/aws-c-cal/all/CMakeLists.txt | 7 -- recipes/aws-c-cal/all/conandata.yml | 32 +++++++- recipes/aws-c-cal/all/conanfile.py | 79 ++++++++++--------- ...1-use-openssl-cmake-imported-target.patch} | 0 .../0002-apple-corefoundation-0.5.11.patch | 26 ++++++ .../0002-apple-corefoundation-0.5.13.patch | 26 ++++++ .../aws-c-cal/all/test_package/CMakeLists.txt | 5 +- .../aws-c-cal/all/test_package/conanfile.py | 22 ++++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../all/test_v1_package/conanfile.py | 22 ++++++ recipes/aws-c-cal/config.yml | 2 + 11 files changed, 172 insertions(+), 59 deletions(-) delete mode 100644 recipes/aws-c-cal/all/CMakeLists.txt rename recipes/aws-c-cal/all/patches/{0001-use-openssl-cmake-imported-target.cmake => 0001-use-openssl-cmake-imported-target.patch} (100%) create mode 100644 recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.11.patch create mode 100644 recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch create mode 100644 recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-cal/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-cal/all/CMakeLists.txt b/recipes/aws-c-cal/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-c-cal/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-cal/all/conandata.yml b/recipes/aws-c-cal/all/conandata.yml index 32f0c310bc263..d3b93a72f80e4 100644 --- a/recipes/aws-c-cal/all/conandata.yml +++ b/recipes/aws-c-cal/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.19": + url: "https://github.com/awslabs/aws-c-cal/archive/refs/tags/v0.5.19.tar.gz" + sha256: "23452ab7960c480f1ec0a96ac55bde32d7d27c4a664baeadc248923b19c12086" "0.5.17": url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.17.tar.gz" sha256: "40297da04443d4ee2988d1c5fb0dc4a156d0e4cfaf80e6a1df1867452566d540" @@ -12,9 +15,30 @@ sources: url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.11.tar.gz" sha256: "ef46e121b2231a0b19afce8af4b32d77501df4d470e926990918456636cd83c0" patches: + "0.5.19": + - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" + "0.5.17": + - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" + "0.5.13": + - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" "0.5.12": - - patch_file: "patches/0001-use-openssl-cmake-imported-target.cmake" - base_path: "source_subfolder" + - patch_file: "patches/0001-use-openssl-cmake-imported-target.patch" + - patch_file: "patches/0002-apple-corefoundation-0.5.11.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" "0.5.11": - - patch_file: "patches/0001-use-openssl-cmake-imported-target.cmake" - base_path: "source_subfolder" + - patch_file: "patches/0001-use-openssl-cmake-imported-target.patch" + - patch_file: "patches/0002-apple-corefoundation-0.5.11.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" diff --git a/recipes/aws-c-cal/all/conanfile.py b/recipes/aws-c-cal/all/conanfile.py index 363b562fb03ab..b05f10499feff 100644 --- a/recipes/aws-c-cal/all/conanfile.py +++ b/recipes/aws-c-cal/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.3" class AwsCCal(ConanFile): @@ -21,22 +25,13 @@ class AwsCCal(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _needs_openssl(self): - return self.settings.os != "Windows" and not tools.is_apple_os(self.settings.os) + return self.settings.os != "Windows" and not is_apple_os(self) def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -45,11 +40,20 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - if tools.Version(self.version) <= "0.5.11": + if Version(self.version) <= "0.5.11": self.requires("aws-c-common/0.6.11") else: self.requires("aws-c-common/0.7.4") @@ -57,29 +61,28 @@ def requirements(self): self.requires("openssl/1.1.1q") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["USE_OPENSSL"] = self._needs_openssl - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["USE_OPENSSL"] = self._needs_openssl + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - 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", "aws-c-cal")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-cal")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-cal") @@ -97,22 +100,22 @@ def package_info(self): self.cpp_info.components["aws-c-cal-lib"].requires = ["aws-c-common::aws-c-common-lib"] if self.settings.os == "Windows": self.cpp_info.components["aws-c-cal-lib"].system_libs.append("ncrypt") - elif tools.is_apple_os(self.settings.os): - self.cpp_info.components["aws-c-cal-lib"].frameworks.append("Security") + elif is_apple_os(self): + self.cpp_info.components["aws-c-cal-lib"].frameworks.extend(["CoreFoundation", "Security"]) elif self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.components["aws-c-cal-lib"].system_libs.append("dl") self.user_info.with_openssl = self._needs_openssl if self._needs_openssl: self.cpp_info.components["aws-c-cal-lib"].requires.append("openssl::crypto") - if not self.options["openssl"].shared: + if not self.dependencies["openssl"].options.shared: # aws-c-cal does not statically link to openssl and searches dynamically for openssl symbols . # Mark these as undefined so the linker will include them. # This avoids dynamical look-up for a system crypto library. crypto_symbols = [ "HMAC_Update", "HMAC_Final", "HMAC_Init_ex", ] - if tools.Version(self.deps_cpp_info["openssl"].version) >= "1.1": + if Version(self.dependencies["openssl"].ref.version) >= "1.1": crypto_symbols.extend([ "HMAC_CTX_new", "HMAC_CTX_free", "HMAC_CTX_reset", ]) diff --git a/recipes/aws-c-cal/all/patches/0001-use-openssl-cmake-imported-target.cmake b/recipes/aws-c-cal/all/patches/0001-use-openssl-cmake-imported-target.patch similarity index 100% rename from recipes/aws-c-cal/all/patches/0001-use-openssl-cmake-imported-target.cmake rename to recipes/aws-c-cal/all/patches/0001-use-openssl-cmake-imported-target.patch diff --git a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.11.patch b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.11.patch new file mode 100644 index 0000000000000..3de09bddfa119 --- /dev/null +++ b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.11.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,12 @@ elseif (APPLE) + message(FATAL_ERROR "Security Framework not found") + endif () + +- list(APPEND PLATFORM_LIBS "-framework Security") ++ find_library(COREFOUNDATION_LIB CoreFoundation) ++ if(NOT COREFOUNDATION_LIB) ++ message(FATAL_ERROR "CoreFoundation Framework not found") ++ endif() ++ ++ list(APPEND PLATFORM_LIBS "-framework Security -framework CoreFoundation") + endif() + else () + if (NOT BYO_CRYPTO) +--- a/source/darwin/securityframework_ecc.c ++++ b/source/darwin/securityframework_ecc.c +@@ -7,6 +7,7 @@ + #include + #include + ++#include + #include + #include + diff --git a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch new file mode 100644 index 0000000000000..422624b80de7e --- /dev/null +++ b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -78,7 +78,12 @@ elseif (APPLE) + message(FATAL_ERROR "Security Framework not found") + endif () + +- list(APPEND PLATFORM_LIBS "-framework Security") ++ find_library(COREFOUNDATION_LIB CoreFoundation) ++ if(NOT COREFOUNDATION_LIB) ++ message(FATAL_ERROR "CoreFoundation Framework not found") ++ endif() ++ ++ list(APPEND PLATFORM_LIBS "-framework Security -framework CoreFoundation") + endif() + else () + if (NOT BYO_CRYPTO) +--- a/source/darwin/securityframework_ecc.c ++++ b/source/darwin/securityframework_ecc.c +@@ -7,6 +7,7 @@ + #include + #include + ++#include + #include + #include + diff --git a/recipes/aws-c-cal/all/test_package/CMakeLists.txt b/recipes/aws-c-cal/all/test_package/CMakeLists.txt index 975ded3bef12d..7ed07f4d9b8e6 100644 --- a/recipes/aws-c-cal/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-cal/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-cal REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-cal) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal) diff --git a/recipes/aws-c-cal/all/test_package/conanfile.py b/recipes/aws-c-cal/all/test_package/conanfile.py index 2862c460d7754..1b3c18ef08ac1 100644 --- a/recipes/aws-c-cal/all/test_package/conanfile.py +++ b/recipes/aws-c-cal/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os import io + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,10 +22,10 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): stream = io.StringIO() - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True, output=stream) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun", output=stream) self.output.info(stream.getvalue()) if self.deps_user_info["aws-c-cal"].with_openssl == "True": assert "found static libcrypto" in stream.getvalue() diff --git a/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8a88842ed46e6 --- /dev/null +++ b/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-cal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-cal) diff --git a/recipes/aws-c-cal/all/test_v1_package/conanfile.py b/recipes/aws-c-cal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ff0f4e1acbd6f --- /dev/null +++ b/recipes/aws-c-cal/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conans import ConanFile, CMake, tools +import os +import io + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + stream = io.StringIO() + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True, output=stream) + self.output.info(stream.getvalue()) + if self.deps_user_info["aws-c-cal"].with_openssl == "True": + assert "found static libcrypto" in stream.getvalue() diff --git a/recipes/aws-c-cal/config.yml b/recipes/aws-c-cal/config.yml index e742c8041e410..1e3606a0136b8 100644 --- a/recipes/aws-c-cal/config.yml +++ b/recipes/aws-c-cal/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.19": + folder: all "0.5.17": folder: all "0.5.13": From 8063e3018031ffe9dd76e6faaca9d9b797544111 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 14 Sep 2022 21:24:26 -0600 Subject: [PATCH 050/561] (#12934) docs: 2.0 migration guidance for subfolders https://github.com/conan-io/conan-center-index/pull/12878#issuecomment-1243569956 --- docs/reviewing.md | 7 +++++-- docs/v2_migration.md | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/reviewing.md b/docs/reviewing.md index f42f88d67438b..61fe6a887d43c 100644 --- a/docs/reviewing.md +++ b/docs/reviewing.md @@ -36,6 +36,9 @@ If possible, try to avoid mixing single quotes (`'`) and double quotes (`"`) in When extracting sources or performing out-of-source builds, it is preferable to use a _subfolder_ attribute, `_source_subfolder` and `_build_subfolder` respectively. +> **Note**: These are only required when using the legacy generator such as `cmake`. For the new generators like `CMakeToolchain` see +> the [2.0 Migration Guide](v2_migration.md#using-layout-with-new-generators) for more information. + For example doing this with property attributes for these variables: ```py @@ -209,9 +212,9 @@ having the same naming conventions for the options may help consumers, e.g. they ## Supported Versions In this repository we are building a subset of all the versions for a given library. This set of version changes over time as new versions -are released and old ones stop to be used. +are released and old ones stop to be used. -We always welcome latest releases as soon as they are available, and from time to time we remove old versions mainly due to technical reasons: +We always welcome latest releases as soon as they are available, and from time to time we remove old versions mainly due to technical reasons: the more versions we have, the more resources that are needed in the CI and the more time it takes to build each pull-request (also, the more chances of failing because of unexpected errors). diff --git a/docs/v2_migration.md b/docs/v2_migration.md index c38d114a5ccc5..e038ab998db35 100644 --- a/docs/v2_migration.md +++ b/docs/v2_migration.md @@ -26,6 +26,11 @@ changes and improvements, you can read about them in the This document is a practical guide, offering extended information particular to Conan Center Index recipes to get them ready to upgrade to Conan 2.0. +## Using Layout with New Generators + +All recipes should use a layout, when doing this there is no need to manually define `self._subfolder_[...]` in a recipe. +Simply use `self.source_folder` and `self.build_folder` instead of [subfolder properties](reviewing.md#subfolder-properties) + ## New cpp_info set_property model New Conan generators like From dc40846d2db2907df61e57e5e765583fda6989d2 Mon Sep 17 00:00:00 2001 From: Kim Lindberger Date: Thu, 15 Sep 2022 05:44:17 +0200 Subject: [PATCH 051/561] (#12936) [xnnpack] Add cci.20220801 --- recipes/xnnpack/all/conandata.yml | 3 +++ recipes/xnnpack/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/xnnpack/all/conandata.yml b/recipes/xnnpack/all/conandata.yml index 1e939090cd27a..b8350dbe92b09 100644 --- a/recipes/xnnpack/all/conandata.yml +++ b/recipes/xnnpack/all/conandata.yml @@ -11,3 +11,6 @@ sources: "cci.20220621": url: "https://github.com/google/XNNPACK/archive/b725ca1a40b53d8087d1be0c53cb49fa05e2f1bc.tar.gz" sha256: "a745c629dea5fc76e5a545e412a408fde1a523b71027f07d1b0670ec9ae54819" + "cci.20220801": + url: "https://github.com/google/XNNPACK/archive/8e3d3359f9bec608e09fac1f7054a2a14b1bd73c.tar.gz" + sha256: "c82327543249bd333034bbaa0300ed1fc9c7060fa73673a285042e3f042540e0" diff --git a/recipes/xnnpack/config.yml b/recipes/xnnpack/config.yml index 55f77649339db..99df439925ce4 100644 --- a/recipes/xnnpack/config.yml +++ b/recipes/xnnpack/config.yml @@ -7,3 +7,5 @@ versions: folder: all "cci.20220621": folder: all + "cci.20220801": + folder: all From aca86802352daf352d21366b8a47e5bb6632fbec Mon Sep 17 00:00:00 2001 From: Kim Lindberger Date: Thu, 15 Sep 2022 06:04:41 +0200 Subject: [PATCH 052/561] (#12937) [flatbuffers] Add 2.0.6 * [flatbuffers] Add 2.0.6 * [flatbuffers] Add missing patch --- recipes/flatbuffers/all/conandata.yml | 5 +++++ .../0004-no-flatc-execution-build-time.patch | 20 +++++++++++++++++++ recipes/flatbuffers/config.yml | 2 ++ 3 files changed, 27 insertions(+) create mode 100644 recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch diff --git a/recipes/flatbuffers/all/conandata.yml b/recipes/flatbuffers/all/conandata.yml index 2146bbb3a8a77..1208a783b9e4f 100644 --- a/recipes/flatbuffers/all/conandata.yml +++ b/recipes/flatbuffers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.6": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.6.tar.gz" + sha256: "e2dc24985a85b278dd06313481a9ca051d048f9474e0f199e372fea3ea4248c9" "2.0.5": url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.5.tar.gz" sha256: "b01e97c988c429e164c5c7df9e87c80007ca87f593c0d73733ba536ddcbc8f98" @@ -12,6 +15,8 @@ sources: url: "https://github.com/google/flatbuffers/archive/v1.11.0.tar.gz" sha256: "3f4a286642094f45b1b77228656fbd7ea123964f19502f9ecfd29933fd23a50b" patches: + "2.0.6": + - patch_file: "patches/0004-no-flatc-execution-build-time.patch" "2.0.5": - patch_file: "patches/0002-apple-no-universal-build.patch" - patch_file: "patches/0003-no-flatc-execution-build-time.patch" diff --git a/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch b/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch new file mode 100644 index 0000000000000..11da02ea5d8c9 --- /dev/null +++ b/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 21e90151..2ce3eb48 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -536,6 +536,7 @@ function(compile_flatbuffers_schema_to_embedded_binary SRC_FBS OPT) + register_generated_output(${GEN_BFBS_HEADER}) + endfunction() + ++if(0) + # Look if we have python 3.5 installed so that we can run the generate code + # python script after flatc is built. + find_package(Python3 3.5 COMPONENTS Interpreter) +@@ -559,6 +560,7 @@ if(Python3_Interpreter_FOUND) + else() + message("No Python3 interpreter found! Unable to generate files automatically.") + endif() ++endif() + + if(FLATBUFFERS_BUILD_TESTS) + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/recipes/flatbuffers/config.yml b/recipes/flatbuffers/config.yml index e341a05045ae4..d58a0e5127c56 100644 --- a/recipes/flatbuffers/config.yml +++ b/recipes/flatbuffers/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.6": + folder: all "2.0.5": folder: all "2.0.0": From 6cf1f9529732b87450ff87d432fbd74c4dfb1897 Mon Sep 17 00:00:00 2001 From: chausner <15180557+chausner@users.noreply.github.com> Date: Thu, 15 Sep 2022 06:44:32 +0200 Subject: [PATCH 053/561] (#12940) cpp-httplib: add version 0.11.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/cpp-httplib/all/conandata.yml | 3 +++ recipes/cpp-httplib/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index 2a7b5fcfca17d..fcbbd3e73f357 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.11.2": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.2.tar.gz" + sha256: "e620d030215733c4831fdc7813d5eb37a6fd599f8192a730662662e1748a741b" "0.11.1": url: "https://github.com/yhirose/cpp-httplib/archive/v0.11.1.tar.gz" sha256: "1ce2f0393ba779ec34885c5cd937141b4b5b730e2bc2efc34eb8554289c24d61" diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index 80b45ad7c194c..172b02076c77b 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,4 +1,6 @@ versions: + "0.11.2": + folder: all "0.11.1": folder: all "0.11.0": From 03ee32116e0d1efcb6275b23eac130ffabbc57cf Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 15 Sep 2022 07:04:34 +0200 Subject: [PATCH 054/561] (#12945) [docs] Hotfix replace wrong cmake method in docs Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- .../autotools_package/all/test_v1_package/CMakeLists.txt | 2 +- .../header_only/all/test_v1_package/CMakeLists.txt | 2 +- .../msbuild_package/all/test_v1_package/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt b/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt index 6298d7b9a123c..4af742edc09e7 100644 --- a/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt +++ b/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt @@ -13,4 +13,4 @@ add_executable(${PROJECT_NAME} ../test_package/test_package.c) # don't link to ${CONAN_LIBS} or CONAN_PKG::package target_link_libraries(${PROJECT_NAME} PRIVATE package::package) # in case the target project requires a C++ standard -# set_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +# target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt b/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt index 40b3d97d7ddb2..5e77e4ac4b188 100644 --- a/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt +++ b/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt @@ -13,4 +13,4 @@ add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) # don't link to ${CONAN_LIBS} or CONAN_PKG::package target_link_libraries(${PROJECT_NAME} PRIVATE package::package) # in case the target project requires a C++ standard -set_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/docs/package_templates/msbuild_package/all/test_v1_package/CMakeLists.txt b/docs/package_templates/msbuild_package/all/test_v1_package/CMakeLists.txt index 6b0a261eddbcc..ffce03aa1cbcf 100644 --- a/docs/package_templates/msbuild_package/all/test_v1_package/CMakeLists.txt +++ b/docs/package_templates/msbuild_package/all/test_v1_package/CMakeLists.txt @@ -13,4 +13,4 @@ add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) # don't link to ${CONAN_LIBS} or CONAN_PKG::package target_link_libraries(${PROJECT_NAME} PRIVATE package::package) # in case the target project requires a C++ standard -set_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) From 8081251a4410e49d92b6c6ba6805b0f523b08c4c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 10:04:43 +0200 Subject: [PATCH 055/561] (#12920) wslay: conan v2 support --- recipes/wslay/all/CMakeLists.txt | 7 -- recipes/wslay/all/conandata.yml | 2 - recipes/wslay/all/conanfile.py | 75 ++++++++++--------- .../wslay/all/patches/0001-msvc-support.patch | 2 +- recipes/wslay/all/test_package/CMakeLists.txt | 9 +-- recipes/wslay/all/test_package/conanfile.py | 19 +++-- .../wslay/all/test_v1_package/CMakeLists.txt | 14 ++++ .../wslay/all/test_v1_package/conanfile.py | 17 +++++ 8 files changed, 87 insertions(+), 58 deletions(-) delete mode 100644 recipes/wslay/all/CMakeLists.txt create mode 100644 recipes/wslay/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wslay/all/test_v1_package/conanfile.py diff --git a/recipes/wslay/all/CMakeLists.txt b/recipes/wslay/all/CMakeLists.txt deleted file mode 100644 index 97030501e5bd7..0000000000000 --- a/recipes/wslay/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/wslay/all/conandata.yml b/recipes/wslay/all/conandata.yml index facd0e25d7b16..5a894437f1a9e 100644 --- a/recipes/wslay/all/conandata.yml +++ b/recipes/wslay/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "1.1.1": - patch_file: "patches/0001-msvc-support.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-cmake-install-shared-artifacts.patch" - base_path: "source_subfolder" diff --git a/recipes/wslay/all/conanfile.py b/recipes/wslay/all/conanfile.py index 47817938f37d1..0891ca89ea5c3 100644 --- a/recipes/wslay/all/conanfile.py +++ b/recipes/wslay/all/conanfile.py @@ -1,8 +1,10 @@ -from conans import ConanFile, tools, CMake +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rmdir, save import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class WslayConan(ConanFile): @@ -23,17 +25,9 @@ class WslayConan(ConanFile): "fPIC": True, } - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -42,33 +36,41 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["WSLAY_STATIC"] = not self.options.shared - self._cmake.definitions["WSLAY_SHARED"] = self.options.shared - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WSLAY_STATIC"] = not self.options.shared + tc.variables["WSLAY_SHARED"] = self.options.shared + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("COPYING", src=os.path.join(self.source_folder, self._source_subfolder), dst="licenses") - cmake = self._configure_cmake() + copy(self, "COPYING", 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")) # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self._create_cmake_module_alias_targets( @@ -76,21 +78,20 @@ def package(self): {self._wslay_lib_target: "wslay::wslay"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property def _wslay_lib_target(self): diff --git a/recipes/wslay/all/patches/0001-msvc-support.patch b/recipes/wslay/all/patches/0001-msvc-support.patch index ddc83979cf721..a689fc2452be1 100644 --- a/recipes/wslay/all/patches/0001-msvc-support.patch +++ b/recipes/wslay/all/patches/0001-msvc-support.patch @@ -35,7 +35,7 @@ index 4af972e..96b5392 100644 -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -pedantic-errors -Wno-long-long") +if(NOT MSVC) -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -pedantic-errors -Wno-long-long") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-long-long") +endif() include(CheckIncludeFile) diff --git a/recipes/wslay/all/test_package/CMakeLists.txt b/recipes/wslay/all/test_package/CMakeLists.txt index ec02a305e3b07..2f2c295f8ed13 100644 --- a/recipes/wslay/all/test_package/CMakeLists.txt +++ b/recipes/wslay/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(wslay REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) if(TARGET wslay_shared) - target_link_libraries(${PROJECT_NAME} wslay_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE wslay_shared) else() - target_link_libraries(${PROJECT_NAME} wslay) + target_link_libraries(${PROJECT_NAME} PRIVATE wslay) endif() diff --git a/recipes/wslay/all/test_package/conanfile.py b/recipes/wslay/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/wslay/all/test_package/conanfile.py +++ b/recipes/wslay/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wslay/all/test_v1_package/CMakeLists.txt b/recipes/wslay/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b27e89de2a1f8 --- /dev/null +++ b/recipes/wslay/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(wslay REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(TARGET wslay_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE wslay_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE wslay) +endif() diff --git a/recipes/wslay/all/test_v1_package/conanfile.py b/recipes/wslay/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/wslay/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From aa1920777e5a85c2545bb43222de7ace76dd0ce5 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Thu, 15 Sep 2022 10:25:10 +0200 Subject: [PATCH 056/561] (#12910) bump dependencies of vulkan-validationlayers; partial conan v2 upgrade * bump wayland; partial conan v2 upgrade * use rm instead of tools.remove_files_by_mask * don't use tools directly * hotfix about providing self to mkdir * resolve naming clash * use self in patch method * update +required_conan_version --- .../vulkan-validationlayers/all/conanfile.py | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/recipes/vulkan-validationlayers/all/conanfile.py b/recipes/vulkan-validationlayers/all/conanfile.py index 6abb4ae5f0675..20e4ba3a25e94 100644 --- a/recipes/vulkan-validationlayers/all/conanfile.py +++ b/recipes/vulkan-validationlayers/all/conanfile.py @@ -1,12 +1,16 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException, ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, replace_in_file, rename, patch, rm, mkdir +from conan.tools.scm import Version +from conans import CMake import functools import glob import os import shutil import yaml -required_conan_version = ">=1.35.0" +required_conan_version = ">=1.50.0" class VulkanValidationLayersConan(ConanFile): @@ -78,13 +82,13 @@ def requirements(self): # TODO: set private=True, once the issue is resolved https://github.com/conan-io/conan/issues/9390 self.requires(self._require("spirv-tools"), private=not hasattr(self, "settings_build")) self.requires(self._require("vulkan-headers")) - # TODO: use tools.Version comparison once https://github.com/conan-io/conan/issues/10000 is fixed + # TODO: use Version comparison once https://github.com/conan-io/conan/issues/10000 is fixed if self._greater_equal_semver(self.version, "1.2.173"): self.requires("robin-hood-hashing/3.11.5") if self.options.get_safe("with_wsi_xcb") or self.options.get_safe("with_wsi_xlib"): self.requires("xorg/system") if self.options.get_safe("with_wsi_wayland"): - self.requires("wayland/1.20.0") + self.requires("wayland/1.21.0") def _require(self, recipe_name): if recipe_name not in self._dependencies_versions: @@ -93,16 +97,16 @@ def _require(self, recipe_name): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) if self.options["spirv-tools"].shared: raise ConanInvalidConfiguration("vulkan-validationlayers can't depend on shared spirv-tools") - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("gcc < 5 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], destination=self._source_subfolder, strip_root=True) def build(self): self._patch_sources() @@ -110,9 +114,9 @@ def build(self): cmake.build() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "FindVulkanHeaders.cmake"), + for data in self.conan_data.get("patches", {}).get(self.version, []): + patch(self, **data) + replace_in_file(self, os.path.join(self._source_subfolder, "cmake", "FindVulkanHeaders.cmake"), "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry", "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry") # FIXME: two CMake module/config files should be generated (SPIRV-ToolsConfig.cmake and SPIRV-Tools-optConfig.cmake), @@ -144,18 +148,18 @@ def package(self): if self.settings.os == "Windows": # import lib is useless, validation layers are loaded at runtime lib_dir = os.path.join(self.package_folder, "lib") - tools.remove_files_by_mask(lib_dir, "VkLayer_khronos_validation.lib") - tools.remove_files_by_mask(lib_dir, "libVkLayer_khronos_validation.dll.a") + rm(self, lib_dir, "VkLayer_khronos_validation.lib") + rm(self, lib_dir, "libVkLayer_khronos_validation.dll.a") # move dll and json manifest files in bin folder bin_dir = os.path.join(self.package_folder, "bin") - tools.mkdir(bin_dir) + mkdir(self, bin_dir) for ext in ("*.dll", "*.json"): for bin_file in glob.glob(os.path.join(lib_dir, ext)): shutil.move(bin_file, os.path.join(bin_dir, os.path.basename(bin_file))) else: # Move json files to res, but keep in mind to preserve relative # path between module library and manifest json file - tools.rename(os.path.join(self.package_folder, "share"), os.path.join(self.package_folder, "res")) + rename(self, os.path.join(self.package_folder, "share"), os.path.join(self.package_folder, "res")) def package_info(self): self.cpp_info.libs = ["VkLayer_utils"] From 8a0249907ede36fb72ecd6fa3da1a4082149ee7a Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Thu, 15 Sep 2022 05:43:58 -0300 Subject: [PATCH 057/561] (#12725) update drogon to 1.8.0 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * Update recipes/sdl/all/CMakeLists.txt Co-authored-by: Anonymous Maarten * Update recipes/sdl/all/CMakeLists.txt Co-authored-by: Anonymous Maarten * Update recipes/sdl/all/conanfile.py Co-authored-by: Anonymous Maarten * Update recipes/sdl/all/conanfile.py Co-authored-by: Anonymous Maarten * Update recipes/sdl/all/conandata.yml Co-authored-by: Anonymous Maarten * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * sdl2 version 2.0.22 * update sdl to 2.24.0 * sdl2 version 2.24.0 * Update recipes/sdl/all/conanfile.py Co-authored-by: Anonymous Maarten * Update recipes/sdl/all/conanfile.py Co-authored-by: Anonymous Maarten * update recipes/sdl/all/conanfile.py Co-authored-by: Anonymous Maarten * sdl2 version 2.24.0 * sdl2 version 2.24.0 * update drogon to 1.8.0 * update drogon to 1.8.0 * update drogon to 1.8.0 * update drogon to 1.8.0 * update drogon to 1.8.0 * sdl2 version 2.24.0 * update drogon to 1.8.0 * update drogon to 1.8.0 * Prepare for Conan 2.0 Signed-off-by: Uilian Ries * Fix jsoncpp find cmake Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries Co-authored-by: Anonymous Maarten Co-authored-by: Uilian Ries --- recipes/drogon/all/CMakeLists.txt | 7 -- recipes/drogon/all/conandata.yml | 28 ++++-- recipes/drogon/all/conanfile.py | 90 ++++++++++--------- .../1.7.5-0004-find-package-jsoncpp.patch | 17 ++++ .../1.8.0-0001-disable-unused-data.patch | 41 +++++++++ .../1.8.0-0002-find-package-jsoncpp.patch | 17 ++++ .../drogon/all/test_package/CMakeLists.txt | 3 - recipes/drogon/all/test_package/conanfile.py | 18 +++- .../drogon/all/test_v1_package/CMakeLists.txt | 18 ++++ .../drogon/all/test_v1_package/conanfile.py | 16 ++++ recipes/drogon/config.yml | 2 + 11 files changed, 193 insertions(+), 64 deletions(-) delete mode 100644 recipes/drogon/all/CMakeLists.txt create mode 100644 recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch create mode 100644 recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch create mode 100644 recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch create mode 100644 recipes/drogon/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/drogon/all/test_v1_package/conanfile.py diff --git a/recipes/drogon/all/CMakeLists.txt b/recipes/drogon/all/CMakeLists.txt deleted file mode 100644 index 1480db2f856ab..0000000000000 --- a/recipes/drogon/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(conan_wrapper CXX) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/drogon/all/conandata.yml b/recipes/drogon/all/conandata.yml index 1e5a3f8b0fae0..08abde0a27bf2 100644 --- a/recipes/drogon/all/conandata.yml +++ b/recipes/drogon/all/conandata.yml @@ -1,12 +1,28 @@ sources: + "1.8.0": + url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.8.0.tar.gz" + sha256: "bc6503cf213ed961d4a5e9fd7cb8e75b6b11045a67840ea2241e57321dd8711b" "1.7.5": url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.7.5.tar.gz" sha256: "e2af7c55dcabafef16f26f5b3242692f5a2b54c19b7b626840bf9132d24766f6" patches: + "1.8.0": + - patch_file: "patches/1.8.0-0001-disable-unused-data.patch" + patch_description: "Consume Trantor package from Conan instead of using the subproject" + patch_type: "conan" + - patch_file: "patches/1.8.0-0002-find-package-jsoncpp.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" "1.7.5": - - base_path: "source_subfolder" - patch_file: "patches/1.7.5-0001-disable_trantor.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.7.5-0002-remove-boost-components.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.7.5-0003-find-package-trantor.patch" + - patch_file: "patches/1.7.5-0001-disable_trantor.patch" + patch_description: "Consume Trantor package from Conan instead of using the subproject" + patch_type: "conan" + - patch_file: "patches/1.7.5-0002-remove-boost-components.patch" + patch_description: "Do not consume specific Boost components" + patch_type: "conan" + - patch_file: "patches/1.7.5-0003-find-package-trantor.patch" + patch_description: "Fix Trantor cmake target name" + patch_type: "conan" + - patch_file: "patches/1.7.5-0004-find-package-jsoncpp.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" diff --git a/recipes/drogon/all/conanfile.py b/recipes/drogon/all/conanfile.py index a74f416e70f3e..ec721394a93fb 100644 --- a/recipes/drogon/all/conanfile.py +++ b/recipes/drogon/all/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMakeToolchain, CMakeDeps, CMake +from conan.tools.files import copy, get, apply_conandata_patches, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os -import functools -required_conan_version = ">=1.43.0" + +required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" class DrogonConan(ConanFile): name = "drogon" @@ -13,7 +17,6 @@ class DrogonConan(ConanFile): homepage = "https://github.com/drogonframework/drogon" url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" options = { "shared": [False, True], "fPIC": [True, False], @@ -43,14 +46,9 @@ class DrogonConan(ConanFile): "with_redis": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -79,20 +77,20 @@ def _compilers_minimum_version(self): } def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, "14") - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: + if Version(self.info.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("{} requires C++14, which your compiler does not support.".format(self.name)) else: self.output.warn("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) def requirements(self): - self.requires("trantor/1.5.5") + self.requires("trantor/1.5.6") self.requires("jsoncpp/1.9.5") - self.requires("openssl/1.1.1o") + self.requires("openssl/1.1.1q") self.requires("zlib/1.2.12") if self.settings.os == "Linux": self.requires("libuuid/1.0.3") @@ -107,48 +105,51 @@ def requirements(self): if self.options.get_safe("with_mysql"): self.requires("libmysqlclient/8.0.25") if self.options.get_safe("with_sqlite"): - self.requires("sqlite3/3.38.5") + self.requires("sqlite3/3.39.2") if self.options.get_safe("with_redis"): self.requires("hiredis/1.0.2") 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], destination=self.source_folder, strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_CTL"] = self.options.with_ctl + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_ORM"] = self.options.with_orm + tc.variables["COZ_PROFILING"] = self.options.with_profile + tc.variables["BUILD_DROGON_SHARED"] = self.options.shared + tc.variables["BUILD_DOC"] = False + tc.variables["BUILD_BROTLI"] = self.options.with_brotli + tc.variables["BUILD_POSTGRESQL"] = self.options.get_safe("with_postgres", False) + tc.variables["BUILD_POSTGRESQL_BATCH"] = self.options.get_safe("with_postgres_batch", False) + tc.variables["BUILD_MYSQL"] = self.options.get_safe("with_mysql", False) + tc.variables["BUILD_SQLITE"] = self.options.get_safe("with_sqlite", False) + tc.variables["BUILD_REDIS"] = self.options.get_safe("with_redis", False) + tc.generate() + tc = CMakeDeps(self) + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): + apply_conandata_patches(self) cmake = CMake(self) - cmake.definitions["BUILD_CTL"] = self.options.with_ctl - cmake.definitions["BUILD_EXAMPLES"] = False - cmake.definitions["BUILD_ORM"] = self.options.with_orm - cmake.definitions["COZ_PROFILING"] = self.options.with_profile - cmake.definitions["BUILD_DROGON_SHARED"] = self.options.shared - cmake.definitions["BUILD_DOC"] = False - cmake.definitions["BUILD_BROTLI"] = self.options.with_brotli - cmake.definitions["BUILD_POSTGRESQL"] = self.options.get_safe("with_postgres", False) - cmake.definitions["BUILD_POSTGRESQL_BATCH"] = self.options.get_safe("with_postgres_batch", False) - cmake.definitions["BUILD_MYSQL"] = self.options.get_safe("with_mysql", False) - cmake.definitions["BUILD_SQLITE"] = self.options.get_safe("with_sqlite", False) - cmake.definitions["BUILD_REDIS"] = self.options.get_safe("with_redis", False) cmake.configure() - return cmake - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() cmake.build() def package(self): - self.copy("LICENSE", "licenses", 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, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.libs = ["drogon"] if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["rpcrt4", "ws2_32", "crypt32", "advapi32"]) - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version).major == "8": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.system_libs.append("stdc++fs") if self.options.with_ctl: @@ -159,6 +160,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "Drogon") self.cpp_info.set_property("cmake_target_name", "Drogon::Drogon") + # TODO: Remove after Conan 2.0 self.cpp_info.filenames["cmake_find_package"] = "Drogon" self.cpp_info.filenames["cmake_find_package_multi"] = "Drogon" self.cpp_info.names["cmake_find_package"] = "Drogon" diff --git a/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch b/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch new file mode 100644 index 0000000000000..dc4849690a251 --- /dev/null +++ b/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d2e2f69..61fb3bf 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -199,9 +199,9 @@ else() + endif() + + # jsoncpp +-find_package(Jsoncpp REQUIRED) +-target_link_libraries(${PROJECT_NAME} PUBLIC Jsoncpp_lib) +-list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS}) ++find_package(jsoncpp REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp_lib) ++list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${jsoncpp_INCLUDE_DIRS}) + + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" + AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" diff --git a/recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch b/recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch new file mode 100644 index 0000000000000..3038da266a3a2 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch @@ -0,0 +1,41 @@ +index ca6dff2..ba015d2 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,6 @@ option(BUILD_CTL "Build drogon_ctl" ${BUILD_PROGRAMS}) + option(BUILD_EXAMPLES "Build examples" ${BUILD_PROGRAMS}) + option(BUILD_ORM "Build orm" ON) + option(COZ_PROFILING "Use coz for profiling" OFF) +-option(BUILD_SHARED_LIBS "Build drogon as a shared lib" OFF) + option(BUILD_DOC "Build Doxygen documentation" OFF) + option(BUILD_BROTLI "Build Brotli" ON) + +@@ -106,7 +105,6 @@ target_include_directories( + $ + $ + $ +- $ + $ + $) + +@@ -116,9 +114,8 @@ if (WIN32) + PRIVATE $) + endif (WIN32) + +-add_subdirectory(trantor) +- +-target_link_libraries(${PROJECT_NAME} PUBLIC trantor) ++find_package(Trantor REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor) + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") + target_link_libraries(${PROJECT_NAME} PRIVATE network) +@@ -177,7 +174,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") + endif () + + if(NEED_BOOST_FS) +- find_package(Boost 1.49.0 COMPONENTS filesystem system REQUIRED) ++ # TODO: component specified find_package is always failed. Need to fix it. ++ find_package(Boost 1.49.0 REQUIRED) + message(STATUS "Using Boost filesytem::path") + message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIR}) + include_directories(${BOOST_INCLUDE_DIRS}) diff --git a/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch b/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch new file mode 100644 index 0000000000000..2402bc2bfdf71 --- /dev/null +++ b/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba015d2..02c2ccc 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -195,9 +195,9 @@ else() + endif() + + # jsoncpp +-find_package(Jsoncpp REQUIRED) +-target_link_libraries(${PROJECT_NAME} PUBLIC Jsoncpp_lib) +-list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS}) ++find_package(jsoncpp REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp_lib) ++list(APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${jsoncpp_INCLUDE_DIRS}) + + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" + AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" diff --git a/recipes/drogon/all/test_package/CMakeLists.txt b/recipes/drogon/all/test_package/CMakeLists.txt index a8db5b906c051..634b92448f47a 100644 --- a/recipes/drogon/all/test_package/CMakeLists.txt +++ b/recipes/drogon/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(Drogon CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/drogon/all/test_package/conanfile.py b/recipes/drogon/all/test_package/conanfile.py index e0660e0801b96..84eaa369e4a72 100644 --- a/recipes/drogon/all/test_package/conanfile.py +++ b/recipes/drogon/all/test_package/conanfile.py @@ -1,9 +1,18 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type", - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,5 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/drogon/all/test_v1_package/CMakeLists.txt b/recipes/drogon/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3bd4427985a7e --- /dev/null +++ b/recipes/drogon/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Drogon CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} Drogon::Drogon) + +# drogon uses string_view when MSVC_VERSION is greater than 1900. +# https://github.com/drogonframework/drogon/blob/v1.7.5/lib/inc/drogon/utils/string_view.h#L16 +if(DEFINED MSVC_VERSION AND MSVC_VERSION GREATER 1900) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/drogon/all/test_v1_package/conanfile.py b/recipes/drogon/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..db6f728ae05ec --- /dev/null +++ b/recipes/drogon/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type", + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/drogon/config.yml b/recipes/drogon/config.yml index 6793cfc73710a..6f8a6d82d9377 100644 --- a/recipes/drogon/config.yml +++ b/recipes/drogon/config.yml @@ -1,3 +1,5 @@ versions: + "1.8.0": + folder: "all" "1.7.5": folder: "all" From 4f9998a78e46b0e8b1b4bf8d5b848265b37a501e Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 11:04:19 +0200 Subject: [PATCH 058/561] (#12922) gemmlowp: conan v2 support --- recipes/gemmlowp/all/CMakeLists.txt | 7 -- recipes/gemmlowp/all/conandata.yml | 1 - recipes/gemmlowp/all/conanfile.py | 64 ++++++++----------- .../gemmlowp/all/test_package/CMakeLists.txt | 11 ++-- .../gemmlowp/all/test_package/conanfile.py | 21 ++++-- .../all/test_v1_package/CMakeLists.txt | 11 ++++ .../gemmlowp/all/test_v1_package/conanfile.py | 17 +++++ 7 files changed, 73 insertions(+), 59 deletions(-) delete mode 100644 recipes/gemmlowp/all/CMakeLists.txt create mode 100644 recipes/gemmlowp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gemmlowp/all/test_v1_package/conanfile.py diff --git a/recipes/gemmlowp/all/CMakeLists.txt b/recipes/gemmlowp/all/CMakeLists.txt deleted file mode 100644 index b8272b9837356..0000000000000 --- a/recipes/gemmlowp/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/contrib") diff --git a/recipes/gemmlowp/all/conandata.yml b/recipes/gemmlowp/all/conandata.yml index 2c4031a28ae9f..5f6290c4c906d 100644 --- a/recipes/gemmlowp/all/conandata.yml +++ b/recipes/gemmlowp/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "cci.20210928": - patch_file: "patches/build-static-libraries.patch" - base_path: "source_subfolder" diff --git a/recipes/gemmlowp/all/conanfile.py b/recipes/gemmlowp/all/conanfile.py index 33bb3d1a0e29a..14a41c63d1d09 100644 --- a/recipes/gemmlowp/all/conanfile.py +++ b/recipes/gemmlowp/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, CMake, tools +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 apply_conandata_patches, copy, get, rmdir +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" class GemmlowpConan(ConanFile): @@ -22,25 +26,9 @@ class GemmlowpConan(ConanFile): "fPIC": True, } - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -50,33 +38,33 @@ def configure(self): if self.options.shared: del self.options.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) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, {}): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "contrib")) cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - 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): self.cpp_info.set_property("cmake_file_name", "gemmlowp") @@ -85,7 +73,7 @@ def package_info(self): self.cpp_info.components["eight_bit_int_gemm"].set_property("cmake_target_name", "gemmlowp::eight_bit_int_gemm") self.cpp_info.components["eight_bit_int_gemm"].includedirs.append(os.path.join("include", "gemmlowp")) self.cpp_info.components["eight_bit_int_gemm"].libs = ["eight_bit_int_gemm"] - if self._is_msvc: + if is_msvc(self): self.cpp_info.components["eight_bit_int_gemm"].defines = ["NOMINMAX"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["eight_bit_int_gemm"].system_libs.extend(["pthread"]) diff --git a/recipes/gemmlowp/all/test_package/CMakeLists.txt b/recipes/gemmlowp/all/test_package/CMakeLists.txt index 9a7186a46dc81..f1605354570fc 100644 --- a/recipes/gemmlowp/all/test_package/CMakeLists.txt +++ b/recipes/gemmlowp/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(gemmlowp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} gemmlowp::gemmlowp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE gemmlowp::gemmlowp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gemmlowp/all/test_package/conanfile.py b/recipes/gemmlowp/all/test_package/conanfile.py index 49a3a66ea5bad..0a6bc68712d90 100644 --- a/recipes/gemmlowp/all/test_package/conanfile.py +++ b/recipes/gemmlowp/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt b/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d3568415c41be --- /dev/null +++ b/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gemmlowp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gemmlowp::gemmlowp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gemmlowp/all/test_v1_package/conanfile.py b/recipes/gemmlowp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gemmlowp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 9a5bb5eb3e423591a5923e50d018ad801d8e531b Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 15 Sep 2022 11:24:02 +0200 Subject: [PATCH 059/561] (#12816) Add bandit * Add bandit * Apply suggestions from code review Co-authored-by: Uilian Ries * Add test_v1_package * fix test_v1_package * Remove empty line * Fix c++11 management since set_compile_features doesn't work * Use target_compile_features * Use target_compile_features in test_package * Apply suggestions from code review Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/bandit/all/conandata.yml | 9 ++++ recipes/bandit/all/conanfile.py | 46 +++++++++++++++++++ .../patches/0001-change-snowhouse-path.patch | 13 ++++++ .../bandit/all/test_package/CMakeLists.txt | 8 ++++ recipes/bandit/all/test_package/conanfile.py | 30 ++++++++++++ .../bandit/all/test_package/test_package.cpp | 24 ++++++++++ .../bandit/all/test_v1_package/CMakeLists.txt | 12 +++++ .../bandit/all/test_v1_package/conanfile.py | 19 ++++++++ recipes/bandit/config.yml | 3 ++ 9 files changed, 164 insertions(+) create mode 100644 recipes/bandit/all/conandata.yml create mode 100644 recipes/bandit/all/conanfile.py create mode 100644 recipes/bandit/all/patches/0001-change-snowhouse-path.patch create mode 100644 recipes/bandit/all/test_package/CMakeLists.txt create mode 100644 recipes/bandit/all/test_package/conanfile.py create mode 100644 recipes/bandit/all/test_package/test_package.cpp create mode 100644 recipes/bandit/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bandit/all/test_v1_package/conanfile.py create mode 100644 recipes/bandit/config.yml diff --git a/recipes/bandit/all/conandata.yml b/recipes/bandit/all/conandata.yml new file mode 100644 index 0000000000000..f6a1c1fc0eaad --- /dev/null +++ b/recipes/bandit/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "cci.20210618": + url: "https://github.com/banditcpp/bandit/archive/77f50861c09d794af9ae5f65111b330d9b721054.tar.gz" + sha256: "4fe2eeb623e16a09b56f7a4e3d8fde864a5a4a67226cb514945fa7e9a1ae216a" +patches: + "cci.20210618": + - patch_file: "patches/0001-change-snowhouse-path.patch" + patch_description: "Fix snowhouse.h include path" + patch_type: "conan" diff --git a/recipes/bandit/all/conanfile.py b/recipes/bandit/all/conanfile.py new file mode 100644 index 0000000000000..31fd2c6978fa4 --- /dev/null +++ b/recipes/bandit/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.3" + + +class BanditConan(ConanFile): + name = "bandit" + description = "Human-friendly unit testing for C++11" + topics = ("testing", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/banditcpp/bandit" + license = "MIT" + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def requirements(self): + self.requires("snowhouse/5.0.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def layout(self): + basic_layout(self) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE.txt", src=os.path.join(self.source_folder, "docs"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "include", "bandit"), src=os.path.join(self.source_folder, "bandit")) + + def package_id(self): + self.info.clear() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + diff --git a/recipes/bandit/all/patches/0001-change-snowhouse-path.patch b/recipes/bandit/all/patches/0001-change-snowhouse-path.patch new file mode 100644 index 0000000000000..1df54a4f04d5b --- /dev/null +++ b/recipes/bandit/all/patches/0001-change-snowhouse-path.patch @@ -0,0 +1,13 @@ +diff --git a/bandit/adapters/snowhouse.h b/bandit/adapters/snowhouse.h +index f3d9fde..ee3844c 100644 +--- a/bandit/adapters/snowhouse.h ++++ b/bandit/adapters/snowhouse.h +@@ -3,7 +3,7 @@ + + #include + #include +-#include ++#include + + namespace bandit { + namespace adapter { diff --git a/recipes/bandit/all/test_package/CMakeLists.txt b/recipes/bandit/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..58ffec4a070b7 --- /dev/null +++ b/recipes/bandit/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(bandit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} bandit::bandit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bandit/all/test_package/conanfile.py b/recipes/bandit/all/test_package/conanfile.py new file mode 100644 index 0000000000000..40f70f535b209 --- /dev/null +++ b/recipes/bandit/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/bandit/all/test_package/test_package.cpp b/recipes/bandit/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..764be0a694402 --- /dev/null +++ b/recipes/bandit/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include + +using namespace snowhouse; +using namespace bandit; + +go_bandit([]() { + describe("context", []() { + bool b; + + before_each([&]() { + b = true; + }); + + it("is true", [&]() { + AssertThat(b, IsTrue()); + }); + }); +}); + +int main(int argc, char** argv) { + return bandit::run(argc, argv); +} + diff --git a/recipes/bandit/all/test_v1_package/CMakeLists.txt b/recipes/bandit/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..08111eba078e8 --- /dev/null +++ b/recipes/bandit/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(bandit REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bandit::bandit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bandit/all/test_v1_package/conanfile.py b/recipes/bandit/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/bandit/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/bandit/config.yml b/recipes/bandit/config.yml new file mode 100644 index 0000000000000..5cbf4c1d7cb53 --- /dev/null +++ b/recipes/bandit/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20210618": + folder: "all" From c3f7f5af0aaa957d287e9befd7f1028bac586a0a Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 15 Sep 2022 14:04:21 +0200 Subject: [PATCH 060/561] (#12959) [linter] Convert import ConanFile from conans into an error --- linter/check_import_conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linter/check_import_conanfile.py b/linter/check_import_conanfile.py index 56442307ea781..bd5a90391b096 100644 --- a/linter/check_import_conanfile.py +++ b/linter/check_import_conanfile.py @@ -13,7 +13,7 @@ class ImportConanFile(BaseChecker): name = "conan-import-conanfile" msgs = { - "W9006": ( + "E9006": ( "Import ConanFile from new module: `from conan import ConanFile`. Old import is deprecated in Conan v2.", "conan-import-conanfile", "Import ConanFile from new module: `from conan import ConanFile`. Old import is deprecated in Conan v2.", From 54476a818c266b72e9d413c3ef3dfa337e43cd03 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Thu, 15 Sep 2022 14:25:38 +0200 Subject: [PATCH 061/561] set win_bash during the configure stage Contributes to CURA-9575 --- recipes/automake/all/conanfile.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index b2fac7a9600be..792151913668e 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -23,15 +23,12 @@ def _settings_build(self): # TODO: Remove for Conan v2 return getattr(self, "settings_build", self.settings) - @property - def win_bash(self): - return self._settings_build.os == "Windows" - def export_sources(self): for p in self.conan_data.get("patches", {}).get(self.version, []): copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def configure(self): + self.win_bash = self._settings_build.os == "Windows" try: del self.settings.compiler.libcxx # for plain C projects only except ValueError: From 488e8add0a07c9ce1ad9fddc41661bb165fd1e9d Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Thu, 15 Sep 2022 14:26:48 +0200 Subject: [PATCH 062/561] workaround for Unix paths not being set in win_bash env Should be reverted once https://github.com/conan-io/conan/issues/11980 is fixed Contributes to CURA-9575 --- recipes/automake/all/conanfile.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 792151913668e..99aa38781c1af 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -18,6 +18,21 @@ class AutomakeConan(ConanFile): topics = ("conan", "automake", "configure", "build") settings = "os", "arch", "compiler", "build_type" + # Workaround for https://github.com/conan-io/conan/issues/11980 + def init(self): + if self._settings_build.os == "Windows" and Version(required_conan_version) < "1.53": + from conan.tools.env import environment + from conan.tools.microsoft.subsystems import deduce_subsystem + + _old_environment_wrap_command = environment.environment_wrap_command + + def environment_wrap_command(env_filenames, env_folder, cmd, subsystem=None, accepted_extensions=None): + if not subsystem: + subsystem = deduce_subsystem(self, scope="build") + return _old_environment_wrap_command(env_filenames, env_folder, cmd, subsystem, accepted_extensions) + + environment.environment_wrap_command = environment_wrap_command + @property def _settings_build(self): # TODO: Remove for Conan v2 @@ -89,8 +104,8 @@ def generate(self): deps = AutotoolsDeps(self) deps.generate() - ms = VirtualBuildEnv(self) - ms.generate(scope="build") + vb = VirtualBuildEnv(self) + vb.generate(scope="build") def build(self): apply_conandata_patches(self) From baec342f346170d4642195c3c81a850f9367638b Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Thu, 15 Sep 2022 14:28:15 +0200 Subject: [PATCH 063/561] (#12960) [bot] Add Access Request users (2022-09-15) --- .c3i/authorized_users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 69a646218d260..e023a428528da 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -933,3 +933,6 @@ authorized_users: - "kissandras" - "scandyna" - "jave27" + - "mark0n" + - "kayoub5" + - "topheg" From bbe087803c0a2ab38af5fb579899095436c9b8e6 Mon Sep 17 00:00:00 2001 From: Jason Green Date: Thu, 15 Sep 2022 08:04:08 -0500 Subject: [PATCH 064/561] (#12310) Update qxmpp to use Qt 6.2.4 Fixes #12180 Co-authored-by: Jason Green --- recipes/qxmpp/all/conanfile.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/recipes/qxmpp/all/conanfile.py b/recipes/qxmpp/all/conanfile.py index 2a16e110b6e1c..b89c7627065d2 100644 --- a/recipes/qxmpp/all/conanfile.py +++ b/recipes/qxmpp/all/conanfile.py @@ -1,5 +1,6 @@ -from conan.tools.files import rename -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools import files +from conans import CMake import functools import os @@ -46,13 +47,13 @@ def configure(self): del self.options.fPIC def requirements(self): - self.requires("qt/6.2.3") + self.requires("qt/6.2.4") if self.options.with_gstreamer: self.requires("gstreamer/1.19.2") self.requires("glib/2.70.1") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) @functools.lru_cache(1) def _configure_cmake(self): @@ -67,7 +68,7 @@ def _configure_cmake(self): def build(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + files.patch(self, **patch) cmake = self._configure_cmake() cmake.build() @@ -75,12 +76,12 @@ def package(self): self.copy("LICENSE.LGPL", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.options.shared and self.settings.os == "Windows": - tools.mkdir(os.path.join(self.package_folder, "bin")) - rename(self, os.path.join(self.package_folder, "lib", "qxmpp.dll"), + files.mkdir(self, os.path.join(self.package_folder, "bin")) + files.rename(self, os.path.join(self.package_folder, "lib", "qxmpp.dll"), os.path.join(self.package_folder, "bin", "qxmpp.dll")) def package_info(self): From 0acf8e063e26c8c30ded5c4cb34fc64f14a83e80 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 15 Sep 2022 17:48:39 +0200 Subject: [PATCH 065/561] Revert "workaround for Unix paths not being set in win_bash env" This reverts commit 488e8add0a07c9ce1ad9fddc41661bb165fd1e9d. --- recipes/automake/all/conanfile.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 99aa38781c1af..792151913668e 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -18,21 +18,6 @@ class AutomakeConan(ConanFile): topics = ("conan", "automake", "configure", "build") settings = "os", "arch", "compiler", "build_type" - # Workaround for https://github.com/conan-io/conan/issues/11980 - def init(self): - if self._settings_build.os == "Windows" and Version(required_conan_version) < "1.53": - from conan.tools.env import environment - from conan.tools.microsoft.subsystems import deduce_subsystem - - _old_environment_wrap_command = environment.environment_wrap_command - - def environment_wrap_command(env_filenames, env_folder, cmd, subsystem=None, accepted_extensions=None): - if not subsystem: - subsystem = deduce_subsystem(self, scope="build") - return _old_environment_wrap_command(env_filenames, env_folder, cmd, subsystem, accepted_extensions) - - environment.environment_wrap_command = environment_wrap_command - @property def _settings_build(self): # TODO: Remove for Conan v2 @@ -104,8 +89,8 @@ def generate(self): deps = AutotoolsDeps(self) deps.generate() - vb = VirtualBuildEnv(self) - vb.generate(scope="build") + ms = VirtualBuildEnv(self) + ms.generate(scope="build") def build(self): apply_conandata_patches(self) From 5d82e07a5d5a654eacb8342781a8d865012ee058 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 16 Sep 2022 01:04:42 +0900 Subject: [PATCH 066/561] (#11993) hazelcast-cpp-client: update dependencies and migration to Conan v2 * hazelcast-cpp-client: update dependencies * migration to Conan V2 * fix import path for check_min_cppstd * add CMakeDeps * link ws2_32 * use get_safe() for cppstd * add VirtualRunEnv to test_package * follow conan v2 * remove unused modules Co-authored-by: Daniel * remove unused modules Co-authored-by: Daniel Co-authored-by: Daniel --- .../hazelcast-cpp-client/all/CMakeLists.txt | 7 -- .../hazelcast-cpp-client/all/conandata.yml | 7 -- recipes/hazelcast-cpp-client/all/conanfile.py | 92 ++++++++++--------- .../all/test_package/CMakeLists.txt | 13 ++- .../all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../all/test_v1_package/conanfile.py | 17 ++++ recipes/hazelcast-cpp-client/config.yml | 2 - 8 files changed, 97 insertions(+), 73 deletions(-) delete mode 100644 recipes/hazelcast-cpp-client/all/CMakeLists.txt create mode 100644 recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hazelcast-cpp-client/all/test_v1_package/conanfile.py diff --git a/recipes/hazelcast-cpp-client/all/CMakeLists.txt b/recipes/hazelcast-cpp-client/all/CMakeLists.txt deleted file mode 100644 index bd4164cb5c1c7..0000000000000 --- a/recipes/hazelcast-cpp-client/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/hazelcast-cpp-client/all/conandata.yml b/recipes/hazelcast-cpp-client/all/conandata.yml index 79239f547f5e4..90b1afe2d9103 100644 --- a/recipes/hazelcast-cpp-client/all/conandata.yml +++ b/recipes/hazelcast-cpp-client/all/conandata.yml @@ -14,13 +14,6 @@ sources: "4.0.1": url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.0.1.zip" sha256: "4b3c6a876ebca2a4dcf23a556d3c3d4da2284e4ce1d2bbdf335df7f86b03fd28" - "4.0.0": - url: "https://github.com/hazelcast/hazelcast-cpp-client/archive/v4.0.0.zip" - sha256: "1bba72aec47951cefb367a99c196fd8989a2d621e527310fee9483313d347d1b" patches: "4.1.0": - patch_file: "patches/gcc_4.9_5_fix.patch" - base_path: "source_subfolder" - "4.0.0": - - patch_file: "patches/cmake_install.patch" - base_path: "source_subfolder" diff --git a/recipes/hazelcast-cpp-client/all/conanfile.py b/recipes/hazelcast-cpp-client/all/conanfile.py index af35073b34822..6f3062922937b 100644 --- a/recipes/hazelcast-cpp-client/all/conanfile.py +++ b/recipes/hazelcast-cpp-client/all/conanfile.py @@ -1,16 +1,20 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.scm import Version +from conan.tools import files +from conan.tools.build import check_min_cppstd + import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.50.0" class HazelcastCppClient(ConanFile): name = "hazelcast-cpp-client" description = "C++ client library for Hazelcast in-memory database." license = "Apache-2.0" - topics = ("conan", "hazelcast", "client", "database", "cache", "in-memory", "distributed", "computing", "ssl") - homepage = "https://github.com/hazelcast/hazelcast-cpp-client" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake", "cmake_find_package" + homepage = "https://github.com/hazelcast/hazelcast-cpp-client" + topics = ("hazelcast", "client", "database", "cache", "in-memory", "distributed", "computing", "ssl") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,15 +27,9 @@ class HazelcastCppClient(ConanFile): "with_openssl": False } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _cmake_name(self): - return "hazelcastcxx" if tools.Version(self.version) <= "4.0.0" else "hazelcast-cpp-client" + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + files.copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -40,50 +38,56 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + + def layout(self): + cmake_layout(self) def requirements(self): - self.requires("boost/1.76.0") + self.requires("boost/1.79.0") if self.options.with_openssl: - self.requires("openssl/1.1.1k") + self.requires("openssl/1.1.1q") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["WITH_OPENSSL"] = self.options.with_openssl - if tools.Version(self.version) <= "4.0.0": - self._cmake.definitions["BUILD_STATIC_LIB"] = not self.options.shared - self._cmake.definitions["BUILD_SHARED_LIB"] = self.options.shared + files.get(self, + **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + toolchain = CMakeToolchain(self) + toolchain.variables["WITH_OPENSSL"] = self.options.with_openssl + if Version(self.version) <= "4.0.0": + toolchain.variables["BUILD_STATIC_LIB"] = not self.options.shared + toolchain.variables["BUILD_SHARED_LIB"] = self.options.shared else: - self._cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared - self._cmake.configure() - return self._cmake + toolchain.variables["BUILD_SHARED_LIBS"] = self.options.shared + toolchain.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + files.apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + self.copy("LICENSE", dst="licenses", src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = self._cmake_name - self.cpp_info.filenames["cmake_find_package_multi"] = self._cmake_name - self.cpp_info.names["cmake_find_package"] = self._cmake_name - self.cpp_info.names["cmake_find_package_multi"] = self._cmake_name + self.cpp_info.set_property("cmake_file_name", "hazelcast-cpp-client") + self.cpp_info.set_property("cmake_target_name", "hazelcast-cpp-client::hazelcast-cpp-client") - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["hazelcast-cpp-client"] self.cpp_info.defines = ["BOOST_THREAD_VERSION=5"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt b/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt index 22c6e17ef0142..47708a63a3ae9 100644 --- a/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt +++ b/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.10) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(hazelcast-cpp-client REQUIRED CONFIG) -add_executable(test_package test_package.cpp) -target_link_libraries(test_package PUBLIC ${CONAN_LIBS}) -set_property(TARGET test_package PROPERTY CXX_STANDARD 11) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hazelcast-cpp-client::hazelcast-cpp-client) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/hazelcast-cpp-client/all/test_package/conanfile.py b/recipes/hazelcast-cpp-client/all/test_package/conanfile.py index a91fd0cd063d1..f70d40a28931b 100644 --- a/recipes/hazelcast-cpp-client/all/test_package/conanfile.py +++ b/recipes/hazelcast-cpp-client/all/test_package/conanfile.py @@ -1,10 +1,18 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools - class TestPackageHazelcastCppClient(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,5 +20,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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt b/recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..87fd6b32ee2e1 --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(hazelcast-cpp-client REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE hazelcast-cpp-client::hazelcast-cpp-client) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/hazelcast-cpp-client/all/test_v1_package/conanfile.py b/recipes/hazelcast-cpp-client/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hazelcast-cpp-client/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/hazelcast-cpp-client/config.yml b/recipes/hazelcast-cpp-client/config.yml index 6714503007139..50e0bcc183e61 100644 --- a/recipes/hazelcast-cpp-client/config.yml +++ b/recipes/hazelcast-cpp-client/config.yml @@ -9,5 +9,3 @@ versions: folder: all "4.0.1": folder: all - "4.0.0": - folder: all From 328bff80c524c672eed6134176c7cf4eb1580688 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 15 Sep 2022 10:45:50 -0600 Subject: [PATCH 067/561] (#12847) fmt: conan v2 modernize * fmt: conan v2 modernize * Update conanfile.py * Update conanfile.py * Update recipes/fmt/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Code review * Code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/fmt/all/conanfile.py | 39 ++++++++++------------- recipes/fmt/all/test_package/conanfile.py | 1 + 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index f581eaba97d14..80b5bdb350725 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -5,8 +5,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import get, apply_conandata_patches, copy, rmdir - -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.51.3" class FmtConan(ConanFile): @@ -16,8 +15,6 @@ class FmtConan(ConanFile): topics = ("fmt", "format", "iostream", "printf") url = "https://github.com/conan-io/conan-center-index" license = "MIT" - exports_sources = "patches/*" - settings = "os", "arch", "compiler", "build_type" options = { "header_only": [True, False], @@ -38,6 +35,10 @@ class FmtConan(ConanFile): def _has_with_os_api_option(self): return Version(str(self.version)) >= "7.0.0" + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, patch["patch_file"], src=self.recipe_folder, dst=self.export_sources_folder) + def generate(self): if not self.options.header_only: tc = CMakeToolchain(self) @@ -75,7 +76,8 @@ def package_id(self): del self.info.options.with_fmt_alias def source(self): - get(self, **self.conan_data["sources"][str(self.version)], strip_root=True) + get(self, **self.conan_data["sources"][str(self.version)], + destination=self.source_folder, strip_root=True) def build(self): apply_conandata_patches(self) @@ -97,37 +99,30 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "fmt" - self.cpp_info.names["cmake_find_package_multi"] = "fmt" - self.cpp_info.names["pkg_config"] = "fmt" - target = "fmt-header-only" if self.options.header_only else "fmt" - self.cpp_info.set_property("cmake_target_name", "fmt::{}".format(target)) + self.cpp_info.set_property("cmake_file_name", "fmt") + self.cpp_info.set_property("cmake_target_name", f"fmt::{target}") + self.cpp_info.set_property("pkg_config_name", "fmt") # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["_fmt"].includedirs.extend(["include"]) + if self.options.with_fmt_alias: + self.cpp_info.components["_fmt"].defines.append("FMT_STRING_ALIAS=1") + if self.options.header_only: self.cpp_info.components["_fmt"].defines.append("FMT_HEADER_ONLY=1") - if self.options.with_fmt_alias: - self.cpp_info.components["_fmt"].defines.append("FMT_STRING_ALIAS=1") else: postfix = "d" if self.settings.build_type == "Debug" else "" libname = "fmt" + postfix self.cpp_info.components["_fmt"].libs = [libname] if self.settings.os == "Linux": self.cpp_info.components["_fmt"].system_libs.extend(["m"]) - # FIXME: remove when Conan 1.50 is used in c3i and update the Conan required version - # from that version components don't have empty libdirs by default - self.cpp_info.components["_fmt"].libdirs.extend(["lib"]) - self.cpp_info.components["_fmt"].bindirs.extend(["bin"]) - if self.options.with_fmt_alias: - self.cpp_info.components["_fmt"].defines.append("FMT_STRING_ALIAS=1") if self.options.shared: self.cpp_info.components["_fmt"].defines.append("FMT_SHARED") # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.names["cmake_find_package"] = "fmt" + self.cpp_info.names["cmake_find_package_multi"] = "fmt" + self.cpp_info.names["pkg_config"] = "fmt" self.cpp_info.components["_fmt"].names["cmake_find_package"] = target self.cpp_info.components["_fmt"].names["cmake_find_package_multi"] = target - self.cpp_info.components["_fmt"].set_property("cmake_target_name", "fmt::{}".format(target)) - # FIXME: Remove as soon as Conan client provide a hotfix. See conan-io/conan-center-index#12149 - self.cpp_info.components["_fmt"].builddirs = [""] + self.cpp_info.components["_fmt"].set_property("cmake_target_name", f"fmt::{target}") diff --git a/recipes/fmt/all/test_package/conanfile.py b/recipes/fmt/all/test_package/conanfile.py index 8a8fc7d357d57..b896898544c19 100644 --- a/recipes/fmt/all/test_package/conanfile.py +++ b/recipes/fmt/all/test_package/conanfile.py @@ -9,6 +9,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) From 46baaaec39ad4d23f4f3e2e8d6e1ac88e725002d Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 15 Sep 2022 11:24:49 -0600 Subject: [PATCH 068/561] (#12935) rapidjson: Conan 2.0 migration * rapidjson: Conan 2.0 migration * Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: Uilian Ries * add layout * fix v2 target * Apply suggestions from code review Co-authored-by: Uilian Ries * Add cci.20220822 since it provides improved better allocators * Update recipes/rapidjson/all/conanfile.py linter Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: Uilian Ries --- recipes/rapidjson/all/conandata.yml | 10 ++++--- recipes/rapidjson/all/conanfile.py | 27 ++++++++++++------- .../rapidjson/all/test_package/CMakeLists.txt | 8 +++--- .../rapidjson/all/test_package/conanfile.py | 19 +++++++++---- .../all/test_v1_package/CMakeLists.txt | 11 ++++++++ .../all/test_v1_package/conanfile.py | 17 ++++++++++++ recipes/rapidjson/config.yml | 4 ++- 7 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 recipes/rapidjson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidjson/all/test_v1_package/conanfile.py diff --git a/recipes/rapidjson/all/conandata.yml b/recipes/rapidjson/all/conandata.yml index 55339d9202d0f..dd7649f2b814f 100644 --- a/recipes/rapidjson/all/conandata.yml +++ b/recipes/rapidjson/all/conandata.yml @@ -2,9 +2,13 @@ sources: "1.1.0": url: "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz" sha256: bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e - "cci.20200410": - url: "https://github.com/Tencent/rapidjson/archive/8f4c021fa2f1e001d2376095928fc0532adf2ae6.zip" - sha256: e6fc99c7df7f29995838a764dd68df87b71db360f7727ace467b21b82c85efda + # More recent unofficial releases based on commits + "cci.20220822": + url: "https://github.com/Tencent/rapidjson/archive/06d58b9e848c650114556a23294d0b6440078c61.tar.gz" + sha256: 30d28bbe0bfff9d8dc5d3cf62799b6ee550499cc1520e44bdece81e002480d19 "cci.20211112": url: "https://github.com/Tencent/rapidjson/archive/0d4517f15a8d7167ba9ae67f3f22a559ca841e3b.tar.gz" sha256: 3697fdcea30dc7c2b2bb68d2521a6b8793f4d3269de751eed2c5fd477ff329ce + "cci.20200410": + url: "https://github.com/Tencent/rapidjson/archive/8f4c021fa2f1e001d2376095928fc0532adf2ae6.zip" + sha256: e6fc99c7df7f29995838a764dd68df87b71db360f7727ace467b21b82c85efda diff --git a/recipes/rapidjson/all/conanfile.py b/recipes/rapidjson/all/conanfile.py index 828301cb40897..01002651291b6 100644 --- a/recipes/rapidjson/all/conanfile.py +++ b/recipes/rapidjson/all/conanfile.py @@ -1,32 +1,39 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" class RapidjsonConan(ConanFile): name = "rapidjson" description = "A fast JSON parser/generator for C++ with both SAX/DOM style API" - topics = ("conan", "rapidjson", "json", "parser", "generator") + topics = ("rapidjson", "json", "parser", "generator") url = "https://github.com/conan-io/conan-center-index" homepage = "http://rapidjson.org" license = "MIT" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self) def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True, + destination=self.source_folder) def package(self): - self.copy(pattern="license.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, pattern="license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_id(self): - self.info.header_only() + self.info.clear() def package_info(self): + self.cpp_info.set_property("cmake_file_name", "RapidJSON") + self.cpp_info.set_property("cmake_target_name", "rapidjson") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "RapidJSON" self.cpp_info.names["cmake_find_package_multi"] = "RapidJSON" diff --git a/recipes/rapidjson/all/test_package/CMakeLists.txt b/recipes/rapidjson/all/test_package/CMakeLists.txt index 196188113685c..30b669a758f42 100644 --- a/recipes/rapidjson/all/test_package/CMakeLists.txt +++ b/recipes/rapidjson/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(RapidJSON CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidjson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidjson/all/test_package/conanfile.py b/recipes/rapidjson/all/test_package/conanfile.py index bd7165a553cf4..081c97abefb38 100644 --- a/recipes/rapidjson/all/test_package/conanfile.py +++ b/recipes/rapidjson/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +required_conan_version = ">=1.50.0" class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + 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 +22,5 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/rapidjson/all/test_v1_package/CMakeLists.txt b/recipes/rapidjson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a694a0d382f57 --- /dev/null +++ b/recipes/rapidjson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(RapidJSON CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE RapidJSON::RapidJSON) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidjson/all/test_v1_package/conanfile.py b/recipes/rapidjson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/rapidjson/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rapidjson/config.yml b/recipes/rapidjson/config.yml index 1ef1c1e46ed25..82e5350012d0b 100644 --- a/recipes/rapidjson/config.yml +++ b/recipes/rapidjson/config.yml @@ -1,7 +1,9 @@ versions: "1.1.0": folder: "all" - "cci.20200410": + "cci.20220822": folder: "all" "cci.20211112": folder: "all" + "cci.20200410": + folder: "all" From a9dadfb2e3540ed67fe7bce6c669b918bcb84a79 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 16 Sep 2022 02:44:16 +0900 Subject: [PATCH 069/561] (#12949) luau: add version 0.544 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/luau/all/conandata.yml | 8 ++++++++ recipes/luau/config.yml | 2 ++ 2 files changed, 10 insertions(+) diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml index f1531ff67e9a1..749c3d6b15c6a 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.544": + url: "https://github.com/Roblox/luau/archive/0.544.tar.gz" + sha256: "c1e2d4e04fe6f191192d1570bd83f96531804fc484a0bc0e00b53248a01d7dee" "0.541": url: "https://github.com/Roblox/luau/archive/0.541.tar.gz" sha256: "02d50b8c0396a353ed641a61959851d6858607d535ed7373478b8fbc2a508eba" @@ -19,6 +22,11 @@ sources: sha256: "e6de36e83e9c537d92bcc94852ab498e3c15a310fd2c4cc4e21c616d8ae1a84f" patches: + "0.544": + - patch_file: "patches/0.536-0001-fix-cmake.patch" + base_path: "source_subfolder" + - patch_file: "patches/0.536-0002-rename-lerp.patch" + base_path: "source_subfolder" "0.541": - patch_file: "patches/0.536-0001-fix-cmake.patch" base_path: "source_subfolder" diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml index d649377c4e1b8..9484f9c30d208 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,4 +1,6 @@ versions: + "0.544": + folder: all "0.541": folder: all "0.540": From 096faf0c64d7646111d4bf3048349ed2f7d64ebc Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Sep 2022 20:04:19 +0200 Subject: [PATCH 070/561] (#12953) lz4: fix CMake imported targets - imported target if shared is LZ4::lz4_shared - properly define LZ4::lz4_static or LZ4::lz4_shared in cmake_find_package & cmake_find_package_multi generators - add lz4::lz4 alias target (unofficial, it's the old one which was provided by CMakeDeps & cmake_find_package[_multi] generators) to avoid breaking consumers or existing CCI recipes still relying on this target name --- recipes/lz4/all/conanfile.py | 34 ++++++++++--------- recipes/lz4/all/test_package/CMakeLists.txt | 12 +++---- .../lz4/all/test_v1_package/CMakeLists.txt | 12 +++---- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/recipes/lz4/all/conanfile.py b/recipes/lz4/all/conanfile.py index 8a675ed676050..0f12071b01ef2 100644 --- a/recipes/lz4/all/conanfile.py +++ b/recipes/lz4/all/conanfile.py @@ -83,12 +83,12 @@ def build(self): def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) + """) save(self, module_file, content) @property @@ -104,24 +104,26 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - if Version(self.version) >= "1.9.4": - # TODO: to remove in conan v2 once legacy generators removed - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {"lz4": "LZ4::lz4" if self.options.shared else "LZ4::lz4_static"} - ) + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {self._lz4_target: "lz4::lz4"}, + ) + + @property + def _lz4_target(self): + return f"LZ4::{'lz4_shared' if self.options.shared else 'lz4_static'}" def package_info(self): + self.cpp_info.set_property("cmake_file_name", "lz4") + self.cpp_info.set_property("cmake_target_name", self._lz4_target) + self.cpp_info.set_property("cmake_target_aliases", ["lz4::lz4"]) # old unofficial target in CCI for lz4, kept for the moment to not break consumers self.cpp_info.set_property("pkg_config_name", "liblz4") - if Version(self.version) >= "1.9.4": - self.cpp_info.set_property("cmake_file_name", "lz4") - self.cpp_info.set_property("cmake_target_name", "LZ4::lz4" if self.options.shared else "LZ4::lz4_static") self.cpp_info.libs = ["lz4"] if is_msvc(self) and self.options.shared: self.cpp_info.defines.append("LZ4_DLL_IMPORT=1") - self.cpp_info.names["pkg_config"] = "liblz4" - if Version(self.version) >= "1.9.4": - # TODO: to remove in conan v2 once legacy generators removed - self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "liblz4" diff --git a/recipes/lz4/all/test_package/CMakeLists.txt b/recipes/lz4/all/test_package/CMakeLists.txt index b008259cf04cb..14b12b7977c2c 100644 --- a/recipes/lz4/all/test_package/CMakeLists.txt +++ b/recipes/lz4/all/test_package/CMakeLists.txt @@ -6,10 +6,8 @@ find_package(lz4 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) if(TARGET LZ4::lz4_static) target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) -elseif(TARGET LZ4::lz4) - target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4) -else() # version 1.9.3 and older - target_link_libraries(${PROJECT_NAME} PRIVATE lz4::lz4) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_shared) endif() option(TEST_SHARED_LIB "Use package in a shared library") @@ -17,9 +15,7 @@ if(TEST_AS_SHARED_LIB) add_library(${PROJECT_NAME}2 SHARED lib.c) if(TARGET LZ4::lz4_static) target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) - elseif(TARGET LZ4::lz4) - target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4) - else() # version 1.9.3 and older - target_link_libraries(${PROJECT_NAME}2 PRIVATE lz4::lz4) + else() + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_shared) endif() endif() diff --git a/recipes/lz4/all/test_v1_package/CMakeLists.txt b/recipes/lz4/all/test_v1_package/CMakeLists.txt index 88ef3fa80eee7..f9324f7603fe8 100644 --- a/recipes/lz4/all/test_v1_package/CMakeLists.txt +++ b/recipes/lz4/all/test_v1_package/CMakeLists.txt @@ -9,10 +9,8 @@ find_package(lz4 REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.c) if(TARGET LZ4::lz4_static) target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) -elseif(TARGET LZ4::lz4) - target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4) -else() # version 1.9.3 and older - target_link_libraries(${PROJECT_NAME} PRIVATE lz4::lz4) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_shared) endif() option(TEST_SHARED_LIB "Use package in a shared library") @@ -20,9 +18,7 @@ if(TEST_AS_SHARED_LIB) add_library(${PROJECT_NAME}2 SHARED ../test_package/lib.c) if(TARGET LZ4::lz4_static) target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) - elseif(TARGET LZ4::lz4) - target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4) - else() # version 1.9.3 and older - target_link_libraries(${PROJECT_NAME}2 PRIVATE lz4::lz4) + else() + target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_shared) endif() endif() From 53068aa5d9760f8b34193abe6a5f10211d798ad5 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Fri, 16 Sep 2022 11:04:51 +0200 Subject: [PATCH 071/561] (#12909) glog: delete unneeded CMakeLists.txt * delete unneeded CMakeLists.txt * Add test package v1 Signed-off-by: Uilian Ries * Update generators Signed-off-by: Uilian Ries * fire ci * add fix for gflags_gflags_nothreads_RELEASE Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries Co-authored-by: danimtb --- recipes/glog/all/CMakeLists.txt | 7 ------- recipes/glog/all/conanfile.py | 17 ++++++++++++++--- recipes/glog/all/test_package/CMakeLists.txt | 5 +---- recipes/glog/all/test_package/conanfile.py | 19 ++++++++++++++----- .../glog/all/test_v1_package/CMakeLists.txt | 10 ++++++++++ recipes/glog/all/test_v1_package/conanfile.py | 18 ++++++++++++++++++ 6 files changed, 57 insertions(+), 19 deletions(-) delete mode 100644 recipes/glog/all/CMakeLists.txt create mode 100644 recipes/glog/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glog/all/test_v1_package/conanfile.py diff --git a/recipes/glog/all/CMakeLists.txt b/recipes/glog/all/CMakeLists.txt deleted file mode 100644 index 68bfd75fb1882..0000000000000 --- a/recipes/glog/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/glog/all/conanfile.py b/recipes/glog/all/conanfile.py index 8c7a60b13be70..2d7a2e163db5b 100644 --- a/recipes/glog/all/conanfile.py +++ b/recipes/glog/all/conanfile.py @@ -1,5 +1,6 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir from conan.tools.scm import Version import os @@ -59,7 +60,7 @@ def requirements(self): def build_requirements(self): if Version(self.version) >= "0.6.0": - self.build_requires("cmake/3.22.3") + self.tool_requires("cmake/3.22.3") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -83,6 +84,12 @@ def generate(self): tc.variables["WITH_GTEST"] = False tc.generate() + tc = CMakeDeps(self) + tc.generate() + + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + def _patch_sources(self): apply_conandata_patches(self) # do not force PIC @@ -90,6 +97,10 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)", "") + # INFO: avoid "CONAN_LIB::gflags_gflags_nothreads_RELEASE" but the target was not found. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "determine_gflags_namespace", + "# determine_gflags_namespace") def build(self): self._patch_sources() @@ -98,7 +109,7 @@ def build(self): cmake.build() def package(self): - self.copy("COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) diff --git a/recipes/glog/all/test_package/CMakeLists.txt b/recipes/glog/all/test_package/CMakeLists.txt index da54003c66306..286cd0d4348c1 100644 --- a/recipes/glog/all/test_package/CMakeLists.txt +++ b/recipes/glog/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) +project(test_package CXX) find_package(glog REQUIRED CONFIG) diff --git a/recipes/glog/all/test_package/conanfile.py b/recipes/glog/all/test_package/conanfile.py index a9f777f7680ff..8a5bb47f50c4c 100644 --- a/recipes/glog/all/test_package/conanfile.py +++ b/recipes/glog/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/glog/all/test_v1_package/CMakeLists.txt b/recipes/glog/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3473c9c27d148 --- /dev/null +++ b/recipes/glog/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(glog REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} glog::glog) diff --git a/recipes/glog/all/test_v1_package/conanfile.py b/recipes/glog/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/glog/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From c1bb3ed39746d32cada7ff5b4478672362b15184 Mon Sep 17 00:00:00 2001 From: SamsonBox Date: Fri, 16 Sep 2022 11:45:55 +0200 Subject: [PATCH 072/561] (#12975) added new Version 7.85.0 --- recipes/libcurl/all/conandata.yml | 3 +++ recipes/libcurl/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/libcurl/all/conandata.yml b/recipes/libcurl/all/conandata.yml index 2c6a9a1d3ae59..40396d0b0972c 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.85.0": + url: "https://curl.se/download/curl-7.85.0.tar.gz" + sha256: "78a06f918bd5fde3c4573ef4f9806f56372b32ec1829c9ec474799eeee641c27" "7.84.0": url: "https://curl.se/download/curl-7.84.0.tar.gz" sha256: "3c6893d38d054d4e378267166858698899e9d87258e8ff1419d020c395384535" diff --git a/recipes/libcurl/config.yml b/recipes/libcurl/config.yml index 55377e18201ce..efcdbfd3ce377 100644 --- a/recipes/libcurl/config.yml +++ b/recipes/libcurl/config.yml @@ -1,4 +1,6 @@ versions: + "7.85.0": + folder: all "7.84.0": folder: all "7.83.1": From c4b2a2c57317133c1bff22fa6224cd428a2325ef Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 16 Sep 2022 18:45:04 +0200 Subject: [PATCH 073/561] (#12951) coin-cbc: generate gcc11 binaries * coin-cbc: generate gcc11 binaries * Update conanfile.py * Update conanfile.py --- recipes/coin-cbc/all/conanfile.py | 42 +++++++++++++++++-------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/recipes/coin-cbc/all/conanfile.py b/recipes/coin-cbc/all/conanfile.py index 0d5cce0751557..ffea985fa3a7d 100644 --- a/recipes/coin-cbc/all/conanfile.py +++ b/recipes/coin-cbc/all/conanfile.py @@ -1,10 +1,14 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import rename, get, apply_conandata_patches, rmdir, mkdir +from conan.tools.build import cross_building +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, tools from contextlib import contextmanager import os import shutil -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class CoinCbcConan(ConanFile): name = "coin-cbc" @@ -65,22 +69,22 @@ def _user_info_build(self): return getattr(self, "user_info_build", self.deps_user_info) def build_requirements(self): - self.build_requires("gnu-config/cci.20201022") - self.build_requires("pkgconf/1.7.4") + self.tool_requires("gnu-config/cci.20201022") + self.tool_requires("pkgconf/1.7.4") if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("msys2/cci.latest") if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.4") + self.tool_requires("automake/1.16.5") def validate(self): if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("coin-cbc does not support shared builds on Windows") # FIXME: This issue likely comes from very old autotools versions used to produce configure. - if hasattr(self, "settings_build") and tools.cross_building(self) and self.options.shared: + if hasattr(self, "settings_build") and cross_building(self) and self.options.shared: raise ConanInvalidConfiguration("coin-cbc shared not supported yet when cross-building") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) @contextmanager @@ -112,8 +116,8 @@ def _configure_autotools(self): ] if self.settings.compiler == "Visual Studio": self._autotools.cxx_flags.append("-EHsc") - configure_args.append("--enable-msvc={}".format(self.settings.compiler.runtime)) - if tools.Version(self.settings.compiler.version) >= 12: + configure_args.append(f"--enable-msvc={self.settings.compiler.runtime}") + if Version(self.settings.compiler.version) >= 12: self._autotools.flags.append("-FS") if self.options.parallel: configure_args.append("--with-pthreadsw32-lib={}".format(tools.unix_path(os.path.join(self.deps_cpp_info["pthreads4w"].lib_paths[0], self.deps_cpp_info["pthreads4w"].libs[0] + ".lib")))) @@ -122,8 +126,7 @@ def _configure_autotools(self): return self._autotools def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, os.path.join(self._source_subfolder, "config.sub")) shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, @@ -135,19 +138,20 @@ def build(self): def package(self): self.copy("LICENSE", src=self._source_subfolder, dst="licenses") # Installation script expects include/coin to already exist - tools.mkdir(os.path.join(self.package_folder, "include", "coin")) + mkdir(self, os.path.join(self.package_folder, "include", "coin")) with self._build_context(): autotools = self._configure_autotools() autotools.install() for l in ("CbcSolver", "Cbc", "OsiCbc"): - os.unlink(os.path.join(self.package_folder, "lib", "lib{}.la").format(l)) + os.unlink(f"{self.package_folder}/lib/lib{l}.la") if self.settings.compiler == "Visual Studio": - os.rename(os.path.join(self.package_folder, "lib", "lib{}.a").format(l), - os.path.join(self.package_folder, "lib", "{}.lib").format(l)) + rename(self, + f"{self.package_folder}/lib/lib{l}.a", + f"{self.package_folder}/lib/{l}.lib") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.components["libcbc"].libs = ["CbcSolver", "Cbc"] From 753c7974f0d94c7f8f987d6fe8087fa0c79b4dd4 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 17 Sep 2022 02:24:23 +0900 Subject: [PATCH 074/561] (#12978) [docs] package_templates/cmake_package : fix `cache_variables.definitions` and add `configure` --- docs/package_templates/cmake_package/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index ffec34ee46a8d..3dbd29bb835eb 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -100,7 +100,7 @@ def generate(self): tc.cache_variables["PACKAGE_CUSTOM_DEFINITION"] = True if is_msvc(self): # don't use self.settings.compiler.runtime - tc.cache_variables.definitions["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.cache_variables.["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) # deps_cpp_info, deps_env_info and deps_user_info are no longer used if self.dependencies["dependency"].options.foobar: tc.cache_variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs @@ -126,6 +126,7 @@ def _patch_sources(self): def build(self): self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed cmake = CMake(self) + cmake.configure() cmake.build() def package(self): From e8ec71cf8397d777c9849296fb85dcad139d81aa Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 17 Sep 2022 19:04:13 +0900 Subject: [PATCH 075/561] (#12982) magic_enum: add version 0.8.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/magic_enum/all/conandata.yml | 3 +++ recipes/magic_enum/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/magic_enum/all/conandata.yml b/recipes/magic_enum/all/conandata.yml index e66d1d0b0f713..489178f9d1b09 100644 --- a/recipes/magic_enum/all/conandata.yml +++ b/recipes/magic_enum/all/conandata.yml @@ -20,3 +20,6 @@ sources: "0.8.0": url: "https://github.com/Neargye/magic_enum/archive/v0.8.0.tar.gz" sha256: "5e7680e877dd4cf68d9d0c0e3c2a683b432a9ba84fc1993c4da3de70db894c3c" + "0.8.1": + url: "https://github.com/Neargye/magic_enum/archive/v0.8.1.tar.gz" + sha256: "6b948d1680f02542d651fc82154a9e136b341ce55c5bf300736b157e23f9df11" diff --git a/recipes/magic_enum/config.yml b/recipes/magic_enum/config.yml index e39e41e8c8906..099df9650d39c 100644 --- a/recipes/magic_enum/config.yml +++ b/recipes/magic_enum/config.yml @@ -13,3 +13,5 @@ versions: folder: all "0.8.0": folder: all + "0.8.1": + folder: all From 8d778ab436de2583713ed524097fb9315bad37a6 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 17 Sep 2022 23:04:22 +0900 Subject: [PATCH 076/561] (#12984) libnghttp2: add version 1.49.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/libnghttp2/all/conandata.yml | 8 ++++++++ recipes/libnghttp2/config.yml | 2 ++ 2 files changed, 10 insertions(+) diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index 39d70e2302947..8131565e0ca21 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.49.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.49.0.tar.gz" + sha256: "744f38f8d6e400a424bf62df449c91e3ffacbae11b5fab99e44a480f5c735ab9" "1.48.0": url: "https://github.com/nghttp2/nghttp2/archive/v1.48.0.tar.gz" sha256: "946a8fa490548b67fc6074553cb225279cc6404bae96cf74551f2ad4453be637" @@ -24,6 +27,11 @@ sources: url: "https://github.com/nghttp2/nghttp2/releases/download/v1.39.2/nghttp2-1.39.2.tar.bz2" sha256: "92a23e4522328c8565028ee0c7270e74add7990614fd1148f2a79d873bc2a1d0" patches: + "1.49.0": + - patch_file: "patches/fix-findJemalloc.cmake" + base_path: "source_subfolder" + - patch_file: "patches/fix-findLibevent.cmake" + base_path: "source_subfolder" "1.48.0": - patch_file: "patches/fix-findJemalloc.cmake" base_path: "source_subfolder" diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index c71f989fb8ec4..0d99bd0a335ce 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,4 +1,6 @@ versions: + "1.49.0": + folder: all "1.48.0": folder: all "1.47.0": From b2a90406571e9ca652f8c9d538095d9ef3218101 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 18 Sep 2022 04:24:18 +0900 Subject: [PATCH 077/561] (#12992) kuba-zip: add version 0.2.5 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/kuba-zip/all/conandata.yml | 3 +++ recipes/kuba-zip/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/kuba-zip/all/conandata.yml b/recipes/kuba-zip/all/conandata.yml index 021dff1a66b54..871b86958fb94 100644 --- a/recipes/kuba-zip/all/conandata.yml +++ b/recipes/kuba-zip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.5": + url: "https://github.com/kuba--/zip/archive/v0.2.5.tar.gz" + sha256: "e052f6cbe6713f69f8caec61214fda4e5ae5150d1fcba02c9e79f1a05d939305" "0.2.4": url: "https://github.com/kuba--/zip/archive/v0.2.4.tar.gz" sha256: "a3dd762129d58c7ca7a6462f509d29388dbdb25bec559cb4dc03f75523d69cf2" diff --git a/recipes/kuba-zip/config.yml b/recipes/kuba-zip/config.yml index 76385b4eb8a75..0715c02788678 100644 --- a/recipes/kuba-zip/config.yml +++ b/recipes/kuba-zip/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.5": + folder: "all" "0.2.4": folder: "all" "0.2.3": From 8f1eb1987b02d5bd383309075ede44394b4d7735 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 18 Sep 2022 06:03:34 +0900 Subject: [PATCH 078/561] (#12034) dacap-clip: add recipe * dacap-clip: add recipe * use xorg::xcb * link pthread * use CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS * drop support msvc debug shared build * Prepare for Conan 2.0 Signed-off-by: Uilian Ries * fix condition miss * cast bool for self.options.shared Co-authored-by: Uilian Ries * add `keep_path=False` * add Foundation and AppKit in MacOS Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/dacap-clip/all/conandata.yml | 4 + recipes/dacap-clip/all/conanfile.py | 114 ++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 ++ .../dacap-clip/all/test_package/conanfile.py | 26 ++++ .../all/test_package/test_package.cpp | 12 ++ .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 19 +++ recipes/dacap-clip/config.yml | 3 + 8 files changed, 197 insertions(+) create mode 100644 recipes/dacap-clip/all/conandata.yml create mode 100644 recipes/dacap-clip/all/conanfile.py create mode 100644 recipes/dacap-clip/all/test_package/CMakeLists.txt create mode 100644 recipes/dacap-clip/all/test_package/conanfile.py create mode 100644 recipes/dacap-clip/all/test_package/test_package.cpp create mode 100644 recipes/dacap-clip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/dacap-clip/all/test_v1_package/conanfile.py create mode 100644 recipes/dacap-clip/config.yml diff --git a/recipes/dacap-clip/all/conandata.yml b/recipes/dacap-clip/all/conandata.yml new file mode 100644 index 0000000000000..daa1ee060995e --- /dev/null +++ b/recipes/dacap-clip/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.5": + url: "https://github.com/dacap/clip/archive/refs/tags/v1.5.tar.gz" + sha256: "8f6f8a427075a09011fafbb75bfdbf1213e4492a13cff4a70975aab361c99382" diff --git a/recipes/dacap-clip/all/conanfile.py b/recipes/dacap-clip/all/conanfile.py new file mode 100644 index 0000000000000..e2bd672a9b3d1 --- /dev/null +++ b/recipes/dacap-clip/all/conanfile.py @@ -0,0 +1,114 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd + +required_conan_version = ">=1.51.3" + +class DacapClipConan(ConanFile): + name = "dacap-clip" + description = "Cross-platform C++ library to copy/paste clipboard content" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dacap/clip/" + topics = ("clipboard", "copy", "paste") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_png": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_png": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_png + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_png", False): + self.requires("libpng/1.6.37") + if self.settings.os == "Linux": + self.requires("xorg/system") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if is_msvc(self) and self.info.settings.build_type == "Debug" and self.info.options.shared == True: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC debug shared build (now).") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + + def generate(self): + toolchain = CMakeToolchain(self) + toolchain.variables["CLIP_EXAMPLES"] = False + toolchain.variables["CLIP_TESTS"] = False + toolchain.variables["CLIP_X11_WITH_PNG"] = self.options.get_safe("with_png", False) + if is_msvc(self): + toolchain.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = bool(self.options.shared) + toolchain.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "clip.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "*.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.so", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dylib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["clip"] + + if self.options.get_safe("with_png", False): + self.cpp_info.requires.append("libpng::libpng") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.requires.append("xorg::xcb") + self.cpp_info.system_libs.append("pthread") + elif is_apple_os(self): + self.cpp_info.frameworks = ['Cocoa', 'Carbon', 'CoreFoundation', 'Foundation', 'AppKit'] + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend([ + "shlwapi", + "windowscodecs", + ]) + + self.cpp_info.set_property("cmake_file_name", "clip") + self.cpp_info.set_property("cmake_target_name", "clip::clip") + + # TODO: Remove on Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "clip" + self.cpp_info.names["cmake_find_package_multi"] = "clip" diff --git a/recipes/dacap-clip/all/test_package/CMakeLists.txt b/recipes/dacap-clip/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..63e11b22a301b --- /dev/null +++ b/recipes/dacap-clip/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(clip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} clip::clip) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/dacap-clip/all/test_package/conanfile.py b/recipes/dacap-clip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5a673574d7a5b --- /dev/null +++ b/recipes/dacap-clip/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dacap-clip/all/test_package/test_package.cpp b/recipes/dacap-clip/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..78ce3cdf1d299 --- /dev/null +++ b/recipes/dacap-clip/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "clip.h" + +int main() { + clip::set_text("Hello World"); + + std::string value; + clip::get_text(value); + std::cout << value << std::endl; + + return 0; +} diff --git a/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt b/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..784c43a27c83a --- /dev/null +++ b/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include("${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(clip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} clip::clip) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/dacap-clip/all/test_v1_package/conanfile.py b/recipes/dacap-clip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e9bf8aa5f82dd --- /dev/null +++ b/recipes/dacap-clip/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conans import ConanFile, CMake +from conan.tools.build import cross_building + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/dacap-clip/config.yml b/recipes/dacap-clip/config.yml new file mode 100644 index 0000000000000..84f49b2850870 --- /dev/null +++ b/recipes/dacap-clip/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5": + folder: "all" From 44c243cc2b65b39c84c0a58eb4c6e0d06a24d51e Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 18 Sep 2022 06:44:22 +0900 Subject: [PATCH 079/561] (#12994) statslib: add version 3.2.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/statslib/all/conandata.yml | 3 +++ recipes/statslib/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/statslib/all/conandata.yml b/recipes/statslib/all/conandata.yml index a820f1f7bcda9..eeb058ec28754 100644 --- a/recipes/statslib/all/conandata.yml +++ b/recipes/statslib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.0": + url: "https://github.com/kthohr/stats/archive/v3.2.0.tar.gz" + sha256: "1360ba4fbeed96db04e28541b8044daffecdbabc5565944d5cb67136477003ed" "3.1.2": url: "https://github.com/kthohr/stats/archive/v3.1.2.tar.gz" sha256: "fe82c679dbed0cbea284ce077e2c2503afaec745658a3791f9fe5010e438305e" diff --git a/recipes/statslib/config.yml b/recipes/statslib/config.yml index 464e2bade6a07..0b639b7fca8af 100644 --- a/recipes/statslib/config.yml +++ b/recipes/statslib/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.0": + folder: "all" "3.1.2": folder: "all" "3.1.1": From f85db3e60973cb076e694a1264946e29e82e66c5 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Sun, 18 Sep 2022 14:44:26 +0200 Subject: [PATCH 080/561] (#12998) at-spi2-core: add version 2.46.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/at-spi2-core/config.yml | 2 ++ recipes/at-spi2-core/new/conandata.yml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/recipes/at-spi2-core/config.yml b/recipes/at-spi2-core/config.yml index e2400052c7bae..75bf09030a311 100644 --- a/recipes/at-spi2-core/config.yml +++ b/recipes/at-spi2-core/config.yml @@ -15,3 +15,5 @@ versions: folder: new "2.45.90": folder: new + "2.46.0": + folder: new diff --git a/recipes/at-spi2-core/new/conandata.yml b/recipes/at-spi2-core/new/conandata.yml index f27c58a670f7b..4ea30e6fd2d79 100644 --- a/recipes/at-spi2-core/new/conandata.yml +++ b/recipes/at-spi2-core/new/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.46.0": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.46/at-spi2-core-2.46.0.tar.xz" + sha256: "aa0c86c79f7a8d67bae49a5b7a5ab08430c608cffe6e33bf47a72f41ab03c3d0" "2.45.90": url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.45/at-spi2-core-2.45.90.tar.xz" sha256: "e9050ad3c24937548396b2377f2fcdb9321ce2daffad35e7554e8f6ad850ab0d" @@ -6,6 +9,9 @@ sources: sha256: "ba95f346e93108fbb3462c62437081d582154db279b4052dedc52a706828b192" url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.45/at-spi2-core-2.45.1.tar.xz" patches: + "2.46.0": + - base_path: "source_subfolder" + patch_file: "patches/93.patch" "2.45.90": - base_path: "source_subfolder" patch_file: "patches/93.patch" From 1536fa7dfbef95ba47f4ac2068f5d7ac51e8a7e8 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Mon, 19 Sep 2022 09:04:38 +0200 Subject: [PATCH 081/561] (#12879) qt 5.15.6 * qt 5.15.6 * update reqs Also, include conan-io/conan-center-index#11619 and conan-io/conan-center-index#12656 * Update conanfile.py --- recipes/qt/5.x.x/conandata.yml | 60 +-- recipes/qt/5.x.x/conanfile.py | 66 +-- recipes/qt/5.x.x/patches/7371d3a.diff | 38 -- recipes/qt/5.x.x/patches/QTBUG-88625.diff | 58 --- recipes/qt/5.x.x/patches/f830b86.diff | 51 -- recipes/qt/5.x.x/patches/fix-gcc-11.diff | 10 - recipes/qt/5.x.x/qtmodules5.15.3.conf | 438 ------------------ ...odules5.15.2.conf => qtmodules5.15.6.conf} | 42 ++ recipes/qt/config.yml | 8 +- 9 files changed, 93 insertions(+), 678 deletions(-) delete mode 100644 recipes/qt/5.x.x/patches/7371d3a.diff delete mode 100644 recipes/qt/5.x.x/patches/QTBUG-88625.diff delete mode 100644 recipes/qt/5.x.x/patches/f830b86.diff delete mode 100644 recipes/qt/5.x.x/patches/fix-gcc-11.diff delete mode 100644 recipes/qt/5.x.x/qtmodules5.15.3.conf rename recipes/qt/5.x.x/{qtmodules5.15.2.conf => qtmodules5.15.6.conf} (91%) diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index 7119ff4959228..e8ed136ff350b 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -1,20 +1,4 @@ sources: - "5.15.2": - url: - - "https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" - - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" - sha256: "3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded07228202240" - "5.15.3": - url: - - "https://download.qt.io/archive/qt/5.15/5.15.3/single/qt-everywhere-opensource-src-5.15.3.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.3/single/qt-everywhere-opensource-src-5.15.3.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.3/single/qt-everywhere-opensource-src-5.15.3.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.3/single/qt-everywhere-opensource-src-5.15.3.tar.xz" - - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.3/single/qt-everywhere-opensource-src-5.15.3.tar.xz" - sha256: "b7412734698a87f4a0ae20751bab32b1b07fdc351476ad8e35328dbe10efdedb" "5.15.4": url: - "https://download.qt.io/archive/qt/5.15/5.15.4/single/qt-everywhere-opensource-src-5.15.4.tar.xz" @@ -29,31 +13,15 @@ sources: - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz" sha256: "5a97827bdf9fd515f43bc7651defaf64fecb7a55e051c79b8f80510d0e990f06" + "5.15.6": + url: + - "https://download.qt.io/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" + - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz" + sha256: "ebc77d27934b70b25b3dc34fbec7c4471eb451848e891c42b32409ea30fe309f" patches: - "5.15.2": - - patch_file: "patches/aa2a39dea5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/c72097e.diff" - base_path: "qt5/qtwebengine" - - patch_file: "patches/fix-macdeployqt.diff" - base_path: "qt5/qttools" - - patch_file: "patches/QTBUG-88625.diff" - base_path: "qt5/qtwebengine" - - patch_file: "patches/7371d3a.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/QTBUG-90395.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/declarative_missing_header.diff" - base_path: "qt5/qtdeclarative" - - patch_file: "patches/f830b86.diff" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/fix-gcc-11.diff" - base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/dece6f5.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/QTBUG-98813.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - "5.15.3": + "5.15.4": - patch_file: "patches/aa2a39dea5.diff" base_path: "qt5/qtbase" - patch_file: "patches/c72097e.diff" @@ -80,17 +48,15 @@ patches: base_path: "qt5/qtwebengine/src/3rdparty" - patch_file: "patches/skia-cd397f3.diff" base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" - "5.15.4": + - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" + base_path: "qt5/qtwebengine/src/3rdparty" + "5.15.5": - patch_file: "patches/aa2a39dea5.diff" base_path: "qt5/qtbase" - patch_file: "patches/c72097e.diff" base_path: "qt5/qtwebengine" - patch_file: "patches/fix-macdeployqt.diff" base_path: "qt5/qttools" - - patch_file: "patches/QTBUG-90395.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/declarative_missing_header.diff" - base_path: "qt5/qtdeclarative" - patch_file: "patches/dece6f5.diff" base_path: "qt5/qtbase" - patch_file: "patches/QTBUG-98813.patch" @@ -99,8 +65,6 @@ patches: base_path: "qt5/qtwebengine/src/3rdparty" - patch_file: "patches/107ed30ec5.patch" base_path: "qt5/qtwebengine/src/3rdparty" - - patch_file: "patches/b498f4ce3f.patch" - base_path: "qt5/qtwebengine/src/3rdparty" - patch_file: "patches/chromium-v8-missing-constexpr.patch" base_path: "qt5/qtwebengine/src/3rdparty/chromium/v8" - patch_file: "patches/chromium-skia-missing-iterator-include.patch" @@ -109,7 +73,7 @@ patches: base_path: "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" base_path: "qt5/qtwebengine/src/3rdparty" - "5.15.5": + "5.15.6": - patch_file: "patches/aa2a39dea5.diff" base_path: "qt5/qtbase" - patch_file: "patches/c72097e.diff" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 022fd2270e0a5..aab3bf9121a6a 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -214,6 +214,7 @@ def config_options(self): del self.options.with_icu del self.options.with_fontconfig del self.options.with_libalsa + del self.options.qtx11extras if self.settings.compiler == "apple-clang": if Version(self.settings.compiler.version) < "10.0": raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)") @@ -230,6 +231,13 @@ def config_options(self): self.options.qtwayland = False self.options.with_atspi = False + if self.settings.os != "Windows": + del self.options.qtwinextras + del self.options.qtactiveqt + + if self.settings.os != "Macos": + del self.options.qtmacextras + def configure(self): # if self.settings.os != "Linux": # self.options.with_libiconv = False # QTBUG-84708 @@ -243,7 +251,7 @@ def configure(self): del self.options.with_libjpeg del self.options.with_libpng del self.options.with_md4c - + if not self.options.with_dbus: del self.options.with_atspi @@ -256,8 +264,6 @@ def configure(self): if self.settings.os in ("FreeBSD", "Linux"): if self.options.qtwebengine: self.options.with_fontconfig = True - else: - del self.options.qtx11extras if self.options.multiconfiguration: del self.settings.build_type @@ -341,7 +347,7 @@ def validate(self): if self.options.get_safe("with_pulseaudio", default=False) and not self.options["pulseaudio"].with_glib: # https://bugreports.qt.io/browse/QTBUG-95952 raise ConanInvalidConfiguration("Pulseaudio needs to be built with glib option or qt's configure script won't detect it") - + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: raise ConanInvalidConfiguration("gssapi cannot be enabled until conan-io/conan-center-index#4102 is closed") @@ -352,31 +358,31 @@ def requirements(self): if self.options.with_pcre2: self.requires("pcre2/10.40") if self.options.get_safe("with_vulkan"): - self.requires("vulkan-loader/1.3.221") + self.requires("vulkan-loader/1.3.224.0") if is_apple_os(self): self.requires("moltenvk/1.1.10") if self.options.with_glib: - self.requires("glib/2.73.2") + self.requires("glib/2.73.3") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 - if self.options.with_doubleconversion: - self.requires("double-conversion/3.2.0") - if self.options.get_safe("with_freetype", False): + if self.options.with_doubleconversion and not self.options.multiconfiguration: + self.requires("double-conversion/3.2.1") + if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: self.requires("freetype/2.12.1") if self.options.get_safe("with_fontconfig", False): self.requires("fontconfig/2.13.93") if self.options.get_safe("with_icu", False): self.requires("icu/71.1") - if self.options.get_safe("with_harfbuzz", False): - self.requires("harfbuzz/4.4.1") - if self.options.get_safe("with_libjpeg", False): + if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: + self.requires("harfbuzz/5.1.0") + if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.3") + self.requires("libjpeg-turbo/2.1.4") else: self.requires("libjpeg/9d") - if self.options.get_safe("with_libpng", False): + if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: self.requires("libpng/1.6.37") - if self.options.with_sqlite3: + if self.options.with_sqlite3 and not self.options.multiconfiguration: self.requires("sqlite3/3.39.2") self.options["sqlite3"].enable_column_metadata = True if self.options.get_safe("with_mysql", False): @@ -404,6 +410,7 @@ def requirements(self): self.requires("libxshmfence/1.3") self.requires("nss/3.77") self.requires("libdrm/2.4.109") + self.requires("egl/system") if self.options.get_safe("with_gstreamer", False): self.requires("gst-plugins-base/1.19.2") if self.options.get_safe("with_pulseaudio", False): @@ -415,7 +422,7 @@ def requirements(self): if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: self.requires("krb5/1.18.3") # conan-io/conan-center-index#4102 if self.options.get_safe("with_atspi"): - self.requires("at-spi2-core/2.45.1") + self.requires("at-spi2-core/2.45.90") if self.options.get_safe("with_md4c", False): self.requires("md4c/0.4.8") @@ -626,7 +633,7 @@ def build(self): args.append("-dbus-linked") else: args.append("-no-dbus") - + args.append("-feature-gssapi" if self.options.get_safe("with_gssapi", False) else "-no-feature-gssapi") for opt, conf_arg in [ @@ -679,7 +686,8 @@ def build(self): args += ["-I \"%s\"" % s for s in self.deps_cpp_info[package].include_paths] args += ["-D %s" % s for s in self.deps_cpp_info[package].defines] args.append("QMAKE_LIBDIR+=\"%s\"" % " ".join(l for package in self.deps_cpp_info.deps for l in self.deps_cpp_info[package].lib_paths)) - args.append("QMAKE_RPATHLINKDIR+=\"%s\"" % ":".join(l for package in self.deps_cpp_info.deps for l in self.deps_cpp_info[package].lib_paths)) + if not self._is_msvc: + args.append("QMAKE_RPATHLINKDIR+=\"%s\"" % ":".join(l for package in self.deps_cpp_info.deps for l in self.deps_cpp_info[package].lib_paths)) if "libmysqlclient" in self.deps_cpp_info.deps: args.append("-mysql_config \"%s\"" % os.path.join(self.deps_cpp_info["libmysqlclient"].rootpath, "bin", "mysql_config")) @@ -929,7 +937,7 @@ def package_info(self): libsuffix = "" if not self.options.multiconfiguration: if self.settings.build_type == "Debug": - if self.settings.os == "Windows": + if self.settings.os == "Windows" and self._is_msvc: libsuffix = "d" elif is_apple_os(self): libsuffix = "_debug" @@ -1040,8 +1048,8 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components["qtFontDatabaseSupport"].requires.append("fontconfig::fontconfig") if self.options.get_safe("with_freetype"): self.cpp_info.components["qtFontDatabaseSupport"].requires.append("freetype::freetype") - - + + _create_module("ThemeSupport", ["Core", "Gui"]) _create_module("AccessibilitySupport", ["Core", "Gui"]) if self.options.get_safe("with_vulkan"): @@ -1056,7 +1064,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.settings.os in ["Android", "Emscripten"]: _create_module("EglSupport", ["Core", "Gui"]) - + if self.settings.os == "Windows": windows_reqs = ["Core", "Gui"] windows_reqs.extend(["EventDispatcherSupport", "FontDatabaseSupport", "ThemeSupport", "AccessibilitySupport"]) @@ -1079,7 +1087,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.get_safe("with_vulkan"): cocoa_reqs.append("VulkanSupport") if self.options.widgets: - cocoa_reqs.append("PrintSupport") + cocoa_reqs.append("PrintSupport") _create_plugin("QCocoaIntegrationPlugin", "qcocoa", "platforms", cocoa_reqs) _create_plugin("QMacStylePlugin", "qmacstyle", "styles", cocoa_reqs) self.cpp_info.components["QCocoaIntegrationPlugin"].frameworks = ["AppKit", "Carbon", "CoreServices", "CoreVideo", @@ -1093,7 +1101,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): elif self.settings.os == "Emscripten": _create_plugin("QWasmIntegrationPlugin", "qwasm", "platforms", ["Core", "Gui", "EventDispatcherSupport", "FontDatabaseSupport", "EglSupport"]) elif self.settings.os in ["Linux", "FreeBSD"]: - service_support_reqs = ["Core", "Gui"] + service_support_reqs = ["Core", "Gui"] if self.options.with_dbus: service_support_reqs.append("DBus") _create_module("ServiceSupport", service_support_reqs) @@ -1210,7 +1218,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): webenginereqs = ["Gui", "Quick", "WebChannel", "Positioning"] if self.settings.os in ["Linux", "FreeBSD"]: webenginereqs.extend(["expat::expat", "opus::libopus", "xorg-proto::xorg-proto", "libxshmfence::libxshmfence", \ - "nss::nss", "libdrm::libdrm"]) + "nss::nss", "libdrm::libdrm", "egl::egl"]) _create_module("WebEngineCore", webenginereqs) if self.settings.os != "Windows": self.cpp_info.components["WebEngineCore"].system_libs.append("resolv") @@ -1330,16 +1338,16 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.qtremoteobjects: _create_module("RemoteObjects") - if self.options.qtwinextras: + if self.options.get_safe("qtwinextras"): _create_module("WinExtras") - if self.options.qtmacextras: + if self.options.get_safe("qtmacextras"): _create_module("MacExtras") if self.options.qtxmlpatterns: _create_module("XmlPatterns", ["Network"]) - if self.options.qtactiveqt: + if self.options.get_safe("qtactiveqt"): _create_module("AxBase", ["Gui", "Widgets"]) self.cpp_info.components["qtAxBase"].includedirs = ["include", os.path.join("include", "ActiveQt")] self.cpp_info.components["qtAxBase"].system_libs.extend(["ole32", "oleaut32", "user32", "gdi32", "advapi32"]) @@ -1380,7 +1388,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.widgets: self.cpp_info.components["qtWidgets"].system_libs.append("UxTheme") self.cpp_info.components["qtWidgets"].system_libs.append("dwmapi") - if self.options.qtwinextras: + if self.options.get_safe("qtwinextras"): self.cpp_info.components["qtWinExtras"].system_libs.append("dwmapi") # qtwinextras requires "DwmGetColorizationColor" which is in "dwmapi.lib" library diff --git a/recipes/qt/5.x.x/patches/7371d3a.diff b/recipes/qt/5.x.x/patches/7371d3a.diff deleted file mode 100644 index 9488a6aec87ec..0000000000000 --- a/recipes/qt/5.x.x/patches/7371d3a.diff +++ /dev/null @@ -1,38 +0,0 @@ -Parent: 30151e20 (Fix misidentification of some shearing QTransforms as only rotating) -Author: Zhang Yu -AuthorDate: 2020-11-17 21:05:39 +0800 -Commit: Zhang Yu -CommitDate: 2020-11-18 07:41:48 +0000 - -Fix QGraphicsItem crash if click right button of mouse - -In this case, the 'parent' is QGraphicsTextItem which isn't a object -inheriting from QWidget. Converting QGraphicsTextItem to QWidget -by static_cast and using it as QWidget leads to crash. - -Fixes: QTBUG-88309 -Change-Id: I3c583f43125eb36841848434d1fa9a135b0e9f57 -Reviewed-by: Volker Hilsheimer -(cherry picked from commit 4df5f93018344f6cdc6cd5a08a084b1c61e0c076) - -diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp -index 40b8af6..e2a07c0 100644 ---- a/src/widgets/widgets/qwidgettextcontrol.cpp -+++ b/src/widgets/widgets/qwidgettextcontrol.cpp -@@ -1942,10 +1942,14 @@ - if (!menu) - return; - menu->setAttribute(Qt::WA_DeleteOnClose); -- if (auto *window = static_cast(parent)->window()->windowHandle()) { -- QMenuPrivate::get(menu)->topData()->initialScreenIndex = -+ -+ if (auto *widget = qobject_cast(parent)) { -+ if (auto *window = widget->window()->windowHandle()) { -+ QMenuPrivate::get(menu)->topData()->initialScreenIndex = - QGuiApplication::screens().indexOf(window->screen()); -+ } - } -+ - menu->popup(screenPos); - #endif - } diff --git a/recipes/qt/5.x.x/patches/QTBUG-88625.diff b/recipes/qt/5.x.x/patches/QTBUG-88625.diff deleted file mode 100644 index ed0c1fd48d82c..0000000000000 --- a/recipes/qt/5.x.x/patches/QTBUG-88625.diff +++ /dev/null @@ -1,58 +0,0 @@ -Fix compile errors in QtWebEngine when building with VS2019 >= 16.8.0 . -See https://bugreports.qt.io/browse/QTBUG-88625 and -https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/321741 . - -diff -u -r a/src/3rdparty/chromium/third_party/angle/src/common/mathutil.cpp b/src/3rdparty/chromium/third_party/angle/src/common/mathutil.cpp ---- a/src/3rdparty/chromium/third_party/angle/src/common/mathutil.cpp 2021-05-20 13:38:32.243947800 +0200 -+++ b/src/3rdparty/chromium/third_party/angle/src/common/mathutil.cpp 2021-05-20 12:25:30.392900700 +0200 -@@ -72,11 +72,11 @@ - const RGB9E5Data *inputData = reinterpret_cast(&input); - - *red = -- inputData->R * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); -+ inputData->R * (float)pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); - *green = -- inputData->G * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); -+ inputData->G * (float)pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); - *blue = -- inputData->B * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); -+ inputData->B * (float)pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits); - } - - } // namespace gl -diff -u -r a/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/lab_color_space.h b/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/lab_color_space.h ---- a/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/lab_color_space.h 2020-11-07 02:22:36.000000000 +0100 -+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/lab_color_space.h 2021-05-20 13:39:42.890109500 +0200 -@@ -130,7 +130,7 @@ - // https://en.wikipedia.org/wiki/CIELAB_color_space#Forward_transformation. - FloatPoint3D toXYZ(const FloatPoint3D& lab) const { - auto invf = [](float x) { -- return x > kSigma ? pow(x, 3) : 3 * kSigma2 * (x - 4.0f / 29.0f); -+ return x > kSigma ? (float)pow(x, 3) : 3 * kSigma2 * (x - 4.0f / 29.0f); - }; - - FloatPoint3D v = {clamp(lab.X(), 0.0f, 100.0f), -diff -u -r a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h ---- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h 2020-11-07 02:22:36.000000000 +0100 -+++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/timestamped_trace_piece.h 2021-05-20 13:41:08.983902900 +0200 -@@ -197,6 +197,20 @@ - } - return *this; - } -+ -+ #if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_MSVC) -+ TimestampedTracePiece& operator=(TimestampedTracePiece&& ttp) const -+ { -+ if (this != &ttp) { -+ // First invoke the destructor and then invoke the move constructor -+ // inline via placement-new to implement move-assignment. -+ this->~TimestampedTracePiece(); -+ new (const_cast(this)) TimestampedTracePiece(std::move(ttp)); -+ } -+ -+ return const_cast(*this); -+ } -+#endif // PERFETTO_BUILDFLAG(PERFETTO_COMPILER_MSVC) - - ~TimestampedTracePiece() { - switch (type) { diff --git a/recipes/qt/5.x.x/patches/f830b86.diff b/recipes/qt/5.x.x/patches/f830b86.diff deleted file mode 100644 index 3b0d18134fe2d..0000000000000 --- a/recipes/qt/5.x.x/patches/f830b86.diff +++ /dev/null @@ -1,51 +0,0 @@ -From f830b86ef770100f6e3fa234ac3e00eee7a1cd70 Mon Sep 17 00:00:00 2001 -From: Peter Varga -Date: Mon, 16 Nov 2020 11:11:13 +0100 -Subject: [PATCH] [Backport] mac: make find_sdk.py work when the sdk goes to 11 - -Bug: 1098738 -Change-Id: I25b84537a445ecb8f80241c98d4753932f5f7c90 -Commit-Queue: Nico Weber -Commit-Queue: Mark Mentovai -Auto-Submit: Nico Weber -Reviewed-by: Mark Mentovai -Cr-Commit-Position: refs/heads/master@{#781835} -Reviewed-by: Allan Sandfeld Jensen ---- - -diff --git a/chromium/build/mac/find_sdk.py b/chromium/build/mac/find_sdk.py -index 38c2883..a2f7455 100755 ---- a/chromium/build/mac/find_sdk.py -+++ b/chromium/build/mac/find_sdk.py -@@ -2,8 +2,7 @@ - # Copyright (c) 2012 The Chromium Authors. All rights reserved. - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. -- --"""Prints the lowest locally available SDK version greater than or equal to a -+r"""Prints the lowest locally available SDK version greater than or equal to a - given minimum sdk version to standard output. - - If --developer_dir is passed, then the script will use the Xcode toolchain -@@ -14,8 +13,10 @@ - toolchain bin dir. - - Usage: -- python find_sdk.py [--developer_dir DEVELOPER_DIR] [--print_sdk_path] \ -- [--print_bin_path] 10.6 # Ignores SDKs < 10.6 -+ python find_sdk.py \ -+ [--print_sdk_path] \ -+ [--print_bin_path] \ -+ 10.6 # Ignores SDKs < 10.6 - - Sample Output: - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -@@ -88,7 +89,7 @@ - raise SdkError('Install Xcode, launch it, accept the license ' + - 'agreement, and run `sudo xcode-select -s /path/to/Xcode.app` ' + - 'to continue.') -- sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)] -+ sdks = [re.findall('^MacOSX(\d+\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)] - sdks = [s[0] for s in sdks if s] # [['10.5'], ['10.6']] => ['10.5', '10.6'] - sdks = [s for s in sdks # ['10.5', '10.6'] => ['10.6'] - if parse_version(s) >= parse_version(min_sdk_version)] diff --git a/recipes/qt/5.x.x/patches/fix-gcc-11.diff b/recipes/qt/5.x.x/patches/fix-gcc-11.diff deleted file mode 100644 index 5818509732180..0000000000000 --- a/recipes/qt/5.x.x/patches/fix-gcc-11.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- a/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.h -+++ b/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.h -@@ -19,6 +19,7 @@ - - #include - #include -+#include - - #include - #include \ No newline at end of file diff --git a/recipes/qt/5.x.x/qtmodules5.15.3.conf b/recipes/qt/5.x.x/qtmodules5.15.3.conf deleted file mode 100644 index c1074189daf23..0000000000000 --- a/recipes/qt/5.x.x/qtmodules5.15.3.conf +++ /dev/null @@ -1,438 +0,0 @@ -[submodule "qtbase"] - path = qtbase - url = ../tqtc-qtbase.git - alias = qt/qtbase - branch = tqtc/lts-5.15-opensource - status = essential - repoType = replaced -[submodule "qtsvg"] - depends = qtbase - path = qtsvg - url = ../tqtc-qtsvg.git - alias = qt/qtsvg - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtdeclarative"] - depends = qtbase - recommends = qtsvg - path = qtdeclarative - url = ../tqtc-qtdeclarative.git - alias = qt/qtdeclarative - branch = tqtc/lts-5.15-opensource - status = essential - repoType = replaced -[submodule "qtactiveqt"] - depends = qtbase - path = qtactiveqt - url = ../tqtc-qtactiveqt.git - alias = qt/qtactiveqt - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtscript"] - depends = qtbase - recommends = qttools - path = qtscript - url = ../qtscript.git - branch = 5.15.3 - status = deprecated - repoType = replaced -[submodule "qtmultimedia"] - depends = qtbase - recommends = qtdeclarative - path = qtmultimedia - url = ../tqtc-qtmultimedia.git - alias = qt/qtmultimedia - branch = tqtc/lts-5.15-opensource - status = essential - repoType = replaced -[submodule "qttools"] - depends = qtbase - recommends = qtdeclarative qtactiveqt - path = qttools - url = ../tqtc-qttools.git - alias = qt/qttools - branch = tqtc/lts-5.15-opensource - status = essential - repoType = replaced -[submodule "qtxmlpatterns"] - depends = qtbase - recommends = qtdeclarative - path = qtxmlpatterns - url = ../tqtc-qtxmlpatterns.git - alias = qt/qtxmlpatterns - branch = tqtc/lts-5.15-opensource - status = deprecated - repoType = replaced -[submodule "qttranslations"] - depends = qttools - path = qttranslations - url = ../tqtc-qttranslations.git - alias = qt/qttranslations - branch = tqtc/lts-5.15-opensource - status = essential - priority = 30 - repoType = replaced -[submodule "qtdoc"] - depends = qtdeclarative qttools - recommends = qtmultimedia qtquickcontrols qtquickcontrols2 - path = qtdoc - url = ../tqtc-qtdoc.git - alias = qt/qtdoc - branch = tqtc/lts-5.15-opensource - status = essential - priority = 40 - repoType = replaced -[submodule "qtrepotools"] - path = qtrepotools - url = ../qtrepotools.git - branch = master - status = essential - project = - - repoType = inherited -[submodule "qtqa"] - depends = qtbase - path = qtqa - url = ../qtqa.git - branch = master - status = essential - priority = 50 - repoType = inherited -[submodule "qtlocation"] - depends = qtbase - recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport - path = qtlocation - url = ../tqtc-qtlocation.git - alias = qt/qtlocation - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtsensors"] - depends = qtbase - recommends = qtdeclarative - path = qtsensors - url = ../tqtc-qtsensors.git - alias = qt/qtsensors - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtsystems"] - depends = qtbase - recommends = qtdeclarative - path = qtsystems - url = ../qtsystems.git - branch = dev - status = ignore - repoType = inherited -[submodule "qtfeedback"] - depends = qtdeclarative - recommends = qtmultimedia - path = qtfeedback - url = ../qtfeedback.git - branch = master - status = ignore - repoType = inherited -[submodule "qtpim"] - depends = qtdeclarative - path = qtpim - url = ../qtpim.git - branch = dev - status = ignore - repoType = inherited -[submodule "qtconnectivity"] - depends = qtbase - recommends = qtdeclarative qtandroidextras - path = qtconnectivity - url = ../tqtc-qtconnectivity.git - alias = qt/qtconnectivity - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtwayland"] - depends = qtbase - recommends = qtdeclarative - path = qtwayland - url = ../tqtc-qtwayland.git - alias = qt/qtwayland - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qt3d"] - depends = qtbase - recommends = qtdeclarative qtimageformats qtgamepad - path = qt3d - url = ../tqtc-qt3d.git - alias = qt/qt3d - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtimageformats"] - depends = qtbase - path = qtimageformats - url = ../tqtc-qtimageformats.git - alias = qt/qtimageformats - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtgraphicaleffects"] - depends = qtdeclarative - path = qtgraphicaleffects - url = ../tqtc-qtgraphicaleffects.git - alias = qt/qtgraphicaleffects - branch = tqtc/lts-5.15-opensource - status = essential - repoType = replaced -[submodule "qtquickcontrols"] - depends = qtdeclarative - recommends = qtgraphicaleffects - path = qtquickcontrols - url = ../tqtc-qtquickcontrols.git - alias = qt/qtquickcontrols - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtserialbus"] - depends = qtbase - recommends = qtserialport - path = qtserialbus - url = ../tqtc-qtserialbus.git - alias = qt/qtserialbus - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtserialport"] - depends = qtbase - path = qtserialport - url = ../tqtc-qtserialport.git - alias = qt/qtserialport - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtx11extras"] - depends = qtbase - path = qtx11extras - url = ../tqtc-qtx11extras.git - alias = qt/qtx11extras - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtmacextras"] - depends = qtbase - path = qtmacextras - url = ../tqtc-qtmacextras.git - alias = qt/qtmacextras - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtwinextras"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtwinextras - url = ../tqtc-qtwinextras.git - alias = qt/qtwinextras - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtandroidextras"] - depends = qtbase - path = qtandroidextras - url = ../tqtc-qtandroidextras.git - alias = qt/qtandroidextras - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtwebsockets"] - depends = qtbase - recommends = qtdeclarative - path = qtwebsockets - url = ../tqtc-qtwebsockets.git - alias = qt/qtwebsockets - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtwebchannel"] - depends = qtbase - recommends = qtdeclarative qtwebsockets - path = qtwebchannel - url = ../tqtc-qtwebchannel.git - alias = qt/qtwebchannel - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtwebengine"] - depends = qtdeclarative - recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools - path = qtwebengine - url = ../qtwebengine.git - branch = 5.15.3 - status = addon - priority = 10 - repoType = replaced -[submodule "qtcanvas3d"] - depends = qtdeclarative - path = qtcanvas3d - url = ../qtcanvas3d.git - branch = dev - status = ignore -[submodule "qtwebview"] - depends = qtdeclarative - recommends = qtwebengine - path = qtwebview - url = ../tqtc-qtwebview.git - alias = qt/qtwebview - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtquickcontrols2"] - depends = qtgraphicaleffects - recommends = qtimageformats - path = qtquickcontrols2 - url = ../tqtc-qtquickcontrols2.git - alias = qt/qtquickcontrols2 - branch = tqtc/lts-5.15-opensource - status = essential - repoType = replaced -[submodule "qtpurchasing"] - depends = qtbase - recommends = qtdeclarative qtandroidextras - path = qtpurchasing - url = ../tqtc-qtpurchasing.git - alias = qt/qtpurchasing - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtcharts"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtcharts - url = ../tqtc-qtcharts.git - alias = qt/qtcharts - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtdatavis3d"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtdatavis3d - url = ../tqtc-qtdatavis3d.git - alias = qt/qtdatavis3d - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtvirtualkeyboard"] - depends = qtbase qtdeclarative qtsvg - recommends = qtmultimedia qtquickcontrols - path = qtvirtualkeyboard - url = ../tqtc-qtvirtualkeyboard.git - alias = qt/qtvirtualkeyboard - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtgamepad"] - depends = qtbase - recommends = qtdeclarative - path = qtgamepad - url = ../tqtc-qtgamepad.git - alias = qt/qtgamepad - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtscxml"] - depends = qtbase qtdeclarative - path = qtscxml - url = ../tqtc-qtscxml.git - alias = qt/qtscxml - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtspeech"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtspeech - url = ../tqtc-qtspeech.git - alias = qt/qtspeech - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtnetworkauth"] - depends = qtbase - path = qtnetworkauth - url = ../tqtc-qtnetworkauth.git - alias = qt/qtnetworkauth - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtremoteobjects"] - depends = qtbase - recommends = qtdeclarative - path = qtremoteobjects - url = ../tqtc-qtremoteobjects.git - alias = qt/qtremoteobjects - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtwebglplugin"] - depends = qtbase qtwebsockets - recommends = qtdeclarative - path = qtwebglplugin - url = ../tqtc-qtwebglplugin.git - alias = qt/qtwebglplugin - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtlottie"] - depends = qtbase qtdeclarative - path = qtlottie - url = ../tqtc-qtlottie.git - alias = qt/qtlottie - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtquicktimeline"] - depends = qtbase qtdeclarative - path = qtquicktimeline - url = ../tqtc-qtquicktimeline - alias = qt/qtquicktimeline - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtquick3d"] - depends = qtbase qtdeclarative - path = qtquick3d - url = ../tqtc-qtquick3d.git - alias = qt/qtquick3d - branch = tqtc/lts-5.15-opensource - status = addon - repoType = replaced -[submodule "qtknx"] - depends = qtbase - recommends = qtdeclarative - path = qtknx - url = ../tqtc-qtknx.git - alias = qt/qtknx - branch = tqtc/lts-5.15-opensource - status = addon - project = qtknx.pro -[submodule "qtmqtt"] - depends = qtbase - path = qtmqtt - url = ../tqtc-qtmqtt.git - alias = qt/qtmqtt - branch = tqtc/lts-5.15-opensource - status = addon - project = qtmqtt.pro -[submodule "qtopcua"] - depends = qtbase qtdeclarative - path = qtopcua - url = ../tqtc-qtopcua.git - alias = qt/qtopcua - branch = tqtc/lts-5.15-opensource - status = preview -[submodule "qtcoap"] - depends = qtbase - path = qtcoap - url = ../tqtc-qtcoap.git - alias = qt/qtcoap - branch = tqtc/lts-5.15-opensource - status = addon diff --git a/recipes/qt/5.x.x/qtmodules5.15.2.conf b/recipes/qt/5.x.x/qtmodules5.15.6.conf similarity index 91% rename from recipes/qt/5.x.x/qtmodules5.15.2.conf rename to recipes/qt/5.x.x/qtmodules5.15.6.conf index 788b31c881415..452233655f279 100644 --- a/recipes/qt/5.x.x/qtmodules5.15.2.conf +++ b/recipes/qt/5.x.x/qtmodules5.15.6.conf @@ -1,51 +1,60 @@ [submodule "qtbase"] path = qtbase url = ../qtbase.git + branch = 5.15 status = essential [submodule "qtsvg"] depends = qtbase path = qtsvg url = ../qtsvg.git + branch = 5.15 status = addon [submodule "qtdeclarative"] depends = qtbase recommends = qtsvg path = qtdeclarative url = ../qtdeclarative.git + branch = 5.15 status = essential [submodule "qtactiveqt"] depends = qtbase path = qtactiveqt url = ../qtactiveqt.git + branch = 5.15 status = addon [submodule "qtscript"] depends = qtbase recommends = qttools path = qtscript url = ../qtscript.git + branch = 5.15 status = deprecated [submodule "qtmultimedia"] depends = qtbase recommends = qtdeclarative path = qtmultimedia url = ../qtmultimedia.git + branch = 5.15 status = essential [submodule "qttools"] depends = qtbase recommends = qtdeclarative qtactiveqt path = qttools url = ../qttools.git + branch = 5.15 status = essential [submodule "qtxmlpatterns"] depends = qtbase recommends = qtdeclarative path = qtxmlpatterns url = ../qtxmlpatterns.git + branch = 5.15 status = deprecated [submodule "qttranslations"] depends = qttools path = qttranslations url = ../qttranslations.git + branch = 5.15 status = essential priority = 30 [submodule "qtdoc"] @@ -53,6 +62,7 @@ recommends = qtmultimedia qtquickcontrols qtquickcontrols2 path = qtdoc url = ../qtdoc.git + branch = 5.15 status = essential priority = 40 [submodule "qtrepotools"] @@ -73,12 +83,14 @@ recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport path = qtlocation url = ../qtlocation.git + branch = 5.15 status = addon [submodule "qtsensors"] depends = qtbase recommends = qtdeclarative path = qtsensors url = ../qtsensors.git + branch = 5.15 status = addon [submodule "qtsystems"] depends = qtbase @@ -111,84 +123,99 @@ recommends = qtdeclarative qtandroidextras path = qtconnectivity url = ../qtconnectivity.git + branch = 5.15 status = addon [submodule "qtwayland"] depends = qtbase recommends = qtdeclarative path = qtwayland url = ../qtwayland.git + branch = 5.15 status = addon [submodule "qt3d"] depends = qtbase recommends = qtdeclarative qtimageformats qtgamepad path = qt3d url = ../qt3d.git + branch = 5.15 status = addon [submodule "qtimageformats"] depends = qtbase path = qtimageformats url = ../qtimageformats.git + branch = 5.15 status = addon [submodule "qtgraphicaleffects"] depends = qtdeclarative path = qtgraphicaleffects url = ../qtgraphicaleffects.git + branch = 5.15 status = essential [submodule "qtquickcontrols"] depends = qtdeclarative recommends = qtgraphicaleffects path = qtquickcontrols url = ../qtquickcontrols.git + branch = 5.15 status = addon [submodule "qtserialbus"] depends = qtbase recommends = qtserialport path = qtserialbus url = ../qtserialbus.git + branch = 5.15 status = addon [submodule "qtserialport"] depends = qtbase path = qtserialport url = ../qtserialport.git + branch = 5.15 status = addon [submodule "qtx11extras"] depends = qtbase path = qtx11extras url = ../qtx11extras.git + branch = 5.15 status = addon [submodule "qtmacextras"] depends = qtbase path = qtmacextras url = ../qtmacextras.git + branch = 5.15 status = addon [submodule "qtwinextras"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtwinextras url = ../qtwinextras.git + branch = 5.15 status = addon [submodule "qtandroidextras"] depends = qtbase path = qtandroidextras url = ../qtandroidextras.git + branch = 5.15 status = addon [submodule "qtwebsockets"] depends = qtbase recommends = qtdeclarative path = qtwebsockets url = ../qtwebsockets.git + branch = 5.15 status = addon [submodule "qtwebchannel"] depends = qtbase recommends = qtdeclarative qtwebsockets path = qtwebchannel url = ../qtwebchannel.git + branch = 5.15 status = addon [submodule "qtwebengine"] depends = qtdeclarative recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools path = qtwebengine url = ../qtwebengine.git + branch = 5.15 status = addon priority = 10 [submodule "qtcanvas3d"] @@ -202,83 +229,98 @@ recommends = qtwebengine path = qtwebview url = ../qtwebview.git + branch = 5.15 status = addon [submodule "qtquickcontrols2"] depends = qtgraphicaleffects recommends = qtimageformats path = qtquickcontrols2 url = ../qtquickcontrols2.git + branch = 5.15 status = essential [submodule "qtpurchasing"] depends = qtbase recommends = qtdeclarative qtandroidextras path = qtpurchasing url = ../qtpurchasing.git + branch = 5.15 status = addon [submodule "qtcharts"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtcharts url = ../qtcharts.git + branch = 5.15 status = addon [submodule "qtdatavis3d"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtdatavis3d url = ../qtdatavis3d.git + branch = 5.15 status = addon [submodule "qtvirtualkeyboard"] depends = qtbase qtdeclarative qtsvg recommends = qtmultimedia qtquickcontrols path = qtvirtualkeyboard url = ../qtvirtualkeyboard.git + branch = 5.15 status = addon [submodule "qtgamepad"] depends = qtbase recommends = qtdeclarative path = qtgamepad url = ../qtgamepad.git + branch = 5.15 status = addon [submodule "qtscxml"] depends = qtbase qtdeclarative path = qtscxml url = ../qtscxml.git + branch = 5.15 status = addon [submodule "qtspeech"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtspeech url = ../qtspeech.git + branch = 5.15 status = addon [submodule "qtnetworkauth"] depends = qtbase path = qtnetworkauth url = ../qtnetworkauth.git + branch = 5.15 status = addon [submodule "qtremoteobjects"] depends = qtbase recommends = qtdeclarative path = qtremoteobjects url = ../qtremoteobjects.git + branch = 5.15 status = addon [submodule "qtwebglplugin"] depends = qtbase qtwebsockets recommends = qtdeclarative path = qtwebglplugin url = ../qtwebglplugin.git + branch = 5.15 status = addon [submodule "qtlottie"] depends = qtbase qtdeclarative path = qtlottie url = ../qtlottie.git + branch = 5.15 status = addon [submodule "qtquicktimeline"] depends = qtbase qtdeclarative path = qtquicktimeline url = ../qtquicktimeline + branch = 5.15 status = addon [submodule "qtquick3d"] depends = qtbase qtdeclarative path = qtquick3d url = ../qtquick3d.git + branch = 5.15 status = addon diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index dade712c351cb..4291074f66a3b 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,14 +1,10 @@ versions: - "5.15.2": - folder: 5.x.x - "5.15.3": - folder: 5.x.x "5.15.4": folder: 5.x.x "5.15.5": folder: 5.x.x - "6.0.4": - folder: 6.x.x + "5.15.6": + folder: 5.x.x "6.1.3": folder: 6.x.x "6.2.4": From 7a2b1c9ab7d36235435f15ace7dda9b8ecaa710d Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 19 Sep 2022 16:25:13 +0900 Subject: [PATCH 082/561] (#13003) thrift: add version 0.17.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/thrift/all/conandata.yml | 5 +++++ recipes/thrift/config.yml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/recipes/thrift/all/conandata.yml b/recipes/thrift/all/conandata.yml index 59c6e430f7e0f..f6caedc01b3c0 100644 --- a/recipes/thrift/all/conandata.yml +++ b/recipes/thrift/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.17.0": + url: "https://github.com/apache/thrift/archive/v0.17.0.tar.gz" + sha256: "f5888bcd3b8de40c2c2ab86896867ad9b18510deb412cba3e5da76fb4c604c29" "0.16.0": url: "https://github.com/apache/thrift/archive/refs/tags/v0.16.0.tar.gz" sha256: "df2931de646a366c2e5962af679018bca2395d586e00ba82d09c0379f14f8e7b" @@ -15,6 +18,8 @@ sources: url: "https://github.com/apache/thrift/archive/0.13.0.tar.gz" sha256: "8469c8d72c684c6de72ddf55fc65d1c10868a576e7dc4d1f4a21a59814b97110" patches: + "0.17.0": + - patch_file: "patches/cmake-0.16.0.patch" "0.16.0": - patch_file: "patches/cmake-0.16.0.patch" "0.15.0": diff --git a/recipes/thrift/config.yml b/recipes/thrift/config.yml index b2d38c3685f16..66a1ad96af024 100644 --- a/recipes/thrift/config.yml +++ b/recipes/thrift/config.yml @@ -1,4 +1,6 @@ versions: + "0.17.0": + folder: all "0.16.0": folder: all "0.15.0": From 72aa361471906faad5adf5f0882fb039a24b838f Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Mon, 19 Sep 2022 04:46:00 -0300 Subject: [PATCH 083/561] (#13005) update sqlite 3.39.3 --- recipes/sqlite3/all/conandata.yml | 3 +++ recipes/sqlite3/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/sqlite3/all/conandata.yml b/recipes/sqlite3/all/conandata.yml index 9cbaf9de69b55..b98e6fe1c7753 100644 --- a/recipes/sqlite3/all/conandata.yml +++ b/recipes/sqlite3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.39.3": + url: "https://sqlite.org/2022/sqlite-amalgamation-3390300.zip" + sha256: "a89db3030d229d860ae56a8bac50ac9761434047ae886e47e7c8f9f428fa98ad" "3.39.2": url: "https://sqlite.org/2022/sqlite-amalgamation-3390200.zip" sha256: "87775784f8b22d0d0f1d7811870d39feaa7896319c7c20b849a4181c5a50609b" diff --git a/recipes/sqlite3/config.yml b/recipes/sqlite3/config.yml index cc979959bee0e..09c0020237894 100644 --- a/recipes/sqlite3/config.yml +++ b/recipes/sqlite3/config.yml @@ -1,4 +1,6 @@ versions: + "3.39.3": + folder: all "3.39.2": folder: all "3.39.1": From 7b0f5ab43d8687057bb428c77ae2ac1ad79e751b Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Sep 2022 10:24:52 +0200 Subject: [PATCH 084/561] (#12965) [docs] Safer autotools template Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- .../autotools_package/all/conanfile.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 27a85160acde1..8b10c37d53331 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.env import VirtualBuildEnv -from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.build import check_min_cppstd, cross_building from conan.tools.files import copy, get, rm, rmdir, apply_conandata_patches from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps from conan.tools.layout import basic_layout @@ -95,9 +95,14 @@ def generate(self): # generate dependencies for autotools tc = AutotoolsDeps(self) tc.generate() - # inject tools_require env vars in build context - ms = VirtualBuildEnv(self) - ms.generate(scope="build") + # inject tools_requires env vars in build scope (not needed if there is no tool_requires) + env = VirtualBuildEnv(self) + env.generate() + # inject requires env vars in build scope + # it's required in case of native build when there is AutotoolsDeps & at least one dependency which might be shared, because configure tries to run a test executable + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") def build(self): # apply patches listed in conandata.yml From c7a95ad48d7664304b8a7e0ffdf1e025ed65464f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 19 Sep 2022 10:46:01 +0200 Subject: [PATCH 085/561] (#12968) vulkan-validationlayers: add 1.3.224.1 & modernize more for conan v2 * modernize more for conan v2 * add vulkan-validationlayers/1.3.224.1 --- .../vulkan-validationlayers/all/conandata.yml | 3 ++ .../vulkan-validationlayers/all/conanfile.py | 29 +++++++++---------- .../dependencies/dependencies-1.3.224.1.yml | 2 ++ .../all/test_package/CMakeLists.txt | 7 ++--- .../all/test_package/conanfile.py | 19 ++++++++---- .../all/test_v1_package/CMakeLists.txt | 11 +++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++++ recipes/vulkan-validationlayers/config.yml | 2 ++ 8 files changed, 66 insertions(+), 24 deletions(-) create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml create mode 100644 recipes/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vulkan-validationlayers/all/test_v1_package/conanfile.py diff --git a/recipes/vulkan-validationlayers/all/conandata.yml b/recipes/vulkan-validationlayers/all/conandata.yml index 9d695319580e0..4dfdd2518953a 100644 --- a/recipes/vulkan-validationlayers/all/conandata.yml +++ b/recipes/vulkan-validationlayers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.224.1": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.224.1.tar.gz" + sha256: "49c00e0119e3bc11e13c0c740e57c76b582b14f754f3779b85508c4d90d9df85" "1.3.216.0": url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.216.0.tar.gz" sha256: "593d9b818d536490b70322a01b306ec165df5e7a70d770d05014fbd0b325fa15" diff --git a/recipes/vulkan-validationlayers/all/conanfile.py b/recipes/vulkan-validationlayers/all/conanfile.py index 20e4ba3a25e94..67e1dc62d199e 100644 --- a/recipes/vulkan-validationlayers/all/conanfile.py +++ b/recipes/vulkan-validationlayers/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.files import copy, get, replace_in_file, rename, patch, rm, mkdir +from conan.tools.files import apply_conandata_patches, copy, get, mkdir, rename, replace_in_file, rm from conan.tools.scm import Version from conans import CMake import functools @@ -10,7 +10,7 @@ import shutil import yaml -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.51.1" class VulkanValidationLayersConan(ConanFile): @@ -54,12 +54,12 @@ def _dependencies_versions(self): return cached_dependencies def export(self): - self.copy(self._dependencies_filename, src="dependencies", dst="dependencies") + copy(self, f"dependencies/{self._dependencies_filename}", self.recipe_folder, self.export_folder) def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os not in ["Linux", "FreeBSD"]: @@ -96,13 +96,13 @@ def _require(self, recipe_name): return f"{recipe_name}/{self._dependencies_versions[recipe_name]}" def validate(self): - if self.settings.compiler.get_safe("cppstd"): + if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - if self.options["spirv-tools"].shared: + if self.dependencies["spirv-tools"].options.shared: raise ConanInvalidConfiguration("vulkan-validationlayers can't depend on shared spirv-tools") - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": raise ConanInvalidConfiguration("gcc < 5 is not supported") def source(self): @@ -114,8 +114,7 @@ def build(self): cmake.build() def _patch_sources(self): - for data in self.conan_data.get("patches", {}).get(self.version, []): - patch(self, **data) + apply_conandata_patches(self) replace_in_file(self, os.path.join(self._source_subfolder, "cmake", "FindVulkanHeaders.cmake"), "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry", "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry") @@ -142,14 +141,14 @@ def _configure_cmake(self): return cmake def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE.txt", src=os.path.join(self.source_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) cmake = self._configure_cmake() cmake.install() if self.settings.os == "Windows": # import lib is useless, validation layers are loaded at runtime lib_dir = os.path.join(self.package_folder, "lib") - rm(self, lib_dir, "VkLayer_khronos_validation.lib") - rm(self, lib_dir, "libVkLayer_khronos_validation.dll.a") + rm(self, "VkLayer_khronos_validation.lib", lib_dir) + rm(self, "libVkLayer_khronos_validation.dll.a", lib_dir) # move dll and json manifest files in bin folder bin_dir = os.path.join(self.package_folder, "bin") mkdir(self, bin_dir) @@ -166,7 +165,7 @@ def package_info(self): manifest_subfolder = "bin" if self.settings.os == "Windows" else os.path.join("res", "vulkan", "explicit_layer.d") vk_layer_path = os.path.join(self.package_folder, manifest_subfolder) - self.output.info("Prepending to VK_LAYER_PATH runtime environment variable: {}".format(vk_layer_path)) + self.output.info(f"Prepending to VK_LAYER_PATH runtime environment variable: {vk_layer_path}") self.runenv_info.prepend_path("VK_LAYER_PATH", vk_layer_path) # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator self.env_info.VK_LAYER_PATH.append(vk_layer_path) diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml new file mode 100644 index 0000000000000..17115c7cd5750 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.224.1.yml @@ -0,0 +1,2 @@ +spirv-tools: "1.3.224.0" +vulkan-headers: "1.3.224.0" diff --git a/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt b/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt index d79aaa901551f..29405b4177fbe 100644 --- a/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt +++ b/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(vulkan-validationlayers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE vulkan-validationlayers::vulkan-validationlayers) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vulkan-validationlayers/all/test_package/conanfile.py b/recipes/vulkan-validationlayers/all/test_package/conanfile.py index 5c09494bc67c0..0a6bc68712d90 100644 --- a/recipes/vulkan-validationlayers/all/test_package/conanfile.py +++ b/recipes/vulkan-validationlayers/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt b/recipes/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..1960fb72b8cf4 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(vulkan-validationlayers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vulkan-validationlayers::vulkan-validationlayers) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vulkan-validationlayers/all/test_v1_package/conanfile.py b/recipes/vulkan-validationlayers/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/vulkan-validationlayers/config.yml b/recipes/vulkan-validationlayers/config.yml index 0e539bdcf5f56..b3ac3789c4b5f 100644 --- a/recipes/vulkan-validationlayers/config.yml +++ b/recipes/vulkan-validationlayers/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.224.1": + folder: all "1.3.216.0": folder: all "1.3.211.0": From 17c3d2e407827a308cddb66368ab0a853969a6de Mon Sep 17 00:00:00 2001 From: Roberto Rossini <71787608+robomics@users.noreply.github.com> Date: Mon, 19 Sep 2022 12:45:48 +0200 Subject: [PATCH 086/561] (#12986) biflags: new recipe * Contribute bitflags recipe * Constrain supported compilers * Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Fix typo Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/bitflags/all/conandata.yml | 4 ++ recipes/bitflags/all/conanfile.py | 59 +++++++++++++++++++ .../bitflags/all/test_package/CMakeLists.txt | 8 +++ .../bitflags/all/test_package/conanfile.py | 27 +++++++++ .../all/test_package/test_package.cpp | 27 +++++++++ .../all/test_v1_package/CMakeLists.txt | 11 ++++ .../bitflags/all/test_v1_package/conanfile.py | 17 ++++++ recipes/bitflags/config.yml | 3 + 8 files changed, 156 insertions(+) create mode 100644 recipes/bitflags/all/conandata.yml create mode 100644 recipes/bitflags/all/conanfile.py create mode 100644 recipes/bitflags/all/test_package/CMakeLists.txt create mode 100644 recipes/bitflags/all/test_package/conanfile.py create mode 100644 recipes/bitflags/all/test_package/test_package.cpp create mode 100644 recipes/bitflags/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bitflags/all/test_v1_package/conanfile.py create mode 100644 recipes/bitflags/config.yml diff --git a/recipes/bitflags/all/conandata.yml b/recipes/bitflags/all/conandata.yml new file mode 100644 index 0000000000000..2abe2034e3c41 --- /dev/null +++ b/recipes/bitflags/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.5.0": + url: "https://github.com/m-peko/bitflags/archive/refs/tags/v1.5.0.tar.gz" + sha256: 1ea19e03e05e8e78faf0126a1a100e591467828bc816224e9cda330b104e69b5 diff --git a/recipes/bitflags/all/conanfile.py b/recipes/bitflags/all/conanfile.py new file mode 100644 index 0000000000000..c9f1d462a3694 --- /dev/null +++ b/recipes/bitflags/all/conanfile.py @@ -0,0 +1,59 @@ +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.50.0" + + +class BitFlags(ConanFile): + name = "bitflags" + description = "Single-header header-only C++11 / C++14 / C++17 library for easily managing set of auto-generated type-safe flags" + topics = ("bits", "bitflags", "header-only") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/m-peko/bitflags" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_compilers_version(self): + return {"apple-clang": "5", "clang": "5", "gcc": "7", "Visual Studio": "14"} + + @property + def _minimum_cpp_standard(self): + return 11 + + def layout(self): + basic_layout(self) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + try: + if Version(self.settings.compiler.version) < self._minimum_compilers_version[str(self.settings.compiler)]: + raise ConanInvalidConfiguration(f"{self.ref} requires a compiler that supports C++{self._minimum_cpp_standard}.") + except KeyError: + self.output.warn("Unknown compiler encountered. Assuming it supports C++11.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, + destination=self.source_folder) + + def package(self): + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "bitflags") + self.cpp_info.set_property("cmake_target_name", "bitflags::bitflags") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/bitflags/all/test_package/CMakeLists.txt b/recipes/bitflags/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..51b69634fef26 --- /dev/null +++ b/recipes/bitflags/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(bitflags REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bitflags::bitflags) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bitflags/all/test_package/conanfile.py b/recipes/bitflags/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e506c322ce801 --- /dev/null +++ b/recipes/bitflags/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +required_conan_version = ">=1.50.0" + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/bitflags/all/test_package/test_package.cpp b/recipes/bitflags/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..91a9730c23c5a --- /dev/null +++ b/recipes/bitflags/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include "bitflags/bitflags.hpp" +#include +#include + +BEGIN_BITFLAGS(Flags) +FLAG(none) +FLAG(flag_a) +FLAG(flag_b) +FLAG(flag_c) +END_BITFLAGS(Flags) + +DEFINE_FLAG(Flags, none) +DEFINE_FLAG(Flags, flag_a) +DEFINE_FLAG(Flags, flag_b) +DEFINE_FLAG(Flags, flag_c) + +int main() { + std::cout << +Flags::none.bits << " - " << Flags::none.name << '\n'; + std::cout << +Flags::flag_a.bits << " - " << Flags::flag_a.name << '\n'; + std::cout << +Flags::flag_b.bits << " - " << Flags::flag_b.name << '\n'; + std::cout << +Flags::flag_c.bits << " - " << Flags::flag_c.name << '\n'; + + const auto flags = Flags::flag_a | Flags::flag_b; + + assert(flags & Flags::flag_a); + assert(!(flags & Flags::flag_c)); +} diff --git a/recipes/bitflags/all/test_v1_package/CMakeLists.txt b/recipes/bitflags/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..789568c184c15 --- /dev/null +++ b/recipes/bitflags/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(bitflags REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bitflags::bitflags) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bitflags/all/test_v1_package/conanfile.py b/recipes/bitflags/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/bitflags/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/bitflags/config.yml b/recipes/bitflags/config.yml new file mode 100644 index 0000000000000..16b5c7979d806 --- /dev/null +++ b/recipes/bitflags/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5.0": + folder: "all" From fd58bf6ae4802694dc9162502fabf468e27dcfff Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Mon, 19 Sep 2022 13:07:44 +0200 Subject: [PATCH 087/561] (#12996) glib: add version 2.74.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/glib/all/conandata.yml | 3 +++ recipes/glib/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml index 60927f8873709..0cfaa0cfe4e33 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -26,6 +26,9 @@ sources: "2.73.3": url: "https://download.gnome.org/sources/glib/2.73/glib-2.73.3.tar.xz" sha256: "df1a2b841667d6b48b2ef6969ebda4328243829f6e45866726f806f90f64eead" + "2.74.0": + url: "https://download.gnome.org/sources/glib/2.74/glib-2.74.0.tar.xz" + sha256: "3652c7f072d7b031a6b5edd623f77ebc5dcd2ae698598abcc89ff39ca75add30" patches: "2.73.1": - patch_file: "patches/f2ea67ae441bc6059b43a1051dd0b750fe5f6301.patch" diff --git a/recipes/glib/config.yml b/recipes/glib/config.yml index da93311de5e9b..382622725e923 100644 --- a/recipes/glib/config.yml +++ b/recipes/glib/config.yml @@ -17,3 +17,5 @@ versions: folder: all "2.73.3": folder: all + "2.74.0": + folder: all From af84dab96b8ab3facdc77e25524cc08ac7871ed9 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:25:46 +0200 Subject: [PATCH 088/561] (#12952) wayland: fix native build when dependencies of wayland-scanner are shared * fix native build when dependencies of wayland-scanner are shared * bump meson * fix indentation * cleanup package_info() - remove duplicated self.env_info.PATH - names["pkg_config"] not needed when set_property("pkg_config_name") defined - no need to add bindirs to PATH in buildenv_info & runenv_info --- recipes/wayland/all/conanfile.py | 39 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index 69131d15a7f3b..1c3a49c45bdba 100644 --- a/recipes/wayland/all/conanfile.py +++ b/recipes/wayland/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import copy, get, replace_in_file, rmdir from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain @@ -35,19 +36,19 @@ class WaylandConan(ConanFile): "enable_dtd_validation": True, } - generators = "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" + generators = "PkgConfigDeps" def configure(self): if self.options.shared: del self.options.fPIC try: - del self.settings.compiler.libcxx + del self.settings.compiler.libcxx except Exception: - pass + pass try: - del self.settings.compiler.cppstd + del self.settings.compiler.cppstd except Exception: - pass + pass def requirements(self): if self.options.enable_libraries: @@ -61,7 +62,7 @@ def validate(self): raise ConanInvalidConfiguration("Wayland can be built on Linux only") def build_requirements(self): - self.tool_requires("meson/0.63.1") + self.tool_requires("meson/0.63.2") self.tool_requires("pkgconf/1.7.4") if cross_building(self): self.tool_requires(self.ref) @@ -83,6 +84,12 @@ def generate(self): tc.project_options["scanner"] = True tc.generate() + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('tests')", "#subdir('tests')") @@ -110,13 +117,10 @@ def package(self): def package_info(self): self.cpp_info.components["wayland-scanner"].set_property("pkg_config_name", "wayland-scanner") - self.cpp_info.components["wayland-scanner"].names["pkg_config"] = "wayland-scanner" self.cpp_info.components["wayland-scanner"].resdirs = ["res"] - self.cpp_info.components["wayland-scanner"].includedirs = [] self.cpp_info.components["wayland-scanner"].libdirs = [] self.cpp_info.components["wayland-scanner"].set_property("component_version", self.version) - self.cpp_info.components["wayland-scanner"].requires = ["expat::expat"] if self.options.enable_dtd_validation: self.cpp_info.components["wayland-scanner"].requires.append("libxml2::libxml2") @@ -130,24 +134,15 @@ def package_info(self): "pkg_config_custom_content", "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items())) - bindir = os.path.join(self.package_folder, "bin") - self.buildenv_info.prepend_path("PATH", bindir) - self.runenv_info.prepend_path("PATH", bindir) - # TODO: Remove in Conan 2.0 where Environment class will be required. - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) - if self.options.enable_libraries: self.cpp_info.components["wayland-server"].libs = ["wayland-server"] self.cpp_info.components["wayland-server"].set_property("pkg_config_name", "wayland-server") - self.cpp_info.components["wayland-server"].names["pkg_config"] = "wayland-server" self.cpp_info.components["wayland-server"].requires = ["libffi::libffi"] self.cpp_info.components["wayland-server"].system_libs = ["pthread", "m"] self.cpp_info.components["wayland-server"].resdirs = ["res"] if self.version >= Version("1.21.0") and self.settings.os == "Linux": self.cpp_info.components["wayland-server"].system_libs += ["rt"] self.cpp_info.components["wayland-server"].set_property("component_version", self.version) - pkgconfig_variables = { 'datarootdir': '${prefix}/res', 'pkgdatadir': '${datarootdir}/wayland', @@ -158,14 +153,12 @@ def package_info(self): self.cpp_info.components["wayland-client"].libs = ["wayland-client"] self.cpp_info.components["wayland-client"].set_property("pkg_config_name", "wayland-client") - self.cpp_info.components["wayland-client"].names["pkg_config"] = "wayland-client" self.cpp_info.components["wayland-client"].requires = ["libffi::libffi"] self.cpp_info.components["wayland-client"].system_libs = ["pthread", "m"] self.cpp_info.components["wayland-client"].resdirs = ["res"] if self.version >= Version("1.21.0") and self.settings.os == "Linux": self.cpp_info.components["wayland-client"].system_libs += ["rt"] self.cpp_info.components["wayland-client"].set_property("component_version", self.version) - pkgconfig_variables = { 'datarootdir': '${prefix}/res', 'pkgdatadir': '${datarootdir}/wayland', @@ -176,20 +169,18 @@ def package_info(self): self.cpp_info.components["wayland-cursor"].libs = ["wayland-cursor"] self.cpp_info.components["wayland-cursor"].set_property("pkg_config_name", "wayland-cursor") - self.cpp_info.components["wayland-cursor"].names["pkg_config"] = "wayland-cursor" self.cpp_info.components["wayland-cursor"].requires = ["wayland-client"] self.cpp_info.components["wayland-cursor"].set_property("component_version", self.version) self.cpp_info.components["wayland-egl"].libs = ["wayland-egl"] self.cpp_info.components["wayland-egl"].set_property("pkg_config_name", "wayland-egl") - self.cpp_info.components["wayland-egl"].names["pkg_config"] = "wayland-egl" self.cpp_info.components["wayland-egl"].requires = ["wayland-client"] self.cpp_info.components["wayland-egl"].set_property("component_version", "18.1.0") - self.cpp_info.components["wayland-egl-backend"].names["pkg_config"] = "wayland-egl-backend" self.cpp_info.components["wayland-egl-backend"].set_property("pkg_config_name", "wayland-egl-backend") self.cpp_info.components["wayland-egl-backend"].set_property("component_version", "3") + # TODO: to remove in conan v2 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) From 908b578ad32f682ed176a82fc0114e000c0940bc Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Sep 2022 14:26:32 +0200 Subject: [PATCH 089/561] (#13014) [docs] Fix leftover dot for cache_variables Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- docs/package_templates/cmake_package/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index 3dbd29bb835eb..75c5ac1382322 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -100,7 +100,7 @@ def generate(self): tc.cache_variables["PACKAGE_CUSTOM_DEFINITION"] = True if is_msvc(self): # don't use self.settings.compiler.runtime - tc.cache_variables.["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.cache_variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) # deps_cpp_info, deps_env_info and deps_user_info are no longer used if self.dependencies["dependency"].options.foobar: tc.cache_variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs From ce5ae1fca9b5e3a5616f4a67129a46c4bb2e676c Mon Sep 17 00:00:00 2001 From: Eric Pederson Date: Mon, 19 Sep 2022 09:05:03 -0400 Subject: [PATCH 090/561] (#12215) [librdkafka] Adds code to test package to test rdkafka++ library. * Fixes #12213. Adds code to test package to test rdkafka++ library. * Split C and C++ tests into two separate executables * Rename test_package.cpp to test_package.c and use stdio/printf. --- recipes/librdkafka/all/test_package/CMakeLists.txt | 9 ++++++--- recipes/librdkafka/all/test_package/conanfile.py | 2 ++ recipes/librdkafka/all/test_package/test_package.c | 12 ++++++++++++ recipes/librdkafka/all/test_package/test_package.cpp | 7 ++++--- .../librdkafka/all/test_v1_package/CMakeLists.txt | 9 ++++++--- recipes/librdkafka/all/test_v1_package/conanfile.py | 2 ++ 6 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 recipes/librdkafka/all/test_package/test_package.c diff --git a/recipes/librdkafka/all/test_package/CMakeLists.txt b/recipes/librdkafka/all/test_package/CMakeLists.txt index b30e0e118dc1d..636b897b6b9d6 100644 --- a/recipes/librdkafka/all/test_package/CMakeLists.txt +++ b/recipes/librdkafka/all/test_package/CMakeLists.txt @@ -1,7 +1,10 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package LANGUAGES C CXX) find_package(RdKafka REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE RdKafka::rdkafka++) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE RdKafka::rdkafka) + +add_executable(${PROJECT_NAME}_cpp test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cpp PRIVATE RdKafka::rdkafka++) diff --git a/recipes/librdkafka/all/test_package/conanfile.py b/recipes/librdkafka/all/test_package/conanfile.py index 3a8c6c5442b33..89e04c98c851d 100644 --- a/recipes/librdkafka/all/test_package/conanfile.py +++ b/recipes/librdkafka/all/test_package/conanfile.py @@ -23,3 +23,5 @@ def test(self): if not cross_building(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/recipes/librdkafka/all/test_package/test_package.c b/recipes/librdkafka/all/test_package/test_package.c new file mode 100644 index 0000000000000..9670aa9ff8583 --- /dev/null +++ b/recipes/librdkafka/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char const *argv[]) { + rd_kafka_conf_t *conf = rd_kafka_conf_new(); + + printf("\n"); + printf("----------------->Tests are done.<---------------------\n"); + printf("Using version (from C lib) %s\n", rd_kafka_version_str()); + printf("///////////////////////////////////////////////////////\n"); + return 0; +} diff --git a/recipes/librdkafka/all/test_package/test_package.cpp b/recipes/librdkafka/all/test_package/test_package.cpp index 2b68c0545be73..d1ea0762857ed 100644 --- a/recipes/librdkafka/all/test_package/test_package.cpp +++ b/recipes/librdkafka/all/test_package/test_package.cpp @@ -1,11 +1,12 @@ #include -#include +#include int main(int argc, char const *argv[]) { - rd_kafka_conf_t *conf = rd_kafka_conf_new(); + RdKafka::Conf* confpp = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); + std::cout << std::endl << "----------------->Tests are done.<---------------------" << std::endl - << "Using version " << rd_kafka_version_str() << std::endl + << "Using version (from C++ lib) " << RdKafka::version() << std::endl << "///////////////////////////////////////////////////////" << std::endl; return 0; } diff --git a/recipes/librdkafka/all/test_v1_package/CMakeLists.txt b/recipes/librdkafka/all/test_v1_package/CMakeLists.txt index 2a519eb83b67b..c3a5ab849b099 100644 --- a/recipes/librdkafka/all/test_v1_package/CMakeLists.txt +++ b/recipes/librdkafka/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,13 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package LANGUAGES C CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) find_package(RdKafka REQUIRED CONFIG) -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE RdKafka::rdkafka++) +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE RdKafka::rdkafka) + +add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cpp PRIVATE RdKafka::rdkafka++) diff --git a/recipes/librdkafka/all/test_v1_package/conanfile.py b/recipes/librdkafka/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..b9d27e1331419 100644 --- a/recipes/librdkafka/all/test_v1_package/conanfile.py +++ b/recipes/librdkafka/all/test_v1_package/conanfile.py @@ -16,3 +16,5 @@ def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) From d3bfd955cf63309d43ad8404c688404e7ad9b687 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 20 Sep 2022 00:26:33 +0900 Subject: [PATCH 091/561] (#13009) implot: add version 0.14 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/implot/all/conandata.yml | 3 +++ recipes/implot/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/implot/all/conandata.yml b/recipes/implot/all/conandata.yml index 34e2b204e07d9..21af4dfe87312 100644 --- a/recipes/implot/all/conandata.yml +++ b/recipes/implot/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.14": + url: "https://github.com/epezent/implot/archive/v0.14.tar.gz" + sha256: "1613af3e6554c0a74de20c6e60e9bce5ce35c2d4f9e1aa5ff963f7fe2d48af88" "0.13": url: "https://github.com/epezent/implot/archive/v0.13.tar.gz" sha256: "acc8b012b6761c9b7ce1599a35fd861ac6dafb01368b1e938c90a3f654bd7589" diff --git a/recipes/implot/config.yml b/recipes/implot/config.yml index 7c7562b414e8f..d62abd0d999a8 100644 --- a/recipes/implot/config.yml +++ b/recipes/implot/config.yml @@ -1,4 +1,6 @@ versions: + "0.14": + folder: "all" "0.13": folder: "all" "0.12": From 1b7da898729587ad723ebe49e601941c7963816f Mon Sep 17 00:00:00 2001 From: Esteban Dugueperoux <43169544+EstebanDugueperoux2@users.noreply.github.com> Date: Mon, 19 Sep 2022 17:44:34 +0200 Subject: [PATCH 092/561] (#12845) qwt: Use Cmake instead of qmake --- recipes/qwt/all/conandata.yml | 8 +- recipes/qwt/all/conanfile.py | 152 +- .../qwt/all/patches/cmake-support-patch.patch | 32 + recipes/qwt/all/patches/cmake-support.patch | 1439 +++++++++++++++++ recipes/qwt/all/test_package/CMakeLists.txt | 2 + recipes/qwt/all/test_package/conanfile.py | 10 +- recipes/qwt/config.yml | 2 - 7 files changed, 1570 insertions(+), 75 deletions(-) create mode 100644 recipes/qwt/all/patches/cmake-support-patch.patch create mode 100644 recipes/qwt/all/patches/cmake-support.patch diff --git a/recipes/qwt/all/conandata.yml b/recipes/qwt/all/conandata.yml index 634726952e06e..31f56157576c0 100644 --- a/recipes/qwt/all/conandata.yml +++ b/recipes/qwt/all/conandata.yml @@ -1,7 +1,9 @@ sources: - "6.1.6": - url: "https://sourceforge.net/projects/qwt/files/qwt/6.1.6/qwt-6.1.6.zip" - sha256: "4b2452662ae64656aca92f1bef44a281229f77056689100af62c4b9f24462873" "6.2.0": url: "https://sourceforge.net/projects/qwt/files/qwt/6.2.0/qwt-6.2.0.zip" sha256: "3e9632a9be6a883db5c496e42ce74cbbf8da02cc3328faa89e2c43e434a2eb76" +patches: + "6.2.0": + - patch_file: "patches/cmake-support.patch" + patch_source: "https://github.com/MehdiChinoune/qwt/blob/cmake/CMakeLists.txt" + - patch_file: "patches/cmake-support-patch.patch" diff --git a/recipes/qwt/all/conanfile.py b/recipes/qwt/all/conanfile.py index 0160ac03050f1..2bdc49e66ab3a 100644 --- a/recipes/qwt/all/conanfile.py +++ b/recipes/qwt/all/conanfile.py @@ -1,7 +1,11 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.build import cross_building +from conan.errors import ConanInvalidConfiguration import os -from conans import ConanFile, tools -required_conan_version = ">=1.40.1" # For https://github.com/conan-io/conan/pull/9568 +required_conan_version = ">=1.50" class QwtConan(ConanFile): name = "qwt" @@ -22,29 +26,50 @@ class QwtConan(ConanFile): "widgets": [True, False], "svg": [True, False], "opengl": [True, False], - "mathml": [True, False], - "designer": [True, False] + "designer": [True, False], + "polar": [True, False], + "playground": [True, False], + "examples": [True, False], + "test": [True, False], } default_options = { "shared": False, "fPIC": True, "plot": True, "widgets": True, + "svg": False, "opengl": True, - "designer": True, - "mathml": False, - "svg": False - + "designer": False, + "polar": True, + "playground": False, + "examples": False, + "test": False } - generators = "qmake" - @property - def _source_subfolder(self): - return "source_subfolder" - + tool_requires = ( + "cmake/3.23.2", + "ninja/1.11.0" + ) + + def _patch_sources(self): + apply_conandata_patches(self) + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + + def requirements(self): + self.requires("qt/5.15.5") + def build_requirements(self): if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio": self.build_requires("jom/1.1.3") + self.tool_requires("qt/5.15.5") + + def validate(self): + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Qwt recipe does not support cross-compilation yet") def config_options(self): if self.settings.os == "Windows": @@ -54,67 +79,62 @@ def configure(self): if self.options.shared: del self.options.fPIC - def requirements(self): - self.requires("qt/5.15.2") - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def _patch_qwt_config_files(self): - # qwtconfig.pri - qwtconfig_path = os.path.join(self.source_folder, self._source_subfolder, "qwtconfig.pri") - qwtconfig = tools.load(qwtconfig_path) - - qwtconfig = "CONFIG += conan_basic_setup\ninclude(../conanbuildinfo.pri)\n" + qwtconfig - qwtconfig += "QWT_CONFIG {}= QwtDll\n".format("+" if self.options.shared else "-") - qwtconfig += "QWT_CONFIG {}= QwtPlot\n".format("+" if self.options.plot else "-") - qwtconfig += "QWT_CONFIG {}= QwtWidgets\n".format("+" if self.options.widgets else "-") - qwtconfig += "QWT_CONFIG {}= QwtSvg\n".format("+" if self.options.svg else "-") - qwtconfig += "QWT_CONFIG {}= QwtOpenGL\n".format("+" if self.options.opengl else "-") - qwtconfig += "QWT_CONFIG {}= QwtMathML\n".format("+" if self.options.mathml else "-") - qwtconfig += "QWT_CONFIG {}= QwtDesigner\n".format("+" if self.options.designer else "-") - tools.save(qwtconfig_path, qwtconfig) - - # qwtbuild.pri - qwtbuild_path = os.path.join(self.source_folder, self._source_subfolder, "qwtbuild.pri") - qwtbuild = tools.load(qwtbuild_path) - # set build type - qwtbuild += "CONFIG -= debug_and_release\n" - qwtbuild += "CONFIG -= build_all\n" - qwtbuild += "CONFIG -= release\n" - qwtbuild += "CONFIG += {}\n".format("debug" if self.settings.build_type == "Debug" else "release") - if self.settings.build_type == "RelWithDebInfo": - qwtbuild += "CONFIG += force_debug_info\n" - tools.save(qwtbuild_path, qwtbuild) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self, generator="Ninja") + + tc.variables["QWT_DLL"] = "ON" if self.options.shared else "OFF" + tc.variables["QWT_STATIC "] = "ON" if not self.options.shared else "OFF" + tc.variables["QWT_PLOT"] = "ON" if self.options.plot else "OFF" + tc.variables["QWT_WIDGETS"] = "ON" if self.options.widgets else "OFF" + tc.variables["QWT_SVG"] = "ON" if self.options.svg else "OFF" + tc.variables["QWT_OPENGL"] = "ON" if self.options.opengl else "OFF" + tc.variables["QWT_DESIGNER"] = "ON" if self.options.designer else "OFF" + tc.variables["QWT_POLAR"] = "ON" if self.options.polar else "OFF" + tc.variables["QWT_BUILD_PLAYGROUND"] = "ON" if self.options.playground else "OFF" + tc.variables["QWT_BUILD_EXAMPLES"] = "ON" if self.options.examples else "OFF" + tc.variables["QWT_BUILD_TESTS"] = "ON" if self.options.test else "OFF" + tc.variables["QWT_FRAMEWORK"] = "OFF" + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - self._patch_qwt_config_files() + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() - if self.settings.compiler == "Visual Studio": - vcvars = tools.vcvars_command(self.settings) - self.run("{} && qmake {}".format(vcvars, self._source_subfolder), run_environment=True) - self.run("{} && jom".format(vcvars)) - else: - self.run("qmake {}".format(self._source_subfolder), run_environment=True) - self.run("make -j {}".format(tools.cpu_count())) + if self.options.test: + cmake.test() def package(self): - self.copy("COPYING", src=os.path.join(self._source_subfolder), dst="licenses") - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "src")) - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.lib", dst="lib", keep_path=False) - self.copy("*.so*", dst="lib", keep_path=False, symlinks=True) - self.copy("*.dylib", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) + cmake = CMake(self) + cmake.install() + rmdir(self, f"{self.package_folder}/lib/pkgconfig") + rmdir(self, f"{self.package_folder}/lib/cmake") + self.copy("COPYING", src=self.folders.source, dst="licenses") def package_info(self): - postfix = "" - if self.settings.build_type == "Debug": - if self.settings.os == "Windows": - postfix += "d" - elif self.settings.os == "Macos": - postfix += "_debug" - self.cpp_info.libs = ["qwt" + postfix] + self.cpp_info.libs = ["qwt"] self.env_info.QT_PLUGIN_PATH.append(os.path.join(self.package_folder, 'bin')) self.env_info.QT_PLUGIN_PATH.append(os.path.join(self.package_folder, 'lib')) self.cpp_info.defines = ['HAVE_QWT', 'QWT_DLL'] if self.options.shared else ['HAVE_QWT'] + if not self.options.plot: + self.cpp_info.defines.append("NO_QWT_PLOT") + if not self.options.polar: + self.cpp_info.defines.append("NO_QWT_POLAR") + if not self.options.widgets: + self.cpp_info.defines.append("NO_QWT_WIDGETS") + if not self.options.opengl: + self.cpp_info.defines.append("NO_QWT_OPENGL") + if not self.options.svg: + self.cpp_info.defines.append("QWT_NO_SVG") + diff --git a/recipes/qwt/all/patches/cmake-support-patch.patch b/recipes/qwt/all/patches/cmake-support-patch.patch new file mode 100644 index 0000000000000..af0f2ec3e1b37 --- /dev/null +++ b/recipes/qwt/all/patches/cmake-support-patch.patch @@ -0,0 +1,32 @@ +From fb0e2add3354cdf39dee7b58e6f6c88aba5d6793 Mon Sep 17 00:00:00 2001 +From: Esteban Dugueperoux + <43169544+EstebanDugueperoux2@users.noreply.github.com> +Date: Thu, 8 Sep 2022 11:10:47 +0000 +Subject: [PATCH] conan: Remove qwt include prefix + + - Remove qwt include prefix to be + compatible with current consumption + of 6.2.0 release through conan center. +--- + src/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a6a4bf2..760f84c 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -419,10 +419,10 @@ install(FILES + ) + + install(FILES ${HEADERS} +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qwt${QWT_NAME_SUFFIX} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${QWT_NAME_SUFFIX} + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/classincludes/ +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qwt${QWT_NAME_SUFFIX} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${QWT_NAME_SUFFIX} + PATTERN "classincludes.pro" EXCLUDE + ) + +-- +2.37.2 diff --git a/recipes/qwt/all/patches/cmake-support.patch b/recipes/qwt/all/patches/cmake-support.patch new file mode 100644 index 0000000000000..95e211d18a828 --- /dev/null +++ b/recipes/qwt/all/patches/cmake-support.patch @@ -0,0 +1,1439 @@ +From eeda942e335afb509f297a1778b654e34d5e4c2b Mon Sep 17 00:00:00 2001 +From: Mehdi Chinoune +Date: Sun, 22 Aug 2021 16:14:37 +0100 +Subject: [PATCH] Support CMake buildsystem + +--- + CMakeLists.txt | 127 +++++++ + designer/CMakeLists.txt | 35 ++ + examples/CMakeLists.txt | 41 +++ + examples/animation/CMakeLists.txt | 8 + + examples/barchart/CMakeLists.txt | 8 + + examples/bode/CMakeLists.txt | 11 + + examples/controls/CMakeLists.txt | 22 ++ + examples/cpuplot/CMakeLists.txt | 12 + + examples/curvedemo/CMakeLists.txt | 4 + + examples/dials/CMakeLists.txt | 14 + + examples/distrowatch/CMakeLists.txt | 8 + + examples/friedberg/CMakeLists.txt | 10 + + examples/itemeditor/CMakeLists.txt | 12 + + examples/legends/CMakeLists.txt | 13 + + examples/oscilloscope/CMakeLists.txt | 18 + + examples/polardemo/CMakeLists.txt | 13 + + examples/polarspectrogram/CMakeLists.txt | 10 + + examples/radio/CMakeLists.txt | 10 + + examples/rasterview/CMakeLists.txt | 8 + + examples/realtime/CMakeLists.txt | 16 + + examples/refreshtest/CMakeLists.txt | 15 + + examples/scatterplot/CMakeLists.txt | 8 + + examples/simpleplot/CMakeLists.txt | 4 + + examples/sinusplot/CMakeLists.txt | 4 + + examples/spectrogram/CMakeLists.txt | 8 + + examples/splineeditor/CMakeLists.txt | 12 + + examples/stockchart/CMakeLists.txt | 14 + + examples/sysinfo/CMakeLists.txt | 4 + + examples/tvplot/CMakeLists.txt | 8 + + playground/CMakeLists.txt | 19 + + playground/curvetracker/CMakeLists.txt | 10 + + playground/graphicscale/CMakeLists.txt | 10 + + playground/plotmatrix/CMakeLists.txt | 8 + + playground/rescaler/CMakeLists.txt | 10 + + playground/scaleengine/CMakeLists.txt | 12 + + playground/shapes/CMakeLists.txt | 4 + + playground/svgmap/CMakeLists.txt | 9 + + playground/symbols/CMakeLists.txt | 4 + + playground/timescale/CMakeLists.txt | 13 + + playground/vectorfield/CMakeLists.txt | 4 + + src/CMakeLists.txt | 439 +++++++++++++++++++++++ + src/qwt-config.cmake.in | 17 + + src/qwt.pc.in | 12 + + tests/CMakeLists.txt | 4 + + tests/splineprof/CMakeLists.txt | 4 + + tests/splinetest/CMakeLists.txt | 4 + + 46 files changed, 1060 insertions(+) + create mode 100644 CMakeLists.txt + create mode 100644 designer/CMakeLists.txt + create mode 100644 examples/CMakeLists.txt + create mode 100644 examples/animation/CMakeLists.txt + create mode 100644 examples/barchart/CMakeLists.txt + create mode 100644 examples/bode/CMakeLists.txt + create mode 100644 examples/controls/CMakeLists.txt + create mode 100644 examples/cpuplot/CMakeLists.txt + create mode 100644 examples/curvedemo/CMakeLists.txt + create mode 100644 examples/dials/CMakeLists.txt + create mode 100644 examples/distrowatch/CMakeLists.txt + create mode 100644 examples/friedberg/CMakeLists.txt + create mode 100644 examples/itemeditor/CMakeLists.txt + create mode 100644 examples/legends/CMakeLists.txt + create mode 100644 examples/oscilloscope/CMakeLists.txt + create mode 100644 examples/polardemo/CMakeLists.txt + create mode 100644 examples/polarspectrogram/CMakeLists.txt + create mode 100644 examples/radio/CMakeLists.txt + create mode 100644 examples/rasterview/CMakeLists.txt + create mode 100644 examples/realtime/CMakeLists.txt + create mode 100644 examples/refreshtest/CMakeLists.txt + create mode 100644 examples/scatterplot/CMakeLists.txt + create mode 100644 examples/simpleplot/CMakeLists.txt + create mode 100644 examples/sinusplot/CMakeLists.txt + create mode 100644 examples/spectrogram/CMakeLists.txt + create mode 100644 examples/splineeditor/CMakeLists.txt + create mode 100644 examples/stockchart/CMakeLists.txt + create mode 100644 examples/sysinfo/CMakeLists.txt + create mode 100644 examples/tvplot/CMakeLists.txt + create mode 100644 playground/CMakeLists.txt + create mode 100644 playground/curvetracker/CMakeLists.txt + create mode 100644 playground/graphicscale/CMakeLists.txt + create mode 100644 playground/plotmatrix/CMakeLists.txt + create mode 100644 playground/rescaler/CMakeLists.txt + create mode 100644 playground/scaleengine/CMakeLists.txt + create mode 100644 playground/shapes/CMakeLists.txt + create mode 100644 playground/svgmap/CMakeLists.txt + create mode 100644 playground/symbols/CMakeLists.txt + create mode 100644 playground/timescale/CMakeLists.txt + create mode 100644 playground/vectorfield/CMakeLists.txt + create mode 100644 src/CMakeLists.txt + create mode 100644 src/qwt-config.cmake.in + create mode 100644 src/qwt.pc.in + create mode 100644 tests/CMakeLists.txt + create mode 100644 tests/splineprof/CMakeLists.txt + create mode 100644 tests/splinetest/CMakeLists.txt + +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..004d4a3 +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,127 @@ ++cmake_minimum_required(VERSION 3.16) ++ ++project(Qwt ++ VERSION 6.2.0 ++ DESCRIPTION "Qt Widgets for Technical Applications" ++ HOMEPAGE_URL "https://qwt.sourceforge.io" ++ LANGUAGES CXX ++) ++ ++set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD_REQUIRED TRUE) ++set(CMAKE_CXX_EXTENSIONS OFF) ++ ++if(MSVC) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /permissive-") ++else() ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wcast-qual \ ++ -Wcast-align -Wredundant-decls -Wformat -Wshadow -Woverloaded-virtual \ ++ -fno-math-errno -funsafe-math-optimizations") ++ if(CMAKE_COMPILER_ID STREQUAL "GNU") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlogical-op") ++ endif() ++ add_compile_definitions(QT_STRICT_ITERATORS) ++endif() ++ ++include(CheckPIESupported) ++check_pie_supported(OUTPUT_VARIABLE PIE_MESSAGE LANGUAGES CXX) ++if(CMAKE_CXX_LINK_PIE_SUPPORTED) ++ set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) ++endif() ++ ++include(GNUInstallDirs) ++ ++set(QWT_NAME_SUFFIX "" CACHE STRING "Qwt Name Suffix") ++ ++set(QWT_QT_VERSION_MAJOR "A" CACHE ++ STRING "Expected Qt major version. Valid values are A (auto-select), 5, 6.") ++set(SUPPORTED_QT_VERSIONS "A" 5 6) ++set_property(CACHE QWT_QT_VERSION_MAJOR PROPERTY STRINGS ${SUPPORTED_QT_VERSIONS}) ++if(NOT QWT_QT_VERSION_MAJOR STREQUAL "A") ++ if(NOT QWT_QT_VERSION_MAJOR IN_LIST SUPPORTED_QT_VERSIONS) ++ message(FATAL_ERROR "Supported Qt versions are \"${SUPPORTED_QT_VERSIONS}\"." ++ " But QWT_QT_VERSION_MAJOR is set to ${QWT_QT_VERSION_MAJOR}.") ++ endif() ++endif() ++ ++option(QWT_DLL "Build shared library" ON) ++ ++option(QWT_STATIC "Build static library" OFF) ++ ++if(NOT (QWT_DLL OR QWT_STATIC)) ++ message(FATAL_ERROR "QWT_DLL and QWT_STATIC are both set to OFF") ++endif() ++ ++option(QWT_PLOT "Enable QwtPlot widget" ON) ++ ++option(QWT_POLAR "Enable QwtPolar classes" ON) ++ ++option(QWT_WIDGETS "Enables other widgets (sliders, dials, ...), beside QwtPlot" ON) ++ ++option(QWT_SVG "Enable SVG Support (Displaying & Exporting)" ON) ++ ++option(QWT_OPENGL "Enable OpenGL Plot Canvas" ON) ++ ++option(QWT_DESIGNER "Build Qwt Designer plugin" ON) ++ ++if(WIN32) ++ option(QWT_DESIGNER_SELF_CONTAINED "Build a self-contained designer plugin" ON) ++endif() ++ ++if(APPLE) ++ option(QWT_FRAMEWORK "Build Qwt as a framework" ON) ++endif() ++ ++option(QWT_BUILD_PLAYGROUND "Build the applications in playground" OFF) ++ ++option(QWT_BUILD_TESTS "Build Tests" OFF) ++ ++option(QWT_BUILD_EXAMPLES "Build Examples" OFF) ++ ++if(QWT_QT_VERSION_MAJOR STREQUAL "A") ++ find_package(Qt6 COMPONENTS Core QUIET) ++ if(Qt6_FOUND) ++ set(QT_VERSION ${Qt6_VERSION}) ++ set(QT_VERSION_MAJOR 6) ++ else() ++ find_package(Qt5 COMPONENTS Core REQUIRED) ++ set(QT_VERSION ${Qt5_VERSION}) ++ set(QT_VERSION_MAJOR 5) ++ endif() ++else() ++ find_package(Qt${QWT_QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) ++ set(QT_VERSION ${Qt${QWT_QT_VERSION_MAJOR}_VERSION}) ++ set(QT_VERSION_MAJOR ${QWT_QT_VERSION_MAJOR}) ++endif() ++ ++find_package(Qt${QT_VERSION_MAJOR} COMPONENTS PrintSupport Concurrent Widgets REQUIRED) ++ ++if(QWT_OPENGL) ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS OpenGL REQUIRED) ++ if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS OpenGLWidgets REQUIRED) ++ endif() ++endif() ++ ++if(QWT_SVG) ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Svg REQUIRED) ++endif() ++ ++add_subdirectory(src) ++ ++if(QWT_DESIGNER) ++ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Designer) ++ add_subdirectory(designer) ++endif() ++ ++if(QWT_BUILD_PLAYGROUND) ++ add_subdirectory(playground) ++endif() ++ ++if(QWT_BUILD_TESTS) ++ add_subdirectory(tests) ++endif() ++ ++if(QWT_BUILD_EXAMPLES) ++ add_subdirectory(examples) ++endif() +diff --git a/designer/CMakeLists.txt b/designer/CMakeLists.txt +new file mode 100644 +index 0000000..aa81efd +--- /dev/null ++++ b/designer/CMakeLists.txt +@@ -0,0 +1,35 @@ ++if(QWT_DESIGNER_SELF_CONTAINED) ++ add_library(qwt_designer_plugin SHARED ++ qwt_designer_plugin.cpp ++ qwt_designer_plugin.qrc ++ $ ++ ) ++ target_link_libraries(qwt_designer_plugin PRIVATE qwt_objects) ++ target_compile_definitions(qwt_designer_plugin PRIVATE ++ QWT_MAKEDLL ++ QT_NO_KEYWORDS ++ QWT_MOC_INCLUDE ++ ) ++else() ++ add_library(qwt_designer_plugin SHARED ++ qwt_designer_plugin.cpp ++ qwt_designer_plugin.qrc ++ ) ++ target_link_libraries(qwt_designer_plugin PRIVATE qwt) ++endif() ++ ++target_link_libraries(qwt_designer_plugin PUBLIC Qt${QT_VERSION_MAJOR}::Designer) ++ ++set_target_properties(qwt_designer_plugin PROPERTIES ++ AUTOMOC ON ++ AUTORCC ON ++) ++ ++if(MINGW) ++ set_target_properties(qwt_designer_plugin PROPERTIES PREFIX "") ++endif() ++ ++install(TARGETS qwt_designer_plugin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_DATADIR}/qt${QT_VERSION_MAJOR}/plugins/designer ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/plugins/designer ++) +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +new file mode 100644 +index 0000000..522436c +--- /dev/null ++++ b/examples/CMakeLists.txt +@@ -0,0 +1,41 @@ ++ ++set(CMAKE_AUTOMOC ON) ++ ++if(QWT_PLOT) ++ add_subdirectory(animation) ++ add_subdirectory(barchart) ++ add_subdirectory(cpuplot) ++ add_subdirectory(curvedemo) ++ add_subdirectory(distrowatch) ++ add_subdirectory(friedberg) ++ add_subdirectory(itemeditor) ++ add_subdirectory(legends) ++ add_subdirectory(stockchart) ++ add_subdirectory(simpleplot) ++ add_subdirectory(sinusplot) ++ add_subdirectory(realtime) ++ add_subdirectory(refreshtest) ++ add_subdirectory(scatterplot) ++ add_subdirectory(spectrogram) ++ add_subdirectory(rasterview) ++ add_subdirectory(tvplot) ++ ++ if(QWT_WIDGETS) ++ add_subdirectory(bode) ++ add_subdirectory(splineeditor) ++ add_subdirectory(oscilloscope) ++ endif() ++ ++ if(QWT_POLAR) ++ add_subdirectory(polardemo) ++ add_subdirectory(polarspectrogram) ++ endif() ++ ++endif() ++ ++if(QWT_WIDGETS) ++ add_subdirectory(sysinfo) ++ add_subdirectory(radio) ++ add_subdirectory(dials) ++ add_subdirectory(controls) ++endif() +diff --git a/examples/animation/CMakeLists.txt b/examples/animation/CMakeLists.txt +new file mode 100644 +index 0000000..b5559c6 +--- /dev/null ++++ b/examples/animation/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(animation ++ main.cpp ++ Plot.cpp ++ Plot.h ++) ++ ++target_link_libraries(animation qwt) +diff --git a/examples/barchart/CMakeLists.txt b/examples/barchart/CMakeLists.txt +new file mode 100644 +index 0000000..e09a78a +--- /dev/null ++++ b/examples/barchart/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(barchart ++ main.cpp ++ BarChart.cpp ++ BarChart.h ++) ++ ++target_link_libraries(barchart qwt) +diff --git a/examples/bode/CMakeLists.txt b/examples/bode/CMakeLists.txt +new file mode 100644 +index 0000000..d0a7d77 +--- /dev/null ++++ b/examples/bode/CMakeLists.txt +@@ -0,0 +1,11 @@ ++ ++add_executable(bode ++ main.cpp ++ MainWindow.cpp ++ MainWindow.h ++ Pixmaps.h ++ Plot.cpp ++ Plot.h ++) ++ ++target_link_libraries(bode qwt) +diff --git a/examples/controls/CMakeLists.txt b/examples/controls/CMakeLists.txt +new file mode 100644 +index 0000000..c6467ed +--- /dev/null ++++ b/examples/controls/CMakeLists.txt +@@ -0,0 +1,22 @@ ++ ++add_executable(controls ++ main.cpp ++ SliderBox.h ++ SliderTab.h ++ WheelBox.h ++ WheelTab.h ++ KnobBox.h ++ KnobTab.h ++ DialBox.h ++ DialTab.h ++ SliderBox.cpp ++ SliderTab.cpp ++ WheelBox.cpp ++ WheelTab.cpp ++ KnobBox.cpp ++ KnobTab.cpp ++ DialBox.cpp ++ DialTab.cpp ++) ++ ++target_link_libraries(controls qwt) +diff --git a/examples/cpuplot/CMakeLists.txt b/examples/cpuplot/CMakeLists.txt +new file mode 100644 +index 0000000..9eecb0a +--- /dev/null ++++ b/examples/cpuplot/CMakeLists.txt +@@ -0,0 +1,12 @@ ++ ++add_executable(cpuplot ++ main.cpp ++ CpuPieMarker.cpp ++ CpuPieMarker.h ++ CpuPlot.cpp ++ CpuPlot.h ++ CpuStat.cpp ++ CpuStat.h ++) ++ ++target_link_libraries(cpuplot qwt) +diff --git a/examples/curvedemo/CMakeLists.txt b/examples/curvedemo/CMakeLists.txt +new file mode 100644 +index 0000000..75b6514 +--- /dev/null ++++ b/examples/curvedemo/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(curvedemo main.cpp) ++ ++target_link_libraries(curvedemo qwt) +diff --git a/examples/dials/CMakeLists.txt b/examples/dials/CMakeLists.txt +new file mode 100644 +index 0000000..5f2ca85 +--- /dev/null ++++ b/examples/dials/CMakeLists.txt +@@ -0,0 +1,14 @@ ++ ++add_executable(dials ++ main.cpp ++ AttitudeIndicator.h ++ SpeedoMeter.h ++ CockpitGrid.h ++ CompassGrid.h ++ AttitudeIndicator.cpp ++ SpeedoMeter.cpp ++ CockpitGrid.cpp ++ CompassGrid.cpp ++) ++ ++target_link_libraries(dials qwt) +diff --git a/examples/distrowatch/CMakeLists.txt b/examples/distrowatch/CMakeLists.txt +new file mode 100644 +index 0000000..c9b7e02 +--- /dev/null ++++ b/examples/distrowatch/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(distrowatch ++ main.cpp ++ BarChart.cpp ++ BarChart.h ++) ++ ++target_link_libraries(distrowatch qwt) +diff --git a/examples/friedberg/CMakeLists.txt b/examples/friedberg/CMakeLists.txt +new file mode 100644 +index 0000000..322b631 +--- /dev/null ++++ b/examples/friedberg/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(friedberg ++ main.cpp ++ Friedberg2007.h ++ Friedberg2007.cpp ++ Plot.h ++ Plot.cpp ++) ++ ++target_link_libraries(friedberg qwt) +diff --git a/examples/itemeditor/CMakeLists.txt b/examples/itemeditor/CMakeLists.txt +new file mode 100644 +index 0000000..0d2df52 +--- /dev/null ++++ b/examples/itemeditor/CMakeLists.txt +@@ -0,0 +1,12 @@ ++ ++add_executable(itemeditor ++ main.cpp ++ Editor.h ++ ShapeFactory.h ++ Plot.h ++ Editor.cpp ++ ShapeFactory.cpp ++ Plot.cpp ++) ++ ++target_link_libraries(itemeditor qwt) +diff --git a/examples/legends/CMakeLists.txt b/examples/legends/CMakeLists.txt +new file mode 100644 +index 0000000..7ad01b3 +--- /dev/null ++++ b/examples/legends/CMakeLists.txt +@@ -0,0 +1,13 @@ ++ ++add_executable(legends ++ main.cpp ++ MainWindow.h ++ Panel.h ++ Settings.h ++ Plot.h ++ MainWindow.cpp ++ Panel.cpp ++ Plot.cpp ++) ++ ++target_link_libraries(legends qwt) +diff --git a/examples/oscilloscope/CMakeLists.txt b/examples/oscilloscope/CMakeLists.txt +new file mode 100644 +index 0000000..828b8fe +--- /dev/null ++++ b/examples/oscilloscope/CMakeLists.txt +@@ -0,0 +1,18 @@ ++ ++add_executable(oscilloscope ++ main.cpp ++ SignalData.h ++ Plot.h ++ Knob.h ++ WheelBox.h ++ SamplingThread.h ++ MainWindow.h ++ SignalData.cpp ++ Plot.cpp ++ Knob.cpp ++ WheelBox.cpp ++ SamplingThread.cpp ++ MainWindow.cpp ++) ++ ++target_link_libraries(oscilloscope qwt) +diff --git a/examples/polardemo/CMakeLists.txt b/examples/polardemo/CMakeLists.txt +new file mode 100644 +index 0000000..3683dfd +--- /dev/null ++++ b/examples/polardemo/CMakeLists.txt +@@ -0,0 +1,13 @@ ++ ++add_executable(polardemo ++ main.cpp ++ Pixmaps.h ++ PlotBox.h ++ Plot.h ++ SettingsEditor.h ++ PlotBox.cpp ++ Plot.cpp ++ SettingsEditor.cpp ++) ++ ++target_link_libraries(polardemo qwt) +diff --git a/examples/polarspectrogram/CMakeLists.txt b/examples/polarspectrogram/CMakeLists.txt +new file mode 100644 +index 0000000..e4a1c22 +--- /dev/null ++++ b/examples/polarspectrogram/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(polarspectrogram ++ main.cpp ++ Plot.h ++ PlotWindow.h ++ Plot.cpp ++ PlotWindow.cpp ++) ++ ++target_link_libraries(polarspectrogram qwt) +diff --git a/examples/radio/CMakeLists.txt b/examples/radio/CMakeLists.txt +new file mode 100644 +index 0000000..00ed82c +--- /dev/null ++++ b/examples/radio/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(radio ++ main.cpp ++ AmplifierBox.h ++ TunerBox.h ++ AmplifierBox.cpp ++ TunerBox.cpp ++) ++ ++target_link_libraries(radio qwt) +diff --git a/examples/rasterview/CMakeLists.txt b/examples/rasterview/CMakeLists.txt +new file mode 100644 +index 0000000..7c21eb8 +--- /dev/null ++++ b/examples/rasterview/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(rasterview ++ main.cpp ++ Plot.h ++ Plot.cpp ++) ++ ++target_link_libraries(rasterview qwt) +diff --git a/examples/realtime/CMakeLists.txt b/examples/realtime/CMakeLists.txt +new file mode 100644 +index 0000000..8a01943 +--- /dev/null ++++ b/examples/realtime/CMakeLists.txt +@@ -0,0 +1,16 @@ ++ ++add_executable(realtime ++ main.cpp ++ ScrollZoomer.h ++ ScrollBar.h ++ IncrementalPlot.h ++ RandomPlot.h ++ MainWindow.h ++ ScrollZoomer.cpp ++ ScrollBar.cpp ++ IncrementalPlot.cpp ++ RandomPlot.cpp ++ MainWindow.cpp ++) ++ ++target_link_libraries(realtime qwt) +diff --git a/examples/refreshtest/CMakeLists.txt b/examples/refreshtest/CMakeLists.txt +new file mode 100644 +index 0000000..7100f79 +--- /dev/null ++++ b/examples/refreshtest/CMakeLists.txt +@@ -0,0 +1,15 @@ ++ ++add_executable(refreshtest ++ main.cpp ++ Settings.h ++ CircularBuffer.h ++ Panel.h ++ Plot.h ++ MainWindow.h ++ CircularBuffer.cpp ++ Panel.cpp ++ Plot.cpp ++ MainWindow.cpp ++) ++ ++target_link_libraries(refreshtest qwt) +diff --git a/examples/scatterplot/CMakeLists.txt b/examples/scatterplot/CMakeLists.txt +new file mode 100644 +index 0000000..02b5efb +--- /dev/null ++++ b/examples/scatterplot/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(scatterplot ++ main.cpp ++ Plot.h ++ Plot.cpp ++) ++ ++target_link_libraries(scatterplot qwt) +diff --git a/examples/simpleplot/CMakeLists.txt b/examples/simpleplot/CMakeLists.txt +new file mode 100644 +index 0000000..27fdfb8 +--- /dev/null ++++ b/examples/simpleplot/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(simpleplot main.cpp) ++ ++target_link_libraries(simpleplot qwt) +diff --git a/examples/sinusplot/CMakeLists.txt b/examples/sinusplot/CMakeLists.txt +new file mode 100644 +index 0000000..a6ce2be +--- /dev/null ++++ b/examples/sinusplot/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(sinusplot main.cpp) ++ ++target_link_libraries(sinusplot qwt) +diff --git a/examples/spectrogram/CMakeLists.txt b/examples/spectrogram/CMakeLists.txt +new file mode 100644 +index 0000000..134be44 +--- /dev/null ++++ b/examples/spectrogram/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(spectrogram ++ main.cpp ++ Plot.h ++ Plot.cpp ++) ++ ++target_link_libraries(spectrogram qwt) +diff --git a/examples/splineeditor/CMakeLists.txt b/examples/splineeditor/CMakeLists.txt +new file mode 100644 +index 0000000..2231f64 +--- /dev/null ++++ b/examples/splineeditor/CMakeLists.txt +@@ -0,0 +1,12 @@ ++ ++add_executable(splineeditor ++ main.cpp ++ ScalePicker.h ++ CanvasPicker.h ++ Plot.h ++ ScalePicker.cpp ++ CanvasPicker.cpp ++ Plot.cpp ++) ++ ++target_link_libraries(splineeditor qwt) +diff --git a/examples/stockchart/CMakeLists.txt b/examples/stockchart/CMakeLists.txt +new file mode 100644 +index 0000000..ca4f4c8 +--- /dev/null ++++ b/examples/stockchart/CMakeLists.txt +@@ -0,0 +1,14 @@ ++ ++add_executable(stockchart ++ main.cpp ++ Legend.h ++ GridItem.h ++ Plot.h ++ QuoteFactory.h ++ Legend.cpp ++ GridItem.cpp ++ Plot.cpp ++ QuoteFactory.cpp ++) ++ ++target_link_libraries(stockchart qwt) +diff --git a/examples/sysinfo/CMakeLists.txt b/examples/sysinfo/CMakeLists.txt +new file mode 100644 +index 0000000..954e9f0 +--- /dev/null ++++ b/examples/sysinfo/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(sysinfo main.cpp) ++ ++target_link_libraries(sysinfo qwt) +diff --git a/examples/tvplot/CMakeLists.txt b/examples/tvplot/CMakeLists.txt +new file mode 100644 +index 0000000..8224c3b +--- /dev/null ++++ b/examples/tvplot/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(tvplot ++ main.cpp ++ TVPlot.h ++ TVPlot.cpp ++) ++ ++target_link_libraries(tvplot qwt) +diff --git a/playground/CMakeLists.txt b/playground/CMakeLists.txt +new file mode 100644 +index 0000000..8384661 +--- /dev/null ++++ b/playground/CMakeLists.txt +@@ -0,0 +1,19 @@ ++ ++set(CMAKE_AUTOMOC ON) ++ ++if(QWT_PLOT) ++ add_subdirectory(plotmatrix) ++ add_subdirectory(timescale) ++ add_subdirectory(scaleengine) ++ add_subdirectory(rescaler) ++ add_subdirectory(shapes) ++ add_subdirectory(curvetracker) ++ add_subdirectory(vectorfield) ++ add_subdirectory(symbols) ++ ++ if(QWT_SVG) ++ add_subdirectory(svgmap) ++ add_subdirectory(graphicscale) ++ endif() ++ ++endif() +diff --git a/playground/curvetracker/CMakeLists.txt b/playground/curvetracker/CMakeLists.txt +new file mode 100644 +index 0000000..9440612 +--- /dev/null ++++ b/playground/curvetracker/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(curvetracker ++ main.cpp ++ CurveTracker.cpp ++ CurveTracker.h ++ Plot.cpp ++ Plot.h ++) ++ ++target_link_libraries(curvetracker qwt) +diff --git a/playground/graphicscale/CMakeLists.txt b/playground/graphicscale/CMakeLists.txt +new file mode 100644 +index 0000000..32c580b +--- /dev/null ++++ b/playground/graphicscale/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(graphicscale ++ main.cpp ++ Canvas.cpp ++ Canvas.h ++ MainWindow.cpp ++ MainWindow.h ++) ++ ++target_link_libraries(graphicscale qwt) +diff --git a/playground/plotmatrix/CMakeLists.txt b/playground/plotmatrix/CMakeLists.txt +new file mode 100644 +index 0000000..d85a098 +--- /dev/null ++++ b/playground/plotmatrix/CMakeLists.txt +@@ -0,0 +1,8 @@ ++ ++add_executable(plotmatrix ++ main.cpp ++ PlotMatrix.cpp ++ PlotMatrix.h ++) ++ ++target_link_libraries(plotmatrix qwt) +diff --git a/playground/rescaler/CMakeLists.txt b/playground/rescaler/CMakeLists.txt +new file mode 100644 +index 0000000..34d1ca7 +--- /dev/null ++++ b/playground/rescaler/CMakeLists.txt +@@ -0,0 +1,10 @@ ++ ++add_executable(rescaler ++ main.cpp ++ MainWindow.cpp ++ MainWindow.h ++ Plot.cpp ++ Plot.h ++) ++ ++target_link_libraries(rescaler qwt) +diff --git a/playground/scaleengine/CMakeLists.txt b/playground/scaleengine/CMakeLists.txt +new file mode 100644 +index 0000000..07ff410 +--- /dev/null ++++ b/playground/scaleengine/CMakeLists.txt +@@ -0,0 +1,12 @@ ++ ++add_executable(scaleengine ++ main.cpp ++ MainWindow.cpp ++ MainWindow.h ++ Plot.cpp ++ Plot.h ++ TransformPlot.cpp ++ TransformPlot.h ++) ++ ++target_link_libraries(scaleengine qwt) +diff --git a/playground/shapes/CMakeLists.txt b/playground/shapes/CMakeLists.txt +new file mode 100644 +index 0000000..bd25989 +--- /dev/null ++++ b/playground/shapes/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(shapes main.cpp) ++ ++target_link_libraries(shapes qwt) +diff --git a/playground/svgmap/CMakeLists.txt b/playground/svgmap/CMakeLists.txt +new file mode 100644 +index 0000000..0306537 +--- /dev/null ++++ b/playground/svgmap/CMakeLists.txt +@@ -0,0 +1,9 @@ ++ ++add_executable(svgmap ++ main.cpp ++ Plot.cpp ++ Plot.h ++ svgmap.qrc ++) ++ ++target_link_libraries(svgmap qwt) +diff --git a/playground/symbols/CMakeLists.txt b/playground/symbols/CMakeLists.txt +new file mode 100644 +index 0000000..77084a0 +--- /dev/null ++++ b/playground/symbols/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(symbols main.cpp) ++ ++target_link_libraries(symbols qwt) +diff --git a/playground/timescale/CMakeLists.txt b/playground/timescale/CMakeLists.txt +new file mode 100644 +index 0000000..cfd8968 +--- /dev/null ++++ b/playground/timescale/CMakeLists.txt +@@ -0,0 +1,13 @@ ++ ++add_executable(timescale ++ main.cpp ++ MainWindow.cpp ++ MainWindow.h ++ Panel.cpp ++ Panel.h ++ Plot.cpp ++ Plot.h ++ Settings.h ++) ++ ++target_link_libraries(timescale qwt) +diff --git a/playground/vectorfield/CMakeLists.txt b/playground/vectorfield/CMakeLists.txt +new file mode 100644 +index 0000000..ea78d87 +--- /dev/null ++++ b/playground/vectorfield/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(vectorfield main.cpp) ++ ++target_link_libraries(vectorfield qwt) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +new file mode 100644 +index 0000000..a6a4bf2 +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,439 @@ ++set(HEADERS ++ qwt.h ++ qwt_abstract_scale_draw.h ++ qwt_bezier.h ++ qwt_clipper.h ++ qwt_color_map.h ++ qwt_column_symbol.h ++ qwt_date.h ++ qwt_date_scale_draw.h ++ qwt_date_scale_engine.h ++ qwt_dyngrid_layout.h ++ qwt_global.h ++ qwt_graphic.h ++ qwt_interval.h ++ qwt_interval_symbol.h ++ qwt_math.h ++ qwt_magnifier.h ++ qwt_null_paintdevice.h ++ qwt_painter.h ++ qwt_painter_command.h ++ qwt_panner.h ++ qwt_picker.h ++ qwt_picker_machine.h ++ qwt_pixel_matrix.h ++ qwt_point_3d.h ++ qwt_point_polar.h ++ qwt_round_scale_draw.h ++ qwt_scale_div.h ++ qwt_scale_draw.h ++ qwt_scale_engine.h ++ qwt_scale_map.h ++ qwt_spline.h ++ qwt_spline_basis.h ++ qwt_spline_parametrization.h ++ qwt_spline_local.h ++ qwt_spline_cubic.h ++ qwt_spline_pleasing.h ++ qwt_spline_polynomial.h ++ qwt_symbol.h ++ qwt_system_clock.h ++ qwt_text_engine.h ++ qwt_text_label.h ++ qwt_text.h ++ qwt_transform.h ++ qwt_widget_overlay.h ++) ++set(SOURCES ++ qwt.cpp ++ qwt_abstract_scale_draw.cpp ++ qwt_bezier.cpp ++ qwt_clipper.cpp ++ qwt_color_map.cpp ++ qwt_column_symbol.cpp ++ qwt_date.cpp ++ qwt_date_scale_draw.cpp ++ qwt_date_scale_engine.cpp ++ qwt_dyngrid_layout.cpp ++ qwt_event_pattern.cpp ++ qwt_graphic.cpp ++ qwt_interval.cpp ++ qwt_interval_symbol.cpp ++ qwt_math.cpp ++ qwt_magnifier.cpp ++ qwt_null_paintdevice.cpp ++ qwt_painter.cpp ++ qwt_painter_command.cpp ++ qwt_panner.cpp ++ qwt_picker.cpp ++ qwt_picker_machine.cpp ++ qwt_pixel_matrix.cpp ++ qwt_point_3d.cpp ++ qwt_point_polar.cpp ++ qwt_round_scale_draw.cpp ++ qwt_scale_div.cpp ++ qwt_scale_draw.cpp ++ qwt_scale_map.cpp ++ qwt_scale_engine.cpp ++ qwt_spline.cpp ++ qwt_spline_basis.cpp ++ qwt_spline_parametrization.cpp ++ qwt_spline_local.cpp ++ qwt_spline_cubic.cpp ++ qwt_spline_pleasing.cpp ++ qwt_spline_polynomial.cpp ++ qwt_symbol.cpp ++ qwt_system_clock.cpp ++ qwt_text_engine.cpp ++ qwt_text_label.cpp ++ qwt_text.cpp ++ qwt_transform.cpp ++ qwt_widget_overlay.cpp ++) ++ ++if(QWT_PLOT) ++ list(APPEND HEADERS ++ qwt_axis.h ++ qwt_axis_id.h ++ qwt_curve_fitter.h ++ qwt_spline_curve_fitter.h ++ qwt_weeding_curve_fitter.h ++ qwt_event_pattern.h ++ qwt_abstract_legend.h ++ qwt_legend.h ++ qwt_legend_data.h ++ qwt_legend_label.h ++ qwt_plot.h ++ qwt_plot_renderer.h ++ qwt_plot_curve.h ++ qwt_plot_dict.h ++ qwt_plot_directpainter.h ++ qwt_plot_graphicitem.h ++ qwt_plot_grid.h ++ qwt_plot_histogram.h ++ qwt_plot_item.h ++ qwt_plot_abstract_barchart.h ++ qwt_plot_barchart.h ++ qwt_plot_multi_barchart.h ++ qwt_plot_intervalcurve.h ++ qwt_plot_tradingcurve.h ++ qwt_plot_layout.h ++ qwt_plot_marker.h ++ qwt_plot_zoneitem.h ++ qwt_plot_textlabel.h ++ qwt_plot_rasteritem.h ++ qwt_plot_spectrogram.h ++ qwt_plot_spectrocurve.h ++ qwt_plot_scaleitem.h ++ qwt_plot_legenditem.h ++ qwt_plot_seriesitem.h ++ qwt_plot_shapeitem.h ++ qwt_plot_vectorfield.h ++ qwt_plot_abstract_canvas.h ++ qwt_plot_canvas.h ++ qwt_plot_panner.h ++ qwt_plot_picker.h ++ qwt_plot_zoomer.h ++ qwt_plot_magnifier.h ++ qwt_plot_rescaler.h ++ qwt_point_mapper.h ++ qwt_raster_data.h ++ qwt_matrix_raster_data.h ++ qwt_vectorfield_symbol.h ++ qwt_sampling_thread.h ++ qwt_samples.h ++ qwt_series_data.h ++ qwt_series_store.h ++ qwt_point_data.h ++ qwt_scale_widget.h ++ ) ++ list(APPEND SOURCES ++ qwt_curve_fitter.cpp ++ qwt_spline_curve_fitter.cpp ++ qwt_weeding_curve_fitter.cpp ++ qwt_abstract_legend.cpp ++ qwt_legend.cpp ++ qwt_legend_data.cpp ++ qwt_legend_label.cpp ++ qwt_plot.cpp ++ qwt_plot_renderer.cpp ++ qwt_plot_axis.cpp ++ qwt_plot_curve.cpp ++ qwt_plot_dict.cpp ++ qwt_plot_directpainter.cpp ++ qwt_plot_graphicitem.cpp ++ qwt_plot_grid.cpp ++ qwt_plot_histogram.cpp ++ qwt_plot_item.cpp ++ qwt_plot_abstract_barchart.cpp ++ qwt_plot_barchart.cpp ++ qwt_plot_multi_barchart.cpp ++ qwt_plot_intervalcurve.cpp ++ qwt_plot_zoneitem.cpp ++ qwt_plot_tradingcurve.cpp ++ qwt_plot_spectrogram.cpp ++ qwt_plot_spectrocurve.cpp ++ qwt_plot_scaleitem.cpp ++ qwt_plot_legenditem.cpp ++ qwt_plot_seriesitem.cpp ++ qwt_plot_shapeitem.cpp ++ qwt_plot_vectorfield.cpp ++ qwt_plot_marker.cpp ++ qwt_plot_textlabel.cpp ++ qwt_plot_layout.cpp ++ qwt_plot_abstract_canvas.cpp ++ qwt_plot_canvas.cpp ++ qwt_plot_panner.cpp ++ qwt_plot_rasteritem.cpp ++ qwt_plot_picker.cpp ++ qwt_plot_zoomer.cpp ++ qwt_plot_magnifier.cpp ++ qwt_plot_rescaler.cpp ++ qwt_point_mapper.cpp ++ qwt_raster_data.cpp ++ qwt_matrix_raster_data.cpp ++ qwt_vectorfield_symbol.cpp ++ qwt_sampling_thread.cpp ++ qwt_series_data.cpp ++ qwt_point_data.cpp ++ qwt_scale_widget.cpp ++ ) ++endif() ++ ++if(QWT_OPENGL) ++ list(APPEND HEADERS qwt_plot_opengl_canvas.h) ++ list(APPEND SOURCES qwt_plot_opengl_canvas.cpp) ++ if(QT_VERSION_MAJOR VERSION_LESS 6) ++ list(APPEND HEADERS qwt_plot_glcanvas.h) ++ list(APPEND SOURCES qwt_plot_glcanvas.cpp) ++ endif() ++endif() ++ ++if(QWT_SVG) ++ list(APPEND HEADERS qwt_plot_svgitem.h) ++ list(APPEND SOURCES qwt_plot_svgitem.cpp) ++endif() ++ ++if(QWT_POLAR) ++ list( APPEND HEADERS ++ qwt_polar.h ++ qwt_polar_canvas.h ++ qwt_polar_curve.h ++ qwt_polar_fitter.h ++ qwt_polar_grid.h ++ qwt_polar_itemdict.h ++ qwt_polar_item.h ++ qwt_polar_layout.h ++ qwt_polar_magnifier.h ++ qwt_polar_marker.h ++ qwt_polar_panner.h ++ qwt_polar_picker.h ++ qwt_polar_plot.h ++ qwt_polar_renderer.h ++ qwt_polar_spectrogram.h ++ ) ++ list(APPEND SOURCES ++ qwt_polar_canvas.cpp ++ qwt_polar_curve.cpp ++ qwt_polar_fitter.cpp ++ qwt_polar_grid.cpp ++ qwt_polar_item.cpp ++ qwt_polar_itemdict.cpp ++ qwt_polar_layout.cpp ++ qwt_polar_magnifier.cpp ++ qwt_polar_marker.cpp ++ qwt_polar_panner.cpp ++ qwt_polar_picker.cpp ++ qwt_polar_plot.cpp ++ qwt_polar_renderer.cpp ++ qwt_polar_spectrogram.cpp ++ ) ++endif() ++ ++if(QWT_WIDGETS) ++ list(APPEND HEADERS ++ qwt_abstract_slider.h ++ qwt_abstract_scale.h ++ qwt_arrow_button.h ++ qwt_analog_clock.h ++ qwt_compass.h ++ qwt_compass_rose.h ++ qwt_counter.h ++ qwt_dial.h ++ qwt_dial_needle.h ++ qwt_knob.h ++ qwt_slider.h ++ qwt_thermo.h ++ qwt_wheel.h ++ ) ++ list(APPEND SOURCES ++ qwt_abstract_slider.cpp ++ qwt_abstract_scale.cpp ++ qwt_arrow_button.cpp ++ qwt_analog_clock.cpp ++ qwt_compass.cpp ++ qwt_compass_rose.cpp ++ qwt_counter.cpp ++ qwt_dial.cpp ++ qwt_dial_needle.cpp ++ qwt_knob.cpp ++ qwt_slider.cpp ++ qwt_thermo.cpp ++ qwt_wheel.cpp ++ ) ++endif() ++ ++add_library(qwt_objects OBJECT ${SOURCES} ${HEADERS}) ++ ++target_include_directories(qwt_objects INTERFACE ++ $ ++ $ ++ $ ++) ++ ++target_link_libraries(qwt_objects PUBLIC ++ Qt${QT_VERSION_MAJOR}::Core ++ Qt${QT_VERSION_MAJOR}::Concurrent ++ Qt${QT_VERSION_MAJOR}::PrintSupport ++) ++ ++target_compile_definitions(qwt_objects PRIVATE ++ QT_NO_KEYWORDS ++ QWT_MOC_INCLUDE ++) ++ ++set_target_properties(qwt_objects PROPERTIES AUTOMOC ON) ++ ++if(NOT QWT_PLOT) ++ target_compile_definitions(qwt_objects PUBLIC NO_QWT_PLOT) ++endif() ++ ++if(NOT QWT_POLAR) ++ target_compile_definitions(qwt_objects PUBLIC NO_QWT_POLAR) ++endif() ++ ++if(QWT_WIDGETS) ++ target_link_libraries(qwt_objects PUBLIC Qt${QT_VERSION_MAJOR}::Widgets) ++else() ++ target_compile_definitions(qwt_objects PUBLIC NO_QWT_WIDGETS) ++endif() ++ ++if(QWT_OPENGL) ++ target_link_libraries(qwt_objects PUBLIC Qt${QT_VERSION_MAJOR}::OpenGL) ++ if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) ++ target_link_libraries(qwt_objects PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) ++ endif() ++else() ++ target_compile_definitions(qwt_objects PUBLIC QWT_NO_OPENGL) ++endif() ++ ++if(QWT_SVG) ++ target_link_libraries(qwt_objects PUBLIC Qt${QT_VERSION_MAJOR}::Svg) ++else() ++ target_compile_definitions(qwt_objects PUBLIC QWT_NO_SVG) ++endif() ++ ++ ++if(WIN32 AND QWT_DLL) ++ target_compile_definitions(qwt_objects ++ PUBLIC QWT_DLL ++ PRIVATE QWT_MAKEDLL ++ ) ++endif() ++ ++set(QWT_LIBS "") ++ ++if(QWT_DLL) ++ add_library(qwt_shared SHARED) ++ target_link_libraries(qwt_shared PUBLIC qwt_objects) ++ list(APPEND QWT_LIBS qwt_shared) ++ set_target_properties(qwt_shared PROPERTIES EXPORT_NAME "Qwt_SHARED") ++ set_target_properties(qwt_shared PROPERTIES OUTPUT_NAME "qwt${QWT_NAME_SUFFIX}") ++endif() ++ ++if(QWT_STATIC) ++ add_library(qwt_static STATIC) ++ target_link_libraries(qwt_static PUBLIC qwt_objects) ++ list(APPEND QWT_LIBS qwt_static) ++ set_target_properties(qwt_static PROPERTIES EXPORT_NAME "Qwt_STATIC") ++ if((MSVC OR (APPLE AND QWT_FRAMEWORK)) AND QWT_DLL) ++ set_target_properties(qwt_static PROPERTIES OUTPUT_NAME "qwt${QWT_NAME_SUFFIX}-static") ++ else() ++ set_target_properties(qwt_static PROPERTIES OUTPUT_NAME "qwt${QWT_NAME_SUFFIX}") ++ endif() ++endif() ++ ++if(QWT_DLL) ++ add_library(qwt ALIAS qwt_shared) ++else() ++ add_library(qwt ALIAS qwt_static) ++endif() ++ ++if(QWT_DLL AND NOT APPLE AND NOT MSVC) ++ set_target_properties(qwt_shared PROPERTIES ++ VERSION ${PROJECT_VERSION} ++ SOVERSION ${PROJECT_VERSION_MAJOR} ++ ) ++endif() ++ ++if(APPLE AND QWT_FRAMEWORK) ++ set_target_properties(${QWT_LIBS} PROPERTIES FRAMEWORK TRUE) ++endif() ++ ++install(TARGETS ${QWT_LIBS} qwt_objects ++ EXPORT QwtTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++ ++set(QWT_CONFIG_NAME "Qt${QT_VERSION_MAJOR}Qwt6") ++ ++install(EXPORT QwtTargets ++ FILE ${QWT_CONFIG_NAME}Targets.cmake ++ NAMESPACE "Qwt::" ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${QWT_CONFIG_NAME} ++) ++include(CMakePackageConfigHelpers) ++ ++get_target_property(QT_LIBRARIES qwt_objects INTERFACE_LINK_LIBRARIES) ++string(JOIN " " QT_LIBRARIES ${QT_LIBRARIES}) ++string(REPLACE "::" "" QT_LIBRARIES ${QT_LIBRARIES}) ++ ++configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/qwt-config.cmake.in ++ "${CMAKE_CURRENT_BINARY_DIR}/${QWT_CONFIG_NAME}Config.cmake" ++ INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${QWT_CONFIG_NAME}" ++ NO_SET_AND_CHECK_MACRO ++ NO_CHECK_REQUIRED_COMPONENTS_MACRO ++) ++write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/${QWT_CONFIG_NAME}ConfigVersion.cmake" ++ VERSION "${Qwt_VERSION}" ++ COMPATIBILITY AnyNewerVersion ++) ++install(FILES ++ ${CMAKE_CURRENT_BINARY_DIR}/${QWT_CONFIG_NAME}Config.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/${QWT_CONFIG_NAME}ConfigVersion.cmake ++ DESTINATION lib/cmake/${QWT_CONFIG_NAME} ++) ++ ++install(FILES ${HEADERS} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qwt${QWT_NAME_SUFFIX} ++) ++install(DIRECTORY ${CMAKE_SOURCE_DIR}/classincludes/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qwt${QWT_NAME_SUFFIX} ++ PATTERN "classincludes.pro" EXCLUDE ++) ++ ++get_target_property(QWT_COMPILE_DEFINITIONS qwt_objects INTERFACE_COMPILE_DEFINITIONS) ++string(JOIN " -D" QWT_COMPILE_DEFINITIONS ${QWT_COMPILE_DEFINITIONS}) ++string(PREPEND QWT_COMPILE_DEFINITIONS "-D") ++ ++set(QWT_PKGCONFIG_FILE ${QWT_CONFIG_NAME}.pc) ++ ++configure_file(qwt.pc.in ${QWT_PKGCONFIG_FILE} @ONLY) ++ ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${QWT_PKGCONFIG_FILE} ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ++) +diff --git a/src/qwt-config.cmake.in b/src/qwt-config.cmake.in +new file mode 100644 +index 0000000..cdd79d1 +--- /dev/null ++++ b/src/qwt-config.cmake.in +@@ -0,0 +1,17 @@ ++ ++@PACKAGE_INIT@ ++ ++include ( "${CMAKE_CURRENT_LIST_DIR}/@QWT_CONFIG_NAME@Targets.cmake" ) ++ ++set(QWT_INCLUDE_DIRS ${PACKAGE_PREFIX_DIR}/include/qwt@QWT_NAME_SUFFIX@) ++ ++if(TARGET Qwt::Qwt_SHARED) ++ add_library(Qwt::Qwt ALIAS Qwt::Qwt_SHARED) ++else() ++ add_library(Qwt::Qwt ALIAS Qwt::Qwt_STATIC) ++endif() ++ ++set(QT_LIBRARIES @QT_LIBRARIES@) ++foreach(qt_lib ${QT_LIBRARIES}) ++ find_package(${qt_lib} @QT_VERSION@ REQUIRED) ++endforeach() +diff --git a/src/qwt.pc.in b/src/qwt.pc.in +new file mode 100644 +index 0000000..05be4e4 +--- /dev/null ++++ b/src/qwt.pc.in +@@ -0,0 +1,12 @@ ++prefix=@CMAKE_INSTALL_PREFIX@ ++exec_prefix=${prefix} ++libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ ++includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ ++ ++Name: @PROJECT_NAME@ ++Description: @PROJECT_DESCRIPTION@ ++Version: @PROJECT_VERSION@ ++ ++Libs: -L${libdir} -lqwt@QWT_NAME_SUFFIX@ ++Cflags: -I${includedir}/qwt@QWT_NAME_SUFFIX@ @QWT_COMPILE_DEFINITIONS@ ++Requires: @QT_LIBRARIES@ +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +new file mode 100644 +index 0000000..c530d58 +--- /dev/null ++++ b/tests/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_subdirectory(splinetest) ++ ++add_subdirectory(splineprof) +diff --git a/tests/splineprof/CMakeLists.txt b/tests/splineprof/CMakeLists.txt +new file mode 100644 +index 0000000..821b725 +--- /dev/null ++++ b/tests/splineprof/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(splineprof main.cpp) ++ ++target_link_libraries(splineprof qwt) +diff --git a/tests/splinetest/CMakeLists.txt b/tests/splinetest/CMakeLists.txt +new file mode 100644 +index 0000000..a08f9f6 +--- /dev/null ++++ b/tests/splinetest/CMakeLists.txt +@@ -0,0 +1,4 @@ ++ ++add_executable(splinetest main.cpp) ++ ++target_link_libraries(splinetest qwt) +-- +2.36.1 + diff --git a/recipes/qwt/all/test_package/CMakeLists.txt b/recipes/qwt/all/test_package/CMakeLists.txt index 79d3544c480ff..aa41291ce00a5 100644 --- a/recipes/qwt/all/test_package/CMakeLists.txt +++ b/recipes/qwt/all/test_package/CMakeLists.txt @@ -4,6 +4,8 @@ project(PackageTest CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) +find_package(qwt REQUIRED) + add_executable(example example.cpp) # Must compile with "-fPIC" since Qt was built with -reduce-relocations. target_compile_options(example PRIVATE -fPIC) diff --git a/recipes/qwt/all/test_package/conanfile.py b/recipes/qwt/all/test_package/conanfile.py index 47c78f875835e..9ae28e5840759 100644 --- a/recipes/qwt/all/test_package/conanfile.py +++ b/recipes/qwt/all/test_package/conanfile.py @@ -1,17 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conans import CMake +from conan.tools.build import cross_building import os class QwtTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - + 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): + if not cross_building(self): bin_path = os.path.join("bin", "example") self.run(bin_path, run_environment=True) diff --git a/recipes/qwt/config.yml b/recipes/qwt/config.yml index 77f21f3888e6f..d0d954ac2ed4c 100644 --- a/recipes/qwt/config.yml +++ b/recipes/qwt/config.yml @@ -1,5 +1,3 @@ versions: - "6.1.6": - folder: "all" "6.2.0": folder: "all" From 398280f4ca50590f5a0dcb5e3744601d65e36886 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 20 Sep 2022 01:05:36 +0900 Subject: [PATCH 093/561] (#13015) json-c: add version 0.16 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/json-c/all/conandata.yml | 3 +++ recipes/json-c/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/json-c/all/conandata.yml b/recipes/json-c/all/conandata.yml index 74d4966619292..7ed706059e17c 100644 --- a/recipes/json-c/all/conandata.yml +++ b/recipes/json-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.16": + url: "https://github.com/json-c/json-c/archive/json-c-0.16-20220414.tar.gz" + sha256: "3ecaeedffd99a60b1262819f9e60d7d983844073abc74e495cb822b251904185" "0.15": url: "https://github.com/json-c/json-c/archive/json-c-0.15-20200726.tar.gz" sha256: "4ba9a090a42cf1e12b84c64e4464bb6fb893666841d5843cc5bef90774028882" diff --git a/recipes/json-c/config.yml b/recipes/json-c/config.yml index 5a2bea1374656..1e4023fe84046 100644 --- a/recipes/json-c/config.yml +++ b/recipes/json-c/config.yml @@ -1,4 +1,6 @@ versions: + "0.16": + folder: all "0.15": folder: all "0.14": From 3411812053b68ba470c373be65471c349db63576 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Mon, 19 Sep 2022 19:25:18 +0200 Subject: [PATCH 094/561] (#13018) harfbuzz 5.2.0 * harfbuzz 5.2.0 * Update conandata.yml * Update config.yml * Update conanfile.py * Update conanfile.py --- recipes/harfbuzz/all/conandata.yml | 42 +++----------------- recipes/harfbuzz/all/conanfile.py | 6 ++- recipes/harfbuzz/all/patches/icu-5.2.x.patch | 31 +++++++++++++++ recipes/harfbuzz/config.yml | 14 +------ 4 files changed, 43 insertions(+), 50 deletions(-) create mode 100644 recipes/harfbuzz/all/patches/icu-5.2.x.patch diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml index 3a1c60eee9a92..92d73bd800af2 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -1,56 +1,26 @@ sources: - "3.0.0": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/3.0.0/harfbuzz-3.0.0.tar.xz" - sha256: "036b0ee118451539783ec7864148bb4106be42a2eb964df4e83e6703ec46f3d9" - "3.1.2": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/3.1.2/harfbuzz-3.1.2.tar.xz" - sha256: "4056b1541dd8bbd8ec29207fe30e568805c0705515632d7fec53a94399bc7945" "3.2.0": url: "https://github.com/harfbuzz/harfbuzz/releases/download/3.2.0/harfbuzz-3.2.0.tar.xz" sha256: "0ada50a1c199bb6f70843ab893c55867743a443b84d087d54df08ad883ebc2cd" - "4.0.1": - url: "https://github.com/harfbuzz/harfbuzz/releases/download/4.0.1/harfbuzz-4.0.1.tar.xz" - sha256: "98f68777272db6cd7a3d5152bac75083cd52a26176d87bc04c8b3929d33bce49" - "4.1.0": - url: "https://github.com/harfbuzz/harfbuzz/archive/4.1.0.tar.gz" - sha256: "0dad9332aa017d216981382cc07a9cf115740990c83b81ce3ea71ad88026d7f1" - "4.2.1": - url: "https://github.com/harfbuzz/harfbuzz/archive/4.2.1.tar.gz" - sha256: "99fcd30e2f4c66d05af3d61ad4cdba2abc2a51ecabb7eb6dc222520a892b50b0" - "4.3.0": - url: "https://github.com/harfbuzz/harfbuzz/archive/4.3.0.tar.gz" - sha256: "32184860ddc0b264ff95010e1c64e596bd746fe4c2e34014a1185340cdddeba6" "4.4.1": url: "https://github.com/harfbuzz/harfbuzz/releases/download/4.4.1/harfbuzz-4.4.1.tar.xz" sha256: "c5bc33ac099b2e52f01d27cde21cee4281b9d5bfec7684135e268512478bc9ee" "5.1.0": url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.1.0/harfbuzz-5.1.0.tar.xz" sha256: "2edb95db668781aaa8d60959d21be2ff80085f31b12053cdd660d9a50ce84f05" + "5.2.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.2.0/harfbuzz-5.2.0.tar.xz" + sha256: "735a94917b47936575acb4d4fa7e7986522f8a89527e4635721474dee2bc942c" patches: - "3.0.0": - - patch_file: "patches/icu-3.0.x.patch" - base_path: "source_subfolder" - "3.1.2": - - patch_file: "patches/icu-3.0.x.patch" - base_path: "source_subfolder" "3.2.0": - patch_file: "patches/icu-3.0.x.patch" base_path: "source_subfolder" - "4.0.1": - - patch_file: "patches/icu-4.0.x.patch" - base_path: "source_subfolder" - "4.1.0": - - patch_file: "patches/icu-4.0.x.patch" - base_path: "source_subfolder" - "4.2.1": - - patch_file: "patches/icu-4.0.x.patch" - base_path: "source_subfolder" - "4.3.0": - - patch_file: "patches/icu-4.0.x.patch" - base_path: "source_subfolder" "4.4.1": - patch_file: "patches/icu-4.0.x.patch" base_path: "source_subfolder" "5.1.0": - patch_file: "patches/icu-5.1.x.patch" base_path: "source_subfolder" + "5.2.0": + - patch_file: "patches/icu-5.2.x.patch" + base_path: "source_subfolder" diff --git a/recipes/harfbuzz/all/conanfile.py b/recipes/harfbuzz/all/conanfile.py index 0e6a6219b8375..7b8acf4dd604c 100644 --- a/recipes/harfbuzz/all/conanfile.py +++ b/recipes/harfbuzz/all/conanfile.py @@ -92,7 +92,7 @@ def requirements(self): if self.options.with_icu: self.requires("icu/71.1") if self.options.with_glib: - self.requires("glib/2.73.1") + self.requires("glib/2.73.3") def source(self): files.get(self, **self.conan_data["sources"][self.version], @@ -133,10 +133,12 @@ def package(self): cmake = self._configure_cmake() cmake.install() files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.names["cmake_find_package"] = "harfbuzz" self.cpp_info.names["cmake_find_package_multi"] = "harfbuzz" + self.cpp_info.set_property("pkg_config_name", "harfbuzz") if self.options.with_icu: self.cpp_info.libs.append("harfbuzz-icu") if self.options.with_subset: @@ -156,7 +158,7 @@ def package_info(self): if self.options.with_directwrite: self.cpp_info.system_libs.append("dwrite") if tools.is_apple_os(self.settings.os): - self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText"]) + self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText", "ApplicationServices"]) if not self.options.shared: libcxx = tools.stdcpp_library(self) if libcxx: diff --git a/recipes/harfbuzz/all/patches/icu-5.2.x.patch b/recipes/harfbuzz/all/patches/icu-5.2.x.patch new file mode 100644 index 0000000000000..083f14117d7f9 --- /dev/null +++ b/recipes/harfbuzz/all/patches/icu-5.2.x.patch @@ -0,0 +1,31 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 3259ca9..8168bb4 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -260,19 +260,19 @@ if (HB_HAVE_ICU) + add_definitions(-DHAVE_ICU) + + # https://github.com/WebKit/webkit/blob/fdd7733f2f30eab7fe096a9791f98c60f62f49c0/Source/cmake/FindICU.cmake +- find_package(PkgConfig) +- pkg_check_modules(PC_ICU QUIET icu-uc) ++ # find_package(PkgConfig) ++ # pkg_check_modules(PC_ICU QUIET icu-uc) + +- find_path(ICU_INCLUDE_DIR NAMES unicode/utypes.h HINTS ${PC_ICU_INCLUDE_DIRS} ${PC_ICU_INCLUDEDIR}) +- find_library(ICU_LIBRARY NAMES libicuuc cygicuuc cygicuuc32 icuuc HINTS ${PC_ICU_LIBRARY_DIRS} ${PC_ICU_LIBDIR}) ++ # find_path(ICU_INCLUDE_DIR NAMES unicode/utypes.h HINTS ${PC_ICU_INCLUDE_DIRS} ${PC_ICU_INCLUDEDIR}) ++ # find_library(ICU_LIBRARY NAMES libicuuc cygicuuc cygicuuc32 icuuc HINTS ${PC_ICU_LIBRARY_DIRS} ${PC_ICU_LIBDIR}) + +- include_directories(${ICU_INCLUDE_DIR}) ++ # include_directories(${ICU_INCLUDE_DIR}) + + list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-icu.h) + +- list(APPEND THIRD_PARTY_LIBS ${ICU_LIBRARY}) ++ # list(APPEND THIRD_PARTY_LIBS ${ICU_LIBRARY}) + +- mark_as_advanced(ICU_INCLUDE_DIR ICU_LIBRARY) ++ # mark_as_advanced(ICU_INCLUDE_DIR ICU_LIBRARY) + endif () + + if (APPLE AND HB_HAVE_CORETEXT) diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml index 7fd2cded2af9b..f7ebfff60979f 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -1,19 +1,9 @@ versions: - "3.0.0": - folder: all - "3.1.2": - folder: all "3.2.0": folder: all - "4.0.1": - folder: all - "4.1.0": - folder: all - "4.2.1": - folder: all - "4.3.0": - folder: all "4.4.1": folder: all "5.1.0": folder: all + "5.2.0": + folder: all From 378f390dc4700af7153ea9211d056ec35e4a81fc Mon Sep 17 00:00:00 2001 From: Roberto Rossini <71787608+robomics@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:24:38 +0200 Subject: [PATCH 095/561] (#12195) libbigwig: new recipe * Initial commit of libBigWig recipe * Bump required_conan_version * Apparently -lgsasl is not needed? * Attempt Conan v2 migration * Remove duplicate blank line * Bugfix in test_package * Bugfix * Update for Conan 2.0 Signed-off-by: Uilian Ries * Workaround gsasl link error * Do not build with curl support by default * Bump libcurl * Document workaround for gsasl link error * Bugfix * Move libcurl option checks inside validate() Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/libbigwig/all/conandata.yml | 4 + recipes/libbigwig/all/conanfile.py | 104 ++++++++++++++++++ .../libbigwig/all/test_package/CMakeLists.txt | 8 ++ .../libbigwig/all/test_package/conanfile.py | 26 +++++ .../libbigwig/all/test_package/test_package.c | 15 +++ .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 19 ++++ recipes/libbigwig/config.yml | 3 + 8 files changed, 190 insertions(+) create mode 100644 recipes/libbigwig/all/conandata.yml create mode 100644 recipes/libbigwig/all/conanfile.py create mode 100644 recipes/libbigwig/all/test_package/CMakeLists.txt create mode 100644 recipes/libbigwig/all/test_package/conanfile.py create mode 100644 recipes/libbigwig/all/test_package/test_package.c create mode 100644 recipes/libbigwig/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libbigwig/all/test_v1_package/conanfile.py create mode 100644 recipes/libbigwig/config.yml diff --git a/recipes/libbigwig/all/conandata.yml b/recipes/libbigwig/all/conandata.yml new file mode 100644 index 0000000000000..e1b88454d66c1 --- /dev/null +++ b/recipes/libbigwig/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.7": + sha256: 8e057797011d93fa00e756600898af4fe6ca2d48959236efc9f296abe94916d9 + url: https://github.com/dpryan79/libBigWig/archive/refs/tags/0.4.7.tar.gz diff --git a/recipes/libbigwig/all/conanfile.py b/recipes/libbigwig/all/conanfile.py new file mode 100644 index 0000000000000..7caf0f129e795 --- /dev/null +++ b/recipes/libbigwig/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, get, copy +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.50.0" + + +class LibBigWigConan(ConanFile): + name = "libbigwig" + description = "A C library for handling bigWig files" + topics = ("bioinformatics", "bigwig", "bigbed") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dpryan79/libBigWig" + license = "MIT" + settings = "arch", "build_type", "compiler", "os" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_curl": [True, False], + "with_zlibng": [True, False] + } + + default_options = { + "shared": False, + "fPIC": True, + "with_curl": False, + "with_zlibng": False + } + + def configure(self): + if self.options.shared: + del self.options.fPIC + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_curl: + self.requires("libcurl/7.85.0") + if self.options.with_zlibng: + self.requires("zlib-ng/2.0.6") + else: + self.requires("zlib/1.2.12") + + def validate(self): + if self.info.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows.") + + if self.info.options.with_zlibng: + zlib_ng = self.dependencies["zlib-ng"] + if not zlib_ng.options.zlib_compat: + raise ConanInvalidConfiguration(f"{self.ref} requires the dependency option zlib-ng:zlib_compat=True") + + if self.options.with_curl: + libcurl = self.dependencies["libcurl"] + if libcurl.options.with_imap or libcurl.options.with_pop3 or libcurl.options.with_smtp: + raise ConanInvalidConfiguration(f"{self.ref} requires libcurl using the follow options: -o libcurl:with_imap=False -o libcurl:with_pop3=False -o libcurl:with_smtp=False") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TESTING"] = False + tc.variables["WITH_CURL"] = self.options.with_curl + tc.variables["WITH_ZLIBNG"] = self.options.with_zlibng + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" # honor BUILD_SHARED_LIBS + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["BigWig"] + self.cpp_info.system_libs = ["m"] + self.cpp_info.set_property("cmake_file_name", "BigWig") + self.cpp_info.set_property("cmake_target_name", "BigWig::BigWig") + + if not self.options.with_curl: + self.cpp_info.defines = ["NOCURL"] + + # TODO: Remove in Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "BigWig" + self.cpp_info.names["cmake_find_package_multi"] = "BigWig" diff --git a/recipes/libbigwig/all/test_package/CMakeLists.txt b/recipes/libbigwig/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7a790b50c498a --- /dev/null +++ b/recipes/libbigwig/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +find_package(BigWig REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE BigWig::BigWig) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/libbigwig/all/test_package/conanfile.py b/recipes/libbigwig/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a6b7483b895d --- /dev/null +++ b/recipes/libbigwig/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "arch", "build_type", "compiler", "os" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libbigwig/all/test_package/test_package.c b/recipes/libbigwig/all/test_package/test_package.c new file mode 100644 index 0000000000000..7bf2175d15e63 --- /dev/null +++ b/recipes/libbigwig/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include "libbigwig/bigWig.h" + + +int main(void) { + bigWigFile_t *fp = NULL; + + bwInit(1<<17); + fp = bwOpen("test_package.bw", NULL, "w"); + bwCreateHdr(fp, 10); + bwClose(fp); + bwCleanup(); + + return EXIT_SUCCESS; +} diff --git a/recipes/libbigwig/all/test_v1_package/CMakeLists.txt b/recipes/libbigwig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0ef441c1d3786 --- /dev/null +++ b/recipes/libbigwig/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(BigWig REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE BigWig::BigWig) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/libbigwig/all/test_v1_package/conanfile.py b/recipes/libbigwig/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fe504f17122b3 --- /dev/null +++ b/recipes/libbigwig/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os + +from conans import ConanFile, CMake +from conan.tools.build import cross_building + + +class TestPackageConan(ConanFile): + settings = "arch", "build_type", "compiler", "os" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libbigwig/config.yml b/recipes/libbigwig/config.yml new file mode 100644 index 0000000000000..0435ca37310c1 --- /dev/null +++ b/recipes/libbigwig/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.7": + folder: all From a67028d3bc1ac73c4d50b6c533e98a1245649e22 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 20 Sep 2022 17:43:50 +0900 Subject: [PATCH 096/561] (#12425) imutils-cpp: add recipe * imutils-cpp: add recipe * follow conan v2 * drop support gcc 7 * define CMAKE_CXX_STANDARD for C++ filesystem Co-authored-by: Uilian Ries * import cross_building Co-authored-by: Uilian Ries * don't use tools.cross_building Co-authored-by: Uilian Ries * set package names for conan 1.0 Co-authored-by: Uilian Ries * drop support gcc 8 Co-authored-by: Uilian Ries * update clang, apple-clang version for std::filesystem * drop support clang 11 * add patch for removing bit/stdc++.h * remove bits/stdc++.h in text.cpp * fix std::filesystem::path cast * set `/permissive-` in MSVC * fix cast from path to string, more Co-authored-by: Uilian Ries --- recipes/imutils-cpp/all/conandata.yml | 9 ++ recipes/imutils-cpp/all/conanfile.py | 106 ++++++++++++++++++ .../all/patches/1.0.1-0001-fix-cmake.patch | 43 +++++++ .../1.0.1-0002-unuse-bits_stdcpp_h.patch | 49 ++++++++ .../patches/1.0.1-0003-fix-path-cast.patch | 22 ++++ .../all/test_package/CMakeLists.txt | 8 ++ .../imutils-cpp/all/test_package/conanfile.py | 22 ++++ .../all/test_package/test_package.cpp | 10 ++ .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 18 +++ recipes/imutils-cpp/config.yml | 3 + 11 files changed, 301 insertions(+) create mode 100644 recipes/imutils-cpp/all/conandata.yml create mode 100644 recipes/imutils-cpp/all/conanfile.py create mode 100644 recipes/imutils-cpp/all/patches/1.0.1-0001-fix-cmake.patch create mode 100644 recipes/imutils-cpp/all/patches/1.0.1-0002-unuse-bits_stdcpp_h.patch create mode 100644 recipes/imutils-cpp/all/patches/1.0.1-0003-fix-path-cast.patch create mode 100644 recipes/imutils-cpp/all/test_package/CMakeLists.txt create mode 100644 recipes/imutils-cpp/all/test_package/conanfile.py create mode 100644 recipes/imutils-cpp/all/test_package/test_package.cpp create mode 100644 recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/imutils-cpp/all/test_v1_package/conanfile.py create mode 100644 recipes/imutils-cpp/config.yml diff --git a/recipes/imutils-cpp/all/conandata.yml b/recipes/imutils-cpp/all/conandata.yml new file mode 100644 index 0000000000000..32d51c439957b --- /dev/null +++ b/recipes/imutils-cpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.0.1": + url: "https://github.com/thedevmanek/imutils-cpp/archive/refs/tags/v1.0.1.tar.gz" + sha256: "de79dce695a20550de1c383f74bf034ade22686f1197308ec612a1fb05fcf67a" +patches: + "1.0.1": + - patch_file: "patches/1.0.1-0001-fix-cmake.patch" + - patch_file: "patches/1.0.1-0002-unuse-bits_stdcpp_h.patch" + - patch_file: "patches/1.0.1-0003-fix-path-cast.patch" diff --git a/recipes/imutils-cpp/all/conanfile.py b/recipes/imutils-cpp/all/conanfile.py new file mode 100644 index 0000000000000..d577073c8baef --- /dev/null +++ b/recipes/imutils-cpp/all/conanfile.py @@ -0,0 +1,106 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools import files +from conan.tools import scm +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches +from conan.tools.build import check_min_cppstd + +import os + +required_conan_version = ">=1.50.0" + +class ImutilsCppConan(ConanFile): + name = "imutils-cpp" + description = "This is a cpp version of popular python computer vision library imutils." + license = "Apache-2.0" + topics = ("opencv", "imutils", "computer vision", ) + homepage = "https://github.com/thedevmanek/imutils-cpp" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "Visual Studio": "15.7", + "msvc": "19.14", + "clang": "12", + "apple-clang": "10.14", + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + files.copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires("opencv/4.5.5") + self.requires("libcurl/7.84.0") + self.requires("openssl/1.1.1q") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and scm.Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + toolchain = CMakeToolchain(self) + toolchain.cache_variables["CMAKE_CXX_STANDARD"] = self._minimum_cpp_standard + toolchain.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + files.copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + files.rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["imutils_cpp"] + + self.cpp_info.set_property("cmake_file_name", "imutils_cpp") + self.cpp_info.set_property("cmake_target_name", "imutils_cpp::imutils_cpp") + + self.cpp_info.requires.append("opencv::opencv") + self.cpp_info.requires.append("libcurl::libcurl") + + # TODO: Remove after Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "imutils_cpp" + self.cpp_info.names["cmake_find_package_multi"] = "imutils_cpp" diff --git a/recipes/imutils-cpp/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/imutils-cpp/all/patches/1.0.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..66ed5cd60c766 --- /dev/null +++ b/recipes/imutils-cpp/all/patches/1.0.1-0001-fix-cmake.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7418a34..82b1777 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,13 +1,26 @@ + cmake_minimum_required(VERSION 3.9) + project(imutils_cpp VERSION 1.0.1 DESCRIPTION "imutils_cpp A series of convenience functions to make basic image processing functions such as translation, rotation, resizing and skeletonization easier with OpenCV ") ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + find_package(OpenCV REQUIRED) ++find_package(CURL REQUIRED) + include(GNUInstallDirs) +-add_library(imutils_cpp SHARED STATIC src/text.cpp include/imutils/text.h src/paths.cpp include/imutils/paths.h src/perspective.cpp include/imutils/perspective.h src/convenience.cpp include/imutils/convenience.h) +-set_target_properties(imutils_cpp PROPERTIES VERSION ${PROJECT_VERSION}) ++add_library(imutils_cpp src/text.cpp src/paths.cpp src/perspective.cpp src/convenience.cpp) ++set(IMUTILS_HEADERS include/imutils/text.h include/imutils/paths.h include/imutils/perspective.h include/imutils/convenience.h) ++set_target_properties(imutils_cpp PROPERTIES ++ VERSION ${PROJECT_VERSION} ++ PUBLIC_HEADER "${IMUTILS_HEADERS}" ++) + target_include_directories(imutils_cpp PRIVATE include) + target_include_directories(imutils_cpp PRIVATE src) + include(GNUInstallDirs) + install(TARGETS imutils_cpp + ${PROJECT_NAME} +- DESTINATION lib/${PROJECT_NAME}) +-target_link_libraries(imutils_cpp ${OpenCV_LIBS} curl) ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/imutils ++) ++target_link_libraries(imutils_cpp opencv::opencv CURL::libcurl) ++if (MSVC) ++ target_compile_options(imutils_cpp PRIVATE "/permissive-") ++endif() +diff --git b/build/.cmake/api/v1/query/client-vscode/query.json b/build/.cmake/api/v1/query/client-vscode/query.json +new file mode 100644 +index 0000000..82bb964 +--- /dev/null ++++ b/build/.cmake/api/v1/query/client-vscode/query.json +@@ -0,0 +1 @@ ++{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1},{"kind":"cmakeFiles","version":1}]} +\ No newline at end of file diff --git a/recipes/imutils-cpp/all/patches/1.0.1-0002-unuse-bits_stdcpp_h.patch b/recipes/imutils-cpp/all/patches/1.0.1-0002-unuse-bits_stdcpp_h.patch new file mode 100644 index 0000000000000..2b2214447761b --- /dev/null +++ b/recipes/imutils-cpp/all/patches/1.0.1-0002-unuse-bits_stdcpp_h.patch @@ -0,0 +1,49 @@ +diff --git a/include/imutils/paths.h b/include/imutils/paths.h +index 29bc503..56b78e5 100644 +--- a/include/imutils/paths.h ++++ b/include/imutils/paths.h +@@ -5,7 +5,8 @@ + #define PATH_H + + #include "filesystem" +-#include "bits/stdc++.h" ++#include ++#include + /** @file paths.h **/ + /***************************************************************************//** + *@class Path +@@ -39,4 +40,4 @@ public: + std::vector + listFiles(std::string basePath, std::vector validExts = {}, std::string contains = "" + ); +-}; +\ No newline at end of file ++}; +diff --git a/src/paths.cpp b/src/paths.cpp +index 380be73..d0bc7f5 100644 +--- a/src/paths.cpp ++++ b/src/paths.cpp +@@ -2,7 +2,9 @@ + // Created by jonsnow on 07/02/22. + // + #include "filesystem" +-#include "bits/stdc++.h" ++#include ++#include ++#include + #include "../include/imutils/paths.h" + + namespace fs = std::filesystem; +diff --git a/src/text.cpp b/src/text.cpp +index 73bec10..6336964 100644 +--- a/src/text.cpp ++++ b/src/text.cpp +@@ -1,5 +1,7 @@ + #include "string" +-#include "bits/stdc++.h" ++#include ++#include ++#include + #include "opencv2/core.hpp" + #include "opencv2/imgproc.hpp" + diff --git a/recipes/imutils-cpp/all/patches/1.0.1-0003-fix-path-cast.patch b/recipes/imutils-cpp/all/patches/1.0.1-0003-fix-path-cast.patch new file mode 100644 index 0000000000000..7658e09e6bedd --- /dev/null +++ b/recipes/imutils-cpp/all/patches/1.0.1-0003-fix-path-cast.patch @@ -0,0 +1,22 @@ +diff --git a/src/paths.cpp b/src/paths.cpp +index d0bc7f5..d39ffb6 100644 +--- a/src/paths.cpp ++++ b/src/paths.cpp +@@ -19,14 +19,14 @@ std::vector Path::listFiles(std::string basePath, std::vector filesDirs; + for (const auto &dirEntry: fs::recursive_directory_iterator(basePath)) { + std::filesystem::path file = dirEntry.path(); +- if (contains != "" and ((std::string) file.filename()).find(contains) == std::string::npos) { ++ if (contains != "" and file.filename().string().find(contains) == std::string::npos) { + continue; + } + if (validExts.empty()) { +- filesDirs.push_back(dirEntry.path()); ++ filesDirs.push_back(dirEntry.path().string()); + } else { + if (std::find(validExts.begin(), validExts.end(), file.extension()) != validExts.end()){ +- filesDirs.push_back(dirEntry.path()); ++ filesDirs.push_back(dirEntry.path().string()); + + } + diff --git a/recipes/imutils-cpp/all/test_package/CMakeLists.txt b/recipes/imutils-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7dc0936c26b56 --- /dev/null +++ b/recipes/imutils-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +find_package(imutils_cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE imutils_cpp::imutils_cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/imutils-cpp/all/test_package/conanfile.py b/recipes/imutils-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c7933801f1176 --- /dev/null +++ b/recipes/imutils-cpp/all/test_package/conanfile.py @@ -0,0 +1,22 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/imutils-cpp/all/test_package/test_package.cpp b/recipes/imutils-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..42bfe878da9e8 --- /dev/null +++ b/recipes/imutils-cpp/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + cv::Mat image1 = cv::Mat::eye(256, 256, CV_8UC3); + cv::Mat image2 = Convenience::translate(image1, 5.0, 3.0); + + return 0; +} diff --git a/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt b/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..529de77d0cf37 --- /dev/null +++ b/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(imutils_cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE imutils_cpp::imutils_cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/imutils-cpp/all/test_v1_package/conanfile.py b/recipes/imutils-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/imutils-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/imutils-cpp/config.yml b/recipes/imutils-cpp/config.yml new file mode 100644 index 0000000000000..715e55357a17b --- /dev/null +++ b/recipes/imutils-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all From e205c46f26af11b5726a4db7746a67e2480bc788 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 20 Sep 2022 12:05:04 +0300 Subject: [PATCH 097/561] (#12764) Add gc/8.2.2 recipe * Add gc/8.2.2 recipe * Add gc/8.2.2 recipe * gc: rename update-cmake.patch to update-cmake-8_0_4.patch * Adapt new Tools Signed-off-by: Uilian Ries * bdwgc: Fix Cmake warning about unused enable_cord variable * bdwgc: Update libatomic_ops dependency to v7.6.14 * bdwgc: Call rmdir() after cmake install * bdwgc: Fix gctba not found installed * Prepare for Conan 2.0 Signed-off-by: Uilian Ries * bdwgc: Update CMakeLists.txt to find libatomic_ops package * bdwgc: Remove duplicates in options_defaults * bdwgc: Do not build docs Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/bdwgc/all/CMakeLists.txt | 7 - recipes/bdwgc/all/conandata.yml | 9 +- recipes/bdwgc/all/conanfile.py | 148 ++++++++++-------- ...e-cmake.patch => update-cmake-8_0_4.patch} | 12 +- .../all/patches/update-cmake-8_0_6.patch | 12 +- .../all/patches/update-cmake-8_2_2.patch | 17 ++ recipes/bdwgc/all/test_package/CMakeLists.txt | 5 +- recipes/bdwgc/all/test_package/conanfile.py | 17 +- .../bdwgc/all/test_v1_package/CMakeLists.txt | 10 ++ .../bdwgc/all/test_v1_package/conanfile.py | 17 ++ recipes/bdwgc/config.yml | 2 + 11 files changed, 176 insertions(+), 80 deletions(-) delete mode 100644 recipes/bdwgc/all/CMakeLists.txt rename recipes/bdwgc/all/patches/{update-cmake.patch => update-cmake-8_0_4.patch} (98%) create mode 100644 recipes/bdwgc/all/patches/update-cmake-8_2_2.patch create mode 100644 recipes/bdwgc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bdwgc/all/test_v1_package/conanfile.py diff --git a/recipes/bdwgc/all/CMakeLists.txt b/recipes/bdwgc/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f..0000000000000 --- a/recipes/bdwgc/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/bdwgc/all/conandata.yml b/recipes/bdwgc/all/conandata.yml index 1d60bdd779fbf..97d6a0b86b6e9 100644 --- a/recipes/bdwgc/all/conandata.yml +++ b/recipes/bdwgc/all/conandata.yml @@ -5,10 +5,13 @@ sources: "8.0.6": url: "https://github.com/ivmai/bdwgc/releases/download/v8.0.6/gc-8.0.6.tar.gz" sha256: "3b4914abc9fa76593596773e4da671d7ed4d5390e3d46fbf2e5f155e121bea11" + "8.2.2": + url: "https://github.com/ivmai/bdwgc/releases/download/v8.2.2/gc-8.2.2.tar.gz" + sha256: "f30107bcb062e0920a790ffffa56d9512348546859364c23a14be264b38836a0" patches: "8.0.4": - - patch_file: "patches/update-cmake.patch" - base_path: "source_subfolder" + - patch_file: "patches/update-cmake-8_0_4.patch" "8.0.6": - patch_file: "patches/update-cmake-8_0_6.patch" - base_path: "source_subfolder" + "8.2.2": + - patch_file: "patches/update-cmake-8_2_2.patch" diff --git a/recipes/bdwgc/all/conanfile.py b/recipes/bdwgc/all/conanfile.py index 9cf6cf0dd7e0b..0c861930ab15c 100644 --- a/recipes/bdwgc/all/conanfile.py +++ b/recipes/bdwgc/all/conanfile.py @@ -1,20 +1,21 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, get, save, rmdir, copy, load +from conan.errors import ConanException import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" class BdwGcConan(ConanFile): name = "bdwgc" homepage = "https://www.hboehm.info/gc/" description = "The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (libgc, bdwgc, boehm-gc)" - topics = ("conan", "gc", "garbage", "collector") + topics = ("gc", "garbage", "collector") url = "https://github.com/conan-io/conan-center-index" license = "MIT" settings = "os", "compiler", "build_type", "arch" - exports_sources = "CMakeLists.txt", "patches/**" - generators = "cmake" _autotools_options_defaults = ( ("cplusplus", False,), @@ -25,7 +26,6 @@ class BdwGcConan(ConanFile): ("handle_fork", True,), ("thread_local_alloc", True,), ("threads_discovery", True,), - ("parallel_mark", True,), ("gcj_support", True,), ("java_finalization", True,), ("sigrt_signals", False,), @@ -39,7 +39,6 @@ class BdwGcConan(ConanFile): ("munmap", True,), ("dynamic_loading", True,), ("register_main_static_data", True,), - ("gc_assertions", False,), ("checksums", False,), ("single_obj_compilation", False,), ) @@ -48,6 +47,7 @@ class BdwGcConan(ConanFile): "shared": [True, False], "fPIC": [True, False], } + default_options = { "shared": False, "fPIC": True, @@ -56,11 +56,9 @@ class BdwGcConan(ConanFile): options[option] = [True, False] default_options[option] = default - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -68,47 +66,60 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - if tools.Version(self.version) <= "8.0.6": + try: + del self.options.fPIC + except Exception: + pass + if Version(self.version) < "8.2.0": del self.options.throw_bad_alloc_library if not self.options.cplusplus: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.settings.os == "Windows": - self.requires("libatomic_ops/7.6.10") + self.requires("libatomic_ops/7.6.14") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) for option, _ in self._autotools_options_defaults: - self._cmake.definitions["enable_{}".format(option)] = self.options.get_safe(option) - self._cmake.definitions["disable_gc_debug"] = not self.options.gc_debug - self._cmake.definitions["disable_handle_fork"] = not self.options.handle_fork - self._cmake.definitions["install_headers"] = True - self._cmake.definitions["build_tests"] = False - self._cmake.verbose = True - self._cmake.parallel = False - self._cmake.configure() - return self._cmake - - def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + if option == "cord": + tc.variables["build_cord"] = self.options.get_safe(option) + elif option == "cplusplus": + tc.cache_variables["enable_cplusplus"] = str(self.options.get_safe(option)) + else: + tc.variables["enable_{}".format(option)] = self.options.get_safe(option) + tc.variables["disable_gc_debug"] = not self.options.gc_debug + tc.variables["disable_handle_fork"] = not self.options.handle_fork + tc.variables["install_headers"] = True + tc.variables["enable_docs"] = False + tc.variables["build_tests"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def _extract_copyright(self): - readme_md = open(os.path.join(self._source_subfolder, "README.md")).read() + readme_md = load(self, os.path.join(self.source_folder, "README.md")) copyright_header = "## Copyright & Warranty\n" index = readme_md.find(copyright_header) if index == -1: @@ -116,28 +127,43 @@ def _extract_copyright(self): return readme_md[index+len(copyright_header):] def package(self): - tools.save(os.path.join(self.package_folder, "licenses", "COPYRIGHT"), self._extract_copyright()) - cmake = self._configure_cmake() + save(self, os.path.join(self.package_folder, "licenses", "COPYRIGHT"), self._extract_copyright()) + cmake = CMake(self) cmake.install() - - @property - def _libs(self): - libs = [] - if self.options.get_safe("throw_bad_alloc_library"): - libs.append("gctba") - if self.options.cplusplus: - libs.append("gccpp") - if self.options.cord: - libs.append("cord") - libs.append("gc") - return libs + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.names["pkg_config"] = "bdw-gc" - self.cpp_info.libs = self._libs - self.cpp_info.defines = ["GC_DLL" if self.options.shared else "GC_NOT_DLL"] - if not self.options.shared: - if self.settings.os == "Linux": - self.cpp_info.system_libs = ["pthread", "dl"] + self.cpp_info.set_property("cmake_file_name", "BDWgc") + self.cpp_info.set_property("cmake_target_name", "BDWgc::BDWgc") + + # TODO: Remove on Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "BDWgc" + self.cpp_info.names["cmake_find_package_multi"] = "BDWgc" + + self.cpp_info.components["gc"].set_property("cmake_target_name", "BDWgc::gc") + self.cpp_info.components["gc"].set_property("pkg_config_name", "bdw-gc") + self.cpp_info.components["gc"].libs = ["gc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["gc"].system_libs = ["pthread", "dl"] + self.cpp_info.components["gc"].defines = ["GC_DLL" if self.options.shared else "GC_NOT_DLL"] if self.options.gc_debug: - self.cpp_info.defines.append("GC_DEBUG") + self.cpp_info.components["gc"].defines.append("GC_DEBUG") + if self.settings.os == "Windows": + self.cpp_info.components["gc"].requires = ["libatomic_ops::libatomic_ops"] + + if self.options.cplusplus and self.options.get_safe("throw_bad_alloc_library"): + self.cpp_info.components["gctba"].set_property("cmake_target_name", "BDWgc::gctba") + self.cpp_info.components["gctba"].libs = ["gctba"] + self.cpp_info.components["gctba"].requires = ["gc"] + + if self.options.cplusplus: + self.cpp_info.components["gccpp"].set_property("cmake_target_name", "BDWgc::gccpp") + self.cpp_info.components["gccpp"].libs = ["gccpp"] + self.cpp_info.components["gccpp"].requires = ["gc"] + + if self.options.cord: + self.cpp_info.components["cord"].set_property("cmake_target_name", "BDWgc::cord") + self.cpp_info.components["cord"].libs = ["cord"] + self.cpp_info.components["cord"].requires = ["gc"] diff --git a/recipes/bdwgc/all/patches/update-cmake.patch b/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch similarity index 98% rename from recipes/bdwgc/all/patches/update-cmake.patch rename to recipes/bdwgc/all/patches/update-cmake-8_0_4.patch index 35f75a11f629a..5a48c4e44df1a 100644 --- a/recipes/bdwgc/all/patches/update-cmake.patch +++ b/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -21,241 +21,596 @@ +@@ -21,241 +21,606 @@ # this will generate gc.sln # @@ -336,6 +336,16 @@ + set(THREADDLLIBS ${CMAKE_THREAD_LIBS_INIT}) + endif() + include_directories(libatomic_ops/src) ++ if (MSVC) ++ # TODO: Rename the following to Atomic_ops ++ find_package(libatomic_ops CONFIG) ++ if (libatomic_ops_FOUND) ++ # TODO: Rename the following to Atomic_ops::atomic_ops ++ get_target_property(AO_INCLUDE_DIRS libatomic_ops::libatomic_ops ++ INTERFACE_INCLUDE_DIRECTORIES) ++ include_directories(${AO_INCLUDE_DIRS}) ++ endif() ++ endif() + if (NOT (APPLE OR CYGWIN OR MSYS OR WIN32 OR HOST MATCHES mips-.*-irix6.*)) + set(THREADDLLIBS ${THREADDLLIBS} -ldl) + # The predefined CMAKE_DL_LIBS may be broken. diff --git a/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch b/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch index 97f0276e5915d..f2b5ba9e75570 100644 --- a/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch +++ b/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -21,232 +21,592 @@ +@@ -21,232 +21,602 @@ # this will generate gc.sln # @@ -322,6 +322,16 @@ + set(THREADDLLIBS ${CMAKE_THREAD_LIBS_INIT}) + endif() + include_directories(libatomic_ops/src) ++ if (MSVC) ++ # TODO: Rename the following to Atomic_ops ++ find_package(libatomic_ops CONFIG) ++ if (libatomic_ops_FOUND) ++ # TODO: Rename the following to Atomic_ops::atomic_ops ++ get_target_property(AO_INCLUDE_DIRS libatomic_ops::libatomic_ops ++ INTERFACE_INCLUDE_DIRECTORIES) ++ include_directories(${AO_INCLUDE_DIRS}) ++ endif() ++ endif() + if (NOT (APPLE OR CYGWIN OR MSYS OR WIN32 OR HOST MATCHES mips-.*-irix6.*)) + set(THREADDLLIBS ${THREADDLLIBS} -ldl) + # The predefined CMAKE_DL_LIBS may be broken. diff --git a/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch b/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch new file mode 100644 index 0000000000000..cb46e01322b4c --- /dev/null +++ b/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch @@ -0,0 +1,17 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -161,6 +161,14 @@ if (enable_threads) + message(STATUS "Thread library: ${CMAKE_THREAD_LIBS_INIT}") + if (without_libatomic_ops OR BORLAND OR MSVC OR WATCOM) + include_directories(libatomic_ops/src) ++ # TODO: Rename the following to Atomic_ops ++ find_package(libatomic_ops CONFIG) ++ if (libatomic_ops_FOUND) ++ # TODO: Rename the following to Atomic_ops::atomic_ops ++ get_target_property(AO_INCLUDE_DIRS libatomic_ops::libatomic_ops ++ INTERFACE_INCLUDE_DIRECTORIES) ++ include_directories(${AO_INCLUDE_DIRS}) ++ endif() + # Note: alternatively, use CFLAGS_EXTRA to pass -I<...>/libatomic_ops/src. + else() + # Assume the compiler supports GCC atomic intrinsics. diff --git a/recipes/bdwgc/all/test_package/CMakeLists.txt b/recipes/bdwgc/all/test_package/CMakeLists.txt index 7b9b613cbb24a..6b8623ba2be96 100644 --- a/recipes/bdwgc/all/test_package/CMakeLists.txt +++ b/recipes/bdwgc/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(BDWgc CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE BDWgc::gc) diff --git a/recipes/bdwgc/all/test_package/conanfile.py b/recipes/bdwgc/all/test_package/conanfile.py index b5ecfa88d3a13..fde7967ed16f1 100644 --- a/recipes/bdwgc/all/test_package/conanfile.py +++ b/recipes/bdwgc/all/test_package/conanfile.py @@ -1,10 +1,19 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.build import can_run class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package_multi", "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,5 +21,5 @@ 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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/bdwgc/all/test_v1_package/CMakeLists.txt b/recipes/bdwgc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8ab3169f9e927 --- /dev/null +++ b/recipes/bdwgc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(BDWgc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE BDWgc::gc) diff --git a/recipes/bdwgc/all/test_v1_package/conanfile.py b/recipes/bdwgc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..dfe389167a895 --- /dev/null +++ b/recipes/bdwgc/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake +from conan.tools.build import cross_building + + +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 cross_building(self): + self.run(os.path.join("bin","test_package"), run_environment=True) diff --git a/recipes/bdwgc/config.yml b/recipes/bdwgc/config.yml index 1f22cca255b0c..a32355f74df3f 100644 --- a/recipes/bdwgc/config.yml +++ b/recipes/bdwgc/config.yml @@ -3,3 +3,5 @@ versions: folder: all "8.0.6": folder: all + "8.2.2": + folder: all From 9382df5010ecd5c78a4323039ed9df0661568872 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 20 Sep 2022 11:24:51 +0200 Subject: [PATCH 098/561] (#12841) openal: conan v2 support * conan v2 support * fix windows build * minor changes * fix windows patch of 1.19.1 --- recipes/openal/all/CMakeLists.txt | 7 - recipes/openal/all/conandata.yml | 25 ++- recipes/openal/all/conanfile.py | 158 ++++++++---------- ....patch => 1.19.1-0001-aligned-alloc.patch} | 5 +- ...tch => 1.19.1-0002-gcc-10-fnocommon.patch} | 0 .../patches/1.19.1-0003-fix-windows-sdk.patch | 38 +++++ .../patches/1.20.1-0001-fix-windows-sdk.patch | 76 +++++++++ ...+14-does-not-have-std-aligned_alloc.patch} | 0 .../patches/1.21.0-0002-fix-windows-sdk.patch | 74 ++++++++ ...fix-al-optional-in-if-compile-error.patch} | 0 .../openal/all/test_package/CMakeLists.txt | 9 +- recipes/openal/all/test_package/conanfile.py | 21 ++- .../openal/all/test_v1_package/CMakeLists.txt | 10 ++ .../openal/all/test_v1_package/conanfile.py | 17 ++ 14 files changed, 322 insertions(+), 118 deletions(-) delete mode 100644 recipes/openal/all/CMakeLists.txt rename recipes/openal/all/patches/{1.19.1/aligned-alloc.patch => 1.19.1-0001-aligned-alloc.patch} (76%) rename recipes/openal/all/patches/{1.19.1/gcc-10-fnocommon.patch => 1.19.1-0002-gcc-10-fnocommon.patch} (100%) create mode 100644 recipes/openal/all/patches/1.19.1-0003-fix-windows-sdk.patch create mode 100644 recipes/openal/all/patches/1.20.1-0001-fix-windows-sdk.patch rename recipes/openal/all/patches/{1.21.0-c++14-does-not-have-std-aligned_alloc.patch => 1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch} (100%) create mode 100644 recipes/openal/all/patches/1.21.0-0002-fix-windows-sdk.patch rename recipes/openal/all/patches/{1.22.2-fix-al-optional-in-if-compile-error.patch => 1.22.2-0001-fix-al-optional-in-if-compile-error.patch} (100%) create mode 100644 recipes/openal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openal/all/test_v1_package/conanfile.py diff --git a/recipes/openal/all/CMakeLists.txt b/recipes/openal/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- a/recipes/openal/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/openal/all/conandata.yml b/recipes/openal/all/conandata.yml index 9f2fddbe352fc..909139e9bcbd7 100644 --- a/recipes/openal/all/conandata.yml +++ b/recipes/openal/all/conandata.yml @@ -16,13 +16,22 @@ sources: sha256: "9f3536ab2bb7781dbafabc6a61e0b34b17edd16bd6c2eaf2ae71bc63078f98c7" patches: "1.22.2": - - base_path: "source_subfolder" - patch_file: "patches/1.22.2-fix-al-optional-in-if-compile-error.patch" + - patch_file: "patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch" "1.21.0": - - base_path: "source_subfolder" - patch_file: "patches/1.21.0-c++14-does-not-have-std-aligned_alloc.patch" + - patch_file: "patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch" + - patch_file: "patches/1.21.0-0002-fix-windows-sdk.patch" + patch_description: "Avoid explicitly searching for the WindowsSDK" + patch_type: "backport" + patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" + "1.20.1": + - patch_file: "patches/1.20.1-0001-fix-windows-sdk.patch" + patch_description: "Avoid explicitly searching for the WindowsSDK" + patch_type: "backport" + patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" "1.19.1": - - base_path: "source_subfolder" - patch_file: "patches/1.19.1/aligned-alloc.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.19.1/gcc-10-fnocommon.patch" + - patch_file: "patches/1.19.1-0001-aligned-alloc.patch" + - patch_file: "patches/1.19.1-0002-gcc-10-fnocommon.patch" + - patch_file: "patches/1.19.1-0003-fix-windows-sdk.patch" + patch_description: "Avoid explicitly searching for the WindowsSDK" + patch_type: "backport" + patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" diff --git a/recipes/openal/all/conanfile.py b/recipes/openal/all/conanfile.py index e11010fd8f180..ad9125032f896 100644 --- a/recipes/openal/all/conanfile.py +++ b/recipes/openal/all/conanfile.py @@ -1,9 +1,15 @@ -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, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, get, rmdir, save +from conan.tools.scm import Version +from conans import tools as tools_legacy import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.3" class OpenALConan(ConanFile): @@ -24,30 +30,31 @@ class OpenALConan(ConanFile): "fPIC": True, } - generators = "cmake" - _cmake = None + @property + def _openal_cxx_backend(self): + return Version(self.version) >= "1.20" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "11" if Version(self.version) < "1.21" else "14" @property - def _build_subfolder(self): - return "build_subfolder" + def _minimum_compilers_version(self): + return { + "Visual Studio": "13" if Version(self.version) < "1.21" else "15", + "msvc": "180" if Version(self.version) < "1.21" else "191", + "gcc": "5", + "clang": "5", + } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - @property - def _openal_cxx_backend(self): - return tools.Version(self.version) >= "1.20" - def configure(self): if self.options.shared: del self.options.fPIC @@ -57,90 +64,65 @@ def configure(self): if not self._openal_cxx_backend: del self.settings.compiler.libcxx + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if self.settings.os == "Linux": - self.requires("libalsa/1.2.5.1") + self.requires("libalsa/1.2.7.2") - @property - def _supports_cxx14(self): - if self.settings.compiler == "clang" and self.settings.compiler.libcxx in ("libstdc++", "libstdc++11"): - if tools.Version(self.settings.compiler.version) < "9": - return False, "openal on clang {} cannot be built with stdlibc++(11) c++ runtime".format(self.settings.compiler.version) - min_version = { - "Visual Studio": "15", - "gcc": "5", - "clang": "5", - }.get(str(self.settings.compiler)) - if min_version and tools.Version(self.settings.compiler.version) < min_version: - return False, "This compiler version does not support c++14" - return True, None + def validate(self): + if self._openal_cxx_backend: + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - @property - def _supports_cxx11(self): - if self.settings.compiler == "clang" and self.settings.compiler.libcxx in ("libstdc++", "libstdc++11"): - if tools.Version(self.settings.compiler.version) < "9": - return False, "openal on clang {} cannot be built with stdlibc++(11) c++ runtime".format(self.settings.compiler.version) - min_version = { - "Visual Studio": "13", - "gcc": "5", - "clang": "5", - }.get(str(self.settings.compiler)) - if min_version and tools.Version(self.settings.compiler.version) < min_version: - return False, "This compiler version does not support c++11" - return True, None + compiler = self.info.settings.compiler - def validate(self): - if tools.Version(self.version) >= "1.21": - ok, msg = self._supports_cxx14 - if not ok: - raise ConanInvalidConfiguration(msg) - if msg: - self.output.warn(msg) - elif tools.Version(self.version) >= "1.20": - ok, msg = self._supports_cxx11 - if not ok: - raise ConanInvalidConfiguration(msg) - if msg: - self.output.warn(msg) + minimum_version = self._minimum_compilers_version.get(str(compiler), False) + if minimum_version and Version(compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if compiler == "clang" and Version(compiler.version) < "9" and \ + compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"): + raise ConanInvalidConfiguration( + f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime", + ) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["LIBTYPE"] = "SHARED" if self.options.shared else "STATIC" - self._cmake.definitions["ALSOFT_UTILS"] = False - self._cmake.definitions["ALSOFT_EXAMPLES"] = False - self._cmake.definitions["ALSOFT_TESTS"] = False - self._cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_SoundIO"] = True - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBTYPE"] = "SHARED" if self.options.shared else "STATIC" + tc.variables["ALSOFT_UTILS"] = False + tc.variables["ALSOFT_EXAMPLES"] = False + tc.variables["ALSOFT_TESTS"] = False + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_SoundIO"] = True + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) self._create_cmake_module_variables( os.path.join(self.package_folder, self._module_file_rel_path) ) - @staticmethod - def _create_cmake_module_variables(module_file): + def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ - if(DEFINED OpenAL_FOUND) - set(OPENAL_FOUND ${OpenAL_FOUND}) - endif() + set(OPENAL_FOUND TRUE) if(DEFINED OpenAL_INCLUDE_DIR) set(OPENAL_INCLUDE_DIR ${OpenAL_INCLUDE_DIR}) endif() @@ -151,11 +133,11 @@ def _create_cmake_module_variables(module_file): set(OPENAL_VERSION_STRING ${OpenAL_VERSION}) endif() """) - tools.save(module_file, content) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-variables.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") @@ -168,16 +150,16 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "OpenAL" self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) self.cpp_info.includedirs.append(os.path.join("include", "AL")) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "m"]) - elif tools.is_apple_os(self.settings.os): + elif is_apple_os(self): self.cpp_info.frameworks.extend(["AudioToolbox", "CoreAudio", "CoreFoundation"]) elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["winmm", "ole32", "shell32", "User32"]) - if self._openal_cxx_backend: - libcxx = tools.stdcpp_library(self) + if self._openal_cxx_backend and not self.options.shared: + libcxx = tools_legacy.stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) if not self.options.shared: diff --git a/recipes/openal/all/patches/1.19.1/aligned-alloc.patch b/recipes/openal/all/patches/1.19.1-0001-aligned-alloc.patch similarity index 76% rename from recipes/openal/all/patches/1.19.1/aligned-alloc.patch rename to recipes/openal/all/patches/1.19.1-0001-aligned-alloc.patch index 0bb0b5673fe4d..f734aeb89945e 100644 --- a/recipes/openal/all/patches/1.19.1/aligned-alloc.patch +++ b/recipes/openal/all/patches/1.19.1-0001-aligned-alloc.patch @@ -1,12 +1,11 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cf10bc203..605285152 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -546,7 +546,6 @@ IF(HAVE_INTRIN_H) +@@ -546,7 +546,7 @@ IF(HAVE_INTRIN_H) ENDIF() CHECK_SYMBOL_EXISTS(sysconf unistd.h HAVE_SYSCONF) -CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) ++#CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) CHECK_SYMBOL_EXISTS(_aligned_malloc malloc.h HAVE__ALIGNED_MALLOC) CHECK_SYMBOL_EXISTS(proc_pidpath libproc.h HAVE_PROC_PIDPATH) diff --git a/recipes/openal/all/patches/1.19.1/gcc-10-fnocommon.patch b/recipes/openal/all/patches/1.19.1-0002-gcc-10-fnocommon.patch similarity index 100% rename from recipes/openal/all/patches/1.19.1/gcc-10-fnocommon.patch rename to recipes/openal/all/patches/1.19.1-0002-gcc-10-fnocommon.patch diff --git a/recipes/openal/all/patches/1.19.1-0003-fix-windows-sdk.patch b/recipes/openal/all/patches/1.19.1-0003-fix-windows-sdk.patch new file mode 100644 index 0000000000000..922c2a2f1c321 --- /dev/null +++ b/recipes/openal/all/patches/1.19.1-0003-fix-windows-sdk.patch @@ -0,0 +1,38 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1092,17 +1092,24 @@ IF(HAVE_WINDOWS_H) + ENDIF() + + # Check DSound backend +- FIND_PACKAGE(DSound) +- IF(DSOUND_FOUND) +- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) +- IF(ALSOFT_BACKEND_DSOUND) +- SET(HAVE_DSOUND 1) +- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") +- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c) +- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES}) +- SET(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) +- ENDIF() +- ENDIF() ++ check_include_file(dsound.h HAVE_DSOUND_H) ++ if(DXSDK_DIR) ++ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" ++ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include ++ DOC "The DirectSound include directory") ++ endif() ++ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) ++ option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) ++ if(ALSOFT_BACKEND_DSOUND) ++ set(HAVE_DSOUND 1) ++ set(BACKENDS "${BACKENDS} DirectSound,") ++ set(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c) ++ ++ if(NOT HAVE_DSOUND_H) ++ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) ++ endif() ++ endif() ++ endif() + + # Check for WASAPI backend + CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H) diff --git a/recipes/openal/all/patches/1.20.1-0001-fix-windows-sdk.patch b/recipes/openal/all/patches/1.20.1-0001-fix-windows-sdk.patch new file mode 100644 index 0000000000000..61ba2e012e0da --- /dev/null +++ b/recipes/openal/all/patches/1.20.1-0001-fix-windows-sdk.patch @@ -0,0 +1,76 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -854,44 +854,38 @@ OPTION(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF) + OPTION(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF) + OPTION(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF) + IF(WIN32) +- SET(WINSDK_LIB_DIRS ) +- SET(WINSDK_INCLUDE_DIRS ) +- FIND_PACKAGE(WindowsSDK) +- IF(WINDOWSSDK_FOUND) +- get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) +- get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) +- ENDIF() +- +- SET(OLD_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}) +- SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_WIN32_WINNT=0x0502) +- + # Check MMSystem backend +- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) +- FIND_LIBRARY(WINMM_LIBRARY NAMES winmm +- PATHS ${WINSDK_LIB_DIRS} +- PATH_SUFFIXES lib lib/x86 lib/x64) +- IF(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) +- OPTION(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) +- IF(ALSOFT_BACKEND_WINMM) +- SET(HAVE_WINMM 1) +- SET(BACKENDS "${BACKENDS} WinMM,") +- SET(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) +- SET(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) +- ENDIF() +- ENDIF() ++ option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) ++ if(ALSOFT_BACKEND_WINMM) ++ set(HAVE_WINMM 1) ++ set(BACKENDS "${BACKENDS} WinMM,") ++ set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) ++ # There doesn't seem to be good way to search for winmm.lib for MSVC. ++ # find_library doesn't find it without being told to look in a specific ++ # place in the WindowsSDK, but it links anyway. If there ends up being ++ # Windows targets without this, another means to detect it is needed. ++ set(EXTRA_LIBS winmm ${EXTRA_LIBS}) ++ endif() + + # Check DSound backend +- FIND_PACKAGE(DSound) +- IF(DSOUND_FOUND) +- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) +- IF(ALSOFT_BACKEND_DSOUND) +- SET(HAVE_DSOUND 1) +- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") +- SET(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) +- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES}) +- SET(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) +- ENDIF() +- ENDIF() ++ check_include_file(dsound.h HAVE_DSOUND_H) ++ if(DXSDK_DIR) ++ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" ++ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include ++ DOC "The DirectSound include directory") ++ endif() ++ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) ++ option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) ++ if(ALSOFT_BACKEND_DSOUND) ++ set(HAVE_DSOUND 1) ++ set(BACKENDS "${BACKENDS} DirectSound,") ++ set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) ++ ++ if(NOT HAVE_DSOUND_H) ++ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) ++ endif() ++ endif() ++ endif() + + # Check for WASAPI backend + CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H) diff --git a/recipes/openal/all/patches/1.21.0-c++14-does-not-have-std-aligned_alloc.patch b/recipes/openal/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch similarity index 100% rename from recipes/openal/all/patches/1.21.0-c++14-does-not-have-std-aligned_alloc.patch rename to recipes/openal/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch diff --git a/recipes/openal/all/patches/1.21.0-0002-fix-windows-sdk.patch b/recipes/openal/all/patches/1.21.0-0002-fix-windows-sdk.patch new file mode 100644 index 0000000000000..3a6c7afb5a414 --- /dev/null +++ b/recipes/openal/all/patches/1.21.0-0002-fix-windows-sdk.patch @@ -0,0 +1,74 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -880,49 +880,36 @@ option(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF) + option(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF) + option(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF) + if(WIN32) +- set(WINSDK_LIB_DIRS ) +- set(WINSDK_INCLUDE_DIRS ) +- find_package(WindowsSDK) +- if(WINDOWSSDK_FOUND) +- get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) +- get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) +- endif() +- + # Check MMSystem backend +- check_include_files("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) +- find_library(WINMM_LIBRARY NAMES winmm +- PATHS ${WINSDK_LIB_DIRS}) +- if(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) +- option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) +- if(ALSOFT_BACKEND_WINMM) +- set(HAVE_WINMM 1) +- set(BACKENDS "${BACKENDS} WinMM,") +- set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) +- set(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) +- endif() ++ option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) ++ if(ALSOFT_BACKEND_WINMM) ++ set(HAVE_WINMM 1) ++ set(BACKENDS "${BACKENDS} WinMM,") ++ set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) ++ # There doesn't seem to be good way to search for winmm.lib for MSVC. ++ # find_library doesn't find it without being told to look in a specific ++ # place in the WindowsSDK, but it links anyway. If there ends up being ++ # Windows targets without this, another means to detect it is needed. ++ set(EXTRA_LIBS winmm ${EXTRA_LIBS}) + endif() + + # Check DSound backend +- find_package(DSound) +- if(DSOUND_FOUND) ++ check_include_file(dsound.h HAVE_DSOUND_H) ++ if(DXSDK_DIR) ++ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" ++ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include ++ DOC "The DirectSound include directory") ++ endif() ++ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) + option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) + if(ALSOFT_BACKEND_DSOUND) + set(HAVE_DSOUND 1) +- set(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") +- set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) +- add_backend_libs(${DSOUND_LIBRARIES}) +- set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) +- endif() +- endif() ++ set(BACKENDS "${BACKENDS} DirectSound,") ++ set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) + +- # Check for WASAPI backend +- check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H) +- if(HAVE_MMDEVICEAPI_H) +- option(ALSOFT_BACKEND_WASAPI "Enable WASAPI backend" ON) +- if(ALSOFT_BACKEND_WASAPI) +- set(HAVE_WASAPI 1) +- set(BACKENDS "${BACKENDS} WASAPI,") +- set(ALC_OBJS ${ALC_OBJS} alc/backends/wasapi.cpp alc/backends/wasapi.h) ++ if(NOT HAVE_DSOUND_H) ++ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) ++ endif() + endif() + endif() + endif() diff --git a/recipes/openal/all/patches/1.22.2-fix-al-optional-in-if-compile-error.patch b/recipes/openal/all/patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch similarity index 100% rename from recipes/openal/all/patches/1.22.2-fix-al-optional-in-if-compile-error.patch rename to recipes/openal/all/patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch diff --git a/recipes/openal/all/test_package/CMakeLists.txt b/recipes/openal/all/test_package/CMakeLists.txt index 43f738951a358..f25fa5a765b27 100644 --- a/recipes/openal/all/test_package/CMakeLists.txt +++ b/recipes/openal/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(OpenAL REQUIRED CONFIG) +find_package(OpenAL REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} OpenAL::OpenAL) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenAL::OpenAL) diff --git a/recipes/openal/all/test_package/conanfile.py b/recipes/openal/all/test_package/conanfile.py index 49a3a66ea5bad..0a6bc68712d90 100644 --- a/recipes/openal/all/test_package/conanfile.py +++ b/recipes/openal/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openal/all/test_v1_package/CMakeLists.txt b/recipes/openal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6ea75c1516be0 --- /dev/null +++ b/recipes/openal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(OpenAL REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenAL::OpenAL) diff --git a/recipes/openal/all/test_v1_package/conanfile.py b/recipes/openal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/openal/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 570a2c35aaff022b1135f491e3238836aa934854 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 20 Sep 2022 12:05:45 +0200 Subject: [PATCH 099/561] (#12868) poco: conan v2 support * conan v2 support * use self.dependencies instead of self.deps_cpp_info * typo * fix libpq target only if version >= 1.10.0 * minor change * properly handle pcre injection through CMakeDeps --- recipes/poco/all/CMakeLists.txt | 26 -- recipes/poco/all/conandata.yml | 28 +- recipes/poco/all/conanfile.py | 197 ++++++++----- recipes/poco/all/patches/1.10.0.patch | 25 +- recipes/poco/all/patches/1.10.1.patch | 25 +- recipes/poco/all/patches/1.11.0.patch | 13 +- recipes/poco/all/patches/1.11.1.patch | 13 +- recipes/poco/all/patches/1.11.2.patch | 41 --- recipes/poco/all/patches/1.11.3.patch | 41 --- recipes/poco/all/patches/1.12.0.patch | 2 +- recipes/poco/all/patches/1.12.1.patch | 2 +- recipes/poco/all/patches/1.12.2.patch | 2 +- recipes/poco/all/patches/1.8.1.patch | 51 ++-- recipes/poco/all/patches/1.9.2-2.patch | 273 ------------------ recipes/poco/all/patches/1.9.2.patch | 51 ++-- recipes/poco/all/test_package/CMakeLists.txt | 5 +- recipes/poco/all/test_package/conanfile.py | 80 +++-- .../poco/all/test_v1_package/CMakeLists.txt | 96 ++++++ recipes/poco/all/test_v1_package/conanfile.py | 61 ++++ 19 files changed, 450 insertions(+), 582 deletions(-) delete mode 100644 recipes/poco/all/CMakeLists.txt delete mode 100644 recipes/poco/all/patches/1.11.2.patch delete mode 100644 recipes/poco/all/patches/1.11.3.patch delete mode 100644 recipes/poco/all/patches/1.9.2-2.patch create mode 100644 recipes/poco/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/poco/all/test_v1_package/conanfile.py diff --git a/recipes/poco/all/CMakeLists.txt b/recipes/poco/all/CMakeLists.txt deleted file mode 100644 index 4568af6253394..0000000000000 --- a/recipes/poco/all/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.5.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -if(MYSQL_ROOT_DIR) - find_package(MySQL REQUIRED) - add_library(MySQL::client INTERFACE IMPORTED) - target_link_libraries(MySQL::client INTERFACE MySQL::MySQL) -endif() -if(PostgreSQL_ROOT_DIR) - find_package(PostgreSQL REQUIRED) - add_library(PostgreSQL::client INTERFACE IMPORTED) - target_link_libraries(PostgreSQL::client INTERFACE PostgreSQL::PostgreSQL) -endif() - -# Disable automatic linking on MSVC -add_definitions(-DPOCO_NO_AUTOMATIC_LIBS) - -if ("${CONAN_PACKAGE_VERSION}" VERSION_GREATER "1.10") - add_definitions(-DXML_DTD) -endif() - - -add_subdirectory(src) diff --git a/recipes/poco/all/conandata.yml b/recipes/poco/all/conandata.yml index d703b99d41fba..0bfa0e1ae52b7 100644 --- a/recipes/poco/all/conandata.yml +++ b/recipes/poco/all/conandata.yml @@ -38,57 +38,33 @@ sources: patches: "1.12.2": - patch_file: patches/1.12.2.patch - base_path: src - patch_file: patches/0002-mysql-include.patch - base_path: src "1.12.1": - patch_file: patches/1.12.1.patch - base_path: src - patch_file: patches/0002-mysql-include.patch - base_path: src "1.12.0": - patch_file: patches/1.12.0.patch - base_path: src - patch_file: patches/0002-mysql-include.patch - base_path: src "1.11.3": - - patch_file: patches/1.11.3.patch - base_path: src + - patch_file: patches/1.11.1.patch - patch_file: patches/0002-mysql-include.patch - base_path: src "1.11.2": - - patch_file: patches/1.11.2.patch - base_path: src + - patch_file: patches/1.11.1.patch - patch_file: patches/0002-mysql-include.patch - base_path: src "1.11.1": - patch_file: patches/1.11.1.patch - base_path: src - patch_file: patches/0002-mysql-include.patch - base_path: src "1.11.0": - patch_file: patches/1.11.0.patch - base_path: src - patch_file: patches/0002-mysql-include.patch - base_path: src "1.10.1": - patch_file: patches/1.10.1.patch - base_path: src "1.10.0": - patch_file: patches/1.10.0.patch - base_path: src - patch_file: patches/1.10.0-set-missing-cmake-variable.patch - base_path: src "1.9.4": - patch_file: patches/1.9.2.patch - base_path: src - - patch_file: patches/1.9.2-2.patch - base_path: src "1.9.3": - patch_file: patches/1.9.2.patch - base_path: src - - patch_file: patches/1.9.2-2.patch - base_path: src "1.8.1": - patch_file: patches/1.8.1.patch - base_path: src diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py index e1b9d2b9a307d..33e5ef0218ed0 100644 --- a/recipes/poco/all/conanfile.py +++ b/recipes/poco/all/conanfile.py @@ -1,17 +1,13 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import msvc_runtime_flag, is_msvc +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, VCVars from conan.tools.scm import Version -from conan.tools.files import get, patch, rmdir - -from conans import CMake, tools - from collections import namedtuple -import functools import os - -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.50.0" class PocoConan(ConanFile): @@ -80,20 +76,9 @@ class PocoConan(ConanFile): default_options[comp.option] = comp.default_option del comp - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "src" - - @property - def _build_subfolder(self): - return "build" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -101,16 +86,16 @@ def config_options(self): del self.options.enable_fork else: del self.options.enable_netssl_win - if Version(self.version) < "1.9": + if Version(self.version) < "1.9.0": del self.options.enable_encodings - if Version(self.version) < "1.10": + if Version(self.version) < "1.10.0": del self.options.enable_data_mysql del self.options.enable_data_postgresql del self.options.enable_jwt - if Version(self.version) < "1.11": + if Version(self.version) < "1.11.0": del self.options.enable_activerecord del self.options.enable_activerecord_compiler - if Version(self.version) < "1.12": + if Version(self.version) < "1.12.0": del self.options.enable_prometheus def configure(self): @@ -124,12 +109,15 @@ def configure(self): if not self.options.enable_json: util_dependencies = self._poco_component_tree["Util"].dependencies self._poco_component_tree["Util"] = self._poco_component_tree["Util"]._replace(dependencies = [x for x in util_dependencies if x != "JSON"]) - if Version(self.version) >= "1.12": + if Version(self.version) >= "1.12.0": foundation_external_dependencies = self._poco_component_tree["Foundation"].external_dependencies self._poco_component_tree["Foundation"] = self._poco_component_tree["Foundation"]._replace(external_dependencies = list(map(lambda x: 'pcre2::pcre2' if x == 'pcre::pcre' else x, foundation_external_dependencies))) + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): - if Version(self.version) < "1.12": + if Version(self.version) < "1.12.0": self.requires("pcre/8.45") else: self.requires("pcre2/10.40") @@ -151,11 +139,14 @@ def requirements(self): if self.options.get_safe("enable_data_mysql"): self.requires("libmysqlclient/8.0.29") + def package_id(self): + del self.info.options.enable_active_record + def validate(self): - if self.options.enable_apacheconnector: + if self.info.options.enable_apacheconnector: # FIXME: missing apache2 recipe + few issues raise ConanInvalidConfiguration("Apache connector not supported: https://github.com/pocoproject/poco/issues/1764") - if is_msvc(self) and self.options.shared and "MT" in msvc_runtime_flag(self): + if is_msvc(self) and self.info.options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Cannot build shared poco libraries with MT(d) runtime") for compopt in self._poco_component_tree.values(): if not compopt.option: @@ -165,74 +156,128 @@ def validate(self): if not self._poco_component_tree[compdep].option: continue if not self.options.get_safe(self._poco_component_tree[compdep].option, False): - raise ConanInvalidConfiguration("option {} requires also option {}".format(compopt.option, self._poco_component_tree[compdep].option)) - if self.options.enable_data_sqlite: - if self.options["sqlite3"].threadsafe == 0: + raise ConanInvalidConfiguration(f"option {compopt.option} requires also option {self._poco_component_tree[compdep].option}") + if self.info.options.enable_data_sqlite: + if self.dependencies["sqlite3"].options.threadsafe == 0: raise ConanInvalidConfiguration("sqlite3 must be built with threadsafe enabled") - if self.options.enable_netssl and self.options.get_safe("enable_netssl_win", False): + if self.info.options.enable_netssl and self.options.get_safe("enable_netssl_win", False): raise ConanInvalidConfiguration("Conflicting enable_netssl[_win] settings") def source(self): get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + destination=self.source_folder, strip_root=True) - def _patch_sources(self): - for data in self.conan_data.get("patches", {}).get(self.version, []): - patch(self, **data) + def _dep_include_paths(self, dep): + dep_info = self.dependencies[dep] + return [os.path.join(dep_info.package_folder, dir).replace("\\", "/") for dir in dep_info.cpp_info.includedirs] - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CMAKE_BUILD_TYPE"] = self.settings.build_type + def _dep_lib_paths(self, dep): + dep_info = self.dependencies[dep] + return [os.path.join(dep_info.package_folder, dir).replace("\\", "/") for dir in dep_info.cpp_info.libdirs] + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_BUILD_TYPE"] = self.settings.build_type if Version(self.version) < "1.10.1": - cmake.definitions["POCO_STATIC"] = not self.options.shared + tc.variables["POCO_STATIC"] = not self.options.shared for comp in self._poco_component_tree.values(): if comp.option: - cmake.definitions[comp.option.upper()] = self.options.get_safe(comp.option, False) - cmake.definitions["POCO_UNBUNDLED"] = True - cmake.definitions["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True + tc.variables[comp.option.upper()] = self.options.get_safe(comp.option, False) + tc.variables["POCO_UNBUNDLED"] = True + tc.variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True if is_msvc(self): - cmake.definitions["POCO_MT"] = "MT" in msvc_runtime_flag(self) + tc.variables["POCO_MT"] = is_msvc_static_runtime(self) if self.options.get_safe("enable_data_postgresql", False): - cmake.definitions["PostgreSQL_ROOT_DIR"] = self.deps_cpp_info["libpq"].rootpath - cmake.definitions["PostgreSQL_ROOT_INCLUDE_DIRS"] = ";".join(self.deps_cpp_info["libpq"].include_paths) - cmake.definitions["PostgreSQL_ROOT_LIBRARY_DIRS"] = ";".join(self.deps_cpp_info["libpq"].lib_paths) + tc.variables["PostgreSQL_ROOT_DIR"] = self.dependencies["libpq"].package_folder.replace("\\", "/") + tc.variables["PostgreSQL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("libpq")) + tc.variables["PostgreSQL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("libpq")) if self.options.get_safe("enable_data_mysql", False): - cmake.definitions["MYSQL_ROOT_DIR"] = self.deps_cpp_info["libmysqlclient"].rootpath - cmake.definitions["MYSQL_ROOT_INCLUDE_DIRS"] = ";".join(self.deps_cpp_info["libmysqlclient"].include_paths) - cmake.definitions["MYSQL_INCLUDE_DIR"] = ";".join(self.deps_cpp_info["libmysqlclient"].include_paths) - cmake.definitions["MYSQL_ROOT_LIBRARY_DIRS"] = ";".join(self.deps_cpp_info["libmysqlclient"].lib_paths) + tc.variables["MYSQL_ROOT_DIR"] = self.dependencies["libmysqlclient"].package_folder.replace("\\", "/") + tc.variables["MYSQL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("libmysqlclient")) + tc.variables["MYSQL_INCLUDE_DIR"] = ";".join(self._dep_include_paths("libmysqlclient")) + tc.variables["MYSQL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("libmysqlclient")) if self.options.enable_apacheconnector: - cmake.definitions["APR_ROOT_DIR"] = self.deps_cpp_info["apr"].rootpath - cmake.definitions["APR_ROOT_INCLUDE_DIRS"] = ";".join(self.deps_cpp_info["apr"].include_paths) - cmake.definitions["APR_ROOT_LIBRARY_DIRS"] = ";".join(self.deps_cpp_info["apr"].lib_paths) - cmake.definitions["APRUTIL_ROOT_DIR"] = self.deps_cpp_info["apr-util"].rootpath - cmake.definitions["APRUTIL_ROOT_INCLUDE_DIRS"] = ";".join(self.deps_cpp_info["apr-util"].include_paths) - cmake.definitions["APRUTIL_ROOT_LIBRARY_DIRS"] = ";".join(self.deps_cpp_info["apr-util"].lib_paths) - + tc.variables["APR_ROOT_DIR"] = self.dependencies["apr"].package_folder.replace("\\", "/") + tc.variables["APR_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("apr")) + tc.variables["APR_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("apr")) + tc.variables["APRUTIL_ROOT_DIR"] = self.dependencies["apr-util"].package_folder.replace("\\", "/") + tc.variables["APRUTIL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("apr-util")) + tc.variables["APRUTIL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("apr-util")) # Disable fork if not self.options.get_safe("enable_fork", True): - cmake.definitions["POCO_NO_FORK_EXEC"] = True - # On Windows, Poco needs a message (MC) compiler. - with tools.vcvars(self.settings) if is_msvc(self) else tools.no_op(): - cmake.configure(build_dir=self._build_subfolder) - return cmake + tc.variables["POCO_NO_FORK_EXEC"] = True + # Disable automatic linking on MSVC + tc.preprocessor_definitions["POCO_NO_AUTOMATIC_LIBS"] = "1" + # Picked up from conan v1 CMake wrapper, don't know the rationale + if Version(self.version) >= "1.11.0": + tc.preprocessor_definitions["XML_DTD"] = "1" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + if is_msvc(self): + # On Windows, Poco needs a message (MC) compiler. + vcvars = VCVars(self) + vcvars.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # mysql + if self.options.get_safe("enable_data_mysql"): + mysql_cpp_info = self.dependencies["libmysqlclient"].cpp_info + mysql_config_file = mysql_cpp_info.get_property("cmake_file_name") or "libmysqlclient" + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(MySQL REQUIRED)", + f"find_package({mysql_config_file} REQUIRED CONFIG)\nset(MYSQL_FOUND TRUE)", + ) + mysql_target_name = mysql_cpp_info.get_property("cmake_target_name") or "libmysqlclient::libmysqlclient" + replace_in_file( + self, + os.path.join(self.source_folder, "Data", "MySQL", "CMakeLists.txt"), + "MySQL::client", + mysql_target_name, + ) + # libpq + if self.options.get_safe("enable_data_postgresql"): + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(PostgreSQL REQUIRED)", + "find_package(PostgreSQL REQUIRED)\nset(POSTGRESQL_FOUND TRUE)", + ) + replace_in_file( + self, + os.path.join(self.source_folder, "Data", "PostgreSQL", "CMakeLists.txt"), + "PostgreSQL::client", + "PostgreSQL::PostgreSQL", + ) + # Ensure to use FindEXPAT.cmake instead of expat-config.cmake + # (side effect of CMAKE_FIND_PACKAGE_PREFER_CONFIG ON, see https://github.com/conan-io/conan/issues/10387) + replace_in_file( + self, + os.path.join(self.source_folder, "XML", "CMakeLists.txt"), + "find_package(EXPAT REQUIRED)", + "find_package(EXPAT REQUIRED MODULE)", + ) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() - def package_id(self): - del self.info.options.enable_active_record - def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "cmake")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Poco") @@ -249,14 +294,14 @@ def package_info(self): for compname, comp in self._poco_component_tree.items(): if comp.option is None or self.options.get_safe(comp.option): - conan_component = "poco_{}".format(compname.lower()) - requires = ["poco_{}".format(dependency.lower()) for dependency in comp.dependencies] + comp.external_dependencies - self.cpp_info.components[conan_component].set_property("cmake_target_name", "Poco::{}".format(compname)) + conan_component = f"poco_{compname.lower()}" + requires = [f"poco_{dependency.lower()}" for dependency in comp.dependencies] + comp.external_dependencies + self.cpp_info.components[conan_component].set_property("cmake_target_name", f"Poco::{compname}") self.cpp_info.components[conan_component].set_property("cmake_file_name", compname) self.cpp_info.components[conan_component].names["cmake_find_package"] = compname self.cpp_info.components[conan_component].names["cmake_find_package_multi"] = compname if comp.is_lib: - self.cpp_info.components[conan_component].libs = ["Poco{}{}".format(compname, suffix)] + self.cpp_info.components[conan_component].libs = [f"Poco{compname}{suffix}"] self.cpp_info.components[conan_component].requires = requires if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/poco/all/patches/1.10.0.patch b/recipes/poco/all/patches/1.10.0.patch index 8d3a1c5ec9d9a..a293b75b06fea 100644 --- a/recipes/poco/all/patches/1.10.0.patch +++ b/recipes/poco/all/patches/1.10.0.patch @@ -1,5 +1,5 @@ ---- cmake/PocoMacros.cmake -+++ cmake/PocoMacros.cmake +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake @@ -40,7 +40,7 @@ if(WIN32) endforeach() endif (X64) @@ -18,19 +18,28 @@ endif() endmacro() ---- Foundation/CMakeLists.txt -+++ Foundation/CMakeLists.txt -@@ -101,7 +101,7 @@ +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES( SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if (POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) ++ find_package(pcre REQUIRED CONFIG) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library +@@ -101,7 +101,7 @@ set_target_properties(Foundation ) if (POCO_UNBUNDLED) - target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE::PCRE ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) endif (POCO_UNBUNDLED) ---- NetSSL_Win/CMakeLists.txt -+++ NetSSL_Win/CMakeLists.txt +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt @@ -21,7 +21,7 @@ DEFINE_SYMBOL NetSSL_Win_EXPORTS ) diff --git a/recipes/poco/all/patches/1.10.1.patch b/recipes/poco/all/patches/1.10.1.patch index eced959820559..60675d563d9b5 100644 --- a/recipes/poco/all/patches/1.10.1.patch +++ b/recipes/poco/all/patches/1.10.1.patch @@ -1,5 +1,5 @@ ---- cmake/PocoMacros.cmake -+++ cmake/PocoMacros.cmake +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake @@ -40,7 +40,7 @@ if(WIN32) endforeach() endif(X64) @@ -18,19 +18,28 @@ endif() endmacro() ---- Foundation/CMakeLists.txt -+++ Foundation/CMakeLists.txt -@@ -101,7 +101,7 @@ +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if(POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) ++ find_package(pcre REQUIRED CONFIG) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library +@@ -101,7 +101,7 @@ set_target_properties(Foundation ) if(POCO_UNBUNDLED) - target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE::PCRE ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) endif(POCO_UNBUNDLED) ---- NetSSL_Win/CMakeLists.txt -+++ NetSSL_Win/CMakeLists.txt +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt @@ -21,7 +21,7 @@ DEFINE_SYMBOL NetSSL_Win_EXPORTS ) diff --git a/recipes/poco/all/patches/1.11.0.patch b/recipes/poco/all/patches/1.11.0.patch index 3674bba4e7e39..1e07c041d0c68 100644 --- a/recipes/poco/all/patches/1.11.0.patch +++ b/recipes/poco/all/patches/1.11.0.patch @@ -21,15 +21,24 @@ index 97eecfe..fa4e85b 100644 INCLUDES DESTINATION include ) diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index 6b276be..81cb8b7 100644 +index 6b276bef5..92ea97727 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if(POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) ++ find_package(pcre REQUIRED CONFIG) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library @@ -101,7 +101,7 @@ set_target_properties(Foundation ) if(POCO_UNBUNDLED) - target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE::PCRE ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) endif(POCO_UNBUNDLED) diff --git a/recipes/poco/all/patches/1.11.1.patch b/recipes/poco/all/patches/1.11.1.patch index 16729af37dce3..e5f552582596d 100644 --- a/recipes/poco/all/patches/1.11.1.patch +++ b/recipes/poco/all/patches/1.11.1.patch @@ -1,13 +1,22 @@ diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index 6b276be..81cb8b7 100644 +index 6b276bef5..92ea97727 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt +@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if(POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) ++ find_package(pcre REQUIRED CONFIG) + find_package(ZLIB REQUIRED) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library @@ -101,7 +101,7 @@ set_target_properties(Foundation ) if(POCO_UNBUNDLED) - target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE::PCRE ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) endif(POCO_UNBUNDLED) diff --git a/recipes/poco/all/patches/1.11.2.patch b/recipes/poco/all/patches/1.11.2.patch deleted file mode 100644 index 16729af37dce3..0000000000000 --- a/recipes/poco/all/patches/1.11.2.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index 6b276be..81cb8b7 100644 ---- a/Foundation/CMakeLists.txt -+++ b/Foundation/CMakeLists.txt -@@ -101,7 +101,7 @@ set_target_properties(Foundation - ) - - if(POCO_UNBUNDLED) -- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE::PCRE ZLIB::ZLIB) - target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) - endif(POCO_UNBUNDLED) - -diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt -index 3e2b5ff..2ab7590 100644 ---- a/NetSSL_Win/CMakeLists.txt -+++ b/NetSSL_Win/CMakeLists.txt -@@ -21,7 +21,7 @@ set_target_properties(NetSSLWin - DEFINE_SYMBOL NetSSL_Win_EXPORTS - ) - --target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) -+target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) - target_include_directories(NetSSLWin - PUBLIC - $ - -diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake -index 038779ec9..fa7afdb1b 100644 ---- a/cmake/PocoMacros.cmake -+++ b/cmake/PocoMacros.cmake -@@ -40,7 +40,7 @@ if(WIN32) - endforeach() - endif(X64) - endif() -- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} -+ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} - DOC "path to message compiler") - if(NOT CMAKE_MC_COMPILER) - message(FATAL_ERROR "message compiler not found: required to build") - diff --git a/recipes/poco/all/patches/1.11.3.patch b/recipes/poco/all/patches/1.11.3.patch deleted file mode 100644 index 16729af37dce3..0000000000000 --- a/recipes/poco/all/patches/1.11.3.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index 6b276be..81cb8b7 100644 ---- a/Foundation/CMakeLists.txt -+++ b/Foundation/CMakeLists.txt -@@ -101,7 +101,7 @@ set_target_properties(Foundation - ) - - if(POCO_UNBUNDLED) -- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE::PCRE ZLIB::ZLIB) - target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) - endif(POCO_UNBUNDLED) - -diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt -index 3e2b5ff..2ab7590 100644 ---- a/NetSSL_Win/CMakeLists.txt -+++ b/NetSSL_Win/CMakeLists.txt -@@ -21,7 +21,7 @@ set_target_properties(NetSSLWin - DEFINE_SYMBOL NetSSL_Win_EXPORTS - ) - --target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) -+target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) - target_include_directories(NetSSLWin - PUBLIC - $ - -diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake -index 038779ec9..fa7afdb1b 100644 ---- a/cmake/PocoMacros.cmake -+++ b/cmake/PocoMacros.cmake -@@ -40,7 +40,7 @@ if(WIN32) - endforeach() - endif(X64) - endif() -- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} -+ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} - DOC "path to message compiler") - if(NOT CMAKE_MC_COMPILER) - message(FATAL_ERROR "message compiler not found: required to build") - diff --git a/recipes/poco/all/patches/1.12.0.patch b/recipes/poco/all/patches/1.12.0.patch index 44db78fbbb6ad..0f5458cd155b5 100644 --- a/recipes/poco/all/patches/1.12.0.patch +++ b/recipes/poco/all/patches/1.12.0.patch @@ -18,7 +18,7 @@ diff -ruN a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt if(POCO_UNBUNDLED) - target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE2::PCRE2 ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) endif(POCO_UNBUNDLED) diff --git a/recipes/poco/all/patches/1.12.1.patch b/recipes/poco/all/patches/1.12.1.patch index 44db78fbbb6ad..0f5458cd155b5 100644 --- a/recipes/poco/all/patches/1.12.1.patch +++ b/recipes/poco/all/patches/1.12.1.patch @@ -18,7 +18,7 @@ diff -ruN a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt if(POCO_UNBUNDLED) - target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE2::PCRE2 ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) endif(POCO_UNBUNDLED) diff --git a/recipes/poco/all/patches/1.12.2.patch b/recipes/poco/all/patches/1.12.2.patch index 44db78fbbb6ad..0f5458cd155b5 100644 --- a/recipes/poco/all/patches/1.12.2.patch +++ b/recipes/poco/all/patches/1.12.2.patch @@ -18,7 +18,7 @@ diff -ruN a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt if(POCO_UNBUNDLED) - target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE2::PCRE2 ZLIB::ZLIB) ++ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) endif(POCO_UNBUNDLED) diff --git a/recipes/poco/all/patches/1.8.1.patch b/recipes/poco/all/patches/1.8.1.patch index 4321893d263ce..26d7aef988e6c 100644 --- a/recipes/poco/all/patches/1.8.1.patch +++ b/recipes/poco/all/patches/1.8.1.patch @@ -1,5 +1,5 @@ ---- cmake/PocoMacros.cmake -+++ cmake/PocoMacros.cmake +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake @@ -265,7 +265,7 @@ if (MSVC) @@ -9,30 +9,19 @@ endif() endmacro() ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -204,7 +204,7 @@ - - find_package(OpenSSL) - if(OPENSSL_FOUND) -- include_directories("${OPENSSL_INCLUDE_DIR}") -+ #include_directories("${OPENSSL_INCLUDE_DIR}") - if(EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_OpenSSL AND ENABLE_NETSSL) - add_subdirectory(NetSSL_OpenSSL) - list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL") ---- Crypto/CMakeLists.txt -+++ Crypto/CMakeLists.txt +--- a/Crypto/CMakeLists.txt ++++ b/Crypto/CMakeLists.txt @@ -20,7 +20,7 @@ DEFINE_SYMBOL Crypto_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation ${OPENSSL_LIBRARIES} ) -+target_link_libraries( "${LIBNAME}" Foundation OpenSSL::OpenSSL ) ++target_link_libraries( "${LIBNAME}" Foundation OpenSSL::SSL OpenSSL::Crypto) target_include_directories( "${LIBNAME}" PUBLIC $ ---- Data/SQLite/CMakeLists.txt -+++ Data/SQLite/CMakeLists.txt +--- a/Data/SQLite/CMakeLists.txt ++++ b/Data/SQLite/CMakeLists.txt @@ -10,9 +10,9 @@ POCO_HEADERS_AUTO( SQLITE_SRCS ${HDRS_G}) @@ -46,8 +35,30 @@ else() # sqlite3 POCO_SOURCES( SQLITE_SRCS sqlite3 ---- NetSSL_Win/CMakeLists.txt -+++ NetSSL_Win/CMakeLists.txt +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -32,9 +32,8 @@ POCO_MESSAGES( SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if (POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) +- set(SYSLIBS ${SYSLIBS} ${PCRE_LIBRARIES}) +- include_directories(${PCRE_INCLUDE_DIRS}) ++ find_package(pcre REQUIRED CONFIG) ++ set(SYSLIBS ${SYSLIBS} pcre::libpcre) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library + POCO_SOURCES( SRCS RegExp +@@ -106,7 +105,6 @@ if(ANDROID) + endif(ANDROID) + + # TODO: Why is this here? +-add_definitions( -DPCRE_STATIC) + + # For SetAffinity + if(UNIX AND NOT APPLE) +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt @@ -18,7 +18,7 @@ DEFINE_SYMBOL NetSSL_Win_EXPORTS ) diff --git a/recipes/poco/all/patches/1.9.2-2.patch b/recipes/poco/all/patches/1.9.2-2.patch deleted file mode 100644 index 8e7bec383a908..0000000000000 --- a/recipes/poco/all/patches/1.9.2-2.patch +++ /dev/null @@ -1,273 +0,0 @@ ---- ApacheConnector/CMakeLists.txt -+++ ApacheConnector/CMakeLists.txt -@@ -10,8 +10,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" SHARED ${SRCS} ) ---- CppParser/CMakeLists.txt -+++ CppParser/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- CppUnit/WinTestRunner/CMakeLists.txt -+++ CppUnit/WinTestRunner/CMakeLists.txt -@@ -13,8 +13,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - # TODO: Is this flag always required? ---- Crypto/CMakeLists.txt -+++ Crypto/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- Data/CMakeLists.txt -+++ Data/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - if (NOT POCO_STATIC) ---- Data/MySQL/CMakeLists.txt -+++ Data/MySQL/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND MYSQL_SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND MYSQL_SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_definitions(-DTHREADSAFE -DNO_TCL) ---- Data/ODBC/CMakeLists.txt -+++ Data/ODBC/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND ODBC_SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND ODBC_SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_definitions( ${ODBC_CFLAGS} -DTHREADSAFE) ---- Data/SQLite/CMakeLists.txt -+++ Data/SQLite/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SQLITE_SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SQLITE_SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - if (POCO_UNBUNDLED) ---- Encodings/CMakeLists.txt -+++ Encodings/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- Foundation/CMakeLists.txt -+++ Foundation/CMakeLists.txt -@@ -28,8 +28,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - # Messages ---- JSON/CMakeLists.txt -+++ JSON/CMakeLists.txt -@@ -19,8 +19,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- MongoDB/CMakeLists.txt -+++ MongoDB/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- Net/CMakeLists.txt -+++ Net/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - # Windows and WindowsCE need additional libraries ---- NetSSL_OpenSSL/CMakeLists.txt -+++ NetSSL_OpenSSL/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- NetSSL_Win/CMakeLists.txt -+++ NetSSL_Win/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- PDF/CMakeLists.txt -+++ PDF/CMakeLists.txt -@@ -120,8 +120,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - #TODO: Can we put this with the below includes? PRIVAT eg. ---- Redis/CMakeLists.txt -+++ Redis/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- SevenZip/CMakeLists.txt -+++ SevenZip/CMakeLists.txt -@@ -52,8 +52,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) ---- Util/CMakeLists.txt -+++ Util/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - POCO_SOURCES_AUTO_PLAT( SRCS WIN32 ---- XML/CMakeLists.txt -+++ XML/CMakeLists.txt -@@ -16,8 +16,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - # If POCO_UNBUNDLED is enabled we try to find the required packages ---- Zip/CMakeLists.txt -+++ Zip/CMakeLists.txt -@@ -11,8 +11,8 @@ - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -- source_group("Resources" FILES ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -- list(APPEND SRCS ${CMAKE_SOURCE_DIR}/DLLVersion.rc) -+ source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) -+ list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) - endif() - - add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) diff --git a/recipes/poco/all/patches/1.9.2.patch b/recipes/poco/all/patches/1.9.2.patch index 3cc515ebe11a5..bd84d7869122d 100644 --- a/recipes/poco/all/patches/1.9.2.patch +++ b/recipes/poco/all/patches/1.9.2.patch @@ -1,5 +1,5 @@ ---- cmake/PocoMacros.cmake -+++ cmake/PocoMacros.cmake +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake @@ -278,7 +278,7 @@ if (MSVC) @@ -9,30 +9,19 @@ endif() endmacro() ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -211,7 +211,7 @@ - - find_package(OpenSSL) - if(OPENSSL_FOUND) -- include_directories("${OPENSSL_INCLUDE_DIR}") -+ include_directories("${OpenSSL_INCLUDE_DIR}") - if(EXISTS ${PROJECT_SOURCE_DIR}/NetSSL_OpenSSL AND ENABLE_NETSSL) - add_subdirectory(NetSSL_OpenSSL) - list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL") ---- Crypto/CMakeLists.txt -+++ Crypto/CMakeLists.txt +--- a/Crypto/CMakeLists.txt ++++ b/Crypto/CMakeLists.txt @@ -24,7 +24,7 @@ DEFINE_SYMBOL Crypto_EXPORTS ) -target_link_libraries( "${LIBNAME}" Foundation ${OPENSSL_LIBRARIES} ) -+target_link_libraries( "${LIBNAME}" Foundation OpenSSL::OpenSSL ) ++target_link_libraries( "${LIBNAME}" Foundation OpenSSL::SSL OpenSSL::Crypto) target_include_directories( "${LIBNAME}" PUBLIC $ ---- Data/SQLite/CMakeLists.txt -+++ Data/SQLite/CMakeLists.txt +--- a/Data/SQLite/CMakeLists.txt ++++ b/Data/SQLite/CMakeLists.txt @@ -16,9 +16,9 @@ endif() @@ -46,8 +35,30 @@ else() # sqlite3 POCO_SOURCES( SQLITE_SRCS sqlite3 ---- NetSSL_Win/CMakeLists.txt -+++ NetSSL_Win/CMakeLists.txt +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -38,9 +38,8 @@ POCO_MESSAGES( SRCS Logging src/pocomsg.mc) + # If POCO_UNBUNDLED is enabled we try to find the required packages + # The configuration will fail if the packages are not found + if (POCO_UNBUNDLED) +- find_package(PCRE REQUIRED) +- set(SYSLIBS ${SYSLIBS} ${PCRE_LIBRARIES}) +- include_directories(${PCRE_INCLUDE_DIRS}) ++ find_package(pcre REQUIRED CONFIG) ++ set(SYSLIBS ${SYSLIBS} pcre::libpcre) + + #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library + POCO_SOURCES( SRCS RegExp +@@ -112,7 +111,6 @@ if(ANDROID) + endif(ANDROID) + + # TODO: Why is this here? +-add_definitions( -DPCRE_STATIC) + + # For SetAffinity + if(UNIX AND NOT APPLE) +--- a/NetSSL_Win/CMakeLists.txt ++++ b/NetSSL_Win/CMakeLists.txt @@ -24,7 +24,7 @@ DEFINE_SYMBOL NetSSL_Win_EXPORTS ) diff --git a/recipes/poco/all/test_package/CMakeLists.txt b/recipes/poco/all/test_package/CMakeLists.txt index 076daa24fb2e9..e3134a6b1bd9a 100644 --- a/recipes/poco/all/test_package/CMakeLists.txt +++ b/recipes/poco/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) +project(test_package LANGUAGES CXX) option(TEST_UTIL "Test Util" ON) option(TEST_CRYPTO "Test crypto" ON) diff --git a/recipes/poco/all/test_package/conanfile.py b/recipes/poco/all/test_package/conanfile.py index 7bc5c2eea133d..f7bd335a861da 100644 --- a/recipes/poco/all/test_package/conanfile.py +++ b/recipes/poco/all/test_package/conanfile.py @@ -1,62 +1,78 @@ -from conans import CMake, ConanFile -from conan.tools.build import cross_building +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" @property def _with_netssl(self): return ( - ("enable_netssl" in self.options["poco"] and self.options["poco"].enable_netssl) or - ("enable_netssl_win" in self.options["poco"] and self.options["poco"].enable_netssl_win) + ("enable_netssl" in self.dependencies["poco"].options and self.dependencies["poco"].options.enable_netssl) or + ("enable_netssl_win" in self.dependencies["poco"].options and self.dependencies["poco"].options.enable_netssl_win) ) @property def _with_encodings(self): - return "enable_encodings" in self.options["poco"] and self.options["poco"].enable_encodings + return "enable_encodings" in self.dependencies["poco"].options and self.dependencies["poco"].options.enable_encodings @property def _with_jwt(self): - return "enable_jwt" in self.options["poco"] and self.options["poco"].enable_jwt + return "enable_jwt" in self.dependencies["poco"].options and self.dependencies["poco"].options.enable_jwt @property def _with_prometheus(self): - return "enable_prometheus" in self.options["poco"] and self.options["poco"].enable_prometheus + return "enable_prometheus" in self.dependencies["poco"].options and self.dependencies["poco"].options.enable_prometheus + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TEST_CRYPTO"] = self.dependencies["poco"].options.enable_crypto + tc.variables["TEST_UTIL"] = self.dependencies["poco"].options.enable_util + tc.variables["TEST_NET"] = self.dependencies["poco"].options.enable_net + tc.variables["TEST_NETSSL"] = self._with_netssl + tc.variables["TEST_SQLITE"] = self.dependencies["poco"].options.enable_data_sqlite + tc.variables["TEST_ENCODINGS"] = self._with_encodings + tc.variables["TEST_JWT"] = self._with_jwt + tc.variables["TEST_PROMETHEUS"] = self._with_prometheus + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["TEST_CRYPTO"] = self.options["poco"].enable_crypto - cmake.definitions["TEST_UTIL"] = self.options["poco"].enable_util - cmake.definitions["TEST_NET"] = self.options["poco"].enable_net - cmake.definitions["TEST_NETSSL"] = self._with_netssl - cmake.definitions["TEST_SQLITE"] = self.options["poco"].enable_data_sqlite - cmake.definitions["TEST_ENCODINGS"] = self._with_encodings - cmake.definitions["TEST_JWT"] = self._with_jwt - cmake.definitions["TEST_PROMETHEUS"] = self._with_prometheus cmake.configure() cmake.build() def test(self): - if not cross_building(self, skip_x64_x86=True): - self.run(os.path.join("bin", "core"), run_environment=True) + if can_run(self): if self.options["poco"].enable_util: - self.run(os.path.join("bin", "util"), run_environment=True) + self.run(os.path.join(self.cpp.build.bindirs[0], "util"), env="conanrun") if self.options["poco"].enable_crypto: - self.run("{} {}".format(os.path.join("bin", "crypto"), os.path.join(self.source_folder, "conanfile.py")), run_environment=True) + self.run("{} {}".format(os.path.join(self.cpp.build.bindirs[0], "crypto"), os.path.join(self.source_folder, "conanfile.py")), env="conanrun") if self.options["poco"].enable_net: - self.run(os.path.join("bin", "net"), run_environment=True) + self.run(os.path.join(self.cpp.build.bindirs[0], "net"), env="conanrun") if self.options["poco"].enable_util: - self.run(os.path.join("bin", "net_2"), run_environment=True) - if self._with_netssl: - self.run(os.path.join("bin", "netssl"), run_environment=True) - if self.options["poco"].enable_data_sqlite: - self.run(os.path.join("bin", "sqlite"), run_environment=True) - if self._with_encodings: - self.run(os.path.join("bin", "encodings"), run_environment=True) - if self._with_jwt: - self.run(os.path.join("bin", "jwt"), run_environment=True) - if self._with_prometheus: - self.run(os.path.join("bin", "prometheus"), run_environment=True) + self.run(os.path.join(self.cpp.build.bindirs[0], "net_2"), env="conanrun") + test_netssl = os.path.join(self.cpp.build.bindirs[0], "netssl") + if os.path.exists(test_netssl): + self.run(test_netssl, env="conanrun") + test_sqlite = os.path.join(self.cpp.build.bindirs[0], "sqlite") + if os.path.exists(test_sqlite): + self.run(test_sqlite, env="conanrun") + test_encodings = os.path.join(self.cpp.build.bindirs[0], "encodings") + if os.path.exists(test_encodings): + self.run(test_encodings, env="conanrun") + test_jwt = os.path.join(self.cpp.build.bindirs[0], "jwt") + if os.path.exists(test_jwt): + self.run(test_jwt, env="conanrun") + test_prometheus = os.path.join(self.cpp.build.bindirs[0], "prometheus") + if os.path.exists(test_prometheus): + self.run(test_prometheus, env="conanrun") diff --git a/recipes/poco/all/test_v1_package/CMakeLists.txt b/recipes/poco/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..22759855e1a02 --- /dev/null +++ b/recipes/poco/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,96 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +option(TEST_UTIL "Test Util" ON) +option(TEST_CRYPTO "Test crypto" ON) +option(TEST_NET "Test Net" ON) +option(TEST_NETSSL "Test NetSSL" ON) +option(TEST_SQLITE "Test Sqlite" ON) +option(TEST_ENCODINGS "Test Encodings" ON) +option(TEST_JWT "Test JWT" ON) +option(TEST_PROMETHEUS "Test Prometheus" ON) + +set(CMAKE_CXX_STANDARD 11) + +set(POCO_COMPONENTS Foundation) +if(TEST_UTIL) + list(APPEND POCO_COMPONENTS Util) +endif() +if(TEST_CRYPTO) + list(APPEND POCO_COMPONENTS Crypto) +endif() +if(TEST_NET) + list(APPEND POCO_COMPONENTS Net) +endif() +if(TEST_NETSSL) + list(APPEND POCO_COMPONENTS NetSSL) +endif() +if(TEST_SQLITE) + list(APPEND POCO_COMPONENTS DataSQLite) +endif() +if(TEST_ENCODINGS) + list(APPEND POCO_COMPONENTS Encodings) +endif() +if(TEST_JWT) + list(APPEND POCO_COMPONENTS JWT) +endif() +if(TEST_PROMETHEUS) + list(APPEND POCO_COMPONENTS Prometheus) +endif() + +find_package(Poco REQUIRED ${POCO_COMPONENTS} CONFIG) + +add_executable(core ../test_package/test_core.cpp) +target_link_libraries(core Poco::Foundation) + +if(TEST_UTIL) + add_executable(util ../test_package/test_util.cpp) + target_link_libraries(util Poco::Util) + if(MINGW) + target_link_options(util PRIVATE -municode) + endif() +endif() + +if(TEST_CRYPTO) + add_executable(tcrypto ../test_package/test_crypto.cpp) + target_link_libraries(tcrypto Poco::Crypto) + set_property(TARGET tcrypto PROPERTY OUTPUT_NAME "crypto") +endif() + +if(TEST_NET) + add_executable(net ../test_package/test_net.cpp) + target_link_libraries(net Poco::Net) + + if(TEST_UTIL) + add_executable(net_2 ../test_package/test_net_2.cpp) + target_link_libraries(net_2 Poco::Net Poco::Util) + endif() +endif() + +if(TEST_NETSSL) + add_executable(netssl ../test_package/test_netssl.cpp) + target_link_libraries(netssl Poco::NetSSL) +endif() + +if(TEST_SQLITE) + add_executable(sqlite ../test_package/test_sqlite.cpp) + target_link_libraries(sqlite Poco::DataSQLite) +endif() + +if(TEST_ENCODINGS) + add_executable(encodings ../test_package/test_encodings.cpp) + target_link_libraries(encodings Poco::Encodings) +endif() + +if(TEST_JWT) + add_executable(jwt ../test_package/test_jwt.cpp) + target_link_libraries(jwt Poco::JWT) +endif() + +if(TEST_PROMETHEUS) + add_executable(prometheus ../test_package/test_prometheus.cpp) + target_link_libraries(prometheus Poco::Prometheus) +endif() diff --git a/recipes/poco/all/test_v1_package/conanfile.py b/recipes/poco/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4183b8f616066 --- /dev/null +++ b/recipes/poco/all/test_v1_package/conanfile.py @@ -0,0 +1,61 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + @property + def _with_netssl(self): + return ( + ("enable_netssl" in self.options["poco"] and self.options["poco"].enable_netssl) or + ("enable_netssl_win" in self.options["poco"] and self.options["poco"].enable_netssl_win) + ) + + @property + def _with_encodings(self): + return "enable_encodings" in self.options["poco"] and self.options["poco"].enable_encodings + + @property + def _with_jwt(self): + return "enable_jwt" in self.options["poco"] and self.options["poco"].enable_jwt + + @property + def _with_prometheus(self): + return "enable_prometheus" in self.options["poco"] and self.options["poco"].enable_prometheus + + def build(self): + cmake = CMake(self) + cmake.definitions["TEST_CRYPTO"] = self.options["poco"].enable_crypto + cmake.definitions["TEST_UTIL"] = self.options["poco"].enable_util + cmake.definitions["TEST_NET"] = self.options["poco"].enable_net + cmake.definitions["TEST_NETSSL"] = self._with_netssl + cmake.definitions["TEST_SQLITE"] = self.options["poco"].enable_data_sqlite + cmake.definitions["TEST_ENCODINGS"] = self._with_encodings + cmake.definitions["TEST_JWT"] = self._with_jwt + cmake.definitions["TEST_PROMETHEUS"] = self._with_prometheus + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "core"), run_environment=True) + if self.options["poco"].enable_util: + self.run(os.path.join("bin", "util"), run_environment=True) + if self.options["poco"].enable_crypto: + self.run("{} {}".format(os.path.join("bin", "crypto"), os.path.join(self.source_folder, "conanfile.py")), run_environment=True) + if self.options["poco"].enable_net: + self.run(os.path.join("bin", "net"), run_environment=True) + if self.options["poco"].enable_util: + self.run(os.path.join("bin", "net_2"), run_environment=True) + if self._with_netssl: + self.run(os.path.join("bin", "netssl"), run_environment=True) + if self.options["poco"].enable_data_sqlite: + self.run(os.path.join("bin", "sqlite"), run_environment=True) + if self._with_encodings: + self.run(os.path.join("bin", "encodings"), run_environment=True) + if self._with_jwt: + self.run(os.path.join("bin", "jwt"), run_environment=True) + if self._with_prometheus: + self.run(os.path.join("bin", "prometheus"), run_environment=True) From 7ed79202bbc40b61223be1d5f7915a042dd36683 Mon Sep 17 00:00:00 2001 From: Elazar Leibovich Date: Tue, 20 Sep 2022 13:44:31 +0300 Subject: [PATCH 100/561] (#12944) libpfm4: Add version 4.8.0 * libpfm4: Add version 4.8.0 * libpfm4: Add version 4.8.0 * Update recipes/libpfm4/all/conanfile.py Co-authored-by: Uilian Ries * _source -> source Co-authored-by: Uilian Ries * tools specialized import * use source_folder * import tools * modernize test according to template * trailing spaces * Adapt for Conan 2.0 Signed-off-by: Uilian Ries * Update recipes/libpfm4/all/conanfile.py Co-authored-by: Uilian Ries * libpfm4: linux only * import correct files * Update version to official repository Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/libpfm4/all/conandata.yml | 4 + recipes/libpfm4/all/conanfile.py | 95 +++++++++++++++++++ .../libpfm4/all/test_package/CMakeLists.txt | 7 ++ recipes/libpfm4/all/test_package/conanfile.py | 26 +++++ .../libpfm4/all/test_package/test_package.c | 16 ++++ .../all/test_v1_package/CMakeLists.txt | 10 ++ .../libpfm4/all/test_v1_package/conanfile.py | 18 ++++ recipes/libpfm4/config.yml | 3 + 8 files changed, 179 insertions(+) create mode 100644 recipes/libpfm4/all/conandata.yml create mode 100644 recipes/libpfm4/all/conanfile.py create mode 100644 recipes/libpfm4/all/test_package/CMakeLists.txt create mode 100644 recipes/libpfm4/all/test_package/conanfile.py create mode 100644 recipes/libpfm4/all/test_package/test_package.c create mode 100644 recipes/libpfm4/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpfm4/all/test_v1_package/conanfile.py create mode 100644 recipes/libpfm4/config.yml diff --git a/recipes/libpfm4/all/conandata.yml b/recipes/libpfm4/all/conandata.yml new file mode 100644 index 0000000000000..ccfa567e2963b --- /dev/null +++ b/recipes/libpfm4/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.12.0": + url: "https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.12.0.tar.gz" + sha256: "4b0c1f53f39a61525b69bebf532c68040c1b984d7544a8ae0844b13cd91e1ee4" diff --git a/recipes/libpfm4/all/conanfile.py b/recipes/libpfm4/all/conanfile.py new file mode 100644 index 0000000000000..89894d3e1796e --- /dev/null +++ b/recipes/libpfm4/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.files import get, rmdir, copy, replace_in_file +from conan.errors import ConanInvalidConfiguration +import os + + +class Libpfm4Conan(ConanFile): + name = "libpfm4" + license = "MIT" + homepage = "http://perfmon2.sourceforge.net" + url = "https://github.com/conan-io/conan-center-index" + description = ("A helper library to program the performance monitoring events") + topics = ("perf", "pmu", "benchmark", "microbenchmark") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + def validate(self): + # The library doesn't really make much sense without perf_events API + # and currently does not compile on modern Mac OS X && Windows + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("This library is Linux only") + + def config_options(self): + # and currently does not compile on modern Mac OS X && Windows + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + basic_layout(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def _patch_sources(self): + if not self.options.shared: + # honor fPIC option + replace_in_file(self, os.path.join(self.source_folder, "rules.mk"), "-fPIC", "") + replace_in_file(self, os.path.join(self.source_folder, "rules.mk"), "-DPIC", "") + + def build(self): + self._patch_sources() + args = [ + 'DBG=', + 'CONFIG_PFMLIB_SHARED={}'.format("y" if self.options.shared else "n"), + f'-C {self.source_folder}' + ] + autotools = Autotools(self) + autotools.make(args=args) + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + args = [ + 'DBG=', + 'LDCONFIG=true', + 'CONFIG_PFMLIB_SHARED={}'.format("y" if self.options.shared else "n"), + f'DESTDIR={self.package_folder}{os.sep}', + f'INCDIR=include{os.sep}', + f'LIBDIR=lib{os.sep}', + f'-C {self.source_folder}' + ] + # due to bug, Mac install phase fails with config shared + if self.settings.os == 'Macos': + args.append('CONFIG_PFMLIB_SHARED=n') + + copy(self, "err.h", dst=os.path.join(self.package_folder, "include", "perfmon"), src=os.path.join(self.source_folder, "include", "perfmon")) + autotools = Autotools(self) + autotools.install(args=args) + rmdir(self, os.path.join(self.package_folder, "usr")) + + def package_info(self): + self.cpp_info.libs = ["pfm"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/libpfm4/all/test_package/CMakeLists.txt b/recipes/libpfm4/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c93d1fbd7ce51 --- /dev/null +++ b/recipes/libpfm4/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(libpfm4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libpfm4::libpfm4) diff --git a/recipes/libpfm4/all/test_package/conanfile.py b/recipes/libpfm4/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libpfm4/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libpfm4/all/test_package/test_package.c b/recipes/libpfm4/all/test_package/test_package.c new file mode 100644 index 0000000000000..22dc57834a15e --- /dev/null +++ b/recipes/libpfm4/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include +#include +#include + + +int main(void) { + int version = 0; + + pfm_initialize(); + version = pfm_get_version(); + printf("PFM VERSION: %d\n", version); + pfm_terminate(); + + return EXIT_SUCCESS; +} diff --git a/recipes/libpfm4/all/test_v1_package/CMakeLists.txt b/recipes/libpfm4/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..92ff6b140a2cc --- /dev/null +++ b/recipes/libpfm4/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libpfm4 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libpfm4::libpfm4) diff --git a/recipes/libpfm4/all/test_v1_package/conanfile.py b/recipes/libpfm4/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/libpfm4/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libpfm4/config.yml b/recipes/libpfm4/config.yml new file mode 100644 index 0000000000000..b06c46e0f08f9 --- /dev/null +++ b/recipes/libpfm4/config.yml @@ -0,0 +1,3 @@ +versions: + "4.12.0": + folder: all From e925af74096d94a3ba74936c7e4682d398482755 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Tue, 20 Sep 2022 13:09:40 +0200 Subject: [PATCH 101/561] (#13019) [bot] Add Access Request users (2022-09-19) --- .c3i/authorized_users.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index e023a428528da..9b5da3fce5e98 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -936,3 +936,8 @@ authorized_users: - "mark0n" - "kayoub5" - "topheg" + - "curoky" + - "datalogics-saharay" + - "sproberts92" + - "madhat1" + - "vince-cheung" From 6098bb66e6ce5d0ea1e303a091d136fec448f772 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 20 Sep 2022 13:26:17 +0200 Subject: [PATCH 102/561] (#13028) [docs] Remove how to disable pylint * Remove how to disable pylint Signed-off-by: Uilian Ries * faq skipping linter Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- docs/faqs.md | 7 ++++++- docs/v2_linter.md | 14 -------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/docs/faqs.md b/docs/faqs.md index e3a2e3e0fa87a..10320b0481242 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -342,7 +342,7 @@ You should expect that latest revision of recipes can introduce breaking changes features that will be broken unless you also upgrade Conan client (and sometimes you will need to modify your project if the recipe changes the binaries, flags,... it provides). -To isolate from these changes there are different strategies you can follow. +To isolate from these changes there are different strategies you can follow. Keep reading in the [consuming recipes section](consuming_recipes.md#isolate-your-project-from-upstream-changes). ## Why are version ranges not allowed? @@ -393,3 +393,8 @@ The [Code Owners](https://docs.github.com/en/repositories/managing-your-reposito write permission for any listed user in the file `.github/CODEOWNERS`, which makes it impossible to be accepted by Conan. However, that file is still important as it can be re-used in a future Github Action to parse and communicate users. Meanwhile, there is the project https://app.github-file-watcher.com/, which is able to notify users, but only after merging to the master branch. Feel free to contribute to a new Github Action that implements a file watcher feature. + +## Is it possible to disable Pylint? + +No. The [pylint](v2_linter.md) has an important role of keeping any recipe prepared for [Conan v2 migration](v2_migration.md). In case you are having +difficult to understand [linter errors](linters.md), please, comment on your pull request about, then the community will help you. diff --git a/docs/v2_linter.md b/docs/v2_linter.md index a048fd4fd2aa3..f2c2ec328e94b 100644 --- a/docs/v2_linter.md +++ b/docs/v2_linter.md @@ -65,19 +65,6 @@ Here is a list of different imports and their new equivalent (note that the inte | conans.errors.ConanInvalidConfiguration | [conan.errors.ConanInvalidConfiguration](https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#migrating-the-recipes) | 1.47.0 | | conans.errors.ConanException | [conan.errors.ConanException](https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#migrating-the-recipes) | 1.47.0 | -## Disable linter for a specific conanfile - -If for some reason a conanfile of a recipe or a test_package is not yet prepared to pass -all the checks of the linter, it can be skipped from `pylint` adding the following comment to the file: - -**`conanfile.py`** - -```python -# pylint: skip-file -from conans import ConanFile, CMake, tools -... -``` - --- ## Running the linter locally @@ -106,4 +93,3 @@ It is possible to run the linter locally the same way it is being run [using Git # Lint the test_package pylint --rcfile=linter/pylintrc_testpackage recipes/boost/all/test_package/conanfile.py ``` - From 384b1a129f2691897f096b1a70a8ed8bec7afef7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 20 Sep 2022 15:45:56 +0200 Subject: [PATCH 103/561] (#12955) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/faqs.md | 3 ++- docs/v2_linter.md | 1 - docs/v2_migration.md | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/faqs.md b/docs/faqs.md index 10320b0481242..6e67032f714a4 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -34,7 +34,8 @@ This section gathers the most common questions from the community related to pac * [How to protect my project from breaking changes in recipes?](#how-to-protect-my-project-from-breaking-changes-in-recipes) * [Why are version ranges not allowed?](#why-are-version-ranges-not-allowed) * [How to consume a graph of shared libraries?](#how-to-consume-a-graph-of-shared-libraries) - * [How to watch only specific recipes?](#how-to-watch-only-specific-recipes) + * [How to watch only specific recipes?](#how-to-watch-only-specific-recipes) + * [Is it possible to disable Pylint?](#is-it-possible-to-disable-pylint) ## What is the policy on recipe name collisions? diff --git a/docs/v2_linter.md b/docs/v2_linter.md index f2c2ec328e94b..89a67d715db42 100644 --- a/docs/v2_linter.md +++ b/docs/v2_linter.md @@ -5,7 +5,6 @@ * [Import ConanFile from `conan`](#import-conanfile-from-conan) * [Import tools from `conan`](#import-tools-from-conan) - * [Disable linter for a specific conanfile](#disable-linter-for-a-specific-conanfile) * [Running the linter locally](#running-the-linter-locally) On our [path to Conan v2](v2_roadmap.md) we are leveraging on custom Pylint rules. This diff --git a/docs/v2_migration.md b/docs/v2_migration.md index e038ab998db35..59e7fd6203991 100644 --- a/docs/v2_migration.md +++ b/docs/v2_migration.md @@ -3,6 +3,7 @@ ## Contents + * [Using Layout with New Generators](#using-layout-with-new-generators) * [New cpp_info set_property model](#new-cpp_info-set_property-model) * [CMakeDeps](#cmakedeps) * [Update required_conan_version to ">=1.43.0"](#update-required_conan_version-to-1430) From bdc4961b1c78228b3aec029e82c088c24d9a69f2 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 20 Sep 2022 16:25:22 +0200 Subject: [PATCH 104/561] (#13039) Update changelog 20-September-2022 --- docs/changelog.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 335787481aa1e..32eb65be6d78b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,19 @@ # Changelog +### 20-September-2022 - 14:27 CEST + +- [feature] Handle scenarios where some files are removed. +- [feature] Simplify logic to detect references to be built in a pull request. +- [feature] Workaround in Conan v2 commands to list package IDs in a pull request. +- [feature] Bump minimum required Conan client version. +- [fix] When merging a pull request, check recipe revisions only against the pull-request repository. +- [fix] Do not consider GitHub check runs for pull requests opened by a bot. +- [fix] Consider files renamed in pull requests as "added" and "removed". +- [fix] Cover use-case when a pull request adds just one conanfile.py. +- [fix] Simplify assignment of GitHub labels. +- [fix] Use backquotes in GitHub comments. +- [fix] Fix promotion of packages with Conan v2. + ### 1-September-2022 - 10:21 CEST - [feature] Avoid `test_v?_package` folders that don't match the Conan version. From e93feccb608f0c3cae5d9d1e8cfa4b394161020c Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 20 Sep 2022 16:51:50 +0200 Subject: [PATCH 105/561] (#13040) [config] Update conan version to 1.52.0 --- .c3i/config_v1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index 0495513380bba..df0cd98446adc 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 1.51.3 + version: 1.52.0 artifactory: url: "https://c3i.jfrog.io/c3i" From 200cbc57b714cb5547ff2d1f32679392886c0789 Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Tue, 20 Sep 2022 16:25:06 -0300 Subject: [PATCH 106/561] (#13004) update sqlitecpp to 3.2.0 * update sqlitecpp to 3.2.0 * Support Conan 2.0 Signed-off-by: Uilian Ries * Remove share folder Signed-off-by: Uilian Ries * add sqlitecpp version 3.2.0 Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/sqlitecpp/all/CMakeLists.txt | 7 -- recipes/sqlitecpp/all/conandata.yml | 16 ++- recipes/sqlitecpp/all/conanfile.py | 102 +++++++++--------- .../patches/2.4.0-0001-cmake-sqlite3.patch | 23 ++++ ...ngw.patch => 2.4.0-0002-mingw-flags.patch} | 11 +- .../patches/2.5.0-0001-cmake-sqlite3.patch | 25 +++++ .../all/patches/2.5.0/0001-conan.patch | 17 --- .../sqlitecpp/all/test_package/CMakeLists.txt | 11 +- .../sqlitecpp/all/test_package/conanfile.py | 19 +++- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 +++ recipes/sqlitecpp/config.yml | 2 + 12 files changed, 160 insertions(+), 101 deletions(-) delete mode 100644 recipes/sqlitecpp/all/CMakeLists.txt create mode 100644 recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch rename recipes/sqlitecpp/all/patches/{2.4.0/0001-mingw.patch => 2.4.0-0002-mingw-flags.patch} (65%) create mode 100644 recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch delete mode 100644 recipes/sqlitecpp/all/patches/2.5.0/0001-conan.patch create mode 100644 recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sqlitecpp/all/test_v1_package/conanfile.py diff --git a/recipes/sqlitecpp/all/CMakeLists.txt b/recipes/sqlitecpp/all/CMakeLists.txt deleted file mode 100644 index 4d393c7a86c09..0000000000000 --- a/recipes/sqlitecpp/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory("source_subfolder") diff --git a/recipes/sqlitecpp/all/conandata.yml b/recipes/sqlitecpp/all/conandata.yml index 3170f3f50955c..502fd61cfa739 100644 --- a/recipes/sqlitecpp/all/conandata.yml +++ b/recipes/sqlitecpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.0": + url: "https://github.com/SRombauts/SQLiteCpp/archive/3.2.0.tar.gz" + sha256: "57f91ed44ef205fe97b8c6586002fe6031cd02771d1c5d8415d9c515ad1532d1" "3.1.1": url: "https://github.com/SRombauts/SQLiteCpp/archive/3.1.1.tar.gz" sha256: "b00b1efad985dd415c3b62b01252cae20d9f2c32dcac435ddd8a105e9d4ddcde" @@ -10,8 +13,13 @@ sources: sha256: "16bf963619786652a60533bcdc71a0412cad1ce132cd09ce43344af6ed7463d9" patches: "2.5.0": - - base_path: "source_subfolder" - patch_file: "patches/2.5.0/0001-conan.patch" + - patch_file: "patches/2.5.0-0001-cmake-sqlite3.patch" + patch_description: "Fix Sqlite3 CMake target" + patch_type: "conan" "2.4.0": - - base_path: "source_subfolder" - patch_file: "patches/2.4.0/0001-mingw.patch" + - patch_file: "patches/2.4.0-0001-cmake-sqlite3.patch" + patch_description: "Fix Sqlite3 CMake target" + patch_type: "conan" + - patch_file: "patches/2.4.0-0002-mingw-flags.patch" + patch_description: "Fix Mingw compiler flags" + patch_type: "conan" diff --git a/recipes/sqlitecpp/all/conanfile.py b/recipes/sqlitecpp/all/conanfile.py index ed12cc40368ff..b8ab25fd1962e 100644 --- a/recipes/sqlitecpp/all/conanfile.py +++ b/recipes/sqlitecpp/all/conanfile.py @@ -1,19 +1,23 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import copy, get, apply_conandata_patches, replace_in_file, rmdir, save +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.errors import ConanInvalidConfiguration import os import textwrap -required_conan_version = ">=1.43.0" + +required_conan_version = ">=1.51.3" class SQLiteCppConan(ConanFile): name = "sqlitecpp" description = "SQLiteCpp is a smart and easy to use C++ sqlite3 wrapper" - topics = ("sqlitecpp", "sqlite3") + topics = ("sqlite", "sqlite3", "data-base") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/SRombauts/SQLiteCpp" license = "MIT" - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,21 +30,9 @@ class SQLiteCppConan(ConanFile): "stack_protection": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -48,66 +40,74 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass def requirements(self): - self.requires("sqlite3/3.38.5") + self.requires("sqlite3/3.39.3") def validate(self): - if tools.Version(self.version) >= "3.0.0" and self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + if Version(self.version) >= "3.0.0" and self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("SQLiteCpp can not be built as shared lib on Windows") + def layout(self): + cmake_layout(self, src_folder="src") + 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], + destination=self.source_folder, strip_root=True) def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) if self.settings.compiler == "clang" and \ - tools.Version(self.settings.compiler.version) < "6.0" and \ - self.settings.compiler.libcxx == "libc++" and \ - tools.Version(self.version) < "3": - tools.replace_in_file( - os.path.join(self._source_subfolder, "include", "SQLiteCpp", "Utils.h"), + Version(self.settings.compiler.version) < "6.0" and \ + self.settings.compiler.libcxx == "libc++" and \ + Version(self.version) < "3": + replace_in_file(self, + os.path.join(self.source_folder, "include", "SQLiteCpp", "Utils.h"), "const nullptr_t nullptr = {};", "") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["SQLITECPP_INTERNAL_SQLITE"] = False - self._cmake.definitions["SQLITECPP_RUN_CPPLINT"] = False - self._cmake.definitions["SQLITECPP_RUN_CPPCHECK"] = False - self._cmake.definitions["SQLITECPP_RUN_DOXYGEN"] = False - self._cmake.definitions["SQLITECPP_BUILD_EXAMPLES"] = False - self._cmake.definitions["SQLITECPP_BUILD_TESTS"] = False - self._cmake.definitions["SQLITECPP_USE_STACK_PROTECTION"] = self.options.stack_protection - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SQLITECPP_INTERNAL_SQLITE"] = False + tc.variables["SQLITECPP_RUN_CPPLINT"] = False + tc.variables["SQLITECPP_RUN_CPPCHECK"] = False + tc.variables["SQLITECPP_RUN_DOXYGEN"] = False + tc.variables["SQLITECPP_BUILD_EXAMPLES"] = False + tc.variables["SQLITECPP_BUILD_TESTS"] = False + tc.variables["SQLITECPP_USE_STACK_PROTECTION"] = self.options.stack_protection + tc.generate() + + tc = CMakeDeps(self) + tc.generate() def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + self.copy(pattern="LICENSE.txt", dst="licenses", src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( + self, os.path.join(self.package_folder, self._module_file_rel_path), {"SQLiteCpp": "SQLiteCpp::SQLiteCpp"} ) @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(conanfile, module_file, targets): content = "" for alias, aliased in targets.items(): content += textwrap.dedent("""\ @@ -116,7 +116,7 @@ def _create_cmake_module_alias_targets(module_file, targets): set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + save(conanfile, module_file, content) @property def _module_file_rel_path(self): diff --git a/recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch b/recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch new file mode 100644 index 0000000000000..dd766533b851d --- /dev/null +++ b/recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c32724b..096818a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,7 +206,7 @@ install(EXPORT ${PROJECT_NAME}Config DESTINATION lib/cmake/${PROJECT_NAME}) + + ## Build provided copy of SQLite3 C library ## + +-# TODO ++# TODO + #find_package(sqlite3) + #if(sqlite3_VERSION VERSION_LESS "3.19") + # set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") +@@ -230,6 +230,9 @@ if (SQLITECPP_INTERNAL_SQLITE) + add_subdirectory(sqlite3) + target_include_directories(sqlite3 PUBLIC "${PROJECT_SOURCE_DIR}/sqlite3") + target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3") ++else (SQLITECPP_INTERNAL_SQLITE) ++ find_package(SQLite3 REQUIRED) ++ target_link_libraries(SQLiteCpp PRIVATE SQLite::SQLite3) + endif (SQLITECPP_INTERNAL_SQLITE) + + # Optional additional targets: diff --git a/recipes/sqlitecpp/all/patches/2.4.0/0001-mingw.patch b/recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch similarity index 65% rename from recipes/sqlitecpp/all/patches/2.4.0/0001-mingw.patch rename to recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch index 56019d6df6789..99fa2af08442e 100644 --- a/recipes/sqlitecpp/all/patches/2.4.0/0001-mingw.patch +++ b/recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index c32724b..efdb43b 100644 +index 096818a..9e40f9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,12 @@ else (MSVC) @@ -16,12 +16,3 @@ index c32724b..efdb43b 100644 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++0x-compat") # C++ only if (CMAKE_COMPILER_IS_GNUCXX) # GCC flags -@@ -230,6 +235,8 @@ if (SQLITECPP_INTERNAL_SQLITE) - add_subdirectory(sqlite3) - target_include_directories(sqlite3 PUBLIC "${PROJECT_SOURCE_DIR}/sqlite3") - target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3") -+else (SQLITECPP_INTERNAL_SQLITE) -+ target_link_libraries(SQLiteCpp PUBLIC CONAN_PKG::sqlite3) - endif (SQLITECPP_INTERNAL_SQLITE) - - # Optional additional targets: diff --git a/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch b/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch new file mode 100644 index 0000000000000..d114e32196b48 --- /dev/null +++ b/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f7e0fbd..146ab01 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -184,7 +184,7 @@ endif (SQLITE_ENABLE_ASSERT_HANDLER) + option(SQLITE_HAS_CODEC "Enable database encryption API. Not available in the public release of SQLite." OFF) + if (SQLITE_HAS_CODEC) + # Enable database encryption API. Requires implementations of sqlite3_key & sqlite3_key_v2. +- # Eg. SQLCipher (libsqlcipher-dev) is an SQLite extension that provides 256 bit AES encryption of database files. ++ # Eg. SQLCipher (libsqlcipher-dev) is an SQLite extension that provides 256 bit AES encryption of database files. + target_compile_definitions(SQLiteCpp PUBLIC SQLITE_HAS_CODEC) + endif (SQLITE_HAS_CODEC) + +@@ -247,10 +247,7 @@ if (SQLITECPP_INTERNAL_SQLITE) + target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3") + else (SQLITECPP_INTERNAL_SQLITE) + find_package (SQLite3 REQUIRED) +- if (SQLITE3_FOUND) +- include_directories(${SQLITE3_INCLUDE_DIRS}) +- target_link_libraries (SQLiteCpp ${SQLITE3_LIBRARIES}) +- endif (SQLITE3_FOUND) ++ target_link_libraries(SQLiteCpp PRIVATE SQLite::SQLite3) + endif (SQLITECPP_INTERNAL_SQLITE) + + # Optional additional targets: diff --git a/recipes/sqlitecpp/all/patches/2.5.0/0001-conan.patch b/recipes/sqlitecpp/all/patches/2.5.0/0001-conan.patch deleted file mode 100644 index cba5603bc5014..0000000000000 --- a/recipes/sqlitecpp/all/patches/2.5.0/0001-conan.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f7e0fbd..752d876 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -246,11 +246,7 @@ if (SQLITECPP_INTERNAL_SQLITE) - target_include_directories(sqlite3 PUBLIC "${PROJECT_SOURCE_DIR}/sqlite3") - target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3") - else (SQLITECPP_INTERNAL_SQLITE) -- find_package (SQLite3 REQUIRED) -- if (SQLITE3_FOUND) -- include_directories(${SQLITE3_INCLUDE_DIRS}) -- target_link_libraries (SQLiteCpp ${SQLITE3_LIBRARIES}) -- endif (SQLITE3_FOUND) -+ target_link_libraries(SQLiteCpp PUBLIC CONAN_PKG::sqlite3) - endif (SQLITECPP_INTERNAL_SQLITE) - - # Optional additional targets: diff --git a/recipes/sqlitecpp/all/test_package/CMakeLists.txt b/recipes/sqlitecpp/all/test_package/CMakeLists.txt index 72782b2cc5102..2b3b312345feb 100644 --- a/recipes/sqlitecpp/all/test_package/CMakeLists.txt +++ b/recipes/sqlitecpp/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.4) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) find_package(SQLiteCpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} SQLiteCpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE SQLiteCpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sqlitecpp/all/test_package/conanfile.py b/recipes/sqlitecpp/all/test_package/conanfile.py index 38f4483872d47..31d542d1b6ce3 100644 --- a/recipes/sqlitecpp/all/test_package/conanfile.py +++ b/recipes/sqlitecpp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt b/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f582b07dd3297 --- /dev/null +++ b/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(SQLiteCpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SQLiteCpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sqlitecpp/all/test_v1_package/conanfile.py b/recipes/sqlitecpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sqlitecpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sqlitecpp/config.yml b/recipes/sqlitecpp/config.yml index 988e83a6e3782..c2f231edab569 100644 --- a/recipes/sqlitecpp/config.yml +++ b/recipes/sqlitecpp/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.0": + folder: all "3.1.1": folder: all "2.5.0": From 13aec6dfa58e90045ddc7d7376ff751644f8e677 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 20 Sep 2022 22:45:29 +0200 Subject: [PATCH 107/561] (#13044) sqlitecpp: more conan v2 stuff --- recipes/sqlitecpp/all/conanfile.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/recipes/sqlitecpp/all/conanfile.py b/recipes/sqlitecpp/all/conanfile.py index b8ab25fd1962e..fc4a02a9c4ed7 100644 --- a/recipes/sqlitecpp/all/conanfile.py +++ b/recipes/sqlitecpp/all/conanfile.py @@ -8,7 +8,7 @@ import textwrap -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.51.1" class SQLiteCppConan(ConanFile): @@ -49,9 +49,9 @@ def requirements(self): self.requires("sqlite3/3.39.3") def validate(self): - if Version(self.version) >= "3.0.0" and self.settings.compiler.get_safe("cppstd"): + if Version(self.version) >= "3.0.0" and self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - if self.settings.os == "Windows" and self.options.shared: + if self.info.settings.os == "Windows" and self.info.options.shared: raise ConanInvalidConfiguration("SQLiteCpp can not be built as shared lib on Windows") def layout(self): @@ -93,7 +93,7 @@ def build(self): cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self.source_folder) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) @@ -101,26 +101,24 @@ def package(self): # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( - self, os.path.join(self.package_folder, self._module_file_rel_path), {"SQLiteCpp": "SQLiteCpp::SQLiteCpp"} ) - @staticmethod - def _create_cmake_module_alias_targets(conanfile, module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - save(conanfile, module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "SQLiteCpp") From 79d0cb588ccb547feaa772f44bf9659e8222009c Mon Sep 17 00:00:00 2001 From: Ayoub Kaanich Date: Tue, 20 Sep 2022 23:24:40 +0200 Subject: [PATCH 108/561] (#12899) Add npcap package * Add npcap package * Upgrade to conan v2 * Format conandata.yml * Apply suggestions from code review Co-authored-by: Uilian Ries * Update layout * Use v2 template * Add test_v1_package * Update package_info * Sort import * Use libpcap compiled as shared lib to mock wpcap.dll * Fix test_v1_package Co-authored-by: Uilian Ries --- recipes/npcap/all/conandata.yml | 13 +++++ recipes/npcap/all/conanfile.py | 53 +++++++++++++++++++ recipes/npcap/all/test_package/CMakeLists.txt | 9 ++++ recipes/npcap/all/test_package/conanfile.py | 49 +++++++++++++++++ recipes/npcap/all/test_package/test_package.c | 9 ++++ .../npcap/all/test_v1_package/CMakeLists.txt | 13 +++++ .../npcap/all/test_v1_package/conanfile.py | 43 +++++++++++++++ recipes/npcap/config.yml | 4 ++ 8 files changed, 193 insertions(+) create mode 100644 recipes/npcap/all/conandata.yml create mode 100644 recipes/npcap/all/conanfile.py create mode 100644 recipes/npcap/all/test_package/CMakeLists.txt create mode 100644 recipes/npcap/all/test_package/conanfile.py create mode 100644 recipes/npcap/all/test_package/test_package.c create mode 100644 recipes/npcap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/npcap/all/test_v1_package/conanfile.py create mode 100644 recipes/npcap/config.yml diff --git a/recipes/npcap/all/conandata.yml b/recipes/npcap/all/conandata.yml new file mode 100644 index 0000000000000..4212558bf5452 --- /dev/null +++ b/recipes/npcap/all/conandata.yml @@ -0,0 +1,13 @@ +# We don't need a new verion here for each release of Npcap +# Only a new version is required if the SDK version changes +# You can find SDK version in https://github.com/nmap/npcap/blob/{GIT_TAG}/version.h + +sources: + # Newer versions at the top + "1.70": + sdk: + url: https://npcap.com/dist/npcap-sdk-1.13.zip + sha256: dad1f2bf1b02b787be08ca4862f99e39a876c1f274bac4ac0cedc9bbc58f94fd + license: + url: https://raw.githubusercontent.com/nmap/npcap/v1.70/LICENSE + sha256: 112d17c43097ae1740b7cb231850da597beeb02a845c566573504b2fbab233e8 diff --git a/recipes/npcap/all/conanfile.py b/recipes/npcap/all/conanfile.py new file mode 100644 index 0000000000000..a8632292b21bd --- /dev/null +++ b/recipes/npcap/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.files import get, download, copy, collect_libs +from conan.errors import ConanInvalidConfiguration +from os.path import join + + +class NpcapConan(ConanFile): + name = "npcap" + description = "Windows port of the libpcap library" + homepage = "https://npcap.com/" + url = "https://github.com/conan-io/conan-center-index" + license = "LicenseRef-NPCAP" + topics = ("pcap", "windows", "packet-capture") + settings = "os", "arch", "build_type", "compiler" + + # not needed but supress warning message from conan commands + def layout(self): + pass + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def validate(self): + if self.info.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} requires Windows") + + # do not cache as source, instead, use build folder + def source(self): + pass + + def build(self): + source = self.conan_data["sources"][self.version] + get(self, **source['sdk'], destination=self.source_folder) + download(self, filename="LICENSE", **source['license']) + + def package(self): + + copy(self, "LICENSE", dst=join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.h", dst=join(self.package_folder, "include"), src=join(self.source_folder, "Include")) + + if self.settings.arch == "x86_64": + copy(self, "*.lib", dst=join(self.package_folder, "lib"), src=join(self.source_folder, "Lib", "x64")) + elif self.settings.arch == "armv8": + copy(self, "*.lib", dst=join(self.package_folder, "lib"), src=join(self.source_folder, "Lib", "ARM64")) + else: + copy(self, "*.lib", dst=join(self.package_folder, "lib"), src=join(self.source_folder, "Lib")) + + def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.bindirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.libs = collect_libs(self) diff --git a/recipes/npcap/all/test_package/CMakeLists.txt b/recipes/npcap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..873f1064773ee --- /dev/null +++ b/recipes/npcap/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ + +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +find_package(npcap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE npcap::npcap) diff --git a/recipes/npcap/all/test_package/conanfile.py b/recipes/npcap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a2a49be1c85ef --- /dev/null +++ b/recipes/npcap/all/test_package/conanfile.py @@ -0,0 +1,49 @@ +from conan import ConanFile +from conan.tools import files +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +from io import StringIO +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + # Needed to make sure libpcap gets compiled + build_policy = "missing" + + def requirements(self): + self.requires(self.tested_reference_str) + if can_run(self): + self.requires("libpcap/1.10.1") + + def configure(self): + if can_run(self): + self.options["libpcap"].shared = True + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bindir = self.cpp.build.bindirs[0] + # Use libpcap DLL as a replacement for npcap DLL + # It will not provide all the functions + # but it will cover enough to check that what we compiled is correct + files.rm(self, "wpcap.dll", bindir) + files.copy(self, "pcap.dll", src=self.deps_cpp_info['libpcap'].bin_paths[0], dst=bindir) + files.rename(self, os.path.join(bindir, "pcap.dll"), os.path.join(bindir, "wpcap.dll")) + + bin_path = os.path.join(bindir, "test_package") + output = StringIO() + self.run(bin_path, env="conanrun", output=output) + test_output = output.getvalue() + print(test_output) + assert "libpcap version 1.10.1" in test_output diff --git a/recipes/npcap/all/test_package/test_package.c b/recipes/npcap/all/test_package/test_package.c new file mode 100644 index 0000000000000..2ac760451bd42 --- /dev/null +++ b/recipes/npcap/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include "pcap/pcap.h" + +int main(void) +{ + printf(pcap_lib_version()); + return EXIT_SUCCESS; +} diff --git a/recipes/npcap/all/test_v1_package/CMakeLists.txt b/recipes/npcap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..90f019f9f9a28 --- /dev/null +++ b/recipes/npcap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(npcap REQUIRED CONFIG) + +# Re-use the same source file from test_package folder +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +# don't link to ${CONAN_LIBS} or CONAN_PKG::package +target_link_libraries(${PROJECT_NAME} PRIVATE npcap::npcap) diff --git a/recipes/npcap/all/test_v1_package/conanfile.py b/recipes/npcap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..215fce6994f62 --- /dev/null +++ b/recipes/npcap/all/test_v1_package/conanfile.py @@ -0,0 +1,43 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +from conan.tools import files +from io import StringIO +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + # Needed to make sure libpcap gets compiled + build_policy = "missing" + + def requirements(self): + self.requires(self.tested_reference_str) + if not cross_building(self): + self.requires("libpcap/1.10.1") + + def configure(self): + if not cross_building(self): + self.options["libpcap"].shared = True + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + # Use libpcap DLL as a replacement for npcap DLL + # It will not provide all the functions + # but it will cover enough to check that what we compiled is correct + files.rm(self, "wpcap.dll", "bin") + files.copy(self, "pcap.dll", src=self.deps_cpp_info['libpcap'].bin_paths[0], dst="bin") + files.rename(self, os.path.join("bin", "pcap.dll"), os.path.join("bin", "wpcap.dll")) + + bin_path = os.path.join("bin", "test_package") + output = StringIO() + self.run(bin_path, run_environment=True, output=output) + test_output = output.getvalue() + print(test_output) + assert "libpcap version 1.10.1" in test_output diff --git a/recipes/npcap/config.yml b/recipes/npcap/config.yml new file mode 100644 index 0000000000000..cec2bb065c323 --- /dev/null +++ b/recipes/npcap/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.70": + folder: all From e55155b48b63d7171dcc4070cdb77d0d77a14dc9 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Sep 2022 06:46:21 +0900 Subject: [PATCH 109/561] (#12928) unordered_dense: add recipe * unordered_dense: add recipe * remove template comment * remove blnak line * remoe apply_conandata_patches * fix set_compile_features Co-authored-by: Uilian Ries * correct msvc version * don't use self.info when clear() is called. Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/unordered_dense/all/conandata.yml | 4 + recipes/unordered_dense/all/conanfile.py | 79 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 9 +++ .../all/test_package/conanfile.py | 26 ++++++ .../all/test_package/test_package.cpp | 14 ++++ .../all/test_v1_package/CMakeLists.txt | 12 +++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/unordered_dense/config.yml | 3 + 8 files changed, 165 insertions(+) create mode 100644 recipes/unordered_dense/all/conandata.yml create mode 100644 recipes/unordered_dense/all/conanfile.py create mode 100644 recipes/unordered_dense/all/test_package/CMakeLists.txt create mode 100644 recipes/unordered_dense/all/test_package/conanfile.py create mode 100644 recipes/unordered_dense/all/test_package/test_package.cpp create mode 100644 recipes/unordered_dense/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/unordered_dense/all/test_v1_package/conanfile.py create mode 100644 recipes/unordered_dense/config.yml diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml new file mode 100644 index 0000000000000..20529e1ed3dc8 --- /dev/null +++ b/recipes/unordered_dense/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.1": + url: "https://github.com/martinus/unordered_dense/archive/refs/tags/v1.3.1.tar.gz" + sha256: "d393168833d6609c9eaf54a05b19fc3120f68b85feffb282ab225119a86df1d4" diff --git a/recipes/unordered_dense/all/conanfile.py b/recipes/unordered_dense/all/conanfile.py new file mode 100644 index 0000000000000..a863fac03d459 --- /dev/null +++ b/recipes/unordered_dense/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.51.3" + + +class PackageConan(ConanFile): + name = "unordered_dense" + description = "A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinus/unordered_dense" + topics = ("unordered_map", "unordered_set", "hashmap", "hashset", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "msvc": "1914", + "gcc": "7", + "clang": "7", + "apple-clang": "11", + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include", "ankerl"), src=os.path.join(self.source_folder, "include", "ankerl")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + self.cpp_info.set_property("cmake_file_name", "unordered_dense") + self.cpp_info.set_property("cmake_target_name", "unordered_dense::unordered_dense") + self.cpp_info.set_property("pkg_config_name", "package") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "unordered_dense" + self.cpp_info.filenames["cmake_find_package_multi"] = "unordered_dense" + self.cpp_info.names["cmake_find_package"] = "unordered_dense" + self.cpp_info.names["cmake_find_package_multi"] = "unordered_dense" diff --git a/recipes/unordered_dense/all/test_package/CMakeLists.txt b/recipes/unordered_dense/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79fa0b1ed9ebb --- /dev/null +++ b/recipes/unordered_dense/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(unordered_dense REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE unordered_dense::unordered_dense) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/unordered_dense/all/test_package/conanfile.py b/recipes/unordered_dense/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/unordered_dense/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/unordered_dense/all/test_package/test_package.cpp b/recipes/unordered_dense/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..428f955bc9dea --- /dev/null +++ b/recipes/unordered_dense/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +// sited from https://github.com/martinus/unordered_dense/blob/main/example/main.cpp +#include + +#include + +auto main() -> int { + auto map = ankerl::unordered_dense::map(); + map[123] = "hello"; + map[987] = "world!"; + + for (auto const& [key, val] : map) { + std::cout << key << " => " << val << std::endl; + } +} diff --git a/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt b/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4931975841988 --- /dev/null +++ b/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(unordered_dense REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE unordered_dense::unordered_dense) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/unordered_dense/all/test_v1_package/conanfile.py b/recipes/unordered_dense/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/unordered_dense/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/unordered_dense/config.yml b/recipes/unordered_dense/config.yml new file mode 100644 index 0000000000000..59334d5077368 --- /dev/null +++ b/recipes/unordered_dense/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.1": + folder: all From 5592b28ebf63b1e4e11d78e9848443eab5a1d389 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Sep 2022 07:05:35 +0900 Subject: [PATCH 110/561] (#12930) daw_header_libraries: conan v2 support and remove older versions * daw_header_libraries: conan v2 support and remove older versions * downgrade required_conan_version Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * correct msvc version Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * use f-string Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * fix typo * move components definition for conan v1 * don't use self.info when clear() is called * xsimd: add version 9.0.1 * fix library name * fix library name * revert xsimd modification Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- .../daw_header_libraries/all/conandata.yml | 12 --- recipes/daw_header_libraries/all/conanfile.py | 79 +++++++++---------- .../all/test_package/CMakeLists.txt | 6 +- .../all/test_package/conanfile.py | 23 ++++-- .../all/test_v1_package/CMakeLists.txt | 12 +++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/daw_header_libraries/config.yml | 8 -- 7 files changed, 87 insertions(+), 71 deletions(-) create mode 100644 recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/daw_header_libraries/all/test_v1_package/conanfile.py diff --git a/recipes/daw_header_libraries/all/conandata.yml b/recipes/daw_header_libraries/all/conandata.yml index 617ae23bce78f..72192bfc7e5dc 100644 --- a/recipes/daw_header_libraries/all/conandata.yml +++ b/recipes/daw_header_libraries/all/conandata.yml @@ -23,18 +23,6 @@ sources: "2.46.0": url: "https://github.com/beached/header_libraries/archive/v2.46.0.tar.gz" sha256: "fa3069a038c347a623af0e35a853aa561dc8616051baf708cd0ac17eb1032741" - "2.33.2": - url: "https://github.com/beached/header_libraries/archive/v2.33.2.tar.gz" - sha256: "daa31640001af84b19349472ca40d07b84137ad92c46af314ac3b10bbbc6c559" - "2.23.0": - url: "https://github.com/beached/header_libraries/archive/v2.23.0.tar.gz" - sha256: "5619830ff745319615736036bfd3437577d6a8438ea9f34023208599fdf2cdda" - "2.15.1": - url: "https://github.com/beached/header_libraries/archive/v2.15.1.tar.gz" - sha256: "3ddfc484448a762fcf13c6143b0fcff643cbd98dabc639e043bcf493235fc54d" - "2.5.3": - url: "https://github.com/beached/header_libraries/archive/refs/tags/v2.5.3.tar.gz" - sha256: "0fd08b31947e5f0da45c875bbb44d178d4250225e2623fb845cd458605390233" "1.29.7": url: "https://github.com/beached/header_libraries/archive/refs/tags/v1.29.7.tar.gz" sha256: "524c34f3f5d2af498e7bcaff7802b914ba42acde29f7e3ecce41a035db0bf5bd" diff --git a/recipes/daw_header_libraries/all/conanfile.py b/recipes/daw_header_libraries/all/conanfile.py index 87bc6d262d6a4..50f3611d7a2d8 100644 --- a/recipes/daw_header_libraries/all/conanfile.py +++ b/recipes/daw_header_libraries/all/conanfile.py @@ -1,71 +1,70 @@ -import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout -from conans.errors import ConanInvalidConfiguration -from conans import ConanFile, CMake, tools +import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class DawHeaderLibrariesConan(ConanFile): name = "daw_header_libraries" + description = "Various header libraries mostly future std lib, replacements for(e.g. visit), or some misc" license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" - description = "Various header libraries mostly future std lib, replacements for(e.g. visit), or some misc" - topics = ("algorithms", "helpers", "data-structures") homepage = "https://github.com/beached/header_libraries" - settings = "compiler", - generators = "cmake", + topics = ("algorithms", "helpers", "data-structures") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _compiler_required_cpp17 = { - "Visual Studio": "16", - "gcc": "8", - "clang": "7", - "apple-clang": "12.0", - } - @property - def _source_subfolder(self): - return "source_subfolder" + def _compiler_required_cpp17(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "17") + check_min_cppstd(self, "17") minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++17, which your compiler does not support.") else: - self.output.warn("{0} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + self.output.warn(f"{self.ref} requires C++17. Your compiler is unknown. Assuming it supports C++17.") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure(source_folder=self._source_subfolder) - return cmake + def build(self): + pass def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - - cmake = self._configure_cmake() - cmake.install() - - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - - def package_id(self): - self.info.header_only() + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "daw-header-libraries" - self.cpp_info.filenames["cmake_find_package_multi"] = "daw-header-libraries" self.cpp_info.set_property("cmake_file_name", "daw-header-libraries") + self.cpp_info.set_property("cmake_target_name", "daw::daw-header-libraries") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "daw-header-libraries" + self.cpp_info.filenames["cmake_find_package_multi"] = "daw-header-libraries" self.cpp_info.names["cmake_find_package"] = "daw" self.cpp_info.names["cmake_find_package_multi"] = "daw" - self.cpp_info.set_property("cmake_target_name", "daw::daw-header-libraries") - self.cpp_info.components["daw"].names["cmake_find_package"] = "daw-header-libraries" self.cpp_info.components["daw"].names["cmake_find_package_multi"] = "daw-header-libraries" self.cpp_info.components["daw"].set_property("cmake_target_name", "daw::daw-header-libraries") diff --git a/recipes/daw_header_libraries/all/test_package/CMakeLists.txt b/recipes/daw_header_libraries/all/test_package/CMakeLists.txt index 927d4cdc2126b..6f3779f32a0d2 100644 --- a/recipes/daw_header_libraries/all/test_package/CMakeLists.txt +++ b/recipes/daw_header_libraries/all/test_package/CMakeLists.txt @@ -1,8 +1,6 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package CXX) find_package(daw-header-libraries CONFIG REQUIRED) diff --git a/recipes/daw_header_libraries/all/test_package/conanfile.py b/recipes/daw_header_libraries/all/test_package/conanfile.py index de03d357e14e0..a9fbb7f543162 100644 --- a/recipes/daw_header_libraries/all/test_package/conanfile.py +++ b/recipes/daw_header_libraries/all/test_package/conanfile.py @@ -1,9 +1,18 @@ +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 DawHeaderLibrariesTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +20,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt b/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..82a3df8058bdf --- /dev/null +++ b/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(daw-header-libraries REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE daw::daw-header-libraries) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/daw_header_libraries/all/test_v1_package/conanfile.py b/recipes/daw_header_libraries/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/daw_header_libraries/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/daw_header_libraries/config.yml b/recipes/daw_header_libraries/config.yml index 0dae96daeb7f5..b96db2d45d6b0 100644 --- a/recipes/daw_header_libraries/config.yml +++ b/recipes/daw_header_libraries/config.yml @@ -15,13 +15,5 @@ versions: folder: all "2.46.0": folder: all - "2.33.2": - folder: all - "2.23.0": - folder: all - "2.15.1": - folder: all - "2.5.3": - folder: all "1.29.7": folder: all From f0a7b967da29fbbfb2b10773ffeb965b14f94eef Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 21 Sep 2022 00:25:53 +0200 Subject: [PATCH 111/561] (#13011) pango 1.50.10 * pango 1.50.10 * Update conandata.yml * Update config.yml * bump reqs * fix hooks * Update conanfile.py --- recipes/pango/all/conandata.yml | 27 +++---------------- recipes/pango/all/conanfile.py | 48 ++++++++++++++++++--------------- recipes/pango/config.yml | 18 ++----------- 3 files changed, 31 insertions(+), 62 deletions(-) diff --git a/recipes/pango/all/conandata.yml b/recipes/pango/all/conandata.yml index cd350d2b24ed1..1d8c33548e913 100644 --- a/recipes/pango/all/conandata.yml +++ b/recipes/pango/all/conandata.yml @@ -1,28 +1,4 @@ sources: -# "1.48.0": -# sha256: "d76513ac89341883320bd5ea063ec7005e70d962deedc064c62d6f17f6769b88" -# url: "https://github.com/GNOME/pango/archive/1.48.0.tar.gz" -# "1.48.1": -# sha256: "766ef4da466eb9a2a6d75278d769795a9c229fce5593d4e735039a05b155199c" -# url: "https://github.com/GNOME/pango/archive/1.48.1.tar.gz" -# "1.48.2": -# url: "https://github.com/GNOME/pango/archive/1.48.2.tar.gz" -# sha256: "19ea06742d9b8da590fed3c2bea018258609c18718a6deedd46cab957d3be9cf" -## "1.48.3": -# url: "https://github.com/GNOME/pango/archive/1.48.3.tar.gz" -# sha256: "63318b75bdd510b11fc960dbcdff9bc8b744fb3e45583acbb3410ef36bacc054" -# "1.48.4": -# url: "https://github.com/GNOME/pango/archive/1.48.4.tar.gz" -# sha256: "2c7e92f2430ae2ab91d6156488f41dfb0fd1ea787fbfb807dfe53a4f361a9d1a" -# "1.48.5": -# url: "https://github.com/GNOME/pango/archive/1.48.5.tar.gz" -# sha256: "9eccf148a4ca4727ed7d31ea1a2b7c77e8a8a286fc87967fb216669939e86eee" -# "1.48.6": -# url: "https://github.com/GNOME/pango/archive/1.48.6.tar.gz" -# sha256: "2ca6020ded58aee9bd10a8a547cad06204e28c36539598f2030cc672e5dfeab8" -# "1.48.7": -# url: "https://github.com/GNOME/pango/archive/1.48.7.tar.gz" -# sha256: "8783c82927582437d3a224eb18ea90d195b7451ff2effdffba16039df5346170" "1.48.9": url: "https://github.com/GNOME/pango/archive/1.48.9.tar.gz" sha256: "6c78162507debd3389dab9f045cfa0b03cb44c432fb21979d4acf45db1b93781" @@ -35,3 +11,6 @@ sources: "1.50.8": url: "https://download.gnome.org/sources/pango/1.50/pango-1.50.8.tar.xz" sha256: "cf626f59dd146c023174c4034920e9667f1d25ac2c1569516d63136c311255fa" + "1.50.10": + url: "https://download.gnome.org/sources/pango/1.50/pango-1.50.10.tar.xz" + sha256: "7e5d2f1e40854d24a9a2c4d093bafe75dcdbeccdf1de43e4437332eabed64966" diff --git a/recipes/pango/all/conanfile.py b/recipes/pango/all/conanfile.py index 1e054908ec7bc..7c23b65c48a80 100644 --- a/recipes/pango/all/conanfile.py +++ b/recipes/pango/all/conanfile.py @@ -1,12 +1,14 @@ import os -import shutil import glob -from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conans import tools, Meson, VisualStudioBuildEnvironment +from conan import ConanFile +from conan.tools.scm import Version +from conan.tools.files import get, replace_in_file, chdir, rmdir, rm, rename +from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc -required_conan_version = ">=1.32.0" +required_conan_version = ">=1.51.3" class PangoConan(ConanFile): name = "pango" @@ -30,7 +32,7 @@ def _build_subfolder(self): return "build_subfolder" def validate(self): - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("this recipe does not support GCC before version 5. contributions are welcome") if self.options.with_xft and not self.settings.os in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("Xft can only be used on Linux and FreeBSD") @@ -72,7 +74,7 @@ def configure(self): def build_requirements(self): self.build_requires("pkgconf/1.7.4") - self.build_requires("meson/0.62.1") + self.build_requires("meson/0.63.2") def requirements(self): if self.options.with_freetype: @@ -86,16 +88,16 @@ def requirements(self): self.requires("xorg/system") # for xorg::xrender if self.options.with_cairo: self.requires("cairo/1.17.4") - self.requires("harfbuzz/4.3.0") - self.requires("glib/2.73.0") + self.requires("harfbuzz/5.1.0") + self.requires("glib/2.73.3") self.requires("fribidi/1.0.12") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def _configure_meson(self): - defs = dict() + defs = {} defs["introspection"] = "disabled" defs["libthai"] = "enabled" if self.options.with_libthai else "disabled" @@ -110,10 +112,10 @@ def _configure_meson(self): def build(self): meson_build = os.path.join(self._source_subfolder, "meson.build") - tools.replace_in_file(meson_build, "subdir('tests')", "") - tools.replace_in_file(meson_build, "subdir('tools')", "") - tools.replace_in_file(meson_build, "subdir('utils')", "") - tools.replace_in_file(meson_build, "subdir('examples')", "") + replace_in_file(self, meson_build, "subdir('tests')", "") + replace_in_file(self, meson_build, "subdir('tools')", "") + replace_in_file(self, meson_build, "subdir('utils')", "") + replace_in_file(self, meson_build, "subdir('examples')", "") with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if is_msvc(self) else tools.no_op(): meson = self._configure_meson() meson.build() @@ -124,13 +126,13 @@ def package(self): meson = self._configure_meson() meson.install() if is_msvc(self): - with tools.chdir(os.path.join(self.package_folder, "lib")): + with chdir(self, os.path.join(self.package_folder, "lib")): for filename_old in glob.glob("*.a"): filename_new = filename_old[3:-2] + ".lib" - self.output.info("rename %s into %s" % (filename_old, filename_new)) - shutil.move(filename_old, filename_new) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(self.package_folder, "*.pdb") + self.output.info(f"rename {filename_old} into {filename_new}") + rename(self, filename_old, filename_new) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): self.cpp_info.components['pango_'].libs = ['pango-1.0'] @@ -197,7 +199,9 @@ def package_info(self): self.env_info.PATH.append(os.path.join(self.package_folder, 'bin')) def package_id(self): - self.info.requires["glib"].full_package_mode() - self.info.requires["harfbuzz"].full_package_mode() - if self.options.with_cairo: + if not self.options["glib"].shared: + self.info.requires["glib"].full_package_mode() + if not self.options["harfbuzz"].shared: + self.info.requires["harfbuzz"].full_package_mode() + if self.options.with_cairo and not self.options["cairo"].shared: self.info.requires["cairo"].full_package_mode() diff --git a/recipes/pango/config.yml b/recipes/pango/config.yml index 21ce9306cfcb9..40891312baffc 100644 --- a/recipes/pango/config.yml +++ b/recipes/pango/config.yml @@ -1,20 +1,4 @@ versions: -# "1.48.0": -# folder: all -# "1.48.1": -# folder: all -# "1.48.2": -# folder: all -# "1.48.3": -# folder: all -# "1.48.4": -# folder: all -# "1.48.5": -# folder: all -# "1.48.6": -# folder: all -# "1.48.7": -# folder: all "1.48.9": folder: all "1.49.3": @@ -23,3 +7,5 @@ versions: folder: all "1.50.8": folder: all + "1.50.10": + folder: all From d4c61a4c75f0d77ea14d44a915f8341b4f548482 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Sep 2022 01:04:55 +0200 Subject: [PATCH 112/561] (#13029) optional-lite: conan v2 support --- recipes/optional-lite/all/conanfile.py | 30 ++++++++++++------- .../all/test_package/CMakeLists.txt | 7 ++--- .../all/test_package/conanfile.py | 19 ++++++++---- .../all/test_v1_package/CMakeLists.txt | 10 +++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++++ 5 files changed, 63 insertions(+), 20 deletions(-) create mode 100644 recipes/optional-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/optional-lite/all/test_v1_package/conanfile.py diff --git a/recipes/optional-lite/all/conanfile.py b/recipes/optional-lite/all/conanfile.py index 5761d46d53213..f70e5bfcb8e65 100644 --- a/recipes/optional-lite/all/conanfile.py +++ b/recipes/optional-lite/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class OptionalLiteConan(ConanFile): @@ -14,24 +16,29 @@ class OptionalLiteConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "optional-lite") self.cpp_info.set_property("cmake_target_name", "nonstd::optional-lite") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "optional-lite" @@ -41,3 +48,6 @@ def package_info(self): self.cpp_info.components["optionallite"].names["cmake_find_package"] = "optional-lite" self.cpp_info.components["optionallite"].names["cmake_find_package_multi"] = "optional-lite" self.cpp_info.components["optionallite"].set_property("cmake_target_name", "nonstd::optional-lite") + self.cpp_info.components["optionallite"].bindirs = [] + self.cpp_info.components["optionallite"].libdirs = [] + self.cpp_info.components["optionallite"].resdirs = [] diff --git a/recipes/optional-lite/all/test_package/CMakeLists.txt b/recipes/optional-lite/all/test_package/CMakeLists.txt index 7d6c9b6cca813..cc0865d43e169 100644 --- a/recipes/optional-lite/all/test_package/CMakeLists.txt +++ b/recipes/optional-lite/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(optional-lite REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} nonstd::optional-lite) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::optional-lite) diff --git a/recipes/optional-lite/all/test_package/conanfile.py b/recipes/optional-lite/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/optional-lite/all/test_package/conanfile.py +++ b/recipes/optional-lite/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/optional-lite/all/test_v1_package/CMakeLists.txt b/recipes/optional-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..381a5d41cbb1b --- /dev/null +++ b/recipes/optional-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(optional-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::optional-lite) diff --git a/recipes/optional-lite/all/test_v1_package/conanfile.py b/recipes/optional-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/optional-lite/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From a4b7ebc93dab2f6f07b048fd02e670c14b9b7529 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 21 Sep 2022 01:24:57 +0200 Subject: [PATCH 113/561] (#13026) libffi 3.4.3 --- recipes/libffi/all/conandata.yml | 12 +++++++++++ .../patches/0002-3.4.3-fix-libtool-path.patch | 20 +++++++++++++++++++ ...raries-to-arch-dependent-directories.patch | 11 ++++++++++ ...0006-3.4.3-library-no-version-suffix.patch | 11 ++++++++++ recipes/libffi/config.yml | 2 ++ 5 files changed, 56 insertions(+) create mode 100644 recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch create mode 100644 recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch create mode 100644 recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch diff --git a/recipes/libffi/all/conandata.yml b/recipes/libffi/all/conandata.yml index d6c753d210634..4ce9946df3a32 100644 --- a/recipes/libffi/all/conandata.yml +++ b/recipes/libffi/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.4.3": + url: "https://github.com/libffi/libffi/releases/download/v3.4.3/libffi-3.4.3.tar.gz" + sha256: "4416dd92b6ae8fcb5b10421e711c4d3cb31203d77521a77d85d0102311e6c3b8" "3.4.2": url: "https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz" sha256: "540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620" @@ -9,6 +12,15 @@ sources: url: "https://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz" sha256: "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37" patches: + "3.4.3": + - base_path: "source_subfolder" + patch_file: "patches/0002-3.4.3-fix-libtool-path.patch" + - base_path: "source_subfolder" + patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" + - base_path: "source_subfolder" + patch_file: "patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch" + - base_path: "source_subfolder" + patch_file: "patches/0006-3.4.3-library-no-version-suffix.patch" "3.4.2": - base_path: "source_subfolder" patch_file: "patches/0002-3.4.2-fix-libtool-path.patch" diff --git a/recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch new file mode 100644 index 0000000000000..f7d0c10680b69 --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.4.3-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -9940,7 +9940,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' + + + +@@ -10032,7 +10032,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=libtool.sh + can_build_shared=yes + + # All known linkers require a '.a' archive for static linking (except MSVC and diff --git a/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch new file mode 100644 index 0000000000000..e82abf24a4fb1 --- /dev/null +++ b/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch @@ -0,0 +1,11 @@ +--- Makefile.in ++++ Makefile.in +@@ -520,7 +520,7 @@ + target_vendor = @target_vendor@ + tmake_file = @tmake_file@ + toolexecdir = @toolexecdir@ +-toolexeclibdir = @toolexeclibdir@ ++toolexeclibdir = @libdir@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ diff --git a/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch new file mode 100644 index 0000000000000..0ad4d29b1c4ce --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch @@ -0,0 +1,11 @@ +--- Makefile.in ++++ Makefile.in +@@ -615,7 +615,7 @@ + @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = + @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map + @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun +-libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` ++libffi_version_info = -avoid-version + libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) + libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) + AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/config.yml b/recipes/libffi/config.yml index c745eb3efbca6..c1c6e30f4ceee 100644 --- a/recipes/libffi/config.yml +++ b/recipes/libffi/config.yml @@ -1,4 +1,6 @@ versions: + "3.4.3": + folder: "all" "3.4.2": folder: "all" "3.3": From 924830c2a020224466b594ec5d7d2bb15157dd46 Mon Sep 17 00:00:00 2001 From: Pat Mancuso <46453397+patmantru@users.noreply.github.com> Date: Tue, 20 Sep 2022 19:45:06 -0400 Subject: [PATCH 114/561] (#13046) opentdf-client: add version 1.1.6 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/opentdf-client/all/conandata.yml | 3 +++ recipes/opentdf-client/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/opentdf-client/all/conandata.yml b/recipes/opentdf-client/all/conandata.yml index 40290f5cad510..a449831989d2e 100644 --- a/recipes/opentdf-client/all/conandata.yml +++ b/recipes/opentdf-client/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.6": + url: "https://github.com/opentdf/client-cpp/archive/1.1.6.tar.gz" + sha256: "83992c37c9a58ae2152660a4ffbf1784fe63d7a9e7b8466d10ca1074697b3d3a" "1.1.5": url: "https://github.com/opentdf/client-cpp/archive/1.1.5.tar.gz" sha256: "8fd5b22b36b19cd58a18f63cbffe3d538263ef3aecde4802059951c4eb5ce044" diff --git a/recipes/opentdf-client/config.yml b/recipes/opentdf-client/config.yml index 8ccfd97624976..56aaeb1ead047 100644 --- a/recipes/opentdf-client/config.yml +++ b/recipes/opentdf-client/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.6": + folder: all "1.1.5": folder: all "1.1.3": From 383ed5733257ffe74292d367e472af9c198f1f58 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 21 Sep 2022 00:24:15 -0700 Subject: [PATCH 115/561] (#12281) docs: capture our policy for the options `shared` and `fPIC` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: capture our policy for the options `shared` and `fPIC` This came as a question on Slack, thought it was worth writting down https://cpplang.slack.com/archives/C41CWV9HA/p1660683315599809 * move everything to packing policy * Update docs/packaging_policy.md * Update docs/packaging_policy.md * Update docs/packaging_policy.md * Apply sse4s suggest * Add original q to faq and link to new docs * Apply suggestions from code review Co-authored-by: Francisco Ramírez * Note `rm_safe` * Update docs/packaging_policy.md * Update docs/packaging_policy.md * Update docs/packaging_policy.md Co-authored-by: Uilian Ries Co-authored-by: Francisco Ramírez Co-authored-by: Uilian Ries --- docs/faqs.md | 7 ++-- docs/packaging_policy.md | 76 +++++++++++++++++++++++++++++++++++----- docs/reviewing.md | 27 -------------- 3 files changed, 73 insertions(+), 37 deletions(-) diff --git a/docs/faqs.md b/docs/faqs.md index 6e67032f714a4..9ecbaef89cdd3 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -127,6 +127,10 @@ As stated earlier, any increase in the number of configurations will result in a We often receive new fixes and improvements to the recipes already available for x86_64, including help for other architectures like x86 and ARM. In addition, we also receive new cases of bugs, for recipes that do not work on a certain platform, but that are necessary for use, which is important to understand where we should put more effort. So we believe that the best way to maintain and add support for other architectures is through the community. +## Do static libraries tend to be compiled as PIC by default? + +Yes! You can learn more about default options in [Packing Policy](packing_policy.md#options). + ## Why PDB files are not allowed? The project initially decided not to support the PDB files primarily due to the size of the final package, which could add an exaggerated size and not even used by users. In addition, PDB files need the source code to perform the debugging and even follow the path in which it was created and not the one used by the user, which makes it difficult to use when compared to the regular development flow with the IDE. @@ -249,8 +253,7 @@ There are different motivations ## Why not add an option to build unit tests - Adding a testing option will change the package ID, but will not provide different packaged binaries -- Use the configuration [skip_test](packaging_policy.md#options) to define the testing behavior. - +- Use the configuration [skip_test](packaging_policy.md#options-to-avoid) to define the testing behavior. ## What is the policy for supported python versions? diff --git a/docs/packaging_policy.md b/docs/packaging_policy.md index 4eb95d041e21c..25757c36cc793 100644 --- a/docs/packaging_policy.md +++ b/docs/packaging_policy.md @@ -108,29 +108,62 @@ for each combination. There are some particular cases for this general rule: ## Options Recipes can list any number of options with any meaning, and defaults are up to the recipe itself. The CI cannot enforce anything -in this direction. However, there are a couple of options that have a special meaning for the CI: +in this direction. However, there are a couple of options that have a special meaning for the CI. -* `shared` (with values `True` or `False`). The CI inspects the recipe looking for this option. If it is found, it will +### Predefined Options and Known Defaults + +ConanCenter supports many combinations, these are outline in the [supported configurations](supported_platforms_and_configurations.md) document for each platform. +By default recipes should use `shared=False` with `fPIC=True`. If support, `header_only=False` is the default. + +Usage of each option should follow the rules: + +* `shared` (with values `True` or `False`). The CI inspects the recipe looking for this option. The **default should be `shared=False`** and will generate all the configurations with values `shared=True` and `shared=False`. - > Note.- The CI applies `shared=True` only to the package being built, while every other requirement will use their defaults - > (typically `shared=False`). It's important to keep this in mind when trying to consume shared packages from ConanCenter + > **Note**: The CI applies `shared=True` only to the package being built, while every other requirement will `shared=False`. To consume everything as a shared library you will set `--build=always` and/or `-o *:shared=True`) + > It's important to keep this in mind when trying to consume shared packages from ConanCenter > as their requirements were linked inside the shared library. See [FAQs](faqs.md#how-to-consume-a-graph-of-shared-libraries) for more information. -* `header_only` (with values `True` or `False`). If the CI detects this option, it will generate all the configurations for the - value `header_only=False` and add one more configuration with `header_only=True`. **Only one - package** will be generated for `header_only=True`, so it is crucial that the package is actually a _header only_ library, with header files only (no libraries or executables inside). +* `fPIC` (with values `True` or `False`). The **default should be `fPIC=True`** and will generate all the configurations with values `fPIC=True` and `fPIC=False`. + This option does not make sense on all the support configurations so it should be removed. + + ```python + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + ``` + + Starting with Conan 1.53 this can be simplified to + + ```py + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + ``` + +* `header_only` (with values `True` or `False`). The **default should be `header_only=False`**. If the CI detects this option, it will generate all the + configurations for the value `header_only=False` and add one more configuration with `header_only=True`. **Only one package** + will be generated for `header_only=True`, so it is crucial that the package is actually a _header only_ library, with header files only (no libraries or executables inside). Recipes with such option should include the following in their `package_id` method ```python def package_id(self): if self.options.header_only: - self.info.header_only() + self.info.clear() ``` ensuring that, when the option is active, the recipe ignores all the settings and only one package ID is generated. +### Options to Avoid + * `build_testing` should not be added, nor any other related unit test option. Options affect the package ID, therefore, testing should not be part of that. Instead, use Conan config [skip_test](https://docs.conan.io/en/latest/reference/config_files/global_conf.html#tools-configurations) feature: @@ -141,3 +174,30 @@ in this direction. However, there are a couple of options that have a special me ``` The `skip_test` configuration is supported by [CMake](https://docs.conan.io/en/latest/reference/build_helpers/cmake.html#test) and [Meson](https://docs.conan.io/en/latest/reference/build_helpers/meson.html#test). + +### Recommended feature options names + +It's often needed to add options to toggle specific library features on/off. Regardless of the default, there is a strong preference for using positive naming for options. In order to avoid fragmentation, we recommend using the following naming conventions for such options: + +- enable_ / disable_ +- with_ / without_ +- use_ + +the actual recipe code then may look like: + +```py + options = {"use_tzdb": [True, False]} + default_options = {"use_tzdb": True} +``` + +```py + options = {"enable_locales": [True, False]} + default_options = {"enable_locales": True} +``` + +```py + options = {"with_zlib": [True, False]} + default_options = {"with_zlib": True} +``` + +having the same naming conventions for the options may help consumers, e.g. they will be able to specify options with wildcards: `-o *:with_threads=True`, therefore, `with_threads` options will be enabled for all packages in the graph that support it. diff --git a/docs/reviewing.md b/docs/reviewing.md index 61fe6a887d43c..3490fe6624b2a 100644 --- a/docs/reviewing.md +++ b/docs/reviewing.md @@ -182,33 +182,6 @@ target_link_libraries(${PROJECT_NAME} package::package) We encourage contributors to check that not only the _global_ target works properly, but also the ones for the components. It can be done creating and linking different libraries and/or executables. -## Recommended feature options names - -It's often needed to add options to toggle specific library features on/off. Regardless of the default, there is a strong preference for using positive naming for options. In order to avoid the fragmentation, we recommend to use the following naming conventions for such options: - -- enable_ / disable_ -- with_ / without_ -- use_ - -the actual recipe code then may look like: - -```py - options = {"use_tzdb": [True, False]} - default_options = {"use_tzdb": True} -``` - -```py - options = {"enable_locales": [True, False]} - default_options = {"enable_locales": True} -``` - -```py - options = {"with_zlib": [True, False]} - default_options = {"with_zlib": True} -``` - -having the same naming conventions for the options may help consumers, e.g. they will be able to specify options with wildcards: `-o *:with_threads=True`, therefore, `with_threads` options will be enabled for all packages in the graph that support it. - ## Supported Versions In this repository we are building a subset of all the versions for a given library. This set of version changes over time as new versions From 04462cba2a9003787af3e880ba9bb7b4b817a61c Mon Sep 17 00:00:00 2001 From: Martin Konrad Date: Wed, 21 Sep 2022 09:45:44 +0200 Subject: [PATCH 116/561] (#12885) Fix an issue when using gtest with Conan 2 * Fix an issue when using gtest with Conan 2 * Remove superfluous "(self)" Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/gtest/all/conanfile.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py index 922eaa70f7d5c..8621c6f8fe34d 100644 --- a/recipes/gtest/all/conanfile.py +++ b/recipes/gtest/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rm, rmdir from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain -from conan.tools.microsoft import is_msvc, msvc_runtime_flag, check_min_vs +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, is_msvc_static_runtime, check_min_vs from conan.tools.scm import Version required_conan_version = ">=1.50.0" @@ -86,13 +86,13 @@ def package_id(self): del self.info.options.no_main def validate(self): - if self.options.shared and (is_msvc(self) or self._is_clang_cl) and "MT" in msvc_runtime_flag(self): + if is_msvc_static_runtime(self) and self.info.options.shared: raise ConanInvalidConfiguration( "gtest:shared=True with compiler=\"Visual Studio\" is not " "compatible with compiler.runtime=MT/MTd" ) - if self.settings.compiler.get_safe("cppstd"): + if self.info.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) def loose_lt_semver(v1, v2): @@ -101,10 +101,11 @@ def loose_lt_semver(v1, v2): min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if min_version and loose_lt_semver(str(self.settings.compiler.version), min_version): + compiler = self.info.settings.compiler + min_version = self._minimum_compilers_version.get(str(compiler)) + if min_version and loose_lt_semver(str(compiler.version), min_version): raise ConanInvalidConfiguration( - f"{self.name} requires {self.settings.compiler} {min_version}. The current compiler is {self.settings.compiler} {self.settings.compiler.version}." + f"{self.ref} requires {compiler} {min_version}. The current compiler is {compiler} {compiler.version}." ) def layout(self): From db0c5009497cbd005b2e0996ed735a4acc12b2ed Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Sep 2022 10:25:56 +0200 Subject: [PATCH 117/561] (#12931) [docs] How to add packages based on new templates * Update how to add packages Signed-off-by: Uilian Ries * Update linter explanation Signed-off-by: Uilian Ries * add suggestion Signed-off-by: Uilian Ries * validate version Signed-off-by: Uilian Ries * Update docs/how_to_add_packages.md Co-authored-by: Chris Mc Signed-off-by: Uilian Ries Co-authored-by: Chris Mc --- docs/how_to_add_packages.md | 64 +++++++++++++++++++------------- docs/package_templates/README.md | 23 ++++++++++++ 2 files changed, 62 insertions(+), 25 deletions(-) create mode 100644 docs/package_templates/README.md diff --git a/docs/how_to_add_packages.md b/docs/how_to_add_packages.md index 6f0363c08c986..9afa6401e8cad 100644 --- a/docs/how_to_add_packages.md +++ b/docs/how_to_add_packages.md @@ -45,7 +45,7 @@ This process helps conan-center-index against spam and malicious code. The proce The specific steps to add new packages are: * Fork the [conan-center-index](https://github.com/conan-io/conan-center-index) git repository, and then clone it locally. -* Create a new folder with the Conan package recipe (`conanfile.py`) in the correct folder. +* Copy a template from [package_templates](package_templates) folder in the recipes/ folder and rename it to the project name (it should be lower-case). Read templates [documentation](package_templates/README.md) to find more information. * Make sure you are using the latest [Conan client](https://conan.io/downloads) version, as recipes might evolve introducing features of the newer Conan releases. * Commit and Push to GitHub then submit a pull request. * Our automated build service will build 100+ different configurations, and provide messages that indicate if there were any issues found during the pull request on GitHub. @@ -84,7 +84,10 @@ This is the canonical structure of one of these folders, where the same `conanfi | +-- test_package/ | +-- conanfile.py | +-- CMakeLists.txt -| +-- main.cpp +| +-- test_package.cpp +| +-- test_v1_package/ +| +-- conanfile.py +| +-- CMakeLists.txt ``` If it becomes too complex to maintain the logic for all the versions in a single `conanfile.py`, it is possible to split the folder `all` into @@ -110,23 +113,23 @@ versions: ### `conandata.yml` -This file lists **all the sources that are needed to build the package**: source code, license files,... any file that will be used by the recipe +This file lists **all the sources that are needed to build the package**: source code, patch files, license files,... any file that will be used by the recipe should be listed here. The file is organized into two sections, `sources` and `patches`, each one of them contains the files that are required for each version of the library. All the files that are downloaded from the internet should include a checksum, so we can validate that they are not changed. -A detailed breakdown of all the fields can be found in [conandata_yml_format.md](conandata_yml_format.md). We strongly encourage adding the [patch fields](conandata_yml_format.md#patches-fields) to help track where patches come from and what issue they solve. +A detailed breakdown of all the fields can be found in [conandata_yml_format.md](conandata_yml_format.md). We **strongly** encourage adding the [patch fields](conandata_yml_format.md#patches-fields) to help track where patches come from and what issue they solve. Inside the `conanfile.py` recipe, this data is available in a `self.conan_data` attribute that can be used as follows: ```py -def source(self): - files.get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def export_sources(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): files.copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) +def source(self): + files.get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + def build(self): files.apply_conandata_patches(self) [...] @@ -141,9 +144,8 @@ as we said before there can be one single recipe suitable for all the versions i different versions in different folders. For mainteinance reasons, we prefer to have only one recipe, but sometimes the extra effort doesn't worth it and it makes sense to split and duplicate it, there is no common rule for it. -Together with the recipe, there can be other files that are needed to build the library: patches, other files related to build systems (many recipes -include a `CMakeLists.txt` to run some Conan logic before using the one from the library),... all these files will usually be listed in the -`exports_sources` attribute and used during the build process. +Together with the recipe, there can be other files that are needed to build the library: patches, other files related to build systems, +... all these files will usually be listed in `exports_sources` and used during the build process. Also, **every `conanfile.py` should be accompanied by one or several folder to test the generated packages** as we will see below. @@ -151,6 +153,8 @@ Also, **every `conanfile.py` should be accompanied by one or several folder to t All the packages in this repository need to be tested before they join ConanCenter. A `test_package` folder with its corresponding `conanfile.py` and a minimal project to test the package is strictly required. You can read about it in the + +# FIXME: This link no longet exist and there is no dedicated section about test package in docs. [Conan documentation](https://docs.conan.io/en/latest/creating_packages/getting_started.html#the-test-package-folder). Sometimes it is useful to test the package using different build systems (CMake, Autotools,...). Instead of adding complex logic to one @@ -196,11 +200,12 @@ The [recipes](https://github.com/conan-io/conan-center-index/tree/master/recipes ### Header Only -If you are looking for header-only projects, you can take a look on [rapidjson](https://github.com/conan-io/conan-center-index/blob/master/recipes/rapidjson/all/conanfile.py), [rapidxml](https://github.com/conan-io/conan-center-index/blob/master/recipes/rapidxml/all/conanfile.py), and [nuklear](https://github.com/conan-io/conan-center-index/blob/master/recipes/nuklear/all/conanfile.py). Also, Conan Docs has a section about [how to package header-only libraries](https://docs.conan.io/en/latest/howtos/header_only.html). +If you are looking for header-only projects, you can take a look on [header-only template](package_templates/header_only). +Also, Conan Docs has a section about [how to package header-only libraries](https://docs.conan.io/en/latest/howtos/header_only.html). ### CMake -For C/C++ projects which use CMake for building, you can take a look on [szip](https://github.com/conan-io/conan-center-index/blob/master/recipes/szip/all/conanfile.py) and [recastnavigation](https://github.com/conan-io/conan-center-index/blob/master/recipes/recastnavigation/all/conanfile.py). +For C/C++ projects which use CMake for building, you can take a look on [cmake package template](package_templates/cmake_package). #### Components @@ -208,7 +213,7 @@ Another common use case for CMake based projects, both header only and compiled, ### Autotools -However, if you need to use autotools for building, you can take a look on [mpc](https://github.com/conan-io/conan-center-index/blob/master/recipes/mpc/all/conanfile.py), [libatomic_ops](https://github.com/conan-io/conan-center-index/blob/master/recipes/libatomic_ops/all/conanfile.py), [libev](https://github.com/conan-io/conan-center-index/blob/master/recipes/libev/all/conanfile.py). +However, if you need to use autotools for building, you can take a look on [libalsa](https://github.com/conan-io/conan-center-index/blob/master/recipes/libalsa/all/conanfile.py), [kmod](https://github.com/conan-io/conan-center-index/blob/master/recipes/kmod/all/conanfile.py), [libcap](https://github.com/conan-io/conan-center-index/blob/master/recipes/libcap/all/conanfile.py). #### Components @@ -225,33 +230,36 @@ For cases where a project only offers source files, but not a build script, you The [SystemPackageTool](https://docs.conan.io/en/latest/reference/conanfile/methods.html#systempackagetool) can easily manage a system package manager (e.g. apt, pacman, brew, choco) and install packages which are missing on Conan Center but available for most distributions. It is key to correctly fill in the `cpp_info` for the consumers of a system package to have access to whatever was installed. -As example there are [glu](https://github.com/conan-io/conan-center-index/blob/master/recipes/glu/all/conanfile.py) and [OpenGL](https://github.com/conan-io/conan-center-index/blob/master/recipes/opengl/all/conanfile.py). Also, it will require an exception rule for [conan-center hook](https://github.com/conan-io/hooks#conan-center), a [pull request](https://github.com/conan-io/hooks/pulls) should be open to allow it over the KB-H032. +As example there is [xorg](https://github.com/conan-io/conan-center-index/blob/master/recipes/xorg/all/conanfile.py). Also, it will require an exception rule for [conan-center hook](https://github.com/conan-io/hooks#conan-center), a [pull request](https://github.com/conan-io/hooks/pulls) should be open to allow it over the KB-H032. ### Verifying Dependency Version -Some project requirements need to respect a version constraint. This can be enforced in a recipe by accessing the [`deps_cpp_info`](https://docs.conan.io/en/latest/reference/conanfile/attributes.html#deps-cpp-info) attribute. -An exaple of this can be found in the [spdlog recipe](https://github.com/conan-io/conan-center-index/blob/9618f31c4d9b4da5d06f905befe9691cf105a1fc/recipes/spdlog/all/conanfile.py#L92-L94). +Some project requirements need to respect a version constraint. This can be enforced in a recipe by accessing the [`dependencies`](https://docs.conan.io/en/latest/reference/conanfile/dependencies.html) attribute. +An example of this can be found in the [fcl recipe](https://github.com/conan-io/conan-center-index/blob/1b6b496fe9a9be4714f8a0db45274c29b0314fe3/recipes/fcl/all/conanfile.py#L80). ```py -if tools.Version(self.deps_cpp_info["liba"].version) < "7": - raise ConanInvalidConfiguration(f"The project {self.name}/{self.version} requires liba > 7.x") +def validate(self): + foobar = self.dependencies["foobar"] + if self.info.options.shared and Version(foobar.ref.version) < "1.2": + raise ConanInvalidConfiguration(f"{self.ref} requires 'foobar' >=1.2 to be built as shared.") ``` -In Conan version 1.x this needs to be done in the `build` method, in future release is should be done in the `validate` method. - ### Verifying Dependency Options Certain projects are dependant on the configuration (a.k.a options) of a dependency. This can be enforced in a recipe by accessing the [`options`](https://docs.conan.io/en/latest/reference/conanfile/attributes.html#options) attribute. -An example of this can be found in the [kealib recipe](https://github.com/conan-io/conan-center-index/blob/9618f31c4d9b4da5d06f905befe9691cf105a1fc/recipes/kealib/all/conanfile.py#L44-L46). +An example of this can be found in the [sdl_image recipe](https://github.com/conan-io/conan-center-index/blob/1b6b496fe9a9be4714f8a0db45274c29b0314fe3/recipes/sdl_image/all/conanfile.py#L93). ```py def validate(self): - if not self.options["liba"].enable_feature: - raise ConanInvalidConfiguration(f"The project {self.name}/{self.version} requires liba.enable_feature=True.") + foobar = self.dependencies["foobar"] + if not foobar.options.enable_feature: + raise ConanInvalidConfiguration(f"The project {self.ref} requires foobar:enable_feature=True.") ``` ## Test the recipe locally +### Hooks + The system will use the [conan-center hook](https://github.com/conan-io/hooks) to perform some quality checks. You can install the hook running: ```sh @@ -267,11 +275,11 @@ All hook checks will print a similar message: [HOOK - conan-center.py] post_package(): ERROR: [PACKAGE LICENSE] No package licenses found ``` -Call `conan create . lib/1.0@` in the folder of the recipe using the profile you want to test. For instance: +Call `conan create . lib/1.0@ -pr:b=default -pr:h=default` in the folder of the recipe using the profile you want to test. For instance: ```sh cd conan-center-index/recipes/boost/all -conan create conanfile.py boost/1.77.0@ +conan create conanfile.py boost/1.77.0@ -pr:b=default -pr:h=default ``` ### Updating conan hooks on your machine @@ -282,6 +290,12 @@ The hooks are updated from time to time, so it's worth keeping your own copy of conan config install ``` +### Linters + +Linters are always executed by Github actions to validate parts of your recipe, for instance, if it uses migrated Conan tools imports. +All executed linters are documented in [linters.md](linters.md). +To understand how to run linters locally, read [V2 linter](v2_linter.md) documentation. + ## Debugging failed builds Go to the [Error Knowledge Base](error_knowledge_base.md) page to know more about Conan Center hook errors. diff --git a/docs/package_templates/README.md b/docs/package_templates/README.md new file mode 100644 index 0000000000000..635023cac662c --- /dev/null +++ b/docs/package_templates/README.md @@ -0,0 +1,23 @@ +## Package Templates + +A brief description about each template available: + +#### Autotools package + +It's listed under [autotools_package](autotools_package) folder. It fits projects which use `autotools` or `make` to be built. + +#### CMake package + +It's listed under [cmake_package](cmake_package) folder. It fits projects which use `CMake` to be built. + +#### Header only + +It's listed under [header_only](header_only) folder. It fits projects which only copy header and have the same package ID always. + +#### MSBuild package + +It's listed under [msbuild_package](msbuild_package) folder. It fits projects which use `msbuild` to be built. + +#### Prebuilt tool package + +It's listed under [prebuilt_tool_package](prebuilt_tool_package) folder. It fits projects which only copy generated binaries (executables and libraries). From 6f7e3e59dfc86a32c67b165cf77aa4743a438f7d Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Sep 2022 10:45:01 +0200 Subject: [PATCH 118/561] (#12963) [docs] Update unexpected error label * Update unexpected error label Signed-off-by: Uilian Ries * Update docs/labels.md Co-authored-by: SSE4 Signed-off-by: Uilian Ries Co-authored-by: SSE4 --- docs/labels.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/labels.md b/docs/labels.md index 1f1a2cff71d50..2646caeaa41cf 100644 --- a/docs/labels.md +++ b/docs/labels.md @@ -50,11 +50,12 @@ any further activity. ## Unexpected Error Label [`Unexpected Error`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Unexpected+Error%22) -is assigned by the CI when the process finishes abnormally. It tries to signal all the pull requests that failed, but -didn't provide any meaningful message to the user. Usually it is some _random_ internal error and it won't happen next -time the CI runs. The CI will re-start your build automatically, the Github check `continuous-integration/jenkins/pr-merge` will changed to the -status `Pending — This commit is being built` to signalize as running. In case you restart it manually, by closing/opening the PR, your -build will be restarted too, but it will be the last in the CI build queue. +is assigned by the CI when the process finishes abnormally. +Usually it is some _random_ internal error and it won't happen next time the CI runs. +The CI will re-start your build automatically, the Github check `continuous-integration/jenkins/pr-merge` +will be changed to the status `Pending — This commit is being built` to signalize as running. + +> **Note**: Manually restarting a new build, by closing/opening the PR, will be added to the end of the CI build queue. ## User-approval pending From 057b873055afacd8a4f2b49dcb4222b2c5ec1592 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Sep 2022 11:05:09 +0200 Subject: [PATCH 119/561] (#12973) [docs] Enforce to ask more details when reporting a bug report * Update bug template Signed-off-by: Uilian Ries * update description Signed-off-by: Uilian Ries * Update help description Co-authored-by: Chris Mc * all fields are mandatory Signed-off-by: Uilian Ries * add placeholders Signed-off-by: Uilian Ries * add placeholders Signed-off-by: Uilian Ries * add placeholders Signed-off-by: Uilian Ries * update issue template Signed-off-by: Uilian Ries * update issue template Signed-off-by: Uilian Ries * update issue template Signed-off-by: Uilian Ries * update issue template Signed-off-by: Uilian Ries * what do you expect Co-authored-by: Chris Mc * emphatize the title Co-authored-by: Chris Mc Signed-off-by: Uilian Ries Co-authored-by: Chris Mc --- .github/ISSUE_TEMPLATE/package_bug.yml | 47 ++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/package_bug.yml b/.github/ISSUE_TEMPLATE/package_bug.yml index 8d4162d3beef4..5ac1a60d6437d 100644 --- a/.github/ISSUE_TEMPLATE/package_bug.yml +++ b/.github/ISSUE_TEMPLATE/package_bug.yml @@ -3,16 +3,22 @@ description: 'Report a bug, something does not work as it supposed to' title: '[package] /: SHORT DESCRIPTION' labels: bug body: -- type: markdown +- type: textarea attributes: + label: Description + description: What is not working? What were you expecting? Are there any workarounds? value: | - Please don't forget to update the issue title. - Include all applicable information to help us reproduce your problem. + _Please don't forget to update the issue title._ + + Missing profile or a short log will make extremely difficult to investigate your case or provide any help, + please, include all applicable information with details to help us reproduce your problem. + validations: + required: true - type: textarea attributes: label: Package and Environment Details - description: include every applicable attribute) + description: (include every applicable attribute) value: | * Package Name/Version: **zlib/1.2.8** * Operating System+version: **Linux Ubuntu 18.04** @@ -20,24 +26,49 @@ body: * Docker image: **conanio/gcc8** * Conan version: **conan 1.18.0** * Python version: **Python 3.7.4** + placeholder: | + cat /etc/lsb-release | grep + gcc --version + docker info + cmake --version + conan -v + python3 --version validations: required: true - - type: textarea attributes: label: Conan profile description: output of `conan profile show default` or `conan profile show ` if custom profile is in use + value: | + [settings] + os=Macos + os_build=Macos + arch=armv8 + arch_build=armv8 + compiler=apple-clang + compiler.version=14 + compiler.libcxx=libc++ + build_type=Release + [options] + [conf] + [build_requires] + [env] + validations: + required: true - type: textarea attributes: label: Steps to reproduce - description: Include if Applicable + description: Which commands did you run? + value: conan install -r conancenter foobar/0.1.0@ -pr:b=default -pr:h=default + validations: + required: true - type: textarea attributes: label: Logs - description: Include/Attach if Applicable + description: Include/Attach the entire command output here. value: |
Click to expand log @@ -46,3 +77,5 @@ body: ```
+ validations: + required: true From 670591802c6bb0daeadeb4407fcdc14ef672cc12 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Sep 2022 18:24:44 +0900 Subject: [PATCH 120/561] (#12977) md4c: conan v2 support * md4c: conan v2 support * fix test_package.c filename * add patch for BUILD_SHARED_LIBS and enable md2html command --- recipes/md4c/all/CMakeLists.txt | 7 -- recipes/md4c/all/conandata.yml | 4 +- recipes/md4c/all/conanfile.py | 85 +++++++++++-------- ...0.4.8-0001-disable-build-shared-flag.patch | 20 +++++ .../0.4.8-0001-remove-unused-files.patch | 29 ------- recipes/md4c/all/test_package/CMakeLists.txt | 10 +-- recipes/md4c/all/test_package/conanfile.py | 22 +++-- .../md4c/all/test_v1_package/CMakeLists.txt | 11 +++ recipes/md4c/all/test_v1_package/conanfile.py | 18 ++++ 9 files changed, 122 insertions(+), 84 deletions(-) delete mode 100644 recipes/md4c/all/CMakeLists.txt create mode 100644 recipes/md4c/all/patches/0.4.8-0001-disable-build-shared-flag.patch delete mode 100644 recipes/md4c/all/patches/0.4.8-0001-remove-unused-files.patch create mode 100644 recipes/md4c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/md4c/all/test_v1_package/conanfile.py diff --git a/recipes/md4c/all/CMakeLists.txt b/recipes/md4c/all/CMakeLists.txt deleted file mode 100644 index 1632809b71a7a..0000000000000 --- a/recipes/md4c/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/md4c/all/conandata.yml b/recipes/md4c/all/conandata.yml index 32ec845b1785b..1d4309b8bcbf9 100644 --- a/recipes/md4c/all/conandata.yml +++ b/recipes/md4c/all/conandata.yml @@ -5,5 +5,5 @@ sources: patches: "0.4.8": - - base_path: "source_subfolder" - patch_file: "patches/0.4.8-0001-remove-unused-files.patch" + - patch_file: "patches/0.4.8-0001-disable-build-shared-flag.patch" + patch_description: "disable setting for BUILD_SHARED_LIBS" diff --git a/recipes/md4c/all/conanfile.py b/recipes/md4c/all/conanfile.py index 3b0624afabb2a..0bb1e2c0c17b0 100644 --- a/recipes/md4c/all/conanfile.py +++ b/recipes/md4c/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, CMake, tools -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, get, copy, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" class Md4cConan(ConanFile): name = "md4c" @@ -22,16 +25,10 @@ class Md4cConan(ConanFile): "fPIC": True, "encoding": "utf-8", } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -39,45 +36,65 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if self.settings.os != "Windows" and self.options.encoding == "utf-16": - raise tools.ConanInvalidConfiguration("utf-16 options is not supported on non-Windows platforms") + if self.info.settings.os != "Windows" and self.info.options.encoding == "utf-16": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support utf-16 options on non-Windows platforms") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + def generate(self): + tc = CMakeToolchain(self) if self.options.encoding == "utf-16": - cmake.definitions["CONAN_C_FLAGS"] = "-DMD4C_USE_UTF16" + tc.cache_variables["CONAN_C_FLAGS"] = "-DMD4C_USE_UTF16" elif self.options.encoding == "ascii": - cmake.definitions["CONAN_C_FLAGS"] = "-DMD4C_USE_ASCII" - - cmake.configure() - return cmake + tc.cache_variables["CONAN_C_FLAGS"] = "-DMD4C_USE_ASCII" + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.md", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["md4c", "md4c-html",] if self.options.encoding == "utf-16": self.cpp_info.defines.append("MD4C_USE_UTF16") + elif self.options.encoding == "ascii": + self.cpp_info.defines.append("MD4C_USE_ASCII") + + self.cpp_info.set_property("cmake_file_name", "md4c") + self.cpp_info.set_property("cmake_target_name", "md4c::md4c") + self.cpp_info.set_property("pkg_config_name", "md4c") + + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.env_info.PATH.append(bin_path) diff --git a/recipes/md4c/all/patches/0.4.8-0001-disable-build-shared-flag.patch b/recipes/md4c/all/patches/0.4.8-0001-disable-build-shared-flag.patch new file mode 100644 index 0000000000000..d193ef88fc969 --- /dev/null +++ b/recipes/md4c/all/patches/0.4.8-0001-disable-build-shared-flag.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ed62385..acdb38c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,6 +10,7 @@ set(MD_VERSION "${MD_VERSION_MAJOR}.${MD_VERSION_MINOR}.${MD_VERSION_RELEASE}") + set(PROJECT_VERSION "${MD_VERSION}") + set(PROJECT_URL "https://github.com/mity/md4c") + ++if(0) + if(WIN32) + # On Windows, given there is no standard lib install dir etc., we rather + # by default build static lib. +@@ -19,6 +20,7 @@ else() + # shared lib. + option(BUILD_SHARED_LIBS "help string describing option" ON) + endif() ++endif() + + add_definitions( + -DMD_VERSION_MAJOR=${MD_VERSION_MAJOR} diff --git a/recipes/md4c/all/patches/0.4.8-0001-remove-unused-files.patch b/recipes/md4c/all/patches/0.4.8-0001-remove-unused-files.patch deleted file mode 100644 index 899960abf53f6..0000000000000 --- a/recipes/md4c/all/patches/0.4.8-0001-remove-unused-files.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 57e353f..ed62385 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -56,4 +56,3 @@ endif() - include(GNUInstallDirs) - - add_subdirectory(src) --add_subdirectory(md2html) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 66f2f50..891abb9 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -40,7 +40,6 @@ install( - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ) --install(FILES ${CMAKE_BINARY_DIR}/src/md4c.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - - install( - TARGETS md4c-html -@@ -50,7 +49,6 @@ install( - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ) --install(FILES ${CMAKE_BINARY_DIR}/src/md4c-html.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - - install(EXPORT md4cConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/md4c/ NAMESPACE md4c::) - diff --git a/recipes/md4c/all/test_package/CMakeLists.txt b/recipes/md4c/all/test_package/CMakeLists.txt index c11ad83370d6c..dd82268d730c4 100644 --- a/recipes/md4c/all/test_package/CMakeLists.txt +++ b/recipes/md4c/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest C) +cmake_minimum_required(VERSION 3.8) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package C) find_package(md4c CONFIG REQUIRED) -add_executable(test_package test_package.c) -target_link_libraries(test_package md4c::md4c) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(test_package PRIVATE md4c::md4c) diff --git a/recipes/md4c/all/test_package/conanfile.py b/recipes/md4c/all/test_package/conanfile.py index 609b243f149ba..a9fb96656f203 100644 --- a/recipes/md4c/all/test_package/conanfile.py +++ b/recipes/md4c/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 Md4cTestConan(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/md4c/all/test_v1_package/CMakeLists.txt b/recipes/md4c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a7e30d5cc2c2d --- /dev/null +++ b/recipes/md4c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(md4c CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE md4c::md4c) diff --git a/recipes/md4c/all/test_v1_package/conanfile.py b/recipes/md4c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/md4c/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From b4e725429dd420e6db9ad33753b9457100dd2da9 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Sep 2022 18:45:12 +0900 Subject: [PATCH 121/561] (#12980) itlib: add version 1.6.1 and conan v2 support --- recipes/itlib/all/conandata.yml | 3 ++ recipes/itlib/all/conanfile.py | 40 ++++++++++++------- recipes/itlib/all/test_package/CMakeLists.txt | 10 ++--- recipes/itlib/all/test_package/conanfile.py | 22 ++++++---- .../itlib/all/test_v1_package/CMakeLists.txt | 12 ++++++ .../itlib/all/test_v1_package/conanfile.py | 18 +++++++++ recipes/itlib/config.yml | 2 + 7 files changed, 80 insertions(+), 27 deletions(-) create mode 100644 recipes/itlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/itlib/all/test_v1_package/conanfile.py diff --git a/recipes/itlib/all/conandata.yml b/recipes/itlib/all/conandata.yml index e8fc93708b1a0..cf2a8dada5fb2 100644 --- a/recipes/itlib/all/conandata.yml +++ b/recipes/itlib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.1": + url: "https://github.com/iboB/itlib/archive/v1.6.1.tar.gz" + sha256: "bff70b95ca223b4fbca206d8e1c5f6c75fd5ac86d76c8f8f14f45c748d25866a" "1.5.2": url: "https://github.com/iboB/itlib/archive/v1.5.2.tar.gz" sha256: "9ebff09fcdc873d2b01d8a2d0de2a7d7bd11844ef632f80ec5041f78bdc6ddec" diff --git a/recipes/itlib/all/conanfile.py b/recipes/itlib/all/conanfile.py index 473e855ca1d97..5176ae5632fc2 100644 --- a/recipes/itlib/all/conanfile.py +++ b/recipes/itlib/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, tools -import os +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout -required_conan_version = ">=1.33.0" +import os +required_conan_version = ">=1.50.0" class ItlibConan(ConanFile): name = "itlib" @@ -10,25 +13,34 @@ class ItlibConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/iboB/itlib" - topics = ("itlib", "template", "flatmatp", "static-vector") + topics = ("template", "flatmatp", "static-vector") settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + return 11 - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) 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], + destination=self.source_folder, strip_root=True) def package(self): - self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/itlib/all/test_package/CMakeLists.txt b/recipes/itlib/all/test_package/CMakeLists.txt index bde691eb7fb62..31ab408f84cc7 100644 --- a/recipes/itlib/all/test_package/CMakeLists.txt +++ b/recipes/itlib/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.4) -project(test_package) +cmake_minimum_required(VERSION 3.8) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package CXX) -find_package(itlib CONFIG REQUIRED) +find_package(itlib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} itlib::itlib) +target_link_libraries(${PROJECT_NAME} PRIVATE itlib::itlib) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/itlib/all/test_package/conanfile.py b/recipes/itlib/all/test_package/conanfile.py index daa9e1d1f76cc..a9fb96656f203 100644 --- a/recipes/itlib/all/test_package/conanfile.py +++ b/recipes/itlib/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools - -class ItlibTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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) @@ -13,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/itlib/all/test_v1_package/CMakeLists.txt b/recipes/itlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..dd166aa657f7d --- /dev/null +++ b/recipes/itlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(itlib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE itlib::itlib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/itlib/all/test_v1_package/conanfile.py b/recipes/itlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/itlib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/itlib/config.yml b/recipes/itlib/config.yml index 8eb3518219bd8..bbf5178c08498 100644 --- a/recipes/itlib/config.yml +++ b/recipes/itlib/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.1": + folder: all "1.5.2": folder: all "1.5.1": From 998b691b7e8e69f5cdc0eb859885f2a0c4d85d0d Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Sep 2022 19:06:31 +0900 Subject: [PATCH 122/561] (#12983) zfp: add version 1.0.0 * zfp: add version 1.0.0 * link math lib * link math lib to component --- recipes/zfp/all/conandata.yml | 3 +++ recipes/zfp/all/conanfile.py | 3 +++ recipes/zfp/all/test_package/test_package.cpp | 8 +++++++- recipes/zfp/config.yml | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/recipes/zfp/all/conandata.yml b/recipes/zfp/all/conandata.yml index dec3f160008dd..15264b6aa165c 100644 --- a/recipes/zfp/all/conandata.yml +++ b/recipes/zfp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.0": + url: "https://github.com/LLNL/zfp/archive/1.0.0.tar.gz" + sha256: "fe13b03141ee9b571692aed42ff76cf37c9dcda40f9a43a808870dca3558a57c" "0.5.5": url: "https://github.com/LLNL/zfp/archive/0.5.5.tar.gz" sha256: "6a7f4934489087d9c117a4af327fd6495ea757924f4df467b9c537abf8bd86c4" diff --git a/recipes/zfp/all/conanfile.py b/recipes/zfp/all/conanfile.py index a7dd27bf0e399..3221dda0f1571 100644 --- a/recipes/zfp/all/conanfile.py +++ b/recipes/zfp/all/conanfile.py @@ -119,6 +119,9 @@ def package_info(self): self.cpp_info.components["_zfp"].sharedlinkflags = openmp_flags self.cpp_info.components["_zfp"].exelinkflags = openmp_flags + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_zfp"].system_libs.append("m") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.components["_zfp"].names["cmake_find_package"] = "zfp" self.cpp_info.components["_zfp"].names["cmake_find_package_multi"] = "zfp" diff --git a/recipes/zfp/all/test_package/test_package.cpp b/recipes/zfp/all/test_package/test_package.cpp index f86f80103efc1..29a08fccd4085 100644 --- a/recipes/zfp/all/test_package/test_package.cpp +++ b/recipes/zfp/all/test_package/test_package.cpp @@ -1,6 +1,12 @@ #include -#include "zfparray2.h" +#include "zfp.h" + +#if ZFP_VERSION_MAJOR < 1 +# include "zfparray2.h" +#else +# include "zfp/array2.hpp" +#endif template inline double total(const array2d& u) diff --git a/recipes/zfp/config.yml b/recipes/zfp/config.yml index 0c58157bbf9a6..3e7309cad846c 100644 --- a/recipes/zfp/config.yml +++ b/recipes/zfp/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.0": + folder: all "0.5.5": folder: all From cba5b318d41847ab2837eeabf5bdfb20010d5b73 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Sep 2022 19:25:18 +0900 Subject: [PATCH 123/561] (#12985) bzip3: add version 1.1.5 * bzip3: add version 1.1.5 * fix patch filenames of 1.1.4 --- recipes/bzip3/all/CMakeLists.txt | 7 ++ recipes/bzip3/all/conandata.yml | 9 +- ...h => 1.1.4-0001-make-restrict-alias.patch} | 0 ....patch => 1.1.4-0002-export-symbols.patch} | 0 .../patches/1.1.5-0002-export-symbols.patch | 83 +++++++++++++++++++ recipes/bzip3/config.yml | 2 + 6 files changed, 99 insertions(+), 2 deletions(-) rename recipes/bzip3/all/patches/{0001-make-restrict-alias.patch => 1.1.4-0001-make-restrict-alias.patch} (100%) rename recipes/bzip3/all/patches/{0002-export-symbols.patch => 1.1.4-0002-export-symbols.patch} (100%) create mode 100644 recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch diff --git a/recipes/bzip3/all/CMakeLists.txt b/recipes/bzip3/all/CMakeLists.txt index 783a1988b3c10..21fba747c07a0 100644 --- a/recipes/bzip3/all/CMakeLists.txt +++ b/recipes/bzip3/all/CMakeLists.txt @@ -9,6 +9,12 @@ set(BZIP3_INC ) add_library(bzip3) + +if (VERSION VERSION_GREATER_EQUAL "1.1.5") +target_sources(bzip3 PRIVATE + ${BZIP3_SRC_DIR}/src/libbz3.c +) +else() target_sources(bzip3 PRIVATE ${BZIP3_SRC_DIR}/src/cm.c ${BZIP3_SRC_DIR}/src/crc32.c @@ -17,6 +23,7 @@ target_sources(bzip3 PRIVATE ${BZIP3_SRC_DIR}/src/lzp.c ${BZIP3_SRC_DIR}/src/rle.c ) +endif() target_include_directories(bzip3 PUBLIC ${BZIP3_SRC_DIR}/include) set_target_properties(bzip3 PROPERTIES PUBLIC_HEADER "${BZIP3_INC}" diff --git a/recipes/bzip3/all/conandata.yml b/recipes/bzip3/all/conandata.yml index a3a9020f9818f..2a3f78f362c7a 100644 --- a/recipes/bzip3/all/conandata.yml +++ b/recipes/bzip3/all/conandata.yml @@ -1,8 +1,13 @@ sources: + "1.1.5": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.5/bzip3-1.1.5.tar.bz2" + sha256: "2f5012b0004b6c23d5f606deed9191fdce44849234edbcf26e0316bf7856d114" "1.1.4": url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.4/bzip3-1.1.4.tar.bz2" sha256: "e23a06ae17fc36192e79d0151950b3bbd4e26381af50ba4b4fd7a2d9797e498f" patches: + "1.1.5": + - patch_file: "patches/1.1.5-0002-export-symbols.patch" "1.1.4": - - patch_file: "patches/0001-make-restrict-alias.patch" - - patch_file: "patches/0002-export-symbols.patch" + - patch_file: "patches/1.1.4-0001-make-restrict-alias.patch" + - patch_file: "patches/1.1.4-0002-export-symbols.patch" diff --git a/recipes/bzip3/all/patches/0001-make-restrict-alias.patch b/recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch similarity index 100% rename from recipes/bzip3/all/patches/0001-make-restrict-alias.patch rename to recipes/bzip3/all/patches/1.1.4-0001-make-restrict-alias.patch diff --git a/recipes/bzip3/all/patches/0002-export-symbols.patch b/recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch similarity index 100% rename from recipes/bzip3/all/patches/0002-export-symbols.patch rename to recipes/bzip3/all/patches/1.1.4-0002-export-symbols.patch diff --git a/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch b/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch new file mode 100644 index 0000000000000..e76dc6e0d184e --- /dev/null +++ b/recipes/bzip3/all/patches/1.1.5-0002-export-symbols.patch @@ -0,0 +1,83 @@ +diff --git a/include/libbz3.h b/include/libbz3.h +index a5ac58a..a9b13fd 100644 +--- a/include/libbz3.h ++++ b/include/libbz3.h +@@ -22,6 +22,16 @@ + + #include + ++#ifdef bzip3_EXPORTS ++#ifdef _WIN32 ++ #define BZIP3_API __declspec(dllexport) ++#else ++ #define BZIP3_API __attribute__((visibility("default"))) ++#endif ++#else ++ #define BZIP3_API ++#endif ++ + #define BZ3_OK 0 + #define BZ3_ERR_OUT_OF_BOUNDS -1 + #define BZ3_ERR_BWT -2 +@@ -35,31 +45,31 @@ struct bz3_state; + /** + * @brief Get the last error number associated with a given state. + */ +-int8_t bz3_last_error(struct bz3_state * state); ++BZIP3_API int8_t bz3_last_error(struct bz3_state * state); + + /** + * @brief Return a user-readable message explaining the cause of the last error. + */ +-const char * bz3_strerror(struct bz3_state * state); ++BZIP3_API const char * bz3_strerror(struct bz3_state * state); + + /** + * @brief Construct a new block encoder state, which will encode blocks as big as the given block size. + * The decoder will be able to decode blocks at most as big as the given block size. + * Returns NULL in case allocation fails or the block size is not between 65K and 511M + */ +-struct bz3_state * bz3_new(int32_t block_size); ++BZIP3_API struct bz3_state * bz3_new(int32_t block_size); + + /** + * @brief Free the memory occupied by a block encoder state. + */ +-void bz3_free(struct bz3_state * state); ++BZIP3_API void bz3_free(struct bz3_state * state); + + /** + * @brief Encode a single block. Returns the amount of bytes written to `buffer'. + * `buffer' must be able to hold at least `size + size / 50 + 32' bytes. The size must not + * exceed the block size associated with the state. + */ +-int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); ++BZIP3_API int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t size); + + /** + * @brief Decode a single block. +@@ -68,7 +78,7 @@ int32_t bz3_encode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz + * @param size The size of the compressed data in `buffer' + * @param orig_size The original size of the data before compression. + */ +-int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); ++BZIP3_API int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t size, int32_t orig_size); + + /** + * @brief Encode `n' blocks, all in parallel. +@@ -80,13 +90,13 @@ int32_t bz3_decode_block(struct bz3_state * state, uint8_t * buffer, int32_t siz + * + * Present in the shared library only if -lpthread was present during building. + */ +-void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); ++BZIP3_API void bz3_encode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t n); + + /** + * @brief Decode `n' blocks, all in parallel. + * Same specifics as `bz3_encode_blocks', but doesn't overwrite `sizes'. + */ +-void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], ++BZIP3_API void bz3_decode_blocks(struct bz3_state * states[], uint8_t * buffers[], int32_t sizes[], int32_t orig_sizes[], + int32_t n); + + #endif diff --git a/recipes/bzip3/config.yml b/recipes/bzip3/config.yml index f7bc2bb892fbd..953d7e8cb96d8 100644 --- a/recipes/bzip3/config.yml +++ b/recipes/bzip3/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.5": + folder: all "1.1.4": folder: all From 0249fed58c49e1521695ea582235fcfca3672471 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 21 Sep 2022 03:45:21 -0700 Subject: [PATCH 124/561] (#12987) docs: fix calls to `conan.files.rm` --- docs/package_templates/cmake_package/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index 75c5ac1382322..c7fe8fbf73634 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -138,8 +138,8 @@ def package(self): rmdir(self, 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, "share")) - rm(self, "*.pdb", self, os.path.join(self.package_folder, "lib")) - rm(self, "*.la", self, os.path.join(self.package_folder, "lib")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): From 15e551187f972f39e8b46b46251dc19d973be4e4 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 21 Sep 2022 04:04:41 -0700 Subject: [PATCH 125/561] (#12989) docs: using different build helpers with layouts * docs: using different build helpers with layouts * More advise --- docs/v2_migration.md | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/docs/v2_migration.md b/docs/v2_migration.md index 59e7fd6203991..26e53c13df307 100644 --- a/docs/v2_migration.md +++ b/docs/v2_migration.md @@ -1,5 +1,9 @@ # Preparing recipes for Conan 2.0 +Refer to [road to Conan v2](v2_roadmap.md) to know the steps that +will be taken in ConanCenter and this repository to start running +Conan v2 in pull requests. + ## Contents @@ -13,11 +17,7 @@ * [Translating .build_modules to cmake_build_modules](#translating-build_modules-to-cmake_build_modules) * [PkgConfigDeps](#pkgconfigdeps) -> ⚠️ Refer to [road to Conan v2](v2_roadmap.md) to know the steps that -> will be taken in ConanCenter and this repository to start running -> Conan v2 in pull requests. - -> ⚠️ Read about the [linter in pull requests](v2_linter.md). +> **Note**: Read about the [linter in pull requests](v2_linter.md) to learn how this is being enforced. It's time to start thinking seriously about Conan v2 and prepare recipes for the incoming changes. Conan v2 comes with many @@ -27,11 +27,31 @@ changes and improvements, you can read about them in the This document is a practical guide, offering extended information particular to Conan Center Index recipes to get them ready to upgrade to Conan 2.0. -## Using Layout with New Generators +## Using Layout + +All recipes should use a layout. Without one, more manual configuration of folders (e.g. source, build, etc) +and package structure will be required. -All recipes should use a layout, when doing this there is no need to manually define `self._subfolder_[...]` in a recipe. +### With New Generators + +When doing this there is no need to manually define `self._subfolder_[...]` in a recipe. Simply use `self.source_folder` and `self.build_folder` instead of [subfolder properties](reviewing.md#subfolder-properties) +### With Multiple Build Helpers + +When different build tools are use, at least one layout needs to be set. + +```python + def layout(self): + if self._use_cmake(): + cmake_layout(self) + else: # using autotools + basic_layout(self) +``` + +The `src_folder` must be the same when using different layouts and should +not depend on settings or options. + ## New cpp_info set_property model New Conan generators like From e3a54278b054be64d2d3a21edd1ee8841832ea04 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Sep 2022 20:24:42 +0900 Subject: [PATCH 126/561] (#12990) c-blosc2: add version 2.4.1 and support Conan v2 * c-blosc2: add version 2.4.1 * add dirty hack for cmake_minimum_required * fix typo * fix find_package parameter and variable names * fix cmake variable names * fix zlib variable name * use `is` instead of `==` Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/c-blosc2/all/CMakeLists.txt | 7 - recipes/c-blosc2/all/conandata.yml | 6 +- recipes/c-blosc2/all/conanfile.py | 121 ++++++++-------- .../all/patches/2.2.0-0001-fix-cmake.patch | 96 +++++++++++-- .../all/patches/2.4.1-0001-fix-cmake.patch | 129 ++++++++++++++++++ .../c-blosc2/all/test_package/CMakeLists.txt | 8 +- .../c-blosc2/all/test_package/conanfile.py | 20 ++- .../c-blosc2/all/test_package/test_package.c | 35 +++++ .../all/test_v1_package/CMakeLists.txt | 11 ++ .../c-blosc2/all/test_v1_package/conanfile.py | 18 +++ recipes/c-blosc2/config.yml | 2 + 11 files changed, 369 insertions(+), 84 deletions(-) delete mode 100644 recipes/c-blosc2/all/CMakeLists.txt create mode 100644 recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch create mode 100644 recipes/c-blosc2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c-blosc2/all/test_v1_package/conanfile.py diff --git a/recipes/c-blosc2/all/CMakeLists.txt b/recipes/c-blosc2/all/CMakeLists.txt deleted file mode 100644 index dd348757f3de8..0000000000000 --- a/recipes/c-blosc2/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 81c0e81ea55e8..60f73ddf9c3c7 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,9 +1,13 @@ sources: + "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.4.1": + - patch_file: "patches/2.4.1-0001-fix-cmake.patch" "2.2.0": - patch_file: "patches/2.2.0-0001-fix-cmake.patch" - base_path: "source_subfolder" diff --git a/recipes/c-blosc2/all/conanfile.py b/recipes/c-blosc2/all/conanfile.py index 598a57dd49f99..3b7bb98ece38b 100644 --- a/recipes/c-blosc2/all/conanfile.py +++ b/recipes/c-blosc2/all/conanfile.py @@ -1,10 +1,12 @@ -from conans import ConanFile, CMake, tools -from conan.tools.microsoft import is_msvc +from conan import ConanFile +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.files import apply_conandata_patches, get, copy, rm, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + import os -import functools import glob -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.51.3" class CBlosc2Conan(ConanFile): name = "c-blosc2" @@ -19,7 +21,7 @@ class CBlosc2Conan(ConanFile): "fPIC": [True, False], "simd_intrinsics": [None, "sse2", "avx2"], "with_lz4": [True, False], - "with_zlib": [None, "zlib", "zlib-ng"], + "with_zlib": [None, "zlib", "zlib-ng", "zlib-ng-compat"], "with_zstd": [True, False], "with_plugins": [True, False], } @@ -32,20 +34,10 @@ class CBlosc2Conan(ConanFile): "with_zstd": True, "with_plugins": True, } - generators = "cmake", "cmake_find_package_multi" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -55,17 +47,32 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + # c-blosc2 uses zlib-ng with zlib compat options. - if self.options.with_zlib == "zlib-ng": + if self.options.with_zlib == "zlib-ng-compat": self.options["zlib-ng"].zlib_compat = True + elif self.options.with_zlib == "zlib-ng": + self.options["zlib-ng"].zlib_compat = False + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_lz4: self.requires("lz4/1.9.3") - if self.options.with_zlib == "zlib-ng": + if self.options.with_zlib in ["zlib-ng", "zlib-ng-compat"]: self.requires("zlib-ng/2.0.6") elif self.options.with_zlib == "zlib": self.requires("zlib/1.2.12") @@ -73,60 +80,66 @@ def requirements(self): self.requires("zstd/1.5.2") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BLOSC_IS_SUBPROJECT"] = False - cmake.definitions["BLOSC_INSTALL"] = True - cmake.definitions["BUILD_STATIC"] = not self.options.shared - cmake.definitions["BUILD_SHARED"] = self.options.shared - cmake.definitions["BUILD_TESTS"] = False - cmake.definitions["BUILD_FUZZERS"] = False - cmake.definitions["BUILD_BENCHMARKS"] = False - cmake.definitions["BUILD_EXAMPLES"] = False + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BLOSC_IS_SUBPROJECT"] = False + tc.cache_variables["BLOSC_INSTALL"] = True + tc.cache_variables["BUILD_STATIC"] = not bool(self.options.shared) + tc.cache_variables["BUILD_SHARED"] = bool(self.options.shared) + tc.cache_variables["BUILD_TESTS"] = False + tc.cache_variables["BUILD_FUZZERS"] = False + tc.cache_variables["BUILD_BENCHMARKS"] = False + tc.cache_variables["BUILD_EXAMPLES"] = False simd_intrinsics = self.options.get_safe("simd_intrinsics", False) - cmake.definitions["DEACTIVATE_AVX2"] = simd_intrinsics != "avx2" - cmake.definitions["DEACTIVATE_LZ4"] = not self.options.with_lz4 - cmake.definitions["PREFER_EXTERNAL_LZ4"] = self.options.with_lz4 - cmake.definitions["DEACTIVATE_ZLIB"] = self.options.with_zlib == None - cmake.definitions["PREFER_EXTERNAL_ZLIB"] = self.options.with_zlib != None - cmake.definitions["DEACTIVATE_ZSTD"] = not self.options.with_zstd - cmake.definitions["PREFER_EXTERNAL_ZSTD"] = self.options.with_zstd - cmake.definitions["BUILD_PLUGINS"] = self.options.with_plugins - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.cache_variables["DEACTIVATE_AVX2"] = simd_intrinsics != "avx2" + 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 + tc.cache_variables["PREFER_EXTERNAL_ZLIB"] = True + tc.cache_variables["DEACTIVATE_ZSTD"] = not bool(self.options.with_zstd) + tc.cache_variables["PREFER_EXTERNAL_ZSTD"] = True + tc.cache_variables["BUILD_PLUGINS"] = bool(self.options.with_plugins) + if self.options.with_zlib == "zlib-ng-compat": + tc.preprocessor_definitions["ZLIB_COMPAT"] = "1" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) - for filename in glob.glob(os.path.join(self._source_subfolder, "cmake", "Find*.cmake")): + for filename in glob.glob(os.path.join(self.source_folder, "cmake", "Find*.cmake")): if os.path.basename(filename) not in [ "FindSIMD.cmake", ]: - os.remove(filename) + rm(self, os.path.basename(filename), os.path.join(self.source_folder, "cmake")) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): licenses = ["BLOSC.txt", "BITSHUFFLE.txt", "FASTLZ.txt", "LZ4.txt", "ZLIB.txt", "STDINT.txt"] for license_file in licenses: - self.copy(license_file, dst="licenses", src=os.path.join(self._source_subfolder, "LICENSES")) - cmake = self._configure_cmake() + copy(self, pattern=license_file, dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "LICENSES")) + + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) # Remove MS runtime files for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), dll_pattern_to_remove) + rm(self, pattern=dll_pattern_to_remove, folder=os.path.join(self.package_folder, "bin"), recursive=True) def package_info(self): self.cpp_info.set_property("pkg_config_name", "blosc2") + prefix = "lib" if is_msvc(self) and not self.options.shared else "" self.cpp_info.libs = ["{}blosc2".format(prefix)] if self.settings.os in ["Linux", "FreeBSD"]: 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 index ea02b0e3d45f3..cef3c154b1ab2 100644 --- 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 @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index bd8cb34..5d8981f 100644 +index bd8cb34..9c4cfe0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,8 @@ if(NOT WIN32) @@ -12,7 +12,7 @@ index bd8cb34..5d8981f 100644 if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.4) cmake_policy(SET CMP0063 NEW) endif() -@@ -144,26 +145,17 @@ if(BUILD_LITE) +@@ -144,26 +145,26 @@ if(BUILD_LITE) endif() if(PREFER_EXTERNAL_LZ4) @@ -26,15 +26,17 @@ index bd8cb34..5d8981f 100644 if(PREFER_EXTERNAL_ZLIB) - find_package(ZLIB_NG) - if (ZLIB_NG_FOUND) -- set(HAVE_ZLIB_NG TRUE) -- else() -- find_package(ZLIB) -- endif() -- ++ 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)) -- message(STATUS "No ZLIB found. Using ZLIB-NG internal sources.") -- endif() -+ find_package(ZLIB REQUIRED) ++ 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)) @@ -42,7 +44,7 @@ index bd8cb34..5d8981f 100644 message(STATUS "Using ZLIB-NG internal sources for ZLIB support.") set(HAVE_ZLIB_NG TRUE) add_definitions(-DZLIB_COMPAT) -@@ -184,7 +176,7 @@ endif() +@@ -184,7 +185,7 @@ endif() if(NOT DEACTIVATE_ZSTD) if(PREFER_EXTERNAL_ZSTD) @@ -51,3 +53,75 @@ index bd8cb34..5d8981f 100644 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/all/patches/2.4.1-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..c7220f5674f37 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch @@ -0,0 +1,129 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 866c7f6..d68513a 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,8 +185,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 441bab6..f17e467 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.4) + 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/all/test_package/CMakeLists.txt b/recipes/c-blosc2/all/test_package/CMakeLists.txt index 2b52be6633ff8..50ba489df290c 100644 --- a/recipes/c-blosc2/all/test_package/CMakeLists.txt +++ b/recipes/c-blosc2/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.8) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package C) find_package(c-blosc2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} c-blosc2::c-blosc2) +target_link_libraries(${PROJECT_NAME} PRIVATE c-blosc2::c-blosc2) diff --git a/recipes/c-blosc2/all/test_package/conanfile.py b/recipes/c-blosc2/all/test_package/conanfile.py index 333435871c7d8..a9fb96656f203 100644 --- a/recipes/c-blosc2/all/test_package/conanfile.py +++ b/recipes/c-blosc2/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conans import ConanFile, CMake -from conan import 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", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.build.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/c-blosc2/all/test_package/test_package.c b/recipes/c-blosc2/all/test_package/test_package.c index 57eacc94c15a2..754d85bde8768 100644 --- a/recipes/c-blosc2/all/test_package/test_package.c +++ b/recipes/c-blosc2/all/test_package/test_package.c @@ -35,6 +35,7 @@ int main(){ data[i] = i; } +#if !defined(BLOSC2_VERSION_MAJOR) /* Register the filter with the library */ printf("Blosc version info: %s (%s)\n", BLOSC_VERSION_STRING, BLOSC_VERSION_DATE); @@ -66,6 +67,40 @@ int main(){ /* After using it, destroy the Blosc environment */ blosc_destroy(); +#else + /* Register the filter with the library */ + printf("Blosc version info: %s (%s)\n", + BLOSC2_VERSION_STRING, BLOSC2_VERSION_DATE); + + /* Initialize the Blosc compressor */ + blosc2_init(); + + /* Compress with clevel=5 and shuffle active */ + csize = blosc2_compress(5, 1, sizeof(float), data, isize, data_out, osize); + if (csize == 0) { + printf("Buffer is uncompressible. Giving up.\n"); + return 1; + } + else if (csize < 0) { + printf("Compression error. Error code: %d\n", csize); + return csize; + } + + printf("Compression: %d -> %d (%.1fx)\n", isize, csize, (1.*isize) / csize); + + /* Decompress */ + dsize = blosc2_decompress(data_out, osize, data_dest, dsize); + if (dsize < 0) { + printf("Decompression error. Error code: %d\n", dsize); + return dsize; + } + + printf("Decompression succesful!\n"); + + /* After using it, destroy the Blosc environment */ + blosc2_destroy(); +#endif + for(i=0;i Date: Wed, 21 Sep 2022 20:44:46 +0900 Subject: [PATCH 127/561] (#12995) jeaiii-itoa: add recipe * jeaiii-itoa: add recipe * fix wrong placefolder --- recipes/jeaiii-itoa/all/conandata.yml | 4 ++ recipes/jeaiii-itoa/all/conanfile.py | 54 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 9 ++++ .../jeaiii-itoa/all/test_package/conanfile.py | 26 +++++++++ .../all/test_package/test_package.cpp | 26 +++++++++ .../all/test_v1_package/CMakeLists.txt | 12 +++++ .../all/test_v1_package/conanfile.py | 18 +++++++ recipes/jeaiii-itoa/config.yml | 3 ++ 8 files changed, 152 insertions(+) create mode 100644 recipes/jeaiii-itoa/all/conandata.yml create mode 100644 recipes/jeaiii-itoa/all/conanfile.py create mode 100644 recipes/jeaiii-itoa/all/test_package/CMakeLists.txt create mode 100644 recipes/jeaiii-itoa/all/test_package/conanfile.py create mode 100644 recipes/jeaiii-itoa/all/test_package/test_package.cpp create mode 100644 recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jeaiii-itoa/all/test_v1_package/conanfile.py create mode 100644 recipes/jeaiii-itoa/config.yml diff --git a/recipes/jeaiii-itoa/all/conandata.yml b/recipes/jeaiii-itoa/all/conandata.yml new file mode 100644 index 0000000000000..4d3c9e2b824e9 --- /dev/null +++ b/recipes/jeaiii-itoa/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220602": + url: "https://github.com/jeaiii/itoa/archive/84f25b835c8bbcf69eb97802216f8095bf94ef13.tar.gz" + sha256: "a116159f9b49922124b1c87f9989a7a8592f582904d98a3d6398e9013eca3f0f" diff --git a/recipes/jeaiii-itoa/all/conanfile.py b/recipes/jeaiii-itoa/all/conanfile.py new file mode 100644 index 0000000000000..e7cabf3b1a327 --- /dev/null +++ b/recipes/jeaiii-itoa/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy +import os + + +required_conan_version = ">=1.50.0" + + +class ItoaConan(ConanFile): + name = "jeaiii-itoa" + description = "Fast integer to ascii / integer to string conversion" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeaiii/itoa/" + topics = ("string-conversion", "itona", "integer-conversion",) + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + 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) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt b/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d27bc00b65615 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(jeaiii-itoa REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jeaiii-itoa::jeaiii-itoa) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jeaiii-itoa/all/test_package/conanfile.py b/recipes/jeaiii-itoa/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/jeaiii-itoa/all/test_package/test_package.cpp b/recipes/jeaiii-itoa/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..144466c23b699 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include + +#include "itoa/jeaiii_to_text.h" + +template +void itoa(T n, char* b) { + *jeaiii::to_text_from_integer(b, n) = '\0'; +} + +template +void show(T n) { + char text[32]; + itoa(n, text); + std::cout << text << "\n"; +} + +int main(void) { + show(-1); + show(1 << 31); + show(0x7fffffff); + show(-0x7fffffff - 1); + show(17999999999999999999ULL); + show(-5999999999999999999LL); + + return 0; +} diff --git a/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt b/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f35b931b51133 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(jeaiii-itoa REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jeaiii-itoa::jeaiii-itoa) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py b/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jeaiii-itoa/config.yml b/recipes/jeaiii-itoa/config.yml new file mode 100644 index 0000000000000..68b626ef915e2 --- /dev/null +++ b/recipes/jeaiii-itoa/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220602": + folder: all From 79e088a50d7fc57cf836d2af261f0b01897dc0e8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Sep 2022 14:05:14 +0200 Subject: [PATCH 128/561] (#13023) assimp: fix rapidjson discovery & link * fix discovery & link of rapidjson * remove requires workaroud in package_info() it has been fixed in conan 1.51.1 --- recipes/assimp/5.x/conanfile.py | 27 +------------------ .../patches/0001-unvendor-deps-5.0.x.patch | 4 +-- .../patches/0003-unvendor-deps-5.1.x.patch | 4 +-- .../patches/0004-unvendor-deps-5.1.6.patch | 4 +-- .../patches/0006-unvendor-deps-5.2.x.patch | 4 +-- 5 files changed, 9 insertions(+), 34 deletions(-) diff --git a/recipes/assimp/5.x/conanfile.py b/recipes/assimp/5.x/conanfile.py index b306ed9818cf2..0e423ced4847b 100644 --- a/recipes/assimp/5.x/conanfile.py +++ b/recipes/assimp/5.x/conanfile.py @@ -7,7 +7,7 @@ from conans import tools as tools_legacy import os -required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" +required_conan_version = ">=1.51.2" class AssimpConan(ConanFile): @@ -282,28 +282,3 @@ def package_info(self): stdcpp_library = tools_legacy.stdcpp_library(self) if stdcpp_library: self.cpp_info.system_libs.append(stdcpp_library) - - # FIXME: shouldn't be necessary. - # It's a workaround to support conan v1 generators - self.cpp_info.requires.append("minizip::minizip") - self.cpp_info.requires.append("utfcpp::utfcpp") - if Version(self.version) < "5.1.0": - self.cpp_info.requires.append("irrxml::irrxml") - else: - self.cpp_info.requires.append("pugixml::pugixml") - if self._depends_on_kuba_zip: - self.cpp_info.requires.append("kuba-zip::kuba-zip") - if self._depends_on_poly2tri: - self.cpp_info.requires.append("poly2tri::poly2tri") - if self._depends_on_rapidjson: - self.cpp_info.requires.append("rapidjson::rapidjson") - if self._depends_on_zlib: - self.cpp_info.requires.append("zlib::zlib") - if self._depends_on_draco: - self.cpp_info.requires.append("draco::draco") - if self._depends_on_clipper: - self.cpp_info.requires.append("clipper::clipper") - if self._depends_on_stb: - self.cpp_info.requires.append("stb::stb") - if self._depends_on_openddlparser: - self.cpp_info.requires.append("openddl-parser::openddl-parser") diff --git a/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch b/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch index 6df76c40d3bc9..1445d96a11b7c 100644 --- a/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch +++ b/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch @@ -110,7 +110,7 @@ - INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" ) - INCLUDE_DIRECTORIES( "../contrib" ) + if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(rapidjson REQUIRED CONFIG) ++ find_package(RapidJSON REQUIRED CONFIG) + endif() ENDIF(HUNTER_ENABLED) @@ -158,7 +158,7 @@ + target_link_libraries(assimp zip::zip) + endif() + if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp rapidjson::rapidjson) ++ target_link_libraries(assimp rapidjson) + endif() ENDIF(HUNTER_ENABLED) diff --git a/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch b/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch index e5355147d8c36..fdd67862ddb24 100644 --- a/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch +++ b/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch @@ -198,7 +198,7 @@ ELSE() - INCLUDE_DIRECTORIES("../contrib/rapidjson/include") + if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(rapidjson REQUIRED CONFIG) ++ find_package(RapidJSON REQUIRED CONFIG) + endif() ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) @@ -288,7 +288,7 @@ + target_link_libraries(assimp openddlparser::openddlparser) + endif() + if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp rapidjson::rapidjson) ++ target_link_libraries(assimp rapidjson) + endif() + if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) + target_link_libraries(assimp stb::stb) diff --git a/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch b/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch index 5e1a3a2bcfaf2..67d2f67fd3661 100644 --- a/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch +++ b/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch @@ -185,7 +185,7 @@ ELSE() - INCLUDE_DIRECTORIES("../contrib/rapidjson/include") + if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(rapidjson REQUIRED CONFIG) ++ find_package(RapidJSON REQUIRED CONFIG) + endif() ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) @@ -275,7 +275,7 @@ + target_link_libraries(assimp openddlparser::openddlparser) + endif() + if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp rapidjson::rapidjson) ++ target_link_libraries(assimp rapidjson) + endif() + if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) + target_link_libraries(assimp stb::stb) diff --git a/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch b/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch index 3fc4c7ba34b08..2a1e7bc39e620 100644 --- a/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch +++ b/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch @@ -185,7 +185,7 @@ ELSE() - INCLUDE_DIRECTORIES("../contrib/rapidjson/include") + if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(rapidjson REQUIRED CONFIG) ++ find_package(RapidJSON REQUIRED CONFIG) + endif() ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) @@ -275,7 +275,7 @@ + target_link_libraries(assimp openddlparser::openddlparser) + endif() + if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp rapidjson::rapidjson) ++ target_link_libraries(assimp rapidjson) + endif() + if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) + target_link_libraries(assimp stb::stb) From e2c75e7fc372e79c6b44f7c66ca64b32199dc2dc Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Sep 2022 14:45:45 +0200 Subject: [PATCH 129/561] (#13027) jsoncpp: also provide `JsonCpp::JsonCpp` target target added in upstream config file in 1.9.5 (https://github.com/open-source-parsers/jsoncpp/pull/1271) --- recipes/jsoncpp/all/conanfile.py | 12 +++++++++--- recipes/jsoncpp/all/test_package/CMakeLists.txt | 6 +----- recipes/jsoncpp/all/test_package/conanfile.py | 10 +++------- recipes/jsoncpp/all/test_v1_package/CMakeLists.txt | 6 +----- recipes/jsoncpp/all/test_v1_package/conanfile.py | 1 - 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/recipes/jsoncpp/all/conanfile.py b/recipes/jsoncpp/all/conanfile.py index 6d95ad8382a50..5528227357e91 100644 --- a/recipes/jsoncpp/all/conanfile.py +++ b/recipes/jsoncpp/all/conanfile.py @@ -84,9 +84,12 @@ def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + + # TODO: to remove in conan v2 once legacy generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), { + "JsonCpp::JsonCpp": "jsoncpp::jsoncpp", # alias target since 1.9.5 "jsoncpp_lib": "jsoncpp::jsoncpp", # imported target for shared lib, but also static between 1.9.0 & 1.9.3 "jsoncpp_static": "jsoncpp::jsoncpp", # imported target for static lib if >= 1.9.4 "jsoncpp_lib_static": "jsoncpp::jsoncpp", # imported target for static lib if < 1.9.0 @@ -110,13 +113,16 @@ def _module_file_rel_path(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "jsoncpp") - self.cpp_info.set_property("cmake_target_name", "jsoncpp_lib") - if not self.options.shared: - self.cpp_info.set_property("cmake_target_aliases", ["jsoncpp_static", "jsoncpp_lib_static"]) + self.cpp_info.set_property("cmake_target_name", "JsonCpp::JsonCpp") + self.cpp_info.set_property( + "cmake_target_aliases", + ["jsoncpp_lib"] if self.options.shared else ["jsoncpp_lib", "jsoncpp_static", "jsoncpp_lib_static"], + ) self.cpp_info.set_property("pkg_config_name", "jsoncpp") self.cpp_info.libs = ["jsoncpp"] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("JSON_DLL") + # TODO: to remove in conan v2 once legacy generators removed self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/jsoncpp/all/test_package/CMakeLists.txt b/recipes/jsoncpp/all/test_package/CMakeLists.txt index 64f408fab6718..3a610a43f2758 100644 --- a/recipes/jsoncpp/all/test_package/CMakeLists.txt +++ b/recipes/jsoncpp/all/test_package/CMakeLists.txt @@ -4,9 +4,5 @@ project(test_package LANGUAGES CXX) find_package(jsoncpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -if(JSONCPP_SHARED) - target_link_libraries(${PROJECT_NAME} PRIVATE jsoncpp_lib) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE jsoncpp_static) -endif() +target_link_libraries(${PROJECT_NAME} PRIVATE JsonCpp::JsonCpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jsoncpp/all/test_package/conanfile.py b/recipes/jsoncpp/all/test_package/conanfile.py index a54e689784373..836780b694c10 100644 --- a/recipes/jsoncpp/all/test_package/conanfile.py +++ b/recipes/jsoncpp/all/test_package/conanfile.py @@ -1,12 +1,13 @@ from conan import ConanFile from conan.tools.build import cross_building -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "VirtualRunEnv" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) @@ -14,11 +15,6 @@ def requirements(self): def layout(self): cmake_layout(self) - def generate(self): - tc = CMakeToolchain(self) - tc.variables["JSONCPP_SHARED"] = self.dependencies["jsoncpp"].options.shared - tc.generate() - def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt b/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt index 4b404af582ffc..79a0c735688f9 100644 --- a/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt +++ b/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt @@ -7,9 +7,5 @@ conan_basic_setup(TARGETS) find_package(jsoncpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -if(JSONCPP_SHARED) - target_link_libraries(${PROJECT_NAME} PRIVATE jsoncpp_lib) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE jsoncpp_static) -endif() +target_link_libraries(${PROJECT_NAME} PRIVATE JsonCpp::JsonCpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jsoncpp/all/test_v1_package/conanfile.py b/recipes/jsoncpp/all/test_v1_package/conanfile.py index 0afd3cd1b201f..38f4483872d47 100644 --- a/recipes/jsoncpp/all/test_v1_package/conanfile.py +++ b/recipes/jsoncpp/all/test_v1_package/conanfile.py @@ -8,7 +8,6 @@ class TestPackageConan(ConanFile): def build(self): cmake = CMake(self) - cmake.definitions["JSONCPP_SHARED"] = self.options["jsoncpp"].shared cmake.configure() cmake.build() From e728a0f893a0d57fd3eb82603265773e7686ba3c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Sep 2022 15:24:53 +0200 Subject: [PATCH 130/561] (#13032) pugixml: conan v2 support --- recipes/pugixml/all/CMakeLists.txt | 10 -- recipes/pugixml/all/conanfile.py | 110 ++++++++++-------- .../pugixml/all/test_package/CMakeLists.txt | 9 +- recipes/pugixml/all/test_package/conanfile.py | 21 +++- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../pugixml/all/test_v1_package/conanfile.py | 17 +++ 6 files changed, 106 insertions(+), 71 deletions(-) delete mode 100644 recipes/pugixml/all/CMakeLists.txt create mode 100644 recipes/pugixml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pugixml/all/test_v1_package/conanfile.py diff --git a/recipes/pugixml/all/CMakeLists.txt b/recipes/pugixml/all/CMakeLists.txt deleted file mode 100644 index f68c6e827bd09..0000000000000 --- a/recipes/pugixml/all/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -message(STATUS "Conan CMake Wrapper") -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory("source_subfolder") diff --git a/recipes/pugixml/all/conanfile.py b/recipes/pugixml/all/conanfile.py index c660cebda0b32..e43b3ee095943 100644 --- a/recipes/pugixml/all/conanfile.py +++ b/recipes/pugixml/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, load, replace_in_file, rmdir, save +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" + class PugiXmlConan(ConanFile): name = "pugixml" @@ -11,92 +15,94 @@ class PugiXmlConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://pugixml.org/" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - settings = ("os", "arch", "compiler", "build_type") + + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "header_only": [True, False], "wchar_mode": [True, False], - "no_exceptions": [True, False] + "no_exceptions": [True, False], } default_options = { - 'shared': False, - 'fPIC': True, - 'header_only': False, - 'wchar_mode': False, - 'no_exceptions': False + "shared": False, + "fPIC": True, + "header_only": False, + "wchar_mode": False, + "no_exceptions": False, } - _cmake = None - - @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': + if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: del self.options.fPIC if self.options.header_only: - if self.settings.os != 'Windows': + if self.settings.os != "Windows": del self.options.fPIC del self.options.shared + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def package_id(self): + if self.options.header_only: + self.info.clear() + def validate(self): if self.options.get_safe("shared") and self.options.wchar_mode: # The app crashes with error "The procedure entry point ... could not be located in the dynamic link library" raise ConanInvalidConfiguration("Combination of 'shared' and 'wchar_mode' options is not supported") - def package_id(self): - if self.options.header_only: - self.info.header_only() - 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTS"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + if not self.options.header_only: + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + # For msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() def build(self): if not self.options.header_only: - header_file = os.path.join(self._source_subfolder, "src", "pugiconfig.hpp") + header_file = os.path.join(self.source_folder, "src", "pugiconfig.hpp") # For the library build mode, options applied via change the configuration file if self.options.wchar_mode: - tools.replace_in_file(header_file, "// #define PUGIXML_WCHAR_MODE", '''#define PUGIXML_WCHAR_MODE''') + replace_in_file(self, header_file, "// #define PUGIXML_WCHAR_MODE", "#define PUGIXML_WCHAR_MODE") if self.options.no_exceptions: - tools.replace_in_file(header_file, "// #define PUGIXML_NO_EXCEPTIONS", '''#define PUGIXML_NO_EXCEPTIONS''') - cmake = self._configure_cmake() + replace_in_file(self, header_file, "// #define PUGIXML_NO_EXCEPTIONS", "#define PUGIXML_NO_EXCEPTIONS") + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - readme_contents = tools.load(os.path.join(self._source_subfolder, "readme.txt")) + readme_contents = load(self, os.path.join(self.source_folder, "readme.txt")) license_contents = readme_contents[readme_contents.find("This library is"):] - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) if self.options.header_only: - source_dir = os.path.join(self._source_subfolder, "src") - self.copy(pattern="*", dst="include", src=source_dir) + source_dir = os.path.join(self.source_folder, "src") + copy(self, "*", src=source_dir, dst=os.path.join(self.package_folder, "include")) else: - cmake = self._configure_cmake() + 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")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "pugixml") + self.cpp_info.set_property("cmake_target_name", "pugixml::pugixml") + self.cpp_info.set_property("pkg_config_name", "pugixml") + self.cpp_info.resdirs = [] if self.options.header_only: # For the "header_only" mode, options applied via global definitions self.cpp_info.defines.append("PUGIXML_HEADER_ONLY") @@ -104,5 +110,11 @@ def package_info(self): self.cpp_info.defines.append("PUGIXML_WCHAR_MODE") if self.options.no_exceptions: self.cpp_info.defines.append("PUGIXML_NO_EXCEPTIONS") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] else: - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.set_property( + "cmake_target_aliases", + ["pugixml::shared"] if self.options.shared else ["pugixml::static"], + ) + self.cpp_info.libs = collect_libs(self) diff --git a/recipes/pugixml/all/test_package/CMakeLists.txt b/recipes/pugixml/all/test_package/CMakeLists.txt index e692ba57d06c2..793d1941f61be 100644 --- a/recipes/pugixml/all/test_package/CMakeLists.txt +++ b/recipes/pugixml/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(pugixml CONFIG REQUIRED) +find_package(pugixml REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} pugixml::pugixml) +target_link_libraries(${PROJECT_NAME} PRIVATE pugixml::pugixml) diff --git a/recipes/pugixml/all/test_package/conanfile.py b/recipes/pugixml/all/test_package/conanfile.py index 49a3a66ea5bad..0a6bc68712d90 100644 --- a/recipes/pugixml/all/test_package/conanfile.py +++ b/recipes/pugixml/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pugixml/all/test_v1_package/CMakeLists.txt b/recipes/pugixml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4099ebfb2c5c9 --- /dev/null +++ b/recipes/pugixml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pugixml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pugixml::pugixml) diff --git a/recipes/pugixml/all/test_v1_package/conanfile.py b/recipes/pugixml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pugixml/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From d0f8c28b8661697cbb9d6abb82a882747a9be6b6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Sep 2022 15:44:59 +0200 Subject: [PATCH 131/561] (#13033) sdf: conan v2 support --- recipes/sdf/all/conanfile.py | 39 +++++++++++-------- recipes/sdf/all/test_package/CMakeLists.txt | 8 ++-- recipes/sdf/all/test_package/conanfile.py | 21 ++++++---- .../sdf/all/test_v1_package/CMakeLists.txt | 11 ++++++ recipes/sdf/all/test_v1_package/conanfile.py | 21 ++++++++++ 5 files changed, 73 insertions(+), 27 deletions(-) create mode 100644 recipes/sdf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sdf/all/test_v1_package/conanfile.py diff --git a/recipes/sdf/all/conanfile.py b/recipes/sdf/all/conanfile.py index 96b6a01437b37..2e95da6861e3d 100644 --- a/recipes/sdf/all/conanfile.py +++ b/recipes/sdf/all/conanfile.py @@ -1,6 +1,9 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -import glob -from conans import ConanFile, tools + +required_conan_version = ">=1.50.0" class SdfConan(ConanFile): @@ -9,26 +12,30 @@ class SdfConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/memononen/SDF" - topics = ("conan", "sdf", "signed", "distance", "field", "contour") - settings = "os" + topics = ("sdf", "signed", "distance", "field", "contour") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "source_subfolder") + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob('SDF-*/')[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - def package(self): - self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") - self.copy("*.h", src=os.path.join(self._source_subfolder, "src"), dst="include") + def build(self): + pass - def package_id(self): - self.info.header_only() + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) def package_info(self): - if self.settings.os == "Linux": + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] diff --git a/recipes/sdf/all/test_package/CMakeLists.txt b/recipes/sdf/all/test_package/CMakeLists.txt index 34af13462f44f..afcf11bbd8776 100644 --- a/recipes/sdf/all/test_package/CMakeLists.txt +++ b/recipes/sdf/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(sdf REQUIRED CONFIG) +find_package(stb REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf stb::stb) diff --git a/recipes/sdf/all/test_package/conanfile.py b/recipes/sdf/all/test_package/conanfile.py index f0f5021b597ee..ad5b8f9465ed6 100644 --- a/recipes/sdf/all/test_package/conanfile.py +++ b/recipes/sdf/all/test_package/conanfile.py @@ -1,13 +1,20 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) def requirements(self): - self.requires("stb/20200203") + self.requires(self.tested_reference_str) + self.requires("stb/cci.20210910") def build(self): cmake = CMake(self) @@ -15,7 +22,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") img_path = os.path.join(self.source_folder, "test.png") - self.run("{0} {1}".format(bin_path, img_path), run_environment=True) + self.run(f"{bin_path} {img_path}", env="conanrun") diff --git a/recipes/sdf/all/test_v1_package/CMakeLists.txt b/recipes/sdf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ee4e3e06a56c5 --- /dev/null +++ b/recipes/sdf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sdf REQUIRED CONFIG) +find_package(stb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf stb::stb) diff --git a/recipes/sdf/all/test_v1_package/conanfile.py b/recipes/sdf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..855f0ca3462a1 --- /dev/null +++ b/recipes/sdf/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def requirements(self): + self.requires("stb/cci.20210910") + + 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") + img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.png") + self.run(f"{bin_path} {img_path}", run_environment=True) From 0a611abe1bc67abef25a7f1aabd09909402af77d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Sep 2022 16:04:52 +0200 Subject: [PATCH 132/561] (#13034) sml: add 1.1.6 + conan v2 support * conan v2 support * explicit cmake names upstream export target since https://github.com/boost-ext/sml/pull/516 * add sml/1.1.6 --- recipes/sml/all/conandata.yml | 12 ++-- recipes/sml/all/conanfile.py | 66 +++++++++++-------- recipes/sml/all/test_package/CMakeLists.txt | 11 ++-- recipes/sml/all/test_package/conanfile.py | 22 +++++-- .../sml/all/test_v1_package/CMakeLists.txt | 11 ++++ recipes/sml/all/test_v1_package/conanfile.py | 17 +++++ recipes/sml/config.yml | 2 + 7 files changed, 98 insertions(+), 43 deletions(-) create mode 100644 recipes/sml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sml/all/test_v1_package/conanfile.py diff --git a/recipes/sml/all/conandata.yml b/recipes/sml/all/conandata.yml index 422f62dead663..cfb630a1d7b27 100644 --- a/recipes/sml/all/conandata.yml +++ b/recipes/sml/all/conandata.yml @@ -1,11 +1,13 @@ sources: + "1.1.6": + url: "https://github.com/boost-ext/sml/archive/refs/tags/v1.1.6.tar.gz" + sha256: "08a6d80eb9aa6ee4e462c1b802b9d7db8a39758746565f13cc4d2459ed49a29e" "1.1.5": - url: https://github.com/boost-ext/sml/archive/v1.1.5.tar.gz - sha256: b8106a28a275a9be7aa6ae49eb58396cc1b4e3c20afb472be8801af556e59cba + url: "https://github.com/boost-ext/sml/archive/v1.1.5.tar.gz" + sha256: "b8106a28a275a9be7aa6ae49eb58396cc1b4e3c20afb472be8801af556e59cba" "1.1.4": - url: https://github.com/boost-ext/sml/archive/v1.1.4.tar.gz - sha256: 897c78077f5a4d22b0de253b8689a8ea6d8adfba8d7b4877d6f5c76277e00976 + url: "https://github.com/boost-ext/sml/archive/v1.1.4.tar.gz" + sha256: "897c78077f5a4d22b0de253b8689a8ea6d8adfba8d7b4877d6f5c76277e00976" patches: "1.1.4": - patch_file: "patches/0001-fix-clang12-error.patch" - base_path: "source_subfolder" diff --git a/recipes/sml/all/conanfile.py b/recipes/sml/all/conanfile.py index 4d900fb0aa739..ba7c5897722f0 100644 --- a/recipes/sml/all/conanfile.py +++ b/recipes/sml/all/conanfile.py @@ -1,7 +1,13 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +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, copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os +required_conan_version = ">=1.50.0" + class SMLConan(ConanFile): name = "sml" @@ -10,47 +16,55 @@ class SMLConan(ConanFile): topics = ("state-machine", "metaprogramming", "design-patterns", "sml") license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" - settings = "compiler" - exports_sources = "patches/*" + settings = "os", "arch", "compiler", "build_type" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "14" @property def _minimum_compilers_version(self): return { "Visual Studio": "15", + "msvc": "191", "gcc": "5", "clang": "5", "apple-clang": "5.1", } - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "14") - minimum_version = self._minimum_compilers_version.get( - str(self.settings.compiler), False) - if not minimum_version: - self.output.warn( - "SML requires C++14. Your compiler is unknown. Assuming it supports C++14.") - elif tools.Version(self.settings.compiler.version) < minimum_version: + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "14") + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - "SML requires C++14, which your compiler does not support.") + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # tools.patch(patch_file="patches/0001-fix-clang12-error.patch") + apply_conandata_patches(self) def package(self): - self.copy(pattern="*", dst="include", - src=os.path.join(self._source_subfolder, "include")) - self.copy("*LICENSE.md", dst="licenses", keep_path=False) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "sml") + self.cpp_info.set_property("cmake_target_name", "sml::sml") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/sml/all/test_package/CMakeLists.txt b/recipes/sml/all/test_package/CMakeLists.txt index 8c0f24c3fa7f3..ab67ff60b5680 100644 --- a/recipes/sml/all/test_package/CMakeLists.txt +++ b/recipes/sml/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.5) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(sml REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::sml) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) +target_link_libraries(${PROJECT_NAME} PRIVATE sml::sml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sml/all/test_package/conanfile.py b/recipes/sml/all/test_package/conanfile.py index b06dd6800dcf0..0a6bc68712d90 100644 --- a/recipes/sml/all/test_package/conanfile.py +++ b/recipes/sml/all/test_package/conanfile.py @@ -1,16 +1,26 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sml/all/test_v1_package/CMakeLists.txt b/recipes/sml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2ecfffc8e29bc --- /dev/null +++ b/recipes/sml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sml::sml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sml/all/test_v1_package/conanfile.py b/recipes/sml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sml/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/sml/config.yml b/recipes/sml/config.yml index 953d7e8cb96d8..fa8612a6d0ffa 100644 --- a/recipes/sml/config.yml +++ b/recipes/sml/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.6": + folder: all "1.1.5": folder: all "1.1.4": From a5ec65b4793984ec5dd92c52cf253c2a20c7a5ba Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Sep 2022 16:25:21 +0200 Subject: [PATCH 133/561] (#13035) span-lite: conan v2 support --- recipes/span-lite/all/conanfile.py | 30 ++++++++++++------- .../span-lite/all/test_package/CMakeLists.txt | 7 ++--- .../span-lite/all/test_package/conanfile.py | 19 ++++++++---- .../all/test_v1_package/CMakeLists.txt | 10 +++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++++ 5 files changed, 63 insertions(+), 20 deletions(-) create mode 100644 recipes/span-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/span-lite/all/test_v1_package/conanfile.py diff --git a/recipes/span-lite/all/conanfile.py b/recipes/span-lite/all/conanfile.py index 13ce9fedf5fa1..a3cdfec98fc6a 100644 --- a/recipes/span-lite/all/conanfile.py +++ b/recipes/span-lite/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class SpanLiteConan(ConanFile): @@ -14,24 +16,29 @@ class SpanLiteConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "span-lite") self.cpp_info.set_property("cmake_target_name", "nonstd::span-lite") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "span-lite" @@ -41,3 +48,6 @@ def package_info(self): self.cpp_info.components["spanlite"].names["cmake_find_package"] = "span-lite" self.cpp_info.components["spanlite"].names["cmake_find_package_multi"] = "span-lite" self.cpp_info.components["spanlite"].set_property("cmake_target_name", "nonstd::span-lite") + self.cpp_info.components["spanlite"].bindirs = [] + self.cpp_info.components["spanlite"].libdirs = [] + self.cpp_info.components["spanlite"].resdirs = [] diff --git a/recipes/span-lite/all/test_package/CMakeLists.txt b/recipes/span-lite/all/test_package/CMakeLists.txt index 011059b1a567b..d8392ded7dfb5 100644 --- a/recipes/span-lite/all/test_package/CMakeLists.txt +++ b/recipes/span-lite/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(span-lite REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} nonstd::span-lite) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::span-lite) diff --git a/recipes/span-lite/all/test_package/conanfile.py b/recipes/span-lite/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/span-lite/all/test_package/conanfile.py +++ b/recipes/span-lite/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/span-lite/all/test_v1_package/CMakeLists.txt b/recipes/span-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b91df846606c0 --- /dev/null +++ b/recipes/span-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(span-lite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::span-lite) diff --git a/recipes/span-lite/all/test_v1_package/conanfile.py b/recipes/span-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/span-lite/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From dc75a1023d691d56e4bcf86f5bacb0700143fbd8 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Sep 2022 23:44:43 +0900 Subject: [PATCH 134/561] (#13054) cpp-peglib: add version 1.8.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/cpp-peglib/1.x.x/conandata.yml | 3 +++ recipes/cpp-peglib/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cpp-peglib/1.x.x/conandata.yml b/recipes/cpp-peglib/1.x.x/conandata.yml index 10e024d656124..08e29671dff3e 100644 --- a/recipes/cpp-peglib/1.x.x/conandata.yml +++ b/recipes/cpp-peglib/1.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.2": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.2.tar.gz" + sha256: "eca5d06dafb940ffee8a99060a57272ada7f2486fc21ed1663e4e49851a70e0c" "1.8.1": url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.1.tar.gz" sha256: "15d7c39d01780bb6f27db511722936d82d04cb1f5a6c63025021ff5dfe5fe1b2" diff --git a/recipes/cpp-peglib/config.yml b/recipes/cpp-peglib/config.yml index 9d1386b25f649..0c3a84819eed8 100644 --- a/recipes/cpp-peglib/config.yml +++ b/recipes/cpp-peglib/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.2": + folder: "1.x.x" "1.8.1": folder: "1.x.x" "1.8.0": From 3c7c67edb7a3570dde5cda326f1eeb926bb85686 Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Wed, 21 Sep 2022 12:04:43 -0300 Subject: [PATCH 135/561] (#13055) add expat version 2.4.9 --- recipes/expat/all/conandata.yml | 3 +++ recipes/expat/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/expat/all/conandata.yml b/recipes/expat/all/conandata.yml index 492b377cb1c27..34f5618ac04c1 100644 --- a/recipes/expat/all/conandata.yml +++ b/recipes/expat/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.9": + sha256: "6e8c0728fe5c7cd3f93a6acce43046c5e4736c7b4b68e032e9350daa0efc0354" + url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_9/expat-2.4.9.tar.xz" "2.4.8": sha256: "f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25" url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.xz" diff --git a/recipes/expat/config.yml b/recipes/expat/config.yml index 5659be52c682e..61afa75ec5ca5 100644 --- a/recipes/expat/config.yml +++ b/recipes/expat/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.9": + folder: all "2.4.8": folder: all "2.4.7": From e0f3a9a81bf29c984f3abf0affa8f81963066fe7 Mon Sep 17 00:00:00 2001 From: Christian Kahr <33638852+dotChris90@users.noreply.github.com> Date: Wed, 21 Sep 2022 18:25:07 +0200 Subject: [PATCH 136/561] (#12893) Add cyclone dds * build works * enable static build and removed bison * enable testing * correcting according conan-center hooks * correct for conan v2 * style change according to pylint * using conan module instead of conans * using sub modules of tools * corrected accoridng pylint (f string error) * correction also done for test_package * adapted for cyclonedds instead of cyclone-dds * let it work for 0.10.2 * removing "MS RUNTIME Files" because conan center build said * wrong pattern * make sure default is minimal working package without dependencies * make sure windows removing right dll's * adding pthread as dependency * added cmake 3.16 * define tool_requires at beginning * followed github suggestions for tools_requires * first try just for linux and mac * try out new cmake classes * done changes according to github PR * stupid copy paste mistake * changed component name and forgot some * make ready for conan V2 * removed self.copy and better error message * restructure tests for v1 and v2 * removed unused variables * try if for windows works --- recipes/cyclonedds/all/conandata.yml | 9 + recipes/cyclonedds/all/conanfile.py | 179 ++++++++++++++++++ .../0.10.2-0001-fix-find-iceoryx.patch | 15 ++ .../all/test_package/CMakeLists.txt | 8 + .../cyclonedds/all/test_package/conanfile.py | 25 +++ .../all/test_package/test_package.cpp | 21 ++ .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 ++ recipes/cyclonedds/config.yml | 3 + 9 files changed, 288 insertions(+) create mode 100644 recipes/cyclonedds/all/conandata.yml create mode 100644 recipes/cyclonedds/all/conanfile.py create mode 100644 recipes/cyclonedds/all/patches/0.10.2-0001-fix-find-iceoryx.patch create mode 100644 recipes/cyclonedds/all/test_package/CMakeLists.txt create mode 100644 recipes/cyclonedds/all/test_package/conanfile.py create mode 100644 recipes/cyclonedds/all/test_package/test_package.cpp create mode 100644 recipes/cyclonedds/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cyclonedds/all/test_v1_package/conanfile.py create mode 100644 recipes/cyclonedds/config.yml diff --git a/recipes/cyclonedds/all/conandata.yml b/recipes/cyclonedds/all/conandata.yml new file mode 100644 index 0000000000000..3842a2285af2b --- /dev/null +++ b/recipes/cyclonedds/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.10.2": + url: "https://github.com/eclipse-cyclonedds/cyclonedds/archive/refs/tags/0.10.2.tar.gz" + sha256: "BC84E137E0C8A055B8CD97FBEAFEC94E36DE1B0C2E88800896A82384FD867AE5" +patches: + "0.10.2": + - patch_file: "patches/0.10.2-0001-fix-find-iceoryx.patch" + patch_description: "Fix cmake find for iceoryx package" + patch_type: "conan" diff --git a/recipes/cyclonedds/all/conanfile.py b/recipes/cyclonedds/all/conanfile.py new file mode 100644 index 0000000000000..039c8d5f7e45d --- /dev/null +++ b/recipes/cyclonedds/all/conanfile.py @@ -0,0 +1,179 @@ +import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools import files, build, scm +from conan.tools.microsoft import is_msvc +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout + +required_conan_version = ">=1.51.3" + +class CycloneDDSConan(ConanFile): + name = "cyclonedds" + license = "EPL-2.0" + homepage = "https://cyclonedds.io/" + url = "https://github.com/conan-io/conan-center-index" + description = "Eclipse Cyclone DDS - An implementation"\ + " of the OMG Data Distribution Service (DDS) specification" + topics = ("dds", "ipc", "ros", "middleware") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + "with_shm" : [True, False], + "enable_security" : [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": False, + "with_shm": False, + "enable_security": False + } + + short_paths = True + + @property + def _bin_package_folder(self): + return os.path.join(self.package_folder,"bin") + + @property + def _tmp_folder(self): + return os.path.join(self.package_folder,"tmp") + + @property + def _license_folder(self): + return os.path.join(self.package_folder,"licenses") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "16.0", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + files.copy(self,patch["patch_file"],self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def requirements(self): + if self.options.with_shm: + self.requires("iceoryx/2.0.0") + if self.options.with_ssl: + self.requires("openssl/1.1.1q") + + def build_requirements(self): + self.tool_requires("cmake/3.21.7") + + def validate(self): + if self.options.enable_security and not self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} currently do not support"\ + "static build and security on") + if self.info.settings.compiler.cppstd: + build.check_min_cppstd(self, 14) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and scm.Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} is just tested with minimal version "\ + f"{minimum_version} of compiler {self.info.settings.compiler}.") + + def source(self): + files.get(self,**self.conan_data["sources"][self.version], strip_root=True, + destination=self.source_folder) + + def layout(self): + cmake_layout(self,src_folder="src") + + def generate(self): + + tc = CMakeToolchain(self) + # TODO : determine how to do in conan : + # - idlc is a code generator that is used as tool (and so not cross compiled) + # - other tools like ddsperf is cross compiled for target + # - maybe separate package like cyclonedds_idlc + tc.variables["BUILD_IDLC"] = False + tc.variables["BUILD_IDLC_TESTING"] = False + tc.variables["BUILD_DDSPERF"] = False + tc.variables["BUILD_IDLC_TESTING"] = False + # variables which effects build + tc.variables["ENABLE_SSL"] = self.options.with_ssl + tc.variables["ENABLE_SHM"] = self.options.with_shm + tc.variables["ENABLE_SECURITY"] = self.options.enable_security + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + def build(self): + files.apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + files.copy(self, "LICENSE", self.source_folder, self._license_folder) + files.rmdir(self, os.path.join(self.package_folder, "share")) + files.rmdir(self, os.path.join(self.package_folder, "lib","pkgconfig")) + files.rmdir(self, os.path.join(self.package_folder, "lib","cmake")) + + # cyclonedds copies multiple windows dlls to bin folder + # these must be removed and just keep ddsc.dll + if self.settings.os == "Windows": + if self.options.shared: + files.mkdir(self, self._tmp_folder) + files.copy(self, "ddsc.dll", self._bin_package_folder, self._tmp_folder) + files.rmdir(self, self._bin_package_folder) + if self.options.shared: + files.mkdir(self,self._bin_package_folder) + files.copy(self,"ddsc.dll",self._tmp_folder,self._bin_package_folder) + files.rmdir(self, self._tmp_folder) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cyclonedds") + self.cpp_info.filenames["cmake_find_package"] = "cyclonedds" + self.cpp_info.filenames["cmake_find_package_multi"] = "cyclonedds" + self.cpp_info.names["cmake_find_package"] = "CycloneDDS" + self.cpp_info.names["cmake_find_package_multi"] = "CycloneDDS" + self.cpp_info.components["CycloneDDS"].names["cmake_find_package"] = "ddsc" + self.cpp_info.components["CycloneDDS"].names["cmake_find_package_multi"] = "ddsc" + self.cpp_info.components["CycloneDDS"].libs = ["ddsc"] + self.cpp_info.components["CycloneDDS"].set_property("cmake_target_name", + "CycloneDDS::ddsc") + requires = [] + if self.options.with_shm: + requires.append("iceoryx::iceoryx_binding_c") + if self.options.with_ssl: + requires.append("openssl::openssl") + self.cpp_info.components["CycloneDDS"].requires = requires + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["CycloneDDS"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["CycloneDDS"].system_libs = [ + "Ws2_32", + "Dbghelp", + "Bcrypt", + "Iphlpapi" + ] diff --git a/recipes/cyclonedds/all/patches/0.10.2-0001-fix-find-iceoryx.patch b/recipes/cyclonedds/all/patches/0.10.2-0001-fix-find-iceoryx.patch new file mode 100644 index 0000000000000..228ee7dba0b01 --- /dev/null +++ b/recipes/cyclonedds/all/patches/0.10.2-0001-fix-find-iceoryx.patch @@ -0,0 +1,15 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index fa08094a..516806dd 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -55,8 +55,8 @@ if(ENABLE_SHM) + else() + set(iceoryx_required QUIET) + endif() +- find_package(iceoryx_binding_c ${iceoryx_required}) +- set(ENABLE_SHM ${iceoryx_binding_c_FOUND} CACHE STRING "" FORCE) ++ find_package(iceoryx ${iceoryx_required}) ++ set(ENABLE_SHM ${iceoryx_FOUND} CACHE STRING "" FORCE) + if(ENABLE_SHM AND APPLE) + get_filename_component(iceoryx_libdir "${ICEORYX_LIB}" DIRECTORY) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${iceoryx_libdir}") diff --git a/recipes/cyclonedds/all/test_package/CMakeLists.txt b/recipes/cyclonedds/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9653148f924fa --- /dev/null +++ b/recipes/cyclonedds/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(cyclonedds REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE CycloneDDS::ddsc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cyclonedds/all/test_package/conanfile.py b/recipes/cyclonedds/all/test_package/conanfile.py new file mode 100644 index 0000000000000..422a7d5c03da2 --- /dev/null +++ b/recipes/cyclonedds/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + +class CycloneDDSTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cyclonedds/all/test_package/test_package.cpp b/recipes/cyclonedds/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9966d58481774 --- /dev/null +++ b/recipes/cyclonedds/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ + +#include +#include +#include +#include +#include +#include + +#include "dds/dds.h" + +int main() { + dds_entity_t participant; + dds_entity_t topic; + + /* Create a Participant. */ + participant = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); + if (participant < 0) + DDS_FATAL("dds_create_participant: %s\n", dds_strretcode(-participant)); + + return EXIT_SUCCESS; +} diff --git a/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt b/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..aa258f41398f0 --- /dev/null +++ b/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cyclonedds CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE CycloneDDS::ddsc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cyclonedds/all/test_v1_package/conanfile.py b/recipes/cyclonedds/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..f7bf754d5a675 --- /dev/null +++ b/recipes/cyclonedds/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake +from conan.tools import build + +class CycloneDDSTestConan(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 build.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cyclonedds/config.yml b/recipes/cyclonedds/config.yml new file mode 100644 index 0000000000000..6c8041d964ef5 --- /dev/null +++ b/recipes/cyclonedds/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.2": + folder: all From c0efe2ab8fe29804f0f4d2fb515061c6b814252a Mon Sep 17 00:00:00 2001 From: Gajendra <9218964+ggulgulia@users.noreply.github.com> Date: Thu, 22 Sep 2022 07:43:53 +0200 Subject: [PATCH 137/561] (#12613) fix: gfortran linux build * fix: linux source download link in conandata.yml * fix: specify version 10.2.0 and conandata.yml format * revert version id * chore: revert stringifying url and sha256 * apply double quotes to values in conadata.yml * restructure conandata.yml * fix: conan v2 changes * incorporate conan v2 changes in recipe * remove filename entry from recipe * fix package_info, remove include dir * revert bazel recipe * revert bazel recipe * revert source method * use get method suited for conandata.yml * hardcode architecture key * fix destination folder Co-authored-by: Chris Mc * update conan version, remove unused imports * allowing short paths for windows/apple-clang build * fix recipe syntax l46 * fix extract_license method * fix extract_license method for Macos builds * fix source folder name for different os * debug macos source folder dirs * debug macos source folder dirs * debug macos source folder dirs * debug print macos source folder dirs * correct macos licence source folder * clean up recipe * add comment to retrigger windows build * build by moving download to build method to fix the build for windows * fix licence folder path * gfortran: conan v2 + fix paths with new file tools * build method only for windows * revert commit to resolve conflicts Co-authored-by: Chris Mc --- recipes/gfortran/all/conandata.yml | 23 +++--- recipes/gfortran/all/conanfile.py | 79 +++++++++++-------- .../gfortran/all/test_package/conanfile.py | 12 ++- .../gfortran/all/test_v1_package/conanfile.py | 8 ++ 4 files changed, 75 insertions(+), 47 deletions(-) create mode 100644 recipes/gfortran/all/test_v1_package/conanfile.py diff --git a/recipes/gfortran/all/conandata.yml b/recipes/gfortran/all/conandata.yml index 9585b50f82122..7baa9c9b5ccf6 100644 --- a/recipes/gfortran/all/conandata.yml +++ b/recipes/gfortran/all/conandata.yml @@ -1,13 +1,14 @@ sources: "10.2": - "url": - "Windows": - url: https://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/ray_linn/GCC-10.X-with-ada/GCC-10.2.0-crt-8.0.0-with-ada-20201019.7z - filename: GCC-10.2.0-crt-8.0.0-with-ada-20201019.7z - sha256: 5c3fc254494bc24eb201870f4b781d401cf7279bd03ea1aba6f2ffae771ded44 - "Linux": - url: https://gfortran.meteodat.ch/download/x86_64/snapshots/gcc-10-20210109.tar.xz - sha256: 494e9d881d6d9bb4a5707bfa149f77001599f093090c6c78fdb19cefbacda7b8 - "Macos": - url: https://downloads.sourceforge.net/project/hpc/hpc/g95/gfortran-10.2-bin.tar.gz - sha256: 2de46f571eefc2b544db4ed6c958c78a5e3e78c4b4b5daab38aabc1b08dd5666 + "Windows": + "x86_64": + url: "https://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/ray_linn/GCC-10.X-with-ada/GCC-10.2.0-crt-8.0.0-with-ada-20201019.7z" + sha256: "5c3fc254494bc24eb201870f4b781d401cf7279bd03ea1aba6f2ffae771ded44" + "Linux": + "x86_64": + url: "https://gfortran.meteodat.ch/download/x86_64/releases/gcc-10.2.0.tar.xz" + sha256: "5cfaf152db442bb967963ca62d4590980cb2664c5902c1a9578fc8a9c6efe40f" + "Macos": + "x86_64": + url: "https://downloads.sourceforge.net/project/hpc/hpc/g95/gfortran-10.2-bin.tar.gz" + sha256: "2de46f571eefc2b544db4ed6c958c78a5e3e78c4b4b5daab38aabc1b08dd5666" diff --git a/recipes/gfortran/all/conanfile.py b/recipes/gfortran/all/conanfile.py index 43279cdb234c8..209997c47d1fa 100644 --- a/recipes/gfortran/all/conanfile.py +++ b/recipes/gfortran/all/conanfile.py @@ -1,11 +1,9 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, load, save, download import os -import glob - - -required_conan_version = ">=1.32.0" +required_conan_version = ">=1.46.0" class GFortranConan(ConanFile): name = "gfortran" @@ -14,12 +12,9 @@ class GFortranConan(ConanFile): homepage = "https://gcc.gnu.org/fortran" topics = ("gnu", "gcc", "fortran", "compiler") license = "GPL-3.0-or-later" - settings = "os", "arch" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - - @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "source_subfolder_{}".format(str(self.settings.os))) + short_paths = True def validate(self): if self.settings.arch != "x86_64": @@ -29,38 +24,56 @@ def validate(self): def build_requirements(self): if self.settings.os == "Windows": - self.build_requires("7zip/19.00") + self.tool_requires("7zip/19.00") + + def build(self): + if self.settings.os == "Windows": + filename = os.path.join(self.build_folder, "GCC-10.2.0-crt-8.0.0-with-ada-20201019.7z") + download(self, **self.conan_data["sources"][self.version][str(self.settings.os)]["x86_64"], filename=filename) + self.run(f"7z x {filename}") + else: + get(self, **self.conan_data["sources"][self.version][str(self.settings.os)]["x86_64"], + destination=self.build_folder, strip_root=True) - def source(self): - url = self.conan_data["sources"][self.version]["url"] - for it in url.keys(): - if self.settings.os == "Windows" and it == "Windows": - filename = url[it]["filename"] - tools.download(**url[it]) - self.run("7z x {0}".format(filename)) - os.unlink(filename) - os.rename("mingw64", "source_subfolder_Windows") - elif it != "Windows": - tools.get(**url[it]) - pattern = "gcc-*" if it == "Linux" else "usr" - os.rename(glob.glob(pattern)[0], "source_subfolder_{}".format(it)) + @property + def _archive_contents_path(self): + if self.settings.os == "Macos": + return os.path.join(self.build_folder, "local") + elif self.settings.os == "Windows": + return os.path.join(self.build_folder, "mingw64") + else: + return os.path.join(self.build_folder) + + @property + def _license_path(self): + return os.path.join(self._archive_contents_path, "share", "info") + + @property + def _library_source_path(self): + return os.path.join(self._archive_contents_path, { + "Linux": "lib64", + "Macos": "lib", + "Windows": os.path.join("lib", "gcc", "x86_64-w64-mingw32", "10.2.0") + }[str(self.settings.os)]) def _extract_license(self): - info = tools.load(os.path.join(self.source_folder, "source_subfolder_Linux", "share", "info", "gfortran.info")) + info = load(self, os.path.join(self._license_path, "gfortran.info")) license_contents = info[info.find("Version 3"):info.find("END OF TERMS", 1)] - tools.save("LICENSE", license_contents) + save(self, os.path.join(self.build_folder, "LICENSE"), license_contents) + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type # The binaries are not specific def package(self): self._extract_license() - self.copy("LICENSE", dst="licenses") - self.copy("gfortran*", dst="bin", src=os.path.join(self._source_subfolder, "bin")) - self.copy("gfortran", dst="bin", src=os.path.join(self._source_subfolder, "local", "bin")) - self.copy("libgfortran.a", dst="lib", src=os.path.join(self._source_subfolder, "lib64")) - self.copy("libgfortran.a", dst="lib", src=os.path.join(self._source_subfolder, "local", "lib")) - self.copy("libgfortran.a", dst="lib", src=os.path.join(self._source_subfolder, "lib", "gcc", "x86_64-w64-mingw32", "10.2.0")) + copy(self, "LICENSE", src=self.build_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "gfortran*", src=os.path.join(self._archive_contents_path, "bin"), dst=os.path.join(self.package_folder, "bin")) + copy(self, "libgfortran.a", src=self._library_source_path, dst=os.path.join(self.package_folder, "lib")) def package_info(self): bin_path = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.cpp_info.includedirs = [] self.env_info.PATH.append(bin_path) self.cpp_info.libs = ["gfortran"] diff --git a/recipes/gfortran/all/test_package/conanfile.py b/recipes/gfortran/all/test_package/conanfile.py index c9380771129c0..9d3aaf213929b 100644 --- a/recipes/gfortran/all/test_package/conanfile.py +++ b/recipes/gfortran/all/test_package/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run 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): - if not tools.cross_building(self): - self.run("gfortran --version", run_environment=True) + if can_run(self): + self.run("gfortran --version", env="conanrun") diff --git a/recipes/gfortran/all/test_v1_package/conanfile.py b/recipes/gfortran/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c9380771129c0 --- /dev/null +++ b/recipes/gfortran/all/test_v1_package/conanfile.py @@ -0,0 +1,8 @@ +from conans import ConanFile, tools + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("gfortran --version", run_environment=True) From c557e9c30852f45477de7def520b07ab1e87cd70 Mon Sep 17 00:00:00 2001 From: GIGte <1713332+GIGte@users.noreply.github.com> Date: Thu, 22 Sep 2022 10:45:47 +0300 Subject: [PATCH 138/561] (#12889) cryptopp: fix Windows ARM build * Fix Windows ARM build * Revert "Fix Windows ARM build" This reverts commit 69b8b5dd00fe12d17a1e206b759b54df4e843ca5. * Bump CMake build requirement * Fix Windows ARM build * Add comment to patch * Update recipes/cryptopp/all/conandata.yml Co-authored-by: chausner <15180557+chausner@users.noreply.github.com> Co-authored-by: chausner <15180557+chausner@users.noreply.github.com> --- recipes/cryptopp/all/conandata.yml | 6 ++-- recipes/cryptopp/all/conanfile.py | 2 +- .../patches/0001-fix-msvc-arm64-8.7.0.patch | 35 +++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100755 recipes/cryptopp/all/patches/0001-fix-msvc-arm64-8.7.0.patch diff --git a/recipes/cryptopp/all/conandata.yml b/recipes/cryptopp/all/conandata.yml index 9aafaf5664ca7..b34682e4296a3 100644 --- a/recipes/cryptopp/all/conandata.yml +++ b/recipes/cryptopp/all/conandata.yml @@ -4,8 +4,8 @@ sources: url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_7_0.tar.gz" sha256: "8d6a4064b8e9f34cd3e838f5a12c40067ee7b95ee37d9173ec273cb0913e7ca2" cmake: - url: "https://github.com/abdes/cryptopp-cmake/archive/ff211af98505c260c1d3a36a8e36e563727b11ee.tar.gz" - sha256: "5a966e8a1af4aa39a4bc1f223562b4af97bd55385e9385b48b1f15fd0dc26b38" + url: "https://github.com/abdes/cryptopp-cmake/archive/CRYPTOPP_8_7_0.tar.gz" + sha256: "c113aba8069842edb201b4aaa2925e2c9d6ca081c4fd6b049ff74fedf6e8bae3" "8.6.0": source: url: "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_6_0.tar.gz" @@ -35,6 +35,8 @@ sources: url: "https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_2_0.tar.gz" sha256: "f41f6a32b1177c094c3ef97423916713c902d0ac26cbee30ec70b1e8ab0e6fba" patches: + "8.7.0": + - patch_file: "patches/0001-fix-msvc-arm64-8.7.0.patch" "8.6.0": - patch_file: "patches/0001-fix-cmake-8.6.0.patch" "8.2.0": diff --git a/recipes/cryptopp/all/conanfile.py b/recipes/cryptopp/all/conanfile.py index 308cf2651bcac..f4a34568ef0e2 100644 --- a/recipes/cryptopp/all/conanfile.py +++ b/recipes/cryptopp/all/conanfile.py @@ -38,7 +38,7 @@ def config_options(self): def build_requirements(self): if Version(self.version) >= "8.7.0": - self.tool_requires("cmake/3.21.0") + self.tool_requires("cmake/3.24.0") def validate(self): if self.options.shared and Version(self.version) >= "8.7.0": diff --git a/recipes/cryptopp/all/patches/0001-fix-msvc-arm64-8.7.0.patch b/recipes/cryptopp/all/patches/0001-fix-msvc-arm64-8.7.0.patch new file mode 100755 index 0000000000000..1e813c076823d --- /dev/null +++ b/recipes/cryptopp/all/patches/0001-fix-msvc-arm64-8.7.0.patch @@ -0,0 +1,35 @@ +--- a/arm_simd.h ++++ b/arm_simd.h +@@ -307,28 +307,32 @@ inline uint64x2_t PMULL_HIGH(const uint64x2_t a, const uint64x2_t b) + #endif + } + ++// This function will be removed in the next version of Crypto++: ++// https://github.com/weidai11/cryptopp/commit/31fa3384160071793bc428a32383938551b3652c ++#if !defined(_MSC_VER) || defined(_M_ARM) + /// \brief Vector extraction + /// \param a the first value + /// \param b the second value + /// \param c the byte count + /// \return vector + /// \details VEXT_U8() extracts the first c bytes of vector + /// a and the remaining bytes in b. VEXT_U8 is provided + /// as GCC inline assembly due to Clang and lack of support for the intrinsic. + /// \since Crypto++ 8.0 + inline uint64x2_t VEXT_U8(uint64x2_t a, uint64x2_t b, unsigned int c) + { + #if defined(_MSC_VER) + return vreinterpretq_u64_u8(vextq_u8( + vreinterpretq_u8_u64(a), vreinterpretq_u8_u64(b), c)); + #else + uint64x2_t r; + __asm__ ("ext %0.16b, %1.16b, %2.16b, %3 \n\t" + :"=w" (r) : "w" (a), "w" (b), "I" (c) ); + return r; + #endif + } ++#endif + + /// \brief Vector extraction + /// \tparam C the byte count + /// \param a the first value From d1b76b3d6f2031d4a2ece8023803423e9fd03abe Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 10:25:19 +0200 Subject: [PATCH 139/561] (#13052) libusb: generate gcc11 binaries --- recipes/libusb/all/conanfile.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/recipes/libusb/all/conanfile.py b/recipes/libusb/all/conanfile.py index 6ba0acedb8c61..f26622513d5b1 100644 --- a/recipes/libusb/all/conanfile.py +++ b/recipes/libusb/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, chdir, rmdir, rm, replace_in_file +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, MSBuild, tools import os import re -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.51.3" class LibUSBConan(ConanFile): @@ -33,10 +37,6 @@ def _source_subfolder(self): def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" - @property - def _is_msvc(self): - return self.settings.os == "Windows" and self.settings.compiler == "Visual Studio" - @property def _settings_build(self): return self.settings_build if hasattr(self, "settings_build") else self.settings @@ -57,7 +57,7 @@ def configure(self): del self.settings.compiler.cppstd def build_requirements(self): - if self._settings_build.os == "Windows" and not self._is_msvc and not tools.get_env("CONAN_BASH_PATH"): + if self._settings_build.os == "Windows" and not is_msvc(self) and not tools.get_env("CONAN_BASH_PATH"): self.build_requires("msys2/cci.latest") def requirements(self): @@ -66,15 +66,15 @@ def requirements(self): self.requires("libudev/system") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def _build_visual_studio(self): - with tools.chdir(self._source_subfolder): + with chdir(self, self._source_subfolder): # Assume we're using the latest Visual Studio and default to libusb_2019.sln # (or libusb_2017.sln for libusb < 1.0.24). # If we're not using the latest Visual Studio, select an appropriate solution file. - solution_msvc_year = 2019 if tools.Version(self.version) >= "1.0.24" else 2017 + solution_msvc_year = 2019 if Version(self.version) >= "1.0.24" else 2017 solution_msvc_year = { "11": 2012, @@ -110,12 +110,12 @@ def _configure_autotools(self): return self._autotools def build(self): - if self._is_msvc: - if tools.Version(self.version) < "1.0.24": + if is_msvc(self): + if Version(self.version) < "1.0.24": for vcxproj in ["fxload_2017", "getopt_2017", "hotplugtest_2017", "libusb_dll_2017", "libusb_static_2017", "listdevs_2017", "stress_2017", "testlibusb_2017", "xusb_2017"]: vcxproj_path = os.path.join(self._source_subfolder, "msvc", "%s.vcxproj" % vcxproj) - tools.replace_in_file(vcxproj_path, "10.0.16299.0", "") + replace_in_file(self, vcxproj_path, "10.0.16299.0", "") self._build_visual_studio() else: autotools = self._configure_autotools() @@ -136,13 +136,13 @@ def _package_visual_studio(self): def package(self): self.copy("COPYING", src=self._source_subfolder, dst="licenses", keep_path=False) - if self._is_msvc: + if is_msvc(self): self._package_visual_studio() else: autotools = self._configure_autotools() autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.names["pkg_config"] = "libusb-1.0" From 3f4ce2ebdf9ed24cf12b27de6358e63a30eb9a0b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 10:45:03 +0200 Subject: [PATCH 140/561] (#13051) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/faqs.md | 1 + docs/how_to_add_packages.md | 2 ++ docs/packaging_policy.md | 5 ++++- docs/reviewing.md | 1 - docs/v2_migration.md | 4 +++- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/faqs.md b/docs/faqs.md index 9ecbaef89cdd3..7179c56a26e3a 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -16,6 +16,7 @@ This section gathers the most common questions from the community related to pac * [Is the Jenkins orchestration library publicly available?](#is-the-jenkins-orchestration-library-publicly-available) * [Why not x86 binaries?](#why-not-x86-binaries) * [But if there are no packages available, what will the x86 validation look like?](#but-if-there-are-no-packages-available-what-will-the-x86-validation-look-like) + * [Do static libraries tend to be compiled as PIC by default?](#do-static-libraries-tend-to-be-compiled-as-pic-by-default) * [Why PDB files are not allowed?](#why-pdb-files-are-not-allowed) * [Why is there no option for PDB, as there is for fPIC?](#why-is-there-no-option-for-pdb-as-there-is-for-fpic) * [Can I remove an option from a recipe?](#can-i-remove-an-option-from-a-recipe) diff --git a/docs/how_to_add_packages.md b/docs/how_to_add_packages.md index 9afa6401e8cad..1fe2b11941674 100644 --- a/docs/how_to_add_packages.md +++ b/docs/how_to_add_packages.md @@ -26,7 +26,9 @@ When pull requests are merged, the CI will upload the generated packages to the * [Verifying Dependency Version](#verifying-dependency-version) * [Verifying Dependency Options](#verifying-dependency-options) * [Test the recipe locally](#test-the-recipe-locally) + * [Hooks](#hooks) * [Updating conan hooks on your machine](#updating-conan-hooks-on-your-machine) + * [Linters](#linters) * [Debugging failed builds](#debugging-failed-builds) ## Request access diff --git a/docs/packaging_policy.md b/docs/packaging_policy.md index 25757c36cc793..9c58b5482b075 100644 --- a/docs/packaging_policy.md +++ b/docs/packaging_policy.md @@ -10,7 +10,10 @@ This document gathers all the relevant information regarding the general lines t * [Build](#build) * [Package](#package) * [Settings](#settings) - * [Options](#options) + * [Options](#options) + * [Predefined Options and Known Defaults](#predefined-options-and-known-defaults) + * [Options to Avoid](#options-to-avoid) + * [Recommended feature options names](#recommended-feature-options-names) ## Sources diff --git a/docs/reviewing.md b/docs/reviewing.md index 3490fe6624b2a..bc361058481c6 100644 --- a/docs/reviewing.md +++ b/docs/reviewing.md @@ -19,7 +19,6 @@ The following policies are preferred during the review, but not mandatory: * [Test Package](#test-package) * [Minimalistic Source Code](#minimalistic-source-code) * [CMake targets](#cmake-targets) - * [Recommended feature options names](#recommended-feature-options-names) * [Supported Versions](#supported-versions) * [Removing old versions](#removing-old-versions) * [Adding old versions](#adding-old-versions) diff --git a/docs/v2_migration.md b/docs/v2_migration.md index 26e53c13df307..700c20b79ae13 100644 --- a/docs/v2_migration.md +++ b/docs/v2_migration.md @@ -7,7 +7,9 @@ Conan v2 in pull requests. ## Contents - * [Using Layout with New Generators](#using-layout-with-new-generators) + * [Using Layout](#using-layout) + * [With New Generators](#with-new-generators) + * [With Multiple Build Helpers](#with-multiple-build-helpers) * [New cpp_info set_property model](#new-cpp_info-set_property-model) * [CMakeDeps](#cmakedeps) * [Update required_conan_version to ">=1.43.0"](#update-required_conan_version-to-1430) From 7df739c4b90bfa0cbd83f4529fad29352cc8ca7f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 11:06:01 +0200 Subject: [PATCH 141/561] (#13056) md4c: add components + honor options & vc runtime * fix injection of encoding definitions at build time * add components * inject CMP0077 instead of patching upstream CMakeLists * use export_conandata_patches * honor vc runtime from profile * really honor encoding from option --- recipes/md4c/all/conandata.yml | 5 +- recipes/md4c/all/conanfile.py | 63 +++++++++++++------ ...0.4.8-0001-disable-build-shared-flag.patch | 20 ------ .../all/patches/0001-honor-vc-runtime.patch | 18 ++++++ 4 files changed, 64 insertions(+), 42 deletions(-) delete mode 100644 recipes/md4c/all/patches/0.4.8-0001-disable-build-shared-flag.patch create mode 100644 recipes/md4c/all/patches/0001-honor-vc-runtime.patch diff --git a/recipes/md4c/all/conandata.yml b/recipes/md4c/all/conandata.yml index 1d4309b8bcbf9..013088e384ddf 100644 --- a/recipes/md4c/all/conandata.yml +++ b/recipes/md4c/all/conandata.yml @@ -2,8 +2,7 @@ sources: "0.4.8": url: "https://github.com/mity/md4c/archive/refs/tags/release-0.4.8.tar.gz" sha256: "4a457df853425b6bb6e3457aa1d1a13bccec587a04c38c622b1013a0da41439f" - patches: "0.4.8": - - patch_file: "patches/0.4.8-0001-disable-build-shared-flag.patch" - patch_description: "disable setting for BUILD_SHARED_LIBS" + - patch_file: "patches/0001-honor-vc-runtime.patch" + patch_description: "Honor msvc runtime from profile" diff --git a/recipes/md4c/all/conanfile.py b/recipes/md4c/all/conanfile.py index 0bb1e2c0c17b0..4b5bb25a31a26 100644 --- a/recipes/md4c/all/conanfile.py +++ b/recipes/md4c/all/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, get, copy, rmdir from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" + class Md4cConan(ConanFile): name = "md4c" @@ -27,8 +28,7 @@ class Md4cConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -62,14 +62,28 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - if self.options.encoding == "utf-16": - tc.cache_variables["CONAN_C_FLAGS"] = "-DMD4C_USE_UTF16" + if self.options.encoding == "utf-8": + tc.preprocessor_definitions["MD4C_USE_UTF8"] = "1" + elif self.options.encoding == "utf-16": + tc.preprocessor_definitions["MD4C_USE_UTF16"] = "1" elif self.options.encoding == "ascii": - tc.cache_variables["CONAN_C_FLAGS"] = "-DMD4C_USE_ASCII" + tc.preprocessor_definitions["MD4C_USE_ASCII"] = "1" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + # Honor encoding option + replace_in_file( + self, + os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "COMPILE_FLAGS \"-DMD4C_USE_UTF8\"", + "", + ) + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -83,18 +97,29 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.libs = ["md4c", "md4c-html",] - - if self.options.encoding == "utf-16": - self.cpp_info.defines.append("MD4C_USE_UTF16") - elif self.options.encoding == "ascii": - self.cpp_info.defines.append("MD4C_USE_ASCII") - self.cpp_info.set_property("cmake_file_name", "md4c") - self.cpp_info.set_property("cmake_target_name", "md4c::md4c") - self.cpp_info.set_property("pkg_config_name", "md4c") - + self.cpp_info.components["_md4c"].set_property("cmake_target_name", "md4c::md4c") + self.cpp_info.components["_md4c"].set_property("pkg_config_name", "md4c") + self.cpp_info.components["_md4c"].libs = ["md4c"] + if self.settings.os == "Windows" and self.options.encoding == "utf-16": + self.cpp_info.components["_md4c"].defines.append("MD4C_USE_UTF16") + + self.cpp_info.components["md4c_html"].set_property("cmake_target_name", "md4c::md4c-html") + self.cpp_info.components["md4c_html"].set_property("pkg_config_name", "md4c-html") + self.cpp_info.components["md4c_html"].libs = ["md4c-html"] + self.cpp_info.components["md4c_html"].requires = ["_md4c"] + + # workaround so that global target & pkgconfig file have all components while avoiding + # to create unofficial target or pkgconfig file + self.cpp_info.set_property("cmake_target_name", "md4c::md4c-html") + self.cpp_info.set_property("pkg_config_name", "md4c-html") + + # TODO: to remove in conan v2 + self.cpp_info.components["_md4c"].names["cmake_find_package"] = "md4c" + self.cpp_info.components["_md4c"].names["cmake_find_package_multi"] = "md4c" + self.cpp_info.components["md4c_html"].names["cmake_find_package"] = "md4c-html" + self.cpp_info.components["md4c_html"].names["cmake_find_package_multi"] = "md4c-html" bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/md4c/all/patches/0.4.8-0001-disable-build-shared-flag.patch b/recipes/md4c/all/patches/0.4.8-0001-disable-build-shared-flag.patch deleted file mode 100644 index d193ef88fc969..0000000000000 --- a/recipes/md4c/all/patches/0.4.8-0001-disable-build-shared-flag.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ed62385..acdb38c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -10,6 +10,7 @@ set(MD_VERSION "${MD_VERSION_MAJOR}.${MD_VERSION_MINOR}.${MD_VERSION_RELEASE}") - set(PROJECT_VERSION "${MD_VERSION}") - set(PROJECT_URL "https://github.com/mity/md4c") - -+if(0) - if(WIN32) - # On Windows, given there is no standard lib install dir etc., we rather - # by default build static lib. -@@ -19,6 +20,7 @@ else() - # shared lib. - option(BUILD_SHARED_LIBS "help string describing option" ON) - endif() -+endif() - - add_definitions( - -DMD_VERSION_MAJOR=${MD_VERSION_MAJOR} diff --git a/recipes/md4c/all/patches/0001-honor-vc-runtime.patch b/recipes/md4c/all/patches/0001-honor-vc-runtime.patch new file mode 100644 index 0000000000000..a20b07a134764 --- /dev/null +++ b/recipes/md4c/all/patches/0001-honor-vc-runtime.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,15 +42,6 @@ elseif(MSVC) + # Disable warnings about the so-called unsecured functions: + add_definitions(/D_CRT_SECURE_NO_WARNINGS) + +- # Specify proper C runtime library: +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") +- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") +- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") + endif() + + include(GNUInstallDirs) From 19e3db66074fa25e21e1bc58a606ed70be29a413 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 13:25:38 +0200 Subject: [PATCH 142/561] (#13088) libglvnd/1.5.0 --- recipes/libglvnd/all/conandata.yml | 3 +++ recipes/libglvnd/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/libglvnd/all/conandata.yml b/recipes/libglvnd/all/conandata.yml index 77ef903a0a94d..930441157c427 100644 --- a/recipes/libglvnd/all/conandata.yml +++ b/recipes/libglvnd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.0": + url: "https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v1.5.0/libglvnd-v1.5.0.tar.gz" + sha256: "8c246d573bdaabbab32874befa79c8b92b12c05d3eb4bbefbe62afa630842793" "1.4.0": url: "https://gitlab.freedesktop.org/glvnd/libglvnd/uploads/ca5bf4295beb39bb324f692c481ac8a1/libglvnd-1.4.0.tar.gz" sha256: "c4a884503d2412dc1fa209613aa8a77193aeb7065b823fe1775dc8b6f3e45211" diff --git a/recipes/libglvnd/config.yml b/recipes/libglvnd/config.yml index eed35319fcea1..bd6887e2cfe66 100644 --- a/recipes/libglvnd/config.yml +++ b/recipes/libglvnd/config.yml @@ -1,3 +1,5 @@ versions: + "1.5.0": + folder: "all" "1.4.0": folder: "all" From 6abf40734932e09785b683528edf3af61cbd89b4 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 13:45:56 +0200 Subject: [PATCH 143/561] (#13089) freeglut/3.2.2 --- recipes/freeglut/all/conandata.yml | 3 +++ recipes/freeglut/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/freeglut/all/conandata.yml b/recipes/freeglut/all/conandata.yml index 23cb4c420e8a3..def708014ba21 100644 --- a/recipes/freeglut/all/conandata.yml +++ b/recipes/freeglut/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.2": + sha256: "c5944a082df0bba96b5756dddb1f75d0cd72ce27b5395c6c1dde85c2ff297a50" + url: "http://downloads.sourceforge.net/freeglut/freeglut/freeglut-3.2.2.tar.gz" "3.2.1": sha256: "d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68" url: "http://downloads.sourceforge.net/freeglut/freeglut/freeglut-3.2.1.tar.gz" diff --git a/recipes/freeglut/config.yml b/recipes/freeglut/config.yml index c09805f11822d..31ef026aaa09c 100644 --- a/recipes/freeglut/config.yml +++ b/recipes/freeglut/config.yml @@ -1,3 +1,5 @@ versions: + "3.2.2": + folder: all "3.2.1": folder: all From cfb78d19af599eb2b18c4a4e07b6a77e11693a6f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:07:22 +0200 Subject: [PATCH 144/561] (#13010) libyuv: conan v2 support + package version 1768 instead of cci.20201106 + add 1841 * add libyuv/1768 & drop cci.20201106 Commit 2664f649bc0a32e05f5bc3ff4d12134e41aa08c4 (called cci.20201106 in conan-center) of libyuv was an intermediate commit between libyuv 1767 & 1768. * conan v2 support * add libyuv/1841 * add comment in conandata.yml regarding versioning --- recipes/libyuv/all/CMakeLists.txt | 11 --- recipes/libyuv/all/conandata.yml | 20 +++-- recipes/libyuv/all/conanfile.py | 86 +++++++++++-------- .../all/patches/0001-fix-cmake-1768.patch | 59 +++++++++++++ .../all/patches/0001-fix-cmake-1841.patch | 62 +++++++++++++ recipes/libyuv/all/patches/001-cmake.patch | 50 ----------- .../libyuv/all/test_package/CMakeLists.txt | 12 ++- recipes/libyuv/all/test_package/conanfile.py | 21 +++-- .../libyuv/all/test_v1_package/CMakeLists.txt | 11 +++ .../libyuv/all/test_v1_package/conanfile.py | 17 ++++ recipes/libyuv/config.yml | 4 +- 11 files changed, 235 insertions(+), 118 deletions(-) delete mode 100644 recipes/libyuv/all/CMakeLists.txt create mode 100644 recipes/libyuv/all/patches/0001-fix-cmake-1768.patch create mode 100644 recipes/libyuv/all/patches/0001-fix-cmake-1841.patch delete mode 100644 recipes/libyuv/all/patches/001-cmake.patch create mode 100644 recipes/libyuv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libyuv/all/test_v1_package/conanfile.py diff --git a/recipes/libyuv/all/CMakeLists.txt b/recipes/libyuv/all/CMakeLists.txt deleted file mode 100644 index 0feb437e18418..0000000000000 --- a/recipes/libyuv/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/libyuv/all/conandata.yml b/recipes/libyuv/all/conandata.yml index 263cd3d833101..3c694384c5d83 100644 --- a/recipes/libyuv/all/conandata.yml +++ b/recipes/libyuv/all/conandata.yml @@ -1,8 +1,16 @@ +# Versions from LIBYUV_VERSION definition in include/libyuv/version.h +# Pay attention to package commits incrementing this definition sources: - "cci.20201106": - url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/2664f649bc0a32e05f5bc3ff4d12134e41aa08c4.tar.gz" - + "1841": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/f71c83552d373f0ff41833b17e2880632d8561d7.tar.gz" + "1768": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/dfaf7534e0e536f7e5ef8ddd7326797bd09b8622.tar.gz" patches: - "cci.20201106": - - patch_file: "patches/001-cmake.patch" - base_path: "source_subfolder" + "1841": + - patch_file: "patches/0001-fix-cmake-1841.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "compatibility" + "1768": + - patch_file: "patches/0001-fix-cmake-1768.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "compatibility" diff --git a/recipes/libyuv/all/conanfile.py b/recipes/libyuv/all/conanfile.py index eb9cd551985b4..b27a3c8bcb157 100644 --- a/recipes/libyuv/all/conanfile.py +++ b/recipes/libyuv/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get import os +required_conan_version = ">=1.47.0" + class LibyuvConan(ConanFile): name = "libyuv" @@ -10,21 +14,22 @@ class LibyuvConan(ConanFile): description = "libyuv is an open source project that includes YUV scaling and conversion functionality." topics = ["YUV", "libyuv", "google", "chromium"] license = "BSD-3-Clause" - settings = "os", "compiler", "arch", "build_type" - options = {"shared": [True, False], - "fPIC": [True, False], - "with_jpeg": [False, "libjpeg", "libjpeg-turbo"]} - default_options = {"shared": False, - "fPIC": True, - "with_jpeg": "libjpeg"} - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_jpeg": "libjpeg", + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -33,9 +38,9 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - if str(self.options.with_jpeg) == "libjpeg-turbo": - raise ConanInvalidConfiguration( - "libjpeg-turbo is an invalid option right now, as it is not supported by the cmake script.") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_jpeg == "libjpeg": @@ -43,31 +48,38 @@ def requirements(self): elif self.options.with_jpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.0.5") - def source(self): - tools.get(**self.conan_data["sources"] - [self.version], destination=self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def validate(self): + if self.info.options.with_jpeg == "libjpeg-turbo": + raise ConanInvalidConfiguration( + "libjpeg-turbo is an invalid option right now, as it is not supported by the cmake script.", + ) - if not self.options.with_jpeg: - self._cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_JPEG"] = True + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TEST"] = False + tc.variables["LIBYUV_WITH_JPEG"] = bool(self.options.with_jpeg) + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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() def package_info(self): self.cpp_info.libs = ["yuv"] + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.PATH.append(bin_path) diff --git a/recipes/libyuv/all/patches/0001-fix-cmake-1768.patch b/recipes/libyuv/all/patches/0001-fix-cmake-1768.patch new file mode 100644 index 0000000000000..c5cf6a86be66a --- /dev/null +++ b/recipes/libyuv/all/patches/0001-fix-cmake-1768.patch @@ -0,0 +1,59 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,8 @@ + # Originally created for "roxlu build system" to compile libyuv on windows + # Run with -DTEST=ON to build unit tests + ++CMAKE_MINIMUM_REQUIRED( VERSION 3.8 ) + PROJECT ( YUV C CXX ) # "C" is required even for C++ projects +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) + OPTION( TEST "Built unit tests" OFF ) + + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) +@@ -23,23 +23,23 @@ LIST ( SORT ly_unittest_sources ) + INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} ) + + # this creates the static library (.a) +-ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) ++ADD_LIBRARY ( ${ly_lib_static} ${ly_source_files} ) ++target_compile_features(${ly_lib_static} PUBLIC cxx_std_11) ++set_target_properties(${ly_lib_static} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # this creates the shared library (.so) +-ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) + + # this creates the conversion tool + ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) + TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) + + +-INCLUDE ( FindJPEG ) +-if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) +- add_definitions( -DHAVE_JPEG ) ++option(LIBYUV_WITH_JPEG "Build libyuv with jpeg" ON) ++if (LIBYUV_WITH_JPEG) ++ find_package(JPEG REQUIRED) ++ target_link_libraries(${ly_lib_static} JPEG::JPEG ) ++ target_compile_definitions(${ly_lib_static} PRIVATE HAVE_JPEG) ++ target_compile_definitions(yuvconvert PRIVATE HAVE_JPEG) + endif() + + if(TEST) +@@ -81,11 +81,9 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) +-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) +-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++INSTALL ( TARGETS yuvconvert DESTINATION bin) ++INSTALL ( TARGETS ${ly_lib_static} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) + + # create the .deb and .rpm packages using cpack +-INCLUDE ( CM_linux_packages.cmake ) + diff --git a/recipes/libyuv/all/patches/0001-fix-cmake-1841.patch b/recipes/libyuv/all/patches/0001-fix-cmake-1841.patch new file mode 100644 index 0000000000000..aa4506b3d1cac --- /dev/null +++ b/recipes/libyuv/all/patches/0001-fix-cmake-1841.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,8 @@ + # Originally created for "roxlu build system" to compile libyuv on windows + # Run with -DTEST=ON to build unit tests + ++CMAKE_MINIMUM_REQUIRED( VERSION 3.8 ) + PROJECT ( YUV C CXX ) # "C" is required even for C++ projects +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) + OPTION( TEST "Built unit tests" OFF ) + + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) +@@ -27,26 +27,23 @@ if(MSVC) + endif() + + # this creates the static library (.a) +-ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) ++ADD_LIBRARY ( ${ly_lib_static} ${ly_source_files} ) ++target_compile_features(${ly_lib_static} PUBLIC cxx_std_11) ++set_target_properties(${ly_lib_static} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # this creates the shared library (.so) +-ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) +-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) +-if(WIN32) +- SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) +-endif() + + # this creates the conversion tool + ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) + TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) + + +-INCLUDE ( FindJPEG ) +-if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) +- add_definitions( -DHAVE_JPEG ) ++option(LIBYUV_WITH_JPEG "Build libyuv with jpeg" ON) ++if (LIBYUV_WITH_JPEG) ++ find_package(JPEG REQUIRED) ++ target_link_libraries(${ly_lib_static} JPEG::JPEG ) ++ target_compile_definitions(${ly_lib_static} PRIVATE HAVE_JPEG) ++ target_compile_definitions(yuvconvert PRIVATE HAVE_JPEG) + endif() + + if(TEST) +@@ -82,11 +79,9 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) +-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) +-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++INSTALL ( TARGETS yuvconvert DESTINATION bin) ++INSTALL ( TARGETS ${ly_lib_static} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) + + # create the .deb and .rpm packages using cpack +-INCLUDE ( CM_linux_packages.cmake ) + diff --git a/recipes/libyuv/all/patches/001-cmake.patch b/recipes/libyuv/all/patches/001-cmake.patch deleted file mode 100644 index 592839d0d2872..0000000000000 --- a/recipes/libyuv/all/patches/001-cmake.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -23,19 +23,21 @@ - INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} ) - - # this creates the static library (.a) --ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) -+ADD_LIBRARY ( ${ly_lib_static} ${ly_source_files} ) -+set_property(TARGET ${ly_lib_static} PROPERTY CXX_STANDARD 11) -+target_link_libraries(${ly_lib_static} ${CONAN_LIBS}) - - # this creates the shared library (.so) --ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) --SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) --SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) -+#ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) -+#SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) -+#SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) - - # this creates the conversion tool - ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) - TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) - - --INCLUDE ( FindJPEG ) -+find_package(JPEG) - if (JPEG_FOUND) - include_directories( ${JPEG_INCLUDE_DIR} ) - target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) -@@ -81,11 +83,17 @@ - - - # install the conversion tool, .so, .a, and all the header files --INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) --INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) --INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) -+#INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) -+#INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) -+#INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) - INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) - -+INSTALL(TARGETS ${ly_lib_static} -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib -+) -+ - # create the .deb and .rpm packages using cpack - INCLUDE ( CM_linux_packages.cmake ) - diff --git a/recipes/libyuv/all/test_package/CMakeLists.txt b/recipes/libyuv/all/test_package/CMakeLists.txt index 9c43a46da45b0..639163e3b7c5c 100644 --- a/recipes/libyuv/all/test_package/CMakeLists.txt +++ b/recipes/libyuv/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libyuv REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) - -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE libyuv::libyuv) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libyuv/all/test_package/conanfile.py b/recipes/libyuv/all/test_package/conanfile.py index 1d0bdd3779793..0a6bc68712d90 100644 --- a/recipes/libyuv/all/test_package/conanfile.py +++ b/recipes/libyuv/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libyuv/all/test_v1_package/CMakeLists.txt b/recipes/libyuv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a044d49d31fde --- /dev/null +++ b/recipes/libyuv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libyuv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libyuv::libyuv) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libyuv/all/test_v1_package/conanfile.py b/recipes/libyuv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libyuv/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libyuv/config.yml b/recipes/libyuv/config.yml index 9e8967e0f82ea..29082e49652b8 100644 --- a/recipes/libyuv/config.yml +++ b/recipes/libyuv/config.yml @@ -1,3 +1,5 @@ versions: - "cci.20201106": + "1841": + folder: all + "1768": folder: all From ff5bcc2dbee2bed556b7e0cdd522695d056310c5 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 22 Sep 2022 21:46:12 +0900 Subject: [PATCH 145/561] (#13060) greg7mdp-gtl: add recipe * greg7mdp-gtl: add recipe * fix package name * remove unused code * update cmake_minimum_required for C++20 --- recipes/greg7mdp-gtl/all/conandata.yml | 4 + recipes/greg7mdp-gtl/all/conanfile.py | 74 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 9 +++ .../all/test_package/conanfile.py | 26 +++++++ .../all/test_package/test_package.cpp | 28 +++++++ .../all/test_v1_package/CMakeLists.txt | 12 +++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/greg7mdp-gtl/config.yml | 3 + 8 files changed, 174 insertions(+) create mode 100644 recipes/greg7mdp-gtl/all/conandata.yml create mode 100644 recipes/greg7mdp-gtl/all/conanfile.py create mode 100644 recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt create mode 100644 recipes/greg7mdp-gtl/all/test_package/conanfile.py create mode 100644 recipes/greg7mdp-gtl/all/test_package/test_package.cpp create mode 100644 recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py create mode 100644 recipes/greg7mdp-gtl/config.yml diff --git a/recipes/greg7mdp-gtl/all/conandata.yml b/recipes/greg7mdp-gtl/all/conandata.yml new file mode 100644 index 0000000000000..cf478003a76b9 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.2": + url: "https://github.com/greg7mdp/gtl/archive/refs/tags/v1.1.2.tar.gz" + sha256: "22ac9fb43608c7ddccb983096f5dadb036e5d3122d9194cdb42fee67d754c552" diff --git a/recipes/greg7mdp-gtl/all/conanfile.py b/recipes/greg7mdp-gtl/all/conanfile.py new file mode 100644 index 0000000000000..44af92f813395 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.51.3" + + +class Greg7mdpGtlConan(ConanFile): + name = "greg7mdp-gtl" + description = "Greg's Template Library of useful classes." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/greg7mdp/gtl" + topics = ("bitset", "memoize", "containers", "bitvector", "unordered-set", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "10", + "apple-clang": "10", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + self.cpp_info.set_property("cmake_file_name", "gtl") + self.cpp_info.set_property("cmake_target_name", "gtl::gtl") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "gtl" + self.cpp_info.filenames["cmake_find_package_multi"] = "gtl" + self.cpp_info.names["cmake_find_package"] = "gtl" + self.cpp_info.names["cmake_find_package_multi"] = "gtl" diff --git a/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt b/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a2b5f552d2486 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) + +find_package(gtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gtl::gtl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/greg7mdp-gtl/all/test_package/conanfile.py b/recipes/greg7mdp-gtl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/greg7mdp-gtl/all/test_package/test_package.cpp b/recipes/greg7mdp-gtl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..543ef825d77e7 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +// this code is referred from README.md of https://github.com/greg7mdp/gtl +#include +#include +#include + +using gtl::flat_hash_map; + +int main() { + // Create an unordered_map of three strings (that map to strings) + flat_hash_map email = + { + { "tom", "tom@gmail.com"}, + { "jeff", "jk@gmail.com"}, + { "jim", "jimg@microsoft.com"} + }; + + // Iterate and print keys and values + for (const auto& n : email) + std::cout << n.first << "'s email is: " << n.second << "\n"; + + // Add a new entry + email["bill"] = "bg@whatever.com"; + + // and print it + std::cout << "bill's email is: " << email["bill"] << "\n"; + + return 0; +} diff --git a/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt b/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7967c88037332 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gtl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gtl::gtl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py b/recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/greg7mdp-gtl/config.yml b/recipes/greg7mdp-gtl/config.yml new file mode 100644 index 0000000000000..8d13aefb6b4fb --- /dev/null +++ b/recipes/greg7mdp-gtl/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.2": + folder: all From 8a8e942df71a7b4fb93f5d64e06bfe9493ce85ea Mon Sep 17 00:00:00 2001 From: datalogics-saharay <39740722+datalogics-saharay@users.noreply.github.com> Date: Thu, 22 Sep 2022 08:07:03 -0500 Subject: [PATCH 146/561] (#12979) Add libpng 1.6.38 to conandata and config --- recipes/libpng/all/conandata.yml | 3 +++ recipes/libpng/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/libpng/all/conandata.yml b/recipes/libpng/all/conandata.yml index e9cde1c021d15..bee40a6b9caf2 100644 --- a/recipes/libpng/all/conandata.yml +++ b/recipes/libpng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.38": + url: "https://github.com/glennrp/libpng/archive/v1.6.38.tar.gz" + sha256: "d4160037fa5d09fa7cff555037f2a7f2fefc99ca01e21723b19bfcda33015234" "1.6.37": url: "https://github.com/glennrp/libpng/archive/v1.6.37.tar.gz" sha256: "ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307" diff --git a/recipes/libpng/config.yml b/recipes/libpng/config.yml index 958422ec0b042..22a564f5ae1cb 100644 --- a/recipes/libpng/config.yml +++ b/recipes/libpng/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.38": + folder: all "1.6.37": folder: all "1.5.30": From f51807c6e00ab556de1a0b7fbd2a901d4fd9e2b4 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 22 Sep 2022 06:26:10 -0700 Subject: [PATCH 147/561] (#13049) gtest: cleanup recipe to match upstream 1.12 latest version 1.12... There were a bunch of weird stuff that's no longer support in recent version. Some removed options were still being support oddly enough. All the old versions were updated to 2.0 so dropping them here should not cause any problems. ``` conan create all 1.12.1@ -o gtest:build_gmock=False conan create all 1.12.1@ -o gtest:build_gmock=False -o gtest:no_main=True conan create all 1.12.1@ -o gtest:shared=True ``` --- recipes/gtest/all/conandata.yml | 22 - recipes/gtest/all/conanfile.py | 120 ++--- .../all/patches/gtest-1.10.0-override.patch | 450 ------------------ recipes/gtest/all/patches/gtest-1.10.0.patch | 13 - recipes/gtest/all/patches/gtest-1.11.0.patch | 13 - recipes/gtest/all/patches/gtest-1.8.1.patch | 13 - recipes/gtest/all/test_package/CMakeLists.txt | 3 - recipes/gtest/all/test_package/conanfile.py | 11 +- recipes/gtest/all/test_package/prime_tables.h | 127 ----- .../gtest/all/test_package/test_package.cpp | 135 ------ .../gtest/all/test_v1_package/conanfile.py | 1 - recipes/gtest/config.yml | 8 - 12 files changed, 43 insertions(+), 873 deletions(-) delete mode 100644 recipes/gtest/all/patches/gtest-1.10.0-override.patch delete mode 100644 recipes/gtest/all/patches/gtest-1.10.0.patch delete mode 100644 recipes/gtest/all/patches/gtest-1.11.0.patch delete mode 100644 recipes/gtest/all/patches/gtest-1.8.1.patch delete mode 100644 recipes/gtest/all/test_package/prime_tables.h diff --git a/recipes/gtest/all/conandata.yml b/recipes/gtest/all/conandata.yml index d8536e8e3c796..4339f47aabf11 100644 --- a/recipes/gtest/all/conandata.yml +++ b/recipes/gtest/all/conandata.yml @@ -2,25 +2,3 @@ sources: "1.12.1": url: "https://github.com/google/googletest/archive/release-1.12.1.tar.gz" sha256: "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2" - "1.11.0": - url: "https://github.com/google/googletest/archive/release-1.11.0.tar.gz" - sha256: "b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5" - "cci.20210126": - url: "https://github.com/google/googletest/archive/273f8cb059a4e7b089731036392422b5ef489791.tar.gz" - sha256: "2937e96827aa44b291d42c4f0ffaa6a7637445822cf873d0fa6a889df84b8628" - "1.10.0": - url: "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" - sha256: "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb" - "1.8.1": - url: "https://github.com/google/googletest/archive/release-1.8.1.tar.gz" - sha256: "9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c" -patches: - "1.11.0": - - patch_file: "patches/gtest-1.11.0.patch" - "cci.20210126": - - patch_file: "patches/gtest-1.10.0.patch" - "1.10.0": - - patch_file: "patches/gtest-1.10.0.patch" - - patch_file: "patches/gtest-1.10.0-override.patch" - "1.8.1": - - patch_file: "patches/gtest-1.8.1.patch" diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py index 8621c6f8fe34d..69f7ada3421c8 100644 --- a/recipes/gtest/all/conanfile.py +++ b/recipes/gtest/all/conanfile.py @@ -3,10 +3,9 @@ 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, copy, get, replace_in_file, rm, rmdir +from conan.tools.files import copy, get, replace_in_file, rm, rmdir from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain -from conan.tools.microsoft import is_msvc, msvc_runtime_flag, is_msvc_static_runtime, check_min_vs -from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime required_conan_version = ">=1.50.0" @@ -21,72 +20,58 @@ class GTestConan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], - "build_gmock": [True, False], "fPIC": [True, False], + "build_gmock": [True, False], "no_main": [True, False], - "debug_postfix": ["ANY"], "hide_symbols": [True, False], + "debug_postfix": ["ANY", "deprecated"], # option that no longer exist } default_options = { "shared": False, - "build_gmock": True, "fPIC": True, + "build_gmock": True, "no_main": False, - "debug_postfix": "d", "hide_symbols": False, + "debug_postfix": "deprecated", # option that no longer exist } @property def _minimum_cpp_standard(self): - if self.version == "1.8.1": - return 98 - else: return 11 @property def _minimum_compilers_version(self): - if self.version == "1.8.1": - return { - "Visual Studio": "14" - } - elif self.version == "1.10.0": - return { - "Visual Studio": "14", - "gcc": "4.8.1", - "clang": "3.3", - "apple-clang": "5.0" - } - else: - return { - "Visual Studio": "14", - "gcc": "5", - "clang": "5", - "apple-clang": "9.1" - } + return { + "Visual Studio": "14", + "msvc": "180", + "gcc": "5", + "clang": "5", + "apple-clang": "9.1" + } @property def _is_clang_cl(self): return self.settings.os == "Windows" and self.settings.compiler == "clang" - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, patch["patch_file"], self.recipe_folder, self.export_sources_folder) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.build_type != "Debug": - del self.options.debug_postfix def configure(self): if self.options.shared: del self.options.fPIC + if self.options.debug_postfix != "deprecated": + self.output.warn("gtest/*:debug_postfix is deprecated.") def package_id(self): - del self.info.options.no_main + del self.info.options.no_main # Only used to expose more targets + del self.info.options.debug_postfix # deprecated option that no longer exist + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if is_msvc_static_runtime(self) and self.info.options.shared: + if self.options.shared and (is_msvc(self) or self._is_clang_cl) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration( "gtest:shared=True with compiler=\"Visual Studio\" is not " "compatible with compiler.runtime=MT/MTd" @@ -108,44 +93,27 @@ def loose_lt_semver(v1, v2): f"{self.ref} requires {compiler} {min_version}. The current compiler is {compiler} {compiler.version}." ) - def layout(self): - cmake_layout(self, src_folder="src") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def _patch_sources(self): - apply_conandata_patches(self) - # No warnings as errors - internal_utils = os.path.join(self.source_folder, "googletest", - "cmake", "internal_utils.cmake") - replace_in_file(self, internal_utils, "-WX", "") - if self.version == "cci.20210126" or Version(self.version) < "1.12.0": - replace_in_file(self, internal_utils, "-Werror", "") - def generate(self): tc = CMakeToolchain(self) - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" - - if self.settings.build_type == "Debug": - tc.cache_variables["CUSTOM_DEBUG_POSTFIX"] = str(self.options.debug_postfix) + tc.variables["BUILD_GMOCK"] = bool(self.options.build_gmock) + tc.variables["gtest_hide_internal_symbols"] = bool(self.options.hide_symbols) if is_msvc(self) or self._is_clang_cl: - tc.cache_variables["gtest_force_shared_crt"] = "MD" in msvc_runtime_flag(self) - - try: - check_min_vs(self, "191") - except ConanInvalidConfiguration: - tc.preprocessor_definitions["GTEST_LANG_CXX11"] = 1 - tc.preprocessor_definitions["GTEST_HAS_TR1_TUPLE"] = 0 - - tc.cache_variables["BUILD_GMOCK"] = bool(self.options.build_gmock) + tc.variables["gtest_force_shared_crt"] = not is_msvc_static_runtime(self) if self.settings.os == "Windows" and self.settings.compiler == "gcc": - tc.cache_variables["gtest_disable_pthreads"] = True - tc.cache_variables["gtest_hide_internal_symbols"] = bool(self.options.hide_symbols) + tc.variables["gtest_disable_pthreads"] = True tc.generate() + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def _patch_sources(self): + if is_msvc(self) or self._is_clang_cl: + # No warnings as errors + replace_in_file(self, os.path.join(self.source_folder, "googletest", + "cmake", "internal_utils.cmake"), "-WX", "") + def build(self): self._patch_sources() cmake = CMake(self) @@ -160,13 +128,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) - @property - def _postfix(self): - # In 1.12.0, gtest remove debug postfix. - if self.version != "cci.20210126" and Version(self.version) >= "1.12.0": - return "" - return self.options.debug_postfix if self.settings.build_type == "Debug" else "" - def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "GTest") @@ -175,7 +136,7 @@ def package_info(self): self.cpp_info.components["libgtest"].set_property("cmake_target_name", "GTest::gtest") self.cpp_info.components["libgtest"].set_property("cmake_target_aliases", ["GTest::GTest"]) self.cpp_info.components["libgtest"].set_property("pkg_config_name", "gtest") - self.cpp_info.components["libgtest"].libs = [f"gtest{self._postfix}"] + self.cpp_info.components["libgtest"].libs = ["gtest"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libgtest"].system_libs.append("m") self.cpp_info.components["libgtest"].system_libs.append("pthread") @@ -183,32 +144,27 @@ def package_info(self): self.cpp_info.components["libgtest"].system_libs.append("regex") if self.options.shared: self.cpp_info.components["libgtest"].defines.append("GTEST_LINKED_AS_SHARED_LIBRARY=1") - if self.version == "1.8.1": - if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "15") or \ - (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler.version) >= "191"): - self.cpp_info.components["libgtest"].defines.append("GTEST_LANG_CXX11=1") - self.cpp_info.components["libgtest"].defines.append("GTEST_HAS_TR1_TUPLE=0") # gtest_main if not self.options.no_main: self.cpp_info.components["gtest_main"].set_property("cmake_target_name", "GTest::gtest_main") self.cpp_info.components["gtest_main"].set_property("cmake_target_aliases", ["GTest::Main"]) self.cpp_info.components["gtest_main"].set_property("pkg_config_name", "gtest_main") - self.cpp_info.components["gtest_main"].libs = [f"gtest_main{self._postfix}"] + self.cpp_info.components["gtest_main"].libs = ["gtest_main"] self.cpp_info.components["gtest_main"].requires = ["libgtest"] # gmock if self.options.build_gmock: self.cpp_info.components["gmock"].set_property("cmake_target_name", "GTest::gmock") self.cpp_info.components["gmock"].set_property("pkg_config_name", "gmock") - self.cpp_info.components["gmock"].libs = [f"gmock{self._postfix}"] + self.cpp_info.components["gmock"].libs = ["gmock"] self.cpp_info.components["gmock"].requires = ["libgtest"] # gmock_main if not self.options.no_main: self.cpp_info.components["gmock_main"].set_property("cmake_target_name", "GTest::gmock_main") self.cpp_info.components["gmock_main"].set_property("pkg_config_name", "gmock_main") - self.cpp_info.components["gmock_main"].libs = [f"gmock_main{self._postfix}"] + self.cpp_info.components["gmock_main"].libs = ["gmock_main"] self.cpp_info.components["gmock_main"].requires = ["gmock"] # TODO: to remove in conan v2 once cmake_find_package_* generators removed diff --git a/recipes/gtest/all/patches/gtest-1.10.0-override.patch b/recipes/gtest/all/patches/gtest-1.10.0-override.patch deleted file mode 100644 index 1757bf3107445..0000000000000 --- a/recipes/gtest/all/patches/gtest-1.10.0-override.patch +++ /dev/null @@ -1,450 +0,0 @@ -From 3cddd56e195b516f449bea6dcd3edd4494195631 Mon Sep 17 00:00:00 2001 -From: Robert Luberda -Date: Wed, 9 Oct 2019 21:48:00 +0200 -Subject: [PATCH] Add more override keywords - -Mark more functions with "override" keyword, just like -it was done in commit 2460f97152c. - -This should prevent compiler from complaining while compiling both -user code, and the googletest code itself with the -Wsuggest-override -option turned on; with the exception of: - * calls to new MOCK_METHOD() in test/gmock-function-mocker_test.cc - * calls to old MOCK_METHODx()/MOCK_CONST_METHODx() in other - unit test files. - -Closes #2493 ---- - .../include/gmock/gmock-generated-actions.h | 24 ++--- - .../gmock/gmock-generated-actions.h.pump | 4 +- - .../include/gmock/gmock-generated-matchers.h | 88 +++++++++---------- - .../gmock/gmock-generated-matchers.h.pump | 8 +- - googletest/include/gtest/gtest-typed-test.h | 4 +- - .../include/gtest/internal/gtest-port.h | 4 +- - googletest/test/gtest_unittest.cc | 4 +- - 7 files changed, 68 insertions(+), 68 deletions(-) - -diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h -index 981af78ff..cee96dae8 100644 ---- a/googlemock/include/gmock/gmock-generated-actions.h -+++ b/googlemock/include/gmock/gmock-generated-actions.h -@@ -663,7 +663,7 @@ class ActionHelper { - typedef typename ::testing::internal::Function::ArgumentTuple\ - args_type;\ - explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -726,7 +726,7 @@ class ActionHelper { - typedef typename ::testing::internal::Function::ArgumentTuple\ - args_type;\ - gmock_Impl() {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -776,7 +776,7 @@ class ActionHelper { - args_type;\ - explicit gmock_Impl(p0##_type gmock_p0) : \ - p0(::std::forward(gmock_p0)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -832,7 +832,7 @@ class ActionHelper { - gmock_Impl(p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::std::forward(gmock_p0)), \ - p1(::std::forward(gmock_p1)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -893,7 +893,7 @@ class ActionHelper { - p2##_type gmock_p2) : p0(::std::forward(gmock_p0)), \ - p1(::std::forward(gmock_p1)), \ - p2(::std::forward(gmock_p2)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -961,7 +961,7 @@ class ActionHelper { - p1(::std::forward(gmock_p1)), \ - p2(::std::forward(gmock_p2)), \ - p3(::std::forward(gmock_p3)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -1038,7 +1038,7 @@ class ActionHelper { - p2(::std::forward(gmock_p2)), \ - p3(::std::forward(gmock_p3)), \ - p4(::std::forward(gmock_p4)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -1119,7 +1119,7 @@ class ActionHelper { - p3(::std::forward(gmock_p3)), \ - p4(::std::forward(gmock_p4)), \ - p5(::std::forward(gmock_p5)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -1206,7 +1206,7 @@ class ActionHelper { - p4(::std::forward(gmock_p4)), \ - p5(::std::forward(gmock_p5)), \ - p6(::std::forward(gmock_p6)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -1302,7 +1302,7 @@ class ActionHelper { - p5(::std::forward(gmock_p5)), \ - p6(::std::forward(gmock_p6)), \ - p7(::std::forward(gmock_p7)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -1404,7 +1404,7 @@ class ActionHelper { - p6(::std::forward(gmock_p6)), \ - p7(::std::forward(gmock_p7)), \ - p8(::std::forward(gmock_p8)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -1513,7 +1513,7 @@ class ActionHelper { - p7(::std::forward(gmock_p7)), \ - p8(::std::forward(gmock_p8)), \ - p9(::std::forward(gmock_p9)) {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump -index 209603c5a..283abcdc2 100644 ---- a/googlemock/include/gmock/gmock-generated-actions.h.pump -+++ b/googlemock/include/gmock/gmock-generated-actions.h.pump -@@ -395,7 +395,7 @@ $range k 0..n-1 - typedef typename ::testing::internal::Function::ArgumentTuple\ - args_type;\ - explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -@@ -482,7 +482,7 @@ $var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]] - typedef typename ::testing::internal::Function::ArgumentTuple\ - args_type;\ - [[$if i==1 [[explicit ]]]]gmock_Impl($ctor_param_list)$inits {}\ -- virtual return_type Perform(const args_type& args) {\ -+ return_type Perform(const args_type& args) override {\ - return ::testing::internal::ActionHelper::\ - Perform(this, args);\ - }\ -diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h -index 690a57f1c..61892380c 100644 ---- a/googlemock/include/gmock/gmock-generated-matchers.h -+++ b/googlemock/include/gmock/gmock-generated-matchers.h -@@ -269,13 +269,13 @@ - public:\ - gmock_Impl()\ - {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - private:\ -@@ -318,13 +318,13 @@ - public:\ - explicit gmock_Impl(p0##_type gmock_p0)\ - : p0(::std::move(gmock_p0)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -371,13 +371,13 @@ - public:\ - gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\ - : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -431,13 +431,13 @@ - gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\ - : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ - p2(::std::move(gmock_p2)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -495,13 +495,13 @@ - p3##_type gmock_p3)\ - : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ - p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -568,13 +568,13 @@ - : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ - p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ - p4(::std::move(gmock_p4)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -644,13 +644,13 @@ - : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ - p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ - p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -726,13 +726,13 @@ - p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ - p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ - p6(::std::move(gmock_p6)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -814,13 +814,13 @@ - p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ - p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ - p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -909,13 +909,13 @@ - p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ - p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ - p8(::std::move(gmock_p8)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -@@ -1009,13 +1009,13 @@ - p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ - p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ - p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\ - p0##_type const p0;\ -diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump -index ae90917cc..69d2ae418 100644 ---- a/googlemock/include/gmock/gmock-generated-matchers.h.pump -+++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump -@@ -302,13 +302,13 @@ $var param_field_decls2 = [[$for j - public:\ - [[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\ - $impl_inits {}\ -- virtual bool MatchAndExplain(\ -+ bool MatchAndExplain(\ - GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ -- ::testing::MatchResultListener* result_listener) const;\ -- virtual void DescribeTo(::std::ostream* gmock_os) const {\ -+ ::testing::MatchResultListener* result_listener) const override;\ -+ void DescribeTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(false);\ - }\ -- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ -+ void DescribeNegationTo(::std::ostream* gmock_os) const override {\ - *gmock_os << FormatDescription(true);\ - }\$param_field_decls - private:\ -diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h -index 095ce0580..6b7c9c8a0 100644 ---- a/googletest/include/gtest/gtest-typed-test.h -+++ b/googletest/include/gtest/gtest-typed-test.h -@@ -201,7 +201,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ -- virtual void TestBody(); \ -+ void TestBody() override; \ - }; \ - static bool gtest_##CaseName##_##TestName##_registered_ \ - GTEST_ATTRIBUTE_UNUSED_ = \ -@@ -276,7 +276,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); - private: \ - typedef SuiteName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ -- virtual void TestBody(); \ -+ void TestBody() override; \ - }; \ - static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ - GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ -diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h -index f6433c58a..2b4770ff5 100644 ---- a/googletest/include/gtest/internal/gtest-port.h -+++ b/googletest/include/gtest/internal/gtest-port.h -@@ -1599,7 +1599,7 @@ class ThreadLocal : public ThreadLocalBase { - class DefaultValueHolderFactory : public ValueHolderFactory { - public: - DefaultValueHolderFactory() {} -- virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); } -+ ValueHolder* MakeNewHolder() const override { return new ValueHolder(); } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory); -@@ -1608,7 +1608,7 @@ class ThreadLocal : public ThreadLocalBase { - class InstanceValueHolderFactory : public ValueHolderFactory { - public: - explicit InstanceValueHolderFactory(const T& value) : value_(value) {} -- virtual ValueHolder* MakeNewHolder() const { -+ ValueHolder* MakeNewHolder() const override { - return new ValueHolder(value_); - } - -diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc -index 8312bd10e..d17a15540 100644 ---- a/googletest/test/gtest_unittest.cc -+++ b/googletest/test/gtest_unittest.cc -@@ -6170,7 +6170,7 @@ TEST_F(ParseFlagsTest, WideStrings) { - #if GTEST_USE_OWN_FLAGFILE_FLAG_ - class FlagfileTest : public ParseFlagsTest { - public: -- virtual void SetUp() { -+ void SetUp() override { - ParseFlagsTest::SetUp(); - - testdata_path_.Set(internal::FilePath( -@@ -6180,7 +6180,7 @@ class FlagfileTest : public ParseFlagsTest { - EXPECT_TRUE(testdata_path_.CreateFolder()); - } - -- virtual void TearDown() { -+ void TearDown() override { - testing::internal::posix::RmDir(testdata_path_.c_str()); - ParseFlagsTest::TearDown(); - } diff --git a/recipes/gtest/all/patches/gtest-1.10.0.patch b/recipes/gtest/all/patches/gtest-1.10.0.patch deleted file mode 100644 index 92d37990ee2c6..0000000000000 --- a/recipes/gtest/all/patches/gtest-1.10.0.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake -index 2f70f0b0..8cd03693 100644 ---- a/googletest/cmake/internal_utils.cmake -+++ b/googletest/cmake/internal_utils.cmake -@@ -154,7 +154,7 @@ function(cxx_library_with_type name type cxx_flags) - # Generate debug library name with a postfix. - set_target_properties(${name} - PROPERTIES -- DEBUG_POSTFIX "d") -+ DEBUG_POSTFIX "${CUSTOM_DEBUG_POSTFIX}") - # Set the output directory for build artifacts - set_target_properties(${name} - PROPERTIES diff --git a/recipes/gtest/all/patches/gtest-1.11.0.patch b/recipes/gtest/all/patches/gtest-1.11.0.patch deleted file mode 100644 index 11e5c57211784..0000000000000 --- a/recipes/gtest/all/patches/gtest-1.11.0.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake -index 8d8d60a..6ea023a 100644 ---- a/googletest/cmake/internal_utils.cmake -+++ b/googletest/cmake/internal_utils.cmake -@@ -157,7 +157,7 @@ function(cxx_library_with_type name type cxx_flags) - # Generate debug library name with a postfix. - set_target_properties(${name} - PROPERTIES -- DEBUG_POSTFIX "d") -+ DEBUG_POSTFIX "${CUSTOM_DEBUG_POSTFIX}") - # Set the output directory for build artifacts - set_target_properties(${name} - PROPERTIES diff --git a/recipes/gtest/all/patches/gtest-1.8.1.patch b/recipes/gtest/all/patches/gtest-1.8.1.patch deleted file mode 100644 index 838ab42c89f02..0000000000000 --- a/recipes/gtest/all/patches/gtest-1.8.1.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake -index 8c1f9ba..2203d3c 100644 ---- a/googletest/cmake/internal_utils.cmake -+++ b/googletest/cmake/internal_utils.cmake -@@ -166,7 +166,7 @@ function(cxx_library_with_type name type cxx_flags) - # Generate debug library name with a postfix. - set_target_properties(${name} - PROPERTIES -- DEBUG_POSTFIX "d") -+ DEBUG_POSTFIX "${CUSTOM_DEBUG_POSTFIX}") - if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED") - set_target_properties(${name} - PROPERTIES diff --git a/recipes/gtest/all/test_package/CMakeLists.txt b/recipes/gtest/all/test_package/CMakeLists.txt index ab1f0c0c68d1e..301b0ee29390c 100644 --- a/recipes/gtest/all/test_package/CMakeLists.txt +++ b/recipes/gtest/all/test_package/CMakeLists.txt @@ -22,6 +22,3 @@ else() endif() set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) -if(WITH_GMOCK) - target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_GMOCK) -endif() diff --git a/recipes/gtest/all/test_package/conanfile.py b/recipes/gtest/all/test_package/conanfile.py index 7e7b3f4ebb387..1bddd2ba2988a 100644 --- a/recipes/gtest/all/test_package/conanfile.py +++ b/recipes/gtest/all/test_package/conanfile.py @@ -2,12 +2,13 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) @@ -20,12 +21,10 @@ def generate(self): with_gmock = bool(self.dependencies[self.tested_reference_str].options.build_gmock) tc.cache_variables['WITH_GMOCK'] = with_gmock - tc.preprocessor_definitions['WITH_GMOCK'] = 1 if with_gmock else 0 - - with_main = not self.dependencies[self.tested_reference_str].options.no_main - tc.cache_variables['WITH_MAIN'] = with_main - tc.preprocessor_definitions['WITH_MAIN'] = 1 if with_main else 0 + if with_gmock: + tc.preprocessor_definitions['WITH_GMOCK'] = 1 + tc.variables['WITH_MAIN'] = not bool(self.dependencies[self.tested_reference_str].options.no_main) tc.generate() def build(self): diff --git a/recipes/gtest/all/test_package/prime_tables.h b/recipes/gtest/all/test_package/prime_tables.h deleted file mode 100644 index 55a3b44efd857..0000000000000 --- a/recipes/gtest/all/test_package/prime_tables.h +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// Author: vladl@google.com (Vlad Losev) - -// This provides interface PrimeTable that determines whether a number is a -// prime and determines a next prime number. This interface is used -// in Google Test samples demonstrating use of parameterized tests. - -#ifndef GTEST_SAMPLES_PRIME_TABLES_H_ -#define GTEST_SAMPLES_PRIME_TABLES_H_ - -#include - -// The prime table interface. -class PrimeTable { - public: - virtual ~PrimeTable() {} - - // Returns true iff n is a prime number. - virtual bool IsPrime(int n) const = 0; - - // Returns the smallest prime number greater than p; or returns -1 - // if the next prime is beyond the capacity of the table. - virtual int GetNextPrime(int p) const = 0; -}; - -// Implementation #1 calculates the primes on-the-fly. -class OnTheFlyPrimeTable : public PrimeTable { - public: - virtual bool IsPrime(int n) const { - if (n <= 1) return false; - - for (int i = 2; i*i <= n; i++) { - // n is divisible by an integer other than 1 and itself. - if ((n % i) == 0) return false; - } - - return true; - } - - virtual int GetNextPrime(int p) const { - for (int n = p + 1; n > 0; n++) { - if (IsPrime(n)) return n; - } - - return -1; - } -}; - -// Implementation #2 pre-calculates the primes and stores the result -// in an array. -class PreCalculatedPrimeTable : public PrimeTable { - public: - // 'max' specifies the maximum number the prime table holds. - explicit PreCalculatedPrimeTable(int max) - : is_prime_size_(max + 1), is_prime_(new bool[max + 1]) { - CalculatePrimesUpTo(max); - } - virtual ~PreCalculatedPrimeTable() { delete[] is_prime_; } - - virtual bool IsPrime(int n) const { - return 0 <= n && n < is_prime_size_ && is_prime_[n]; - } - - virtual int GetNextPrime(int p) const { - for (int n = p + 1; n < is_prime_size_; n++) { - if (is_prime_[n]) return n; - } - - return -1; - } - - private: - void CalculatePrimesUpTo(int max) { - ::std::fill(is_prime_, is_prime_ + is_prime_size_, true); - is_prime_[0] = is_prime_[1] = false; - - // Checks every candidate for prime number (we know that 2 is the only even - // prime). - for (int i = 2; i*i <= max; i += i%2+1) { - if (!is_prime_[i]) continue; - - // Marks all multiples of i (except i itself) as non-prime. - // We are starting here from i-th multiplier, because all smaller - // complex numbers were already marked. - for (int j = i*i; j <= max; j += i) { - is_prime_[j] = false; - } - } - } - - const int is_prime_size_; - bool* const is_prime_; - - // Disables compiler warning "assignment operator could not be generated." - void operator=(const PreCalculatedPrimeTable& rhs); -}; - -#endif // GTEST_SAMPLES_PRIME_TABLES_H_ diff --git a/recipes/gtest/all/test_package/test_package.cpp b/recipes/gtest/all/test_package/test_package.cpp index 4a1f9d2acf990..36d68c62eb3c5 100644 --- a/recipes/gtest/all/test_package/test_package.cpp +++ b/recipes/gtest/all/test_package/test_package.cpp @@ -50,138 +50,3 @@ TEST(SalutationTest, Static) { EXPECT_EQ(string("Hello World!"), Salutation::greet("World")); } - -#if GTEST_HAS_COMBINE -#include "prime_tables.h" - -// Suppose we want to introduce a new, improved implementation of PrimeTable -// which combines speed of PrecalcPrimeTable and versatility of -// OnTheFlyPrimeTable (see prime_tables.h). Inside it instantiates both -// PrecalcPrimeTable and OnTheFlyPrimeTable and uses the one that is more -// appropriate under the circumstances. But in low memory conditions, it can be -// told to instantiate without PrecalcPrimeTable instance at all and use only -// OnTheFlyPrimeTable. -class HybridPrimeTable : public PrimeTable { - public: - HybridPrimeTable(bool force_on_the_fly, int max_precalculated) - : on_the_fly_impl_(new OnTheFlyPrimeTable), - precalc_impl_(force_on_the_fly ? NULL : - new PreCalculatedPrimeTable(max_precalculated)), - max_precalculated_(max_precalculated) {} - virtual ~HybridPrimeTable() { - delete on_the_fly_impl_; - delete precalc_impl_; - } - - virtual bool IsPrime(int n) const { - if (precalc_impl_ != NULL && n < max_precalculated_) - return precalc_impl_->IsPrime(n); - else - return on_the_fly_impl_->IsPrime(n); - } - - virtual int GetNextPrime(int p) const { - int next_prime = -1; - if (precalc_impl_ != NULL && p < max_precalculated_) - next_prime = precalc_impl_->GetNextPrime(p); - - return next_prime != -1 ? next_prime : on_the_fly_impl_->GetNextPrime(p); - } - - private: - OnTheFlyPrimeTable* on_the_fly_impl_; - PreCalculatedPrimeTable* precalc_impl_; - int max_precalculated_; -}; - -using ::testing::TestWithParam; -using ::testing::Bool; -using ::testing::Values; -using ::testing::Combine; - -// To test all code paths for HybridPrimeTable we must test it with numbers -// both within and outside PreCalculatedPrimeTable's capacity and also with -// PreCalculatedPrimeTable disabled. We do this by defining fixture which will -// accept different combinations of parameters for instantiating a -// HybridPrimeTable instance. -class PrimeTableTest : public TestWithParam< ::testing::tuple > { - protected: - virtual void SetUp() { - // This can be written as - // - // bool force_on_the_fly; - // int max_precalculated; - // tie(force_on_the_fly, max_precalculated) = GetParam(); - // - // once the Google C++ Style Guide allows use of ::std::tr1::tie. - // - bool force_on_the_fly = ::testing::get<0>(GetParam()); - int max_precalculated = ::testing::get<1>(GetParam()); - table_ = new HybridPrimeTable(force_on_the_fly, max_precalculated); - } - virtual void TearDown() { - delete table_; - table_ = NULL; - } - HybridPrimeTable* table_; -}; - -TEST_P(PrimeTableTest, ReturnsFalseForNonPrimes) { - // Inside the test body, you can refer to the test parameter by GetParam(). - // In this case, the test parameter is a PrimeTable interface pointer which - // we can use directly. - // Please note that you can also save it in the fixture's SetUp() method - // or constructor and use saved copy in the tests. - - EXPECT_FALSE(table_->IsPrime(-5)); - EXPECT_FALSE(table_->IsPrime(0)); - EXPECT_FALSE(table_->IsPrime(1)); - EXPECT_FALSE(table_->IsPrime(4)); - EXPECT_FALSE(table_->IsPrime(6)); - EXPECT_FALSE(table_->IsPrime(100)); -} - -TEST_P(PrimeTableTest, ReturnsTrueForPrimes) { - EXPECT_TRUE(table_->IsPrime(2)); - EXPECT_TRUE(table_->IsPrime(3)); - EXPECT_TRUE(table_->IsPrime(5)); - EXPECT_TRUE(table_->IsPrime(7)); - EXPECT_TRUE(table_->IsPrime(11)); - EXPECT_TRUE(table_->IsPrime(131)); -} - -TEST_P(PrimeTableTest, CanGetNextPrime) { - EXPECT_EQ(2, table_->GetNextPrime(0)); - EXPECT_EQ(3, table_->GetNextPrime(2)); - EXPECT_EQ(5, table_->GetNextPrime(3)); - EXPECT_EQ(7, table_->GetNextPrime(5)); - EXPECT_EQ(11, table_->GetNextPrime(7)); - EXPECT_EQ(131, table_->GetNextPrime(128)); -} - -// In order to run value-parameterized tests, you need to instantiate them, -// or bind them to a list of values which will be used as test parameters. -// You can instantiate them in a different translation module, or even -// instantiate them several times. -// -// Here, we instantiate our tests with a list of parameters. We must combine -// all variations of the boolean flag suppressing PrecalcPrimeTable and some -// meaningful values for tests. We choose a small value (1), and a value that -// will put some of the tested numbers beyond the capability of the -// PrecalcPrimeTable instance and some inside it (10). Combine will produce all -// possible combinations. -INSTANTIATE_TEST_CASE_P(MeaningfulTestParameters, - PrimeTableTest, - Combine(Bool(), Values(1, 10))); - -#else - -// Google Test may not support Combine() with some compilers. If we -// use conditional compilation to compile out all code referring to -// the gtest_main library, MSVC linker will not link that library at -// all and consequently complain about missing entry point defined in -// that library (fatal error LNK1561: entry point must be -// defined). This dummy test keeps gtest_main linked in. -TEST(DummyTest, CombineIsNotSupportedOnThisPlatform) {} - -#endif // GTEST_HAS_COMBINE diff --git a/recipes/gtest/all/test_v1_package/conanfile.py b/recipes/gtest/all/test_v1_package/conanfile.py index 9d0e714740084..1490f15fbb3c6 100644 --- a/recipes/gtest/all/test_v1_package/conanfile.py +++ b/recipes/gtest/all/test_v1_package/conanfile.py @@ -16,7 +16,6 @@ def build(self): cmake.build() def test(self): - assert os.path.isfile(os.path.join(self.deps_cpp_info["gtest"].rootpath, "licenses", "LICENSE")) if not cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) diff --git a/recipes/gtest/config.yml b/recipes/gtest/config.yml index b5875ece43c69..daa3a213a56fa 100644 --- a/recipes/gtest/config.yml +++ b/recipes/gtest/config.yml @@ -1,11 +1,3 @@ versions: "1.12.1": folder: all - "1.11.0": - folder: all - "cci.20210126": - folder: all - "1.10.0": - folder: all - "1.8.1": - folder: all From 66a246ae25dc5a7e67c7aa2c4580af69d7aa193f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 15:45:39 +0200 Subject: [PATCH 148/561] (#13061) tsl-robin-map: conan v2 support --- recipes/tsl-robin-map/all/conanfile.py | 35 +++++++++++++------ .../all/test_package/CMakeLists.txt | 11 +++--- .../all/test_package/conanfile.py | 19 +++++++--- .../all/test_v1_package/CMakeLists.txt | 11 ++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++ 5 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-robin-map/all/test_v1_package/conanfile.py diff --git a/recipes/tsl-robin-map/all/conanfile.py b/recipes/tsl-robin-map/all/conanfile.py index da0b3a58cb5e8..60cfac70c1a0d 100644 --- a/recipes/tsl-robin-map/all/conanfile.py +++ b/recipes/tsl-robin-map/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class TslRobinMapConan(ConanFile): @@ -14,24 +17,33 @@ class TslRobinMapConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "tsl-robin-map") self.cpp_info.set_property("cmake_target_name", "tsl::robin_map") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-robin-map" @@ -41,3 +53,6 @@ def package_info(self): self.cpp_info.components["robin_map"].names["cmake_find_package"] = "robin_map" self.cpp_info.components["robin_map"].names["cmake_find_package_multi"] = "robin_map" self.cpp_info.components["robin_map"].set_property("cmake_target_name", "tsl::robin_map") + self.cpp_info.components["robin_map"].bindirs = [] + self.cpp_info.components["robin_map"].libdirs = [] + self.cpp_info.components["robin_map"].resdirs = [] diff --git a/recipes/tsl-robin-map/all/test_package/CMakeLists.txt b/recipes/tsl-robin-map/all/test_package/CMakeLists.txt index c27b4ffba58e9..e1f4cd6d85611 100644 --- a/recipes/tsl-robin-map/all/test_package/CMakeLists.txt +++ b/recipes/tsl-robin-map/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(tsl-robin-map REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} tsl::robin_map) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::robin_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-robin-map/all/test_package/conanfile.py b/recipes/tsl-robin-map/all/test_package/conanfile.py index 1e9df9e32dfbd..0a6bc68712d90 100644 --- a/recipes/tsl-robin-map/all/test_package/conanfile.py +++ b/recipes/tsl-robin-map/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..1fde03f4de7cd --- /dev/null +++ b/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-robin-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::robin_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-robin-map/all/test_v1_package/conanfile.py b/recipes/tsl-robin-map/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-robin-map/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) From b7a1c37b568df80503578db217cebf451ea4d6c4 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 16:05:01 +0200 Subject: [PATCH 149/561] (#13062) tsl-sparse-map: conan v2 support --- recipes/tsl-sparse-map/all/conanfile.py | 35 +++++++++++++------ .../all/test_package/CMakeLists.txt | 11 +++--- .../all/test_package/conanfile.py | 19 +++++++--- .../all/test_v1_package/CMakeLists.txt | 11 ++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++ 5 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-sparse-map/all/test_v1_package/conanfile.py diff --git a/recipes/tsl-sparse-map/all/conanfile.py b/recipes/tsl-sparse-map/all/conanfile.py index 19327116f1ac9..4168882cba1a3 100644 --- a/recipes/tsl-sparse-map/all/conanfile.py +++ b/recipes/tsl-sparse-map/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class TslSparseMapConan(ConanFile): @@ -14,24 +17,33 @@ class TslSparseMapConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "tsl-sparse-map") self.cpp_info.set_property("cmake_target_name", "tsl::sparse_map") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-sparse-map" @@ -41,3 +53,6 @@ def package_info(self): self.cpp_info.components["sparse_map"].names["cmake_find_package"] = "sparse_map" self.cpp_info.components["sparse_map"].names["cmake_find_package_multi"] = "sparse_map" self.cpp_info.components["sparse_map"].set_property("cmake_target_name", "tsl::sparse_map") + self.cpp_info.components["sparse_map"].bindirs = [] + self.cpp_info.components["sparse_map"].libdirs = [] + self.cpp_info.components["sparse_map"].resdirs = [] diff --git a/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt b/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt index 32b9c341072fd..47e7071ad283b 100644 --- a/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt +++ b/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(tsl-sparse-map REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} tsl::sparse_map) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::sparse_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-sparse-map/all/test_package/conanfile.py b/recipes/tsl-sparse-map/all/test_package/conanfile.py index 1e9df9e32dfbd..0a6bc68712d90 100644 --- a/recipes/tsl-sparse-map/all/test_package/conanfile.py +++ b/recipes/tsl-sparse-map/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3e681dedd0cd4 --- /dev/null +++ b/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-sparse-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::sparse_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-sparse-map/all/test_v1_package/conanfile.py b/recipes/tsl-sparse-map/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-sparse-map/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) From a6862dbcdcb523600a2db6ef8b155154a918d41d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 16:25:37 +0200 Subject: [PATCH 150/561] (#13063) tsl-ordered-map: conan v2 support --- recipes/tsl-ordered-map/all/conanfile.py | 35 +++++++++++++------ .../all/test_package/CMakeLists.txt | 11 +++--- .../all/test_package/conanfile.py | 19 +++++++--- .../all/test_v1_package/CMakeLists.txt | 11 ++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++ 5 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-ordered-map/all/test_v1_package/conanfile.py diff --git a/recipes/tsl-ordered-map/all/conanfile.py b/recipes/tsl-ordered-map/all/conanfile.py index 88eb33e09a29c..d13b78edda147 100644 --- a/recipes/tsl-ordered-map/all/conanfile.py +++ b/recipes/tsl-ordered-map/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class TslOrderedMapConan(ConanFile): @@ -14,24 +17,33 @@ class TslOrderedMapConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "tsl-ordered-map") self.cpp_info.set_property("cmake_target_name", "tsl::ordered_map") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-ordered-map" @@ -41,3 +53,6 @@ def package_info(self): self.cpp_info.components["ordered_map"].names["cmake_find_package"] = "ordered_map" self.cpp_info.components["ordered_map"].names["cmake_find_package_multi"] = "ordered_map" self.cpp_info.components["ordered_map"].set_property("cmake_target_name", "tsl::ordered_map") + self.cpp_info.components["ordered_map"].bindirs = [] + self.cpp_info.components["ordered_map"].libdirs = [] + self.cpp_info.components["ordered_map"].resdirs = [] diff --git a/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt b/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt index 4683f6913dedf..cf4b3a228306b 100644 --- a/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt +++ b/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(tsl-ordered-map REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} tsl::ordered_map) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::ordered_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-ordered-map/all/test_package/conanfile.py b/recipes/tsl-ordered-map/all/test_package/conanfile.py index 1e9df9e32dfbd..0a6bc68712d90 100644 --- a/recipes/tsl-ordered-map/all/test_package/conanfile.py +++ b/recipes/tsl-ordered-map/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..843a031b132e4 --- /dev/null +++ b/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-ordered-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::ordered_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-ordered-map/all/test_v1_package/conanfile.py b/recipes/tsl-ordered-map/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-ordered-map/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) From 1490a48ea2809b0de083cd671bb1c583e29ce9ae Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 16:45:58 +0200 Subject: [PATCH 151/561] (#13064) tsl-hopscotch-map: conan v2 support --- recipes/tsl-hopscotch-map/all/conanfile.py | 35 +++++++++++++------ .../all/test_package/CMakeLists.txt | 11 +++--- .../all/test_package/conanfile.py | 19 +++++++--- .../all/test_v1_package/CMakeLists.txt | 11 ++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++ 5 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py diff --git a/recipes/tsl-hopscotch-map/all/conanfile.py b/recipes/tsl-hopscotch-map/all/conanfile.py index bd7f158542108..6772f3c321bc9 100644 --- a/recipes/tsl-hopscotch-map/all/conanfile.py +++ b/recipes/tsl-hopscotch-map/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class TslHopscotchMapConan(ConanFile): @@ -14,24 +17,33 @@ class TslHopscotchMapConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "tsl-hopscotch-map") self.cpp_info.set_property("cmake_target_name", "tsl::hopscotch_map") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-hopscotch-map" @@ -41,3 +53,6 @@ def package_info(self): self.cpp_info.components["hopscotch_map"].names["cmake_find_package"] = "hopscotch_map" self.cpp_info.components["hopscotch_map"].names["cmake_find_package_multi"] = "hopscotch_map" self.cpp_info.components["hopscotch_map"].set_property("cmake_target_name", "tsl::hopscotch_map") + self.cpp_info.components["hopscotch_map"].bindirs = [] + self.cpp_info.components["hopscotch_map"].libdirs = [] + self.cpp_info.components["hopscotch_map"].resdirs = [] diff --git a/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt b/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt index b8b116d1cdf2f..de096ee6a84f9 100644 --- a/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt +++ b/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(tsl-hopscotch-map REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} tsl::hopscotch_map) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hopscotch_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hopscotch-map/all/test_package/conanfile.py b/recipes/tsl-hopscotch-map/all/test_package/conanfile.py index 1e9df9e32dfbd..0a6bc68712d90 100644 --- a/recipes/tsl-hopscotch-map/all/test_package/conanfile.py +++ b/recipes/tsl-hopscotch-map/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d71994382aff0 --- /dev/null +++ b/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-hopscotch-map REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hopscotch_map) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py b/recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) From ef79b0bfffff7fabe2abda9e2b0698f769c2cc0b Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 22 Sep 2022 18:06:33 +0300 Subject: [PATCH 152/561] (#13065) doctest: Upgrade imports to Conan v2-compatible --- recipes/doctest/2.x.x/conanfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/doctest/2.x.x/conanfile.py b/recipes/doctest/2.x.x/conanfile.py index db899278087d4..4017382a98300 100644 --- a/recipes/doctest/2.x.x/conanfile.py +++ b/recipes/doctest/2.x.x/conanfile.py @@ -1,5 +1,6 @@ -from conans import ConanFile, tools, CMake import os +from conan import ConanFile +from conan.tools import files class DoctestConan(ConanFile): @@ -17,7 +18,7 @@ def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" def source(self): - tools.get(**self.conan_data["sources"][self.version]) + files.get(self, **self.conan_data["sources"][self.version]) extracted_dir = self.name + "-" + self.version os.rename(extracted_dir, self._source_subfolder) From a57aaf94ef317feb2d6a1d5972f07875e02439d2 Mon Sep 17 00:00:00 2001 From: Julien Pilet Date: Thu, 22 Sep 2022 17:44:36 +0200 Subject: [PATCH 153/561] (#11694) gdal: add new CMake based conanfile.py for version 3.5.1 * [WIP] Add gdal 3.5.1 * [WIP] treat all dependencies in the same way * works as shared lib * Works with several deps, formatted * Format strings with double quotes * Fix libkml dependency linking * More fixes, add README.md * Remove blank line * Fix build and lint issues * Fix wrong include dir * fix requirements component reference * disable fPIC option with shared * Check if fPIC options exists before evaluating it * Updated readme * Update recipes/gdal/post_3.5.0/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * removed imports: conan.tools.cmake, conans.tools * Simplify patch * Move build in its own folder * Fix windows lib name * import is_msvc * Remove dependency array indirection, replace CONAN_PKG::, address other comments * Support with_jpeg=libjpeg-turbo * support with_mysql * Remove useless line * use get_safe("fPIC") Co-authored-by: Chris Mc * Try to make linter happy * Revert changes on pre-3.5.0 conanfile * Fix cmake error * Remove windows suffixes * Add 'd' suffix for windows debug builds * Address comments * Remove --with_crypto, explain cmake patches * deprecate with_crypto properly Co-authored-by: ericLemanissier Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: Chris Mc --- recipes/gdal/config.yml | 2 + recipes/gdal/post_3.5.0/CMakeLists.txt | 112 +++ recipes/gdal/post_3.5.0/conandata.yml | 8 + recipes/gdal/post_3.5.0/conanfile.py | 894 ++++++++++++++++++ .../3.5.1/0-replace-find-package.patch | 266 ++++++ .../post_3.5.0/test_package/CMakeLists.txt | 14 + .../gdal/post_3.5.0/test_package/conanfile.py | 23 + .../post_3.5.0/test_package/test_package.c | 58 ++ .../post_3.5.0/test_package/test_package.cpp | 54 ++ 9 files changed, 1431 insertions(+) create mode 100644 recipes/gdal/post_3.5.0/CMakeLists.txt create mode 100644 recipes/gdal/post_3.5.0/conandata.yml create mode 100644 recipes/gdal/post_3.5.0/conanfile.py create mode 100644 recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch create mode 100644 recipes/gdal/post_3.5.0/test_package/CMakeLists.txt create mode 100644 recipes/gdal/post_3.5.0/test_package/conanfile.py create mode 100644 recipes/gdal/post_3.5.0/test_package/test_package.c create mode 100644 recipes/gdal/post_3.5.0/test_package/test_package.cpp diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index 5c91c444b2c8a..52a62879ed75b 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.1": + folder: "post_3.5.0" "3.4.3": folder: "pre_3.5.0" "3.4.1": diff --git a/recipes/gdal/post_3.5.0/CMakeLists.txt b/recipes/gdal/post_3.5.0/CMakeLists.txt new file mode 100644 index 0000000000000..e2ba095f98b6c --- /dev/null +++ b/recipes/gdal/post_3.5.0/CMakeLists.txt @@ -0,0 +1,112 @@ +cmake_minimum_required(VERSION 3.15) +project(gdal_cmake_wrapper) + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +include(CMakePushCheckState) + + +if (${GDAL_USE_POPPLER}) + find_package(poppler) + set(Poppler_VERSION_STRING ${poppler_VERSION}) + add_library(Poppler::Poppler ALIAS poppler::libpoppler) +endif() + +file(GLOB CONAN_GENERATED_CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Find*.cmake") +foreach(CMAKE_FILE ${CONAN_GENERATED_CMAKE_FILES}) + include(${CMAKE_FILE}) +endforeach() + +if (${GDAL_USE_ARROW}) + find_package(Arrow REQUIRED) + add_library(arrow_shared ALIAS arrow::arrow) +endif() + +if (${GDAL_USE_CRYPTOPP}) + find_package(cryptopp REQUIRED) + add_library(CRYPTOPP::CRYPTOPP ALIAS cryptopp::cryptopp-static) +endif() + +if (${GDAL_USE_DEFLATE}) + find_package(libdeflate REQUIRED) + add_library(Deflate::Deflate ALIAS libdeflate::libdeflate) +endif() + +if (${GDAL_USE_LZ4}) + find_package(lz4 REQUIRED) + add_library(LZ4::LZ4 ALIAS lz4::lz4) +endif() + +if (${GDAL_USE_BLOSC}) + find_package(c-blosc REQUIRED) + add_library(Blosc::Blosc ALIAS c-blosc::c-blosc) +endif() + +if (${GDAL_USE_OPENEXR}) + find_package(Imath REQUIRED) + find_package(OpenEXR REQUIRED) + add_library(OpenEXR::IlmImf ALIAS OpenEXR::IlmThread) + add_library(OpenEXR::IlmImfUtil ALIAS OpenEXR::OpenEXR) + add_library(OpenEXR::Half ALIAS Imath::Imath) + # gdal includes without "Imath/" folder prefix + target_include_directories(Imath::Imath INTERFACE ${Imath_INCLUDE_DIR}) + # and also without "OpenEXR/" prefix + target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) +endif() + +if (${GDAL_USE_FREEXL}) + find_package(freexl REQUIRED) + add_library(FREEXL::freexl ALIAS freexl::freexl) +endif() + +if (${GDAL_USE_OPENJPEG}) + add_library(OPENJPEG::OpenJPEG ALIAS OpenJPEG::OpenJPEG) +endif() + +if (${GDAL_USE_GIF}) + find_package(GIF REQUIRED) +endif() + +if (${GDAL_USE_CFITSIO}) + find_package(cfitsio) + add_library(CFITSIO::CFITSIO ALIAS cfitsio::cfitsio) +endif() + +if (${GDAL_USE_SQLITE3}) + find_package(SQLite3) +endif() + +if (${GDAL_USE_LIBXML2}) + find_package(LibXml2) +endif() + +if (${GDAL_USE_POSTGRESQL}) + find_package(PostgreSQL) + add_library(PostgreSQL::PostgreSQL ALIAS PostgreSQL::pq) +endif() + +if (${GDAL_USE_HDF5}) + find_package(HDF5) + set(HDF5_C_LIBRARIES HDF5::C) +endif() + +if ("${GDAL_CONAN_PACKAGE_FOR_MYSQL}" STREQUAL "libmysqlclient") + find_package(mysql REQUIRED) +endif() +if ("${GDAL_CONAN_PACKAGE_FOR_MYSQL}" STREQUAL "mariadb-connector-c") + find_package(mariadb-connector-c REQUIRED) +endif() + +if (${GDAL_USE_ZLIB}) + find_package(ZLIB) +endif() + +if ("${GDAL_CONAN_PACKAGE_FOR_JPEG}" STREQUAL "libjpeg-turbo") + find_package(libjpeg-turbo REQUIRED) + add_library(JPEG::JPEG ALIAS ${TARGET_FOR_JPEG}) +endif() + + +add_subdirectory("source_subfolder") diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml new file mode 100644 index 0000000000000..3d2af160639de --- /dev/null +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -0,0 +1,8 @@ +sources: + "3.5.1": + url: "https://github.com/OSGeo/gdal/releases/download/v3.5.1/gdal-3.5.1.tar.gz" + sha256: "7c4406ca010dc8632703a0a326f39e9db25d9f1f6ebaaeca64a963e3fac123d1" +patches: + "3.5.1": + - patch_file: "patches/3.5.1/0-replace-find-package.patch" + base_path: "source_subfolder" diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py new file mode 100644 index 0000000000000..559f688ce0a4f --- /dev/null +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -0,0 +1,894 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, get, files +from conan.errors import ConanInvalidConfiguration +from conans import CMake +import functools +import os + +class GdalConan(ConanFile): + name = "gdal" + description = "GDAL is an open source X/MIT licensed translator library " \ + "for raster and vector geospatial data formats." + license = "MIT" + topics = ("osgeo", "geospatial", "raster", "vector") + homepage = "https://github.com/OSGeo/gdal" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + + generators = "cmake", "cmake_find_package" + + # A list of gdal dependencies can be taken from cmake/helpers/CheckDependentLibraries.cmake + # within gdal sources with the command: + # grep -E '^[ \t]*gdal_check_package\(' cmake/helpers/CheckDependentLibraries.cmake \ + # | sed 's/[ \t]*gdal_check_package(\([a-zA-Z_0-9]\+\) "\(.*\)"\(.*\)/{ 'dep': \'\1\', 'descr': \'\2\' },/' \ + # | sort | uniq + + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + "with_armadillo": [True, False], + "with_arrow": [True, False], + "with_blosc": [True, False], + "with_cfitsio": [True, False], + # with_cypto option has been renamed with_openssl in version 3.5.1 + "with_crypto": [True, False, "deprecated"], + "with_cryptopp": [True, False], + "with_curl": [True, False], + "with_dds": [True, False], + "with_expat": [True, False], + "with_exr": [True, False], + "with_freexl": [True, False], + "with_geos": [True, False], + "with_gif": [True, False], + "with_gta": [True, False], + "with_hdf4": [True, False], + "with_hdf5": [True, False], + "with_heif": [True, False], + "with_kea": [True, False], + "with_libdeflate": [True, False], + "with_libiconv": [True, False], + "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], + "with_libkml": [True, False], + "with_libtiff": [True, False], + "with_lz4": [True, False], + "with_mongocxx": [True, False], + "with_mysql": [None, "libmysqlclient", "mariadb-connector-c"], + "with_netcdf": [True, False], + "with_odbc": [True, False], + "with_openjpeg": [True, False], + "with_openssl": [True, False], + "with_pcre": [True, False], + "with_pcre2": [True, False], + "with_pg": [True, False], + "with_png": [True, False], + "with_podofo": [True, False], + "with_poppler": [True, False], + "with_proj": [True, False], + "with_qhull": [True, False], + "with_sqlite3": [True, False], + "with_webp": [True, False], + "with_xerces": [True, False], + "with_xml2": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "tools": False, + "with_armadillo": False, + "with_arrow": False, + "with_blosc": False, + "with_cfitsio": False, + "with_crypto": "deprecated", + "with_cryptopp": False, + "with_curl": False, + "with_dds": False, + "with_expat": False, + "with_exr": False, + "with_freexl": False, + "with_geos": True, + "with_gif": True, + "with_gta": False, + "with_hdf4": False, + "with_hdf5": False, + "with_heif": False, + "with_kea": False, + "with_libdeflate": True, + "with_libiconv": True, + "with_jpeg": "libjpeg", + "with_libkml": False, + "with_libtiff": True, + "with_lz4": False, + "with_mongocxx": False, + "with_mysql": None, + "with_netcdf": False, + "with_odbc": False, + "with_openjpeg": False, + "with_openssl": False, + "with_pcre": False, + "with_pcre2": False, + "with_pg": False, + "with_png": True, + "with_podofo": False, + "with_poppler": False, + "with_proj": True, + "with_qhull": True, + "with_sqlite3": True, + "with_webp": False, + "with_xerces": False, + "with_xml2": False, + "with_zlib": True, + "with_zstd": False, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build" + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.with_crypto != "deprecated": + self.output.error("with_crypto option is deprecated, use with_openssl instead.") + + if self.options.shared: + try: + del self.options.fPIC + except: + pass + + def requirements(self): + self.requires("json-c/0.15") + self.requires("libgeotiff/1.7.1") + + if self.options.with_armadillo: + self.requires("armadillo/10.7.3") + + if self.options.with_arrow: + self.requires("arrow/8.0.0") + + if self.options.with_blosc: + self.requires("c-blosc/1.21.1") + + if self.options.with_cfitsio: + self.requires("cfitsio/4.1.0") + + if self.options.with_cryptopp: + self.requires("cryptopp/8.6.0") + + if self.options.with_curl: + self.requires("libcurl/7.83.1") + + if self.options.with_dds: + self.requires("crunch/cci.20190615") + + if self.options.with_expat: + self.requires("expat/2.4.8") + + if self.options.with_exr: + self.requires("openexr/3.1.5") + self.requires("imath/3.1.5") + + if self.options.with_freexl: + self.requires("freexl/1.0.6") + + if self.options.with_geos: + self.requires("geos/3.11.0") + + if self.options.with_gif: + self.requires("giflib/5.2.1") + + if self.options.with_gta: + self.requires("libgta/1.2.1") + + if self.options.with_hdf4: + self.requires("hdf4/4.2.15") + + if self.options.with_hdf5: + self.requires("hdf5/1.13.1") + + if self.options.with_heif: + self.requires("libheif/1.12.0") + + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9d") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.2") + + if self.options.with_kea: + self.requires("kealib/1.4.14") + + if self.options.with_libdeflate: + self.requires("libdeflate/1.12") + + if self.options.with_libiconv: + self.requires("libiconv/1.17") + + if self.options.with_libkml: + self.requires("libkml/1.3.0") + + if self.options.with_libtiff: + self.requires("libtiff/4.3.0") + + if self.options.with_lz4: + self.requires("lz4/1.9.3") + + if self.options.with_mongocxx: + self.requires("mongo-cxx-driver/3.6.6") + + if self.options.with_mysql == "libmysqlclient": + self.requires("libmysqlclient/8.0.29") + elif self.options.with_mysql == "mariadb-connector-c": + self.requires("mariadb-connector-c/3.1.12") + + if self.options.with_netcdf: + self.requires("netcdf/4.8.1") + + if self.options.with_odbc: + self.requires("odbc/2.3.9") + + if self.options.with_openjpeg: + self.requires("openjpeg/2.5.0") + + if self.options.with_openssl: + self.requires("openssl/1.1.1o") + + if self.options.with_pcre: + self.requires("pcre/8.45") + + if self.options.with_pcre2: + self.requires("pcre2/10.40") + + if self.options.with_pg: + self.requires("libpq/14.2") + + if self.options.with_png: + self.requires("libpng/1.6.37") + + if self.options.with_podofo: + self.requires("podofo/0.9.7") + + if self.options.with_poppler: + self.requires("poppler/21.07.0") + + if self.options.with_proj: + self.requires("proj/9.0.0") + + if self.options.with_qhull: + self.requires("qhull/8.0.1") + + if self.options.with_sqlite3: + self.requires("sqlite3/3.38.5") + + if self.options.with_webp: + self.requires("libwebp/1.2.2") + + if self.options.with_xerces: + self.requires("xerces-c/3.2.3") + + if self.options.with_xml2: + self.requires("libxml2/2.9.14") + + if self.options.with_zlib: + self.requires("zlib/1.2.12") + + if self.options.with_zstd: + self.requires("zstd/1.5.2") + + def package_id(self): + del self.info.options.with_crypto + + def validate(self): + if self.options.get_safe("with_pcre") and self.options.get_safe("with_pcre2"): + raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") + + if self.options.get_safe("with_sqlite3") and not self.options["sqlite3"].enable_column_metadata: + raise ConanInvalidConfiguration("gdql requires sqlite3:enable_column_metadata=True") + + if self.options.get_safe("with_libtiff") and self.options["libtiff"].jpeg != self.options.get_safe("with_jpeg"): + msg = "libtiff:jpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." + # For some reason, the ConanInvalidConfiguration message is not shown, only + # ERROR: At least two recipes provides the same functionality: + # - 'libjpeg' provided by 'libjpeg-turbo/2.1.2', 'libjpeg/9d' + # So we print the error message manually. + self.output.error(msg) + raise ConanInvalidConfiguration(msg) + + if self.options.get_safe("with_poppler") and self.options["poppler"].with_libjpeg != self.options.get_safe("with_jpeg"): + msg = "poppler:with_libjpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." + self.output.error(msg) + raise ConanInvalidConfiguration(msg) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + @functools.lru_cache(1) + def _configure_cmake(self): + cmake = CMake(self) + + if self.options.get_safe("fPIC", True): + cmake.definitions[ + "GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = True + + cmake.definitions["BUILD_JAVA_BINDINGS"] = False + cmake.definitions["BUILD_CSHARP_BINDINGS"] = False + cmake.definitions["BUILD_PYTHON_BINDINGS"] = False + + cmake.definitions["BUILD_TESTING"] = False + cmake.definitions["GDAL_USE_ZLIB_INTERNAL"] = False + cmake.definitions["GDAL_USE_JSONC_INTERNAL"] = False + cmake.definitions["GDAL_USE_JPEG_INTERNAL"] = False + cmake.definitions["GDAL_USE_JPEG12_INTERNAL"] = False + cmake.definitions["GDAL_USE_TIFF_INTERNAL"] = False + cmake.definitions["GDAL_USE_GEOTIFF_INTERNAL"] = False + cmake.definitions["GDAL_USE_GIF_INTERNAL"] = False + cmake.definitions["GDAL_USE_PNG_INTERNAL"] = False + + cmake.definitions["GDAL_USE_LERC_INTERNAL"] = True + cmake.definitions["GDAL_USE_SHAPELIB_INTERNAL"] = True + + cmake.definitions["BUILD_APPS"] = self.options.tools + + cmake.definitions["SQLite3_HAS_COLUMN_METADATA"] = \ + self.options["sqlite3"].enable_column_metadata + + cmake.definitions["SQLite3_HAS_RTREE"] = self.options[ + "sqlite3"].enable_rtree + + cmake.definitions["GDAL_USE_JSONC"] = True + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JSONC"] = "json-c" + + cmake.definitions["GDAL_USE_GEOTIFF"] = True + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GEOTIFF"] = "libgeotiff" + cmake.definitions["TARGET_FOR_GEOTIFF"] = "GeoTIFF::GeoTIFF" + + cmake.definitions["GDAL_USE_ARMADILLO"] = self.options.with_armadillo + if self.options.with_armadillo: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ARMADILLO"] = "armadillo" + cmake.definitions["TARGET_FOR_ARMADILLO"] = \ + self.dependencies["armadillo"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Armadillo_FOUND"] = False + + cmake.definitions["GDAL_USE_ARROW"] = self.options.with_arrow + if self.options.with_arrow: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ARROW"] = "arrow" + cmake.definitions["TARGET_FOR_ARROW"] = \ + self.dependencies["arrow"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Arrow_FOUND"] = False + + cmake.definitions["GDAL_USE_BLOSC"] = self.options.with_blosc + if self.options.with_blosc: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_BLOSC"] = "c-blosc" + cmake.definitions["TARGET_FOR_BLOSC"] = \ + self.dependencies["c-blosc"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Blosc_FOUND"] = False + + cmake.definitions["GDAL_USE_CFITSIO"] = self.options.with_cfitsio + if self.options.with_cfitsio: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CFITSIO"] = "cfitsio" + cmake.definitions["TARGET_FOR_CFITSIO"] = \ + self.dependencies["cfitsio"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["CFITSIO_FOUND"] = False + + cmake.definitions["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp + if self.options.with_cryptopp: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CRYPTOPP"] = "cryptopp" + cmake.definitions["TARGET_FOR_CRYPTOPP"] = \ + self.dependencies["cryptopp"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["CryptoPP_FOUND"] = False + + cmake.definitions["GDAL_USE_CURL"] = self.options.with_curl + if self.options.with_curl: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CURL"] = "libcurl" + cmake.definitions["TARGET_FOR_CURL"] = \ + self.dependencies["libcurl"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["CURL_FOUND"] = False + + cmake.definitions["GDAL_USE_CRNLIB"] = self.options.with_dds + if self.options.with_dds: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CRNLIB"] = "crunch" + cmake.definitions["TARGET_FOR_CRNLIB"] = \ + self.dependencies["crunch"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Crnlib_FOUND"] = False + + cmake.definitions["GDAL_USE_EXPAT"] = self.options.with_expat + if self.options.with_expat: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_EXPAT"] = "expat" + cmake.definitions["TARGET_FOR_EXPAT"] = "EXPAT::EXPAT" + else: + cmake.definitions["EXPAT_FOUND"] = False + + cmake.definitions["GDAL_USE_OPENEXR"] = self.options.with_exr + if self.options.with_exr: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENEXR"] = "openexr" + cmake.definitions["TARGET_FOR_OPENEXR"] = \ + self.dependencies["openexr"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["OpenEXR_FOUND"] = False + + cmake.definitions["GDAL_USE_FREEXL"] = self.options.with_freexl + if self.options.with_freexl: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_FREEXL"] = "freexl" + cmake.definitions["TARGET_FOR_FREEXL"] = "freexl::freexl" + else: + cmake.definitions["FreeXL_FOUND"] = False + + cmake.definitions["GDAL_USE_GEOS"] = self.options.with_geos + if self.options.with_geos: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GEOS"] = "geos" + cmake.definitions["TARGET_FOR_GEOS"] = \ + self.dependencies["geos"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["GEOS_FOUND"] = False + + cmake.definitions["GDAL_USE_GIF"] = self.options.with_gif + if self.options.with_gif: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GIF"] = "giflib" + cmake.definitions["TARGET_FOR_GIF"] = \ + self.dependencies["giflib"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["GIF_FOUND"] = False + + cmake.definitions["GDAL_USE_GTA"] = self.options.with_gta + if self.options.with_gta: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GTA"] = "libgta" + cmake.definitions["TARGET_FOR_GTA"] = \ + self.dependencies["libgta"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["GTA_FOUND"] = False + + cmake.definitions["GDAL_USE_HDF4"] = self.options.with_hdf4 + if self.options.with_hdf4: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HDF4"] = "hdf4" + cmake.definitions["TARGET_FOR_HDF4"] = \ + self.dependencies["hdf4"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["HDF4_FOUND"] = False + + cmake.definitions["GDAL_USE_HDF5"] = self.options.with_hdf5 + if self.options.with_hdf5: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HDF5"] = "hdf5" + cmake.definitions["TARGET_FOR_HDF5"] = \ + self.dependencies["hdf5"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["HDF5_FOUND"] = False + + cmake.definitions["GDAL_USE_HEIF"] = self.options.with_heif + if self.options.with_heif: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HEIF"] = "libheif" + cmake.definitions["TARGET_FOR_HEIF"] = \ + self.dependencies["libheif"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["HEIF_FOUND"] = False + + cmake.definitions["GDAL_USE_KEA"] = self.options.with_kea + if self.options.with_kea: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_KEA"] = "kealib" + cmake.definitions["TARGET_FOR_KEA"] = \ + self.dependencies["kealib"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["KEA_FOUND"] = False + + cmake.definitions["GDAL_USE_DEFLATE"] = self.options.with_libdeflate + if self.options.with_libdeflate: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_DEFLATE"] = "libdeflate" + cmake.definitions["TARGET_FOR_DEFLATE"] = \ + self.dependencies["libdeflate"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Deflate_FOUND"] = False + + cmake.definitions["GDAL_USE_ICONV"] = self.options.with_libiconv + if self.options.with_libiconv: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ICONV"] = "libiconv" + cmake.definitions["TARGET_FOR_ICONV"] = \ + self.dependencies["libiconv"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Iconv_FOUND"] = False + + if self.options.with_jpeg == "libjpeg" or self.options.with_jpeg == "libjpeg-turbo": + print(f'self.options.with_jpeg: {self.options.with_jpeg}') + cmake.definitions["GDAL_USE_JPEG"] = True + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg + cmake.definitions["TARGET_FOR_JPEG"] = \ + "JPEG::JPEG" if self.options.with_jpeg == "libjpeg" else "libjpeg-turbo::libjpeg-turbo" + else: + cmake.definitions["JPEG_FOUND"] = False + + cmake.definitions["GDAL_USE_LIBKML"] = self.options.with_libkml + if self.options.with_libkml: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LIBKML"] = "libkml" + cmake.definitions["TARGET_FOR_LIBKML"] = \ + self.dependencies["libkml"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["LibKML_FOUND"] = False + + cmake.definitions["GDAL_USE_TIFF"] = self.options.with_libtiff + if self.options.with_libtiff: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_TIFF"] = "libtiff" + cmake.definitions["TARGET_FOR_TIFF"] = \ + self.dependencies["libtiff"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["TIFF_FOUND"] = False + + cmake.definitions["GDAL_USE_LZ4"] = self.options.with_lz4 + if self.options.with_lz4: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LZ4"] = "lz4" + cmake.definitions["TARGET_FOR_LZ4"] = \ + self.dependencies["lz4"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["LZ4_FOUND"] = False + + cmake.definitions["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx + if self.options.with_mongocxx: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_MONGOCXX"] = "mongo-cxx-driver" + cmake.definitions["TARGET_FOR_MONGOCXX"] = \ + self.dependencies["mongo-cxx-driver"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["MONGOCXX_FOUND"] = False + + if self.options.with_mysql == "libmysqlclient" or self.options.with_mysql == "mariadb-connector-c": + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_MYSQL"] = str(self.options.with_mysql) + cmake.definitions["TARGET_FOR_MYSQL"] = \ + "mariadb-connector-c::mariadb-connector-c" \ + if self.options.with_mysql == "mariadb-connector-c" \ + else "libmysqlclient::libmysqlclient" + else: + cmake.definitions["MYSQL_FOUND"] = False + + cmake.definitions["GDAL_USE_NETCDF"] = self.options.with_netcdf + if self.options.with_netcdf: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_NETCDF"] = "netcdf" + cmake.definitions["TARGET_FOR_NETCDF"] = \ + self.dependencies["netcdf"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["NetCDF_FOUND"] = False + + cmake.definitions["GDAL_USE_ODBC"] = self.options.with_odbc + if self.options.with_odbc: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ODBC"] = "odbc" + cmake.definitions["TARGET_FOR_ODBC"] = \ + self.dependencies["odbc"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["ODBC_FOUND"] = False + + cmake.definitions["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg + if self.options.with_openjpeg: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENJPEG"] = "openjpeg" + cmake.definitions["TARGET_FOR_OPENJPEG"] = \ + self.dependencies["openjpeg"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["OPENJPEG_FOUND"] = False + + cmake.definitions["GDAL_USE_OPENSSL"] = self.options.with_openssl + if self.options.with_openssl: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENSSL"] = "openssl" + cmake.definitions["TARGET_FOR_OPENSSL"] = \ + self.dependencies["openssl"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["OpenSSL_FOUND"] = False + + cmake.definitions["GDAL_USE_PCRE"] = self.options.with_pcre + if self.options.with_pcre: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PCRE"] = "pcre" + cmake.definitions["TARGET_FOR_PCRE"] = \ + self.dependencies["pcre"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PCRE_FOUND"] = False + + cmake.definitions["GDAL_USE_PDFIUM"] = self.options.with_pcre2 + if self.options.with_pcre2: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PDFIUM"] = "pcre2" + cmake.definitions["TARGET_FOR_PDFIUM"] = \ + self.dependencies["pcre2"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PDFIUM_FOUND"] = False + + cmake.definitions["GDAL_USE_POSTGRESQL"] = self.options.with_pg + if self.options.with_pg: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_POSTGRESQL"] = "libpq" + cmake.definitions["TARGET_FOR_POSTGRESQL"] = \ + self.dependencies["libpq"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PostgreSQL_FOUND"] = False + + cmake.definitions["GDAL_USE_PNG"] = self.options.with_png + if self.options.with_png: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PNG"] = "libpng" + cmake.definitions["TARGET_FOR_PNG"] = \ + self.dependencies["libpng"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PNG_FOUND"] = False + + cmake.definitions["GDAL_USE_PODOFO"] = self.options.with_podofo + if self.options.with_podofo: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PODOFO"] = "podofo" + cmake.definitions["TARGET_FOR_PODOFO"] = \ + self.dependencies["podofo"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Podofo_FOUND"] = False + + cmake.definitions["GDAL_USE_POPPLER"] = self.options.with_poppler + if self.options.with_poppler: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_POPPLER"] = "poppler" + cmake.definitions["TARGET_FOR_POPPLER"] = \ + self.dependencies["poppler"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["Poppler_FOUND"] = False + + cmake.definitions["GDAL_USE_PROJ"] = self.options.with_proj + if self.options.with_proj: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PROJ"] = "proj" + cmake.definitions["TARGET_FOR_PROJ"] = \ + self.dependencies["proj"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["PROJ_FOUND"] = False + + cmake.definitions["GDAL_USE_QHULL"] = self.options.with_qhull + if self.options.with_qhull: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_QHULL"] = "qhull" + cmake.definitions["TARGET_FOR_QHULL"] = \ + self.dependencies["qhull"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["QHULL_FOUND"] = False + + cmake.definitions["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 + if self.options.with_sqlite3: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_SQLITE3"] = "sqlite3" + cmake.definitions["TARGET_FOR_SQLITE3"] = \ + self.dependencies["sqlite3"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["SQLite3_FOUND"] = False + + cmake.definitions["GDAL_USE_WEBP"] = self.options.with_webp + if self.options.with_webp: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_WEBP"] = "libwebp" + cmake.definitions["TARGET_FOR_WEBP"] = \ + self.dependencies["libwebp"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["WebP_FOUND"] = False + + cmake.definitions["GDAL_USE_XERCESC"] = self.options.with_xerces + if self.options.with_xerces: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_XERCESC"] = "xerces-c" + cmake.definitions["TARGET_FOR_XERCESC"] = \ + self.dependencies["xerces-c"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["XercesC_FOUND"] = False + + cmake.definitions["GDAL_USE_LIBXML2"] = self.options.with_xml2 + if self.options.with_xml2: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LIBXML2"] = "libxml2" + cmake.definitions["TARGET_FOR_LIBXML2"] = \ + self.dependencies["libxml2"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["LibXml2_FOUND"] = False + + cmake.definitions["GDAL_USE_ZLIB"] = self.options.with_zlib + if self.options.with_zlib: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ZLIB"] = "zlib" + cmake.definitions["TARGET_FOR_ZLIB"] = \ + self.dependencies["zlib"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["ZLIB_FOUND"] = False + + cmake.definitions["GDAL_USE_ZSTD"] = self.options.with_zstd + if self.options.with_zstd: + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ZSTD"] = "zstd" + cmake.definitions["TARGET_FOR_ZSTD"] = \ + self.dependencies["zstd"].cpp_info.get_property("cmake_target_name") + else: + cmake.definitions["ZSTD_FOUND"] = False + + + for k, v in cmake.definitions.items(): + print(k, " = ", v) + + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + apply_conandata_patches(self) + cmake = self._configure_cmake() + + cmake.build() + + def package(self): + self.copy("LICENSE.TXT", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + files.rmdir(self, os.path.join(self.package_folder, "share")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + + self.cpp_info.set_property("cmake_file_name", "GDAL") + self.cpp_info.set_property("cmake_target_name", "GDAL::GDAL") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("pkg_config_name", "gdal") + + self.cpp_info.names["cmake_find_package"] = "GDAL" + self.cpp_info.names["cmake_find_package_multi"] = "GDAL" + self.cpp_info.filenames["cmake_find_package"] = "GDAL" + self.cpp_info.filenames["cmake_find_package_multi"] = "GDAL" + + libname = "gdal" + if self.settings.os == "Windows": + if self.settings.build_type == "Debug": + libname += "d" + self.cpp_info.libs = [ libname ] + + self.cpp_info.requires.extend(['json-c::json-c']) + self.cpp_info.requires.extend(['libgeotiff::libgeotiff']) + + if self.options.with_armadillo: + self.cpp_info.requires.extend(['armadillo::armadillo']) + + if self.options.with_arrow: + self.cpp_info.requires.extend(['arrow::libarrow']) + + if self.options.with_blosc: + self.cpp_info.requires.extend(['c-blosc::c-blosc']) + + if self.options.with_cfitsio: + self.cpp_info.requires.extend(['cfitsio::cfitsio']) + + if self.options.with_cryptopp: + self.cpp_info.requires.extend(['cryptopp::libcryptopp']) + + if self.options.with_curl: + self.cpp_info.requires.extend(['libcurl::curl']) + + if self.options.with_dds: + self.cpp_info.requires.extend(['crunch::crunch']) + + if self.options.with_expat: + self.cpp_info.requires.extend(['expat::expat']) + + if self.options.with_exr: + self.cpp_info.requires.extend(['openexr::openexr', 'imath::imath']) + + if self.options.with_freexl: + self.cpp_info.requires.extend(['freexl::freexl']) + + if self.options.with_geos: + self.cpp_info.requires.extend(['geos::geos_c']) + + if self.options.with_gif: + self.cpp_info.requires.extend(['giflib::giflib']) + + if self.options.with_gta: + self.cpp_info.requires.extend(['libgta::libgta']) + + if self.options.with_hdf4: + self.cpp_info.requires.extend(['hdf4::hdf4']) + + if self.options.with_hdf5: + self.cpp_info.requires.extend(['hdf5::hdf5_c']) + + if self.options.with_heif: + self.cpp_info.requires.extend(['libheif::libheif']) + + if self.options.with_kea: + self.cpp_info.requires.extend(['kealib::kealib']) + + if self.options.with_libdeflate: + self.cpp_info.requires.extend(['libdeflate::libdeflate']) + + if self.options.with_libiconv: + self.cpp_info.requires.extend(['libiconv::libiconv']) + + if self.options.with_jpeg == "libjpeg": + self.cpp_info.requires.extend(['libjpeg::libjpeg']) + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.requires.extend(['libjpeg-turbo::jpeg']) + + if self.options.with_libkml: + self.cpp_info.requires.extend(['libkml::kmldom', 'libkml::kmlengine']) + + if self.options.with_libtiff: + self.cpp_info.requires.extend(['libtiff::libtiff']) + + if self.options.with_lz4: + self.cpp_info.requires.extend(['lz4::lz4']) + + if self.options.with_mongocxx: + self.cpp_info.requires.extend(['mongo-cxx-driver::mongo-cxx-driver']) + + if self.options.with_mysql == "libmysqlclient": + self.cpp_info.requires.extend(['libmysqlclient::libmysqlclient']) + elif self.options.with_mysql == "mariadb-connector-c": + self.cpp_info.requires.extend(['mariadb-connector-c::mariadb-connector-c']) + + if self.options.with_netcdf: + self.cpp_info.requires.extend(['netcdf::netcdf']) + + if self.options.with_odbc: + self.cpp_info.requires.extend(['odbc::odbc']) + + if self.options.with_openjpeg: + self.cpp_info.requires.extend(['openjpeg::openjpeg']) + + if self.options.with_openssl: + self.cpp_info.requires.extend(['openssl::ssl']) + + if self.options.with_pcre: + self.cpp_info.requires.extend(['pcre::pcre']) + + if self.options.with_pcre2: + self.cpp_info.requires.extend(['pcre2::pcre2']) + + if self.options.with_pg: + self.cpp_info.requires.extend(['libpq::pq']) + + if self.options.with_png: + self.cpp_info.requires.extend(['libpng::libpng']) + + if self.options.with_podofo: + self.cpp_info.requires.extend(['podofo::podofo']) + + if self.options.with_poppler: + self.cpp_info.requires.extend(['poppler::libpoppler']) + + if self.options.with_proj: + self.cpp_info.requires.extend(['proj::projlib']) + + if self.options.with_qhull: + self.cpp_info.requires.extend(['qhull::libqhull']) + + if self.options.with_sqlite3: + self.cpp_info.requires.extend(['sqlite3::sqlite']) + + if self.options.with_webp: + self.cpp_info.requires.extend(['libwebp::libwebp']) + + if self.options.with_xerces: + self.cpp_info.requires.extend(['xerces-c::xerces-c']) + + if self.options.with_xml2: + self.cpp_info.requires.extend(['libxml2::libxml2']) + + if self.options.with_zlib: + self.cpp_info.requires.extend(['zlib::zlib']) + + if self.options.with_zstd: + self.cpp_info.requires.extend(['zstd::zstdlib']) + + gdal_data_path = os.path.join(self.package_folder, "res", "gdal") + self.output.info( + "Prepending to GDAL_DATA environment variable: {}".format( + gdal_data_path)) + self.runenv_info.prepend_path("GDAL_DATA", gdal_data_path) + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator + self.env_info.GDAL_DATA = gdal_data_path + + if self.options.tools: + self.buildenv_info.prepend_path("GDAL_DATA", gdal_data_path) + bin_path = os.path.join(self.package_folder, "bin") + self.output.info( + "Appending PATH environment variable: {}".format(bin_path)) + self.env_info.PATH.append(bin_path) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch new file mode 100644 index 0000000000000..e790a586d8abd --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch @@ -0,0 +1,266 @@ +diff --git a/alg/CMakeLists.txt b/alg/CMakeLists.txt +index edf75158c7..4200309ca8 100644 +--- a/alg/CMakeLists.txt ++++ b/alg/CMakeLists.txt +@@ -72,7 +72,7 @@ if (GDAL_USE_OPENCL) + target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp) + endif () + +-gdal_target_link_libraries(alg PRIVATE PROJ::proj) ++target_link_libraries(alg PUBLIC PROJ::proj) + + if (GDAL_USE_QHULL_INTERNAL) + target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL) +diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt +index a49165d14a..91d6170067 100644 +--- a/apps/CMakeLists.txt ++++ b/apps/CMakeLists.txt +@@ -25,7 +25,7 @@ target_include_directories( + appslib PRIVATE $ $ + $ $) + +-gdal_target_link_libraries(appslib PRIVATE PROJ::proj) ++target_link_libraries(appslib PUBLIC PROJ::proj) + + set_property(TARGET appslib PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) +diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake +index 7fa3b565c7..77a610f223 100644 +--- a/cmake/helpers/CheckDependentLibraries.cmake ++++ b/cmake/helpers/CheckDependentLibraries.cmake +@@ -11,7 +11,10 @@ Detect GDAL dependencies and set variable HAVE_* + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++ ++# Conan recipes should rely on config files from generators so let's just disble GDAL's ++include(ConanFindPackage) ++ + include(CheckSymbolExists) + + option( +@@ -111,47 +114,7 @@ macro (gdal_check_package name purpose) + set(_find_dependency_args "") + find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) + if (NOT DEFINED ${key}_FOUND) +- set(_find_package_args) +- if (_GCP_VERSION) +- list(APPEND _find_package_args ${_GCP_VERSION}) +- endif () +- if (_GCP_CONFIG) +- list(APPEND _find_package_args CONFIG) +- endif () +- if (_GCP_COMPONENTS) +- list(APPEND _find_package_args COMPONENTS ${_GCP_COMPONENTS}) +- endif () +- if (_GCP_PATHS) +- list(APPEND _find_package_args PATHS ${_GCP_PATHS}) +- endif () +- if (_GCP_NAMES) +- set(GDAL_CHECK_PACKAGE_${name}_NAMES "${_GCP_NAMES}" CACHE STRING "Config file name for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_NAMES) +- endif () +- if (_GCP_TARGETS) +- set(GDAL_CHECK_PACKAGE_${name}_TARGETS "${_GCP_TARGETS}" CACHE STRING "Target name candidates for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_TARGETS) +- endif () +- if (GDAL_CHECK_PACKAGE_${name}_NAMES) +- find_package(${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} ${_find_package_args}) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS} REQUIRED) +- if (${name}_FOUND) +- get_filename_component(_find_dependency_args "${${name}_CONFIG}" NAME) +- string(REPLACE ";" " " _find_dependency_args "${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} CONFIGS ${_find_dependency_args} ${_find_package_args}") +- endif () +- endif () +- if (NOT ${name}_FOUND) +- find_package(${name} ${_find_package_args}) +- if (${name}_FOUND) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- elseif (${key}_FOUND) # Some find modules do not set _FOUND +- gdal_check_package_target(${key} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- set(${name}_FOUND "${key}_FOUND") +- endif () +- if (${name}_FOUND) +- string(REPLACE ";" " " _find_dependency_args "${name} ${_find_package_args}") +- endif() +- endif () ++ message(FATAL_ERROR "Conan recipes should rely on config files from generators so let's just disble GDAL's") + endif () + if (${key}_FOUND OR ${name}_FOUND) + set(HAVE_${key} ON) +@@ -321,14 +284,15 @@ if (GDAL_USE_CRYPTOPP) + endif () + + # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. +-find_package(PROJ 9 CONFIG QUIET) +-if (NOT PROJ_FOUND) +- find_package(PROJ 8 CONFIG QUIET) +-endif() ++find_package2(PROJ) ++target_include_directories(PROJ::proj INTERFACE ${PROJ_INCLUDE_DIRS}) ++#if (NOT PROJ_FOUND) ++# find_package(proj 8 CONFIG QUIET) ++#endif() + if (PROJ_FOUND) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") + else() +- find_package(PROJ 6.0 REQUIRED) ++ find_package(proj 6.0 REQUIRED) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ 6.0)\n") + endif () + +@@ -379,15 +343,10 @@ gdal_check_package(JSONC "json-c library (external)" CAN_DISABLE + TARGETS json-c::json-c JSONC::JSONC + ) + gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) +- get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) +- find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) +- list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") +- list(REMOVE_DUPLICATES include_dirs) +- set_target_properties(json-c::json-c PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" +- ) +-endif() ++get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) ++list(APPEND include_dirs "${JSONC_INCLUDE_DIRS}/json-c") ++set_target_properties(json-c::json-c PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include_dirs}") ++message("Setting include for json-c: ${include_dirs}") + + gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) + gdal_internal_library(OPENCAD) +@@ -482,7 +441,7 @@ if (GDAL_USE_RASTERLITE2) + endif () + cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) + +-find_package(LibKML COMPONENTS DOM ENGINE) ++find_package(LibKML COMPONENTS kmlengine kmldom kmlbase) + if (GDAL_USE_LIBKML) + if (NOT LibKML_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") +diff --git a/cmake/helpers/ConanFindPackage.cmake b/cmake/helpers/ConanFindPackage.cmake +new file mode 100644 +index 0000000000..9dfa8193a3 +--- /dev/null ++++ b/cmake/helpers/ConanFindPackage.cmake +@@ -0,0 +1,43 @@ ++ ++function(define_find_package2 pkgname include_file library_name) ++endfunction() ++ ++function(find_package2 pkgname) ++ set(_options QUIET REQUIRED) ++ set(_oneValueArgs OUT_DEPENDENCY) ++ set(_multiValueArgs) ++ cmake_parse_arguments(arg "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) ++ if(arg_QUIET) ++ set(${pkgname}_FIND_QUIETLY TRUE) ++ endif() ++ if(arg_REQUIRED) ++ set(${pkgname}_FIND_REQUIRED TRUE) ++ endif() ++ ++ string(TOUPPER ${pkgname} key) ++ ++ set(docstring "Configured for conan package ${GDAL_CONAN_PACKAGE_FOR_${key}}") ++ if (DEFINED GDAL_CONAN_PACKAGE_FOR_${key}) ++ message("Using conan package ${GDAL_CONAN_PACKAGE_FOR_${key}} for dependency ${pkgname}") ++ set(conan_package ${GDAL_CONAN_PACKAGE_FOR_${key}}) ++ string(TOUPPER ${conan_package} conan_package_upper) ++ ++ set(${key}_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_${conan_package_upper}}" CACHE STRING ${docstring}) ++ if (NOT TARGET_FOR_${key}) ++ set(TARGET_FOR_${key} "${conan_package}::${conan_package}") ++ endif() ++ set(${key}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_INCLUDE_DIRS "CONAN_INCLUDE_DIRS_${conan_package_upper}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_FOUND TRUE CACHE BOOL ${docstring}) ++ ++ else () ++ message("dependency ${pkgname} has no conan package") ++ set(${key}_FOUND FALSE CACHE BOOL ${docstring}) ++ endif() ++ ++endfunction() +diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt +index e5b7138e91..039cac7361 100644 +--- a/frmts/hfa/CMakeLists.txt ++++ b/frmts/hfa/CMakeLists.txt +@@ -15,7 +15,8 @@ add_gdal_driver( + hfa_overviews.cpp + BUILTIN) + gdal_standard_includes(gdal_HFA) +-target_include_directories(gdal_HFA PRIVATE $) ++target_link_libraries(gdal_HFA INTERFACE PROJ::proj) ++target_include_directories(gdal_HFA PRIVATE ${PROJ_INCLUDE_DIRS}) + target_compile_definitions(gdal_HFA PRIVATE $) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) +diff --git a/gdal.cmake b/gdal.cmake +index ff1ca7e6f6..e98875f1b9 100644 +--- a/gdal.cmake ++++ b/gdal.cmake +@@ -795,25 +795,6 @@ if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK) + ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gdal/) + +- # Generate gdal-config utility command and pkg-config module gdal.pc +- include(GdalGenerateConfig) +- gdal_generate_config( +- TARGET +- "${GDAL_LIB_TARGET_NAME}" +- GLOBAL_PROPERTY +- "gdal_private_link_libraries" +- GDAL_CONFIG +- "${PROJECT_BINARY_DIR}/apps/gdal-config" +- PKG_CONFIG +- "${CMAKE_CURRENT_BINARY_DIR}/gdal.pc") +- install( +- PROGRAMS ${PROJECT_BINARY_DIR}/apps/gdal-config +- DESTINATION ${CMAKE_INSTALL_BINDIR} +- COMPONENT applications) +- install( +- FILES ${CMAKE_CURRENT_BINARY_DIR}/gdal.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +- COMPONENT libraries) + endif () + + configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) +diff --git a/ogr/CMakeLists.txt b/ogr/CMakeLists.txt +index 19ba4e12fe..87cd123c54 100644 +--- a/ogr/CMakeLists.txt ++++ b/ogr/CMakeLists.txt +@@ -88,12 +88,12 @@ endif () + + target_compile_definitions(ogr PRIVATE HAVE_MITAB) + +-gdal_target_link_libraries(ogr PRIVATE PROJ::proj) ++target_link_libraries(ogr PUBLIC PROJ::proj) + + # External libs then + if (GDAL_USE_GEOS) + target_compile_definitions(ogr PRIVATE -DHAVE_GEOS=1) +- gdal_target_link_libraries(ogr PRIVATE ${GEOS_TARGET}) ++ target_link_libraries(ogr PUBLIC ${GEOS_TARGET}) + endif () + + if (GDAL_USE_SFCGAL) +diff --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h +index 88928ad1ad..7cdd587db7 100644 +--- a/ogr/ogr_proj_p.h ++++ b/ogr/ogr_proj_p.h +@@ -29,7 +29,7 @@ + #ifndef OGR_PROJ_P_H_INCLUDED + #define OGR_PROJ_P_H_INCLUDED + +-#include "proj.h" ++#include + + #include "cpl_mem_cache.h" + diff --git a/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..861d8d69409b0 --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(GDAL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} GDAL::GDAL) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c GDAL::GDAL) diff --git a/recipes/gdal/post_3.5.0/test_package/conanfile.py b/recipes/gdal/post_3.5.0/test_package/conanfile.py new file mode 100644 index 0000000000000..9dced2ad9cf71 --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_package/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + if self.options["gdal"].tools: + self.run("gdal_translate --formats", run_environment=True) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) diff --git a/recipes/gdal/post_3.5.0/test_package/test_package.c b/recipes/gdal/post_3.5.0/test_package/test_package.c new file mode 100644 index 0000000000000..e4faf1b9e561d --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_package/test_package.c @@ -0,0 +1,58 @@ +#include + +#include +#include + +int main() { + GDALAllRegister(); + + const char *pszDriverName = "ESRI Shapefile"; + GDALDriverH hDriver = GDALGetDriverByName(pszDriverName); + if (!hDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } + + GDALDatasetH hDS = GDALCreate(hDriver, "point_out_c.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!hDS) { + printf("Creation of output file failed.\n"); + exit(1); + } + + OGRLayerH hLayer = GDALDatasetCreateLayer(hDS, "point_out", NULL, wkbPoint, NULL); + if (!hLayer) { + printf("Layer creation failed.\n"); + exit(1); + } + + OGRFieldDefnH hFieldDefn = OGR_Fld_Create("Name", OFTString); + + OGR_Fld_SetWidth(hFieldDefn, 32); + + if (OGR_L_CreateField(hLayer, hFieldDefn, TRUE) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } + + OGR_Fld_Destroy(hFieldDefn); + + OGRFeatureH hFeature = OGR_F_Create(OGR_L_GetLayerDefn(hLayer)); + OGR_F_SetFieldString(hFeature, OGR_F_GetFieldIndex(hFeature, "Name"), "conan"); + + OGRGeometryH hPt = OGR_G_CreateGeometry(wkbPoint); + OGR_G_SetPoint_2D(hPt, 0, 40.74, -27.891); + + OGR_F_SetGeometry(hFeature, hPt); + OGR_G_DestroyGeometry(hPt); + + if (OGR_L_CreateFeature(hLayer, hFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit(1); + } + + OGR_F_Destroy(hFeature); + + GDALClose(hDS); + + return 0; +} diff --git a/recipes/gdal/post_3.5.0/test_package/test_package.cpp b/recipes/gdal/post_3.5.0/test_package/test_package.cpp new file mode 100644 index 0000000000000..ec77987bc5ece --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_package/test_package.cpp @@ -0,0 +1,54 @@ +#include + +#include +#include + +int main() { + GDALAllRegister(); + + const char *pszDriverName = "ESRI Shapefile"; + GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszDriverName); + if (!poDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } + + GDALDataset *poDS = poDriver->Create("point_out_cpp.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!poDS) { + printf("Creation of output file failed.\n"); + exit(1); + } + + OGRLayer *poLayer = poDS->CreateLayer("point_out", NULL, wkbPoint, NULL); + if (!poLayer) { + printf("Layer creation failed.\n"); + exit(1); + } + + OGRFieldDefn oField("Name", OFTString); + oField.SetWidth(32); + + if (poLayer->CreateField(&oField) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } + + OGRFeature *poFeature = OGRFeature::CreateFeature(poLayer->GetLayerDefn()); + poFeature->SetField("Name", "conan"); + + OGRPoint pt; + pt.setX(40.74); + pt.setY(-27.891); + poFeature->SetGeometry(&pt); + + if (poLayer->CreateFeature(poFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit( 1 ); + } + + OGRFeature::DestroyFeature(poFeature); + + GDALClose(poDS); + + return 0; +} From b55b8ad5eff7b244ed182e225b6ea0dbe317e975 Mon Sep 17 00:00:00 2001 From: curoky Date: Fri, 23 Sep 2022 00:07:03 +0800 Subject: [PATCH 154/561] (#12962) folly: fix find-package for gflags (#12903) * folly: fix find-packages for gflag * folly: fix find-packages for gflag * folly: fix find-packages for gflag --- .../all/patches/0016-find-packages.patch | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/recipes/folly/all/patches/0016-find-packages.patch b/recipes/folly/all/patches/0016-find-packages.patch index ad83fc73d121c..c6cd14fad52c9 100644 --- a/recipes/folly/all/patches/0016-find-packages.patch +++ b/recipes/folly/all/patches/0016-find-packages.patch @@ -1,8 +1,8 @@ diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index e0e02c0..2bd4940 100644 +index 9c9d9ea60..e78611542 100644 --- a/CMake/folly-deps.cmake +++ b/CMake/folly-deps.cmake -@@ -48,11 +48,11 @@ find_package(Boost 1.51.0 MODULE +@@ -48,25 +48,25 @@ find_package(Boost 1.51.0 MODULE list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) @@ -12,12 +12,19 @@ index e0e02c0..2bd4940 100644 list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) -find_package(Gflags MODULE) +-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) +-if(LIBGFLAGS_FOUND) +- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) +- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY}) +- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR}) +find_package(gflags MODULE) - set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) - if(LIBGFLAGS_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) -@@ -61,12 +61,12 @@ if(LIBGFLAGS_FOUND) - set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR}) ++set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) ++if(gflags_FOUND) ++ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIRS}) ++ set(FOLLY_LIBGFLAGS_LIBRARY ${gflags_LIBRARIES}) ++ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIRS}) endif() -find_package(Glog MODULE) From 5018d384c29b788ffa395291b9cd877c2f103ad2 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 18:28:50 +0200 Subject: [PATCH 155/561] (#13066) tsl-hat-trie: conan v2 support --- recipes/tsl-hat-trie/all/conanfile.py | 36 ++++++++++++------- .../all/test_package/CMakeLists.txt | 11 +++--- .../all/test_package/conanfile.py | 19 +++++++--- .../all/test_v1_package/CMakeLists.txt | 11 ++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++ 5 files changed, 70 insertions(+), 24 deletions(-) create mode 100644 recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-hat-trie/all/test_v1_package/conanfile.py diff --git a/recipes/tsl-hat-trie/all/conanfile.py b/recipes/tsl-hat-trie/all/conanfile.py index 5e966dafd748d..fbce5d32f1f2b 100644 --- a/recipes/tsl-hat-trie/all/conanfile.py +++ b/recipes/tsl-hat-trie/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class TslHatTrieConan(ConanFile): @@ -14,32 +17,38 @@ class TslHatTrieConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): self.requires("tsl-array-hash/0.7.1") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) def build(self): - tools.rmdir(os.path.join(self._source_subfolder, "include", "tsl", "array-hash")) - tools.replace_in_file(os.path.join(self._source_subfolder, "include", "tsl", "htrie_hash.h"), + rmdir(self, os.path.join(self.source_folder, "include", "tsl", "array-hash")) + replace_in_file(self, os.path.join(self.source_folder, "include", "tsl", "htrie_hash.h"), '#include "array-hash/', '#include "tsl/') def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "tsl-hat-trie") self.cpp_info.set_property("cmake_target_name", "tsl::hat_trie") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-hat-trie" @@ -50,3 +59,6 @@ def package_info(self): self.cpp_info.components["hat_trie"].names["cmake_find_package_multi"] = "hat_trie" self.cpp_info.components["hat_trie"].requires = ["tsl-array-hash::array_hash"] self.cpp_info.components["hat_trie"].set_property("cmake_target_name", "tsl::hat_trie") + self.cpp_info.components["hat_trie"].bindirs = [] + self.cpp_info.components["hat_trie"].libdirs = [] + self.cpp_info.components["hat_trie"].resdirs = [] diff --git a/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt b/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt index 29a9a3272ad00..c212bc7cbc125 100644 --- a/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt +++ b/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(tsl-hat-trie REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} tsl::hat_trie) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hat_trie) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hat-trie/all/test_package/conanfile.py b/recipes/tsl-hat-trie/all/test_package/conanfile.py index 1e9df9e32dfbd..0a6bc68712d90 100644 --- a/recipes/tsl-hat-trie/all/test_package/conanfile.py +++ b/recipes/tsl-hat-trie/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt b/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6a1b5a8c7df69 --- /dev/null +++ b/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-hat-trie REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hat_trie) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hat-trie/all/test_v1_package/conanfile.py b/recipes/tsl-hat-trie/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-hat-trie/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) From 2be0e71b74c91f1816caf962b48c7961886f80ac Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 18:45:14 +0200 Subject: [PATCH 156/561] (#13067) tsl-array-hash: conan v2 support --- recipes/tsl-array-hash/all/conanfile.py | 35 +++++++++++++------ .../all/test_package/CMakeLists.txt | 11 +++--- .../all/test_package/conanfile.py | 19 +++++++--- .../all/test_v1_package/CMakeLists.txt | 11 ++++++ .../all/test_v1_package/conanfile.py | 17 +++++++++ 5 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsl-array-hash/all/test_v1_package/conanfile.py diff --git a/recipes/tsl-array-hash/all/conanfile.py b/recipes/tsl-array-hash/all/conanfile.py index cc15f0c529ecd..8c6297fe62672 100644 --- a/recipes/tsl-array-hash/all/conanfile.py +++ b/recipes/tsl-array-hash/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class TslArrayHashConan(ConanFile): @@ -14,24 +17,33 @@ class TslArrayHashConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "tsl-array-hash") self.cpp_info.set_property("cmake_target_name", "tsl::array_hash") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "tsl-array-hash" @@ -41,3 +53,6 @@ def package_info(self): self.cpp_info.components["array_hash"].names["cmake_find_package"] = "array_hash" self.cpp_info.components["array_hash"].names["cmake_find_package_multi"] = "array_hash" self.cpp_info.components["array_hash"].set_property("cmake_target_name", "tsl::array_hash") + self.cpp_info.components["array_hash"].bindirs = [] + self.cpp_info.components["array_hash"].libdirs = [] + self.cpp_info.components["array_hash"].resdirs = [] diff --git a/recipes/tsl-array-hash/all/test_package/CMakeLists.txt b/recipes/tsl-array-hash/all/test_package/CMakeLists.txt index 9618f6b9a037e..813f6130cae26 100644 --- a/recipes/tsl-array-hash/all/test_package/CMakeLists.txt +++ b/recipes/tsl-array-hash/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(tsl-array-hash REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} tsl::array_hash) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::array_hash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-array-hash/all/test_package/conanfile.py b/recipes/tsl-array-hash/all/test_package/conanfile.py index 1e9df9e32dfbd..0a6bc68712d90 100644 --- a/recipes/tsl-array-hash/all/test_package/conanfile.py +++ b/recipes/tsl-array-hash/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt b/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..15d716d7a9505 --- /dev/null +++ b/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsl-array-hash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tsl::array_hash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-array-hash/all/test_v1_package/conanfile.py b/recipes/tsl-array-hash/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1e9df9e32dfbd --- /dev/null +++ b/recipes/tsl-array-hash/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + test_package = os.path.join("bin", "test_package") + self.run(test_package, run_environment=True) From 04737a941e12c22ee5393d4384798045338a0c62 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 19:05:52 +0200 Subject: [PATCH 157/561] (#13069) tsil: conan v2 support --- recipes/tsil/all/CMakeLists.txt | 100 +++++++++--------- recipes/tsil/all/conanfile.py | 80 +++++++------- recipes/tsil/all/test_package/CMakeLists.txt | 7 +- recipes/tsil/all/test_package/conanfile.py | 21 ++-- .../tsil/all/test_v1_package/CMakeLists.txt | 10 ++ recipes/tsil/all/test_v1_package/conanfile.py | 17 +++ 6 files changed, 138 insertions(+), 97 deletions(-) create mode 100644 recipes/tsil/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tsil/all/test_v1_package/conanfile.py diff --git a/recipes/tsil/all/CMakeLists.txt b/recipes/tsil/all/CMakeLists.txt index 5d70658b6ac75..2c6adc0080dcc 100644 --- a/recipes/tsil/all/CMakeLists.txt +++ b/recipes/tsil/all/CMakeLists.txt @@ -1,73 +1,73 @@ cmake_minimum_required(VERSION 3.4) -project(TSIL C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(SOURCE_DIR source_subfolder) +project(TSIL LANGUAGES C) add_library(tsil - ${SOURCE_DIR}/initialize.c - ${SOURCE_DIR}/evaluate.c - ${SOURCE_DIR}/fevaluate.c - ${SOURCE_DIR}/generic.c - ${SOURCE_DIR}/rk6.c - ${SOURCE_DIR}/rk5.c - ${SOURCE_DIR}/functions.c - ${SOURCE_DIR}/dilog.c - ${SOURCE_DIR}/trilog.c - ${SOURCE_DIR}/dBds.c - ${SOURCE_DIR}/dSds.c - ${SOURCE_DIR}/dTds.c - ${SOURCE_DIR}/dUds.c - ${SOURCE_DIR}/dsMds.c - ${SOURCE_DIR}/initB.c - ${SOURCE_DIR}/initS.c - ${SOURCE_DIR}/initT.c - ${SOURCE_DIR}/initU.c - ${SOURCE_DIR}/initV.c - ${SOURCE_DIR}/initM.c - ${SOURCE_DIR}/special.c - ${SOURCE_DIR}/analyticAB.c - ${SOURCE_DIR}/analyticI.c - ${SOURCE_DIR}/analyticS.c - ${SOURCE_DIR}/analyticT.c - ${SOURCE_DIR}/analyticTbar.c - ${SOURCE_DIR}/analyticU.c - ${SOURCE_DIR}/analyticV.c - ${SOURCE_DIR}/analyticM.c - ${SOURCE_DIR}/setTbar.c - ${SOURCE_DIR}/setV.c - ${SOURCE_DIR}/setbold.c - ) + ${TSIL_SRC_DIR}/initialize.c + ${TSIL_SRC_DIR}/evaluate.c + ${TSIL_SRC_DIR}/fevaluate.c + ${TSIL_SRC_DIR}/generic.c + ${TSIL_SRC_DIR}/rk6.c + ${TSIL_SRC_DIR}/rk5.c + ${TSIL_SRC_DIR}/functions.c + ${TSIL_SRC_DIR}/dilog.c + ${TSIL_SRC_DIR}/trilog.c + ${TSIL_SRC_DIR}/dBds.c + ${TSIL_SRC_DIR}/dSds.c + ${TSIL_SRC_DIR}/dTds.c + ${TSIL_SRC_DIR}/dUds.c + ${TSIL_SRC_DIR}/dsMds.c + ${TSIL_SRC_DIR}/initB.c + ${TSIL_SRC_DIR}/initS.c + ${TSIL_SRC_DIR}/initT.c + ${TSIL_SRC_DIR}/initU.c + ${TSIL_SRC_DIR}/initV.c + ${TSIL_SRC_DIR}/initM.c + ${TSIL_SRC_DIR}/special.c + ${TSIL_SRC_DIR}/analyticAB.c + ${TSIL_SRC_DIR}/analyticI.c + ${TSIL_SRC_DIR}/analyticS.c + ${TSIL_SRC_DIR}/analyticT.c + ${TSIL_SRC_DIR}/analyticTbar.c + ${TSIL_SRC_DIR}/analyticU.c + ${TSIL_SRC_DIR}/analyticV.c + ${TSIL_SRC_DIR}/analyticM.c + ${TSIL_SRC_DIR}/setTbar.c + ${TSIL_SRC_DIR}/setV.c + ${TSIL_SRC_DIR}/setbold.c +) -add_executable(tsil.x ${SOURCE_DIR}/basecalc.c) -target_link_libraries(tsil.x tsil m) -set_target_properties(tsil.x PROPERTIES OUTPUT_NAME "tsil") +find_library(LIBM NAMES m) +target_link_libraries(tsil PRIVATE $<$:${LIBM}>) -set(size long CACHE STRING "set floating point data size") -set_property(CACHE size PROPERTY STRINGS long double) +set(TSIL_SIZE long CACHE STRING "set floating point data size") +set_property(CACHE TSIL_SIZE PROPERTY STRINGS long double) -if(size STREQUAL "double") +if(TSIL_SIZE STREQUAL "double") target_compile_definitions(tsil PUBLIC TSIL_SIZE_DOUBLE) -elseif(size STREQUAL "long") +elseif(TSIL_SIZE STREQUAL "long") target_compile_definitions(tsil PUBLIC TSIL_SIZE_LONG) else() message(FATAL_ERROR "You must set size to either double or long") endif() -message(STATUS "Using size: ${size}") +message(STATUS "Using size: ${TSIL_SIZE}") install( FILES - "${SOURCE_DIR}/tsil.h" - "${SOURCE_DIR}/tsil_cpp.h" + "${TSIL_SRC_DIR}/tsil.h" + "${TSIL_SRC_DIR}/tsil_cpp.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) install( - TARGETS tsil tsil.x + TARGETS tsil ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + +add_executable(tsil.x ${TSIL_SRC_DIR}/basecalc.c) +target_link_libraries(tsil.x PRIVATE tsil) +set_target_properties(tsil.x PROPERTIES OUTPUT_NAME "tsil" RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + +install(TARGETS tsil.x DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/recipes/tsil/all/conanfile.py b/recipes/tsil/all/conanfile.py index 3596a1b741488..81d982b72282a 100644 --- a/recipes/tsil/all/conanfile.py +++ b/recipes/tsil/all/conanfile.py @@ -1,8 +1,11 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.microsoft import is_msvc import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class TsilConan(ConanFile): @@ -11,29 +14,21 @@ class TsilConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.niu.edu/spmartin/TSIL/" description = "Two-loop Self-energy Integral Library" - topics = ("conan", "high-energy", "physics", "hep", "two-loop", "integrals") - settings = "os", "compiler", "build_type", "arch" + topics = ("high-energy", "physics", "hep", "two-loop", "integrals") + + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "size": ["long", "double"] + "size": ["long", "double"], } default_options = { "shared": False, "fPIC": True, - "size": "long" + "size": "long", } - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + exports_sources = "CMakeLists.txt" @property def _tsil_size(self): @@ -45,34 +40,44 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("TSIL does not support {}".format(self.settings.compiler)) + if is_msvc(self): + raise ConanInvalidConfiguration(f"TSIL does not support {self.settings.compiler}") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["size"] = self.options.size - self._cmake.definitions["CMAKE_MACOSX_BUNDLE"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TSIL_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["TSIL_SIZE"] = self.options.size + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): @@ -81,6 +86,7 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/tsil/all/test_package/CMakeLists.txt b/recipes/tsil/all/test_package/CMakeLists.txt index 546c16acea82b..48214718fc55d 100644 --- a/recipes/tsil/all/test_package/CMakeLists.txt +++ b/recipes/tsil/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(PackageTest C) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(tsil REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package CONAN_PKG::tsil) +target_link_libraries(test_package PRIVATE tsil::tsil) diff --git a/recipes/tsil/all/test_package/conanfile.py b/recipes/tsil/all/test_package/conanfile.py index 23559dca88d0c..0a6bc68712d90 100644 --- a/recipes/tsil/all/test_package/conanfile.py +++ b/recipes/tsil/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" -class TsilTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = ["cmake"] + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tsil/all/test_v1_package/CMakeLists.txt b/recipes/tsil/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..141659813702c --- /dev/null +++ b/recipes/tsil/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tsil REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.c) +target_link_libraries(test_package PRIVATE tsil::tsil) diff --git a/recipes/tsil/all/test_v1_package/conanfile.py b/recipes/tsil/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tsil/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 2e32f2557cde61649f16dc8075a41e8e01d6ae83 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 22 Sep 2022 19:25:10 +0200 Subject: [PATCH 158/561] (#13070) trompeloeil: conan v2 support --- recipes/trompeloeil/all/conanfile.py | 43 +++++++++++++------ .../all/test_package/CMakeLists.txt | 13 +++--- .../trompeloeil/all/test_package/conanfile.py | 21 ++++++--- .../{example.cpp => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 11 +++++ .../all/test_v1_package/conanfile.py | 17 ++++++++ 6 files changed, 77 insertions(+), 28 deletions(-) rename recipes/trompeloeil/all/test_package/{example.cpp => test_package.cpp} (100%) create mode 100644 recipes/trompeloeil/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/trompeloeil/all/test_v1_package/conanfile.py diff --git a/recipes/trompeloeil/all/conanfile.py b/recipes/trompeloeil/all/conanfile.py index 9bcce64548e1d..c2548bfe997b8 100644 --- a/recipes/trompeloeil/all/conanfile.py +++ b/recipes/trompeloeil/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" + class TrompeloeilConan(ConanFile): name = "trompeloeil" @@ -10,22 +14,33 @@ class TrompeloeilConan(ConanFile): homepage = "https://github.com/rollbear/trompeloeil" url = "https://github.com/conan-io/conan-center-index" license = "BSL-1.0" - settings = "os", "compiler", "build_type", "arch" - + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - include_folder = os.path.join(self._source_subfolder, "include") - self.copy(pattern="LICENSE*.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", dst="include", src=include_folder) + copy(self, "LICENSE*.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "trompeloeil") + self.cpp_info.set_property("cmake_target_name", "trompeloeil::trompeloeil") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/trompeloeil/all/test_package/CMakeLists.txt b/recipes/trompeloeil/all/test_package/CMakeLists.txt index 9188e664fcbab..ecb1ebf14da1c 100644 --- a/recipes/trompeloeil/all/test_package/CMakeLists.txt +++ b/recipes/trompeloeil/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(trompeloeil REQUIRED) -add_executable(test_package example.cpp) -target_link_libraries(test_package trompeloeil::trompeloeil) -set_property(TARGET test_package PROPERTY CXX_STANDARD 14) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE trompeloeil::trompeloeil) +target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/recipes/trompeloeil/all/test_package/conanfile.py b/recipes/trompeloeil/all/test_package/conanfile.py index 3da371b660e0a..0a6bc68712d90 100644 --- a/recipes/trompeloeil/all/test_package/conanfile.py +++ b/recipes/trompeloeil/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/trompeloeil/all/test_package/example.cpp b/recipes/trompeloeil/all/test_package/test_package.cpp similarity index 100% rename from recipes/trompeloeil/all/test_package/example.cpp rename to recipes/trompeloeil/all/test_package/test_package.cpp diff --git a/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt b/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..328f7742d99d6 --- /dev/null +++ b/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(trompeloeil REQUIRED) + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE trompeloeil::trompeloeil) +target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/recipes/trompeloeil/all/test_v1_package/conanfile.py b/recipes/trompeloeil/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/trompeloeil/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 3aab2c975f59ea17639b1edb01595f4efedf0997 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 19:46:09 +0200 Subject: [PATCH 159/561] (#13078) xorg-proto 2022.2 --- recipes/xorg-proto/all/conandata.yml | 3 +++ recipes/xorg-proto/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/xorg-proto/all/conandata.yml b/recipes/xorg-proto/all/conandata.yml index f23edcc216fbf..a78c2d2c2da43 100644 --- a/recipes/xorg-proto/all/conandata.yml +++ b/recipes/xorg-proto/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2022.2": + url: "https://www.x.org/releases/individual/proto/xorgproto-2022.2.tar.gz" + sha256: "da351a403d07a7006d7bdc8dcfc14ddc1b588b38fb81adab9989a8eef605757b" "2021.4": url: "https://www.x.org/releases/individual/proto/xorgproto-2021.4.tar.gz" sha256: "9de0babd3d8cb16b0c1c47b8389a52f3e1326bb0bc9a9ab34a9500778448a2bd" diff --git a/recipes/xorg-proto/config.yml b/recipes/xorg-proto/config.yml index e586020e72036..2928e57dc1b28 100644 --- a/recipes/xorg-proto/config.yml +++ b/recipes/xorg-proto/config.yml @@ -1,3 +1,5 @@ versions: + "2022.2": + folder: "all" "2021.4": folder: "all" From 94578410995e78a3908f45abf504926e05278c33 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 20:05:50 +0200 Subject: [PATCH 160/561] (#13079) srawberryperl 5.32.1.1 --- recipes/strawberryperl/all/conandata.yml | 7 +++++++ recipes/strawberryperl/config.yml | 2 ++ 2 files changed, 9 insertions(+) diff --git a/recipes/strawberryperl/all/conandata.yml b/recipes/strawberryperl/all/conandata.yml index dc29ec4938022..9652ba8327657 100644 --- a/recipes/strawberryperl/all/conandata.yml +++ b/recipes/strawberryperl/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "5.32.1.1": + x86: + url: "http://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit-portable.zip" + sha256: "d9c5711d12573a0f6d977792caa58364b1d46217521ae5c25cf5cc378a7c23c0" + x86_64: + url: "http://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit-portable.zip" + sha256: "692646105b0f5e058198a852dc52a48f1cebcaf676d63bbdeae12f4eaee9bf5c" "5.30.0.1": x86: url: "http://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit-portable.zip" diff --git a/recipes/strawberryperl/config.yml b/recipes/strawberryperl/config.yml index 4efddcd9dd418..11c21ecefe1e6 100644 --- a/recipes/strawberryperl/config.yml +++ b/recipes/strawberryperl/config.yml @@ -1,4 +1,6 @@ versions: + "5.32.1.1": + folder: all "5.30.0.1": folder: all "5.28.1.1": From d17ddd31187a44c3d14f9a2eed9fae1add88b471 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 20:27:08 +0200 Subject: [PATCH 161/561] (#13081) pkgconf/1.9.3 --- recipes/pkgconf/all/conandata.yml | 6 ++++++ ...KG_CONF_PATH-allow-colon+semicolon-separator.patch | 11 +++++++++++ recipes/pkgconf/config.yml | 4 +++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 recipes/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch diff --git a/recipes/pkgconf/all/conandata.yml b/recipes/pkgconf/all/conandata.yml index 6d3e3854ac1ed..7616abd9442f1 100644 --- a/recipes/pkgconf/all/conandata.yml +++ b/recipes/pkgconf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.9.3": + url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.9.3.tar.xz" + sha256: "5fb355b487d54fb6d341e4f18d4e2f7e813a6622cf03a9e87affa6a40565699d" "1.7.4": url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.4.tar.xz" sha256: "d73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab" @@ -6,6 +9,9 @@ sources: url: "https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.3.tar.xz" sha256: "b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0" patches: + "1.9.3": + - patch_file: "patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" + base_path: "source_subfolder" "1.7.4": - patch_file: "patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch" base_path: "source_subfolder" diff --git a/recipes/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/recipes/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000000000..8c6738a233a52 --- /dev/null +++ b/recipes/pkgconf/all/patches/1.9.3-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -138,7 +138,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ":;")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/recipes/pkgconf/config.yml b/recipes/pkgconf/config.yml index abd512535e029..9816b088e4d7b 100644 --- a/recipes/pkgconf/config.yml +++ b/recipes/pkgconf/config.yml @@ -1,5 +1,7 @@ versions: - "1.7.3": + "1.9.3": folder: "all" "1.7.4": folder: "all" + "1.7.3": + folder: "all" From 5347eabc29d75bc7d017998904d63a8388c264f7 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 20:44:46 +0200 Subject: [PATCH 162/561] (#13083) nspr/4.35 --- recipes/nspr/all/conandata.yml | 3 +++ recipes/nspr/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/nspr/all/conandata.yml b/recipes/nspr/all/conandata.yml index c7a9539834aa3..d2ac3c69dc0ae 100644 --- a/recipes/nspr/all/conandata.yml +++ b/recipes/nspr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.35": + url: "https://ftp.mozilla.org/pub/nspr/releases/v4.35/src/nspr-4.35.tar.gz" + sha256: "7ea3297ea5969b5d25a5dd8d47f2443cda88e9ee746301f6e1e1426f8a6abc8f" "4.33": url: "https://ftp.mozilla.org/pub/nspr/releases/v4.33/src/nspr-4.33.tar.gz" sha256: "b23ee315be0e50c2fb1aa374d17f2d2d9146a835b1a79c1918ea15d075a693d7" diff --git a/recipes/nspr/config.yml b/recipes/nspr/config.yml index e2aac52e9a538..d437dc203c15e 100644 --- a/recipes/nspr/config.yml +++ b/recipes/nspr/config.yml @@ -1,4 +1,6 @@ versions: + "4.35": + folder: all "4.33": folder: all "4.32": From b9e997d8954fc5a3266b0dcb3e3593f6e3b1ea13 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 21:04:47 +0200 Subject: [PATCH 163/561] (#13085) libpq/14.5 --- recipes/libpq/all/conandata.yml | 18 +++--------------- recipes/libpq/config.yml | 12 ++---------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index c963d2f1693a5..aee7eccdfda63 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -1,31 +1,19 @@ sources: + "14.5": + url: "https://ftp.postgresql.org/pub/source/v14.5/postgresql-14.5.tar.bz2" + sha256: "d4f72cb5fb857c9a9f75ec8cf091a1771272802f2178f0b2e65b7b6ff64f4a30" "14.2": url: "https://ftp.postgresql.org/pub/source/v14.2/postgresql-14.2.tar.bz2" sha256: "2cf78b2e468912f8101d695db5340cf313c2e9f68a612fb71427524e8c9a977a" "13.6": url: "https://ftp.postgresql.org/pub/source/v13.6/postgresql-13.6.tar.gz" sha256: "42dcde620b627d35bf51dfc2c1d0f7f25f44d3dbedd81cc459da2d2c9e859059" - "13.4": - url: "https://ftp.postgresql.org/pub/source/v13.4/postgresql-13.4.tar.gz" - sha256: "59d7bc523e78570c549876fed297ec3e46dd307e90f5b1d22f49181191cf203e" - "13.3": - url: "https://ftp.postgresql.org/pub/source/v13.3/postgresql-13.3.tar.gz" - sha256: "0b54a8a68dbfaf5dcddd89eb3922740143df50fbea02fefda8de743d8af99516" - "13.2": - url: "https://ftp.postgresql.org/pub/source/v13.2/postgresql-13.2.tar.gz" - sha256: "3386a40736332aceb055c7c9012ecc665188536d874d967fcc5a33e7992f8080" "12.10": url: "https://ftp.postgresql.org/pub/source/v12.10/postgresql-12.10.tar.gz" sha256: "987e008699d52d5de4bae0580416f6c75aa28016b11543c42f5fbde5efbdfb56" - "12.2": - url: "https://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.gz" - sha256: "8808449444ee9b086054a6dcfbfb98029e4f8022372c2edf3de5b6d8f417c8e4" "11.15": url: "https://ftp.postgresql.org/pub/source/v11.15/postgresql-11.15.tar.gz" sha256: "5f6ef2add1acb93d69012a55c3f276b91f4f0c91aa9a91243d9c5737ed5b5541" - "11.9": - url: "https://ftp.postgresql.org/pub/source/v11.9/postgresql-11.9.tar.gz" - sha256: "e98a8649814e2fa632a5d86bfb91f1ad570d47b108bc5c0d0d854803282abb03" "10.20": url: "https://ftp.postgresql.org/pub/source/v10.20/postgresql-10.20.tar.gz" sha256: "403bdad47101f7c0a15824627dd0fa0ad4abf1fa26d2bde77dea8921da25a48e" diff --git a/recipes/libpq/config.yml b/recipes/libpq/config.yml index 3c16a63a04d1d..a2b649a937afd 100644 --- a/recipes/libpq/config.yml +++ b/recipes/libpq/config.yml @@ -1,22 +1,14 @@ versions: + "14.5": + folder: all "14.2": folder: all "13.6": folder: all - "13.4": - folder: all - "13.3": - folder: all - "13.2": - folder: all "12.10": folder: all - "12.2": - folder: all "11.15": folder: all - "11.9": - folder: all "10.20": folder: all "9.6.24": From 8a7415e8b451ccb6b966cf4bc3718e0e1b6e4bf8 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Sep 2022 21:24:47 +0200 Subject: [PATCH 164/561] (#13087) libjpeg/9e --- recipes/libjpeg/all/conandata.yml | 6 ++ ...0001-9e-libjpeg-add-msvc-dll-support.patch | 92 +++++++++++++++++++ recipes/libjpeg/config.yml | 2 + 3 files changed, 100 insertions(+) create mode 100644 recipes/libjpeg/all/patches/0001-9e-libjpeg-add-msvc-dll-support.patch diff --git a/recipes/libjpeg/all/conandata.yml b/recipes/libjpeg/all/conandata.yml index a44bc5bf6378b..62cabbedb4b8c 100644 --- a/recipes/libjpeg/all/conandata.yml +++ b/recipes/libjpeg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9e": + url: "http://ijg.org/files/jpegsrc.v9e.tar.gz" + sha256: "4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d" "9d": url: "http://ijg.org/files/jpegsrc.v9d.tar.gz" sha256: "2303a6acfb6cc533e0e86e8a9d29f7e6079e118b9de3f96e07a71a11c082fa6a" @@ -6,6 +9,9 @@ sources: url: "http://ijg.org/files/jpegsrc.v9c.tar.gz" sha256: "682aee469c3ca857c4c38c37a6edadbfca4b04d42e56613b11590ec6aa4a278d" patches: + "9e": + - patch_file: "patches/0001-9e-libjpeg-add-msvc-dll-support.patch" + base_path: "source_subfolder" "9d": - patch_file: "patches/0001-libjpeg-add-msvc-dll-support.patch" base_path: "source_subfolder" diff --git a/recipes/libjpeg/all/patches/0001-9e-libjpeg-add-msvc-dll-support.patch b/recipes/libjpeg/all/patches/0001-9e-libjpeg-add-msvc-dll-support.patch new file mode 100644 index 0000000000000..c3f634ab1ed84 --- /dev/null +++ b/recipes/libjpeg/all/patches/0001-9e-libjpeg-add-msvc-dll-support.patch @@ -0,0 +1,92 @@ +--- jmorecfg.h ++++ jmorecfg.h +@@ -238,14 +238,26 @@ + * or code profilers that require it. + */ + ++#if defined(_MSC_VER) ++#if defined(LIBJPEG_STATIC) ++#define LIBJPEG_EXPORTS ++#elif !defined(LIBJPEG_BUILDING) ++#define LIBJPEG_EXPORTS __declspec(dllimport) ++#else ++#define LIBJPEG_EXPORTS __declspec(dllexport) ++#endif ++#else ++#define LIBJPEG_EXPORTS ++#endif ++ + /* a function called through method pointers: */ + #define METHODDEF(type) static type + /* a function used only in its module: */ + #define LOCAL(type) static type + /* a function referenced thru EXTERNs: */ +-#define GLOBAL(type) type ++#define GLOBAL(type) LIBJPEG_EXPORTS type + /* a reference to a GLOBAL function: */ +-#define EXTERN(type) extern type ++#define EXTERN(type) extern GLOBAL(type) + + + /* This macro is used to declare a "method", that is, a function pointer. + +--- makefile.vc ++++ makefile.vc +@@ -30,6 +30,7 @@ + # miscellaneous OS-dependent stuff + # file deletion command + RM= del ++MKDIR=mkdir + + # End of configurable options. + +@@ -108,20 +109,30 @@ + $(cc) $(CFLAGS) $*.c + + +-all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe ++all: shared/libjpeg.lib static/libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +-libjpeg.lib: $(LIBOBJECTS) +- $(RM) libjpeg.lib +- lib -out:libjpeg.lib $(LIBOBJECTS) ++shared: ++ $(MKDIR) shared ++ ++static: ++ $(MKDIR) static ++ ++static/libjpeg.lib: $(LIBOBJECTS) static ++ $(RM) static\libjpeg.lib ++ lib -out:static/libjpeg.lib $(LIBOBJECTS) ++ ++shared/libjpeg.lib shared/libjpeg-9.dll: $(LIBOBJECTS) shared ++ $(RM) shared\libjpeg.lib shared\libjpeg-9.dll ++ link -DLL -out:shared/libjpeg-9.dll -implib:shared/libjpeg.lib $(LIBOBJECTS) + +-cjpeg.exe: $(COBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) libjpeg.lib $(LDLIBS) ++cjpeg.exe: $(COBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) static/libjpeg.lib $(LDLIBS) + +-djpeg.exe: $(DOBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) libjpeg.lib $(LDLIBS) ++djpeg.exe: $(DOBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) static/libjpeg.lib $(LDLIBS) + +-jpegtran.exe: $(TROBJECTS) libjpeg.lib +- $(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) libjpeg.lib $(LDLIBS) ++jpegtran.exe: $(TROBJECTS) static/libjpeg.lib ++ $(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) static/libjpeg.lib $(LDLIBS) + + rdjpgcom.exe: rdjpgcom.obj + $(link) $(LDFLAGS) -out:rdjpgcom.exe rdjpgcom.obj $(LDLIBS) +@@ -131,7 +142,7 @@ + + + clean: +- $(RM) *.obj *.exe libjpeg.lib ++ $(RM) *.obj *.exe static\libjpeg.lib shared\libjpeg.lib shared\libjpeg-9.dll + $(RM) testout* + + setup-vc6: diff --git a/recipes/libjpeg/config.yml b/recipes/libjpeg/config.yml index 2c707deb1831f..6c44911f307cd 100644 --- a/recipes/libjpeg/config.yml +++ b/recipes/libjpeg/config.yml @@ -1,4 +1,6 @@ versions: + "9e": + folder: all "9d": folder: all "9c": From 5205eacc41a1288891c9752e2d6a5c2b1b20ece5 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 23 Sep 2022 04:44:40 +0900 Subject: [PATCH 165/561] (#13100) unordered_dense: add version 1.3.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/unordered_dense/all/conandata.yml | 3 +++ recipes/unordered_dense/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml index 20529e1ed3dc8..c59ee1921274b 100644 --- a/recipes/unordered_dense/all/conandata.yml +++ b/recipes/unordered_dense/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.2": + url: "https://github.com/martinus/unordered_dense/archive/v1.3.2.tar.gz" + sha256: "f12db3b93f31f7f20f4d8cac6adc551f6ae17a5b9a16040abeee427f54427953" "1.3.1": url: "https://github.com/martinus/unordered_dense/archive/refs/tags/v1.3.1.tar.gz" sha256: "d393168833d6609c9eaf54a05b19fc3120f68b85feffb282ab225119a86df1d4" diff --git a/recipes/unordered_dense/config.yml b/recipes/unordered_dense/config.yml index 59334d5077368..4977bb7915a7c 100644 --- a/recipes/unordered_dense/config.yml +++ b/recipes/unordered_dense/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.2": + folder: all "1.3.1": folder: all From 6c01a2b649c227d933d49991fa830118980a8804 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 23 Sep 2022 03:04:41 +0200 Subject: [PATCH 166/561] (#13093) [templates] Use Conan 1.52.0 feature * Use Conan 1.52.0 feature Signed-off-by: Uilian Ries * Fix required version Signed-off-by: Uilian Ries --- docs/package_templates/autotools_package/all/conanfile.py | 7 +++---- docs/package_templates/cmake_package/all/conanfile.py | 7 +++---- docs/package_templates/header_only/all/conanfile.py | 7 +++---- docs/package_templates/msbuild_package/all/conanfile.py | 7 +++---- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 8b10c37d53331..6f71bb9b45ca6 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -2,13 +2,13 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.build import check_min_cppstd, cross_building -from conan.tools.files import copy, get, rm, rmdir, apply_conandata_patches +from conan.tools.files import copy, get, rm, rmdir, apply_conandata_patches, export_conandata_patches from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class PackageConan(ConanFile): @@ -33,8 +33,7 @@ class PackageConan(ConanFile): # no exports_sources attribute, but export_sources(self) method instead # this allows finer grain exportation of patches per version def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index c7fe8fbf73634..2e937d45fe90e 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc_static_runtime, is_msvc -from conan.tools.files import apply_conandata_patches, get, copy, rm, rmdir, replace_in_file +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 @@ -9,7 +9,7 @@ import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class PackageConan(ConanFile): @@ -46,8 +46,7 @@ def _compilers_minimum_version(self): # no exports_sources attribute, but export_sources(self) method instead # this allows finer grain exportation of patches per version def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index 4d9370bad1f91..96ae97d1ec8d6 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, get, copy +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class PackageConan(ConanFile): @@ -38,8 +38,7 @@ def _compilers_minimum_version(self): # no exports_sources attribute, but export_sources(self) method instead # this allows finer grain exportation of patches per version def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def layout(self): # src_folder must use the same source folder name the project diff --git a/docs/package_templates/msbuild_package/all/conanfile.py b/docs/package_templates/msbuild_package/all/conanfile.py index 42c754733c1a9..cc1c13ec4b812 100644 --- a/docs/package_templates/msbuild_package/all/conanfile.py +++ b/docs/package_templates/msbuild_package/all/conanfile.py @@ -2,11 +2,11 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, MSBuildDeps, MSBuildToolchain, MSBuild, VCVars from conan.tools.layout import vs_layout -from conan.tools.files import apply_conandata_patches, get, copy, rm, replace_in_file +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, replace_in_file import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class PackageConan(ConanFile): @@ -29,8 +29,7 @@ class PackageConan(ConanFile): # no exports_sources attribute, but export_sources(self) method instead # this allows finer grain exportation of patches per version def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": From 613615ff1f93101d3def73e7d9329a7e490c95ce Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 23 Sep 2022 14:44:21 +0900 Subject: [PATCH 167/561] (#12964) eternal: add recipe * eternal: add recipe * remove comment * add limits header * remove apply_conandata_patches Co-authored-by: Chris Mc * fix msvc version number Co-authored-by: Chris Mc --- recipes/eternal/all/conandata.yml | 4 ++ recipes/eternal/all/conanfile.py | 69 +++++++++++++++++++ .../eternal/all/test_package/CMakeLists.txt | 9 +++ recipes/eternal/all/test_package/conanfile.py | 26 +++++++ .../eternal/all/test_package/test_package.cpp | 41 +++++++++++ .../all/test_v1_package/CMakeLists.txt | 12 ++++ .../eternal/all/test_v1_package/conanfile.py | 18 +++++ recipes/eternal/config.yml | 3 + 8 files changed, 182 insertions(+) create mode 100644 recipes/eternal/all/conandata.yml create mode 100644 recipes/eternal/all/conanfile.py create mode 100644 recipes/eternal/all/test_package/CMakeLists.txt create mode 100644 recipes/eternal/all/test_package/conanfile.py create mode 100644 recipes/eternal/all/test_package/test_package.cpp create mode 100644 recipes/eternal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/eternal/all/test_v1_package/conanfile.py create mode 100644 recipes/eternal/config.yml diff --git a/recipes/eternal/all/conandata.yml b/recipes/eternal/all/conandata.yml new file mode 100644 index 0000000000000..8214ea0955a49 --- /dev/null +++ b/recipes/eternal/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.1": + url: "https://github.com/mapbox/eternal/archive/refs/tags/v1.0.1.tar.gz" + sha256: "7d799381b3786d0bd987eea75df2a81f581a64ee962e922a2f7a7d3d0c3d0421" diff --git a/recipes/eternal/all/conanfile.py b/recipes/eternal/all/conanfile.py new file mode 100644 index 0000000000000..fd3a53c2138bb --- /dev/null +++ b/recipes/eternal/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.51.3" + + +class EternalConan(ConanFile): + name = "eternal" + description = "A C++14 compile-time/constexpr map and hash map with minimal binary footprint" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mapbox/eternal" + topics = ("hashing", "map", "constexpr", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "5", + "clang": "4", + "apple-clang": "10", + } + + def export_sources(self): + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.hpp", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/eternal/all/test_package/CMakeLists.txt b/recipes/eternal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8d5920de9d2e0 --- /dev/null +++ b/recipes/eternal/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(eternal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE eternal::eternal) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/eternal/all/test_package/conanfile.py b/recipes/eternal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/eternal/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/eternal/all/test_package/test_package.cpp b/recipes/eternal/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..11565bc6294ec --- /dev/null +++ b/recipes/eternal/all/test_package/test_package.cpp @@ -0,0 +1,41 @@ +#include +#include +#include + +#include "mapbox/eternal.hpp" + +struct Color { + constexpr inline Color() { + } + constexpr inline Color(unsigned char r_, unsigned char g_, unsigned char b_, float a_) + : r(r_), g(g_), b(b_), a(a_ > 1 ? 1 : a_ < 0 ? 0 : a_) { + } + unsigned char r = 0, g = 0, b = 0; + float a = 1.0f; + + constexpr bool operator==(const Color& rhs) const { + return r == rhs.r && g == rhs.g && b == rhs.b && + (a >= rhs.a ? a - rhs.a : rhs.a - a) < std::numeric_limits::epsilon(); + } +}; + +MAPBOX_ETERNAL_CONSTEXPR const auto multi_colors = mapbox::eternal::map({ + { "red", { 255, 0, 0, 1 } }, + { "yellow", { 255, 255, 0, 1 } }, + { "white", { 255, 255, 255, 1 } }, // comes before yellow! + { "yellow", { 255, 220, 0, 1 } }, // a darker yellow +}); + +int main(void) { + static_assert(!multi_colors.unique(), "multi_colors are not unique"); + static_assert(multi_colors.find("yellow") != multi_colors.end(), "colors contains yellow"); + static_assert(multi_colors.find("yellow")->second == Color(255, 255, 0, 1), "yellow returns the correct color"); + static_assert((++multi_colors.find("yellow"))->second == Color(255, 220, 0, 1), "yellow returns the correct color"); + static_assert(multi_colors.equal_range("white").first == multi_colors.find("white"), "white range returns the correct begin"); + static_assert(multi_colors.equal_range("white").second == multi_colors.find("yellow"), "white range end is the next color"); + static_assert(multi_colors.equal_range("yellow").first == multi_colors.find("yellow"), "yellow range returns the correct begin"); + static_assert(multi_colors.equal_range("yellow").second == multi_colors.end(), "yellow range end returns end"); + static_assert(multi_colors.count("yellow") == 2, "has 2 yellows"); + + return EXIT_SUCCESS; +} diff --git a/recipes/eternal/all/test_v1_package/CMakeLists.txt b/recipes/eternal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e900db203f73f --- /dev/null +++ b/recipes/eternal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(eternal REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE eternal::eternal) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/eternal/all/test_v1_package/conanfile.py b/recipes/eternal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/eternal/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/eternal/config.yml b/recipes/eternal/config.yml new file mode 100644 index 0000000000000..715e55357a17b --- /dev/null +++ b/recipes/eternal/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: all From 18a594de67e7662b53cbccbab67e77da69f6e2fc Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 23 Sep 2022 01:25:23 -0700 Subject: [PATCH 168/561] (#13103) docs: use export_conandata_patches --- docs/how_to_add_packages.md | 11 +++++------ docs/reviewing.md | 5 ++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/how_to_add_packages.md b/docs/how_to_add_packages.md index 1fe2b11941674..a1c49c304fce3 100644 --- a/docs/how_to_add_packages.md +++ b/docs/how_to_add_packages.md @@ -126,8 +126,7 @@ Inside the `conanfile.py` recipe, this data is available in a `self.conan_data` ```py def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - files.copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def source(self): files.get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -142,8 +141,8 @@ More details can be found in the [reviewing preference](reviewing.md) documentat ### The _recipe folder_: `conanfile.py` The main files in this repository are the `conanfile.py` ones that contain the logic to build the libraries from sources for all the configurations, -as we said before there can be one single recipe suitable for all the versions inside the `all` folder, or there can be several recipes targetting -different versions in different folders. For mainteinance reasons, we prefer to have only one recipe, but sometimes the extra effort doesn't worth +as we said before there can be one single recipe suitable for all the versions inside the `all` folder, or there can be several recipes targeting +different versions in different folders. For maintenance reasons, we prefer to have only one recipe, but sometimes the extra effort doesn't worth it and it makes sense to split and duplicate it, there is no common rule for it. Together with the recipe, there can be other files that are needed to build the library: patches, other files related to build systems, @@ -188,12 +187,12 @@ project files as simple as possible, without the need of extra logic to handle d The CI will explore all the folders and run the tests for the ones matching `test_*/conanfile.py` pattern. You can find the output of all of them together in the testing logs. -> **Note.-** If, for any reason, it is useful to write a test that should only be checked using Conan v1, you can do so by using the pattern +> **Note**: If, for any reason, it is useful to write a test that should only be checked using Conan v1, you can do so by using the pattern > `test_v1_*/conanfile.py` for the folder. Please, have a look to [linter notes](v2_linter.md) to know how to prevent the linter from > checking these files. > Remember that the `test_` recipes should **test the package configuration that has just been generated** for the _host_ context, otherwise -> it will fail in crossbuilding scenarios. +> it will fail in cross-building scenarios. ## How to provide a good recipe diff --git a/docs/reviewing.md b/docs/reviewing.md index bc361058481c6..d830691bd757f 100644 --- a/docs/reviewing.md +++ b/docs/reviewing.md @@ -91,15 +91,14 @@ Where the SPDX guidelines do not apply, packages should do the following: ## Exporting Patches -It's ideal to minimize the number of files in a package the exactly whats required. When recipes support multiple versions with differing patches it's strongly encourged to only export the patches that are being used for that given recipe. +It's ideal to minimize the number of files in a package the exactly whats required. When recipes support multiple versions with differing patches it's strongly encouraged to only export the patches that are being used for that given recipe. Make sure the `export_sources` attribute is replaced by the following: ```py def export_sources(self): self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) ``` ## Applying Patches From 9468c97456b66984dd71f8fe50a67a0d8b712f92 Mon Sep 17 00:00:00 2001 From: Kim Lindberger Date: Fri, 23 Sep 2022 10:44:15 +0200 Subject: [PATCH 169/561] (#12390) [tensorflow-lite] Update to 2.10.0, prepare for Conan v2, use the new CMake build helpers * [tensorflow-lite] Prepare for Conan v2, use the new CMake build helpers * [tensorflow-lite] Reorder and simplify patches * [tensorflow-lite] Remove 2.6.x series and update compiler requirements * [tensorflow-lite] Don't use collect_libs * [tensorflow-lite] Update tests Imported from https://github.com/conan-io/conan-center-index/pull/12686 * [tensorflow-lite] Don't remove pdb files (no need) * [tensorflow-lite] Use export_conandata_patches() * [tensorflow-lite] self.copy() -> tools.files.copy() * [tensorflow-lite] abseil: 20211102.0 -> 20220623.0 * [tensorflow-lite] Minor test_package fixes * [tensorflow-lite] Add layout() * [tensorflow-lite] Remove unnecessary destination arg to get() * [tensorflow-lite] Update missed reference to C++14 * [tensorflow-lite] Don't use export_conandata_patches * [tensorflow-lite] 2.9.1 -> 2.10.0 * Revert "[tensorflow-lite] Add layout()" This reverts commit 4740f6b1085307ba4eb82f6cb13b5151c8a45ce7. layout() breaks windows build. * [tensorflow-lite] Add missing dependency patch * [tensorflow-lite] Move methods * [tensorflow-lite] Re-add layout() with windows build workaround * [tensorflow-lite] Change back to using source_folder in test_v1 * [tensorflow-lite] Put the dll in the bin output folder... ...and be a bit stricter about which file patterns to copy. * Revert "[tensorflow-lite] Don't use export_conandata_patches" This reverts commit 1d946d8ef5cae5f97ab8a6c0ba059ffb06063e4b. * [tensorflow-lite] Don't use self in static method * [tensorflow-lite] Refactor layout() * [tensorflow-lite] self.settings -> self.info.settings in validate() * [tensorflow-lite] Explicitly specify source destination folder --- recipes/tensorflow-lite/all/CMakeLists.txt | 7 - recipes/tensorflow-lite/all/conandata.yml | 34 +--- recipes/tensorflow-lite/all/conanfile.py | 116 +++++++------ ...cies_2_9.patch => dependencies_2_10.patch} | 41 ++--- .../all/patches/dependencies_2_6.patch | 81 --------- .../all/patches/disable_fetch_content.patch | 12 ++ .../all/patches/msvc_fixes.patch | 155 ------------------ ...emove_simple_memory_arena_debug_dump.patch | 4 +- .../all/test_package/CMakeLists.txt | 5 +- .../all/test_package/conanfile.py | 19 ++- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 19 +++ recipes/tensorflow-lite/config.yml | 6 +- 13 files changed, 136 insertions(+), 374 deletions(-) delete mode 100644 recipes/tensorflow-lite/all/CMakeLists.txt rename recipes/tensorflow-lite/all/patches/{dependencies_2_9.patch => dependencies_2_10.patch} (60%) delete mode 100644 recipes/tensorflow-lite/all/patches/dependencies_2_6.patch create mode 100644 recipes/tensorflow-lite/all/patches/disable_fetch_content.patch delete mode 100644 recipes/tensorflow-lite/all/patches/msvc_fixes.patch create mode 100644 recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tensorflow-lite/all/test_v1_package/conanfile.py diff --git a/recipes/tensorflow-lite/all/CMakeLists.txt b/recipes/tensorflow-lite/all/CMakeLists.txt deleted file mode 100644 index 57b8c78f33a5b..0000000000000 --- a/recipes/tensorflow-lite/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/../conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("src/tensorflow/lite") diff --git a/recipes/tensorflow-lite/all/conandata.yml b/recipes/tensorflow-lite/all/conandata.yml index 1e50dbd6e75e1..42304f36f76b1 100644 --- a/recipes/tensorflow-lite/all/conandata.yml +++ b/recipes/tensorflow-lite/all/conandata.yml @@ -1,34 +1,14 @@ sources: - "2.6.0": - url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.6.0.tar.gz" - sha256: "41b32eeaddcbc02b0583660bcf508469550e4cd0f86b22d2abe72dfebeacde0f" - "2.6.2": - url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.6.2.tar.gz" - sha256: "e68c1d346fc3d529653530ca346b2c62f5b31bd4fcca7ffc9c65bb39ab2f6ed3" - "2.9.1": - url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.9.1.tar.gz" - sha256: "6eaf86ead73e23988fe192da1db68f4d3828bcdd0f3a9dc195935e339c95dbdc" + "2.10.0": + url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.10.0.tar.gz" + sha256: "b5a1bb04c84b6fe1538377e5a1f649bb5d5f0b2e3625a3c526ff3a8af88633e8" patches: - "2.9.1": - - patch_file: "patches/msvc_fixes.patch" - patch_description: "Fix Windows build: Apply fixes for compatibility with MSVC from master" - patch_source: "https://github.com/tensorflow/tensorflow/pull/56408" - patch_type: "backport" - base_path: "src" - - patch_file: "patches/dependencies_2_9.patch" - patch_description: "Dependency compatibility: Patch CMakeLists.txt, updating package names, target names, etc" - patch_type: "conan" - base_path: "src" + "2.10.0": - patch_file: "patches/remove_simple_memory_arena_debug_dump.patch" patch_description: "Shared build fails on Windows with error LNK2005. Resolve the conflict by removing the conflicting implementation for now." - base_path: "src" - "2.6.0": - - patch_file: "patches/dependencies_2_6.patch" - patch_description: "Dependency compatibility: Patch CMakeLists.txt, updating package names, target names, etc" + - patch_file: "patches/disable_fetch_content.patch" + patch_description: "Fail if the CMake build script tries to fetch external dependencies" patch_type: "conan" - base_path: "src" - "2.6.2": - - patch_file: "patches/dependencies_2_6.patch" + - patch_file: "patches/dependencies_2_10.patch" patch_description: "Dependency compatibility: Patch CMakeLists.txt, updating package names, target names, etc" patch_type: "conan" - base_path: "src" diff --git a/recipes/tensorflow-lite/all/conanfile.py b/recipes/tensorflow-lite/all/conanfile.py index efe5861ad778c..f780e991d21b0 100644 --- a/recipes/tensorflow-lite/all/conanfile.py +++ b/recipes/tensorflow-lite/all/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile -from conan.tools import files from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, save, copy, export_conandata_patches, apply_conandata_patches from conan.errors import ConanInvalidConfiguration -from conans import CMake, tools -import functools -import os +from os.path import join import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class TensorflowLiteConan(ConanFile): @@ -37,31 +37,19 @@ class TensorflowLiteConan(ConanFile): "with_xnnpack": True } - short_paths = True - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - @property - def _source_subfolder(self): - return "src" - - @property - def _build_subfolder(self): - return "build" @property def _compilers_minimum_version(self): return { - "gcc": "5", - "Visual Studio": "14", - "clang": "3.4", + "gcc": "8", + "Visual Studio": "15.8", + "clang": "5", "apple-clang": "5.1", } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -76,60 +64,66 @@ def configure(self): del self.options.fPIC def requirements(self): - self.requires("abseil/20211102.0") + self.requires("abseil/20220623.0") self.requires("eigen/3.4.0") self.requires("farmhash/cci.20190513") self.requires("fft/cci.20061228") - self.requires("flatbuffers/2.0.5") + self.requires("flatbuffers/2.0.6") self.requires("gemmlowp/cci.20210928") if self.settings.arch in ("x86", "x86_64"): self.requires("intel-neon2sse/cci.20210225") self.requires("ruy/cci.20220628") if self.options.with_xnnpack: - self.requires("xnnpack/cci.20220621") + self.requires("xnnpack/cci.20220801") if self.options.with_xnnpack or self.options.get_safe("with_nnapi", False): self.requires("fp16/cci.20210320") def build_requirements(self): self.tool_requires("cmake/3.24.0") - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17 if Version(self.version) >= "2.9.1" else 14) - - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn(f"{self.name} requires C++14. Your compiler is unknown. Assuming it supports C++14.") - elif Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires C++14, which your compiler does not support.") - - def source(self): - files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def build(self): - files.apply_conandata_patches(self) - cmake = self._configure_cmake() - cmake.build() + def layout(self): + cmake_layout(self, build_folder=f"build_folder/{self.settings.build_type}") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions.update({ + def generate(self): + tc = CMakeToolchain(self) + tc.variables.update({ "CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS": True, "TFLITE_ENABLE_RUY": self.options.with_ruy, "TFLITE_ENABLE_NNAPI": self.options.get_safe("with_nnapi", False), "TFLITE_ENABLE_GPU": False, "TFLITE_ENABLE_XNNPACK": self.options.with_xnnpack, - "TFLITE_ENABLE_MMAP": self.options.get_safe("with_mmap", False) + "TFLITE_ENABLE_MMAP": self.options.get_safe("with_mmap", False), + "FETCHCONTENT_FULLY_DISCONNECTED": True, + "clog_POPULATED": True, }) if self.settings.arch == "armv8": # Not defined by Conan for Apple Silicon. See https://github.com/conan-io/conan/pull/8026 - cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = "arm64" - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = "arm64" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def validate(self): + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, 17) + + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if not minimum_version: + self.output.warn(f"{self.name} requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++17, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=join("tensorflow", "lite")) + cmake.build() @staticmethod - def _create_cmake_module_alias_target(module_file): + def _create_cmake_module_alias_target(conanfile, module_file): aliased = "tensorflowlite::tensorflowlite" alias = "tensorflow::tensorflowlite" content = textwrap.dedent(f"""\ @@ -138,21 +132,21 @@ def _create_cmake_module_alias_target(module_file): set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() """) - tools.save(module_file, content) + save(conanfile, module_file, content) @property def _module_file(self): - return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + return join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst=os.path.join("include", "tensorflow", "lite"), src=os.path.join(self._source_subfolder, "tensorflow", "lite")) - self.copy("*", dst="lib", src=os.path.join(self._build_subfolder, "lib")) - if self.options.shared: - self.copy("*", dst="bin", src=os.path.join(self._build_subfolder, "bin")) - if self.settings.build_type == "Debug": - tools.remove_files_by_mask(self.package_folder, "*.pdb") - self._create_cmake_module_alias_target(os.path.join(self.package_folder, self._module_file)) + copy(self, "LICENSE", self.source_folder, join(self.package_folder, "licenses")) + copy(self, "*.h", join(self.source_folder, "tensorflow", "lite"), join(self.package_folder, "include", "tensorflow", "lite")) + copy(self, "*.a", self.build_folder, join(self.package_folder, "lib")) + copy(self, "*.so", self.build_folder, join(self.package_folder, "lib")) + copy(self, "*.dylib", self.build_folder, join(self.package_folder, "lib")) + copy(self, "*.lib", self.build_folder, join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", self.build_folder, join(self.package_folder, "bin"), keep_path=False) + self._create_cmake_module_alias_target(self, join(self.package_folder, self._module_file)) def package_info(self): self.cpp_info.set_property("cmake_file_name", "tensorflowlite") @@ -170,6 +164,6 @@ def package_info(self): defines.append("TFLITE_WITH_RUY") self.cpp_info.defines = defines - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["tensorflow-lite"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("dl") diff --git a/recipes/tensorflow-lite/all/patches/dependencies_2_9.patch b/recipes/tensorflow-lite/all/patches/dependencies_2_10.patch similarity index 60% rename from recipes/tensorflow-lite/all/patches/dependencies_2_9.patch rename to recipes/tensorflow-lite/all/patches/dependencies_2_10.patch index 0c15d040912a9..a82533faee2e8 100644 --- a/recipes/tensorflow-lite/all/patches/dependencies_2_9.patch +++ b/recipes/tensorflow-lite/all/patches/dependencies_2_10.patch @@ -1,25 +1,14 @@ +commit fcb02f001504c4060f83233cedc9b8f197fcc607 +Author: talyz +Date: Wed Aug 24 19:09:53 2022 +0200 + + Conan deps + diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt -index 40f9485b5d6..f184ac5d30d 100644 +index 663f07ab31c..9f05de4ebec 100644 --- a/tensorflow/lite/CMakeLists.txt +++ b/tensorflow/lite/CMakeLists.txt -@@ -50,14 +50,8 @@ if(NOT TENSORFLOW_SOURCE_DIR) - endif() - set(TF_SOURCE_DIR "${TENSORFLOW_SOURCE_DIR}/tensorflow") - set(TFLITE_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}") --set(CMAKE_MODULE_PATH -- "${TFLITE_SOURCE_DIR}/tools/cmake/modules" -- ${CMAKE_MODULE_PATH} --) --set(CMAKE_PREFIX_PATH -- "${TFLITE_SOURCE_DIR}/tools/cmake/modules" -- ${CMAKE_PREFIX_PATH} --) -+list(APPEND CMAKE_MODULE_PATH "${TFLITE_SOURCE_DIR}/tools/cmake/modules") -+list(APPEND CMAKE_PREFIX_PATH "${TFLITE_SOURCE_DIR}/tools/cmake/modules") - include(CMakeDependentOption) - option(TFLITE_ENABLE_RUY "Enable experimental RUY integration" OFF) - option(TFLITE_ENABLE_RESOURCE "Enable experimental support for resources" ON) -@@ -138,12 +132,11 @@ macro(populate_tf_source_vars RELATIVE_DIR SOURCES_VAR) +@@ -138,12 +138,11 @@ macro(populate_tf_source_vars RELATIVE_DIR SOURCES_VAR) endmacro() # Find TensorFlow Lite dependencies. find_package(absl REQUIRED) @@ -35,18 +24,18 @@ index 40f9485b5d6..f184ac5d30d 100644 find_package(clog REQUIRED) find_package(cpuinfo REQUIRED) #CPUINFO is used by XNNPACK and RUY library find_package(ruy REQUIRED) -@@ -162,6 +155,10 @@ set(TFLITE_TARGET_PUBLIC_OPTIONS "") +@@ -162,6 +161,10 @@ set(TFLITE_TARGET_PUBLIC_OPTIONS "") set(TFLITE_TARGET_PRIVATE_OPTIONS "") # Additional library dependencies based upon enabled features. set(TFLITE_TARGET_DEPENDENCIES "") +if (NOT CMAKE_SYSTEM_PROCESSOR OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86") -+ find_package(NEON_2_SSE REQUIRED) -+ list(APPEND TFLITE_TARGET_DEPENDENCIES NEON_2_SSE::NEON_2_SSE) ++ find_package(intel-neon2sse REQUIRED) ++ list(APPEND TFLITE_TARGET_DEPENDENCIES intel-neon2sse::intel-neon2sse) +endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") # TFLite uses deprecated methods in neon2sse which generates a huge number of # warnings so surpress these until they're fixed. -@@ -395,7 +392,7 @@ if(TFLITE_ENABLE_XNNPACK) +@@ -411,7 +414,7 @@ if(TFLITE_ENABLE_XNNPACK) FILTER ".*(_test|_tester)\\.(cc|h)" ) list(APPEND TFLITE_TARGET_DEPENDENCIES @@ -55,7 +44,7 @@ index 40f9485b5d6..f184ac5d30d 100644 ) list(APPEND TFLITE_TARGET_PUBLIC_OPTIONS "-DTFLITE_BUILD_WITH_XNNPACK_DELEGATE") endif() -@@ -499,18 +496,17 @@ target_include_directories(tensorflow-lite +@@ -519,17 +522,16 @@ target_include_directories(tensorflow-lite target_link_libraries(tensorflow-lite PUBLIC Eigen3::Eigen @@ -70,12 +59,10 @@ index 40f9485b5d6..f184ac5d30d 100644 - fft2d_fftsg2d - flatbuffers - gemmlowp -- ruy + farmhash::farmhash + fft::fft + flatbuffers::flatbuffers + gemmlowp::eight_bit_int_gemm -+ ruy::ruy + ruy::ruy ${CMAKE_DL_LIBS} ${TFLITE_TARGET_DEPENDENCIES} - ) diff --git a/recipes/tensorflow-lite/all/patches/dependencies_2_6.patch b/recipes/tensorflow-lite/all/patches/dependencies_2_6.patch deleted file mode 100644 index f5d3dbba999d2..0000000000000 --- a/recipes/tensorflow-lite/all/patches/dependencies_2_6.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt -index f5cc9b97924..4edc693dd7d 100644 ---- a/tensorflow/lite/CMakeLists.txt -+++ b/tensorflow/lite/CMakeLists.txt -@@ -50,14 +50,8 @@ if(NOT TENSORFLOW_SOURCE_DIR) - endif() - set(TF_SOURCE_DIR "${TENSORFLOW_SOURCE_DIR}/tensorflow") - set(TFLITE_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}") --set(CMAKE_MODULE_PATH -- "${TFLITE_SOURCE_DIR}/tools/cmake/modules" -- ${CMAKE_MODULE_PATH} --) --set(CMAKE_PREFIX_PATH -- "${TFLITE_SOURCE_DIR}/tools/cmake/modules" -- ${CMAKE_PREFIX_PATH} --) -+list(APPEND CMAKE_MODULE_PATH "${TFLITE_SOURCE_DIR}/tools/cmake/modules") -+list(APPEND CMAKE_PREFIX_PATH "${TFLITE_SOURCE_DIR}/tools/cmake/modules") - include(CMakeDependentOption) - option(TFLITE_ENABLE_RUY "Enable experimental RUY integration" OFF) - option(TFLITE_ENABLE_RESOURCE "Enable experimental support for resources" ON) -@@ -125,12 +119,11 @@ macro(populate_tf_source_vars RELATIVE_DIR SOURCES_VAR) - endmacro() - # Find TensorFlow Lite dependencies. - find_package(absl REQUIRED) --find_package(eigen REQUIRED) -+find_package(Eigen3 REQUIRED) - find_package(farmhash REQUIRED) --find_package(fft2d REQUIRED) --find_package(flatbuffers REQUIRED) -+find_package(fft REQUIRED) -+find_package(Flatbuffers REQUIRED CONFIG) - find_package(gemmlowp REQUIRED) --find_package(neon2sse REQUIRED) - find_package(ruy REQUIRED) - # Generate TensorFlow Lite FlatBuffer code. - # We used to have an actual compilation logic with flatc but decided to use -@@ -147,6 +140,10 @@ set(TFLITE_TARGET_PUBLIC_OPTIONS "") - set(TFLITE_TARGET_PRIVATE_OPTIONS "") - # Additional library dependencies based upon enabled features. - set(TFLITE_TARGET_DEPENDENCIES "") -+if (NOT CMAKE_SYSTEM_PROCESSOR OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86") -+ find_package(NEON_2_SSE REQUIRED) -+ list(APPEND TFLITE_TARGET_DEPENDENCIES NEON_2_SSE::NEON_2_SSE) -+endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") - # TFLite uses deprecated methods in neon2sse which generates a huge number of - # warnings so surpress these until they're fixed. -@@ -322,7 +319,7 @@ if(TFLITE_ENABLE_XNNPACK) - FILTER ".*(_test|_tester)\\.(cc|h)" - ) - list(APPEND TFLITE_TARGET_DEPENDENCIES -- XNNPACK -+ xnnpack::xnnpack - ) - list(APPEND TFLITE_TARGET_PUBLIC_OPTIONS "-DTFLITE_BUILD_WITH_XNNPACK_DELEGATE") - endif() -@@ -418,18 +415,17 @@ target_include_directories(tensorflow-lite - target_link_libraries(tensorflow-lite - PUBLIC - Eigen3::Eigen -- NEON_2_SSE - absl::flags - absl::hash - absl::status - absl::strings - absl::synchronization - absl::variant -- farmhash -- fft2d_fftsg2d -- flatbuffers -- gemmlowp -- ruy -+ farmhash::farmhash -+ fft::fft -+ flatbuffers::flatbuffers -+ gemmlowp::eight_bit_int_gemm -+ ruy::ruy - ${CMAKE_DL_LIBS} - ${TFLITE_TARGET_DEPENDENCIES} - ) diff --git a/recipes/tensorflow-lite/all/patches/disable_fetch_content.patch b/recipes/tensorflow-lite/all/patches/disable_fetch_content.patch new file mode 100644 index 0000000000000..adc6f0561afef --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/disable_fetch_content.patch @@ -0,0 +1,12 @@ +diff --git a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake +index 9ed95109ba9..4ddf322b95f 100644 +--- a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake ++++ b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake +@@ -244,6 +244,7 @@ endfunction() + # All content names passed to this method are added to the global property + # OVERRIDABLE_FETCH_CONTENT_LIST. + function(OverridableFetchContent_Declare CONTENT_NAME) ++ message(FATAL_ERROR "OverridableFetchContent_Declare called by ${CONTENT_NAME}! Failing build.") + set(OVERRIDABLE_ARGS + GIT_REPOSITORY + GIT_TAG diff --git a/recipes/tensorflow-lite/all/patches/msvc_fixes.patch b/recipes/tensorflow-lite/all/patches/msvc_fixes.patch deleted file mode 100644 index 6400721781285..0000000000000 --- a/recipes/tensorflow-lite/all/patches/msvc_fixes.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 79be9efa5190a4a9c828369ba358e6f9e59fbbe5 Mon Sep 17 00:00:00 2001 -From: Jamie Cook -Date: Thu, 9 Jun 2022 17:54:52 +1000 -Subject: [PATCH 1/4] Use the help macro from absl to avoid gcc specific - compiler macro (__PRETTY_FUNCTION__) - ---- - tensorflow/lite/kernels/internal/compatibility.h | 11 +++++++++++ - .../kernels/internal/optimized/depthwiseconv_float.h | 2 +- - .../kernels/internal/optimized/depthwiseconv_uint8.h | 2 +- - .../internal/optimized/integer_ops/depthwise_conv.h | 2 +- - 4 files changed, 14 insertions(+), 3 deletions(-) - -diff --git a/tensorflow/lite/kernels/internal/compatibility.h b/tensorflow/lite/kernels/internal/compatibility.h -index 61becad30c5c2..1b275095092dd 100644 ---- a/tensorflow/lite/kernels/internal/compatibility.h -+++ b/tensorflow/lite/kernels/internal/compatibility.h -@@ -86,6 +86,17 @@ using int32 = std::int32_t; - using uint32 = std::uint32_t; - #endif // !defined(TF_LITE_STATIC_MEMORY) - -+ -+// Allow for cross-compiler usage of function signatures - used for specifying -+// named RUY profiler regions in templated methods. -+#if defined(_MSC_VER) -+#define TFLITE_PRETTY_FUNCTION __FUNCSIG__ -+#elif defined(__GNUC__) -+#define TFLITE_PRETTY_FUNCTION __PRETTY_FUNCTION__ -+#else -+#define TFLITE_PRETTY_FUNCTION __func__ -+#endif -+ - // TFLITE_DEPRECATED() - // - // Duplicated from absl/base/macros.h to avoid pulling in that library. -diff --git a/tensorflow/lite/kernels/internal/optimized/depthwiseconv_float.h b/tensorflow/lite/kernels/internal/optimized/depthwiseconv_float.h -index a8903c1d2758a..daafa93ef3baa 100644 ---- a/tensorflow/lite/kernels/internal/optimized/depthwiseconv_float.h -+++ b/tensorflow/lite/kernels/internal/optimized/depthwiseconv_float.h -@@ -768,7 +768,7 @@ void FloatDepthwiseConvAccumRow(int stride, int dilation_factor, - const float* filter_data, - int out_x_buffer_start, int out_x_buffer_end, - int output_depth, float* acc_buffer) { -- ruy::profiler::ScopeLabel label(__PRETTY_FUNCTION__); -+ ruy::profiler::ScopeLabel label(TFLITE_PRETTY_FUNCTION); - // Consistency check parameters. This is important in particular to ensure - // that we keep the number of template instantiations minimal, so we don't - // increase binary size unnecessarily. -diff --git a/tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h b/tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h -index 52469b34c8703..8ebb7411e0ff7 100644 ---- a/tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h -+++ b/tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h -@@ -1519,7 +1519,7 @@ void QuantizedDepthwiseConvAccumRow(int stride, int dilation_factor, - int16 filter_offset, int out_x_buffer_start, - int out_x_buffer_end, int output_depth, - int32* acc_buffer) { -- ruy::profiler::ScopeLabel label(__PRETTY_FUNCTION__); -+ ruy::profiler::ScopeLabel label(TFLITE_PRETTY_FUNCTION);; - // Consistency check parameters. This is important in particular to ensure - // that we keep the number of template instantiations minimal, so we don't - // increase binary size unnecessarily. -diff --git a/tensorflow/lite/kernels/internal/optimized/integer_ops/depthwise_conv.h b/tensorflow/lite/kernels/internal/optimized/integer_ops/depthwise_conv.h -index d38d05e81bd3e..b9727e4ad40c3 100644 ---- a/tensorflow/lite/kernels/internal/optimized/integer_ops/depthwise_conv.h -+++ b/tensorflow/lite/kernels/internal/optimized/integer_ops/depthwise_conv.h -@@ -1429,7 +1429,7 @@ void QuantizedDepthwiseConvAccumRow(int stride, int dilation_factor, - int out_x_buffer_start, - int out_x_buffer_end, int output_depth, - int32* acc_buffer) { -- ruy::profiler::ScopeLabel label(__PRETTY_FUNCTION__); -+ ruy::profiler::ScopeLabel label(TFLITE_PRETTY_FUNCTION); - // Consistency check parameters. This is important in particular to ensure - // that we keep the number of template instantiations minimal, so we don't - // increase binary size unnecessarily. - -From 3616d189a87a3f7cd3cabb8f3ec44f29f58f7e14 Mon Sep 17 00:00:00 2001 -From: Jamie Cook -Date: Fri, 10 Jun 2022 08:19:52 +1000 -Subject: [PATCH 2/4] designated initializers are only supported on MSVC 2019 - with stdc++20 - ---- - .../lite/delegates/external/external_delegate.cc | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/tensorflow/lite/delegates/external/external_delegate.cc b/tensorflow/lite/delegates/external/external_delegate.cc -index 7fe5c5329dd2a..39a2d04cfca43 100644 ---- a/tensorflow/lite/delegates/external/external_delegate.cc -+++ b/tensorflow/lite/delegates/external/external_delegate.cc -@@ -155,12 +155,12 @@ ExternalDelegateWrapper::ExternalDelegateWrapper( - ckeys.size(), nullptr); - if (external_delegate_) { - wrapper_delegate_ = { -- .data_ = reinterpret_cast(this), -- .Prepare = DelegatePrepare, -- .CopyFromBufferHandle = nullptr, -- .CopyToBufferHandle = nullptr, -- .FreeBufferHandle = nullptr, -- .flags = external_delegate_->flags, -+ reinterpret_cast(this), // .data = -+ DelegatePrepare, // .Prepare = -+ nullptr, // .CopyFromBufferHandle = -+ nullptr, // .CopyToBufferHandle = -+ nullptr, // .FreeBufferHandle = -+ external_delegate_->flags, // .flags = - }; - if (external_delegate_->CopyFromBufferHandle) { - wrapper_delegate_.CopyFromBufferHandle = DelegateCopyFromBufferHandle; - -From 6e7e5291950e8f72f9ad50674ba0162247f5d078 Mon Sep 17 00:00:00 2001 -From: Jamie Cook -Date: Mon, 13 Jun 2022 14:29:51 +1000 -Subject: [PATCH 3/4] Trigger build which was failing last week with DNS issues - ---- - tensorflow/lite/kernels/internal/compatibility.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tensorflow/lite/kernels/internal/compatibility.h b/tensorflow/lite/kernels/internal/compatibility.h -index 1b275095092dd..037697f19fb6c 100644 ---- a/tensorflow/lite/kernels/internal/compatibility.h -+++ b/tensorflow/lite/kernels/internal/compatibility.h -@@ -87,7 +87,7 @@ using uint32 = std::uint32_t; - #endif // !defined(TF_LITE_STATIC_MEMORY) - - --// Allow for cross-compiler usage of function signatures - used for specifying -+// Allow for cross-compiler usage of function signatures - currently used for specifying - // named RUY profiler regions in templated methods. - #if defined(_MSC_VER) - #define TFLITE_PRETTY_FUNCTION __FUNCSIG__ - -From d12d20dfc989f2ebdc74bdcfb8a9155eb51ba03e Mon Sep 17 00:00:00 2001 -From: Mihai Maruseac -Date: Wed, 15 Jun 2022 17:14:47 -0700 -Subject: [PATCH 4/4] Update - tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h - ---- - .../lite/kernels/internal/optimized/depthwiseconv_uint8.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h b/tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h -index 8ebb7411e0ff7..f7176bb8bc7db 100644 ---- a/tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h -+++ b/tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h -@@ -1519,7 +1519,7 @@ void QuantizedDepthwiseConvAccumRow(int stride, int dilation_factor, - int16 filter_offset, int out_x_buffer_start, - int out_x_buffer_end, int output_depth, - int32* acc_buffer) { -- ruy::profiler::ScopeLabel label(TFLITE_PRETTY_FUNCTION);; -+ ruy::profiler::ScopeLabel label(TFLITE_PRETTY_FUNCTION); - // Consistency check parameters. This is important in particular to ensure - // that we keep the number of template instantiations minimal, so we don't - // increase binary size unnecessarily. diff --git a/recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch b/recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch index 4e2350cd29678..2f7e6367c52d8 100644 --- a/recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch +++ b/recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch @@ -1,8 +1,8 @@ diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt -index f184ac5d30d..f59f9ea717c 100644 +index 40f9485b5d6..f250ebccc05 100644 --- a/tensorflow/lite/CMakeLists.txt +++ b/tensorflow/lite/CMakeLists.txt -@@ -199,6 +199,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Android") +@@ -202,6 +202,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Android") endif() # Build a list of source files to compile into the TF Lite library. populate_tflite_source_vars("." TFLITE_SRCS) diff --git a/recipes/tensorflow-lite/all/test_package/CMakeLists.txt b/recipes/tensorflow-lite/all/test_package/CMakeLists.txt index afc3ca8116573..b1b0f24e0aa99 100644 --- a/recipes/tensorflow-lite/all/test_package/CMakeLists.txt +++ b/recipes/tensorflow-lite/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(tensorflowlite REQUIRED CONFIG) add_executable(test_package test_package.cpp) target_link_libraries(test_package PRIVATE tensorflow::tensorflowlite) -target_compile_features(test_package PRIVATE cxx_std_14) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/tensorflow-lite/all/test_package/conanfile.py b/recipes/tensorflow-lite/all/test_package/conanfile.py index ac6751f7f689b..841a097747d32 100644 --- a/recipes/tensorflow-lite/all/test_package/conanfile.py +++ b/recipes/tensorflow-lite/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,7 +21,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): model_path = os.path.join(self.source_folder, "model.tflite") - command = os.path.join("bin", "test_package") - self.run(" ".join([command, model_path]), run_environment=True) + command = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{command} {model_path}", env="conanrun") diff --git a/recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt b/recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ff2f7e7d39536 --- /dev/null +++ b/recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tensorflowlite REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE tensorflow::tensorflowlite) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/tensorflow-lite/all/test_v1_package/conanfile.py b/recipes/tensorflow-lite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..17a163fae24bd --- /dev/null +++ b/recipes/tensorflow-lite/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + model_path = os.path.join(self.source_folder, os.pardir, "test_package", "model.tflite") + command = os.path.join("bin", "test_package") + self.run(f"{command} {model_path}", run_environment=True) diff --git a/recipes/tensorflow-lite/config.yml b/recipes/tensorflow-lite/config.yml index 939866f077b06..22d65dcfdfac6 100644 --- a/recipes/tensorflow-lite/config.yml +++ b/recipes/tensorflow-lite/config.yml @@ -1,7 +1,3 @@ versions: - "2.6.0": - folder: all - "2.6.2": - folder: all - "2.9.1": + "2.10.0": folder: all From 361df20f5dd3358c5e9513e907b6bbefe4783013 Mon Sep 17 00:00:00 2001 From: Fernando Pelliccioni Date: Fri, 23 Sep 2022 11:05:53 +0200 Subject: [PATCH 170/561] (#13037) [Catch2] adapt recipe for Conan v2 * [Catch2] adapt recipe for Conan v2 * fixes * fixes * fixes * fixes * fixes 4 * fixes 5 * fixes 6 * Update recipes/catch2/3.x.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/catch2/3.x.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/catch2/3.x.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/catch2/3.x.x/conanfile.py * fix patches * fix * fix * remove comments * Update recipes/catch2/3.x.x/conanfile.py Co-authored-by: Chris Mc * Update recipes/catch2/3.x.x/conanfile.py Co-authored-by: Chris Mc * test package changes * Move test package files (#2) * move gtest Signed-off-by: Uilian Ries * Delete test_all.sh * Use cmake targets * Do not use settings Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries Co-authored-by: Chris Mc --- .../2.x.x/test_v1_package/CMakeLists.txt | 32 ++++++++ .../catch2/2.x.x/test_v1_package/conanfile.py | 24 ++++++ recipes/catch2/3.x.x/CMakeLists.txt | 10 --- recipes/catch2/3.x.x/conandata.yml | 2 - recipes/catch2/3.x.x/conanfile.py | 75 +++++++++---------- .../catch2/3.x.x/test_package/CMakeLists.txt | 5 +- .../catch2/3.x.x/test_package/conanfile.py | 29 +++++-- .../3.x.x/test_v1_package/CMakeLists.txt | 22 ++++++ .../catch2/3.x.x/test_v1_package/conanfile.py | 18 +++++ 9 files changed, 152 insertions(+), 65 deletions(-) create mode 100644 recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/catch2/2.x.x/test_v1_package/conanfile.py delete mode 100644 recipes/catch2/3.x.x/CMakeLists.txt create mode 100644 recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/catch2/3.x.x/test_v1_package/conanfile.py diff --git a/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt b/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ba50d23310806 --- /dev/null +++ b/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.5) +project(test_package) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Catch2 REQUIRED) + +if(NOT WITH_PREFIX) + add_executable(test_package ../test_package/000-CatchMain.cpp ../test_package/100-Fix-Section.cpp) + target_link_libraries(test_package PRIVATE Catch2::Catch2) + + if(WITH_MAIN) + add_executable(standalone ../test_package/200-standalone.cpp) + target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) + if(WITH_BENCHMARK) + add_executable(benchmark ../test_package/300-benchmark.cpp) + target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) + endif() + endif() +else() + add_executable(test_package ../test_package/000-CatchMain.cpp ../test_package/400-with-prefix.cpp) + target_link_libraries(test_package PRIVATE Catch2::Catch2) + + if(WITH_MAIN) + add_executable(standalone ../test_package/400-with-prefix.cpp) + target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) + endif() +endif() diff --git a/recipes/catch2/2.x.x/test_v1_package/conanfile.py b/recipes/catch2/2.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..26e54f7cba1f5 --- /dev/null +++ b/recipes/catch2/2.x.x/test_v1_package/conanfile.py @@ -0,0 +1,24 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_MAIN"] = self.options["catch2"].with_main + cmake.definitions["WITH_BENCHMARK"] = self.options["catch2"].with_main and self.options["catch2"].with_benchmark + cmake.definitions["WITH_PREFIX"] = self.options["catch2"].with_prefix + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) + if self.options["catch2"].with_main: + self.run(os.path.join("bin", "standalone"), run_environment=True) + if self.options["catch2"].with_benchmark: + self.run(os.path.join("bin", "benchmark"), run_environment=True) diff --git a/recipes/catch2/3.x.x/CMakeLists.txt b/recipes/catch2/3.x.x/CMakeLists.txt deleted file mode 100644 index 8a6f93c2da7ef..0000000000000 --- a/recipes/catch2/3.x.x/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(cmake_wrapper) - -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index c9fa14ce205a3..9b3616a81d44c 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -8,7 +8,5 @@ sources: patches: "3.1.0": - patch_file: "patches/3.0.1-0001-force-not_usbproject-off.patch" - base_path: "source_subfolder" "3.0.1": - patch_file: "patches/3.0.1-0001-force-not_usbproject-off.patch" - base_path: "source_subfolder" diff --git a/recipes/catch2/3.x.x/conanfile.py b/recipes/catch2/3.x.x/conanfile.py index 88d4e49f20587..6b39f3af95662 100644 --- a/recipes/catch2/3.x.x/conanfile.py +++ b/recipes/catch2/3.x.x/conanfile.py @@ -1,9 +1,12 @@ import os -import functools -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, copy, get, rmdir -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class Catch2Conan(ConanFile): name = "catch2" @@ -23,24 +26,14 @@ class Catch2Conan(ConanFile): "with_prefix": False, "default_reporter": None, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" @property def _default_reporter_str(self): return '"{}"'.format(str(self.options.default_reporter).strip('"')) def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -55,12 +48,15 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def layout(self): + cmake_layout(self, src_folder="src") + def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") + check_min_cppstd(self, "14") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: + if Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("{}/{}: Unsupported compiler: {}-{} " "(https://github.com/p-ranav/structopt#compiler-compatibility)." .format(self.name, self.version, self.settings.compiler, self.settings.compiler.version)) @@ -68,39 +64,36 @@ def validate(self): self.output.warn("{}/{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name, self.version)) def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTING"] = "OFF" - cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF" - cmake.definitions["CATCH_INSTALL_HELPERS"] = "ON" - cmake.definitions["CATCH_CONFIG_PREFIX_ALL"] = self.options.with_prefix + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["CATCH_INSTALL_DOCS"] = False + tc.variables["CATCH_INSTALL_HELPERS"] = True + tc.variables["CATCH_CONFIG_PREFIX_ALL"] = self.options.with_prefix if self.options.default_reporter: - cmake.definitions["CATCH_CONFIG_DEFAULT_REPORTER"] = self._default_reporter_str - cmake.configure(build_folder=self._build_subfolder) - return cmake - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + tc.variables["CATCH_CONFIG_DEFAULT_REPORTER"] = self._default_reporter_str + tc.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", 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")) - tools.rmdir(os.path.join(self.package_folder, "share")) + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) for cmake_file in ["ParseAndAddCatchTests.cmake", "Catch.cmake", "CatchAddTests.cmake"]: self.copy( cmake_file, - src=os.path.join(self._source_subfolder, "extras"), + src=os.path.join(self.source_folder, "extras"), dst=os.path.join("lib", "cmake", "Catch2"), ) diff --git a/recipes/catch2/3.x.x/test_package/CMakeLists.txt b/recipes/catch2/3.x.x/test_package/CMakeLists.txt index 93500a54ca713..5747d03f1f75f 100644 --- a/recipes/catch2/3.x.x/test_package/CMakeLists.txt +++ b/recipes/catch2/3.x.x/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_package(Catch2 REQUIRED CONFIG) set(CMAKE_CXX_STANDARD 14) diff --git a/recipes/catch2/3.x.x/test_package/conanfile.py b/recipes/catch2/3.x.x/test_package/conanfile.py index 752bdb4cf4490..26998ae73cc28 100644 --- a/recipes/catch2/3.x.x/test_package/conanfile.py +++ b/recipes/catch2/3.x.x/test_package/conanfile.py @@ -1,18 +1,31 @@ -from conans import ConanFile, CMake, tools -from conans.tools import Version +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_PREFIX"] = self.dependencies[self.tested_reference_str].options.with_prefix + tc.generate() + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) - cmake.definitions["WITH_PREFIX"] = self.options["catch2"].with_prefix cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "standalone"), run_environment=True) - self.run(os.path.join("bin", "benchmark"), run_environment=True) + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "standalone"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindirs[0], "benchmark"), env="conanrun") diff --git a/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt b/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c64530cd7a4a6 --- /dev/null +++ b/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(Catch2 REQUIRED CONFIG) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if(NOT WITH_PREFIX) + add_executable(standalone ../test_package/100-standalone.cpp) + target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) + add_executable(benchmark ../test_package/200-benchmark.cpp) + target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) +else() + add_executable(standalone ../test_package/300-standalone-with-prefix.cpp) + target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) + add_executable(benchmark ../test_package/400-benchmark-with-prefix.cpp) + target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) +endif() diff --git a/recipes/catch2/3.x.x/test_v1_package/conanfile.py b/recipes/catch2/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..752bdb4cf4490 --- /dev/null +++ b/recipes/catch2/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +from conans.tools import Version +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_PREFIX"] = self.options["catch2"].with_prefix + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "standalone"), run_environment=True) + self.run(os.path.join("bin", "benchmark"), run_environment=True) From 5b36cdb8a9c531086a4cb98722cad469222f5f1e Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Fri, 23 Sep 2022 05:25:38 -0400 Subject: [PATCH 171/561] (#13104) [parallel-hashmap] bump version to 1.36 * Bump version: parallel-hashmap 1.34 * [parallel-hashmap] update version to 1.36 --- recipes/parallel-hashmap/all/conandata.yml | 3 +++ recipes/parallel-hashmap/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml index cd12ac5c65f5c..236952e80cbd7 100644 --- a/recipes/parallel-hashmap/all/conandata.yml +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.36": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.36.tar.gz" + sha256: "33acf44158a9661a9d630d13f9250a2aa27a770cb3771df77b1ba1a661c0b766" "1.35": url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.35.tar.gz" sha256: "308ab6f92e4c6f49304562e352890cf7140de85ce723c097e74fbdec88e0e1ce" diff --git a/recipes/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml index 5f1ab385db344..e79552aaa2013 100644 --- a/recipes/parallel-hashmap/config.yml +++ b/recipes/parallel-hashmap/config.yml @@ -1,4 +1,6 @@ versions: + "1.36": + folder: all "1.35": folder: all "1.34": From 3502bb795fc1f1165c7515933db21ef5a5b94299 Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Fri, 23 Sep 2022 09:05:08 -0400 Subject: [PATCH 172/561] (#13108) [greg7mdp-gtl] bump version to 1.1.3 * Bump version: parallel-hashmap 1.34 * [greg7mdp-gtl] bump version to 1.1.3 --- recipes/greg7mdp-gtl/all/conandata.yml | 3 +++ recipes/greg7mdp-gtl/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/greg7mdp-gtl/all/conandata.yml b/recipes/greg7mdp-gtl/all/conandata.yml index cf478003a76b9..267549ce8cbbf 100644 --- a/recipes/greg7mdp-gtl/all/conandata.yml +++ b/recipes/greg7mdp-gtl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.3": + url: "https://github.com/greg7mdp/gtl/archive/refs/tags/v1.1.3.tar.gz" + sha256: "c667690eeecf37f660d8a61bca1076e845154bc535c44ec0d2404c04c66ae228" "1.1.2": url: "https://github.com/greg7mdp/gtl/archive/refs/tags/v1.1.2.tar.gz" sha256: "22ac9fb43608c7ddccb983096f5dadb036e5d3122d9194cdb42fee67d754c552" diff --git a/recipes/greg7mdp-gtl/config.yml b/recipes/greg7mdp-gtl/config.yml index 8d13aefb6b4fb..75493b9d0906b 100644 --- a/recipes/greg7mdp-gtl/config.yml +++ b/recipes/greg7mdp-gtl/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.3": + folder: all "1.1.2": folder: all From b683b4e06e5dcd7b0b0a852aa64921054fc95880 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Fri, 23 Sep 2022 15:24:42 +0200 Subject: [PATCH 173/561] (#12255) update diligent-core tag signature * update diligent-core tag signature * migrate to conan v2 * make linter happy * add recursive flag to rm command * update required_conan_version * use conan v2 way of deleting PDB files * use conan v2 way of deleting PDB files * Apply suggestions from code review Co-authored-by: Chris Mc * remove pdb files recursively * use export_conandata_patches * don't import patch as not needed * make linter happy * remove pdb file from the whole package folder * Update recipes/diligent-core/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/diligent-core/all/conanfile.py Co-authored-by: Uilian Ries Co-authored-by: Chris Mc Co-authored-by: Uilian Ries --- recipes/diligent-core/all/conandata.yml | 2 +- recipes/diligent-core/all/conanfile.py | 50 +++++++++++++------------ 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/recipes/diligent-core/all/conandata.yml b/recipes/diligent-core/all/conandata.yml index 0b9b5a5985bfa..f42eb9cd48eb5 100644 --- a/recipes/diligent-core/all/conandata.yml +++ b/recipes/diligent-core/all/conandata.yml @@ -1,7 +1,7 @@ sources: "api.252004": url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API252004.tar.gz" - sha256: "f1a5a46f60b26cd7f07e27a64b90e76e28643a09cb3af786d04141ce7c306452" + sha256: "06e4ee5f95163ae74bbe62f59dcdf1da5e181ff2d6a8e3982319bb5c8f97c53b" "api.252003": url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API252003.tar.gz" sha256: "18f17eaa0b6425022be4019c61fede441b9feec4b94c2b7e8ab73d86a7f6a913" diff --git a/recipes/diligent-core/all/conanfile.py b/recipes/diligent-core/all/conanfile.py index 8f3afdf2864e7..fd38f8bec8c43 100644 --- a/recipes/diligent-core/all/conanfile.py +++ b/recipes/diligent-core/all/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conans import CMake +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building, check_min_cppstd +from conan.tools.scm import Version +from conan.tools.files import rm, get, rmdir, rename, collect_libs, patches +from conan.tools.apple import is_apple_os import os -from conan.tools.build import cross_building -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.51.3" class DiligentCoreConan(ConanFile): @@ -52,20 +56,20 @@ def _minimum_cpp_standard(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._minimum_cpp_standard) min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) if not min_version: self.output.warn("{} recipe lacks information about the {} compiler support.".format( self.name, self.settings.compiler)) else: - if tools.Version(self.settings.compiler.version) < min_version: + if Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) if self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime: raise ConanInvalidConfiguration("Visual Studio build with MT runtime is not supported") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def package_id(self): if self.settings.compiler == "Visual Studio": @@ -83,14 +87,14 @@ def config_options(self): del self.options.fPIC def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + patches.apply_conandata_patches(self) def build_requirements(self): - self.build_requires("cmake/3.22.0") + self.tool_requires("cmake/3.24.0") def requirements(self): self.requires("opengl/system") + self.requires("wayland/1.21.0") self.requires("spirv-cross/1.3.216.0") self.requires("spirv-tools/1.3.216.0") @@ -151,37 +155,37 @@ def build(self): def package(self): cmake = self._configure_cmake() cmake.install() - tools.rename(src=os.path.join(self.package_folder, "include", "source_subfolder"), + rename(self, src=os.path.join(self.package_folder, "include", "source_subfolder"), dst=os.path.join(self.package_folder, "include", "DiligentCore")) - tools.rmdir(os.path.join(self.package_folder, "Licenses")) - tools.rmdir(os.path.join(self.package_folder, "lib")) - tools.rmdir(os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "Licenses")) + rmdir(self, os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "bin")) self.copy("License.txt", dst="licenses", src=self._source_subfolder) if self.options.shared: self.copy(pattern="*.dylib", dst="lib", keep_path=False) self.copy(pattern="*.so", dst="lib", keep_path=False) self.copy(pattern="*.dll", dst="bin", keep_path=False) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.a") + rm(self, os.path.join(self.package_folder, "lib"), "*.a", recursive=True) if self.settings.os != "Windows": - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.lib") + rm(self, os.path.join(self.package_folder, "lib"), "*.lib", recursive=True) else: self.copy(pattern="*.a", dst="lib", keep_path=False) self.copy(pattern="*.lib", dst="lib", keep_path=False) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.dylib") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.so") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.dll") + rm(self, os.path.join(self.package_folder, "lib"), "*.dylib", recursive=True) + rm(self, os.path.join(self.package_folder, "lib"), "*.so", recursive=True) + rm(self, os.path.join(self.package_folder, "lib"), "*.dll", recursive=True) self.copy(pattern="*.fxh", dst="res", keep_path=False) self.copy("File2String*", src=os.path.join(self._build_subfolder, "bin"), dst="bin", keep_path=False) - tools.remove_files_by_mask(self.package_folder, "*.pdb") + rm(self, "*.pdb", self.package_folder, recursive=True) # MinGw creates many invalid files, called objects.a, remove them here: - tools.remove_files_by_mask(self.package_folder, "objects.a") + rm(self, "objects.a", self.package_folder, recursive=True) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) # included as discussed here https://github.com/conan-io/conan-center-index/pull/10732#issuecomment-1123596308 self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include")) self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "DiligentCore", "Common")) @@ -203,7 +207,7 @@ def package_info(self): self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Basic", "interface")) if self.settings.os == "Android": self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Android", "interface")) - elif tools.is_apple_os(self.settings.os): + elif is_apple_os(self): self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Apple", "interface")) elif self.settings.os == "Emscripten": self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Emscripten", "interface")) From b972fc42ef27deb0c915fec628b565d53b3b8c52 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 23 Sep 2022 16:05:39 +0200 Subject: [PATCH 174/561] (#13007) libavif: conan v2 support * conan v2 support * bump dependencies * bump libyuv * use export_conandata_patches() * protect fPIC deletion --- recipes/libavif/all/CMakeLists.txt | 7 -- recipes/libavif/all/conandata.yml | 2 - recipes/libavif/all/conanfile.py | 104 +++++++++++------- .../libavif/all/test_package/CMakeLists.txt | 5 +- recipes/libavif/all/test_package/conanfile.py | 22 ++-- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../libavif/all/test_v1_package/conanfile.py | 17 +++ 7 files changed, 106 insertions(+), 61 deletions(-) delete mode 100644 recipes/libavif/all/CMakeLists.txt create mode 100644 recipes/libavif/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libavif/all/test_v1_package/conanfile.py diff --git a/recipes/libavif/all/CMakeLists.txt b/recipes/libavif/all/CMakeLists.txt deleted file mode 100644 index 079f85b3af328..0000000000000 --- a/recipes/libavif/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(libavif_wrapper C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libavif/all/conandata.yml b/recipes/libavif/all/conandata.yml index 13ca37eae538b..8c5ef7fb45af6 100644 --- a/recipes/libavif/all/conandata.yml +++ b/recipes/libavif/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "0.9.3": - patch_file: patches/0001-disable-developer-only-codepaths.patch - base_path: source_subfolder - patch_file: patches/0002-fix-libyuv-version-handling.patch - base_path: source_subfolder diff --git a/recipes/libavif/all/conanfile.py b/recipes/libavif/all/conanfile.py index 27390af71e2ba..66b650db87d1d 100644 --- a/recipes/libavif/all/conanfile.py +++ b/recipes/libavif/all/conanfile.py @@ -1,10 +1,10 @@ -import functools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save import os import textwrap -from conans import ConanFile, CMake, tools - -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class LibAVIFConan(ConanFile): @@ -25,8 +25,9 @@ class LibAVIFConan(ConanFile): "fPIC": True, "with_decoder": "dav1d", } - generators = "cmake", "cmake_find_package_multi" - exports_sources = "CMakeLists.txt", "patches/*" + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -34,53 +35,75 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") @property def _has_dav1d(self): return self.options.with_decoder == "dav1d" def requirements(self): - self.requires("libaom-av1/3.1.2") - self.requires("libyuv/cci.20201106") + self.requires("libaom-av1/3.4.0") + self.requires("libyuv/1841") if self._has_dav1d: - self.requires("dav1d/0.9.1") - - @property - def _source_subfolder(self): - return "source_subfolder" + self.requires("dav1d/1.0.0") def source(self): - root = self._source_subfolder - get_args = self.conan_data["sources"][self.version] - tools.get(**get_args, destination=root, strip_root=True) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["AVIF_ENABLE_WERROR"] = False + tc.variables["AVIF_CODEC_AOM"] = True + tc.variables["AVIF_CODEC_DAV1D"] = self.options.with_decoder == "dav1d" + tc.variables["AVIF_CODEC_AOM_DECODE"] = self.options.with_decoder == "aom" + tc.variables["LIBYUV_VERSION"] = self.dependencies["libyuv"].ref.version + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "find_package(libyuv QUIET)", "find_package(libyuv REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${LIBYUV_LIBRARY}", "libyuv::libyuv") + replace_in_file(self, cmakelists, "find_package(dav1d REQUIRED)", "find_package(dav1d REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${DAV1D_LIBRARY}", "dav1d::dav1d") + replace_in_file(self, cmakelists, "find_package(aom REQUIRED)", "find_package(libaom-av1 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${AOM_LIBRARIES}", "libaom-av1::libaom-av1") - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): + self._patch_sources() cmake = CMake(self) - cmake.definitions["AVIF_CODEC_AOM"] = True - if self._has_dav1d: - cmake.definitions["AVIF_CODEC_DAV1D"] = True - cmake.definitions["AVIF_CODEC_AOM_DECODE"] = False cmake.configure() - return cmake - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - self._configure_cmake().build() + cmake.build() @property def _alias_path(self): return os.path.join("lib", "conan-official-avif-targets.cmake") def package(self): - self.copy("LICENSE", "licenses", self._source_subfolder) - self._configure_cmake().install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) # TODO: remove in conan v2 alias = os.path.join(self.package_folder, self._alias_path) @@ -93,7 +116,7 @@ def package(self): ) endif() """) - tools.save(alias, content) + save(self, alias, content) def package_info(self): self.cpp_info.requires = ["libyuv::libyuv", "libaom-av1::libaom-av1"] @@ -103,21 +126,20 @@ def package_info(self): self.cpp_info.libs = ["avif"] if self.options.shared: self.cpp_info.defines = ["AVIF_DLL"] - if self.settings.os != "Windows": - self.cpp_info.system_libs = ["pthread", "m"] - if self.settings.os == "Linux" and self._has_dav1d: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + if self._has_dav1d: self.cpp_info.system_libs.append("dl") self.cpp_info.set_property("cmake_file_name", "libavif") self.cpp_info.set_property("cmake_target_name", "avif") + self.cpp_info.set_property("pkg_config_name", "libavif") # TODO: remove in conan v2 self.cpp_info.names["cmake_find_package"] = "avif" self.cpp_info.names["cmake_find_package_multi"] = "avif" self.cpp_info.filenames["cmake_find_package"] = "libavif" self.cpp_info.filenames["cmake_find_package_multi"] = "libavif" - self.cpp_info.build_modules["cmake"] = [self._alias_path] self.cpp_info.build_modules["cmake_find_package"] = [self._alias_path] self.cpp_info.build_modules["cmake_find_package_multi"] = \ [self._alias_path] - self.cpp_info.builddirs = ["lib"] diff --git a/recipes/libavif/all/test_package/CMakeLists.txt b/recipes/libavif/all/test_package/CMakeLists.txt index 403b265b00020..b46c3a250bddb 100644 --- a/recipes/libavif/all/test_package/CMakeLists.txt +++ b/recipes/libavif/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) +project(test_package LANGUAGES C) find_package(libavif REQUIRED CONFIG) diff --git a/recipes/libavif/all/test_package/conanfile.py b/recipes/libavif/all/test_package/conanfile.py index ec80e0c5cc134..0a6bc68712d90 100644 --- a/recipes/libavif/all/test_package/conanfile.py +++ b/recipes/libavif/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools - class TestPackageConan(ConanFile): - settings = ("os", "compiler", "build_type", "arch") - generators = ("cmake", "cmake_find_package_multi") + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libavif/all/test_v1_package/CMakeLists.txt b/recipes/libavif/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..23152240acea8 --- /dev/null +++ b/recipes/libavif/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libavif REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.c) +target_link_libraries(test_package PRIVATE avif) diff --git a/recipes/libavif/all/test_v1_package/conanfile.py b/recipes/libavif/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libavif/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From f2337518201a7a2813afbefbc81ee928a86798b9 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 23 Sep 2022 16:25:40 +0200 Subject: [PATCH 175/561] (#13071) uncrustify: conan v2 support --- recipes/uncrustify/all/CMakeLists.txt | 4 -- recipes/uncrustify/all/conanfile.py | 68 +++++++++---------- .../uncrustify/all/test_package/conanfile.py | 12 +++- .../all/test_v1_package/conanfile.py | 9 +++ 4 files changed, 52 insertions(+), 41 deletions(-) delete mode 100644 recipes/uncrustify/all/CMakeLists.txt create mode 100644 recipes/uncrustify/all/test_v1_package/conanfile.py diff --git a/recipes/uncrustify/all/CMakeLists.txt b/recipes/uncrustify/all/CMakeLists.txt deleted file mode 100644 index 6daa96f1f210a..0000000000000 --- a/recipes/uncrustify/all/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -add_subdirectory("source_subfolder") diff --git a/recipes/uncrustify/all/conanfile.py b/recipes/uncrustify/all/conanfile.py index 85c2f0f6f2b23..da8a4d29e3f0e 100644 --- a/recipes/uncrustify/all/conanfile.py +++ b/recipes/uncrustify/all/conanfile.py @@ -1,10 +1,12 @@ -from conans import ConanFile, CMake, tools -from conan.tools.files import rename -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, mkdir, rename, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os -import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.47.0" class UncrustifyConan(ConanFile): @@ -15,41 +17,40 @@ class UncrustifyConan(ConanFile): homepage = "https://github.com/uncrustify/uncrustify" url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" - exports_sources = "CMakeLists.txt" - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") - @property - def _build_subfolder(self): - return "build_subfolder" + def package_id(self): + del self.info.settings.compiler def validate(self): - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "7": - raise ConanInvalidConfiguration(f"{self.name} requires GCC >=8") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=7") def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure(build_folder=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["NoGitVersionString"] = True + tc.variables["BUILD_TESTING"] = False + tc.generate() def build(self): - cmake = self._configure_cmake() + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) - if self.settings.os == "Windows": - tools.mkdir(os.path.join(self.package_folder, "bin")) + if is_msvc(self): + mkdir(self, os.path.join(self.package_folder, "bin")) rename(self, os.path.join(self.package_folder, "uncrustify.exe"), os.path.join(self.package_folder, "bin", "uncrustify.exe")) os.remove(os.path.join(self.package_folder, "AUTHORS")) @@ -58,16 +59,15 @@ def package(self): os.remove(os.path.join(self.package_folder, "ChangeLog")) os.remove(os.path.join(self.package_folder, "HELP")) os.remove(os.path.join(self.package_folder, "README.md")) - tools.rmdir(os.path.join(self.package_folder, "cfg")) - tools.rmdir(os.path.join(self.package_folder, "doc")) - - tools.rmdir(os.path.join(self.package_folder, "share")) - - def package_id(self): - del self.info.settings.compiler + rmdir(self, os.path.join(self.package_folder, "cfg")) + rmdir(self, os.path.join(self.package_folder, "doc")) def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 binpath = os.path.join(self.package_folder, "bin") self.output.info(f"Adding to PATH: {binpath}") self.env_info.PATH.append(binpath) - self.cpp_info.includedirs = [] diff --git a/recipes/uncrustify/all/test_package/conanfile.py b/recipes/uncrustify/all/test_package/conanfile.py index a60815102333e..ca7e7aabaf2bf 100644 --- a/recipes/uncrustify/all/test_package/conanfile.py +++ b/recipes/uncrustify/all/test_package/conanfile.py @@ -1,9 +1,15 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self): - self.run("uncrustify --version", run_environment=True) + if can_run(self): + self.run("uncrustify --version", env="conanrun") diff --git a/recipes/uncrustify/all/test_v1_package/conanfile.py b/recipes/uncrustify/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a60815102333e --- /dev/null +++ b/recipes/uncrustify/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("uncrustify --version", run_environment=True) From a90344ef519132b94de3d6060d10a10ccfe8a5fe Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 23 Sep 2022 16:44:57 +0200 Subject: [PATCH 176/561] (#13073) units: conan v2 support * conan v2 support * typo --- recipes/units/all/conandata.yml | 6 +- recipes/units/all/conanfile.py | 82 +++++++++++-------- recipes/units/all/test_package/CMakeLists.txt | 13 ++- recipes/units/all/test_package/conanfile.py | 22 +++-- .../{unitstest.cpp => test_package.cpp} | 0 .../units/all/test_v1_package/CMakeLists.txt | 11 +++ .../units/all/test_v1_package/conanfile.py | 17 ++++ 7 files changed, 101 insertions(+), 50 deletions(-) rename recipes/units/all/test_package/{unitstest.cpp => test_package.cpp} (100%) create mode 100644 recipes/units/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/units/all/test_v1_package/conanfile.py diff --git a/recipes/units/all/conandata.yml b/recipes/units/all/conandata.yml index 3a9acfbdba5f7..919cb85ead53a 100644 --- a/recipes/units/all/conandata.yml +++ b/recipes/units/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "2.3.1": - url: https://github.com/nholthaus/units/archive/v2.3.1.tar.gz - sha256: 4a242a6e1b117f0234dffc2796c9133ca57d114f0fdf2c200754e6770db6bfd8 + "2.3.1": + url: "https://github.com/nholthaus/units/archive/v2.3.1.tar.gz" + sha256: "4a242a6e1b117f0234dffc2796c9133ca57d114f0fdf2c200754e6770db6bfd8" diff --git a/recipes/units/all/conanfile.py b/recipes/units/all/conanfile.py index dad45a55f097d..abb3f73f19041 100644 --- a/recipes/units/all/conanfile.py +++ b/recipes/units/all/conanfile.py @@ -1,51 +1,67 @@ +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.scm import Version import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from conans.tools import Version +required_conan_version = ">=1.50.0" class UnitsConan(ConanFile): name = "units" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/nholthaus/units" - description = "A compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies" + description = ( + "A compile-time, header-only, dimensional analysis and unit conversion " + "library built on c++14 with no dependencies" + ) + license = "MIT" topics = ("unit-conversion", "dimensional-analysis", "cpp14", "template-metaprogramming", "compile-time", "header-only", "no-dependencies") - license = "MIT" + homepage = "https://github.com/nholthaus/units" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = "compiler" - _source_subfolder = "source_subfolder" + @property + def _min_cppstd(self): + return "14" - def configure(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "14") - minimum_version = { - "clang": 3.4, + @property + def _minimum_compilers_version(self): + return { + "clang": "3.4", "gcc": "4.9.3", - "Visual Studio": 14.0, - }.get(str(self.settings.compiler)) - if not minimum_version: - self.output.warn( - "Unknown compiler: assuming compiler supports C++14") - else: - if Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - "Compiler does not support C++14") + "Visual Studio": "14", + "msvc": "190", + } + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy( - "units.h", - dst="include", - src=os.path.join(self._source_subfolder, "include")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "units.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "units") + self.cpp_info.set_property("cmake_target_name", "units::units") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/units/all/test_package/CMakeLists.txt b/recipes/units/all/test_package/CMakeLists.txt index 6458832a89f30..34eb08429bc23 100644 --- a/recipes/units/all/test_package/CMakeLists.txt +++ b/recipes/units/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(unitstest CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(units REQUIRED CONFIG) -add_executable(${PROJECT_NAME} ${PROJECT_NAME}.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE units::units) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/units/all/test_package/conanfile.py b/recipes/units/all/test_package/conanfile.py index f62c3328307cc..0a6bc68712d90 100644 --- a/recipes/units/all/test_package/conanfile.py +++ b/recipes/units/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import CMake, ConanFile, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" -class UnitsTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "unitstest") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/units/all/test_package/unitstest.cpp b/recipes/units/all/test_package/test_package.cpp similarity index 100% rename from recipes/units/all/test_package/unitstest.cpp rename to recipes/units/all/test_package/test_package.cpp diff --git a/recipes/units/all/test_v1_package/CMakeLists.txt b/recipes/units/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b01d1d5fd06ef --- /dev/null +++ b/recipes/units/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(units REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE units::units) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/units/all/test_v1_package/conanfile.py b/recipes/units/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e0a85886fc12c --- /dev/null +++ b/recipes/units/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 82eb1890ae00e2982cfebaf6124a77f0bdd612f8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 23 Sep 2022 18:05:46 +0200 Subject: [PATCH 177/561] (#13074) utf8proc: conan v2 support --- recipes/utf8proc/all/CMakeLists.txt | 7 -- recipes/utf8proc/all/conanfile.py | 65 ++++++++++--------- .../utf8proc/all/test_package/CMakeLists.txt | 11 ++-- .../utf8proc/all/test_package/conanfile.py | 18 +++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../utf8proc/all/test_v1_package/conanfile.py | 17 +++++ 6 files changed, 80 insertions(+), 48 deletions(-) delete mode 100644 recipes/utf8proc/all/CMakeLists.txt create mode 100644 recipes/utf8proc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/utf8proc/all/test_v1_package/conanfile.py diff --git a/recipes/utf8proc/all/CMakeLists.txt b/recipes/utf8proc/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f..0000000000000 --- a/recipes/utf8proc/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/utf8proc/all/conanfile.py b/recipes/utf8proc/all/conanfile.py index 66de4c17f64fc..698e23be72ec9 100644 --- a/recipes/utf8proc/all/conanfile.py +++ b/recipes/utf8proc/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" + class Utf8ProcConan(ConanFile): name = "utf8proc" @@ -10,8 +14,7 @@ class Utf8ProcConan(ConanFile): description = "A clean C library for processing UTF-8 Unicode data" topics = ("utf", "utf8", "unicode", "text") license = "MIT expat" - exports_sources = "CMakeLists.txt" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,48 +25,50 @@ class Utf8ProcConan(ConanFile): "fPIC": True, } - _cmake = None - - @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 - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") 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], + destination=self.source_folder, strip_root=True) - 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 generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.md", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.md", 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["pkg_config"] = "libutf8proc" - self.cpp_info.libs = ["utf8proc_static" if self.settings.compiler == "Visual Studio" and not self.options.shared else "utf8proc"] + self.cpp_info.set_property("pkg_config_name", "libutf8proc") + suffix = "_static" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"utf8proc{suffix}"] if not self.options.shared: self.cpp_info.defines = ["UTF8PROC_STATIC"] diff --git a/recipes/utf8proc/all/test_package/CMakeLists.txt b/recipes/utf8proc/all/test_package/CMakeLists.txt index 3a215a752bdf4..55f8f30732e29 100644 --- a/recipes/utf8proc/all/test_package/CMakeLists.txt +++ b/recipes/utf8proc/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(utf8proc REQUIRED CONFIG) -find_package(utf8proc CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c) -target_link_libraries(${PROJECT_NAME} utf8proc::utf8proc) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8proc::utf8proc) diff --git a/recipes/utf8proc/all/test_package/conanfile.py b/recipes/utf8proc/all/test_package/conanfile.py index 9b63bd176646b..0a6bc68712d90 100644 --- a/recipes/utf8proc/all/test_package/conanfile.py +++ b/recipes/utf8proc/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/utf8proc/all/test_v1_package/CMakeLists.txt b/recipes/utf8proc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..93470a5a40dd5 --- /dev/null +++ b/recipes/utf8proc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(utf8proc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8proc::utf8proc) diff --git a/recipes/utf8proc/all/test_v1_package/conanfile.py b/recipes/utf8proc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/utf8proc/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From c5fb0967968c0e643e228bb5016d163095d9b753 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 23 Sep 2022 18:25:21 +0200 Subject: [PATCH 178/561] (#13075) utf8.h: conan v2 support --- recipes/utf8.h/all/conanfile.py | 34 ++++++++++++------- .../utf8.h/all/test_package/CMakeLists.txt | 7 ++-- recipes/utf8.h/all/test_package/conanfile.py | 21 ++++++++---- .../utf8.h/all/test_v1_package/CMakeLists.txt | 10 ++++++ .../utf8.h/all/test_v1_package/conanfile.py | 17 ++++++++++ 5 files changed, 66 insertions(+), 23 deletions(-) create mode 100644 recipes/utf8.h/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/utf8.h/all/test_v1_package/conanfile.py diff --git a/recipes/utf8.h/all/conanfile.py b/recipes/utf8.h/all/conanfile.py index 635e886398dd2..3c63ca89d6157 100644 --- a/recipes/utf8.h/all/conanfile.py +++ b/recipes/utf8.h/all/conanfile.py @@ -1,6 +1,9 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -import glob -from conans import ConanFile, tools + +required_conan_version = ">=1.50.0" class Utf8HConan(ConanFile): @@ -10,20 +13,27 @@ class Utf8HConan(ConanFile): description = "Single header utf8 string functions for C and C++" topics = ("utf8", "unicode", "text") license = "Unlicense" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("utf8.h-*")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("utf8.h", dst="include", src=self._source_subfolder) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "utf8.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/utf8.h/all/test_package/CMakeLists.txt b/recipes/utf8.h/all/test_package/CMakeLists.txt index 6fec0df294d0a..59a397c341a04 100644 --- a/recipes/utf8.h/all/test_package/CMakeLists.txt +++ b/recipes/utf8.h/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package LANGUAGES CXX) find_package(utf8.h REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} utf8.h::utf8.h) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8.h::utf8.h) diff --git a/recipes/utf8.h/all/test_package/conanfile.py b/recipes/utf8.h/all/test_package/conanfile.py index abcaeed3f89b6..0a6bc68712d90 100644 --- a/recipes/utf8.h/all/test_package/conanfile.py +++ b/recipes/utf8.h/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, cmake_layout import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/utf8.h/all/test_v1_package/CMakeLists.txt b/recipes/utf8.h/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e35aca1f7a135 --- /dev/null +++ b/recipes/utf8.h/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(utf8.h REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE utf8.h::utf8.h) diff --git a/recipes/utf8.h/all/test_v1_package/conanfile.py b/recipes/utf8.h/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/utf8.h/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 0a7532d6b7e889dfd43a60707ff89507e094c6a0 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 23 Sep 2022 18:45:42 +0200 Subject: [PATCH 179/561] (#13076) volk: add 1.3.224.0 + conan v2 support * conan v2 support * add volk/1.3.224.0 --- recipes/volk/all/CMakeLists.txt | 7 -- recipes/volk/all/conandata.yml | 3 + recipes/volk/all/conanfile.py | 66 +++++++++++-------- recipes/volk/all/test_package/CMakeLists.txt | 9 +-- recipes/volk/all/test_package/conanfile.py | 21 ++++-- .../volk/all/test_v1_package/CMakeLists.txt | 14 ++++ recipes/volk/all/test_v1_package/conanfile.py | 17 +++++ recipes/volk/config.yml | 2 + 8 files changed, 93 insertions(+), 46 deletions(-) delete mode 100644 recipes/volk/all/CMakeLists.txt create mode 100644 recipes/volk/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/volk/all/test_v1_package/conanfile.py diff --git a/recipes/volk/all/CMakeLists.txt b/recipes/volk/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f..0000000000000 --- a/recipes/volk/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/volk/all/conandata.yml b/recipes/volk/all/conandata.yml index 51d3cb8ae93f1..68f400091e69b 100644 --- a/recipes/volk/all/conandata.yml +++ b/recipes/volk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.224.0": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "c9f9dd80dc8f3cd28b1d3d5716bb5e56be966b88aa9c54b18d793df8f60abc36" "1.3.216.0": url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.216.0.tar.gz" sha256: "cbbbcad79d84081f21a3cfa3261819a4fa2012cd8e6965136bdebb444bae063c" diff --git a/recipes/volk/all/conanfile.py b/recipes/volk/all/conanfile.py index 691cdc3d5bfc7..4d95cbead05b0 100644 --- a/recipes/volk/all/conanfile.py +++ b/recipes/volk/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.47.0" class VolkConan(ConanFile): @@ -20,7 +22,7 @@ class VolkConan(ConanFile): ) topics = ("vulkan", "loader", "extension", "entrypoint", "graphics") - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], } @@ -28,46 +30,54 @@ class VolkConan(ConanFile): "fPIC": True, } - exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("vulkan-headers/" + self.version) + self.requires(f"vulkan-headers/{self.version}") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["VOLK_INSTALL"] = True - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VOLK_PULL_IN_VULKAN"] = True + tc.variables["VOLK_INSTALL"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "find_package(Vulkan QUIET)", "find_package(VulkanHeaders REQUIRED)") + replace_in_file(self, cmakelists, "Vulkan::Vulkan", "Vulkan::Headers") def build(self): - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.md", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.md", 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): self.cpp_info.set_property("cmake_file_name", "volk") diff --git a/recipes/volk/all/test_package/CMakeLists.txt b/recipes/volk/all/test_package/CMakeLists.txt index bd1fc171d101b..f79c7351a572f 100644 --- a/recipes/volk/all/test_package/CMakeLists.txt +++ b/recipes/volk/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(volk REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} volk::volk) +target_link_libraries(${PROJECT_NAME} PRIVATE volk::volk) add_executable(${PROJECT_NAME}_nolibs test_package.c) target_compile_definitions(${PROJECT_NAME}_nolibs PRIVATE VOLK_IMPLEMENTATION) -target_link_libraries(${PROJECT_NAME}_nolibs volk::volk_headers) +target_link_libraries(${PROJECT_NAME}_nolibs PRIVATE volk::volk_headers) diff --git a/recipes/volk/all/test_package/conanfile.py b/recipes/volk/all/test_package/conanfile.py index da79ceaaf9ebd..ca066f730c2f4 100644 --- a/recipes/volk/all/test_package/conanfile.py +++ b/recipes/volk/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) - self.run(os.path.join("bin", "test_package_nolibs"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + bin_path_nolibs = os.path.join(self.cpp.build.bindirs[0], "test_package_nolibs") + self.run(bin_path_nolibs, env="conanrun") diff --git a/recipes/volk/all/test_v1_package/CMakeLists.txt b/recipes/volk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..528a71ca307f4 --- /dev/null +++ b/recipes/volk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(volk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE volk::volk) + +add_executable(${PROJECT_NAME}_nolibs ../test_package/test_package.c) +target_compile_definitions(${PROJECT_NAME}_nolibs PRIVATE VOLK_IMPLEMENTATION) +target_link_libraries(${PROJECT_NAME}_nolibs PRIVATE volk::volk_headers) diff --git a/recipes/volk/all/test_v1_package/conanfile.py b/recipes/volk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..da79ceaaf9ebd --- /dev/null +++ b/recipes/volk/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) + self.run(os.path.join("bin", "test_package_nolibs"), run_environment=True) diff --git a/recipes/volk/config.yml b/recipes/volk/config.yml index 205873f336fae..dc9db3ea45dcb 100644 --- a/recipes/volk/config.yml +++ b/recipes/volk/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.224.0": + folder: "all" "1.3.216.0": folder: "all" "1.3.204": From bee7a9ce9bb95b882235d30a8677185e665c28eb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 23 Sep 2022 19:26:09 +0200 Subject: [PATCH 180/561] (#13077) vectorclass: conan v2 support --- recipes/vectorclass/all/CMakeLists.txt | 13 +-- recipes/vectorclass/all/conanfile.py | 83 ++++++++++--------- .../all/test_package/CMakeLists.txt | 8 +- .../vectorclass/all/test_package/conanfile.py | 19 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../all/test_v1_package/conanfile.py | 17 ++++ 6 files changed, 90 insertions(+), 61 deletions(-) create mode 100644 recipes/vectorclass/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vectorclass/all/test_v1_package/conanfile.py diff --git a/recipes/vectorclass/all/CMakeLists.txt b/recipes/vectorclass/all/CMakeLists.txt index a8fe5cc4331f3..80dcca3ff846c 100644 --- a/recipes/vectorclass/all/CMakeLists.txt +++ b/recipes/vectorclass/all/CMakeLists.txt @@ -1,16 +1,9 @@ cmake_minimum_required(VERSION 3.8) +project(vectorclass LANGUAGES CXX) -project(vectorclass CXX) +file(GLOB HEADERS "${VECTORCLASS_SRC_DIR}/*.h") -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/instrset_detect.cpp) - -file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder/*.h") - -add_library(vectorclass STATIC ${SOURCES} ${HEADERS}) +add_library(vectorclass STATIC ${VECTORCLASS_SRC_DIR}/instrset_detect.cpp) target_compile_features(vectorclass PUBLIC cxx_std_17) set_target_properties(vectorclass PROPERTIES PUBLIC_HEADER "${HEADERS}") diff --git a/recipes/vectorclass/all/conanfile.py b/recipes/vectorclass/all/conanfile.py index f2a0e8cc20e75..5696b99489d45 100644 --- a/recipes/vectorclass/all/conanfile.py +++ b/recipes/vectorclass/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.51.1" class VectorclassConan(ConanFile): @@ -11,32 +15,23 @@ class VectorclassConan(ConanFile): "microprocessors with the x86 or x86/64 instruction set on " \ "Windows, Linux, and Mac platforms." license = "Apache-2.0" - topics = ("conan", "vectorclass", "vector", "simd") + topics = ("vectorclass", "vector", "simd") homepage = "https://github.com/vectorclass/version2" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - settings = ("os", "arch", "compiler", "build_type") + + settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False] + "fPIC": [True, False], } default_options = { - "fPIC": True + "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + exports_sources = "CMakeLists.txt" @property - def _build_subfolder(self): - return "build_subfolder" - - def config_options(self): - if self.settings.os == 'Windows': - del self.options.fPIC + def _min_cppstd(self): + return "17" @property def _compilers_minimum_version(self): @@ -44,46 +39,52 @@ def _compilers_minimum_version(self): "Visual Studio": "15.7", "gcc": "7", "clang": "4.0", - "apple-clang": "9.1" + "apple-clang": "9.1", } + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + def validate(self): - if self.settings.os not in ["Linux", "Windows", "Macos"] or self.settings.arch not in ["x86", "x86_64"]: + if self.info.settings.os not in ["Linux", "Windows", "Macos"] or self.info.settings.arch not in ["x86", "x86_64"]: raise ConanInvalidConfiguration("vectorclass supports Linux/Windows/macOS and x86/x86_64 only.") - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - def lazy_lt_semver(v1, v2): + def loose_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] lv2 = [int(v) for v in v2.split(".")] min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("{} {} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name, self.version)) - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} {} requires C++17, which your compiler does not support.".format(self.name, self.version)) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.info.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) 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], + destination=self.source_folder, strip_root=True) - 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["VECTORCLASS_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/vectorclass/all/test_package/CMakeLists.txt b/recipes/vectorclass/all/test_package/CMakeLists.txt index 2954126775e7b..b10c5c90bde2f 100644 --- a/recipes/vectorclass/all/test_package/CMakeLists.txt +++ b/recipes/vectorclass/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(vectorclass REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE vectorclass::vectorclass) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/vectorclass/all/test_package/conanfile.py b/recipes/vectorclass/all/test_package/conanfile.py index 5216332f39f5c..0a6bc68712d90 100644 --- a/recipes/vectorclass/all/test_package/conanfile.py +++ b/recipes/vectorclass/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/vectorclass/all/test_v1_package/CMakeLists.txt b/recipes/vectorclass/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..1d531c5d5a930 --- /dev/null +++ b/recipes/vectorclass/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(vectorclass REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vectorclass::vectorclass) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/vectorclass/all/test_v1_package/conanfile.py b/recipes/vectorclass/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vectorclass/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 0ebbe75e6a0f3b7ad01b0a00f627569c1623b530 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 23 Sep 2022 19:45:28 +0200 Subject: [PATCH 181/561] (#13080) benchmark: add 1.7.0 + conan v2 support * conan v2 support * add benckmark/1.7.0 * allow shared msvc if version >= 1.7.0 * fix compiler version comparison --- recipes/benchmark/all/CMakeLists.txt | 11 -- recipes/benchmark/all/conandata.yml | 21 ++-- recipes/benchmark/all/conanfile.py | 113 ++++++++++-------- .../benchmark/all/test_package/CMakeLists.txt | 7 +- .../benchmark/all/test_package/conanfile.py | 22 ++-- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../all/test_v1_package/conanfile.py | 18 +++ recipes/benchmark/config.yml | 8 +- 8 files changed, 125 insertions(+), 85 deletions(-) delete mode 100644 recipes/benchmark/all/CMakeLists.txt create mode 100644 recipes/benchmark/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/benchmark/all/test_v1_package/conanfile.py diff --git a/recipes/benchmark/all/CMakeLists.txt b/recipes/benchmark/all/CMakeLists.txt deleted file mode 100644 index 08bd91ff0594a..0000000000000 --- a/recipes/benchmark/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") - include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -else() - include(conanbuildinfo.cmake) -endif() -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/benchmark/all/conandata.yml b/recipes/benchmark/all/conandata.yml index bcab7bca71fa9..115dd22fdab4a 100644 --- a/recipes/benchmark/all/conandata.yml +++ b/recipes/benchmark/all/conandata.yml @@ -1,13 +1,16 @@ sources: - "1.5.6": - url: "https://github.com/google/benchmark/archive/v1.5.6.tar.gz" - sha256: "789f85b4810d13ff803834ea75999e41b326405d83d6a538baf01499eda96102" - "1.6.0": - url: "https://github.com/google/benchmark/archive/v1.6.0.tar.gz" - sha256: "1f71c72ce08d2c1310011ea6436b31e39ccab8c2db94186d26657d41747c85d6" - "1.6.1": - url: "https://github.com/google/benchmark/archive/v1.6.1.tar.gz" - sha256: "6132883bc8c9b0df5375b16ab520fac1a85dc9e4cf5be59480448ece74b278d4" + "1.7.0": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.7.0.tar.gz" + sha256: "3aff99169fa8bdee356eaa1f691e835a6e57b1efeadb8a0f9f228531158246ac" "1.6.2": url: "https://github.com/google/benchmark/archive/v1.6.2.tar.gz" sha256: "a9f77e6188c1cd4ebedfa7538bf5176d6acc72ead6f456919e5f464ef2f06158" + "1.6.1": + url: "https://github.com/google/benchmark/archive/v1.6.1.tar.gz" + sha256: "6132883bc8c9b0df5375b16ab520fac1a85dc9e4cf5be59480448ece74b278d4" + "1.6.0": + url: "https://github.com/google/benchmark/archive/v1.6.0.tar.gz" + sha256: "1f71c72ce08d2c1310011ea6436b31e39ccab8c2db94186d26657d41747c85d6" + "1.5.6": + url: "https://github.com/google/benchmark/archive/v1.5.6.tar.gz" + sha256: "789f85b4810d13ff803834ea75999e41b326405d83d6a538baf01499eda96102" diff --git a/recipes/benchmark/all/conanfile.py b/recipes/benchmark/all/conanfile.py index fbabb91905a8c..6b7ecc174442b 100644 --- a/recipes/benchmark/all/conanfile.py +++ b/recipes/benchmark/all/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class BenchmarkConan(ConanFile): @@ -13,10 +17,8 @@ class BenchmarkConan(ConanFile): url = "https://github.com/conan-io/conan-center-index/" homepage = "https://github.com/google/benchmark" license = "Apache-2.0" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - settings = "arch", "build_type", "compiler", "os" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -30,71 +32,80 @@ class BenchmarkConan(ConanFile): "enable_exceptions": True, } - _cmake = None - - @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], destination=self._source_subfolder, strip_root=True) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version.value) <= 12: - raise ConanInvalidConfiguration("{} {} does not support Visual Studio <= 12".format(self.name, self.version)) def configure(self): if self.options.shared: - del self.options.fPIC - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Windows shared builds are not supported right now, see issue #639") + try: + del self.options.fPIC + except Exception: + pass - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def layout(self): + cmake_layout(self, src_folder="src") - self._cmake.definitions["BENCHMARK_ENABLE_TESTING"] = "OFF" - self._cmake.definitions["BENCHMARK_ENABLE_GTEST_TESTS"] = "OFF" - self._cmake.definitions["BENCHMARK_ENABLE_LTO"] = "ON" if self.options.enable_lto else "OFF" - self._cmake.definitions["BENCHMARK_ENABLE_EXCEPTIONS"] = "ON" if self.options.enable_exceptions else "OFF" + def validate(self): + if self.info.settings.compiler == "Visual Studio" and Version(self.info.settings.compiler.version) <= "12": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio <= 12") + if Version(self.version) < "1.7.0" and is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support msvc shared builds") + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BENCHMARK_ENABLE_TESTING"] = "OFF" + tc.variables["BENCHMARK_ENABLE_GTEST_TESTS"] = "OFF" + tc.variables["BENCHMARK_ENABLE_LTO"] = self.options.enable_lto + tc.variables["BENCHMARK_ENABLE_EXCEPTIONS"] = self.options.enable_exceptions + if Version(self.version) >= "1.6.1": + tc.variables["BENCHMARK_ENABLE_WERROR"] = False + tc.variables["BENCHMARK_FORCE_WERROR"] = False if self.settings.os != "Windows": if cross_building(self): - self._cmake.definitions["HAVE_STD_REGEX"] = False - self._cmake.definitions["HAVE_POSIX_REGEX"] = False - self._cmake.definitions["HAVE_STEADY_CLOCK"] = False - self._cmake.definitions["BENCHMARK_USE_LIBCXX"] = "ON" if self.settings.compiler.get_safe("libcxx") == "libc++" else "OFF" + tc.variables["HAVE_STD_REGEX"] = False + tc.variables["HAVE_POSIX_REGEX"] = False + tc.variables["HAVE_STEADY_CLOCK"] = False + tc.variables["BENCHMARK_USE_LIBCXX"] = self.settings.compiler.get_safe("libcxx") == "libc++" else: - self._cmake.definitions["BENCHMARK_USE_LIBCXX"] = "OFF" - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["BENCHMARK_USE_LIBCXX"] = False + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig')) - tools.rmdir(os.path.join(self.package_folder, 'lib', 'cmake')) - tools.rmdir(os.path.join(self.package_folder, 'share')) + rmdir(self, 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, "share")) def package_info(self): - self.cpp_info.libs = ["benchmark", "benchmark_main"] + self.cpp_info.set_property("cmake_file_name", "benchmark") + self.cpp_info.set_property("pkg_config_name", "benchmark") + + self.cpp_info.components["_benchmark"].set_property("cmake_target_name", "benchmark::benchmark") + self.cpp_info.components["_benchmark"].libs = ["benchmark"] + if Version(self.version) >= "1.7.0" and not self.options.shared: + self.cpp_info.components["_benchmark"].defines.append("BENCHMARK_STATIC_DEFINE") if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.system_libs.extend(["pthread", "rt"]) + self.cpp_info.components["_benchmark"].system_libs.extend(["pthread", "rt"]) elif self.settings.os == "Windows": - self.cpp_info.system_libs.append("shlwapi") + self.cpp_info.components["_benchmark"].system_libs.append("shlwapi") elif self.settings.os == "SunOS": - self.cpp_info.system_libs.append("kstat") + self.cpp_info.components["_benchmark"].system_libs.append("kstat") + + self.cpp_info.components["benchmark_main"].set_property("cmake_target_name", "benchmark::benchmark_main") + self.cpp_info.components["benchmark_main"].libs = ["benchmark_main"] + self.cpp_info.components["benchmark_main"].requires = ["_benchmark"] + + # workaround to have all components in CMakeDeps of downstream recipes + self.cpp_info.set_property("cmake_target_name", "benchmark::benchmark_main") diff --git a/recipes/benchmark/all/test_package/CMakeLists.txt b/recipes/benchmark/all/test_package/CMakeLists.txt index 196188113685c..58358ea09a5db 100644 --- a/recipes/benchmark/all/test_package/CMakeLists.txt +++ b/recipes/benchmark/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(benchmark REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark benchmark::benchmark_main) diff --git a/recipes/benchmark/all/test_package/conanfile.py b/recipes/benchmark/all/test_package/conanfile.py index d882f9a0f3178..0a6bc68712d90 100644 --- a/recipes/benchmark/all/test_package/conanfile.py +++ b/recipes/benchmark/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/benchmark/all/test_v1_package/CMakeLists.txt b/recipes/benchmark/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a15245dc7e07 --- /dev/null +++ b/recipes/benchmark/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(benchmark REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark benchmark::benchmark_main) diff --git a/recipes/benchmark/all/test_v1_package/conanfile.py b/recipes/benchmark/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2490acfa82ff8 --- /dev/null +++ b/recipes/benchmark/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/benchmark/config.yml b/recipes/benchmark/config.yml index 75621c0323825..29d13bedc4f34 100644 --- a/recipes/benchmark/config.yml +++ b/recipes/benchmark/config.yml @@ -1,9 +1,11 @@ versions: - "1.5.6": + "1.7.0": folder: all - "1.6.0": + "1.6.2": folder: all "1.6.1": folder: all - "1.6.2": + "1.6.0": + folder: all + "1.5.6": folder: all From f896f7bc0773de8b6b634708cfce0c18ec09213d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 24 Sep 2022 02:25:34 +0200 Subject: [PATCH 182/561] (#13095) hiredis: conan v2 support --- recipes/hiredis/all/CMakeLists.txt | 7 -- recipes/hiredis/all/conandata.yml | 9 +-- recipes/hiredis/all/conanfile.py | 76 +++++++++---------- ...cmake.patch => 0001-fix-cmake-1.0.0.patch} | 20 +++-- .../{fix-aix.patch => 0002-fix-aix.patch} | 0 .../hiredis/all/test_package/CMakeLists.txt | 7 +- recipes/hiredis/all/test_package/conanfile.py | 19 +++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../hiredis/all/test_v1_package/conanfile.py | 17 +++++ 9 files changed, 98 insertions(+), 67 deletions(-) delete mode 100644 recipes/hiredis/all/CMakeLists.txt rename recipes/hiredis/all/patches/{fix-cmake.patch => 0001-fix-cmake-1.0.0.patch} (67%) rename recipes/hiredis/all/patches/{fix-aix.patch => 0002-fix-aix.patch} (100%) create mode 100644 recipes/hiredis/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hiredis/all/test_v1_package/conanfile.py diff --git a/recipes/hiredis/all/CMakeLists.txt b/recipes/hiredis/all/CMakeLists.txt deleted file mode 100644 index c921d02a0d877..0000000000000 --- a/recipes/hiredis/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/hiredis/all/conandata.yml b/recipes/hiredis/all/conandata.yml index 8b8b073d7f542..2aa3fad9d8514 100644 --- a/recipes/hiredis/all/conandata.yml +++ b/recipes/hiredis/all/conandata.yml @@ -7,10 +7,7 @@ sources: sha256: "2a0b5fe5119ec973a0c1966bfc4bd7ed39dbce1cb6d749064af9121fe971936f" patches: "1.0.2": - - patch_file: "patches/fix-cmake.patch" - base_path: "source_subfolder" - - patch_file: "patches/fix-aix.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-fix-cmake-1.0.0.patch" + - patch_file: "patches/0002-fix-aix.patch" "1.0.0": - - patch_file: "patches/fix-cmake.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-fix-cmake-1.0.0.patch" diff --git a/recipes/hiredis/all/conanfile.py b/recipes/hiredis/all/conanfile.py index 78e734d78b42b..c55723c4ae068 100644 --- a/recipes/hiredis/all/conanfile.py +++ b/recipes/hiredis/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class HiredisConan(ConanFile): @@ -24,21 +26,8 @@ class HiredisConan(ConanFile): "with_ssl": False, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -46,40 +35,51 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_ssl: self.requires("openssl/1.1.1q") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_SSL"] = self.options.with_ssl + tc.variables["DISABLE_TESTS"] = True + tc.variables["ENABLE_EXAMPLES"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_SSL"] = self.options.with_ssl - self._cmake.definitions["DISABLE_TESTS"] = True - self._cmake.definitions["ENABLE_EXAMPLES"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", 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", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "hiredis") diff --git a/recipes/hiredis/all/patches/fix-cmake.patch b/recipes/hiredis/all/patches/0001-fix-cmake-1.0.0.patch similarity index 67% rename from recipes/hiredis/all/patches/fix-cmake.patch rename to recipes/hiredis/all/patches/0001-fix-cmake-1.0.0.patch index 7e792575ef6d4..630a4c0250233 100644 --- a/recipes/hiredis/all/patches/fix-cmake.patch +++ b/recipes/hiredis/all/patches/0001-fix-cmake-1.0.0.patch @@ -1,17 +1,25 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -39,8 +39,8 @@ SET(hiredis_sources ${hiredis_sources}) - IF(WIN32) +@@ -1,6 +1,6 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 3.4.0) +-INCLUDE(GNUInstallDirs) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.8) + PROJECT(hiredis) ++INCLUDE(GNUInstallDirs) + + OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF) + OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF) +@@ -40,7 +40,8 @@ IF(WIN32) ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN) ENDIF() -- + -ADD_LIBRARY(hiredis SHARED ${hiredis_sources}) -+SET(CMAKE_C_STANDARD 99) +ADD_LIBRARY(hiredis ${hiredis_sources}) ++target_compile_features(hiredis PUBLIC c_std_99) SET_TARGET_PROPERTIES(hiredis PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE -@@ -97,7 +97,7 @@ IF(ENABLE_SSL) +@@ -97,7 +98,7 @@ IF(ENABLE_SSL) FIND_PACKAGE(OpenSSL REQUIRED) SET(hiredis_ssl_sources ssl.c) @@ -20,7 +28,7 @@ ${hiredis_ssl_sources}) IF (APPLE) -@@ -109,8 +109,7 @@ IF(ENABLE_SSL) +@@ -109,8 +110,7 @@ IF(ENABLE_SSL) WINDOWS_EXPORT_ALL_SYMBOLS TRUE VERSION "${HIREDIS_SONAME}") diff --git a/recipes/hiredis/all/patches/fix-aix.patch b/recipes/hiredis/all/patches/0002-fix-aix.patch similarity index 100% rename from recipes/hiredis/all/patches/fix-aix.patch rename to recipes/hiredis/all/patches/0002-fix-aix.patch diff --git a/recipes/hiredis/all/test_package/CMakeLists.txt b/recipes/hiredis/all/test_package/CMakeLists.txt index dec692e0271d4..49e1f3d74c74e 100644 --- a/recipes/hiredis/all/test_package/CMakeLists.txt +++ b/recipes/hiredis/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(hiredis REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} hiredis::hiredis) +target_link_libraries(${PROJECT_NAME} PRIVATE hiredis::hiredis) diff --git a/recipes/hiredis/all/test_package/conanfile.py b/recipes/hiredis/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/hiredis/all/test_package/conanfile.py +++ b/recipes/hiredis/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/hiredis/all/test_v1_package/CMakeLists.txt b/recipes/hiredis/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1ea1807c4774 --- /dev/null +++ b/recipes/hiredis/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(hiredis REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE hiredis::hiredis) diff --git a/recipes/hiredis/all/test_v1_package/conanfile.py b/recipes/hiredis/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hiredis/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 8bc034e274b1cf5b68bde8029152640dd21f41f7 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 24 Sep 2022 10:04:56 +0900 Subject: [PATCH 183/561] (#13127) quill: add version 2.2.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/quill/all/conandata.yml | 3 +++ recipes/quill/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/quill/all/conandata.yml b/recipes/quill/all/conandata.yml index be5ac14cbcc40..2ad5762a9d9e5 100644 --- a/recipes/quill/all/conandata.yml +++ b/recipes/quill/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/odygrd/quill/archive/v2.2.0.tar.gz" + sha256: "6b123b60b16d41009228d907851f025c8be974d5fcf41af0b6afbe48edebbf73" "2.1.0": url: "https://github.com/odygrd/quill/archive/v2.1.0.tar.gz" sha256: "66c59501ad827207e7d4682ccba0f1c33ca215269aa13a388df4d59ca195ee76" diff --git a/recipes/quill/config.yml b/recipes/quill/config.yml index 57285066d2137..5687ce1413095 100644 --- a/recipes/quill/config.yml +++ b/recipes/quill/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: "all" "2.1.0": folder: "all" "2.0.2": From ccff2775a1cf0f5eb1d3db9bc7e8f9e016430d18 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 24 Sep 2022 03:25:10 +0200 Subject: [PATCH 184/561] (#13096) hdrhistogram-c: conan v2 support --- recipes/hdrhistogram-c/all/CMakeLists.txt | 7 -- recipes/hdrhistogram-c/all/conandata.yml | 1 - recipes/hdrhistogram-c/all/conanfile.py | 83 ++++++++++--------- .../all/test_package/CMakeLists.txt | 7 +- .../all/test_package/conanfile.py | 19 +++-- .../all/test_v1_package/CMakeLists.txt | 14 ++++ .../all/test_v1_package/conanfile.py | 17 ++++ 7 files changed, 91 insertions(+), 57 deletions(-) delete mode 100644 recipes/hdrhistogram-c/all/CMakeLists.txt create mode 100644 recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hdrhistogram-c/all/test_v1_package/conanfile.py diff --git a/recipes/hdrhistogram-c/all/CMakeLists.txt b/recipes/hdrhistogram-c/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- a/recipes/hdrhistogram-c/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/hdrhistogram-c/all/conandata.yml b/recipes/hdrhistogram-c/all/conandata.yml index 41b43fd72aa14..b4fa682a3e25b 100644 --- a/recipes/hdrhistogram-c/all/conandata.yml +++ b/recipes/hdrhistogram-c/all/conandata.yml @@ -8,4 +8,3 @@ sources: patches: "0.11.0": - patch_file: "patches/cmake-install.patch" - base_path: "source_subfolder" diff --git a/recipes/hdrhistogram-c/all/conanfile.py b/recipes/hdrhistogram-c/all/conanfile.py index 5d9f68b60c0e1..1aa5b94776c55 100644 --- a/recipes/hdrhistogram-c/all/conanfile.py +++ b/recipes/hdrhistogram-c/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class HdrhistogramcConan(ConanFile): @@ -22,17 +24,8 @@ class HdrhistogramcConan(ConanFile): "shared": False, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -40,49 +33,61 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("zlib/1.2.12") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["HDR_HISTOGRAM_BUILD_PROGRAMS"] = False - self._cmake.definitions["HDR_HISTOGRAM_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["HDR_HISTOGRAM_INSTALL_SHARED"] = self.options.shared - self._cmake.definitions["HDR_HISTOGRAM_BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["HDR_HISTOGRAM_INSTALL_STATIC"] = not self.options.shared - self._cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["HDR_HISTOGRAM_BUILD_PROGRAMS"] = False + tc.variables["HDR_HISTOGRAM_BUILD_SHARED"] = self.options.shared + tc.variables["HDR_HISTOGRAM_INSTALL_SHARED"] = self.options.shared + tc.variables["HDR_HISTOGRAM_BUILD_STATIC"] = not self.options.shared + tc.variables["HDR_HISTOGRAM_INSTALL_STATIC"] = not self.options.shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - self.copy("COPYING.txt", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): target = "hdr_histogram" if self.options.shared else "hdr_histogram_static" self.cpp_info.set_property("cmake_file_name", "hdr_histogram") - self.cpp_info.set_property("cmake_target_name", "hdr_histogram::{}".format(target)) + self.cpp_info.set_property("cmake_target_name", f"hdr_histogram::{target}") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["hdr_histrogram"].libs = tools.collect_libs(self) + self.cpp_info.components["hdr_histrogram"].libs = collect_libs(self) self.cpp_info.components["hdr_histrogram"].includedirs.append(os.path.join("include", "hdr")) if not self.options.shared: if self.settings.os in ["Linux", "FreeBSD"]: @@ -95,5 +100,5 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "hdr_histogram" self.cpp_info.components["hdr_histrogram"].names["cmake_find_package"] = target self.cpp_info.components["hdr_histrogram"].names["cmake_find_package_multi"] = target - self.cpp_info.components["hdr_histrogram"].set_property("cmake_target_name", "hdr_histogram::{}".format(target)) + self.cpp_info.components["hdr_histrogram"].set_property("cmake_target_name", f"hdr_histogram::{target}") self.cpp_info.components["hdr_histrogram"].requires = ["zlib::zlib"] diff --git a/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt b/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt index 749b53ae5c99a..43cecb9cf0752 100644 --- a/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt +++ b/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(hdr_histogram REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) if(TARGET hdr_histogram::hdr_histogram_static) - target_link_libraries(${PROJECT_NAME} hdr_histogram::hdr_histogram_static) + target_link_libraries(${PROJECT_NAME} PRIVATE hdr_histogram::hdr_histogram_static) else() - target_link_libraries(${PROJECT_NAME} hdr_histogram::hdr_histogram) + target_link_libraries(${PROJECT_NAME} PRIVATE hdr_histogram::hdr_histogram) endif() diff --git a/recipes/hdrhistogram-c/all/test_package/conanfile.py b/recipes/hdrhistogram-c/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/hdrhistogram-c/all/test_package/conanfile.py +++ b/recipes/hdrhistogram-c/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt b/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0f3ffb58a6c47 --- /dev/null +++ b/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(hdr_histogram REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(TARGET hdr_histogram::hdr_histogram_static) + target_link_libraries(${PROJECT_NAME} PRIVATE hdr_histogram::hdr_histogram_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE hdr_histogram::hdr_histogram) +endif() diff --git a/recipes/hdrhistogram-c/all/test_v1_package/conanfile.py b/recipes/hdrhistogram-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/hdrhistogram-c/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From e382640e3f8144aab888389d72e7c30dfd85315e Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 24 Sep 2022 04:45:10 +0200 Subject: [PATCH 185/561] (#13097) libschrift: conan v2 support * conan v2 support * restore strict C99 --- recipes/libschrift/all/CMakeLists.txt | 8 +-- recipes/libschrift/all/conanfile.py | 52 +++++++++++-------- .../all/test_package/CMakeLists.txt | 5 +- .../libschrift/all/test_package/conanfile.py | 20 +++++-- .../all/test_v1_package/CMakeLists.txt | 10 ++++ .../all/test_v1_package/conanfile.py | 18 +++++++ 6 files changed, 76 insertions(+), 37 deletions(-) create mode 100644 recipes/libschrift/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libschrift/all/test_v1_package/conanfile.py diff --git a/recipes/libschrift/all/CMakeLists.txt b/recipes/libschrift/all/CMakeLists.txt index 7833150cb7a02..89baaf56270d3 100644 --- a/recipes/libschrift/all/CMakeLists.txt +++ b/recipes/libschrift/all/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required(VERSION 3.8) project(schrift LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - include(GNUInstallDirs) -add_library(schrift source_subfolder/schrift.c) -target_compile_features(schrift PRIVATE c_std_99) +add_library(schrift ${LIBSCHRIFT_SRC_DIR}/schrift.c) set_target_properties(schrift PROPERTIES - PUBLIC_HEADER source_subfolder/schrift.h + PUBLIC_HEADER ${LIBSCHRIFT_SRC_DIR}/schrift.h WINDOWS_EXPORT_ALL_SYMBOLS ON C_EXTENSIONS OFF C_STANDARD 99 diff --git a/recipes/libschrift/all/conanfile.py b/recipes/libschrift/all/conanfile.py index 54ef03bcf7593..949296527320a 100644 --- a/recipes/libschrift/all/conanfile.py +++ b/recipes/libschrift/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.46.0" + class LibschriftConan(ConanFile): name = "libschrift" @@ -22,12 +25,6 @@ class LibschriftConan(ConanFile): } exports_sources = ["CMakeLists.txt"] - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" def config_options(self): if self.settings.os == "Windows": @@ -35,28 +32,39 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBSCHRIFT_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/libschrift/all/test_package/CMakeLists.txt b/recipes/libschrift/all/test_package/CMakeLists.txt index 7e8a08a26324f..36819133561d5 100644 --- a/recipes/libschrift/all/test_package/CMakeLists.txt +++ b/recipes/libschrift/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(libschrift REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libschrift::libschrift) +target_link_libraries(${PROJECT_NAME} PRIVATE libschrift::libschrift) diff --git a/recipes/libschrift/all/test_package/conanfile.py b/recipes/libschrift/all/test_package/conanfile.py index a77ba6c16f4ae..d4c18b77de306 100644 --- a/recipes/libschrift/all/test_package/conanfile.py +++ b/recipes/libschrift/all/test_package/conanfile.py @@ -1,9 +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, cmake_layout import os + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -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.bindirs[0], "test_package") font_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") - self.run("{} {}".format(bin_path, font_path), run_environment=True) + self.run(f"{bin_path} {font_path}", env="conanrun") diff --git a/recipes/libschrift/all/test_v1_package/CMakeLists.txt b/recipes/libschrift/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a36c74cedeb93 --- /dev/null +++ b/recipes/libschrift/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libschrift REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libschrift::libschrift) diff --git a/recipes/libschrift/all/test_v1_package/conanfile.py b/recipes/libschrift/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..da2d908b1d4a7 --- /dev/null +++ b/recipes/libschrift/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", run_environment=True) From 0fa0bfaad13c3fd798626c1a74b9a183e3e3bd01 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 24 Sep 2022 06:04:45 +0200 Subject: [PATCH 186/561] (#13098) leveldb: conan v2 support --- recipes/leveldb/all/CMakeLists.txt | 7 -- recipes/leveldb/all/conandata.yml | 2 - recipes/leveldb/all/conanfile.py | 68 +++++++++---------- .../leveldb/all/test_package/CMakeLists.txt | 11 ++- recipes/leveldb/all/test_package/conanfile.py | 19 ++++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../leveldb/all/test_v1_package/conanfile.py | 17 +++++ 7 files changed, 80 insertions(+), 55 deletions(-) delete mode 100644 recipes/leveldb/all/CMakeLists.txt create mode 100644 recipes/leveldb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/leveldb/all/test_v1_package/conanfile.py diff --git a/recipes/leveldb/all/CMakeLists.txt b/recipes/leveldb/all/CMakeLists.txt deleted file mode 100644 index 5927671e52e95..0000000000000 --- a/recipes/leveldb/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/leveldb/all/conandata.yml b/recipes/leveldb/all/conandata.yml index 9cd0c9e32caf4..904735bb768f7 100644 --- a/recipes/leveldb/all/conandata.yml +++ b/recipes/leveldb/all/conandata.yml @@ -8,7 +8,5 @@ sources: patches: "1.23": - patch_file: "patches/check_library_exists.1.23.patch" - base_path: "source_subfolder" "1.22": - patch_file: "patches/check_library_exists.1.22.patch" - base_path: "source_subfolder" diff --git a/recipes/leveldb/all/conanfile.py b/recipes/leveldb/all/conanfile.py index c7441605c206c..7aefd15a7bf6f 100644 --- a/recipes/leveldb/all/conanfile.py +++ b/recipes/leveldb/all/conanfile.py @@ -1,8 +1,10 @@ -from conans import CMake, ConanFile, tools -import functools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class LevelDBCppConan(ConanFile): @@ -30,16 +32,8 @@ class LevelDBCppConan(ConanFile): "with_crc32c": True, } - generators = "cmake", "cmake_find_package_multi" - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -47,46 +41,52 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - # FIXME: tcmalloc is also conditionally included in leveldb, but - # there is no "official" conan package yet; when that is available, we - # can add similar with options for those + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): + # FIXME: tcmalloc is also conditionally included in leveldb, but + # there is no "official" conan package yet; when that is available, we + # can add similar with options for those if self.options.with_snappy: self.requires("snappy/1.1.9") if self.options.with_crc32c: self.requires("crc32c/1.1.2") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LEVELDB_BUILD_TESTS"] = False + tc.variables["LEVELDB_BUILD_BENCHMARKS"] = False + tc.variables["HAVE_SNAPPY"] = self.options.with_snappy + tc.variables["HAVE_CRC32C"] = self.options.with_crc32c + tc.generate() + deps = CMakeDeps(self) + deps.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): + apply_conandata_patches(self) cmake = CMake(self) - cmake.definitions["LEVELDB_BUILD_TESTS"] = False - cmake.definitions["LEVELDB_BUILD_BENCHMARKS"] = False - cmake.definitions["HAVE_SNAPPY"] = self.options.with_snappy - cmake.definitions["HAVE_CRC32C"] = self.options.with_crc32c cmake.configure() - return cmake - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - 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): self.cpp_info.set_property("cmake_file_name", "leveldb") diff --git a/recipes/leveldb/all/test_package/CMakeLists.txt b/recipes/leveldb/all/test_package/CMakeLists.txt index b172f9a98e165..c55600d5161fd 100644 --- a/recipes/leveldb/all/test_package/CMakeLists.txt +++ b/recipes/leveldb/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(leveldb REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} leveldb::leveldb) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE leveldb::leveldb) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/leveldb/all/test_package/conanfile.py b/recipes/leveldb/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/leveldb/all/test_package/conanfile.py +++ b/recipes/leveldb/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/leveldb/all/test_v1_package/CMakeLists.txt b/recipes/leveldb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..add355dae7008 --- /dev/null +++ b/recipes/leveldb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(leveldb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE leveldb::leveldb) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/leveldb/all/test_v1_package/conanfile.py b/recipes/leveldb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/leveldb/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 476048b33d89ce3de2c591ca7736c04492231b6e Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 24 Sep 2022 07:44:33 +0200 Subject: [PATCH 187/561] (#13099) leptonica: conan v2 support * conan v2 support * bump dependencies --- recipes/leptonica/all/CMakeLists.txt | 7 - recipes/leptonica/all/conandata.yml | 1 - recipes/leptonica/all/conanfile.py | 182 +++++++++--------- .../leptonica/all/test_package/CMakeLists.txt | 7 +- .../leptonica/all/test_package/conanfile.py | 21 +- .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 ++ 7 files changed, 140 insertions(+), 105 deletions(-) delete mode 100644 recipes/leptonica/all/CMakeLists.txt create mode 100644 recipes/leptonica/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/leptonica/all/test_v1_package/conanfile.py diff --git a/recipes/leptonica/all/CMakeLists.txt b/recipes/leptonica/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/leptonica/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/leptonica/all/conandata.yml b/recipes/leptonica/all/conandata.yml index 8f3c853016fab..452eea8cdafea 100644 --- a/recipes/leptonica/all/conandata.yml +++ b/recipes/leptonica/all/conandata.yml @@ -17,4 +17,3 @@ sources: patches: "1.78.0": - patch_file: "patches/fix-find-modules-variables.patch" - base_path: "source_subfolder" diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index 7f5894cd0595f..1dbbdf5af8280 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class LeptonicaConan(ConanFile): @@ -38,21 +43,8 @@ class LeptonicaConan(ConanFile): "with_webp": True, } - generators = "cmake", "cmake_find_package", "pkg_config" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -60,9 +52,21 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_zlib: @@ -72,119 +76,126 @@ def requirements(self): if self.options.with_jpeg: self.requires("libjpeg/9d") if self.options.with_png: - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.38") if self.options.with_tiff: - self.requires("libtiff/4.3.0") + self.requires("libtiff/4.4.0") if self.options.with_openjpeg: - self.requires("openjpeg/2.4.0") + self.requires("openjpeg/2.5.0") if self.options.with_webp: - self.requires("libwebp/1.2.2") + self.requires("libwebp/1.2.4") def build_requirements(self): if self.options.with_webp or self.options.with_openjpeg: - self.build_requires("pkgconf/1.7.4") + self.tool_requires("pkgconf/1.7.4") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "1.79.0": + tc.variables["STATIC"] = not self.options.shared + tc.variables["BUILD_PROG"] = False + tc.variables["SW_BUILD"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + if self.options.with_webp or self.options.with_openjpeg: + pc = PkgConfigDeps(self) + pc.generate() + env = VirtualBuildEnv(self) + env.generate() + # TODO: to remove when properly handled by conan (see https://github.com/conan-io/conan/issues/11962) + env = Environment() + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + env.vars(self).save_script("conanbuildenv_pkg_config_path") def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") - cmakelists_src = os.path.join(self._source_subfolder, "src", "CMakeLists.txt") - cmake_configure = os.path.join(self._source_subfolder, "cmake", "Configure.cmake") - - # Fix installation - tools.replace_in_file(cmakelists_src, "${CMAKE_BINARY_DIR}", "${PROJECT_BINARY_DIR}") + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + cmakelists_src = os.path.join(self.source_folder, "src", "CMakeLists.txt") + cmake_configure = os.path.join(self.source_folder, "cmake", "Configure.cmake") # Honor options and inject dependencies definitions # TODO: submit a patch upstream ## zlib - tools.replace_in_file(cmakelists_src, "${ZLIB_LIBRARIES}", "ZLIB::ZLIB") + replace_in_file(self, cmakelists_src, "${ZLIB_LIBRARIES}", "ZLIB::ZLIB") if not self.options.with_zlib: - tools.replace_in_file(cmakelists_src, "if (ZLIB_LIBRARIES)", "if(0)") - tools.replace_in_file(cmake_configure, "if (ZLIB_FOUND)", "if(0)") + replace_in_file(self, cmakelists_src, "if (ZLIB_LIBRARIES)", "if(0)") + replace_in_file(self, cmake_configure, "if (ZLIB_FOUND)", "if(0)") ## giflib - tools.replace_in_file(cmakelists_src, "${GIF_LIBRARIES}", "GIF::GIF") + replace_in_file(self, cmakelists_src, "${GIF_LIBRARIES}", "GIF::GIF") if not self.options.with_gif: - tools.replace_in_file(cmakelists_src, "if (GIF_LIBRARIES)", "if(0)") - tools.replace_in_file(cmake_configure, "if (GIF_FOUND)", "if(0)") + replace_in_file(self, cmakelists_src, "if (GIF_LIBRARIES)", "if(0)") + replace_in_file(self, cmake_configure, "if (GIF_FOUND)", "if(0)") ## libjpeg - tools.replace_in_file(cmakelists_src, "${JPEG_LIBRARIES}", "JPEG::JPEG") + replace_in_file(self, cmakelists_src, "${JPEG_LIBRARIES}", "JPEG::JPEG") if not self.options.with_jpeg: - tools.replace_in_file(cmakelists_src, "if (JPEG_LIBRARIES)", "if(0)") - tools.replace_in_file(cmake_configure, "if (JPEG_FOUND)", "if(0)") + replace_in_file(self, cmakelists_src, "if (JPEG_LIBRARIES)", "if(0)") + replace_in_file(self, cmake_configure, "if (JPEG_FOUND)", "if(0)") ## libpng - tools.replace_in_file(cmakelists_src, "${PNG_LIBRARIES}", "PNG::PNG") + replace_in_file(self, cmakelists_src, "${PNG_LIBRARIES}", "PNG::PNG") if not self.options.with_png: - tools.replace_in_file(cmakelists_src, "if (PNG_LIBRARIES)", "if(0)") - tools.replace_in_file(cmake_configure, "if (PNG_FOUND)", "if(0)") + replace_in_file(self, cmakelists_src, "if (PNG_LIBRARIES)", "if(0)") + replace_in_file(self, cmake_configure, "if (PNG_FOUND)", "if(0)") ## libtiff - tools.replace_in_file(cmakelists_src, "${TIFF_LIBRARIES}", "TIFF::TIFF") + replace_in_file(self, cmakelists_src, "${TIFF_LIBRARIES}", "TIFF::TIFF") if not self.options.with_tiff: - tools.replace_in_file(cmakelists_src, "if (TIFF_LIBRARIES)", "if(0)") - tools.replace_in_file(cmake_configure, "if (TIFF_FOUND)", "if(0)") + replace_in_file(self, cmakelists_src, "if (TIFF_LIBRARIES)", "if(0)") + replace_in_file(self, cmake_configure, "if (TIFF_FOUND)", "if(0)") ## We have to be more aggressive with dependencies found with pkgconfig ## Injection of libdirs is ensured by conan_basic_setup() ## openjpeg - tools.replace_in_file(cmakelists, "if(NOT JP2K)", "if(0)") - tools.replace_in_file(cmakelists_src, + replace_in_file(self, cmakelists, "if(NOT JP2K)", "if(0)") + replace_in_file(self, cmakelists_src, "if (JP2K_FOUND)", "if (JP2K_FOUND)\n" + "target_link_directories(leptonica PRIVATE ${JP2K_LIBRARY_DIRS})\n" "target_compile_definitions(leptonica PRIVATE ${JP2K_CFLAGS_OTHER})") if not self.options.with_openjpeg: - tools.replace_in_file(cmakelists_src, "if (JP2K_FOUND)", "if(0)") - tools.replace_in_file(cmake_configure, "if (JP2K_FOUND)", "if(0)") + replace_in_file(self, cmakelists_src, "if (JP2K_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (JP2K_FOUND)", "if(0)") ## libwebp - tools.replace_in_file(cmakelists, "if(NOT WEBP)", "if(0)") - tools.replace_in_file(cmakelists_src, + replace_in_file(self, cmakelists, "if(NOT WEBP)", "if(0)") + replace_in_file(self, cmakelists_src, "if (WEBP_FOUND)", "if (WEBP_FOUND)\n" + "target_link_directories(leptonica PRIVATE ${WEBP_LIBRARY_DIRS} ${WEBPMUX_LIBRARY_DIRS})\n" "target_compile_definitions(leptonica PRIVATE ${WEBP_CFLAGS_OTHER} ${WEBPMUX_CFLAGS_OTHER})") - tools.replace_in_file(cmakelists_src, "${WEBP_LIBRARIES}", "${WEBP_LIBRARIES} ${WEBPMUX_LIBRARIES}") - if tools.Version(self.version) >= "1.79.0": - tools.replace_in_file(cmakelists, "if(NOT WEBPMUX)", "if(0)") + replace_in_file(self, cmakelists_src, "${WEBP_LIBRARIES}", "${WEBP_LIBRARIES} ${WEBPMUX_LIBRARIES}") + if Version(self.version) >= "1.79.0": + replace_in_file(self, cmakelists, "if(NOT WEBPMUX)", "if(0)") if not self.options.with_webp: - tools.replace_in_file(cmakelists_src, "if (WEBP_FOUND)", "if(0)") - tools.replace_in_file(cmake_configure, "if (WEBP_FOUND)", "if(0)") + replace_in_file(self, cmakelists_src, "if (WEBP_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (WEBP_FOUND)", "if(0)") # Remove detection of fmemopen() on macOS < 10.13 # CheckFunctionExists will find it in the link library. # There's no error because it's not including the header with the # deprecation macros. if self.settings.os == "Macos" and self.settings.os.version: - if tools.Version(self.settings.os.version) < "10.13": - tools.replace_in_file(cmake_configure, + if Version(self.settings.os.version) < "10.13": + replace_in_file(self, cmake_configure, "set(functions_list\n " "fmemopen\n fstatat\n)", "set(functions_list\n " "fstatat\n)") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - if tools.Version(self.version) < "1.79.0": - self._cmake.definitions["STATIC"] = not self.options.shared - self._cmake.definitions["BUILD_PROG"] = False - self._cmake.definitions["SW_BUILD"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy(pattern="leptonica-license.txt", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) # since 1.81.0 - tools.rmdir(os.path.join(self.package_folder, "cmake")) + copy(self, "leptonica-license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) # since 1.81.0 + rmdir(self, os.path.join(self.package_folder, "cmake")) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( @@ -192,27 +203,26 @@ def package(self): {"leptonica": "Leptonica::Leptonica"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "Leptonica") self.cpp_info.set_property("cmake_target_name", "leptonica") self.cpp_info.set_property("pkg_config_name", "lept") - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] self.cpp_info.includedirs.append(os.path.join("include", "leptonica")) diff --git a/recipes/leptonica/all/test_package/CMakeLists.txt b/recipes/leptonica/all/test_package/CMakeLists.txt index 4b216b1756f75..b498b89f556d8 100644 --- a/recipes/leptonica/all/test_package/CMakeLists.txt +++ b/recipes/leptonica/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(Leptonica REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} leptonica) +target_link_libraries(${PROJECT_NAME} PRIVATE leptonica) diff --git a/recipes/leptonica/all/test_package/conanfile.py b/recipes/leptonica/all/test_package/conanfile.py index 49a3a66ea5bad..0a6bc68712d90 100644 --- a/recipes/leptonica/all/test_package/conanfile.py +++ b/recipes/leptonica/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/leptonica/all/test_v1_package/CMakeLists.txt b/recipes/leptonica/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f86c2a9f99016 --- /dev/null +++ b/recipes/leptonica/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Leptonica REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE leptonica) diff --git a/recipes/leptonica/all/test_v1_package/conanfile.py b/recipes/leptonica/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/leptonica/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 8a99b52b80dbd6d57ff5c18477a0d6e893452850 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 24 Sep 2022 18:44:46 +0200 Subject: [PATCH 188/561] (#13105) glew: conan v2 support * conan v2 support * fix upstream CMakeLists --- recipes/glew/all/CMakeLists.txt | 7 -- recipes/glew/all/conandata.yml | 12 +++- recipes/glew/all/conanfile.py | 71 +++++++++---------- .../all/patches/0001-fix-cmake-2.1.0.patch | 15 ++++ .../all/patches/0001-fix-cmake-2.2.0.patch | 15 ++++ ...-fix.patch => 0002-vs16-release-fix.patch} | 0 recipes/glew/all/test_package/CMakeLists.txt | 7 +- recipes/glew/all/test_package/conanfile.py | 20 ++++-- .../glew/all/test_v1_package/CMakeLists.txt | 10 +++ recipes/glew/all/test_v1_package/conanfile.py | 17 +++++ 10 files changed, 119 insertions(+), 55 deletions(-) delete mode 100644 recipes/glew/all/CMakeLists.txt create mode 100644 recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch create mode 100644 recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch rename recipes/glew/all/patches/{vs16-release-fix.patch => 0002-vs16-release-fix.patch} (100%) create mode 100644 recipes/glew/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glew/all/test_v1_package/conanfile.py diff --git a/recipes/glew/all/CMakeLists.txt b/recipes/glew/all/CMakeLists.txt deleted file mode 100644 index 1da00850fa23c..0000000000000 --- a/recipes/glew/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper C) - -include("conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder/build/cmake") diff --git a/recipes/glew/all/conandata.yml b/recipes/glew/all/conandata.yml index 8cfd90ad63ca0..c4c27b1a2cf9f 100644 --- a/recipes/glew/all/conandata.yml +++ b/recipes/glew/all/conandata.yml @@ -6,6 +6,14 @@ sources: sha256: "04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95" url: "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz" patches: + "2.2.0": + - patch_file: "patches/0001-fix-cmake-2.2.0.patch" + patch_description: "Fix CMake: cmake_minimum_required() before project()" + patch_type: conan "2.1.0": - - patch_file: "patches/vs16-release-fix.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-fix-cmake-2.1.0.patch" + patch_description: "Fix CMake: cmake_minimum_required() before project()" + patch_type: conan + - patch_file: "patches/0002-vs16-release-fix.patch" + patch_type: "backport" + patch_source: "https://github.com/nigels-com/glew/commit/4bbe8aa2ab70a6eb847ee5751735422d0ba623cd" diff --git a/recipes/glew/all/conanfile.py b/recipes/glew/all/conanfile.py index c3e2c208bc048..75e5f17da8e37 100644 --- a/recipes/glew/all/conanfile.py +++ b/recipes/glew/all/conanfile.py @@ -1,9 +1,9 @@ from conan import ConanFile -from conan.tools import files -from conans import CMake -import functools +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class GlewConan(ConanFile): @@ -26,20 +26,8 @@ class GlewConan(ConanFile): "with_egl": False, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -48,38 +36,49 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("opengl/system") self.requires("glu/system") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_UTILS"] = False - cmake.definitions["GLEW_EGL"] = self.options.get_safe("with_egl", False) - cmake.configure(build_folder=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_UTILS"] = False + tc.variables["GLEW_EGL"] = self.options.get_safe("with_egl", False) + tc.generate() def build(self): - files.apply_conandata_patches(self) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "build", "cmake")) cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - files.rmdir(self, f"{self.package_folder}/lib/pkgconfig") - files.rmdir(self, f"{self.package_folder}/lib/cmake") - files.rm(self, "*.pdb", f"{self.package_folder}/lib") + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) def package_info(self): glewlib_target_name = "glew" if self.options.shared else "glew_s" diff --git a/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch b/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch new file mode 100644 index 0000000000000..d64b6d88a9c4b --- /dev/null +++ b/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch @@ -0,0 +1,15 @@ +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -1,10 +1,10 @@ ++cmake_minimum_required (VERSION 2.8.12) ++project (glew C) + if ( NOT DEFINED CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" ) + endif () + +-project (glew) + +-cmake_minimum_required (VERSION 2.8.12) + + include(GNUInstallDirs) + diff --git a/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch b/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch new file mode 100644 index 0000000000000..8373c5364c4dd --- /dev/null +++ b/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch @@ -0,0 +1,15 @@ +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -1,10 +1,10 @@ ++cmake_minimum_required (VERSION 2.8.12) ++project (glew C) + if ( NOT DEFINED CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" ) + endif () + +-project (glew C) + +-cmake_minimum_required (VERSION 2.8.12) + + include(GNUInstallDirs) + diff --git a/recipes/glew/all/patches/vs16-release-fix.patch b/recipes/glew/all/patches/0002-vs16-release-fix.patch similarity index 100% rename from recipes/glew/all/patches/vs16-release-fix.patch rename to recipes/glew/all/patches/0002-vs16-release-fix.patch diff --git a/recipes/glew/all/test_package/CMakeLists.txt b/recipes/glew/all/test_package/CMakeLists.txt index d69e64cd58c7d..f7e367639f538 100644 --- a/recipes/glew/all/test_package/CMakeLists.txt +++ b/recipes/glew/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(GLEW REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} GLEW::GLEW) +target_link_libraries(${PROJECT_NAME} PRIVATE GLEW::GLEW) diff --git a/recipes/glew/all/test_package/conanfile.py b/recipes/glew/all/test_package/conanfile.py index a831367c532bc..0a6bc68712d90 100644 --- a/recipes/glew/all/test_package/conanfile.py +++ b/recipes/glew/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/glew/all/test_v1_package/CMakeLists.txt b/recipes/glew/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..abaffb362cf82 --- /dev/null +++ b/recipes/glew/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(GLEW REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE GLEW::GLEW) diff --git a/recipes/glew/all/test_v1_package/conanfile.py b/recipes/glew/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/glew/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From b9480230eb85223189f4363237e59af577f465bc Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Sat, 24 Sep 2022 21:44:39 -0300 Subject: [PATCH 189/561] (#13140) add emsdk version 3.1.23 --- recipes/emsdk/all/conandata.yml | 3 +++ recipes/emsdk/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/emsdk/all/conandata.yml b/recipes/emsdk/all/conandata.yml index 3bd99a86c6c6b..97335d64e50ee 100644 --- a/recipes/emsdk/all/conandata.yml +++ b/recipes/emsdk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.23": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.23.tar.gz" + sha256: "a2609fd97580e4e332acbf49b6cc363714982f06cb6970d54c9789df8e91381c" "3.1.20": url: "https://github.com/emscripten-core/emsdk/archive/3.1.20.tar.gz" sha256: "fd336c6d3e51c7205a8ec68e835c442dcbb187f92e50c42b3d7d54a312072ef7" diff --git a/recipes/emsdk/config.yml b/recipes/emsdk/config.yml index 8cb71bb34e538..7591f3687c322 100644 --- a/recipes/emsdk/config.yml +++ b/recipes/emsdk/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.23": + folder: all "3.1.20": folder: all "3.1.18": From 1d04372ae1bead2e86a3f7183561361e9fcd9761 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sun, 25 Sep 2022 10:25:22 +0200 Subject: [PATCH 190/561] (#12966) spirv-cross: add 1.3.224.0 + partial conan v2 support * partial conan v2 support * add spirv-cross/1.3.224.0 --- recipes/spirv-cross/all/conandata.yml | 3 + recipes/spirv-cross/all/conanfile.py | 83 +++++++++---------- .../all/test_package/CMakeLists.txt | 9 +- .../spirv-cross/all/test_package/conanfile.py | 19 +++-- .../all/test_v1_package/CMakeLists.txt | 15 ++++ .../all/test_v1_package/conanfile.py | 17 ++++ recipes/spirv-cross/config.yml | 2 + 7 files changed, 95 insertions(+), 53 deletions(-) create mode 100644 recipes/spirv-cross/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/spirv-cross/all/test_v1_package/conanfile.py diff --git a/recipes/spirv-cross/all/conandata.yml b/recipes/spirv-cross/all/conandata.yml index 775d8d9eb7bd0..9f381bc4d1821 100644 --- a/recipes/spirv-cross/all/conandata.yml +++ b/recipes/spirv-cross/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.224.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "00256c33e235c5b9f0fc4b531fb9058d3cf1ff53e21e2db62cd8db848525536c" "1.3.216.0": url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.216.0.tar.gz" sha256: "dd66ce2f9e6d3b9b8055662ac25172fa5559603f2f23c1a178c74f1602de8732" diff --git a/recipes/spirv-cross/all/conanfile.py b/recipes/spirv-cross/all/conanfile.py index 293e94489d389..03c287d70e62c 100644 --- a/recipes/spirv-cross/all/conanfile.py +++ b/recipes/spirv-cross/all/conanfile.py @@ -1,9 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, get, rm, rmdir, save +from conans import CMake, tools as tools_legacy import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class SpirvCrossConan(ConanFile): @@ -57,9 +59,9 @@ def _build_subfolder(self): return "build_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -73,17 +75,16 @@ def configure(self): del self.options.util def validate(self): - if not self.options.glsl and \ - (self.options.hlsl or self.options.msl or self.options.cpp or self.options.reflect): + if not self.info.options.glsl and \ + (self.info.options.hlsl or self.info.options.msl or self.info.options.cpp or self.info.options.reflect): raise ConanInvalidConfiguration("hlsl, msl, cpp and reflect require glsl enabled") 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], + destination=self._source_subfolder, strip_root=True) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) cmake = self._configure_cmake() cmake.build() if self.options.build_executable and not self._are_proper_binaries_available_for_executable: @@ -137,40 +138,36 @@ def _build_exe(self): cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) cmake = self._configure_cmake() cmake.install() if self.options.build_executable and not self._are_proper_binaries_available_for_executable: - self.copy(pattern="spirv-cross*", dst="bin", src=os.path.join("build_subfolder_exe", "bin")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.ilk") - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + copy(self, "spirv-cross*", src=os.path.join(self.build_folder, "build_subfolder_exe", "bin"), dst=os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.ilk", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + # TODO: to remove in conan v2 once legacy generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), - {target: "spirv-cross::{}".format(target) for target in self._spirv_cross_components.keys()} + {target: f"spirv-cross::{target}" for target in self._spirv_cross_components.keys()}, ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) - - @property - def _module_subfolder(self): - return os.path.join("lib", "cmake") + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join(self._module_subfolder, - "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property def _spirv_cross_components(self): @@ -210,29 +207,31 @@ def package_info(self): # FIXME: we should provide one CMake config file per target (waiting for an implementation of https://github.com/conan-io/conan/issues/9000) def _register_component(target_lib, requires): self.cpp_info.components[target_lib].set_property("cmake_target_name", target_lib) - self.cpp_info.components[target_lib].builddirs.append(self._module_subfolder) - - self.cpp_info.components[target_lib].names["cmake_find_package"] = target_lib - self.cpp_info.components[target_lib].names["cmake_find_package_multi"] = target_lib - self.cpp_info.components[target_lib].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components[target_lib].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if self.options.shared: self.cpp_info.components[target_lib].set_property("pkg_config_name", target_lib) prefix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" - self.cpp_info.components[target_lib].libs = ["{}{}".format(target_lib, prefix)] + self.cpp_info.components[target_lib].libs = [f"{target_lib}{prefix}"] self.cpp_info.components[target_lib].includedirs.append(os.path.join("include", "spirv_cross")) - self.cpp_info.components[target_lib].defines.append("SPIRV_CROSS_NAMESPACE_OVERRIDE={}".format(self.options.namespace)) + self.cpp_info.components[target_lib].defines.append(f"SPIRV_CROSS_NAMESPACE_OVERRIDE={self.options.namespace}") self.cpp_info.components[target_lib].requires = requires if self.settings.os in ["Linux", "FreeBSD"] and self.options.glsl: self.cpp_info.components[target_lib].system_libs.append("m") - if not self.options.shared and self.options.c_api and tools.stdcpp_library(self): - self.cpp_info.components[target_lib].system_libs.append(tools.stdcpp_library(self)) + if not self.options.shared and self.options.c_api: + libcxx = tools_legacy.stdcpp_library(self) + if libcxx: + self.cpp_info.components[target_lib].system_libs.append(libcxx) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.components[target_lib].names["cmake_find_package"] = target_lib + self.cpp_info.components[target_lib].names["cmake_find_package_multi"] = target_lib + self.cpp_info.components[target_lib].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components[target_lib].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] for target_lib, requires in self._spirv_cross_components.items(): _register_component(target_lib, requires) + # TODO: to remove in conan v2 once legacy generators removed if self.options.build_executable: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/spirv-cross/all/test_package/CMakeLists.txt b/recipes/spirv-cross/all/test_package/CMakeLists.txt index 587f4d76d9d98..a40c4a736880a 100644 --- a/recipes/spirv-cross/all/test_package/CMakeLists.txt +++ b/recipes/spirv-cross/all/test_package/CMakeLists.txt @@ -1,15 +1,12 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) # FIXME: this is not the official way to find spirv-cross components find_package(spirv-cross REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) if(TARGET spirv-cross-c) - target_link_libraries(${PROJECT_NAME} spirv-cross-c) + target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c) elseif(TARGET spirv-cross-c-shared) - target_link_libraries(${PROJECT_NAME} spirv-cross-c-shared) + target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c-shared) endif() diff --git a/recipes/spirv-cross/all/test_package/conanfile.py b/recipes/spirv-cross/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/spirv-cross/all/test_package/conanfile.py +++ b/recipes/spirv-cross/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt b/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..97069b25defdb --- /dev/null +++ b/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +# FIXME: this is not the official way to find spirv-cross components +find_package(spirv-cross REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(TARGET spirv-cross-c) + target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c) +elseif(TARGET spirv-cross-c-shared) + target_link_libraries(${PROJECT_NAME} PRIVATE spirv-cross-c-shared) +endif() diff --git a/recipes/spirv-cross/all/test_v1_package/conanfile.py b/recipes/spirv-cross/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/spirv-cross/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/spirv-cross/config.yml b/recipes/spirv-cross/config.yml index 85861b575c14b..791b0b57e6377 100644 --- a/recipes/spirv-cross/config.yml +++ b/recipes/spirv-cross/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.224.0": + folder: all "1.3.216.0": folder: all "1.3.211.0": From 293d1ad9543a3fc742abf2c40977512cd7a25470 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sun, 25 Sep 2022 11:24:49 +0200 Subject: [PATCH 191/561] (#12967) glslang: add 1.3.224.0 + partial conan v2 support * partial conan v2 support Also enforce target names in CMakeDeps. Since https://github.com/KhronosGroup/glslang/pull/2989, glslang provides glslang-config.cmake file with CMake targets under glslang:: namespace. * add glslang/1.3.224.0 --- recipes/glslang/all/conandata.yml | 6 ++ recipes/glslang/all/conanfile.py | 77 +++++++++++-------- .../glslang/all/test_package/CMakeLists.txt | 11 ++- recipes/glslang/all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../glslang/all/test_v1_package/conanfile.py | 19 +++++ recipes/glslang/config.yml | 2 + 7 files changed, 102 insertions(+), 45 deletions(-) create mode 100644 recipes/glslang/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glslang/all/test_v1_package/conanfile.py diff --git a/recipes/glslang/all/conandata.yml b/recipes/glslang/all/conandata.yml index 305ce48378dab..5b78067f18a37 100644 --- a/recipes/glslang/all/conandata.yml +++ b/recipes/glslang/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.224.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.224.0.tar.gz" + sha256: "c43c6aa149fa1165e01b375b4d95cbc23b4fc72bd9972a89c55dd1eaa8a360ca" "1.3.216.0": url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.216.0.tar.gz" sha256: "3f80a926390faedd33e6ed17ec68340abace83913b285174e2dee87156577be5" @@ -21,6 +24,9 @@ sources: url: "https://github.com/KhronosGroup/glslang/archive/8.13.3559.tar.gz" sha256: "c58fdcf7e00943ba10f9ae565b2725ec9d5be7dab7c8e82cac72fcaa83c652ca" patches: + "1.3.224.0": + - patch_file: "patches/0001-no-force-glslang-pic.patch" + base_path: "source_subfolder" "1.3.216.0": - patch_file: "patches/0001-no-force-glslang-pic.patch" base_path: "source_subfolder" diff --git a/recipes/glslang/all/conanfile.py b/recipes/glslang/all/conanfile.py index 89dad6a7a9ceb..ccfc0f7a9bcb5 100644 --- a/recipes/glslang/all/conanfile.py +++ b/recipes/glslang/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, CMake, 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.files import apply_conandata_patches, copy, get, replace_in_file, rmdir +from conan.tools.scm import Version +from conans import CMake import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.51.3" class GlslangConan(ConanFile): @@ -46,9 +51,9 @@ def _build_subfolder(self): return "build_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -69,33 +74,29 @@ def _get_compatible_spirv_tools_version(self): def requirements(self): if self.options.enable_optimizer: - self.requires("spirv-tools/{}".format(self._get_compatible_spirv_tools_version)) + self.requires(f"spirv-tools/{self._get_compatible_spirv_tools_version}") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) # see https://github.com/KhronosGroup/glslang/issues/2283 - glslang_version = tools.Version(self.version) - if (self.options.shared and - (self.settings.os == "Windows" or \ - (glslang_version >= "7.0.0" and glslang_version < "11.0.0" and tools.is_apple_os(self.settings.os))) + glslang_version = Version(self.version) + if (self.info.options.shared and + (self.info.settings.os == "Windows" or \ + (glslang_version >= "7.0.0" and glslang_version < "11.0.0" and is_apple_os(self))) ): - raise ConanInvalidConfiguration( - "glslang {} shared library build is broken on {}".format( - self.version, self.settings.os, - ) - ) + raise ConanInvalidConfiguration(f"{self.ref} shared library build is broken on {self.info.settings.os}") - if self.options.enable_optimizer and self.options["spirv-tools"].shared: + if self.info.options.enable_optimizer and self.dependencies["spirv-tools"].options.shared: raise ConanInvalidConfiguration( - "glslang with enable_optimizer requires static spirv-tools, " + f"{self.ref} with enable_optimizer requires static spirv-tools, " "because SPIRV-Tools-opt is not built if shared" ) 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], + destination=self._source_subfolder, strip_root=True) def build(self): self._patches_sources() @@ -103,8 +104,7 @@ def build(self): cmake.build() def _patches_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) # Do not force PIC if static (but keep it if shared, because OGLCompiler, OSDependent, # GenericCodeGen and MachineIndependent are still static and linked to glslang shared) if not self.options.shared: @@ -116,7 +116,7 @@ def _patches_sources(self): {"target": "OSDependent", "relpath": os.path.join("glslang", "OSDependent", "Windows","CMakeLists.txt")}, {"target": "HLSL" , "relpath": os.path.join("hlsl", "CMakeLists.txt")}, ] - glslang_version = tools.Version(self.version) + glslang_version = Version(self.version) if glslang_version >= "7.0.0" and glslang_version < "11.0.0": cmake_files_to_fix.append({"target": "glslang" , "relpath": os.path.join("glslang", "CMakeLists.txt")}) else: @@ -124,7 +124,7 @@ def _patches_sources(self): cmake_files_to_fix.append({"target": "MachineIndependent", "relpath": os.path.join("glslang", "CMakeLists.txt")}) cmake_files_to_fix.append({"target": "GenericCodeGen", "relpath": os.path.join("glslang", "CMakeLists.txt")}) for cmake_file in cmake_files_to_fix: - tools.replace_in_file(os.path.join(self._source_subfolder, cmake_file["relpath"]), + replace_in_file(self, os.path.join(self.build_folder, self._source_subfolder, cmake_file["relpath"]), "set_property(TARGET {} PROPERTY POSITION_INDEPENDENT_CODE ON)".format(cmake_file["target"]), "") @@ -136,7 +136,7 @@ def _configure_cmake(self): self._cmake.definitions["SKIP_GLSLANG_INSTALL"] = False self._cmake.definitions["ENABLE_SPVREMAPPER"] = self.options.spv_remapper self._cmake.definitions["ENABLE_GLSLANG_BINARIES"] = self.options.build_executables - glslang_version = tools.Version(self.version) + glslang_version = Version(self.version) if glslang_version < "7.0.0" or glslang_version >= "8.13.3743": self._cmake.definitions["ENABLE_GLSLANG_JS"] = False self._cmake.definitions["ENABLE_GLSLANG_WEBMIN"] = False @@ -155,7 +155,7 @@ def _configure_cmake(self): self._cmake.definitions["USE_CCACHE"] = False if (glslang_version < "7.0.0" or glslang_version >= "11.6.0") and self.settings.os == "Windows": self._cmake.definitions["OVERRIDE_MSVCCRT"] = False - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): self._cmake.definitions["CMAKE_MACOSX_BUNDLE"] = False # Generate a relocatable shared lib on Macos self._cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" @@ -163,15 +163,19 @@ def _configure_cmake(self): return self._cmake def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE.txt", src=os.path.join(self.build_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "licenses")) cmake = self._configure_cmake() cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - # TODO: glslang exports non-namespaced targets but without config file... + self.cpp_info.set_property("cmake_file_name", "glslang") + self.cpp_info.set_property("cmake_target_name", "glslang::glslang-do-not-use") # because glslang-core target is glslang::glslang + lib_suffix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" # glslang + self.cpp_info.components["glslang-core"].set_property("cmake_target_name", "glslang::glslang") self.cpp_info.components["glslang-core"].names["cmake_find_package"] = "glslang" self.cpp_info.components["glslang-core"].names["cmake_find_package_multi"] = "glslang" self.cpp_info.components["glslang-core"].libs = ["glslang" + lib_suffix] @@ -179,12 +183,13 @@ def package_info(self): self.cpp_info.components["glslang-core"].system_libs.extend(["m", "pthread"]) self.cpp_info.components["glslang-core"].requires = ["oglcompiler", "osdependent"] - glslang_version = tools.Version(self.version) + glslang_version = Version(self.version) if (glslang_version < "7.0.0" or glslang_version >= "11.0.0"): if self.options.shared: self.cpp_info.components["glslang-core"].defines.append("GLSLANG_IS_SHARED_LIBRARY") else: # MachineIndependent + self.cpp_info.components["machineindependent"].set_property("cmake_target_name", "glslang::MachineIndependent") self.cpp_info.components["machineindependent"].names["cmake_find_package"] = "MachineIndependent" self.cpp_info.components["machineindependent"].names["cmake_find_package_multi"] = "MachineIndependent" self.cpp_info.components["machineindependent"].libs = ["MachineIndependent" + lib_suffix] @@ -192,12 +197,14 @@ def package_info(self): self.cpp_info.components["glslang-core"].requires.append("machineindependent") # GenericCodeGen + self.cpp_info.components["genericcodegen"].set_property("cmake_target_name", "glslang::GenericCodeGen") self.cpp_info.components["genericcodegen"].names["cmake_find_package"] = "GenericCodeGen" self.cpp_info.components["genericcodegen"].names["cmake_find_package_multi"] = "GenericCodeGen" self.cpp_info.components["genericcodegen"].libs = ["GenericCodeGen" + lib_suffix] self.cpp_info.components["glslang-core"].requires.append("genericcodegen") # OSDependent + self.cpp_info.components["osdependent"].set_property("cmake_target_name", "glslang::OSDependent") self.cpp_info.components["osdependent"].names["cmake_find_package"] = "OSDependent" self.cpp_info.components["osdependent"].names["cmake_find_package_multi"] = "OSDependent" self.cpp_info.components["osdependent"].libs = ["OSDependent" + lib_suffix] @@ -205,11 +212,13 @@ def package_info(self): self.cpp_info.components["osdependent"].system_libs.append("pthread") # OGLCompiler + self.cpp_info.components["oglcompiler"].set_property("cmake_target_name", "glslang::OGLCompiler") self.cpp_info.components["oglcompiler"].names["cmake_find_package"] = "OGLCompiler" self.cpp_info.components["oglcompiler"].names["cmake_find_package_multi"] = "OGLCompiler" self.cpp_info.components["oglcompiler"].libs = ["OGLCompiler" + lib_suffix] # SPIRV + self.cpp_info.components["spirv"].set_property("cmake_target_name", "glslang::SPIRV") self.cpp_info.components["spirv"].names["cmake_find_package"] = "SPIRV" self.cpp_info.components["spirv"].names["cmake_find_package_multi"] = "SPIRV" self.cpp_info.components["spirv"].libs = ["SPIRV" + lib_suffix] @@ -220,6 +229,7 @@ def package_info(self): # HLSL if self.options.hlsl: + self.cpp_info.components["hlsl"].set_property("cmake_target_name", "glslang::HLSL") self.cpp_info.components["hlsl"].names["cmake_find_package"] = "HLSL" self.cpp_info.components["hlsl"].names["cmake_find_package_multi"] = "HLSL" self.cpp_info.components["hlsl"].libs = ["HLSL" + lib_suffix] @@ -228,11 +238,12 @@ def package_info(self): # SPVRemapper if self.options.spv_remapper: + self.cpp_info.components["spvremapper"].set_property("cmake_target_name", "glslang::SPVRemapper") self.cpp_info.components["spvremapper"].names["cmake_find_package"] = "SPVRemapper" self.cpp_info.components["spvremapper"].names["cmake_find_package_multi"] = "SPVRemapper" self.cpp_info.components["spvremapper"].libs = ["SPVRemapper" + lib_suffix] if self.options.build_executables: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/glslang/all/test_package/CMakeLists.txt b/recipes/glslang/all/test_package/CMakeLists.txt index 33ae887aa6aea..02d778d679219 100644 --- a/recipes/glslang/all/test_package/CMakeLists.txt +++ b/recipes/glslang/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(glslang REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE glslang::glslang) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/glslang/all/test_package/conanfile.py b/recipes/glslang/all/test_package/conanfile.py index daf9386ce8619..216f67362e0fd 100644 --- a/recipes/glslang/all/test_package/conanfile.py +++ b/recipes/glslang/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,8 +21,8 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") shader_name = os.path.join(self.source_folder, "test_package.vert") - self.run("glslangValidator \"{}\"".format(shader_name), run_environment=True) + self.run(f"glslangValidator \"{shader_name}\"", env="conanrun") diff --git a/recipes/glslang/all/test_v1_package/CMakeLists.txt b/recipes/glslang/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..fb4f9ced552e0 --- /dev/null +++ b/recipes/glslang/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(glslang REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glslang::glslang) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/glslang/all/test_v1_package/conanfile.py b/recipes/glslang/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d939929a7a456 --- /dev/null +++ b/recipes/glslang/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + shader_name = os.path.join(self.source_folder, os.pardir, "test_package", "test_package.vert") + self.run(f"glslangValidator \"{shader_name}\"", run_environment=True) diff --git a/recipes/glslang/config.yml b/recipes/glslang/config.yml index 0a42721fd10b1..f05402cfe8796 100644 --- a/recipes/glslang/config.yml +++ b/recipes/glslang/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.224.0": + folder: all "1.3.216.0": folder: all "1.3.211.0": From 7762d812eee326d1fee87ab96a8a1e4576069cd1 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 26 Sep 2022 01:04:46 +0900 Subject: [PATCH 192/561] (#13146) unordered_dense: add version 1.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/unordered_dense/all/conandata.yml | 3 +++ recipes/unordered_dense/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml index c59ee1921274b..dd610968822a9 100644 --- a/recipes/unordered_dense/all/conandata.yml +++ b/recipes/unordered_dense/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.3": + url: "https://github.com/martinus/unordered_dense/archive/v1.3.3.tar.gz" + sha256: "621a984d7f1de156d3078ecb5e1252bcc2ebc875de6eb6b8635f6c2a0898e496" "1.3.2": url: "https://github.com/martinus/unordered_dense/archive/v1.3.2.tar.gz" sha256: "f12db3b93f31f7f20f4d8cac6adc551f6ae17a5b9a16040abeee427f54427953" diff --git a/recipes/unordered_dense/config.yml b/recipes/unordered_dense/config.yml index 4977bb7915a7c..1334fb71cef79 100644 --- a/recipes/unordered_dense/config.yml +++ b/recipes/unordered_dense/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.3": + folder: all "1.3.2": folder: all "1.3.1": From 83c4c988eb0ef2254d6f25bce8d051d996956b7c Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 26 Sep 2022 17:25:05 +0900 Subject: [PATCH 193/561] (#13147) itlib: add version 1.6.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/itlib/all/conandata.yml | 3 +++ recipes/itlib/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/itlib/all/conandata.yml b/recipes/itlib/all/conandata.yml index cf2a8dada5fb2..75c51a069dcdc 100644 --- a/recipes/itlib/all/conandata.yml +++ b/recipes/itlib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.3": + url: "https://github.com/iboB/itlib/archive/v1.6.3.tar.gz" + sha256: "d2e320d9218269c421407d6df819ca0bfae3ea5bc897b341b9babaedc0b7103f" "1.6.1": url: "https://github.com/iboB/itlib/archive/v1.6.1.tar.gz" sha256: "bff70b95ca223b4fbca206d8e1c5f6c75fd5ac86d76c8f8f14f45c748d25866a" diff --git a/recipes/itlib/config.yml b/recipes/itlib/config.yml index bbf5178c08498..da2c4537319ae 100644 --- a/recipes/itlib/config.yml +++ b/recipes/itlib/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.3": + folder: all "1.6.1": folder: all "1.5.2": From 80871af5f91fa966823208bb9a9593c85cf75493 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Mon, 26 Sep 2022 11:05:09 +0200 Subject: [PATCH 194/561] (#13149) proposal: bump to 7.4.2 --- recipes/proposal/all/conandata.yml | 3 +++ recipes/proposal/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/proposal/all/conandata.yml b/recipes/proposal/all/conandata.yml index 19eb61c93267d..9822195b42ce2 100644 --- a/recipes/proposal/all/conandata.yml +++ b/recipes/proposal/all/conandata.yml @@ -32,3 +32,6 @@ sources: "7.4.1": url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.1.tar.gz" sha256: "e6ff9749f402dd77f320a2a28b77a45636cbe186f926d9b5a7b54ea6ee631ada" + "7.4.2": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.2.tar.gz" + sha256: "f0db44c96a80a6ce3dda02c598574f5f0209376bd2c6c176797710da8eb3e108" diff --git a/recipes/proposal/config.yml b/recipes/proposal/config.yml index 92c637b05e3a2..a8df5c3026f1b 100644 --- a/recipes/proposal/config.yml +++ b/recipes/proposal/config.yml @@ -21,3 +21,5 @@ versions: folder: all "7.4.1": folder: all + "7.4.2": + folder: all From d58f1e1d00fad626060d93da83e6f8f7d338749f Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 26 Sep 2022 18:26:30 +0900 Subject: [PATCH 195/561] (#13150) greg7mdp-gtl: add version 1.1.4 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/greg7mdp-gtl/all/conandata.yml | 3 +++ recipes/greg7mdp-gtl/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/greg7mdp-gtl/all/conandata.yml b/recipes/greg7mdp-gtl/all/conandata.yml index 267549ce8cbbf..d64a2a2417125 100644 --- a/recipes/greg7mdp-gtl/all/conandata.yml +++ b/recipes/greg7mdp-gtl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.4": + url: "https://github.com/greg7mdp/gtl/archive/v1.1.4.tar.gz" + sha256: "b51b9951d11fb73ed22360a96a3f6c691c15202c3b14c79dcdd498da80b6502d" "1.1.3": url: "https://github.com/greg7mdp/gtl/archive/refs/tags/v1.1.3.tar.gz" sha256: "c667690eeecf37f660d8a61bca1076e845154bc535c44ec0d2404c04c66ae228" diff --git a/recipes/greg7mdp-gtl/config.yml b/recipes/greg7mdp-gtl/config.yml index 75493b9d0906b..4170839cda204 100644 --- a/recipes/greg7mdp-gtl/config.yml +++ b/recipes/greg7mdp-gtl/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.4": + folder: all "1.1.3": folder: all "1.1.2": From ebef6771b318f6ab82aef753734594bdc818358e Mon Sep 17 00:00:00 2001 From: Alexander Bigerl Date: Mon, 26 Sep 2022 11:44:48 +0200 Subject: [PATCH 196/561] (#13111) serd/0.30.16 version bump * add serd version 0.30.16 * did as CI told me --- recipes/serd/all/conandata.yml | 3 +++ recipes/serd/all/test_v1_package/conanfile.py | 1 - recipes/serd/config.yml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/serd/all/conandata.yml b/recipes/serd/all/conandata.yml index 2ddae1a9b1130..b401b2ad15e33 100644 --- a/recipes/serd/all/conandata.yml +++ b/recipes/serd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.30.16": + url: "https://gitlab.com/drobilla/serd/-/archive/v0.30.16/serd-v0.30.16.tar.gz" + sha256: "c139e02af039e277fb1b7deb2a687477bf6ec46cd6348bbb1232c2727a1dd744" "0.30.14": url: "https://gitlab.com/drobilla/serd/-/archive/v0.30.14/serd-v0.30.14.tar.gz" sha256: "5b8d620afda474861f159b18af5e49d0ea1a9d48ff7879b23b92a058ce7aad68" diff --git a/recipes/serd/all/test_v1_package/conanfile.py b/recipes/serd/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/serd/all/test_v1_package/conanfile.py +++ b/recipes/serd/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/serd/config.yml b/recipes/serd/config.yml index b19122c5d123f..9877695aeb2f5 100644 --- a/recipes/serd/config.yml +++ b/recipes/serd/config.yml @@ -1,3 +1,5 @@ versions: + "0.30.16": + folder: all "0.30.14": folder: all From cca1b53ae770109c2a70ee64f8bded65217f79ec Mon Sep 17 00:00:00 2001 From: cguentherTUChemnitz Date: Mon, 26 Sep 2022 12:05:07 +0200 Subject: [PATCH 197/561] (#13115) ade/0.1.2a version bump --- recipes/ade/all/conandata.yml | 3 +++ recipes/ade/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/ade/all/conandata.yml b/recipes/ade/all/conandata.yml index 33408bd203512..954c10dfe2c1d 100644 --- a/recipes/ade/all/conandata.yml +++ b/recipes/ade/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.2a": + url: "https://github.com/opencv/ade/archive/refs/tags/v0.1.2a.tar.gz" + sha256: "c022a688b0554017e46e1cbdeb0105e625ca090fc3755c15df8c4451a304e084" "0.1.1f": url: "https://github.com/opencv/ade/archive/refs/tags/v0.1.1f.tar.gz" sha256: "c316680efbb5dd3ac4e10bb8cea345cf26a6a25ebc22418f8f0b8ca931a550e9" diff --git a/recipes/ade/config.yml b/recipes/ade/config.yml index 02ba1ae2763b8..cbf2f373fb630 100644 --- a/recipes/ade/config.yml +++ b/recipes/ade/config.yml @@ -1,3 +1,5 @@ versions: + "0.1.2a": + folder: "all" "0.1.1f": folder: "all" From c35724eca4e4396eaf1dfc111626d8bda71d4f74 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 26 Sep 2022 19:46:55 +0900 Subject: [PATCH 198/561] (#13117) argparse: add version 2.9 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/argparse/all/conandata.yml | 3 +++ recipes/argparse/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/argparse/all/conandata.yml b/recipes/argparse/all/conandata.yml index 741831c2fa64b..18f4555649896 100644 --- a/recipes/argparse/all/conandata.yml +++ b/recipes/argparse/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.9": + url: "https://github.com/p-ranav/argparse/archive/v2.9.tar.gz" + sha256: "cd563293580b9dc592254df35b49cf8a19b4870ff5f611c7584cf967d9e6031e" "2.6": url: "https://github.com/p-ranav/argparse/archive/v2.6.tar.gz" sha256: "da261c3b3010c10a163f4535bbe2b160319d2a6b1e0fd2eb5a7b9f6a85c29021" diff --git a/recipes/argparse/config.yml b/recipes/argparse/config.yml index c4a01f65b8f9b..5a743e89da3ef 100644 --- a/recipes/argparse/config.yml +++ b/recipes/argparse/config.yml @@ -1,4 +1,6 @@ versions: + "2.9": + folder: all "2.6": folder: all "2.5": From c7bd28033e1a7125e681647f28ba566a2bf6268f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 26 Sep 2022 13:25:23 +0200 Subject: [PATCH 199/561] (#13109) libtiff: conan v2 support * conan v2 support * bump dependencies * more robust injection of libjpeg-turbo CMakeDeps info --- recipes/libtiff/all/CMakeLists.txt | 7 - recipes/libtiff/all/conandata.yml | 38 ++-- recipes/libtiff/all/conanfile.py | 175 ++++++++---------- .../4.0.8-0001-cmake-add-libjpeg-turbo.patch | 41 ---- .../4.0.8-0001-cmake-dependencies.patch | 38 ++++ .../patches/4.0.8-0002-no-libm-mingw.patch | 13 ++ .../4.0.8-0003-file-offsets-bits-mingw.patch | 11 ++ .../4.1.0-0001-cmake-add-libjpeg-turbo.patch | 41 ---- .../4.1.0-0001-cmake-dependencies.patch | 85 +++++++++ .../patches/4.1.0-0002-no-libm-mingw.patch | 13 ++ .../4.2.0-0001-cmake-add-libjpeg-turbo.patch | 36 ---- .../4.2.0-0001-cmake-dependencies.patch | 102 ++++++++++ .../4.3.0-0001-cmake-add-libjpeg-turbo.patch | 50 ----- .../4.3.0-0001-cmake-dependencies.patch | 91 +++++++++ .../4.4.0-0001-cmake-add-libjpeg-turbo.patch | 50 ----- .../4.4.0-0001-cmake-dependencies.patch | 92 +++++++++ .../libtiff/all/test_package/CMakeLists.txt | 7 +- recipes/libtiff/all/test_package/conanfile.py | 21 ++- .../all/test_v1_package/CMakeLists.txt | 10 + .../libtiff/all/test_v1_package/conanfile.py | 17 ++ 20 files changed, 597 insertions(+), 341 deletions(-) delete mode 100644 recipes/libtiff/all/CMakeLists.txt delete mode 100644 recipes/libtiff/all/patches/4.0.8-0001-cmake-add-libjpeg-turbo.patch create mode 100644 recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch create mode 100644 recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch delete mode 100644 recipes/libtiff/all/patches/4.1.0-0001-cmake-add-libjpeg-turbo.patch create mode 100644 recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch delete mode 100644 recipes/libtiff/all/patches/4.2.0-0001-cmake-add-libjpeg-turbo.patch create mode 100644 recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch delete mode 100644 recipes/libtiff/all/patches/4.3.0-0001-cmake-add-libjpeg-turbo.patch create mode 100644 recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch delete mode 100644 recipes/libtiff/all/patches/4.4.0-0001-cmake-add-libjpeg-turbo.patch create mode 100644 recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch create mode 100644 recipes/libtiff/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libtiff/all/test_v1_package/conanfile.py diff --git a/recipes/libtiff/all/CMakeLists.txt b/recipes/libtiff/all/CMakeLists.txt deleted file mode 100644 index 61147f558a6f9..0000000000000 --- a/recipes/libtiff/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libtiff/all/conandata.yml b/recipes/libtiff/all/conandata.yml index 3cb1bcee90622..ed109970ab657 100644 --- a/recipes/libtiff/all/conandata.yml +++ b/recipes/libtiff/all/conandata.yml @@ -19,20 +19,34 @@ sources: sha256: "59d7a5a8ccd92059913f246877db95a2918e6c04fb9d43fd74e5c3390dac2910" patches: "4.4.0": - - patch_file: "patches/4.4.0-0001-cmake-add-libjpeg-turbo.patch" - base_path: "source_subfolder" + - patch_file: "patches/4.4.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" "4.3.0": - - patch_file: "patches/4.3.0-0001-cmake-add-libjpeg-turbo.patch" - base_path: "source_subfolder" + - patch_file: "patches/4.3.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" "4.2.0": - - patch_file: "patches/4.2.0-0001-cmake-add-libjpeg-turbo.patch" - base_path: "source_subfolder" + - patch_file: "patches/4.2.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" "4.1.0": - - patch_file: "patches/4.1.0-0001-cmake-add-libjpeg-turbo.patch" - base_path: "source_subfolder" + - patch_file: "patches/4.1.0-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + - patch_file: "patches/4.1.0-0002-no-libm-mingw.patch" + patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" "4.0.9": - - patch_file: "patches/4.0.8-0001-cmake-add-libjpeg-turbo.patch" - base_path: "source_subfolder" + - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" + patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" "4.0.8": - - patch_file: "patches/4.0.8-0001-cmake-add-libjpeg-turbo.patch" - base_path: "source_subfolder" + - patch_file: "patches/4.0.8-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" + - patch_file: "patches/4.0.8-0002-no-libm-mingw.patch" + patch_source: "https://gitlab.com/libtiff/libtiff/-/merge_requests/73" + - patch_file: "patches/4.0.8-0003-file-offsets-bits-mingw.patch" + patch_source: "https://gitlab.com/libtiff/libtiff/-/commit/f2a3b020402943f90957552a884788e70ece6cd7" diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index 36c2722b0e064..bb6e7d3f38d44 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -1,11 +1,12 @@ -from conan.tools.files import get, rename, rmdir +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir from conan.tools.microsoft import is_msvc -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from conans.tools import Version +from conan.tools.scm import Version import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.52.0" class LibtiffConan(ConanFile): @@ -42,17 +43,6 @@ class LibtiffConan(ConanFile): "cxx": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property def _has_webp_option(self): return Version(self.version) >= "4.0.10" @@ -66,9 +56,7 @@ def _has_libdeflate_option(self): return Version(self.version) >= "4.2.0" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -82,10 +70,22 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass if not self.options.cxx: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.zlib: @@ -95,93 +95,85 @@ def requirements(self): if self.options.lzma: self.requires("xz_utils/5.2.5") if self.options.jpeg == "libjpeg": - self.requires("libjpeg/9d") + self.requires("libjpeg/9e") if self.options.jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.3") + self.requires("libjpeg-turbo/2.1.4") if self.options.jbig: self.requires("jbig/20160605") if self.options.get_safe("zstd"): self.requires("zstd/1.5.2") if self.options.get_safe("webp"): - self.requires("libwebp/1.2.3") + self.requires("libwebp/1.2.4") def validate(self): - if self.options.get_safe("libdeflate") and not self.options.zlib: + if self.info.options.get_safe("libdeflate") and not self.info.options.zlib: raise ConanInvalidConfiguration("libtiff:libdeflate=True requires libtiff:zlib=True") def source(self): get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["lzma"] = self.options.lzma + tc.variables["jpeg"] = bool(self.options.jpeg) + tc.variables["jpeg12"] = False + tc.variables["jbig"] = self.options.jbig + tc.variables["zlib"] = self.options.zlib + if self._has_libdeflate_option: + tc.variables["libdeflate"] = self.options.libdeflate + if self._has_zstd_option: + tc.variables["zstd"] = self.options.zstd + if self._has_webp_option: + tc.variables["webp"] = self.options.webp + if Version(self.version) >= "4.3.0": + tc.variables["lerc"] = False # TODO: add lerc support for libtiff versions >= 4.3.0 + tc.variables["cxx"] = self.options.cxx + tc.generate() + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) - # Rename the generated Findjbig.cmake and Findzstd.cmake to avoid case insensitive conflicts with FindJBIG.cmake and FindZSTD.cmake on Windows - if Version(self.version) >= "4.3.0": - if self.options.jbig: - rename(self, "Findjbig.cmake", "ConanFindjbig.cmake") - else: - os.remove(os.path.join(self.build_folder, self._source_subfolder, "cmake", "FindJBIG.cmake")) - if self.options.zstd: - rename(self, "Findzstd.cmake", "ConanFindzstd.cmake") + top_cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + libtiff_cmakelists = os.path.join(self.source_folder, "libtiff", "CMakeLists.txt") + + # Handle libjpeg-turbo + if self.options.jpeg == "libjpeg-turbo": + if Version(self.version) < "4.3.0": + file_find_package_jpeg = top_cmakelists + file_jpeg_target = top_cmakelists else: - os.remove(os.path.join(self.build_folder, self._source_subfolder, "cmake", "FindZSTD.cmake")) - - if self.options.shared and is_msvc(self): - # https://github.com/Microsoft/vcpkg/blob/master/ports/tiff/fix-cxx-shared-libs.patch - tools.replace_in_file(os.path.join(self._source_subfolder, "libtiff", "CMakeLists.txt"), - r"set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})", - r"set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION} " - r"WINDOWS_EXPORT_ALL_SYMBOLS ON)") - cmakefile = os.path.join(self._source_subfolder, "CMakeLists.txt") - if self.settings.os == "Windows" and not is_msvc(self): - if Version(self.version) < "4.2.0": - tools.replace_in_file(cmakefile, - "find_library(M_LIBRARY m)", - "if (NOT MINGW)\n find_library(M_LIBRARY m)\nendif()") - if Version(self.version) < "4.0.9": - tools.replace_in_file(cmakefile, "if (UNIX)", "if (UNIX OR MINGW)") - tools.replace_in_file(cmakefile, + file_find_package_jpeg = os.path.join(self.source_folder, "cmake", "JPEGCodec.cmake") + file_jpeg_target = libtiff_cmakelists + cpp_info_jpeg_turbo = self.dependencies["libjpeg-turbo"].cpp_info + jpeg_config = cpp_info_jpeg_turbo.get_property("cmake_file_name") or "libjpeg-turbo" + jpeg_target = cpp_info_jpeg_turbo.components["jpeg"].get_property("cmake_target_name") or "libjpeg-turbo::jpeg" + replace_in_file(self, file_find_package_jpeg, + "find_package(JPEG)", + f"find_package({jpeg_config} REQUIRED CONFIG)\nset(JPEG_FOUND TRUE)") + replace_in_file(self, file_jpeg_target, "JPEG::JPEG", jpeg_target) + + # Export symbols of tiffxx for msvc shared + replace_in_file(self, libtiff_cmakelists, + "set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})", + "set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION} WINDOWS_EXPORT_ALL_SYMBOLS ON)") + + # Disable tools, test, contrib, man & html generation + replace_in_file(self, top_cmakelists, "add_subdirectory(tools)\nadd_subdirectory(test)\nadd_subdirectory(contrib)\nadd_subdirectory(build)\n" "add_subdirectory(man)\nadd_subdirectory(html)", "") - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["lzma"] = self.options.lzma - self._cmake.definitions["jpeg"] = self.options.jpeg != False - self._cmake.definitions["jbig"] = self.options.jbig - self._cmake.definitions["zlib"] = self.options.zlib - if self._has_libdeflate_option: - self._cmake.definitions["libdeflate"] = self.options.libdeflate - if self.options.libdeflate: - if Version(self.version) < "4.3.0": - self._cmake.definitions["DEFLATE_NAMES"] = self.deps_cpp_info["libdeflate"].libs[0] - if self._has_zstd_option: - self._cmake.definitions["zstd"] = self.options.zstd - if self._has_webp_option: - self._cmake.definitions["webp"] = self.options.webp - self._cmake.definitions["cxx"] = self.options.cxx - - # Workaround for cross-build to at least iOS/tvOS/watchOS, - # when dependencies like libdeflate, jbig and zstd are found with find_path() and find_library() - # see https://github.com/conan-io/conan-center-index/issues/6637 - if tools.cross_building(self): - self._cmake.definitions["CMAKE_FIND_ROOT_PATH_MODE_INCLUDE"] = "BOTH" - self._cmake.definitions["CMAKE_FIND_ROOT_PATH_MODE_LIBRARY"] = "BOTH" - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("COPYRIGHT", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) - cmake = self._configure_cmake() + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), ignore_case=True, keep_path=False) + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) @@ -190,18 +182,15 @@ def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "TIFF") self.cpp_info.set_property("cmake_target_name", "TIFF::TIFF") - self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(Version(self.version).major)) + self.cpp_info.set_property("pkg_config_name", f"libtiff-{Version(self.version).major}") + suffix = "d" if is_msvc(self) and self.settings.build_type == "Debug" else "" if self.options.cxx: - self.cpp_info.libs.append("tiffxx") - self.cpp_info.libs.append("tiff") - if self.settings.os == "Windows" and self.settings.build_type == "Debug" and is_msvc(self): - self.cpp_info.libs = [lib + "d" for lib in self.cpp_info.libs] - if self.options.shared and self.settings.os == "Windows" and not is_msvc(self): - self.cpp_info.libs = [lib + ".dll" for lib in self.cpp_info.libs] + self.cpp_info.libs.append(f"tiffxx{suffix}") + self.cpp_info.libs.append(f"tiff{suffix}") if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: self.cpp_info.system_libs.append("m") # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "TIFF" self.cpp_info.names["cmake_find_package_multi"] = "TIFF" - self.cpp_info.names["pkg_config"] = "libtiff-{}".format(Version(self.version).major) + self.cpp_info.names["pkg_config"] = f"libtiff-{Version(self.version).major}" diff --git a/recipes/libtiff/all/patches/4.0.8-0001-cmake-add-libjpeg-turbo.patch b/recipes/libtiff/all/patches/4.0.8-0001-cmake-add-libjpeg-turbo.patch deleted file mode 100644 index a8338b086284b..0000000000000 --- a/recipes/libtiff/all/patches/4.0.8-0001-cmake-add-libjpeg-turbo.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -521,14 +521,14 @@ - set(PIXARLOG_SUPPORT TRUE) - endif() - endif() -- - # JPEG - option(jpeg "use libjpeg (required for JPEG compression)" ON) - if (jpeg) - find_package(JPEG) -+ find_package(libjpeg-turbo) - endif() - set(JPEG_SUPPORT FALSE) --if(JPEG_FOUND) -+if(JPEG_FOUND OR libjpeg-turbo_FOUND) - set(JPEG_SUPPORT TRUE) - endif() - -@@ -680,8 +680,8 @@ - if(ZLIB_INCLUDE_DIRS) - list(APPEND TIFF_INCLUDES ${ZLIB_INCLUDE_DIRS}) - endif() --if(JPEG_INCLUDE_DIR) -- list(APPEND TIFF_INCLUDES ${JPEG_INCLUDE_DIR}) -+if(JPEG_INCLUDE_DIR OR libjpeg-turbo_INCLUDE_DIRS) -+ list(APPEND TIFF_INCLUDES ${JPEG_INCLUDE_DIR} ${libjpeg-turbo_INCLUDE_DIRS}) - endif() - if(JPEG12_INCLUDE_DIR) - list(APPEND TIFF_INCLUDES ${JPEG12_INCLUDE_DIR}) -@@ -701,8 +701,8 @@ - if(ZLIB_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_LIBRARIES OR libjpeg-turbo_LIBRARIES) -+ list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES} ${libjpeg-turbo_LIBRARIES}) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..7b7979045b5a1 --- /dev/null +++ b/recipes/libtiff/all/patches/4.0.8-0001-cmake-dependencies.patch @@ -0,0 +1,38 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -544,12 +544,10 @@ endif() + option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) + if (jbig) + set(JBIG_FOUND 0) +- find_path(JBIG_INCLUDE_DIR jbig.h) +- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) +- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) +- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) ++ find_package(jbig REQUIRED CONFIG) ++ if (1) + set(JBIG_FOUND 1) +- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) ++ set(JBIG_LIBRARIES jbig::jbig) + endif() + endif() + set(JBIG_SUPPORT 0) +@@ -564,7 +562,7 @@ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARY}) +-check_function_exists(jbg_newlen HAVE_JBG_NEWLEN) ++set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + +@@ -701,8 +699,8 @@ endif() + if(ZLIB_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) + endif() +-if(JPEG_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) ++if(JPEG_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) + endif() + if(JPEG12_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch new file mode 100644 index 0000000000000..216911511380b --- /dev/null +++ b/recipes/libtiff/all/patches/4.0.8-0002-no-libm-mingw.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,7 +206,9 @@ else() + endif() + + # Find libm, if available +-find_library(M_LIBRARY m) ++if (NOT MINGW) ++ find_library(M_LIBRARY m) ++endif() + + check_include_file(assert.h HAVE_ASSERT_H) + check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch b/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch new file mode 100644 index 0000000000000..44a861121db9c --- /dev/null +++ b/recipes/libtiff/all/patches/4.0.8-0003-file-offsets-bits-mingw.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -469,7 +469,7 @@ report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER + HOST_BIG_ENDIAN HAVE_IEEEFP) + + # Large file support +-if (UNIX) ++if (UNIX OR MINGW) + # This might not catch every possibility catered for by + # AC_SYS_LARGEFILE. + add_definitions(-D_FILE_OFFSET_BITS=64) diff --git a/recipes/libtiff/all/patches/4.1.0-0001-cmake-add-libjpeg-turbo.patch b/recipes/libtiff/all/patches/4.1.0-0001-cmake-add-libjpeg-turbo.patch deleted file mode 100644 index e6039391033f1..0000000000000 --- a/recipes/libtiff/all/patches/4.1.0-0001-cmake-add-libjpeg-turbo.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -466,14 +466,14 @@ - set(PIXARLOG_SUPPORT TRUE) - endif() - endif() -- - # JPEG - option(jpeg "use libjpeg (required for JPEG compression)" ON) - if (jpeg) - find_package(JPEG) -+ find_package(libjpeg-turbo) - endif() - set(JPEG_SUPPORT FALSE) --if(JPEG_FOUND) -+if(JPEG_FOUND OR libjpeg-turbo_FOUND) - set(JPEG_SUPPORT TRUE) - endif() - -@@ -654,8 +654,8 @@ - if(ZLIB_INCLUDE_DIRS) - list(APPEND TIFF_INCLUDES ${ZLIB_INCLUDE_DIRS}) - endif() --if(JPEG_INCLUDE_DIR) -- list(APPEND TIFF_INCLUDES ${JPEG_INCLUDE_DIR}) -+if(JPEG_INCLUDE_DIR OR libjpeg-turbo_INCLUDE_DIRS) -+ list(APPEND TIFF_INCLUDES ${JPEG_INCLUDE_DIR} ${libjpeg-turbo_INCLUDE_DIRS}) - endif() - if(JPEG12_INCLUDE_DIR) - list(APPEND TIFF_INCLUDES ${JPEG12_INCLUDE_DIR}) -@@ -681,8 +681,8 @@ - if(ZLIB_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_LIBRARIES OR libjpeg-turbo_LIBRARIES) -+ list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES} ${libjpeg-turbo_LIBRARIES}) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..b8a3ec4a4b033 --- /dev/null +++ b/recipes/libtiff/all/patches/4.1.0-0001-cmake-dependencies.patch @@ -0,0 +1,85 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -489,12 +489,10 @@ endif() + option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) + if (jbig) + set(JBIG_FOUND 0) +- find_path(JBIG_INCLUDE_DIR jbig.h) +- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) +- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) +- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) ++ find_package(jbig REQUIRED CONFIG) ++ if (1) + set(JBIG_FOUND 1) +- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) ++ set(JBIG_LIBRARIES jbig::jbig) + endif() + endif() + set(JBIG_SUPPORT 0) +@@ -507,7 +505,7 @@ endif() + + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) +-check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + + # liblzma2 +@@ -523,13 +521,11 @@ endif() + # libzstd + option(zstd "use libzstd (required for ZSTD compression)" ON) + if (zstd) +- find_path(ZSTD_INCLUDE_DIR zstd.h) +- find_library(ZSTD_LIBRARY NAMES zstd) +- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) +- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) ++ find_package(zstd REQUIRED CONFIG) ++ if (1) ++ set(ZSTD_RECENT_ENOUGH TRUE) + if (ZSTD_RECENT_ENOUGH) + set(ZSTD_FOUND TRUE) +- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) + message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") + else () + message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") +@@ -544,15 +540,13 @@ endif() + # libwebp + option(webp "use libwebp (required for WEBP compression)" ON) + if (webp) +- find_path(WEBP_INCLUDE_DIR /webp/decode.h) +- find_library(WEBP_LIBRARY NAMES webp) ++ find_package(WebP REQUIRED CONFIG) + endif() + set(WEBP_SUPPORT 0) +-set(WEBP_FOUND FALSE) +-if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) ++if (WebP_FOUND) + set(WEBP_SUPPORT 1) + set(WEBP_FOUND TRUE) +- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) ++ set(WEBP_LIBRARIES WebP::webp) + message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") + endif() + +@@ -681,8 +675,8 @@ endif() + if(ZLIB_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES}) + endif() +-if(JPEG_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) ++if(JPEG_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) + endif() + if(JPEG12_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) +@@ -693,8 +687,8 @@ endif() + if(LIBLZMA_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) + endif() +-if(ZSTD_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) ++if(ZSTD_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + if(WEBP_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch b/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch new file mode 100644 index 0000000000000..0fcf8f5711810 --- /dev/null +++ b/recipes/libtiff/all/patches/4.1.0-0002-no-libm-mingw.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -207,7 +207,9 @@ else() + endif() + + # Find libm, if available +-find_library(M_LIBRARY m) ++if (NOT MINGW) ++ find_library(M_LIBRARY m) ++endif() + + check_include_file(assert.h HAVE_ASSERT_H) + check_include_file(dlfcn.h HAVE_DLFCN_H) diff --git a/recipes/libtiff/all/patches/4.2.0-0001-cmake-add-libjpeg-turbo.patch b/recipes/libtiff/all/patches/4.2.0-0001-cmake-add-libjpeg-turbo.patch deleted file mode 100644 index df3cb8b0e3e8b..0000000000000 --- a/recipes/libtiff/all/patches/4.2.0-0001-cmake-add-libjpeg-turbo.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -499,9 +499,10 @@ endif() - option(jpeg "use libjpeg (required for JPEG compression)" ON) - if (jpeg) - find_package(JPEG) -+ find_package(libjpeg-turbo) - endif() - set(JPEG_SUPPORT FALSE) --if(JPEG_FOUND) -+if(JPEG_FOUND OR libjpeg-turbo_FOUND) - set(JPEG_SUPPORT TRUE) - endif() - -@@ -685,8 +686,8 @@ endif() - if(DEFLATE_INCLUDE_DIR) - list(APPEND TIFF_INCLUDES ${DEFLATE_INCLUDE_DIR}) - endif() --if(JPEG_INCLUDE_DIR) -- list(APPEND TIFF_INCLUDES ${JPEG_INCLUDE_DIR}) -+if(JPEG_INCLUDE_DIR OR libjpeg-turbo_INCLUDE_DIRS) -+ list(APPEND TIFF_INCLUDES ${JPEG_INCLUDE_DIR} ${libjpeg-turbo_INCLUDE_DIRS}) - endif() - if(JPEG12_INCLUDE_DIR) - list(APPEND TIFF_INCLUDES ${JPEG12_INCLUDE_DIR}) -@@ -715,8 +716,8 @@ endif() - if(DEFLATE_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${DEFLATE_LIBRARIES}) - endif() --if(JPEG_LIBRARIES) -- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) -+if(JPEG_LIBRARIES OR libjpeg-turbo_LIBRARIES) -+ list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES} ${libjpeg-turbo_LIBRARIES}) - endif() - if(JPEG12_LIBRARIES) - list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..6639e9879408c --- /dev/null +++ b/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch @@ -0,0 +1,102 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -463,12 +463,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) + option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ON) + if (libdeflate) + set(DEFLATE_FOUND 0) +- find_path(DEFLATE_INCLUDE_DIR libdeflate.h) +- set(DEFLATE_NAMES ${DEFLATE_NAMES} deflate) +- find_library(DEFLATE_LIBRARY NAMES ${DEFLATE_NAMES}) +- if (DEFLATE_INCLUDE_DIR AND DEFLATE_LIBRARY) ++ find_package(libdeflate REQUIRED CONFIG) ++ if (1) + set(DEFLATE_FOUND 1) +- set(DEFLATE_LIBRARIES ${DEFLATE_LIBRARY}) ++ set(DEFLATE_LIBRARIES libdeflate::libdeflate) + endif() + endif() + set(LIBDEFLATE_SUPPORT FALSE) +@@ -517,12 +515,10 @@ endif() + option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON) + if (jbig) + set(JBIG_FOUND 0) +- find_path(JBIG_INCLUDE_DIR jbig.h) +- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig) +- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES}) +- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY) ++ find_package(jbig REQUIRED CONFIG) ++ if (1) + set(JBIG_FOUND 1) +- set(JBIG_LIBRARIES ${JBIG_LIBRARY}) ++ set(JBIG_LIBRARIES jbig::jbig) + endif() + endif() + set(JBIG_SUPPORT 0) +@@ -535,7 +531,7 @@ endif() + + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR}) +-check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + + # liblzma2 +@@ -551,14 +547,11 @@ endif() + # libzstd + option(zstd "use libzstd (required for ZSTD compression)" ON) + if (zstd) +- find_path(ZSTD_INCLUDE_DIR zstd.h) +- find_library(ZSTD_LIBRARY NAMES zstd) +- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY) +- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH) ++ find_package(zstd REQUIRED CONFIG) ++ if (1) ++ set(ZSTD_RECENT_ENOUGH TRUE) + if (ZSTD_RECENT_ENOUGH) + set(ZSTD_FOUND TRUE) +- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) +- message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}") + else () + message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0") + endif () +@@ -572,15 +565,13 @@ endif() + # libwebp + option(webp "use libwebp (required for WEBP compression)" ON) + if (webp) +- find_path(WEBP_INCLUDE_DIR /webp/decode.h) +- find_library(WEBP_LIBRARY NAMES webp) ++ find_package(WebP REQUIRED CONFIG) + endif() + set(WEBP_SUPPORT 0) +-set(WEBP_FOUND FALSE) +-if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY) ++if (WebP_FOUND) + set(WEBP_SUPPORT 1) + set(WEBP_FOUND TRUE) +- set(WEBP_LIBRARIES ${WEBP_LIBRARY}) ++ set(WEBP_LIBRARIES WebP::webp) + message(STATUS "Found WEBP library: ${WEBP_LIBRARY}") + endif() + +@@ -715,8 +706,8 @@ endif() + if(DEFLATE_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${DEFLATE_LIBRARIES}) + endif() +-if(JPEG_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES}) ++if(JPEG_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS JPEG::JPEG) + endif() + if(JPEG12_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES}) +@@ -727,8 +718,8 @@ endif() + if(LIBLZMA_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES}) + endif() +-if(ZSTD_LIBRARIES) +- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES}) ++if(ZSTD_FOUND) ++ list(APPEND TIFF_LIBRARY_DEPS $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + if(WEBP_LIBRARIES) + list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.3.0-0001-cmake-add-libjpeg-turbo.patch b/recipes/libtiff/all/patches/4.3.0-0001-cmake-add-libjpeg-turbo.patch deleted file mode 100644 index 9e17a7c186e33..0000000000000 --- a/recipes/libtiff/all/patches/4.3.0-0001-cmake-add-libjpeg-turbo.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- cmake/FindZSTD.cmake -+++ cmake/FindZSTD.cmake -@@ -1,0 +1,9 @@ -+include("${cmake_wrapper_SOURCE_DIR}/ConanFindzstd.cmake") -+if(NOT TARGET ZSTD::ZSTD) -+ add_library(ZSTD::ZSTD INTERFACE IMPORTED) -+ if(TARGET zstd::libzstd_shared) -+ set_target_properties(ZSTD::ZSTD PROPERTIES INTERFACE_LINK_LIBRARIES zstd::libzstd_shared) -+ else() -+ set_target_properties(ZSTD::ZSTD PROPERTIES INTERFACE_LINK_LIBRARIES zstd::libzstd_static) -+ endif() -+endif() ---- cmake/FindJBIG.cmake -+++ cmake/FindJBIG.cmake -@@ -1,0 +1,5 @@ -+include("${cmake_wrapper_SOURCE_DIR}/ConanFindjbig.cmake") -+if(NOT TARGET JBIG::JBIG) -+ add_library(JBIG::JBIG INTERFACE IMPORTED) -+ set_target_properties(JBIG::JBIG PROPERTIES INTERFACE_LINK_LIBRARIES jbig::jbig) -+endif() ---- cmake/JPEGCodec.cmake -+++ cmake/JPEGCodec.cmake -@@ -24,11 +24,11 @@ --# OF THIS SOFTWARE. -- -- --# JPEG - set(JPEG_SUPPORT FALSE) -+if(DEFINED CONAN_LIBJPEG_ROOT) - find_package(JPEG) -+else() -+find_package(libjpeg-turbo) -+endif() - option(jpeg "use libjpeg (required for JPEG compression)" ${JPEG_FOUND}) --if (jpeg AND JPEG_FOUND) -+if (jpeg AND (JPEG_FOUND OR libjpeg-turbo_FOUND)) - set(JPEG_SUPPORT TRUE) - endif() - ---- libtiff/CMakeLists.txt -+++ libtiff/CMakeLists.txt -@@ -113,7 +113,7 @@ - target_link_libraries(tiff PRIVATE Deflate::Deflate) - endif() - if(JPEG_SUPPORT) -- target_link_libraries(tiff PRIVATE JPEG::JPEG) -+ target_link_libraries(tiff PRIVATE $ $ $) - if(JPEG_DUAL_MODE_8_12) - target_include_directories(tiff PRIVATE ${JPEG12_INCLUDE_DIR}) - target_link_libraries(tiff PRIVATE ${JPEG12_LIBRARIES}) diff --git a/recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..a14bbb01635d3 --- /dev/null +++ b/recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch @@ -0,0 +1,91 @@ +--- a/cmake/DeflateCodec.cmake ++++ b/cmake/DeflateCodec.cmake +@@ -35,7 +35,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) + + # libdeflate + set(LIBDEFLATE_SUPPORT FALSE) +-find_package(Deflate) ++find_package(libdeflate CONFIG) ++if(libdeflate_FOUND) ++ set(Deflate_FOUND TRUE) ++endif() + option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ${Deflate_FOUND}) + if (libdeflate AND Deflate_FOUND AND ZIP_SUPPORT) + set(LIBDEFLATE_SUPPORT TRUE) +--- a/cmake/JBIGCodec.cmake ++++ b/cmake/JBIGCodec.cmake +@@ -27,14 +27,17 @@ + # JBIG-KIT + set(JBIG_SUPPORT FALSE) + +-find_package(JBIG) ++find_package(jbig CONFIG) ++if(jbig_FOUND) ++ set(JBIG_FOUND TRUE) ++endif() + + if(JBIG_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES}) +- check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++ set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + endif() +--- a/cmake/ZSTDCodec.cmake ++++ b/cmake/ZSTDCodec.cmake +@@ -28,14 +28,17 @@ + set(ZSTD_SUPPORT FALSE) + set(ZSTD_USABLE FALSE) + +-find_package(ZSTD) ++find_package(zstd CONFIG) ++if(zstd_FOUND) ++ set(ZSTD_FOUND TRUE) ++endif() + + if(ZSTD_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ZSTD_LIBRARIES}) +- check_symbol_exists(ZSTD_decompressStream "zstd.h" ZSTD_RECENT_ENOUGH) ++ set(ZSTD_RECENT_ENOUGH TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + +--- a/libtiff/CMakeLists.txt ++++ b/libtiff/CMakeLists.txt +@@ -110,7 +110,7 @@ if(ZIP_SUPPORT) + target_link_libraries(tiff PRIVATE ZLIB::ZLIB) + endif() + if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) +- target_link_libraries(tiff PRIVATE Deflate::Deflate) ++ target_link_libraries(tiff PRIVATE libdeflate::libdeflate) + endif() + if(JPEG_SUPPORT) + target_link_libraries(tiff PRIVATE JPEG::JPEG) +@@ -120,7 +120,7 @@ if(JPEG_SUPPORT) + endif() + endif() + if(JBIG_SUPPORT) +- target_link_libraries(tiff PRIVATE JBIG::JBIG) ++ target_link_libraries(tiff PRIVATE jbig::jbig) + endif() + if(LERC_SUPPORT) + target_link_libraries(tiff PRIVATE LERC::LERC) +@@ -129,10 +129,10 @@ if(LZMA_SUPPORT) + target_link_libraries(tiff PRIVATE LibLZMA::LibLZMA) + endif() + if(ZSTD_SUPPORT) +- target_link_libraries(tiff PRIVATE ZSTD::ZSTD) ++ target_link_libraries(tiff PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + if(WEBP_SUPPORT) +- target_link_libraries(tiff PRIVATE WebP::WebP) ++ target_link_libraries(tiff PRIVATE WebP::webp) + endif() + target_link_libraries(tiff PRIVATE CMath::CMath) + diff --git a/recipes/libtiff/all/patches/4.4.0-0001-cmake-add-libjpeg-turbo.patch b/recipes/libtiff/all/patches/4.4.0-0001-cmake-add-libjpeg-turbo.patch deleted file mode 100644 index 6736da2ac6f15..0000000000000 --- a/recipes/libtiff/all/patches/4.4.0-0001-cmake-add-libjpeg-turbo.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- cmake/FindZSTD.cmake -+++ cmake/FindZSTD.cmake -@@ -1,0 +1,9 @@ -+include("${cmake_wrapper_SOURCE_DIR}/ConanFindzstd.cmake") -+if(NOT TARGET ZSTD::ZSTD) -+ add_library(ZSTD::ZSTD INTERFACE IMPORTED) -+ if(TARGET zstd::libzstd_shared) -+ set_target_properties(ZSTD::ZSTD PROPERTIES INTERFACE_LINK_LIBRARIES zstd::libzstd_shared) -+ else() -+ set_target_properties(ZSTD::ZSTD PROPERTIES INTERFACE_LINK_LIBRARIES zstd::libzstd_static) -+ endif() -+endif() ---- cmake/FindJBIG.cmake -+++ cmake/FindJBIG.cmake -@@ -1,0 +1,5 @@ -+include("${cmake_wrapper_SOURCE_DIR}/ConanFindjbig.cmake") -+if(NOT TARGET JBIG::JBIG) -+ add_library(JBIG::JBIG INTERFACE IMPORTED) -+ set_target_properties(JBIG::JBIG PROPERTIES INTERFACE_LINK_LIBRARIES jbig::jbig) -+endif() ---- cmake/JPEGCodec.cmake -+++ cmake/JPEGCodec.cmake -@@ -24,11 +24,11 @@ --# OF THIS SOFTWARE. -- -- --# JPEG - set(JPEG_SUPPORT FALSE) -+if(DEFINED CONAN_LIBJPEG_ROOT) - find_package(JPEG) -+else() -+find_package(libjpeg-turbo) -+endif() - option(jpeg "use libjpeg (required for JPEG compression)" ${JPEG_FOUND}) --if (jpeg AND JPEG_FOUND) -+if (jpeg AND (JPEG_FOUND OR libjpeg-turbo_FOUND)) - set(JPEG_SUPPORT TRUE) - endif() - ---- libtiff/CMakeLists.txt -+++ libtiff/CMakeLists.txt -@@ -118,7 +118,7 @@ - list(APPEND tiff_libs_private_list "${Deflate_LIBRARY}") - endif() - if(JPEG_SUPPORT) -- target_link_libraries(tiff PRIVATE JPEG::JPEG) -+ target_link_libraries(tiff PRIVATE $ $ $) - string(APPEND tiff_requires_private " libjpeg") - if(JPEG_DUAL_MODE_8_12) - target_include_directories(tiff PRIVATE ${JPEG12_INCLUDE_DIR}) diff --git a/recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch b/recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch new file mode 100644 index 0000000000000..6dcc12574992c --- /dev/null +++ b/recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch @@ -0,0 +1,92 @@ +--- a/cmake/DeflateCodec.cmake ++++ b/cmake/DeflateCodec.cmake +@@ -35,7 +35,10 @@ set(ZIP_SUPPORT ${ZLIB_SUPPORT}) + + # libdeflate + set(LIBDEFLATE_SUPPORT FALSE) +-find_package(Deflate) ++find_package(libdeflate CONFIG) ++if(libdeflate_FOUND) ++ set(Deflate_FOUND TRUE) ++endif() + option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ${Deflate_FOUND}) + if (libdeflate AND Deflate_FOUND AND ZIP_SUPPORT) + set(LIBDEFLATE_SUPPORT TRUE) +--- a/cmake/JBIGCodec.cmake ++++ b/cmake/JBIGCodec.cmake +@@ -27,14 +27,17 @@ + # JBIG-KIT + set(JBIG_SUPPORT FALSE) + +-find_package(JBIG) ++find_package(jbig CONFIG) ++if(jbig_FOUND) ++ set(JBIG_FOUND TRUE) ++endif() + + if(JBIG_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES}) +- check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++ set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + endif() +--- a/cmake/ZSTDCodec.cmake ++++ b/cmake/ZSTDCodec.cmake +@@ -28,14 +28,17 @@ + set(ZSTD_SUPPORT FALSE) + set(ZSTD_USABLE FALSE) + +-find_package(ZSTD) ++find_package(zstd CONFIG) ++if(zstd_FOUND) ++ set(ZSTD_FOUND TRUE) ++endif() + + if(ZSTD_FOUND) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ZSTD_LIBRARIES}) +- check_symbol_exists(ZSTD_decompressStream "zstd.h" ZSTD_RECENT_ENOUGH) ++ set(ZSTD_RECENT_ENOUGH TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + +--- a/libtiff/CMakeLists.txt ++++ b/libtiff/CMakeLists.txt +@@ -114,7 +114,7 @@ if(ZIP_SUPPORT) + string(APPEND tiff_requires_private " zlib") + endif() + if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) +- target_link_libraries(tiff PRIVATE Deflate::Deflate) ++ target_link_libraries(tiff PRIVATE libdeflate::libdeflate) + list(APPEND tiff_libs_private_list "${Deflate_LIBRARY}") + endif() + if(JPEG_SUPPORT) +@@ -126,7 +126,7 @@ if(JPEG_SUPPORT) + endif() + endif() + if(JBIG_SUPPORT) +- target_link_libraries(tiff PRIVATE JBIG::JBIG) ++ target_link_libraries(tiff PRIVATE jbig::jbig) + list(APPEND tiff_libs_private_list "${JBIG_LIBRARY}") + endif() + if(LERC_SUPPORT) +@@ -141,11 +141,11 @@ if(LZMA_SUPPORT) + string(APPEND tiff_requires_private " liblzma") + endif() + if(ZSTD_SUPPORT) +- target_link_libraries(tiff PRIVATE ZSTD::ZSTD) ++ target_link_libraries(tiff PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) + string(APPEND tiff_requires_private " libzstd") + endif() + if(WEBP_SUPPORT) +- target_link_libraries(tiff PRIVATE WebP::WebP) ++ target_link_libraries(tiff PRIVATE WebP::webp) + string(APPEND tiff_requires_private " libwebp") + endif() + target_link_libraries(tiff PRIVATE CMath::CMath) diff --git a/recipes/libtiff/all/test_package/CMakeLists.txt b/recipes/libtiff/all/test_package/CMakeLists.txt index 5d81acd120205..cd389da928806 100644 --- a/recipes/libtiff/all/test_package/CMakeLists.txt +++ b/recipes/libtiff/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(TIFF REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} TIFF::TIFF) +target_link_libraries(${PROJECT_NAME} PRIVATE TIFF::TIFF) diff --git a/recipes/libtiff/all/test_package/conanfile.py b/recipes/libtiff/all/test_package/conanfile.py index 3da371b660e0a..0a6bc68712d90 100644 --- a/recipes/libtiff/all/test_package/conanfile.py +++ b/recipes/libtiff/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libtiff/all/test_v1_package/CMakeLists.txt b/recipes/libtiff/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..82fc25886bcef --- /dev/null +++ b/recipes/libtiff/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(TIFF REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE TIFF::TIFF) diff --git a/recipes/libtiff/all/test_v1_package/conanfile.py b/recipes/libtiff/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/libtiff/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 8bf350b7b63575a1f741b1d2218ec7a461bf63cd Mon Sep 17 00:00:00 2001 From: Ayoub Kaanich Date: Mon, 26 Sep 2022 14:05:08 +0200 Subject: [PATCH 200/561] (#13132) Remove build_policy from npcap test package --- recipes/npcap/all/test_package/conanfile.py | 2 -- recipes/npcap/all/test_v1_package/conanfile.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/recipes/npcap/all/test_package/conanfile.py b/recipes/npcap/all/test_package/conanfile.py index a2a49be1c85ef..88fb844b5824b 100644 --- a/recipes/npcap/all/test_package/conanfile.py +++ b/recipes/npcap/all/test_package/conanfile.py @@ -11,8 +11,6 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" - # Needed to make sure libpcap gets compiled - build_policy = "missing" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/npcap/all/test_v1_package/conanfile.py b/recipes/npcap/all/test_v1_package/conanfile.py index 215fce6994f62..1b88417f558b4 100644 --- a/recipes/npcap/all/test_v1_package/conanfile.py +++ b/recipes/npcap/all/test_v1_package/conanfile.py @@ -9,8 +9,6 @@ class TestPackageV1Conan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" - # Needed to make sure libpcap gets compiled - build_policy = "missing" def requirements(self): self.requires(self.tested_reference_str) From bfb15ffa12e84393a477644e85244d1b33f5450d Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Mon, 26 Sep 2022 16:25:13 +0200 Subject: [PATCH 201/561] (#13107) lzma_sdk: generate gcc11 binaries * lzma_sdk: generate gcc11 binaries * Update conanfile.py * Update conanfile.py * fix link with windows 11 sdk * Update recipes/lzma_sdk/9.20/conanfile.py Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/lzma_sdk/9.20/conanfile.py | 37 ++++++++++++++++-------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/recipes/lzma_sdk/9.20/conanfile.py b/recipes/lzma_sdk/9.20/conanfile.py index 3d677c0f510f8..66f4dfa40693b 100644 --- a/recipes/lzma_sdk/9.20/conanfile.py +++ b/recipes/lzma_sdk/9.20/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment +from conan import ConanFile +from conan.tools.files import get, chdir, replace_in_file, rm +from conans import tools, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" """ This older lzma release is used to build 7zip (to extract its sources). @@ -41,9 +43,9 @@ def package_id(self): del self.info.settings.compiler def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder) - os.unlink(os.path.join(self._source_subfolder, "7zr.exe")) - os.unlink(os.path.join(self._source_subfolder, "lzma.exe")) + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder) + rm(self, "7zr.exe", self._source_subfolder) + rm(self, "lzma.exe", self._source_subfolder) @property def _msvc_build_dirs(self): @@ -66,8 +68,8 @@ def _msvc_cpu(self): def _autotools_build_dirs(self): es = ".exe" if self.settings.os == "Windows" else "" return ( - (os.path.join(self._source_subfolder, "C", "Util", "7z"), "7zDec{}".format(es)), - (os.path.join(self._source_subfolder, "CPP", "7zip", "Bundles", "LzmaCon"), "lzma{}".format(es)), + (os.path.join(self._source_subfolder, "C", "Util", "7z"), f"7zDec{es}"), + (os.path.join(self._source_subfolder, "CPP", "7zip", "Bundles", "LzmaCon"), f"lzma{es}"), ) def _build_msvc(self): @@ -75,13 +77,13 @@ def _build_msvc(self): with tools.vcvars(self): with tools.environment_append(VisualStudioBuildEnvironment(self).vars): with tools.chdir(make_dir): - self.run("nmake /f makefile NEW_COMPILER=1 CPU={}".format(self._msvc_cpu)) + self.run(f"nmake /f makefile NEW_COMPILER=1 CPU={self._msvc_cpu} NO_BUFFEROVERFLOWU=1") def _build_autotools(self): env_build = AutoToolsBuildEnvironment(self) with tools.environment_append(env_build.vars): for make_dir, _ in self._autotools_build_dirs: - with tools.chdir(make_dir): + with chdir(self, make_dir): args = [ "-f", "makefile.gcc", ] @@ -92,24 +94,24 @@ def _build_autotools(self): def _patch_sources(self): if self.settings.compiler == "Visual Studio": - tools.replace_in_file(os.path.join(self._source_subfolder, "CPP", "Build.mak"), + replace_in_file(self, os.path.join(self._source_subfolder, "CPP", "Build.mak"), "-MT\r", "-" + str(self.settings.compiler.runtime)) - tools.replace_in_file(os.path.join(self._source_subfolder, "CPP", "Build.mak"), + replace_in_file(self, os.path.join(self._source_subfolder, "CPP", "Build.mak"), "-MD\r", "-" + str(self.settings.compiler.runtime)) - tools.replace_in_file(os.path.join(self._source_subfolder, "CPP", "Build.mak"), + replace_in_file(self, os.path.join(self._source_subfolder, "CPP", "Build.mak"), " -WX ", " ") # Patches for other build systems - tools.replace_in_file(os.path.join(self._source_subfolder, "C", "Util", "7z", "makefile.gcc"), + replace_in_file(self, os.path.join(self._source_subfolder, "C", "Util", "7z", "makefile.gcc"), "CFLAGS = ", "CFLAGS = -fpermissive ") - tools.replace_in_file(os.path.join(self._source_subfolder, "C", "Util", "7z", "makefile.gcc"), + replace_in_file(self, os.path.join(self._source_subfolder, "C", "Util", "7z", "makefile.gcc"), ": 7zAlloc.c", ": ../../7zAlloc.c") - tools.replace_in_file(os.path.join(self._source_subfolder, "C", "Util", "Lzma", "makefile.gcc"), + replace_in_file(self, os.path.join(self._source_subfolder, "C", "Util", "Lzma", "makefile.gcc"), "CFLAGS = ", "CFLAGS = -fpermissive ") - tools.replace_in_file(os.path.join(self._source_subfolder, "CPP", "Common", "MyString.h"), + replace_in_file(self, os.path.join(self._source_subfolder, "CPP", "Common", "MyString.h"), "#ifdef _WIN32\r\n", "#ifdef _WIN32\r\n#ifndef UNDER_CE\r\n#include \r\n#endif\r\n") @@ -132,6 +134,7 @@ def package(self): def package_info(self): self.cpp_info.libdirs = [] + self.cpp_info.includedirs = [] bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.path.append(bin_path) From 92035a949620f4d00da2db8fdd044ef6d582fcb8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 26 Sep 2022 16:45:07 +0200 Subject: [PATCH 202/561] (#13110) cppcodec: conan v2 support --- recipes/cppcodec/all/conanfile.py | 43 ++++++++++++++----- .../cppcodec/all/test_package/CMakeLists.txt | 13 +++--- .../cppcodec/all/test_package/conanfile.py | 23 +++++++--- .../{example.cpp => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 11 +++++ .../cppcodec/all/test_v1_package/conanfile.py | 17 ++++++++ recipes/cppcodec/config.yml | 1 - 7 files changed, 82 insertions(+), 26 deletions(-) rename recipes/cppcodec/all/test_package/{example.cpp => test_package.cpp} (100%) create mode 100644 recipes/cppcodec/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cppcodec/all/test_v1_package/conanfile.py diff --git a/recipes/cppcodec/all/conanfile.py b/recipes/cppcodec/all/conanfile.py index c843146d3df75..59f96dbe4a59f 100644 --- a/recipes/cppcodec/all/conanfile.py +++ b/recipes/cppcodec/all/conanfile.py @@ -1,5 +1,10 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -from conans import ConanFile, tools + +required_conan_version = ">=1.50.0" class CppcodecConan(ConanFile): @@ -7,21 +12,37 @@ class CppcodecConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tplgy/cppcodec" - description = "Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32" + description = ( + "Header-only C++11 library to encode/decode base64, base64url, base32, " + "base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32" + ) topics = ("base64", "cpp11", "codec", "base32") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _source_subfolder = "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - def package(self): - self.copy("*hpp", dst=os.path.join("include", "cppcodec"), src=os.path.join(self._source_subfolder, "cppcodec")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + def build(self): + pass - def package_id(self): - self.info.header_only() + def package(self): + copy(self, "*hpp", src=os.path.join(self.source_folder, "cppcodec"), dst=os.path.join(self.package_folder, "include", "cppcodec")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "cppcodec-1") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/cppcodec/all/test_package/CMakeLists.txt b/recipes/cppcodec/all/test_package/CMakeLists.txt index 6aab347eddf53..d359976811ee3 100644 --- a/recipes/cppcodec/all/test_package/CMakeLists.txt +++ b/recipes/cppcodec/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(cppcodec REQUIRED CONFIG) -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) -set_property(TARGET example PROPERTY CXX_STANDARD 11) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppcodec::cppcodec) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cppcodec/all/test_package/conanfile.py b/recipes/cppcodec/all/test_package/conanfile.py index 9a662bfeb73fe..0a6bc68712d90 100644 --- a/recipes/cppcodec/all/test_package/conanfile.py +++ b/recipes/cppcodec/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, cmake_layout import os -from conans import ConanFile, CMake, tools -class CppcodecTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "example") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cppcodec/all/test_package/example.cpp b/recipes/cppcodec/all/test_package/test_package.cpp similarity index 100% rename from recipes/cppcodec/all/test_package/example.cpp rename to recipes/cppcodec/all/test_package/test_package.cpp diff --git a/recipes/cppcodec/all/test_v1_package/CMakeLists.txt b/recipes/cppcodec/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4e3738c68e0b9 --- /dev/null +++ b/recipes/cppcodec/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cppcodec REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cppcodec::cppcodec) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cppcodec/all/test_v1_package/conanfile.py b/recipes/cppcodec/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cppcodec/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/cppcodec/config.yml b/recipes/cppcodec/config.yml index 4862588660bd8..7e65100e62b2c 100644 --- a/recipes/cppcodec/config.yml +++ b/recipes/cppcodec/config.yml @@ -1,4 +1,3 @@ ---- versions: "0.2": folder: all From c9ed46560bd80332a8265fef306df5b87c512cd6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:05:10 +0200 Subject: [PATCH 203/561] (#13112) picojson: conan v2 support --- recipes/picojson/all/conandata.yml | 12 +++---- recipes/picojson/all/conanfile.py | 32 +++++++++++++------ .../picojson/all/test_package/CMakeLists.txt | 13 ++++---- .../picojson/all/test_package/conanfile.py | 32 +++++++++---------- .../{example.cpp => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 11 +++++++ .../picojson/all/test_v1_package/conanfile.py | 17 ++++++++++ recipes/picojson/config.yml | 8 ++--- 8 files changed, 83 insertions(+), 42 deletions(-) rename recipes/picojson/all/test_package/{example.cpp => test_package.cpp} (100%) create mode 100644 recipes/picojson/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/picojson/all/test_v1_package/conanfile.py diff --git a/recipes/picojson/all/conandata.yml b/recipes/picojson/all/conandata.yml index 8fc39d2b5d249..64e533b3e850a 100644 --- a/recipes/picojson/all/conandata.yml +++ b/recipes/picojson/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "cci.20210117": - url: "https://github.com/kazuho/picojson/archive/111c9be5188f7350c2eac9ddaedd8cca3d7bf394.zip" - sha256: 9937fc918d32a2e802a32e1565f48b04850ece0389ce22e8e3acba54aee13c99 - "1.3.0": - url: "https://github.com/kazuho/picojson/archive/v1.3.0.zip" - sha256: 58fff34589d93b0cef208a456788b9de6c7d04cfa9a7be576328ca7b48f10069 + "cci.20210117": + url: "https://github.com/kazuho/picojson/archive/111c9be5188f7350c2eac9ddaedd8cca3d7bf394.zip" + sha256: "9937fc918d32a2e802a32e1565f48b04850ece0389ce22e8e3acba54aee13c99" + "1.3.0": + url: "https://github.com/kazuho/picojson/archive/v1.3.0.zip" + sha256: "58fff34589d93b0cef208a456788b9de6c7d04cfa9a7be576328ca7b48f10069" diff --git a/recipes/picojson/all/conanfile.py b/recipes/picojson/all/conanfile.py index fbc4acf3394f7..d6af3be3fb2be 100644 --- a/recipes/picojson/all/conanfile.py +++ b/recipes/picojson/all/conanfile.py @@ -1,5 +1,9 @@ -from conans import ConanFile, tools -import os, glob +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" class PicoJSONConan(ConanFile): @@ -8,18 +12,28 @@ class PicoJSONConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/kazuho/picojson" description = "A C++ JSON parser/serializer" - topics = ("picojson", "json", "header-only", "conan-recipe") + topics = ("picojson", "json", "header-only") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - _source_subfolder = "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(glob.glob("picojson-*")[0], self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("{}.h".format(self.name), dst="include", src=self._source_subfolder) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "picojson.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) def package_info(self): - self.info.header_only() + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/picojson/all/test_package/CMakeLists.txt b/recipes/picojson/all/test_package/CMakeLists.txt index e84da4689b1cb..26a59553dbe52 100644 --- a/recipes/picojson/all/test_package/CMakeLists.txt +++ b/recipes/picojson/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -find_package(picojson REQUIRED) +find_package(picojson REQUIRED CONFIG) -add_executable(example example.cpp) -set_property(TARGET example PROPERTY CXX_STANDARD 11) - -target_link_libraries(example picojson::picojson) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE picojson::picojson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/picojson/all/test_package/conanfile.py b/recipes/picojson/all/test_package/conanfile.py index 446a5dff1281a..0a6bc68712d90 100644 --- a/recipes/picojson/all/test_package/conanfile.py +++ b/recipes/picojson/all/test_package/conanfile.py @@ -1,26 +1,26 @@ -from conans import ConanFile, CMake, tools - +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -class PicoJSONTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package" - @property - def _is_multi_configuration(self): - cmake = CMake(self) - return cmake.is_multi_configuration +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) - # Current dir is "test_package/build/" and CMakeLists.txt is - # in "test_package" cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = "example" - if self._is_multi_configuration: - bin_path = os.path.join(str(self.settings.build_type), bin_path) - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/picojson/all/test_package/example.cpp b/recipes/picojson/all/test_package/test_package.cpp similarity index 100% rename from recipes/picojson/all/test_package/example.cpp rename to recipes/picojson/all/test_package/test_package.cpp diff --git a/recipes/picojson/all/test_v1_package/CMakeLists.txt b/recipes/picojson/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..76b4af39af45d --- /dev/null +++ b/recipes/picojson/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(picojson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE picojson::picojson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/picojson/all/test_v1_package/conanfile.py b/recipes/picojson/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/picojson/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/picojson/config.yml b/recipes/picojson/config.yml index 8c6ed9e6ba8aa..3bca60b62a2dc 100644 --- a/recipes/picojson/config.yml +++ b/recipes/picojson/config.yml @@ -1,5 +1,5 @@ versions: - "cci.20210117": - folder: all - "1.3.0": - folder: all + "cci.20210117": + folder: all + "1.3.0": + folder: all From c15fb3dd31c4a69d26696f10f7b4a8262009aaf6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:44:56 +0200 Subject: [PATCH 204/561] (#13114) highfive: conan v2 support + fix CMake imported target + bump dependencies * conan v2 support * bump dependencies --- recipes/highfive/all/CMakeLists.txt | 7 - recipes/highfive/all/conanfile.py | 131 +++++++++++------- .../highfive/all/test_package/CMakeLists.txt | 12 +- .../highfive/all/test_package/conanfile.py | 25 ++-- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../highfive/all/test_v1_package/conanfile.py | 17 +++ 6 files changed, 132 insertions(+), 71 deletions(-) delete mode 100644 recipes/highfive/all/CMakeLists.txt create mode 100644 recipes/highfive/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/highfive/all/test_v1_package/conanfile.py diff --git a/recipes/highfive/all/CMakeLists.txt b/recipes/highfive/all/CMakeLists.txt deleted file mode 100644 index 4d393c7a86c09..0000000000000 --- a/recipes/highfive/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory("source_subfolder") diff --git a/recipes/highfive/all/conanfile.py b/recipes/highfive/all/conanfile.py index 7328169f3ba4c..2547f248b8e4c 100644 --- a/recipes/highfive/all/conanfile.py +++ b/recipes/highfive/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import CMake, ConanFile, tools -import os.path +from conan import ConanFile +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, replace_in_file, rmdir, save +import os +import textwrap -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" class HighFiveConan(ConanFile): @@ -11,8 +15,7 @@ class HighFiveConan(ConanFile): topics = ("hdf5", "hdf", "data") homepage = "https://github.com/BlueBrain/HighFive" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" options = { "with_boost": [True, False], @@ -27,72 +30,98 @@ class HighFiveConan(ConanFile): "with_opencv": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("hdf5/1.12.0") + self.requires("hdf5/1.13.1") if self.options.with_boost: - self.requires("boost/1.77.0") + self.requires("boost/1.80.0") if self.options.with_eigen: self.requires("eigen/3.4.0") if self.options.with_xtensor: - self.requires("xtensor/0.23.10") + self.requires("xtensor/0.24.2") if self.options.with_opencv: - self.requires("opencv/4.5.3") + self.requires("opencv/4.5.5") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) - def build(self): - tools.replace_in_file( - os.path.join(self._source_subfolder, "CMake", "HighFiveTargetDeps.cmake"), + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_BOOST"] = self.options.with_boost + tc.variables["USE_EIGEN"] = self.options.with_eigen + tc.variables["USE_XTENSOR"] = self.options.with_xtensor + tc.variables["USE_OPENCV"] = self.options.with_opencv + tc.variables["HIGHFIVE_UNIT_TESTS"] = False + tc.variables["HIGHFIVE_EXAMPLES"] = False + tc.variables["HIGHFIVE_BUILD_DOCS"] = False + tc.variables["HIGHFIVE_USE_INSTALL_DEPS"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + replace_in_file( + self, + os.path.join(self.source_folder, "CMake", "HighFiveTargetDeps.cmake"), "find_package(Eigen3 NO_MODULE)", "find_package(Eigen3 REQUIRED)", ) - tools.replace_in_file( - os.path.join(self._source_subfolder, "CMake", "HighFiveTargetDeps.cmake"), + replace_in_file( + self, + os.path.join(self.source_folder, "CMake", "HighFiveTargetDeps.cmake"), "EIGEN3_INCLUDE_DIRS", "Eigen3_INCLUDE_DIRS", ) - cmake = self._configure_cmake() + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["USE_BOOST"] = self.options.with_boost - self._cmake.definitions["USE_EIGEN"] = self.options.with_eigen - self._cmake.definitions["USE_XTENSOR"] = self.options.with_xtensor - self._cmake.definitions["USE_OPENCV"] = self.options.with_opencv - self._cmake.definitions["HIGHFIVE_UNIT_TESTS"] = False - self._cmake.definitions["HIGHFIVE_EXAMPLES"] = False - self._cmake.definitions["HIGHFIVE_BUILD_DOCS"] = False - self._cmake.definitions["HIGHFIVE_USE_INSTALL_DEPS"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - - def package_id(self): - self.info.header_only() - def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - 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, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) + + # TODO: to remove in conan v2 once legacy generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"HighFive": "HighFive::HighFive"}, + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): - self.cpp_info.names["cmake_find_package"] = "HighFive" - self.cpp_info.names["cmake_find_package_multi"] = "HighFive" + self.cpp_info.set_property("cmake_file_name", "HighFive") + self.cpp_info.set_property("cmake_target_name", "HighFive") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] self.cpp_info.requires = ["hdf5::hdf5"] if self.options.with_boost: self.cpp_info.requires.append("boost::headers") @@ -102,3 +131,9 @@ def package_info(self): self.cpp_info.requires.append("xtensor::xtensor") if self.options.with_opencv: self.cpp_info.requires.append("opencv::opencv") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "HighFive" + self.cpp_info.names["cmake_find_package_multi"] = "HighFive" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/highfive/all/test_package/CMakeLists.txt b/recipes/highfive/all/test_package/CMakeLists.txt index 49b6d7a88fe87..9094d8eb2cd6d 100644 --- a/recipes/highfive/all/test_package/CMakeLists.txt +++ b/recipes/highfive/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.1) - +cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 11) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) -find_package(HighFive 2.3 REQUIRED) +find_package(HighFive REQUIRED CONFIG) add_executable(test_package test_package.cpp) -target_link_libraries(test_package HighFive::HighFive) +target_link_libraries(test_package PRIVATE HighFive) +target_compile_features(test_package PRIVATE cxx_std_11) diff --git a/recipes/highfive/all/test_package/conanfile.py b/recipes/highfive/all/test_package/conanfile.py index 817752e58b49a..0a6bc68712d90 100644 --- a/recipes/highfive/all/test_package/conanfile.py +++ b/recipes/highfive/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import CMake, ConanFile, tools -import os.path +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os -class HighFiveTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/highfive/all/test_v1_package/CMakeLists.txt b/recipes/highfive/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..671f071b8ed9f --- /dev/null +++ b/recipes/highfive/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(HighFive REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE HighFive) +target_compile_features(test_package PRIVATE cxx_std_11) diff --git a/recipes/highfive/all/test_v1_package/conanfile.py b/recipes/highfive/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4453fcd822f20 --- /dev/null +++ b/recipes/highfive/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 20994c604143fe32e63b3c547c28b42a465cc7aa Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Sep 2022 04:46:02 +0200 Subject: [PATCH 205/561] (#13120) nlohmann_json: small improvements * tiny improvements * Update recipes/nlohmann_json/all/conanfile.py --- recipes/nlohmann_json/all/conanfile.py | 23 ++++++++++++------- .../all/test_package/CMakeLists.txt | 8 +++---- .../all/test_package/conanfile.py | 1 + .../all/test_v1_package/CMakeLists.txt | 8 +++---- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/recipes/nlohmann_json/all/conanfile.py b/recipes/nlohmann_json/all/conanfile.py index 5bb517c0955a7..09b5607e0454d 100644 --- a/recipes/nlohmann_json/all/conanfile.py +++ b/recipes/nlohmann_json/all/conanfile.py @@ -1,8 +1,8 @@ -import os - from conan import ConanFile +from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get from conan.tools.layout import basic_layout +import os required_conan_version = ">=1.50.0" @@ -23,17 +23,24 @@ def layout(self): def package_id(self): self.info.clear() - def generate(self): - pass + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): copy(self, "LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses")) copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "nlohmann_json" - self.cpp_info.names["cmake_find_package_multi"] = "nlohmann_json" - self.cpp_info.names["pkg_config"] = "nlohmann_json" + self.cpp_info.set_property("cmake_file_name", "nlohmann_json") + self.cpp_info.set_property("cmake_target_name", "nlohmann_json::nlohmann_json") + self.cpp_info.set_property("pkg_config_name", "nlohmann_json") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/nlohmann_json/all/test_package/CMakeLists.txt b/recipes/nlohmann_json/all/test_package/CMakeLists.txt index a0cd149e8acbf..8976512b85ce6 100644 --- a/recipes/nlohmann_json/all/test_package/CMakeLists.txt +++ b/recipes/nlohmann_json/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(nlohmann_json REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} nlohmann_json::nlohmann_json) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE nlohmann_json::nlohmann_json) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nlohmann_json/all/test_package/conanfile.py b/recipes/nlohmann_json/all/test_package/conanfile.py index 87a7297528bf3..cb68885270b30 100644 --- a/recipes/nlohmann_json/all/test_package/conanfile.py +++ b/recipes/nlohmann_json/all/test_package/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/nlohmann_json/all/test_v1_package/CMakeLists.txt b/recipes/nlohmann_json/all/test_v1_package/CMakeLists.txt index 6eb158583c5c7..611fe4322eb54 100644 --- a/recipes/nlohmann_json/all/test_v1_package/CMakeLists.txt +++ b/recipes/nlohmann_json/all/test_v1_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) @@ -7,5 +7,5 @@ conan_basic_setup(TARGETS) find_package(nlohmann_json REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} nlohmann_json::nlohmann_json) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE nlohmann_json::nlohmann_json) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) From 67d66b50268b7b47d9317d7387f3275ba60a055f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Sep 2022 05:04:53 +0200 Subject: [PATCH 206/561] (#13121) gtest: set the correct required_conan_version + few minor fixes * update required_conan_version 1.51.1 is needed due to get_safe in self.info * reorder methods * use self.info in validate() * fix indentation * protect deletion of fPIC --- recipes/gtest/all/conanfile.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py index 69f7ada3421c8..967828a11c68b 100644 --- a/recipes/gtest/all/conanfile.py +++ b/recipes/gtest/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.51.1" class GTestConan(ConanFile): @@ -37,7 +37,7 @@ class GTestConan(ConanFile): @property def _minimum_cpp_standard(self): - return 11 + return 11 @property def _minimum_compilers_version(self): @@ -59,19 +59,22 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass if self.options.debug_postfix != "deprecated": self.output.warn("gtest/*:debug_postfix is deprecated.") + def layout(self): + cmake_layout(self, src_folder="src") + def package_id(self): del self.info.options.no_main # Only used to expose more targets del self.info.options.debug_postfix # deprecated option that no longer exist - def layout(self): - cmake_layout(self, src_folder="src") - def validate(self): - if self.options.shared and (is_msvc(self) or self._is_clang_cl) and is_msvc_static_runtime(self): + if self.info.options.shared and (is_msvc(self) or self._is_clang_cl) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration( "gtest:shared=True with compiler=\"Visual Studio\" is not " "compatible with compiler.runtime=MT/MTd" @@ -93,6 +96,9 @@ def loose_lt_semver(v1, v2): f"{self.ref} requires {compiler} {min_version}. The current compiler is {compiler} {compiler.version}." ) + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + def generate(self): tc = CMakeToolchain(self) # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) @@ -105,9 +111,6 @@ def generate(self): tc.variables["gtest_disable_pthreads"] = True tc.generate() - def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def _patch_sources(self): if is_msvc(self) or self._is_clang_cl: # No warnings as errors From d0fd449ed494b111d19a5468e6a78d08c714fda0 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 27 Sep 2022 07:26:24 +0200 Subject: [PATCH 207/561] (#13084) libxft/2.3.6 * libxft/2.3.6 * disable gcc <6 * fix gcc 5 and gcc 11 * Apply suggestions from code review Co-authored-by: Uilian Ries * Update conanfile.py Co-authored-by: Uilian Ries --- recipes/libxft/all/conandata.yml | 10 ++++++++ recipes/libxft/all/conanfile.py | 20 +++++++++------- .../all/patches/0001-fix-gcc-5-and-11.patch | 24 +++++++++++++++++++ recipes/libxft/config.yml | 2 ++ 4 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch diff --git a/recipes/libxft/all/conandata.yml b/recipes/libxft/all/conandata.yml index 59703e66e854d..e56e888b5fdb6 100644 --- a/recipes/libxft/all/conandata.yml +++ b/recipes/libxft/all/conandata.yml @@ -1,4 +1,14 @@ sources: + "2.3.6": + url: "https://www.x.org/archive/individual/lib/libXft-2.3.6.tar.gz" + sha256: "b7e59f69e0bbabe9438088775f7e5a7c16a572e58b11f9722519385d38192df5" "2.3.4": url: "https://www.x.org/archive/individual/lib/libXft-2.3.4.tar.gz" sha256: "1eca71bec9cb483165ce1ab94f5cd3036269f5268651df6a2d99c4a7ab644d79" +patches: + "2.3.6": + - patch_file: "patches/0001-fix-gcc-5-and-11.patch" + patch_description: "fix gcc 5 and gcc 11 compilation" + patch_type: "portability" + patch_source: "https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/17" + base_path: "source_subfolder" diff --git a/recipes/libxft/all/conanfile.py b/recipes/libxft/all/conanfile.py index ea24924333b7d..5bb077b0fdb7a 100644 --- a/recipes/libxft/all/conanfile.py +++ b/recipes/libxft/all/conanfile.py @@ -1,9 +1,9 @@ from conan import ConanFile -from conan.tools import files +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, chdir, rm, rmdir from conans import AutoToolsBuildEnvironment import functools -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class libxftConan(ConanFile): name = "libxft" @@ -22,6 +22,9 @@ class libxftConan(ConanFile): def _source_subfolder(self): return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) + def requirements(self): self.requires("xorg/system") self.requires("freetype/2.12.1") @@ -33,7 +36,7 @@ def build_requirements(self): self.build_requires("libtool/2.4.7") def source(self): - files.get(self, **self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def configure(self): @@ -54,19 +57,20 @@ def _configure_autotools(self): return autotools def build(self): - with files.chdir(self, self._source_subfolder): + apply_conandata_patches(self) + with chdir(self, self._source_subfolder): autotools = self._configure_autotools() autotools.make() def package(self): self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - with files.chdir(self, self._source_subfolder): + with chdir(self, self._source_subfolder): autotools = self._configure_autotools() autotools.install(args=["-j1"]) - files.rm(self, "*.la", f"{self.package_folder}/lib", recursive=True) - files.rmdir(self, f"{self.package_folder}/lib/pkgconfig") - files.rmdir(self, f"{self.package_folder}/share") + rm(self, "*.la", f"{self.package_folder}/lib", recursive=True) + rmdir(self, f"{self.package_folder}/lib/pkgconfig") + rmdir(self, f"{self.package_folder}/share") def package_info(self): self.cpp_info.names['pkg_config'] = "Xft" diff --git a/recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch b/recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch new file mode 100644 index 0000000000000..c7b72d5585aa0 --- /dev/null +++ b/recipes/libxft/all/patches/0001-fix-gcc-5-and-11.patch @@ -0,0 +1,24 @@ +From 84310d83bf4c057dd0866e7116779c9c2f043007 Mon Sep 17 00:00:00 2001 +From: ericLemanissier +Date: Fri, 23 Sep 2022 07:59:55 +0000 +Subject: [PATCH] fix compilation with gcc 5 and gcc 11 + +stdint.h header is needed for SIZE_MAX +--- + src/xftrender.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/xftrender.c b/src/xftrender.c +index 3021d56..c15237e 100644 +--- a/src/xftrender.c ++++ b/src/xftrender.c +@@ -21,6 +21,7 @@ + */ + + #include "xftint.h" ++#include + + #define NUM_LOCAL 1024 + #define NUM_ELT_LOCAL 128 +-- +GitLab diff --git a/recipes/libxft/config.yml b/recipes/libxft/config.yml index 45925611b3bf0..6caf25620b5dc 100644 --- a/recipes/libxft/config.yml +++ b/recipes/libxft/config.yml @@ -1,3 +1,5 @@ versions: + "2.3.6": + folder: all "2.3.4": folder: all From 9001e65bf59a880f28ceb51b08bf0274a4b16743 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 27 Sep 2022 09:05:09 +0200 Subject: [PATCH 208/561] (#13086) libmysqlclient/8.0.30 * libmysqlclient/8.0.30 * fix linter * Update conanfile.py * Update conanfile.py --- recipes/libmysqlclient/all/conandata.yml | 8 ++ recipes/libmysqlclient/all/conanfile.py | 113 +++++++++++++---------- recipes/libmysqlclient/config.yml | 2 + 3 files changed, 74 insertions(+), 49 deletions(-) diff --git a/recipes/libmysqlclient/all/conandata.yml b/recipes/libmysqlclient/all/conandata.yml index 05070aeb8765e..3284d28321c06 100644 --- a/recipes/libmysqlclient/all/conandata.yml +++ b/recipes/libmysqlclient/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "8.0.30": + url: + - "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.30.tar.gz" + - "https://mirrors.huaweicloud.com/mysql/Downloads/MySQL-8.0/mysql-8.0.30.tar.gz" + sha256: "c988d5c6ba9a56692a6cd6e9813465b5fc9368ed4b461df97059a2fc160c8b84" "8.0.29": url: - "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.29.tar.gz" @@ -11,6 +16,9 @@ sources: url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.17.tar.gz" sha256: "c6e3f38199a77bfd8a4925ca00b252d3b6159b90e4980c7232f1c58d6ca759d6" patches: + "8.0.30": + - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" + base_path: "source_subfolder" "8.0.29": - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" base_path: "source_subfolder" diff --git a/recipes/libmysqlclient/all/conanfile.py b/recipes/libmysqlclient/all/conanfile.py index 70917c76136fb..5173229199ba3 100644 --- a/recipes/libmysqlclient/all/conanfile.py +++ b/recipes/libmysqlclient/all/conanfile.py @@ -1,12 +1,15 @@ from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.files import rename +from conan.tools.files import rename, get, apply_conandata_patches, replace_in_file, rmdir, rm from conan.tools.build import cross_building -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conan.tools.apple import is_apple_os +from conans import CMake, tools import functools import os -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.51.3" class LibMysqlClientCConan(ConanFile): @@ -40,17 +43,17 @@ def _source_subfolder(self): @property def _with_zstd(self): - return tools.Version(self.version) > "8.0.17" + return Version(self.version) > "8.0.17" @property def _with_lz4(self): - return tools.Version(self.version) > "8.0.17" + return Version(self.version) > "8.0.17" @property def _compilers_minimum_version(self): return { - "Visual Studio": "16" if tools.Version(self.version) > "8.0.17" else "15", - "gcc": "7" if tools.Version(self.version) >= "8.0.27" else "5.3", + "Visual Studio": "16" if Version(self.version) > "8.0.17" else "15", + "gcc": "7" if Version(self.version) >= "8.0.27" else "5.3", "clang": "6", } @@ -88,9 +91,7 @@ def loose_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} {} requires {} {} or newer".format( - self.name, self.version, self.settings.compiler, minimum_version, - )) + raise ConanInvalidConfiguration(f"{self.name} {self.version} requires {self.settings.compiler} {minimum_version} or newer") if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. contributions are welcome.") @@ -100,80 +101,94 @@ def loose_lt_semver(v1, v2): # error: expected unqualified-id MYSQL_VERSION_MAJOR=8 # error: no member named 'ptrdiff_t' in the global namespace if self.version == "8.0.17" and self.settings.compiler == "apple-clang" and \ - tools.Version(self.settings.compiler.version) >= "12.0": + Version(self.settings.compiler.version) >= "12.0": raise ConanInvalidConfiguration("libmysqlclient 8.0.17 doesn't support apple-clang >= 12.0") # mysql>=8.0.17 doesn't support shared library on MacOS. # https://github.com/mysql/mysql-server/blob/mysql-8.0.17/cmake/libutils.cmake#L333-L335 - if tools.Version(self.version) >= "8.0.17" and self.settings.compiler == "apple-clang" and \ + if Version(self.version) >= "8.0.17" and self.settings.compiler == "apple-clang" and \ self.options.shared: - raise ConanInvalidConfiguration("{}/{} doesn't support shared library".format( self.name, self.version)) + raise ConanInvalidConfiguration(f"{self.name}/{self.version} doesn't support shared library") # mysql < 8.0.29 uses `requires` in source code. It is the reserved keyword in C++20. # https://github.com/mysql/mysql-server/blob/mysql-8.0.0/include/mysql/components/services/dynamic_loader.h#L270 - if self.settings.compiler.get_safe("cppstd") == "20" and tools.Version(self.version) < "8.0.29": - raise ConanInvalidConfiguration("{}/{} doesn't support C++20".format(self.name, self.version)) + if self.settings.compiler.get_safe("cppstd") == "20" and Version(self.version) < "8.0.29": + raise ConanInvalidConfiguration(f"{self.name}/{self.version} doesn't support C++20") def build_requirements(self): - if tools.Version(self.version) >= "8.0.25" and tools.is_apple_os(self.settings.os): + if Version(self.version) >= "8.0.25" and is_apple_os(self): # CMake 3.18 or higher is required if Apple, but CI of CCI may run CMake 3.15 self.build_requires("cmake/3.22.5") if self.settings.os == "FreeBSD": self.build_requires("pkgconf/1.7.4") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def _patch_files(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) libs_to_remove = ["icu", "libevent", "re2", "rapidjson", "protobuf", "libedit"] if not self._with_lz4: libs_to_remove.append("lz4") for lib in libs_to_remove: - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "MYSQL_CHECK_%s()\n" % lib.upper(), + replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + f"MYSQL_CHECK_{lib.upper()}()\n", "", strict=False) - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "INCLUDE(%s)\n" % lib, + replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + f"INCLUDE({lib})\n", "", strict=False) - tools.rmdir(os.path.join(self._source_subfolder, "extra")) + replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + f"WARN_MISSING_SYSTEM_{lib.upper()}({lib.upper()}_WARN_GIVEN)", + f"# WARN_MISSING_SYSTEM_{lib.upper()}({lib.upper()}_WARN_GIVEN)", + strict=False) + + replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + f"SET({lib.upper()}_WARN_GIVEN)", + f"# SET({lib.upper()}_WARN_GIVEN)", + strict=False) + + rmdir(self, os.path.join(self._source_subfolder, "extra")) for folder in ["client", "man", "mysql-test", "libbinlogstandalone"]: - tools.rmdir(os.path.join(self._source_subfolder, folder)) - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "ADD_SUBDIRECTORY(%s)\n" % folder, + rmdir(self, os.path.join(self._source_subfolder, folder)) + replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + f"ADD_SUBDIRECTORY({folder})\n", "", strict=False) - tools.rmdir(os.path.join(self._source_subfolder, "storage", "ndb")) + rmdir(self, os.path.join(self._source_subfolder, "storage", "ndb")) for t in ["INCLUDE(cmake/boost.cmake)\n", "MYSQL_CHECK_EDITLINE()\n"]: - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), t, "", strict=False) if self._with_zstd: - tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "zstd.cmake"), + replace_in_file(self, os.path.join(self._source_subfolder, "cmake", "zstd.cmake"), "NAMES zstd", "NAMES zstd %s" % self.deps_cpp_info["zstd"].libs[0]) - tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "ssl.cmake"), + replace_in_file(self, os.path.join(self._source_subfolder, "cmake", "ssl.cmake"), "NAMES ssl", "NAMES ssl %s" % self.deps_cpp_info["openssl"].components["ssl"].libs[0]) - tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "ssl.cmake"), + replace_in_file(self, os.path.join(self._source_subfolder, "cmake", "ssl.cmake"), "NAMES crypto", "NAMES crypto %s" % self.deps_cpp_info["openssl"].components["crypto"].libs[0]) + replace_in_file(self, os.path.join(self._source_subfolder, "cmake", "ssl.cmake"), + "IF(NOT OPENSSL_APPLINK_C)\n", + "IF(FALSE AND NOT OPENSSL_APPLINK_C)\n", + strict=False) + # Do not copy shared libs of dependencies to package folder deps_shared = ["SSL"] - if tools.Version(self.version) > "8.0.17": + if Version(self.version) > "8.0.17": deps_shared.extend(["KERBEROS", "SASL", "LDAP", "PROTOBUF", "CURL"]) for dep in deps_shared: - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "MYSQL_CHECK_{}_DLLS()".format(dep), + replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), + f"MYSQL_CHECK_{dep}_DLLS()", "") sources_cmake = os.path.join(self._source_subfolder, "CMakeLists.txt") @@ -181,10 +196,10 @@ def _patch_files(self): rename(self, sources_cmake, sources_cmake_orig) rename(self, "CMakeLists.txt", sources_cmake) if self.settings.os == "Macos": - tools.replace_in_file(os.path.join(self._source_subfolder, "libmysql", "CMakeLists.txt"), - "COMMAND %s" % ("$" if tools.Version(self.version) < "8.0.25" else "libmysql_api_test"), + replace_in_file(self, os.path.join(self._source_subfolder, "libmysql", "CMakeLists.txt"), + "COMMAND %s" % ("$" if Version(self.version) < "8.0.25" else "libmysql_api_test"), "COMMAND DYLD_LIBRARY_PATH=%s %s" %(os.path.join(self.build_folder, "library_output_directory"), os.path.join(self.build_folder, "runtime_output_directory", "libmysql_api_test"))) - tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "install_macros.cmake"), + replace_in_file(self, os.path.join(self._source_subfolder, "cmake", "install_macros.cmake"), " INSTALL_DEBUG_SYMBOLS(", " # INSTALL_DEBUG_SYMBOLS(") @@ -229,18 +244,18 @@ def package(self): os.mkdir(os.path.join(self.package_folder, "licenses")) rename(self, os.path.join(self.package_folder, "LICENSE"), os.path.join(self.package_folder, "licenses", "LICENSE")) os.remove(os.path.join(self.package_folder, "README")) - tools.remove_files_by_mask(self.package_folder, "*.pdb") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "docs")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "docs")) + rmdir(self, os.path.join(self.package_folder, "share")) if self.settings.os == "Windows" and self.options.shared: self.copy("*.dll", "bin", keep_path=False) if self.options.shared: - tools.remove_files_by_mask(self.package_folder, "*.a") + rm(self, "*.a", self.package_folder, recursive=True) else: - tools.remove_files_by_mask(self.package_folder, "*.dll") - tools.remove_files_by_mask(self.package_folder, "*.dylib") - tools.remove_files_by_mask(self.package_folder, "*.so*") + rm(self, "*.dll", self.package_folder, recursive=True) + rm(self, "*.dylib", self.package_folder, recursive=True) + rm(self, "*.so*", self.package_folder, recursive=True) def package_info(self): self.cpp_info.set_property("pkg_config_name", "mysqlclient") @@ -253,10 +268,10 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") if self.settings.os in ["Linux", "FreeBSD"]: - if tools.Version(self.version) >= "8.0.25": + if Version(self.version) >= "8.0.25": self.cpp_info.system_libs.append("resolv") if self.settings.os == "Windows": - if tools.Version(self.version) >= "8.0.25": + if Version(self.version) >= "8.0.25": self.cpp_info.system_libs.append("dnsapi") self.cpp_info.system_libs.append("secur32") diff --git a/recipes/libmysqlclient/config.yml b/recipes/libmysqlclient/config.yml index eaba5db3fd9ef..33b7ea062fadb 100644 --- a/recipes/libmysqlclient/config.yml +++ b/recipes/libmysqlclient/config.yml @@ -1,4 +1,6 @@ versions: + "8.0.30": + folder: all "8.0.29": folder: all "8.0.25": From 0cbceba893dd8b5bbb15e3e8ab2def0e12e85209 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Sep 2022 09:25:29 +0200 Subject: [PATCH 209/561] (#13126) godot_headers: set cpp_info.resdirs --- recipes/godot_headers/all/conanfile.py | 8 ++++---- recipes/godot_headers/all/test_package/conanfile.py | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/recipes/godot_headers/all/conanfile.py b/recipes/godot_headers/all/conanfile.py index 49da40f0936eb..0a0d46219f9db 100644 --- a/recipes/godot_headers/all/conanfile.py +++ b/recipes/godot_headers/all/conanfile.py @@ -16,12 +16,12 @@ class GodotHeadersConan(ConanFile): 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) @@ -36,5 +36,5 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] diff --git a/recipes/godot_headers/all/test_package/conanfile.py b/recipes/godot_headers/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/godot_headers/all/test_package/conanfile.py +++ b/recipes/godot_headers/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() From 5a07e3f9c7e2e2fd7fea2a3faa50a62947c6bd3b Mon Sep 17 00:00:00 2001 From: Fernando Pelliccioni Date: Tue, 27 Sep 2022 05:05:27 -0300 Subject: [PATCH 210/561] (#13162) [catch2] fix recipe --- recipes/catch2/3.x.x/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/catch2/3.x.x/conanfile.py b/recipes/catch2/3.x.x/conanfile.py index 6b39f3af95662..e3d3e9d81076b 100644 --- a/recipes/catch2/3.x.x/conanfile.py +++ b/recipes/catch2/3.x.x/conanfile.py @@ -52,7 +52,7 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler.get_safe("cppstd"): + if self.info.settings.compiler.cppstd: check_min_cppstd(self, "14") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: From 92d1019be1a27a0fce372d64a823e371fbfe74ff Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 27 Sep 2022 17:25:04 +0900 Subject: [PATCH 211/561] (#13161) parallel-hashmap: add version 1.37 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/parallel-hashmap/all/conandata.yml | 3 +++ recipes/parallel-hashmap/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml index 236952e80cbd7..b73f7fb085a53 100644 --- a/recipes/parallel-hashmap/all/conandata.yml +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.37": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.37.tar.gz" + sha256: "2ac652be0552fcb53a1163c08c1f28f29f0756594fcc587eebb4d8b363153709" "1.36": url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.36.tar.gz" sha256: "33acf44158a9661a9d630d13f9250a2aa27a770cb3771df77b1ba1a661c0b766" diff --git a/recipes/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml index e79552aaa2013..3b0a16e24b285 100644 --- a/recipes/parallel-hashmap/config.yml +++ b/recipes/parallel-hashmap/config.yml @@ -1,4 +1,6 @@ versions: + "1.37": + folder: all "1.36": folder: all "1.35": From a30da84b051a8deee987b872e43a0b887cbd3692 Mon Sep 17 00:00:00 2001 From: Federico De Felici Date: Tue, 27 Sep 2022 09:44:48 +0100 Subject: [PATCH 212/561] (#13122) clove-unit: bump v2.3.0 * clove-unit: add version 2.2.3 * fix conanfile * update test * reduce cmake minimum version for Macos Clang M1/Arm64 * remove unused os import Co-authored-by: Uilian Ries * fix indentation Co-authored-by: Uilian Ries * replace CONAN_LIBS because deprecation Co-authored-by: Uilian Ries * add cmake_find_package_multi generator to generate CloveUnit-config.cmake Co-authored-by: Uilian Ries * removed outdated self.settings for dual profile Co-authored-by: Uilian Ries * bump to v2.3.0 Co-authored-by: Uilian Ries --- recipes/clove-unit/all/conandata.yml | 3 +++ recipes/clove-unit/all/test_package/test_package.cpp | 8 +++----- recipes/clove-unit/config.yml | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/recipes/clove-unit/all/conandata.yml b/recipes/clove-unit/all/conandata.yml index 46805140996fc..2c3695d23b94a 100644 --- a/recipes/clove-unit/all/conandata.yml +++ b/recipes/clove-unit/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.0": + url: "https://github.com/fdefelici/clove-unit/archive/v2.3.0.tar.gz" + sha256: ca94d33643bbe1ff2205f7e6405f3e9c5a95d2f3a076a126814e64b46e3cce8e "2.2.4": url: "https://github.com/fdefelici/clove-unit/archive/v2.2.4.tar.gz" sha256: 0341f13b3e897952f1643eea2ca70cf014c4a086cf83375270980ac05f9d51aa diff --git a/recipes/clove-unit/all/test_package/test_package.cpp b/recipes/clove-unit/all/test_package/test_package.cpp index 86a73c9d5448a..4d57d1c55fccb 100644 --- a/recipes/clove-unit/all/test_package/test_package.cpp +++ b/recipes/clove-unit/all/test_package/test_package.cpp @@ -1,11 +1,9 @@ -#define CLOVE_IMPLEMENTATION #include -char * __clove_exec_path; -char * __clove_exec_base_path; int main() { - __clove_report_console_setup_ansi(); - return 0; + const char* version = __CLOVE_VERSION; + if (version) return 0; + return 1; } diff --git a/recipes/clove-unit/config.yml b/recipes/clove-unit/config.yml index 1b05da0f1b9ea..3c940ec906d09 100644 --- a/recipes/clove-unit/config.yml +++ b/recipes/clove-unit/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.0": + folder: "all" "2.2.4": folder: "all" "2.2.3": From 33c236a4a8c6d0fd95f2c27dfda13db7f2474052 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Sep 2022 11:05:06 +0200 Subject: [PATCH 213/561] (#13123) libjpeg: conan v2 support * conan v2 support * set self.cpp_info.resdirs seems to be required with layout * typo * add a TODO regarding robustness of msvc build * set win_bash in build_requirements --- recipes/libjpeg/all/conandata.yml | 3 - recipes/libjpeg/all/conanfile.py | 205 +++++++++--------- .../libjpeg/all/test_package/CMakeLists.txt | 19 +- recipes/libjpeg/all/test_package/conanfile.py | 52 +++-- .../all/test_v1_package/CMakeLists.txt | 19 ++ .../libjpeg/all/test_v1_package/conanfile.py | 28 +++ 6 files changed, 192 insertions(+), 134 deletions(-) create mode 100644 recipes/libjpeg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libjpeg/all/test_v1_package/conanfile.py diff --git a/recipes/libjpeg/all/conandata.yml b/recipes/libjpeg/all/conandata.yml index 62cabbedb4b8c..772d543a52140 100644 --- a/recipes/libjpeg/all/conandata.yml +++ b/recipes/libjpeg/all/conandata.yml @@ -11,10 +11,7 @@ sources: patches: "9e": - patch_file: "patches/0001-9e-libjpeg-add-msvc-dll-support.patch" - base_path: "source_subfolder" "9d": - patch_file: "patches/0001-libjpeg-add-msvc-dll-support.patch" - base_path: "source_subfolder" "9c": - patch_file: "patches/0001-libjpeg-add-msvc-dll-support.patch" - base_path: "source_subfolder" diff --git a/recipes/libjpeg/all/conanfile.py b/recipes/libjpeg/all/conanfile.py index d44c2e6847f4e..20caf78ba6003 100644 --- a/recipes/libjpeg/all/conanfile.py +++ b/recipes/libjpeg/all/conanfile.py @@ -1,9 +1,15 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, load, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, unix_path, VCVars import os import re import shutil -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class LibjpegConan(ConanFile): @@ -24,24 +30,17 @@ class LibjpegConan(ConanFile): "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" @property - def _is_clang_cl(self): - return self.settings.os == 'Windows' and self.settings.compiler == 'clang' + def _settings_build(self): + return getattr(self, "settings_build", self.settings) def export_sources(self): - self.copy("Win32.Mak") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "Win32.Mak", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -49,130 +48,138 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): - if self._settings_build.os == "Windows" and not (self._is_msvc or self. _is_clang_cl) and \ - not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + if self._settings_build.os == "Windows" and not (is_msvc(self) or self. _is_clang_cl): + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + self.win_bash = True 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + if is_msvc(self) or self._is_clang_cl: + vc = VCVars(self) + vc.generate() + env = Environment() + env.define("PROFILE", None) + env.define("TUNE", None) + env.define("NODEBUG", None) + env.vars(self).save_script("conanbuildenv_nmake") + # TODO: there is probably something missing here + # Do we really honor everything from profile (build_type, tools.build:cflags etc)? + else: + tc = AutotoolsToolchain(self) + tc.extra_defines.append("LIBJPEG_BUILDING") + tc.generate() + env = VirtualBuildEnv(self) + env.generate() def _build_nmake(self): - shutil.copy("Win32.Mak", os.path.join(self._source_subfolder, "Win32.Mak")) - tools.replace_in_file(os.path.join(self._source_subfolder, "Win32.Mak"), - "\nccommon = -c ", - "\nccommon = -c -DLIBJPEG_BUILDING {}".format("" if self.options.shared else "-DLIBJPEG_STATIC ")) - # clean environment variables that might affect on the build (e.g. if set by Jenkins) - with tools.chdir(self._source_subfolder), tools.environment_append({"PROFILE": None, "TUNE": None, "NODEBUG": None}): + copy(self, "Win32.Mak", src=os.path.join(self.source_folder, os.pardir), dst=self.source_folder) + with chdir(self, self.source_folder): + # export symbols if shared + replace_in_file( + self, + "Win32.Mak", + "\nccommon = -c ", + "\nccommon = -c -DLIBJPEG_BUILDING {}".format("" if self.options.shared else "-DLIBJPEG_STATIC "), + ) + # clean environment variables that might affect on the build (e.g. if set by Jenkins) shutil.copy("jconfig.vc", "jconfig.h") make_args = [ - "nodebug=1" if self.settings.build_type != 'Debug' else "", + "nodebug=1" if self.settings.build_type != "Debug" else "", ] if self._is_clang_cl: - cl = os.environ.get('CC', 'clang-cl') - link = os.environ.get('LD', 'lld-link') - lib = os.environ.get('AR', 'llvm-lib') - rc = os.environ.get('RC', 'llvm-rc') - tools.replace_in_file('Win32.Mak', 'cc = cl', 'cc = %s' % cl) - tools.replace_in_file('Win32.Mak', 'link = link', 'link = %s' % link) - tools.replace_in_file('Win32.Mak', 'implib = lib', 'implib = %s' % lib) - tools.replace_in_file('Win32.Mak', 'rc = Rc', 'rc = %s' % rc) + cl = os.environ.get("CC", "clang-cl") + link = os.environ.get("LD", "lld-link") + lib = os.environ.get("AR", "llvm-lib") + rc = os.environ.get("RC", "llvm-rc") + replace_in_file(self, "Win32.Mak", "cc = cl", f"cc = {cl}") + replace_in_file(self, "Win32.Mak", "link = link", f"link = {link}") + replace_in_file(self, "Win32.Mak", "implib = lib", f"implib = {lib}") + replace_in_file(self, "Win32.Mak", "rc = Rc", f"rc = {rc}") # set flags directly in makefile.vc # cflags are critical for the library. ldflags and ldlibs are only for binaries - if self.settings.compiler.runtime in ["MD", "MDd"]: - tools.replace_in_file("makefile.vc", "(cvars)", "(cvarsdll)") - tools.replace_in_file("makefile.vc", "(conlibs)", "(conlibsdll)") + if is_msvc_static_runtime(self): + replace_in_file(self, "makefile.vc", "(cvars)", "(cvarsmt)") + replace_in_file(self, "makefile.vc", "(conlibs)", "(conlibsmt)") else: - tools.replace_in_file("makefile.vc", "(cvars)", "(cvarsmt)") - tools.replace_in_file("makefile.vc", "(conlibs)", "(conlibsmt)") - target = "{}/libjpeg.lib".format( "shared" if self.options.shared else "static" ) - with tools.vcvars(self.settings): - self.run("nmake -f makefile.vc {} {}".format(" ".join(make_args), target)) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.defines.append("LIBJPEG_BUILDING") - yes_no = lambda v: "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - self._autotools.configure(configure_dir=self._source_subfolder, args=args) - return self._autotools - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # Fix rpath in LC_ID_DYLIB of installed shared libs on macOS - if tools.is_apple_os(self.settings.os): - tools.replace_in_file( - os.path.join(self._source_subfolder, "configure"), - "-install_name \\$rpath/", - "-install_name @rpath/", - ) + replace_in_file(self, "makefile.vc", "(cvars)", "(cvarsdll)") + replace_in_file(self, "makefile.vc", "(conlibs)", "(conlibsdll)") + target = "{}/libjpeg.lib".format("shared" if self.options.shared else "static") + self.run("nmake -f makefile.vc {} {}".format(" ".join(make_args), target)) def build(self): - self._patch_sources() - if self._is_msvc or self._is_clang_cl: + apply_conandata_patches(self) + if is_msvc(self) or self._is_clang_cl: self._build_nmake() else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("README", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) - if (self._is_msvc or self._is_clang_cl): + copy(self, "README", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self) or self._is_clang_cl: for filename in ["jpeglib.h", "jerror.h", "jconfig.h", "jmorecfg.h"]: - self.copy(pattern=filename, dst="include", src=self._source_subfolder, keep_path=False) + copy(self, filename, src=self.source_folder, dst=os.path.join(self.package_folder, "include"), keep_path=False) - self.copy(pattern="*.lib", dst="lib", src=self._source_subfolder, keep_path=False) + copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) if self.options.shared: - self.copy(pattern="*.dll", dst="bin", src=self._source_subfolder, keep_path=False) + copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) else: - autotools = self._configure_autotools() - autotools.install() + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) if self.settings.os == "Windows" and self.options.shared: - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*[!.dll]") + rm(self, "*[!.dll]", os.path.join(self.package_folder, "bin")) else: - tools.rmdir(os.path.join(self.package_folder, "bin")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "bin")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) for fn in ("jpegint.h", "transupp.h",): - self.copy(fn, src=self._source_subfolder, dst="include") + copy(self, fn, src=self.source_folder, dst=os.path.join(self.package_folder, "include")) for fn in ("jinclude.h", "transupp.c",): - self.copy(fn, src=self._source_subfolder, dst="res") + copy(self, fn, src=self.source_folder, dst=os.path.join(self.package_folder, "res")) # Remove export decorations of transupp symbols for relpath in os.path.join("include", "transupp.h"), os.path.join("res", "transupp.c"): path = os.path.join(self.package_folder, relpath) - tools.save(path, re.subn(r"(?:EXTERN|GLOBAL)\(([^)]+)\)", r"\1", tools.load(path))[0]) + save(self, path, re.subn(r"(?:EXTERN|GLOBAL)\(([^)]+)\)", r"\1", load(self, path))[0]) def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "JPEG") self.cpp_info.set_property("cmake_target_name", "JPEG::JPEG") self.cpp_info.set_property("pkg_config_name", "libjpeg") + prefix = "lib" if is_msvc(self) or self._is_clang_cl else "" + self.cpp_info.libs = [f"{prefix}jpeg"] + self.cpp_info.resdirs = ["res"] + if not self.options.shared: + self.cpp_info.defines.append("LIBJPEG_STATIC") + # TODO: to remove in conan v2 once legacy generators removed self.cpp_info.names["cmake_find_package"] = "JPEG" self.cpp_info.names["cmake_find_package_multi"] = "JPEG" - - if (self._is_msvc or self._is_clang_cl): - self.cpp_info.libs = ["libjpeg"] - else: - self.cpp_info.libs = ["jpeg"] - if not self.options.shared: - self.cpp_info.defines.append("LIBJPEG_STATIC") diff --git a/recipes/libjpeg/all/test_package/CMakeLists.txt b/recipes/libjpeg/all/test_package/CMakeLists.txt index 6bbc5e332c193..f6e52def00111 100644 --- a/recipes/libjpeg/all/test_package/CMakeLists.txt +++ b/recipes/libjpeg/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) @@ -11,9 +8,11 @@ endif() find_package(JPEG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} JPEG::JPEG) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +target_link_libraries(${PROJECT_NAME} PRIVATE JPEG::JPEG) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) -add_executable(test_transupp test_transupp.c "${CONAN_LIBJPEG_ROOT}/res/transupp.c") -target_link_libraries(test_transupp JPEG::JPEG) -set_property(TARGET test_transupp PROPERTY C_STANDARD 99) +if(BUILD_TRANSUPP) + add_executable(test_transupp test_transupp.c ${LIBJPEG_RES_DIR}/transupp.c) + target_link_libraries(test_transupp PRIVATE JPEG::JPEG) + target_compile_features(test_transupp PRIVATE c_std_99) +endif() diff --git a/recipes/libjpeg/all/test_package/conanfile.py b/recipes/libjpeg/all/test_package/conanfile.py index 5d40f08406b63..0243933ba22dd 100644 --- a/recipes/libjpeg/all/test_package/conanfile.py +++ b/recipes/libjpeg/all/test_package/conanfile.py @@ -1,25 +1,32 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" @property - def _test_transupp(self): + def _build_transupp(self): # transupp+libjpeg makes use of stdio of the C library. This cannot be used when using a dll libjpeg, built with a static c library. - return not (self.options["libjpeg"].shared and self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime) - - def build_requirements(self): - if hasattr(self, "settings_build") and tools.cross_building(self) and \ - self.settings.os == "Macos" and self.settings.arch == "armv8": - # Workaround for CMake bug with error message: - # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # set. This could be because you are using a Mac OS X version less than 10.5 - # or because CMake's platform configuration is corrupt. - # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + return not (self.dependencies["libjpeg"].options.shared and is_msvc(self) and is_msvc_static_runtime(self)) + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TRANSUPP"] = self._build_transupp + if self._build_transupp: + tc.variables["LIBJPEG_RES_DIR"] = self.dependencies["libjpeg"].cpp_info.resdirs[0].replace("\\", "/") + tc.generate() def build(self): cmake = CMake(self) @@ -27,10 +34,11 @@ def build(self): cmake.build() def test(self): - if tools.cross_building(self): - return - img_name = os.path.join(self.source_folder, "testimg.jpg") - out_img = os.path.join(self.build_folder, "outimg.jpg") - self.run("%s %s" % (os.path.join("bin", "test_package"), img_name), run_environment=True) - if self._test_transupp: - self.run("%s %s %s" % (os.path.join("bin", "test_transupp"), img_name, out_img), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + img_name = os.path.join(self.source_folder, "testimg.jpg") + self.run(f"{bin_path} {img_name}", env="conanrun") + test_transupp_path = os.path.join(self.cpp.build.bindirs[0], "test_transupp") + if os.path.exists(test_transupp_path): + out_img = os.path.join(self.build_folder, "outimg.jpg") + self.run(f"{test_transupp_path} {img_name} {out_img}", env="conanrun") diff --git a/recipes/libjpeg/all/test_v1_package/CMakeLists.txt b/recipes/libjpeg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e6eccdbfe8184 --- /dev/null +++ b/recipes/libjpeg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) +endif() + +find_package(JPEG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE JPEG::JPEG) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) + +add_executable(test_transupp ../test_package/test_transupp.c "${CONAN_LIBJPEG_ROOT}/res/transupp.c") +target_link_libraries(test_transupp PRIVATE JPEG::JPEG) +target_compile_features(test_transupp PRIVATE c_std_99) diff --git a/recipes/libjpeg/all/test_v1_package/conanfile.py b/recipes/libjpeg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d9893410defb6 --- /dev/null +++ b/recipes/libjpeg/all/test_v1_package/conanfile.py @@ -0,0 +1,28 @@ +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + @property + def _test_transupp(self): + # transupp+libjpeg makes use of stdio of the C library. This cannot be used when using a dll libjpeg, built with a static c library. + return not (self.options["libjpeg"].shared and is_msvc(self) and is_msvc_static_runtime(self)) + + 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") + img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") + self.run(f"{bin_path} {img_name}", run_environment=True) + if self._test_transupp: + test_transupp_path = os.path.join("bin", "test_transupp") + out_img = os.path.join(self.build_folder, "outimg.jpg") + self.run(f"{test_transupp_path} {img_name} {out_img}", run_environment=True) From a206a6a4f1a0d9d3e2e63697e02fb293f8afc9d5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Sep 2022 11:26:07 +0200 Subject: [PATCH 214/561] (#13124) libalsa: set cpp_info.resdirs & minor improvements * set resdirs * cleanup imports * use export_conandata_patches * explicit test_type in test_package --- recipes/libalsa/all/conanfile.py | 15 +++++++-------- recipes/libalsa/all/test_package/conanfile.py | 7 ++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/recipes/libalsa/all/conanfile.py b/recipes/libalsa/all/conanfile.py index cac0714be412f..b5408d4dbbe38 100644 --- a/recipes/libalsa/all/conanfile.py +++ b/recipes/libalsa/all/conanfile.py @@ -1,13 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, chdir, copy, get, rm, rmdir +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout -from conan.tools.microsoft import unix_path import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class LibalsaConan(ConanFile): @@ -32,8 +31,7 @@ class LibalsaConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def configure(self): if self.options.shared: @@ -47,6 +45,9 @@ def configure(self): except Exception: pass + def layout(self): + basic_layout(self, src_folder="src") + def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("Only Linux supported") @@ -54,9 +55,6 @@ def validate(self): def build_requirements(self): self.tool_requires("libtool/2.4.7") - def layout(self): - basic_layout(self, src_folder="src") - def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -95,6 +93,7 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "ALSA::ALSA") self.cpp_info.set_property("pkg_config_name", "alsa") self.cpp_info.libs = ["asound"] + self.cpp_info.resdirs = ["res"] self.cpp_info.system_libs = ["dl", "m", "rt", "pthread"] alsa_config_dir = os.path.join(self.package_folder, "res", "alsa") self.runenv_info.define_path("ALSA_CONFIG_DIR", alsa_config_dir) diff --git a/recipes/libalsa/all/test_package/conanfile.py b/recipes/libalsa/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/libalsa/all/test_package/conanfile.py +++ b/recipes/libalsa/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() From 30f4de944ab0df92db1493d690a900788020c22c Mon Sep 17 00:00:00 2001 From: Jason Green Date: Tue, 27 Sep 2022 04:45:56 -0500 Subject: [PATCH 215/561] (#13166) poco: bump sqlite3 dependency version for MacOS --- recipes/poco/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py index 33e5ef0218ed0..14445dfd13d83 100644 --- a/recipes/poco/all/conanfile.py +++ b/recipes/poco/all/conanfile.py @@ -125,7 +125,7 @@ def requirements(self): if self.options.enable_xml: self.requires("expat/2.4.8") if self.options.enable_data_sqlite: - self.requires("sqlite3/3.39.2") + self.requires("sqlite3/3.39.3") if self.options.enable_apacheconnector: self.requires("apr/1.7.0") self.requires("apr-util/1.6.1") From 786ccc4bd7d31b71283710012fa81899a9ded040 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Sep 2022 19:27:41 +0200 Subject: [PATCH 216/561] (#13129) libuv: conan v2 support --- recipes/libuv/all/CMakeLists.txt | 7 -- recipes/libuv/all/conandata.yml | 100 ++++++++---------- recipes/libuv/all/conanfile.py | 85 +++++++-------- recipes/libuv/all/test_package/CMakeLists.txt | 9 +- recipes/libuv/all/test_package/conanfile.py | 19 +++- .../libuv/all/test_v1_package/CMakeLists.txt | 14 +++ .../libuv/all/test_v1_package/conanfile.py | 17 +++ recipes/libuv/config.yml | 16 +-- 8 files changed, 143 insertions(+), 124 deletions(-) delete mode 100644 recipes/libuv/all/CMakeLists.txt create mode 100644 recipes/libuv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libuv/all/test_v1_package/conanfile.py diff --git a/recipes/libuv/all/CMakeLists.txt b/recipes/libuv/all/CMakeLists.txt deleted file mode 100644 index ebd13bfa7a47e..0000000000000 --- a/recipes/libuv/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/libuv/all/conandata.yml b/recipes/libuv/all/conandata.yml index 2d67687a864cd..77db7c637633e 100644 --- a/recipes/libuv/all/conandata.yml +++ b/recipes/libuv/all/conandata.yml @@ -1,62 +1,50 @@ sources: - "1.34.2": - url: "https://github.com/libuv/libuv/archive/v1.34.2.zip" - sha256: "e1a663bcbfbeb18e447f79a39645ca555db47153d29ed81a1cb289373f357035" - "1.38.0": - url: "https://github.com/libuv/libuv/archive/v1.38.0.zip" - sha256: "6502ee75e1007325ba2e15e06d3d7b94ac911704793b2fe6f7bb933e1748db72" - "1.38.1": - url: "https://github.com/libuv/libuv/archive/v1.38.1.zip" - sha256: "0359369492742eb2a36312fffe26f80bcffe4cec981a4fd72d182b061ee14890" - "1.40.0": - url: "https://github.com/libuv/libuv/archive/v1.40.0.zip" - sha256: "61366e30d8484197dc9e4a94dbd98a0ba52fb55cb6c6d991af1f3701b10f322b" - "1.41.0": - url: "https://github.com/libuv/libuv/archive/v1.41.0.zip" - sha256: "cb89a8b9f686c5ccf7ed09a9e0ece151a73ebebc17af3813159c335b02181794" - "1.41.1": - url: "https://github.com/libuv/libuv/archive/v1.41.1.tar.gz" - sha256: "62c29d1d76b0478dc8aaed0ed1f874324f6cd2d6ff4cb59a44026c09e818cd53" - "1.42.0": - url: "https://github.com/libuv/libuv/archive/v1.42.0.tar.gz" - sha256: "371e5419708f6aaeb8656671f89400b92a9bba6443369af1bb70bcd6e4b3c764" - "1.43.0": - url: "https://github.com/libuv/libuv/archive/v1.43.0.tar.gz" - sha256: "9e27825a55279de69a7c43e42d509fd1337c9bece2547c761e91a1592e91cc4d" "1.44.1": url: "https://github.com/libuv/libuv/archive/v1.44.1.tar.gz" sha256: "e91614e6dc2dd0bfdd140ceace49438882206b7a6fb00b8750914e67a9ed6d6b" -patches: - "1.34.2": - - base_path: "source_subfolder" - patch_file: "patches/1.34.2/fix-cmake.patch" - "1.38.0": - - base_path: "source_subfolder" - patch_file: "patches/1.38.0/fix-cmake.patch" - "1.38.1": - - base_path: "source_subfolder" - patch_file: "patches/1.38.1/fix-cmake.patch" - "1.40.0": - - base_path: "source_subfolder" - patch_file: "patches/1.40.0/fix-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.40.0/fix-ios.patch" - "1.41.0": - - base_path: "source_subfolder" - patch_file: "patches/1.41.0/fix-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.40.0/fix-ios.patch" - "1.41.1": - - base_path: "source_subfolder" - patch_file: "patches/1.41.0/fix-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.40.0/fix-ios.patch" - "1.42.0": - - base_path: "source_subfolder" - patch_file: "patches/1.42.0/fix-cmake.patch" "1.43.0": - - base_path: "source_subfolder" - patch_file: "patches/1.43.0/fix-cmake.patch" + url: "https://github.com/libuv/libuv/archive/v1.43.0.tar.gz" + sha256: "9e27825a55279de69a7c43e42d509fd1337c9bece2547c761e91a1592e91cc4d" + "1.42.0": + url: "https://github.com/libuv/libuv/archive/v1.42.0.tar.gz" + sha256: "371e5419708f6aaeb8656671f89400b92a9bba6443369af1bb70bcd6e4b3c764" + "1.41.1": + url: "https://github.com/libuv/libuv/archive/v1.41.1.tar.gz" + sha256: "62c29d1d76b0478dc8aaed0ed1f874324f6cd2d6ff4cb59a44026c09e818cd53" + "1.41.0": + url: "https://github.com/libuv/libuv/archive/v1.41.0.zip" + sha256: "cb89a8b9f686c5ccf7ed09a9e0ece151a73ebebc17af3813159c335b02181794" + "1.40.0": + url: "https://github.com/libuv/libuv/archive/v1.40.0.zip" + sha256: "61366e30d8484197dc9e4a94dbd98a0ba52fb55cb6c6d991af1f3701b10f322b" + "1.38.1": + url: "https://github.com/libuv/libuv/archive/v1.38.1.zip" + sha256: "0359369492742eb2a36312fffe26f80bcffe4cec981a4fd72d182b061ee14890" + "1.38.0": + url: "https://github.com/libuv/libuv/archive/v1.38.0.zip" + sha256: "6502ee75e1007325ba2e15e06d3d7b94ac911704793b2fe6f7bb933e1748db72" + "1.34.2": + url: "https://github.com/libuv/libuv/archive/v1.34.2.zip" + sha256: "e1a663bcbfbeb18e447f79a39645ca555db47153d29ed81a1cb289373f357035" +patches: "1.44.1": - - base_path: "source_subfolder" - patch_file: "patches/1.44.1/fix-cmake.patch" + - patch_file: "patches/1.44.1/fix-cmake.patch" + "1.43.0": + - patch_file: "patches/1.43.0/fix-cmake.patch" + "1.42.0": + - patch_file: "patches/1.42.0/fix-cmake.patch" + "1.41.1": + - patch_file: "patches/1.41.0/fix-cmake.patch" + - patch_file: "patches/1.40.0/fix-ios.patch" + "1.41.0": + - patch_file: "patches/1.41.0/fix-cmake.patch" + - patch_file: "patches/1.40.0/fix-ios.patch" + "1.40.0": + - patch_file: "patches/1.40.0/fix-cmake.patch" + - patch_file: "patches/1.40.0/fix-ios.patch" + "1.38.1": + - patch_file: "patches/1.38.1/fix-cmake.patch" + "1.38.0": + - patch_file: "patches/1.38.0/fix-cmake.patch" + "1.34.2": + - patch_file: "patches/1.34.2/fix-cmake.patch" diff --git a/recipes/libuv/all/conanfile.py b/recipes/libuv/all/conanfile.py index 0def182f30fac..a147f0a7124e2 100644 --- a/recipes/libuv/all/conanfile.py +++ b/recipes/libuv/all/conanfile.py @@ -1,10 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, check_min_vs import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class LibuvConan(ConanFile): @@ -25,16 +26,8 @@ class LibuvConan(ConanFile): "fPIC": True, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -42,40 +35,49 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler == "Visual Studio": - if tools.Version(self.settings.compiler.version) < "14": - raise ConanInvalidConfiguration("Visual Studio 2015 or higher required") + if is_msvc(self): + check_min_vs(self, "190") 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], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["LIBUV_BUILD_TESTS"] = False - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBUV_BUILD_TESTS"] = False + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("LICENSE-docs", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + for license_file in ["LICENSE", "LICENSE-docs"]: + copy(self, license_file, 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")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -83,21 +85,20 @@ def package(self): {self._target_lib_name: "libuv::libuv"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property def _target_lib_name(self): diff --git a/recipes/libuv/all/test_package/CMakeLists.txt b/recipes/libuv/all/test_package/CMakeLists.txt index 5299beae70163..582a892fd9c5b 100644 --- a/recipes/libuv/all/test_package/CMakeLists.txt +++ b/recipes/libuv/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(libuv REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) if(TARGET uv_a) - target_link_libraries(${PROJECT_NAME} uv_a) + target_link_libraries(${PROJECT_NAME} PRIVATE uv_a) else() - target_link_libraries(${PROJECT_NAME} uv) + target_link_libraries(${PROJECT_NAME} PRIVATE uv) endif() diff --git a/recipes/libuv/all/test_package/conanfile.py b/recipes/libuv/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/libuv/all/test_package/conanfile.py +++ b/recipes/libuv/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libuv/all/test_v1_package/CMakeLists.txt b/recipes/libuv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cc50e3b1333c0 --- /dev/null +++ b/recipes/libuv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libuv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(TARGET uv_a) + target_link_libraries(${PROJECT_NAME} PRIVATE uv_a) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE uv) +endif() diff --git a/recipes/libuv/all/test_v1_package/conanfile.py b/recipes/libuv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libuv/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libuv/config.yml b/recipes/libuv/config.yml index 8a3012b477079..0b7b938d97cc5 100644 --- a/recipes/libuv/config.yml +++ b/recipes/libuv/config.yml @@ -1,19 +1,19 @@ versions: - "1.34.2": + "1.44.1": folder: all - "1.38.0": + "1.43.0": folder: all - "1.38.1": + "1.42.0": folder: all - "1.40.0": + "1.41.1": folder: all "1.41.0": folder: all - "1.41.1": + "1.40.0": folder: all - "1.42.0": + "1.38.1": folder: all - "1.43.0": + "1.38.0": folder: all - "1.44.1": + "1.34.2": folder: all From d9ad528b30032bb01c5d522224e5b604c6fa6501 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Sep 2022 20:05:54 +0200 Subject: [PATCH 217/561] (#13130) libuuid: conan v2 support --- recipes/libuuid/all/conandata.yml | 1 - recipes/libuuid/all/conanfile.py | 93 +++++++++++-------- .../libuuid/all/test_package/CMakeLists.txt | 11 +-- recipes/libuuid/all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../libuuid/all/test_v1_package/conanfile.py | 17 ++++ 6 files changed, 101 insertions(+), 53 deletions(-) create mode 100644 recipes/libuuid/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libuuid/all/test_v1_package/conanfile.py diff --git a/recipes/libuuid/all/conandata.yml b/recipes/libuuid/all/conandata.yml index 37a31cc5d58bd..65a63e13dcdf9 100644 --- a/recipes/libuuid/all/conandata.yml +++ b/recipes/libuuid/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "1.0.3": - patch_file: "patches/0001-check-sys-syscall-h+wrap-includes.patch" - base_path: "source_subfolder" diff --git a/recipes/libuuid/all/conanfile.py b/recipes/libuuid/all/conanfile.py index 41ca52ec65930..aa83c7a3c0314 100644 --- a/recipes/libuuid/all/conanfile.py +++ b/recipes/libuuid/all/conanfile.py @@ -1,10 +1,13 @@ from conan import ConanFile -from conan.tools import files from conan.errors import ConanInvalidConfiguration -from conans import AutoToolsBuildEnvironment, tools +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class LibuuidConan(ConanFile): @@ -13,17 +16,20 @@ class LibuuidConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://sourceforge.net/projects/libuuid/" license = "BSD-3-Clause" - topics = ("conan", "libuuid", "uuid", "unique-id", "unique-identifier") - settings = "os", "arch", "compiler", "build_type" - exports_sources = "patches/**" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + topics = ("libuuid", "uuid", "unique-id", "unique-identifier") - _autotools = None + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == 'Windows': @@ -31,50 +37,57 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.settings.os == "Windows": + if self.info.settings.os == "Windows": raise ConanInvalidConfiguration("libuuid is not supported on Windows") def build_requirements(self): - self.build_requires("libtool/2.4.7") + self.tool_requires("libtool/2.4.7") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - yes_no = lambda v: "yes" if v else "no" - configure_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] + def generate(self): + tc = AutotoolsToolchain(self) if "x86" in self.settings.arch: - self._autotools.flags.append('-mstackrealign') - self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder) - return self._autotools + tc.extra_cflags.append("-mstackrealign") + tc.generate() + env = VirtualBuildEnv(self) + env.generate() def build(self): - files.apply_conandata_patches(self) - with files.chdir(self, self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True) - autotools = self._configure_autotools() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - autotools = self._configure_autotools() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - files.rm(self, "*.la", os.path.join(self.package_folder, "lib")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.names["pkg_config"] = "uuid" + self.cpp_info.set_property("pkg_config_name", "uuid") self.cpp_info.libs = ["uuid"] self.cpp_info.includedirs.append(os.path.join("include", "uuid")) diff --git a/recipes/libuuid/all/test_package/CMakeLists.txt b/recipes/libuuid/all/test_package/CMakeLists.txt index fd126a732c403..75c717f769900 100644 --- a/recipes/libuuid/all/test_package/CMakeLists.txt +++ b/recipes/libuuid/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libuuid REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +target_link_libraries(${PROJECT_NAME} PRIVATE libuuid::libuuid) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/libuuid/all/test_package/conanfile.py b/recipes/libuuid/all/test_package/conanfile.py index bd7165a553cf4..0a6bc68712d90 100644 --- a/recipes/libuuid/all/test_package/conanfile.py +++ b/recipes/libuuid/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libuuid/all/test_v1_package/CMakeLists.txt b/recipes/libuuid/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..40c1a8324330c --- /dev/null +++ b/recipes/libuuid/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libuuid REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libuuid::libuuid) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/libuuid/all/test_v1_package/conanfile.py b/recipes/libuuid/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libuuid/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 387e8246c4695af28a800ccd0867289209ea8224 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 28 Sep 2022 10:45:14 +0200 Subject: [PATCH 218/561] (#13172) odbc 2.3.11 * odbc 2.3.11 * fix sha --- recipes/odbc/all/conandata.yml | 5 +++++ recipes/odbc/config.yml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/recipes/odbc/all/conandata.yml b/recipes/odbc/all/conandata.yml index df25a82c0ba11..5dc1a314049d4 100644 --- a/recipes/odbc/all/conandata.yml +++ b/recipes/odbc/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "2.3.11": + url: + - "http://www.unixodbc.org/unixODBC-2.3.11.tar.gz" + - "http://www.unixodbc.net/unixODBC-2.3.11.tar.gz" + sha256: "d9e55c8e7118347e3c66c87338856dad1516b490fb7c756c1562a2c267c73b5c" "2.3.9": url: - "http://www.unixodbc.org/unixODBC-2.3.9.tar.gz" diff --git a/recipes/odbc/config.yml b/recipes/odbc/config.yml index ce75cb93300de..2237b5771605c 100644 --- a/recipes/odbc/config.yml +++ b/recipes/odbc/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.11": + folder: all "2.3.9": folder: all "2.3.7": From b1fc0b0ae1653a246221fb103add3f240f774531 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 28 Sep 2022 11:51:24 +0200 Subject: [PATCH 219/561] (#13072) [docs] Templates documentation: Fix link for test package Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- docs/how_to_add_packages.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/how_to_add_packages.md b/docs/how_to_add_packages.md index a1c49c304fce3..6a48eaf22075b 100644 --- a/docs/how_to_add_packages.md +++ b/docs/how_to_add_packages.md @@ -155,8 +155,7 @@ Also, **every `conanfile.py` should be accompanied by one or several folder to t All the packages in this repository need to be tested before they join ConanCenter. A `test_package` folder with its corresponding `conanfile.py` and a minimal project to test the package is strictly required. You can read about it in the -# FIXME: This link no longet exist and there is no dedicated section about test package in docs. -[Conan documentation](https://docs.conan.io/en/latest/creating_packages/getting_started.html#the-test-package-folder). +[Conan documentation](https://docs.conan.io/en/latest/creating_packages/getting_started.html). Sometimes it is useful to test the package using different build systems (CMake, Autotools,...). Instead of adding complex logic to one `test_package/conanfile.py` file, it is better to add another `test_/conanfile.py` file with a minimal example for that build system. That From 221972b081042ae628c74650f1cfe08c0867fc12 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Sep 2022 19:04:50 +0900 Subject: [PATCH 220/561] (#13031) mozjpeg: add version 4.1.1 and support conan v2 * mozjpeg: add version 4.1.1 and support conan v2 * add argument to is_msvc_static_untime * Update conanfile.py * fix bug in bin_path * remove lib64 folder * fix jpeg file path * fix binary install folder * fix link error in MT * fix wrong condition for WITH_CRT_DLL * revert ENABLE_SHARED,ENABLE_STATIC * fix static binary path * use TARGET_FILE in 3.3.1 --- recipes/mozjpeg/all/CMakeLists.txt | 9 - recipes/mozjpeg/all/conandata.yml | 17 +- recipes/mozjpeg/all/conanfile.py | 208 ++++++++++-------- .../all/patches/3.3.1-0001-cmake-fixes.patch | 10 +- .../all/patches/4.1.1-0001-cmake-fixes.patch | 34 +++ .../mozjpeg/all/test_package/CMakeLists.txt | 8 +- recipes/mozjpeg/all/test_package/conanfile.py | 22 +- .../all/test_v1_package/CMakeLists.txt | 11 + .../mozjpeg/all/test_v1_package/conanfile.py | 19 ++ recipes/mozjpeg/config.yml | 4 +- 10 files changed, 218 insertions(+), 124 deletions(-) delete mode 100644 recipes/mozjpeg/all/CMakeLists.txt create mode 100644 recipes/mozjpeg/all/patches/4.1.1-0001-cmake-fixes.patch create mode 100644 recipes/mozjpeg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mozjpeg/all/test_v1_package/conanfile.py diff --git a/recipes/mozjpeg/all/CMakeLists.txt b/recipes/mozjpeg/all/CMakeLists.txt deleted file mode 100644 index 6d4e2abf9a485..0000000000000 --- a/recipes/mozjpeg/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -include(GNUInstallDirs) - -add_subdirectory(source_subfolder) diff --git a/recipes/mozjpeg/all/conandata.yml b/recipes/mozjpeg/all/conandata.yml index 49a83576b27b3..b3cb941ad21eb 100644 --- a/recipes/mozjpeg/all/conandata.yml +++ b/recipes/mozjpeg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.1.1": + url: "https://github.com/mozilla/mozjpeg/archive/v4.1.1.tar.gz" + sha256: "66b1b8d6b55d263f35f27f55acaaa3234df2a401232de99b6d099e2bb0a9d196" "4.0.0": url: "https://github.com/mozilla/mozjpeg/archive/v4.0.0.tar.gz" sha256: "961e14e73d06a015e9b23b8af416f010187cc0bec95f6e3b0fcb28cc7e2cbdd4" @@ -6,9 +9,15 @@ sources: url: "https://github.com/mozilla/mozjpeg/archive/v3.3.1.tar.gz" sha256: "aebbea60ea038a84a2d1ed3de38fdbca34027e2e54ee2b7d08a97578be72599d" patches: + "4.1.1": + - patch_file: "patches/4.1.1-0001-cmake-fixes.patch" + patch_description: "fix install folder and disable /NODEFAULT in MSVC" + patch_type: "conan" "4.0.0": - - base_path: "source_subfolder" - patch_file: "patches/4.0.0-0001-cmake-fixes.patch" + - patch_file: "patches/4.0.0-0001-cmake-fixes.patch" + patch_description: "fix install folder" + patch_type: "conan" "3.3.1": - - base_path: "source_subfolder" - patch_file: "patches/3.3.1-0001-cmake-fixes.patch" + - patch_file: "patches/3.3.1-0001-cmake-fixes.patch" + patch_description: "fix install folder" + patch_type: "conan" diff --git a/recipes/mozjpeg/all/conanfile.py b/recipes/mozjpeg/all/conanfile.py index 5e05fb0bce716..691c801f8bb8c 100644 --- a/recipes/mozjpeg/all/conanfile.py +++ b/recipes/mozjpeg/all/conanfile.py @@ -1,19 +1,24 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, CMake, tools -import os - +from conan import ConanFile +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.files import apply_conandata_patches, get, copy, rm, rmdir, export_conandata_patches +from conan.tools.build import cross_building +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.env import VirtualBuildEnv +from conan.tools.layout import basic_layout -required_conan_version = ">=1.33.0" +import os +required_conan_version = ">=1.52.0" class MozjpegConan(ConanFile): name = "mozjpeg" description = "MozJPEG is an improved JPEG encoder" - url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "image", "format", "mozjpeg", "jpg", "jpeg", "picture", "multimedia", "graphics") license = ("BSD", "BSD-3-Clause", "ZLIB") + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mozilla/mozjpeg" - exports_sources = ("CMakeLists.txt", "patches/*") - generators = "cmake" + topics = ("conan", "image", "format", "mozjpeg", "jpg", "jpeg", "picture", "multimedia", "graphics") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -42,21 +47,13 @@ class MozjpegConan(ConanFile): "enable12bit": False, } - _autotools = None - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property def _has_simd_support(self): return self.settings.arch in ["x86", "x86_64"] + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -65,110 +62,133 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass self.provides = ["libjpeg", "libjpeg-turbo"] if self.options.turbojpeg else "libjpeg" @property def _use_cmake(self): - return self.settings.os == "Windows" or tools.Version(self.version) >= "4.0.0" + return self.settings.os == "Windows" or Version(self.version) >= "4.0.0" + + def layout(self): + if self._use_cmake: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder='src') def build_requirements(self): - if not self._use_cmake: - if self.settings.os != "Windows": - self.build_requires("libtool/2.4.6") - self.build_requires("pkgconf/1.7.4") + if not self._use_cmake and self.settings.os != "Windows": + self.tool_requires("libtool/2.4.7") + self.tool_requires("pkgconf/1.7.4") if self.options.get_safe("SIMD"): - self.build_requires("nasm/2.15.05") + self.tool_requires("nasm/2.15.05") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - if tools.cross_building(self.settings): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate_cmake(self): + tc = CMakeToolchain(self) + if cross_building(self): # FIXME: too specific and error prone, should be delegated to CMake helper cmake_system_processor = { "armv8": "aarch64", "armv8.3": "aarch64", }.get(str(self.settings.arch), str(self.settings.arch)) - self._cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor - self._cmake.definitions["ENABLE_TESTING"] = False - self._cmake.definitions["ENABLE_STATIC"] = not self.options.shared - self._cmake.definitions["ENABLE_SHARED"] = self.options.shared - self._cmake.definitions["REQUIRE_SIMD"] = self.options.get_safe("SIMD", False) - self._cmake.definitions["WITH_SIMD"] = self.options.get_safe("SIMD", False) - self._cmake.definitions["WITH_ARITH_ENC"] = self.options.arithmetic_encoder - self._cmake.definitions["WITH_ARITH_DEC"] = self.options.arithmetic_decoder - self._cmake.definitions["WITH_JPEG7"] = self.options.libjpeg7_compatibility - self._cmake.definitions["WITH_JPEG8"] = self.options.libjpeg8_compatibility - self._cmake.definitions["WITH_MEM_SRCDST"] = self.options.mem_src_dst - self._cmake.definitions["WITH_TURBOJPEG"] = self.options.turbojpeg - self._cmake.definitions["WITH_JAVA"] = self.options.java - self._cmake.definitions["WITH_12BIT"] = self.options.enable12bit - self._cmake.definitions["CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT"] = False - self._cmake.definitions["PNG_SUPPORTED"] = False # PNG and zlib are only required for executables (and static libraries) - if self.settings.compiler == "Visual Studio": - self._cmake.definitions["WITH_CRT_DLL"] = "MD" in str(self.settings.compiler.runtime) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - - def _configure_autotools(self): - if not self._autotools: - self._autotools = AutoToolsBuildEnvironment(self) - yes_no = lambda v: "yes" if v else "no" - args = [ - "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))), - "--with-simd={}".format(yes_no(self.options.get_safe("SIMD", False))), - "--with-arith-enc={}".format(yes_no(self.options.arithmetic_encoder)), - "--with-arith-dec={}".format(yes_no(self.options.arithmetic_decoder)), - "--with-jpeg7={}".format(yes_no(self.options.libjpeg7_compatibility)), - "--with-jpeg8={}".format(yes_no(self.options.libjpeg8_compatibility)), - "--with-mem-srcdst={}".format(yes_no(self.options.mem_src_dst)), - "--with-turbojpeg={}".format(yes_no(self.options.turbojpeg)), - "--with-java={}".format(yes_no(self.options.java)), - "--with-12bit={}".format(yes_no(self.options.enable12bit)), - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - self._autotools.configure(configure_dir=self._source_subfolder, args=args) - return self._autotools + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor + tc.variables["ENABLE_SHARED"] = self.options.shared + tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.variables["ENABLE_TESTING"] = False + tc.variables["REQUIRE_SIMD"] = bool(self.options.get_safe("SIMD", False)) + tc.variables["WITH_SIMD"] = bool(self.options.get_safe("SIMD", False)) + tc.variables["WITH_ARITH_ENC"] = bool(self.options.arithmetic_encoder) + tc.variables["WITH_ARITH_DEC"] = bool(self.options.arithmetic_decoder) + tc.variables["WITH_JPEG7"] = bool(self.options.libjpeg7_compatibility) + tc.variables["WITH_JPEG8"] = bool(self.options.libjpeg8_compatibility) + tc.variables["WITH_MEM_SRCDST"] = bool(self.options.mem_src_dst) + tc.variables["WITH_TURBOJPEG"] = bool(self.options.turbojpeg) + tc.variables["WITH_JAVA"] = bool(self.options.java) + tc.variables["WITH_12BIT"] = bool(self.options.enable12bit) + tc.variables["CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT"] = False + tc.variables["PNG_SUPPORTED"] = False # PNG and zlib are only required for executables (and static libraries) + if is_msvc(self): + tc.variables["WITH_CRT_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def generate_autotools(self): + toolchain = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + toolchain.configure_args.append("--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True)))) + toolchain.configure_args.append("--with-simd={}".format(yes_no(self.options.get_safe("SIMD", False)))) + toolchain.configure_args.append("--with-arith-enc={}".format(yes_no(self.options.arithmetic_encoder))) + toolchain.configure_args.append("--with-arith-dec={}".format(yes_no(self.options.arithmetic_decoder))) + toolchain.configure_args.append("--with-jpeg7={}".format(yes_no(self.options.libjpeg7_compatibility))) + toolchain.configure_args.append("--with-jpeg8={}".format(yes_no(self.options.libjpeg8_compatibility))) + toolchain.configure_args.append("--with-mem-srcdst={}".format(yes_no(self.options.mem_src_dst))) + toolchain.configure_args.append("--with-turbojpeg={}".format(yes_no(self.options.turbojpeg))) + toolchain.configure_args.append("--with-java={}".format(yes_no(self.options.java))) + toolchain.configure_args.append("--with-12bit={}".format(yes_no(self.options.enable12bit))) + toolchain.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + def generate(self): + if self._use_cmake: + self.generate_cmake() + else: + self.generate_autotools() + + tc = VirtualBuildEnv(self) + tc.generate(scope="build") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) if self._use_cmake: - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() else: - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF"))) - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() autotools.make() def package(self): - self.copy(pattern="LICENSE.md", dst="licenses", src=self._source_subfolder) + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if self._use_cmake: - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "doc")) + rmdir(self, os.path.join(self.package_folder, "doc")) else: - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + rm(self, pattern="*.la", folder=os.path.join(self.package_folder, "lib")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=os.path.join(self.package_folder, "lib64")) + rmdir(self, os.path.join(self.package_folder, "lib64")) # remove binaries and pdb files for bin_pattern_to_remove in ["cjpeg*", "djpeg*", "jpegtran*", "tjbench*", "wrjpgcom*", "rdjpgcom*", "*.pdb"]: - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), bin_pattern_to_remove) + rm(self, pattern=bin_pattern_to_remove, folder=os.path.join(self.package_folder, "bin")) def _lib_name(self, name): - if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio" and not self.options.shared: + if is_msvc(self) and not self.options.shared: return name + "-static" return name @@ -176,11 +196,11 @@ def package_info(self): # libjpeg self.cpp_info.components["libjpeg"].names["pkg_config"] = "libjpeg" self.cpp_info.components["libjpeg"].libs = [self._lib_name("jpeg")] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libjpeg"].system_libs.append("m") # libturbojpeg if self.options.turbojpeg: self.cpp_info.components["libturbojpeg"].names["pkg_config"] = "libturbojpeg" self.cpp_info.components["libturbojpeg"].libs = [self._lib_name("turbojpeg")] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libturbojpeg"].system_libs.append("m") diff --git a/recipes/mozjpeg/all/patches/3.3.1-0001-cmake-fixes.patch b/recipes/mozjpeg/all/patches/3.3.1-0001-cmake-fixes.patch index b126195864e79..de72859433e6a 100644 --- a/recipes/mozjpeg/all/patches/3.3.1-0001-cmake-fixes.patch +++ b/recipes/mozjpeg/all/patches/3.3.1-0001-cmake-fixes.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 743a243..b5d41a1 100644 +index 743a243..eb787c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,7 +168,7 @@ message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}") @@ -34,7 +34,7 @@ index 743a243..b5d41a1 100644 install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib) if(NOT ENABLE_SHARED) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe -+ install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tjbench-static.exe ++ install(PROGRAMS $ DESTINATION bin RENAME tjbench.exe) endif() endif() @@ -46,13 +46,13 @@ index 743a243..b5d41a1 100644 install(TARGETS jpeg-static ARCHIVE DESTINATION lib) if(NOT ENABLE_SHARED) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe -+ install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cjpeg-static.exe ++ install(PROGRAMS $ DESTINATION bin RENAME cjpeg.exe) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe -+ install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/djpeg-static.exe ++ install(PROGRAMS $ DESTINATION bin RENAME djpeg.exe) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe -+ install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jpegtran-static.exe ++ install(PROGRAMS $ DESTINATION bin RENAME jpegtran.exe) endif() endif() diff --git a/recipes/mozjpeg/all/patches/4.1.1-0001-cmake-fixes.patch b/recipes/mozjpeg/all/patches/4.1.1-0001-cmake-fixes.patch new file mode 100644 index 0000000000000..0d6ad37fc19fd --- /dev/null +++ b/recipes/mozjpeg/all/patches/4.1.1-0001-cmake-fixes.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d295c6..b30dacb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1461,7 +1461,7 @@ if(WITH_TURBOJPEG) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/tjbench-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) + endif() + endif() +@@ -1479,16 +1479,16 @@ if(ENABLE_STATIC) + else() + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +- install(PROGRAMS ${DIR}/cjpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) +- install(PROGRAMS ${DIR}/djpeg-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) +- install(PROGRAMS ${DIR}/jpegtran-static${EXE} ++ install(PROGRAMS $ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) + endif() + endif() + +-install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install(TARGETS rdjpgcom wrjpgcom DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt diff --git a/recipes/mozjpeg/all/test_package/CMakeLists.txt b/recipes/mozjpeg/all/test_package/CMakeLists.txt index 7b9b613cbb24a..9d43e05ca2a27 100644 --- a/recipes/mozjpeg/all/test_package/CMakeLists.txt +++ b/recipes/mozjpeg/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) + project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(mozjpeg REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE mozjpeg::libjpeg) diff --git a/recipes/mozjpeg/all/test_package/conanfile.py b/recipes/mozjpeg/all/test_package/conanfile.py index 3ae27388e5a6d..eb44b6270b92d 100644 --- a/recipes/mozjpeg/all/test_package/conanfile.py +++ b/recipes/mozjpeg/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -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" + 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,7 +20,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") img_name = os.path.join(self.source_folder, "testimg.jpg") - self.run("%s %s" % (bin_path, img_name), run_environment=True) + self.run(f"{bin_path} {img_name}", env="conanrun") diff --git a/recipes/mozjpeg/all/test_v1_package/CMakeLists.txt b/recipes/mozjpeg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f4df079837a44 --- /dev/null +++ b/recipes/mozjpeg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(mozjpeg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mozjpeg::libjpeg) diff --git a/recipes/mozjpeg/all/test_v1_package/conanfile.py b/recipes/mozjpeg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cf6e3a0371de5 --- /dev/null +++ b/recipes/mozjpeg/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") + self.run(f"{bin_path} {img_name}", run_environment=True) diff --git a/recipes/mozjpeg/config.yml b/recipes/mozjpeg/config.yml index 7bdb507696897..c5a4dbb215dd3 100644 --- a/recipes/mozjpeg/config.yml +++ b/recipes/mozjpeg/config.yml @@ -1,5 +1,7 @@ versions: - "3.3.1": + "4.1.1": folder: all "4.0.0": folder: all + "3.3.1": + folder: all From 14eec9c95f7adaf2303f5ab66d75637eb0270802 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:24:59 +0200 Subject: [PATCH 221/561] (#13038) xz_utils: conan v2 support * conan v2 support * typo * refactor slightly * fix MinGW build DESTDIR manually injected due to https://github.com/conan-io/conan/issues/12153 * workaround to update PlatformToolset in vcxproj files * fix install for compiler=msvc * remove WindowsTargetPlatformVersion in 5.2.4 * add ugly tricks for MSBuild * test custom CMake variables in conan generator variables from https://cmake.org/cmake/help/latest/module/FindLibLZMA.html must be defined LIBLZMA_HAS_AUTO_DECODER, LIBLZMA_HAS_EASY_ENCODER & LIBLZMA_HAS_LZMA_PRESET are not modeled for the moment * typo * set win_bash in build_requirements --- recipes/xz_utils/all/conanfile.py | 248 +++++++++++------- .../xz_utils/all/test_package/CMakeLists.txt | 26 +- .../xz_utils/all/test_package/conanfile.py | 28 +- .../all/test_v1_package/CMakeLists.txt | 29 ++ .../xz_utils/all/test_v1_package/conanfile.py | 17 ++ 5 files changed, 227 insertions(+), 121 deletions(-) create mode 100644 recipes/xz_utils/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xz_utils/all/test_v1_package/conanfile.py diff --git a/recipes/xz_utils/all/conanfile.py b/recipes/xz_utils/all/conanfile.py index 8358c6924229e..6c9f443898926 100644 --- a/recipes/xz_utils/all/conanfile.py +++ b/recipes/xz_utils/all/conanfile.py @@ -1,9 +1,16 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild -from conans.tools import Version +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import collect_libs, copy, get, rename, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuild, MSBuildToolchain, unix_path +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class XZUtils(ConanFile): @@ -28,16 +35,6 @@ class XZUtils(ConanFile): "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -45,7 +42,11 @@ def _settings_build(self): @property def _effective_msbuild_type(self): # treat "RelWithDebInfo" and "MinSizeRel" as "Release" - return "Debug" if self.settings.build_type == "Debug" else "Release" + # there is no DebugMT configuration in upstream vcxproj, we patch Debug configuration afterwards + return "{}{}".format( + "Debug" if self.settings.build_type == "Debug" else "Release", + "MT" if is_msvc_static_runtime(self) and self.settings.build_type != "Debug" else "", + ) def config_options(self): if self.settings.os == "Windows": @@ -54,133 +55,176 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): - if self._settings_build.os == "Windows" and not self._is_msvc and \ - not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + if self._settings_build.os == "Windows" and not is_msvc(self): + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + self.win_bash = True 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-doc") + if self.settings.build_type == "Debug": + tc.configure_args.append("--enable-debug") + tc.generate() + env = VirtualBuildEnv(self) + env.generate() + + def _fix_msvc_platform_toolset(self, vcxproj_file, old_toolset): + platform_toolset = { + "Visual Studio": { + "8": "v80", + "9": "v90", + "10": "v100", + "11": "v110", + "12": "v120", + "14": "v140", + "15": "v141", + "16": "v142", + "17": "v143", + }, + "msvc": { + "170": "v110", + "180": "v120", + "190": "v140", + "191": "v141", + "192": "v142", + "193": "v143", + } + }.get(str(self.settings.compiler), {}).get(str(self.settings.compiler.version)) + if not platform_toolset: + raise ConanException( + f"Unkown platform toolset for {self.settings.compiler} {self.settings.compiler.version}", + ) + replace_in_file( + self, + vcxproj_file, + f"{old_toolset}", + f"{platform_toolset}", + ) - def _apply_patches(self): - if tools.Version(self.version) == "5.2.4" and self._is_msvc: + def _build_msvc(self): + if Version(self.version) == "5.2.4": # Relax Windows SDK restriction # Workaround is required only for 5.2.4 because since 5.2.5 WindowsTargetPlatformVersion is dropped from vcproj file - # - # emulate VS2019+ meaning of WindowsTargetPlatformVersion == "10.0" - # undocumented method, but officially recommended workaround by microsoft at at # https://developercommunity.visualstudio.com/content/problem/140294/windowstargetplatformversion-makes-it-impossible-t.html windows_target_platform_version_old = "10.0.15063.0" - if self.settings.compiler.version == 15: - windows_target_platform_version_new = "$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))" - else: - windows_target_platform_version_new = "10.0" - tools.replace_in_file(os.path.join(self._source_subfolder, "windows", "vs2017", "liblzma.vcxproj"), - windows_target_platform_version_old, - windows_target_platform_version_new) - tools.replace_in_file(os.path.join(self._source_subfolder, "windows", "vs2017", "liblzma_dll.vcxproj"), - windows_target_platform_version_old, - windows_target_platform_version_new) - - # Allow to install relocatable shared lib on macOS - if tools.is_apple_os(self.settings.os): - tools.replace_in_file( - os.path.join(self._source_subfolder, "configure"), - "-install_name \\$rpath/", - "-install_name @rpath/", - ) + replace_in_file(self, os.path.join(self.source_folder, "windows", "vs2017", "liblzma.vcxproj"), + windows_target_platform_version_old, "") + replace_in_file(self, os.path.join(self.source_folder, "windows", "vs2017", "liblzma_dll.vcxproj"), + windows_target_platform_version_old, "") + + # TODO: Find a way to inject conantoolchain.props content from MSBuildToolchain + # For the moment all the logic below is a big trick & doesn't honor custom cflags, cxxflags & ldflags from profile + # and arch different than x86 & x86_64 - def _build_msvc(self): # windows\INSTALL-MSVC.txt - msvc_version = "vs2017" if Version(self.settings.compiler.version) >= "15" else "vs2013" - with tools.chdir(os.path.join(self._source_subfolder, "windows", msvc_version)): - target = "liblzma_dll" if self.options.shared else "liblzma" - msbuild = MSBuild(self) - msbuild.build( - "xz_win.sln", - targets=[target], - build_type=self._effective_msbuild_type, - platforms={"x86": "Win32", "x86_64": "x64"}, - upgrade_project=Version(self.settings.compiler.version) >= "17") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - args = ["--disable-doc"] - if self.settings.os != "Windows" and self.options.get_safe("fPIC", True): - args.append("--with-pic") - if self.options.shared: - args.extend(["--disable-static", "--enable-shared"]) + if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler) >= "15") or \ + (self.settings.compiler == "msvc" and Version(self.settings.compiler) >= "191"): + msvc_version = "vs2017" + old_toolset = "v141" else: - args.extend(["--enable-static", "--disable-shared"]) - if self.settings.build_type == "Debug": - args.append("--enable-debug") - self._autotools.configure(configure_dir=self._source_subfolder, args=args, build=False) - return self._autotools + msvc_version = "vs2013" + old_toolset = "v120" + build_script_folder = os.path.join(self.source_folder, "windows", msvc_version) + + # TODO: replace by some conan helper function (https://github.com/conan-io/conan/issues/12155)? + liblzma_vcxproj = os.path.join(build_script_folder, "liblzma.vcxproj") + liblzma_dll_vcxproj = os.path.join(build_script_folder, "liblzma_dll.vcxproj") + self._fix_msvc_platform_toolset(liblzma_vcxproj, old_toolset) + self._fix_msvc_platform_toolset(liblzma_dll_vcxproj, old_toolset) + + # Patch Debug configuration if runtime is MT since there is no DebugMT configuration in upstream vcxproj + if self.settings.build_type == "Debug" and is_msvc_static_runtime(self): + replace_in_file(self, liblzma_vcxproj, "MultiThreadedDebugDLL", "MultiThreadedDebug") + replace_in_file(self, liblzma_dll_vcxproj, "MultiThreadedDebugDLL", "MultiThreadedDebug") + + target = "liblzma_dll" if self.options.shared else "liblzma" + msbuild = MSBuild(self) + msbuild.build_type = self._effective_msbuild_type + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + msbuild.build(os.path.join(build_script_folder, "xz_win.sln"), targets=[target]) def build(self): - self._apply_patches() - if self._is_msvc: + if is_msvc(self): self._build_msvc() else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - if self._is_msvc: - inc_dir = os.path.join(self._source_subfolder, "src", "liblzma", "api") - self.copy(pattern="*.h", dst="include", src=inc_dir, keep_path=True) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + inc_dir = os.path.join(self.source_folder, "src", "liblzma", "api") + copy(self, "*.h", src=inc_dir, dst=os.path.join(self.package_folder, "include"), keep_path=True) arch = {"x86": "Win32", "x86_64": "x64"}.get(str(self.settings.arch)) target = "liblzma_dll" if self.options.shared else "liblzma" - msvc_version = "vs2017" if Version(self.settings.compiler.version) >= "15" else "vs2013" - bin_dir = os.path.join(self._source_subfolder, "windows", msvc_version, + if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler) >= "15") or \ + (self.settings.compiler == "msvc" and Version(self.settings.compiler) >= "191"): + msvc_version = "vs2017" + else: + msvc_version = "vs2013" + bin_dir = os.path.join(self.source_folder, "windows", msvc_version, self._effective_msbuild_type, arch, target) - self.copy(pattern="*.lib", dst="lib", src=bin_dir, keep_path=False) + copy(self, "*.lib", src=bin_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) if self.options.shared: - self.copy(pattern="*.dll", dst="bin", src=bin_dir, keep_path=False) - tools.rename(os.path.join(self.package_folder, "lib", "liblzma.lib"), + copy(self, "*.dll", src=bin_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + rename(self, os.path.join(self.package_folder, "lib", "liblzma.lib"), os.path.join(self.package_folder, "lib", "lzma.lib")) else: - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) self._create_cmake_module_variables( os.path.join(self.package_folder, self._module_file_rel_path), - tools.Version(self.version) ) - @staticmethod - def _create_cmake_module_variables(module_file, version): + def _create_cmake_module_variables(self, module_file): # TODO: also add LIBLZMA_HAS_AUTO_DECODER, LIBLZMA_HAS_EASY_ENCODER & LIBLZMA_HAS_LZMA_PRESET - content = textwrap.dedent("""\ - if(DEFINED LibLZMA_FOUND) - set(LIBLZMA_FOUND ${{LibLZMA_FOUND}}) - endif() + content = textwrap.dedent(f"""\ + set(LIBLZMA_FOUND TRUE) if(DEFINED LibLZMA_INCLUDE_DIRS) set(LIBLZMA_INCLUDE_DIRS ${{LibLZMA_INCLUDE_DIRS}}) endif() if(DEFINED LibLZMA_LIBRARIES) set(LIBLZMA_LIBRARIES ${{LibLZMA_LIBRARIES}}) endif() - set(LIBLZMA_VERSION_MAJOR {major}) - set(LIBLZMA_VERSION_MINOR {minor}) - set(LIBLZMA_VERSION_PATCH {patch}) - set(LIBLZMA_VERSION_STRING "{major}.{minor}.{patch}") - """.format(major=version.major, minor=version.minor, patch=version.patch)) - tools.save(module_file, content) + set(LIBLZMA_VERSION_MAJOR {Version(self.version).major}) + set(LIBLZMA_VERSION_MINOR {Version(self.version).minor}) + set(LIBLZMA_VERSION_PATCH {Version(self.version).patch}) + set(LIBLZMA_VERSION_STRING "{self.version}") + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-variables.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") @@ -192,7 +236,7 @@ def package_info(self): self.cpp_info.defines.append("LZMA_API_STATIC") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "LibLZMA" diff --git a/recipes/xz_utils/all/test_package/CMakeLists.txt b/recipes/xz_utils/all/test_package/CMakeLists.txt index 52957893e3d02..72a4496088dd7 100644 --- a/recipes/xz_utils/all/test_package/CMakeLists.txt +++ b/recipes/xz_utils/all/test_package/CMakeLists.txt @@ -1,10 +1,26 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(LibLZMA REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} LibLZMA::LibLZMA) +target_link_libraries(${PROJECT_NAME} PRIVATE LibLZMA::LibLZMA) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindLibLZMA.html +# are properly defined in conan generators +set(_custom_vars + LIBLZMA_FOUND + LIBLZMA_INCLUDE_DIRS + LIBLZMA_LIBRARIES + LIBLZMA_VERSION_MAJOR + LIBLZMA_VERSION_MINOR + LIBLZMA_VERSION_PATCH + LIBLZMA_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED _custom_var) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/xz_utils/all/test_package/conanfile.py b/recipes/xz_utils/all/test_package/conanfile.py index 52ff86a518167..0a6bc68712d90 100644 --- a/recipes/xz_utils/all/test_package/conanfile.py +++ b/recipes/xz_utils/all/test_package/conanfile.py @@ -1,19 +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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # Workaround for CMake bug with error message: - # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # set. This could be because you are using a Mac OS X version less than 10.5 - # or because CMake's platform configuration is corrupt. - # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -21,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xz_utils/all/test_v1_package/CMakeLists.txt b/recipes/xz_utils/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..971f2caf78d9a --- /dev/null +++ b/recipes/xz_utils/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(LibLZMA REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibLZMA::LibLZMA) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindLibLZMA.html +# are properly defined in conan generators +set(_custom_vars + LIBLZMA_FOUND + LIBLZMA_INCLUDE_DIRS + LIBLZMA_LIBRARIES + LIBLZMA_VERSION_MAJOR + LIBLZMA_VERSION_MINOR + LIBLZMA_VERSION_PATCH + LIBLZMA_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED _custom_var) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/xz_utils/all/test_v1_package/conanfile.py b/recipes/xz_utils/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/xz_utils/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 0e73f6813d0751fcf0192442626edfdd9c5425d8 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 28 Sep 2022 12:44:55 +0200 Subject: [PATCH 222/561] (#13090) dbus/1.14.0 * dbus/1.14.0 * restrict dbus 1.14.0 to gcc >= 7 * Update conanfile.py * Update conanfile.py * Update recipes/dbus/1.x.x/conanfile.py Co-authored-by: Uilian Ries * Bump reqs * dbus 1.15.0 * set session socket dir * Update conanfile.py Co-authored-by: Uilian Ries --- recipes/dbus/1.x.x/conandata.yml | 6 ++++++ recipes/dbus/1.x.x/conanfile.py | 29 +++++++++++++++++++++-------- recipes/dbus/config.yml | 4 ++++ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/recipes/dbus/1.x.x/conandata.yml b/recipes/dbus/1.x.x/conandata.yml index 42752d935328d..782da97eb7547 100644 --- a/recipes/dbus/1.x.x/conandata.yml +++ b/recipes/dbus/1.x.x/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.15.0": + url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.0.tar.xz" + sha256: "5073c8cb9ad20226647bb38f4965182b762a6e1f595ccdc8e59411014bfd640a" + "1.14.0": + url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.14.0.tar.xz" + sha256: "ccd7cce37596e0a19558fd6648d1272ab43f011d80c8635aea8fd0bad58aebd4" "1.12.20": url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.12.20.tar.gz" sha256: "f77620140ecb4cdc67f37fb444f8a6bea70b5b6461f12f1cbe2cec60fa7de5fe" diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index b229ca53b3684..06afef2d16de7 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -3,11 +3,12 @@ from conan import ConanFile from conan.tools.files import apply_conandata_patches, copy, get, mkdir, rename, rmdir, save, rm +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.scm import Version from conans import CMake -# TODO: Update to conan.tools.apple after 1.51.3 -from conans.tools import is_apple_os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.51.3" class DbusConan(ConanFile): @@ -25,6 +26,7 @@ class DbusConan(ConanFile): "with_x11": [True, False], "with_glib": [True, False], "with_selinux": [True, False], + "session_socket_dir": "ANY", } default_options = { "system_socket": "", @@ -32,6 +34,7 @@ class DbusConan(ConanFile): "with_x11": False, "with_glib": False, "with_selinux": False, + "session_socket_dir": "/tmp", } generators = "cmake", "cmake_find_package", "VirtualBuildEnv", "VirtualRunEnv" @@ -54,14 +57,21 @@ def configure(self): del self.settings.compiler.cppstd def requirements(self): - self.requires("expat/2.4.8") + self.requires("expat/2.4.9") if self.options.with_glib: - self.requires("glib/2.72.0") + self.requires("glib/2.73.3") if self.options.with_selinux: self.requires("selinux/3.3") if self.options.get_safe("with_x11"): self.requires("xorg/system") - + + def validate(self): + if Version(self.version) >= "1.14.0": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7: + raise ConanInvalidConfiguration("dbus requires at least gcc 7.") + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("dbus 1.14.0 does not support windows. contributions are welcome") + def export_sources(self): for p in self.conan_data.get("patches", {}).get(self.version, []): copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) @@ -80,13 +90,16 @@ def _configure_cmake(self): self._cmake.definitions["DBUS_BUILD_X11"] = self.options.get_safe("with_x11", False) self._cmake.definitions["DBUS_WITH_GLIB"] = self.options.with_glib - self._cmake.definitions["DBUS_DISABLE_ASSERT"] = is_apple_os(self.settings.os) + self._cmake.definitions["DBUS_DISABLE_ASSERT"] = is_apple_os(self) self._cmake.definitions["DBUS_DISABLE_CHECKS"] = False # Conan does not provide an EXPAT_LIBRARIES CMake variable for the Expat library. # Define EXPAT_LIBRARIES to be the expat::expat target provided by Conan to fix linking. self._cmake.definitions["EXPAT_LIBRARIES"] = "expat::expat" + # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a + self._cmake.definitions["DBUS_SESSION_SOCKET_DIR"] = self.options.session_socket_dir + self._cmake.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder) return self._cmake @@ -131,7 +144,7 @@ def _create_cmake_module_alias_targets(self, module_file, targets): @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "DBus1") diff --git a/recipes/dbus/config.yml b/recipes/dbus/config.yml index 25658d2dae43d..390e432df5f56 100644 --- a/recipes/dbus/config.yml +++ b/recipes/dbus/config.yml @@ -1,3 +1,7 @@ versions: + "1.15.0": + folder: 1.x.x + "1.14.0": + folder: 1.x.x "1.12.20": folder: 1.x.x From 8763863abb98f15d73687acc15ca0da92cce3cda Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 28 Sep 2022 14:05:13 +0300 Subject: [PATCH 223/561] (#13042) libatomic_ops: change cmake package name to Atomic_ops * libatomic_ops: change cmake package name to Atomic_ops, drop old 7.6.x vers * Prepare for Conan 2.0 * Use CMakeLists.txt from upstream to build 7.6.14 (this is to match cmake package/targer naming of upstream) * Drop 7.6.10 and 7.6.12 (because no CMakeLists.txt exists for them and because 7.6.14 is the bugfix release for them) * Validate conan 1.x Signed-off-by: Uilian Ries * libatomic_ops: Use target_link_options and LINKER in cmake script * libatomic_ops: export public symbols to fix build by MSVC This is a backport of commit cf55946ee from upstream master. * libatomic_ops: Add patch description, source and type Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/libatomic_ops/all/conandata.yml | 12 +- recipes/libatomic_ops/all/conanfile.py | 142 ++-- .../all/patches/enable-cmake-7_6_14.patch | 730 ++++++++++++++++++ .../all/test_package/CMakeLists.txt | 5 +- .../all/test_package/conanfile.py | 18 +- .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 19 + recipes/libatomic_ops/config.yml | 4 - 8 files changed, 849 insertions(+), 91 deletions(-) create mode 100644 recipes/libatomic_ops/all/patches/enable-cmake-7_6_14.patch create mode 100644 recipes/libatomic_ops/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libatomic_ops/all/test_v1_package/conanfile.py diff --git a/recipes/libatomic_ops/all/conandata.yml b/recipes/libatomic_ops/all/conandata.yml index db7a433eb252e..59db3060423da 100644 --- a/recipes/libatomic_ops/all/conandata.yml +++ b/recipes/libatomic_ops/all/conandata.yml @@ -1,10 +1,10 @@ sources: - "7.6.10": - url: "https://github.com/ivmai/libatomic_ops/releases/download/v7.6.10/libatomic_ops-7.6.10.tar.gz" - sha256: "587edf60817f56daf1e1ab38a4b3c729b8e846ff67b4f62a6157183708f099af" - "7.6.12": - url: "https://github.com/ivmai/libatomic_ops/releases/download/v7.6.12/libatomic_ops-7.6.12.tar.gz" - sha256: "f0ab566e25fce08b560e1feab6a3db01db4a38e5bc687804334ef3920c549f3e" "7.6.14": url: "https://github.com/ivmai/libatomic_ops/releases/download/v7.6.14/libatomic_ops-7.6.14.tar.gz" sha256: "390f244d424714735b7050d056567615b3b8f29008a663c262fb548f1802d292" +patches: + "7.6.14": + - patch_file: "patches/enable-cmake-7_6_14.patch" + patch_description: "Support build with CMake" + patch_source: "https://github.com/ivmai/libatomic_ops/blob/044573903530c4a8e8318e20a830d4a0531b2035/CMakeLists.txt" + patch_type: "backport" diff --git a/recipes/libatomic_ops/all/conanfile.py b/recipes/libatomic_ops/all/conanfile.py index c9d7c9b91e05b..8bdc55215ddd6 100644 --- a/recipes/libatomic_ops/all/conanfile.py +++ b/recipes/libatomic_ops/all/conanfile.py @@ -1,12 +1,13 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import contextlib +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, rmdir, export_conandata_patches import os -import shutil -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" -class Libatomic_opsConan(ConanFile): + +class Atomic_opsConan(ConanFile): name = "libatomic_ops" homepage = "https://github.com/ivmai/libatomic_ops" description = "The atomic_ops project (Atomic memory update operations portable implementation)" @@ -15,6 +16,11 @@ class Libatomic_opsConan(ConanFile): license = "GPL-2.0-or-later" settings = "os", "compiler", "build_type", "arch" + _cmake_options_defaults = ( + ("assertions", False,), + ("atomic_intrinsics", True,), + ) + options = { "shared": [True, False], "fPIC": [True, False], @@ -23,88 +29,78 @@ class Libatomic_opsConan(ConanFile): "shared": False, "fPIC": True, } + for option, default in _cmake_options_defaults: + options[option] = [True, False] + default_options[option] = default - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass - def build_requirements(self): - self.build_requires("gnu-config/cci.20201022") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - if self.settings.compiler == "Visual Studio": - self._autotools.flags.append("-FS") - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo", - "LD": "link"}): - yield - else: - yield - - @property - def _user_info_build(self): - return getattr(self, "user_info_build", None) or self.deps_user_info + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + for option, _ in self._cmake_options_defaults: + tc.variables["enable_{}".format(option)] = self.options.get_safe(option) + tc.variables["install_headers"] = True + tc.variables["build_tests"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, - os.path.join(self._source_subfolder, "config.sub")) - shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, - os.path.join(self._source_subfolder, "config.guess")) - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() - - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) - if self.settings.compiler == "Visual Studio" and self.options.shared: - for lib in ["atomic_ops_gpl", "atomic_ops"]: - tools.rename(os.path.join(self.package_folder, "lib", "{}.dll.lib".format(lib)), - os.path.join(self.package_folder, "lib", "{}.lib".format(lib))) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.names["pkg_config"] = "atomic_ops" - self.cpp_info.libs = ["atomic_ops_gpl", "atomic_ops"] + self.cpp_info.set_property("cmake_file_name", "Atomic_ops") + self.cpp_info.set_property("cmake_target_name", "Atomic_ops::atomic_ops_gpl") # workaround to not define an unofficial target + + # TODO: Remove on Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "Atomic_ops" + self.cpp_info.names["cmake_find_package_multi"] = "Atomic_ops" + + self.cpp_info.components["atomic_ops"].set_property("cmake_target_name", "Atomic_ops::atomic_ops") + self.cpp_info.components["atomic_ops"].set_property("pkg_config_name", "atomic_ops") + self.cpp_info.components["atomic_ops"].libs = ["atomic_ops"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["atomic_ops"].system_libs = ["pthread"] + + self.cpp_info.components["atomic_ops_gpl"].set_property("cmake_target_name", "Atomic_ops::atomic_ops_gpl") + self.cpp_info.components["atomic_ops_gpl"].libs = ["atomic_ops_gpl"] + self.cpp_info.components["atomic_ops_gpl"].requires = ["atomic_ops"] diff --git a/recipes/libatomic_ops/all/patches/enable-cmake-7_6_14.patch b/recipes/libatomic_ops/all/patches/enable-cmake-7_6_14.patch new file mode 100644 index 0000000000000..15470fd99352f --- /dev/null +++ b/recipes/libatomic_ops/all/patches/enable-cmake-7_6_14.patch @@ -0,0 +1,730 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..8b26697 +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,341 @@ ++# ++# Copyright (c) 2021-2022 Ivan Maidanski ++## ++# Permission is hereby granted, free of charge, to any person obtaining a copy ++# of this software and associated documentation files (the "Software"), to deal ++# in the Software without restriction, including without limitation the rights ++# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++# copies of the Software, and to permit persons to whom the Software is ++# furnished to do so, subject to the following conditions: ++# ++# The above copyright notice and this permission notice shall be included in ++# all copies or substantial portions of the Software. ++# ++# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++# SOFTWARE. ++## ++ ++cmake_minimum_required(VERSION 3.1) ++ ++set(PACKAGE_VERSION 7.6.14) ++# Version must match that in AC_INIT of configure.ac and that in README. ++# Version must conform to: [0-9]+[.][0-9]+[.][0-9]+ ++ ++# Info (current:revision:age) for the Libtool versioning system. ++# These values should match those in src/Makefile.am. ++set(LIBATOMIC_OPS_VER_INFO 2:1:1) ++set(LIBATOMIC_OPS_GPL_VER_INFO 2:3:1) ++ ++project(libatomic_ops C) ++ ++if (POLICY CMP0057) ++ # Required for CheckLinkerFlag, at least. ++ cmake_policy(SET CMP0057 NEW) ++endif() ++ ++include(CheckCCompilerFlag) ++include(CheckFunctionExists) ++include(CMakePackageConfigHelpers) ++include(CTest) ++include(GNUInstallDirs) ++ ++if (NOT (${CMAKE_VERSION} VERSION_LESS "3.18.0")) ++ include(CheckLinkerFlag) ++endif() ++ ++# Customize the build by passing "-D=ON|OFF" in the command line. ++option(BUILD_SHARED_LIBS "Build shared libraries" OFF) ++option(build_tests "Build tests" OFF) ++option(enable_assertions "Enable assertion checking" OFF) ++option(enable_werror "Treat warnings as errors" OFF) ++option(enable_atomic_intrinsics "Use GCC atomic intrinsics" ON) ++option(enable_docs "Build and install documentation" ON) ++option(install_headers "Install header and pkg-config metadata files" ON) ++ ++# Override the default build type to RelWithDebInfo (this instructs cmake to ++# pass -O2 -g -DNDEBUG options to the compiler). ++if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) ++ set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE ++ STRING "Choose the type of build." FORCE) ++ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY ++ STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel") ++endif() ++ ++# Convert VER_INFO values to [SO]VERSION ones. ++if (BUILD_SHARED_LIBS) ++ # atomic_ops: ++ string(REGEX REPLACE "(.+):.+:.+" "\\1" ao_cur ${LIBATOMIC_OPS_VER_INFO}) ++ string(REGEX REPLACE ".+:(.+):.+" "\\1" ao_rev ${LIBATOMIC_OPS_VER_INFO}) ++ string(REGEX REPLACE ".+:.+:(.+)$" "\\1" ao_age ${LIBATOMIC_OPS_VER_INFO}) ++ math(EXPR AO_SOVERSION "${ao_cur} - ${ao_age}") ++ set(AO_VERSION_PROP "${AO_SOVERSION}.${ao_age}.${ao_rev}") ++ message(STATUS "AO_VERSION_PROP = ${AO_VERSION_PROP}") ++ # atomic_ops_gpl: ++ string(REGEX REPLACE "(.+):.+:.+" "\\1" ao_gpl_cur ++ ${LIBATOMIC_OPS_GPL_VER_INFO}) ++ string(REGEX REPLACE ".+:(.+):.+" "\\1" ao_gpl_rev ++ ${LIBATOMIC_OPS_GPL_VER_INFO}) ++ string(REGEX REPLACE ".+:.+:(.+)$" "\\1" ao_gpl_age ++ ${LIBATOMIC_OPS_GPL_VER_INFO}) ++ math(EXPR AO_GPL_SOVERSION "${ao_gpl_cur} - ${ao_gpl_age}") ++ set(AO_GPL_VERSION_PROP "${AO_GPL_SOVERSION}.${ao_gpl_age}.${ao_gpl_rev}") ++ message(STATUS "AO_GPL_VERSION_PROP = ${AO_GPL_VERSION_PROP}") ++endif(BUILD_SHARED_LIBS) ++ ++# Output all warnings. ++if (MSVC) ++ # All warnings but ignoring "conditional expression is constant" ones. ++ add_compile_options(/W4 /wd4127) ++else() ++ add_compile_options(-Wall -Wextra) ++endif() ++ ++find_package(Threads REQUIRED) ++message(STATUS "Thread library: ${CMAKE_THREAD_LIBS_INIT}") ++include_directories(${Threads_INCLUDE_DIR}) ++set(THREADDLLIBS_LIST ${CMAKE_THREAD_LIBS_INIT}) ++ ++if (CMAKE_USE_PTHREADS_INIT) ++ # Required define if using POSIX threads. ++ add_compile_options(-D_REENTRANT) ++else() ++ # No pthreads library available. ++ add_compile_options(-DAO_NO_PTHREADS) ++endif() ++ ++if (enable_assertions) ++ # In case NDEBUG macro is defined e.g. by cmake -DCMAKE_BUILD_TYPE=Release. ++ add_compile_options(-UNDEBUG) ++else() ++ # Define to disable assertion checking. ++ add_compile_options(-DNDEBUG) ++endif() ++ ++if (NOT enable_atomic_intrinsics) ++ # Define to avoid GCC atomic intrinsics even if available. ++ add_compile_options(-DAO_DISABLE_GCC_ATOMICS) ++endif() ++ ++# AO API symbols export control. ++if (BUILD_SHARED_LIBS) ++ add_compile_options(-DAO_DLL) ++endif() ++ ++if (enable_werror) ++ if (MSVC) ++ add_compile_options(/WX) ++ else() ++ add_compile_options(-Werror) ++ endif() ++endif(enable_werror) ++ ++# Extra user-defined flags to pass to the C compiler. ++if (DEFINED CFLAGS_EXTRA) ++ separate_arguments(CFLAGS_EXTRA_LIST UNIX_COMMAND "${CFLAGS_EXTRA}") ++ add_compile_options(${CFLAGS_EXTRA_LIST}) ++endif() ++ ++set(SRC src/atomic_ops.c) ++ ++if (CMAKE_C_COMPILER_ID STREQUAL "SunPro") ++ # SunCC compiler on SunOS (Solaris). ++ set(SRC ${SRC} src/atomic_ops_sysdeps.S) ++endif() ++ ++add_library(atomic_ops ${SRC}) ++target_link_libraries(atomic_ops PRIVATE ${THREADDLLIBS_LIST}) ++target_include_directories(atomic_ops ++ PUBLIC "$" ++ INTERFACE "$") ++ ++set(AO_GPL_SRC src/atomic_ops_malloc.c src/atomic_ops_stack.c) ++add_library(atomic_ops_gpl ${AO_GPL_SRC}) ++check_function_exists(mmap HAVE_MMAP) ++if (HAVE_MMAP) ++ target_compile_definitions(atomic_ops_gpl PRIVATE HAVE_MMAP) ++endif() ++target_link_libraries(atomic_ops_gpl PRIVATE atomic_ops) ++target_include_directories(atomic_ops_gpl ++ PUBLIC "$" ++ INTERFACE "$") ++if (BUILD_SHARED_LIBS) ++ set_property(TARGET atomic_ops_gpl PROPERTY VERSION ${AO_GPL_VERSION_PROP}) ++ set_property(TARGET atomic_ops_gpl PROPERTY SOVERSION ${AO_GPL_SOVERSION}) ++endif() ++install(TARGETS atomic_ops_gpl EXPORT Atomic_opsTargets ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ ++if (BUILD_SHARED_LIBS) ++ if (${CMAKE_VERSION} VERSION_LESS "3.18.0") ++ set(WL_NO_UNDEFINED_OPT "-Wl,--no-undefined") ++ check_c_compiler_flag(${WL_NO_UNDEFINED_OPT} HAVE_FLAG_WL_NO_UNDEFINED) ++ else() ++ set(WL_NO_UNDEFINED_OPT "LINKER:--no-undefined") ++ check_linker_flag(C "${WL_NO_UNDEFINED_OPT}" HAVE_FLAG_WL_NO_UNDEFINED) ++ endif() ++ if (HAVE_FLAG_WL_NO_UNDEFINED) ++ # Declare that the libraries do not refer to external symbols. ++ if (${CMAKE_VERSION} VERSION_LESS "3.13.0") ++ target_link_libraries(atomic_ops PRIVATE ${WL_NO_UNDEFINED_OPT}) ++ target_link_libraries(atomic_ops_gpl PRIVATE ${WL_NO_UNDEFINED_OPT}) ++ else() ++ target_link_options(atomic_ops PRIVATE ${WL_NO_UNDEFINED_OPT}) ++ target_link_options(atomic_ops_gpl PRIVATE ${WL_NO_UNDEFINED_OPT}) ++ endif() ++ endif(HAVE_FLAG_WL_NO_UNDEFINED) ++ set_property(TARGET atomic_ops PROPERTY VERSION ${AO_VERSION_PROP}) ++ set_property(TARGET atomic_ops PROPERTY SOVERSION ${AO_SOVERSION}) ++endif(BUILD_SHARED_LIBS) ++ ++install(TARGETS atomic_ops EXPORT Atomic_opsTargets ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ ++if (install_headers) ++ install(FILES src/atomic_ops.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ install(FILES src/atomic_ops_malloc.h ++ src/atomic_ops_stack.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ ++ install(FILES src/atomic_ops/ao_version.h ++ src/atomic_ops/generalize-arithm.h ++ src/atomic_ops/generalize-small.h ++ src/atomic_ops/generalize.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops") ++ ++ install(FILES src/atomic_ops/sysdeps/all_acquire_release_volatile.h ++ src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h ++ src/atomic_ops/sysdeps/all_atomic_load_store.h ++ src/atomic_ops/sysdeps/all_atomic_only_load.h ++ src/atomic_ops/sysdeps/ao_t_is_int.h ++ src/atomic_ops/sysdeps/emul_cas.h ++ src/atomic_ops/sysdeps/generic_pthread.h ++ src/atomic_ops/sysdeps/ordered.h ++ src/atomic_ops/sysdeps/ordered_except_wr.h ++ src/atomic_ops/sysdeps/read_ordered.h ++ src/atomic_ops/sysdeps/standard_ao_double_t.h ++ src/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h ++ src/atomic_ops/sysdeps/test_and_set_t_is_char.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps") ++ ++ install(FILES src/atomic_ops/sysdeps/armcc/arm_v6.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps/armcc") ++ install(FILES src/atomic_ops/sysdeps/gcc/aarch64.h ++ src/atomic_ops/sysdeps/gcc/alpha.h ++ src/atomic_ops/sysdeps/gcc/arm.h ++ src/atomic_ops/sysdeps/gcc/avr32.h ++ src/atomic_ops/sysdeps/gcc/cris.h ++ src/atomic_ops/sysdeps/gcc/generic-arithm.h ++ src/atomic_ops/sysdeps/gcc/generic-small.h ++ src/atomic_ops/sysdeps/gcc/generic.h ++ src/atomic_ops/sysdeps/gcc/hexagon.h ++ src/atomic_ops/sysdeps/gcc/hppa.h ++ src/atomic_ops/sysdeps/gcc/ia64.h ++ src/atomic_ops/sysdeps/gcc/m68k.h ++ src/atomic_ops/sysdeps/gcc/mips.h ++ src/atomic_ops/sysdeps/gcc/powerpc.h ++ src/atomic_ops/sysdeps/gcc/riscv.h ++ src/atomic_ops/sysdeps/gcc/s390.h ++ src/atomic_ops/sysdeps/gcc/sh.h ++ src/atomic_ops/sysdeps/gcc/sparc.h ++ src/atomic_ops/sysdeps/gcc/tile.h ++ src/atomic_ops/sysdeps/gcc/x86.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps/gcc") ++ ++ install(FILES src/atomic_ops/sysdeps/hpc/hppa.h ++ src/atomic_ops/sysdeps/hpc/ia64.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps/hpc") ++ install(FILES src/atomic_ops/sysdeps/ibmc/powerpc.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps/ibmc") ++ install(FILES src/atomic_ops/sysdeps/icc/ia64.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps/icc") ++ ++ install(FILES src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h ++ src/atomic_ops/sysdeps/loadstore/atomic_load.h ++ src/atomic_ops/sysdeps/loadstore/atomic_store.h ++ src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h ++ src/atomic_ops/sysdeps/loadstore/char_atomic_load.h ++ src/atomic_ops/sysdeps/loadstore/char_atomic_store.h ++ src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h ++ src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h ++ src/atomic_ops/sysdeps/loadstore/int_atomic_load.h ++ src/atomic_ops/sysdeps/loadstore/int_atomic_store.h ++ src/atomic_ops/sysdeps/loadstore/ordered_loads_only.h ++ src/atomic_ops/sysdeps/loadstore/ordered_stores_only.h ++ src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h ++ src/atomic_ops/sysdeps/loadstore/short_atomic_load.h ++ src/atomic_ops/sysdeps/loadstore/short_atomic_store.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps/loadstore") ++ ++ install(FILES src/atomic_ops/sysdeps/msftc/arm.h ++ src/atomic_ops/sysdeps/msftc/common32_defs.h ++ src/atomic_ops/sysdeps/msftc/x86.h ++ src/atomic_ops/sysdeps/msftc/x86_64.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps/msftc") ++ install(FILES src/atomic_ops/sysdeps/sunc/sparc.h ++ src/atomic_ops/sysdeps/sunc/x86.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/atomic_ops/sysdeps/sunc") ++ ++ # Provide pkg-config metadata. ++ set(prefix "${CMAKE_INSTALL_PREFIX}") ++ set(exec_prefix \${prefix}) ++ set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}") ++ set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}") ++ string(REPLACE ";" " " THREADDLLIBS "${THREADDLLIBS_LIST}") ++ # PACKAGE_VERSION is defined above. ++ configure_file(pkgconfig/atomic_ops.pc.in pkgconfig/atomic_ops.pc @ONLY) ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/atomic_ops.pc" ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ++endif(install_headers) ++ ++if (build_tests) ++ add_executable(test_stack tests/test_stack.c) ++ target_link_libraries(test_stack ++ PRIVATE atomic_ops atomic_ops_gpl ${THREADDLLIBS_LIST}) ++ add_test(NAME test_stack COMMAND test_stack) ++ ++ add_executable(test_malloc tests/test_malloc.c) ++ target_link_libraries(test_malloc ++ PRIVATE atomic_ops atomic_ops_gpl ${THREADDLLIBS_LIST}) ++ add_test(NAME test_malloc COMMAND test_malloc) ++endif(build_tests) ++ ++if (enable_docs) ++ install(FILES AUTHORS doc/LICENSING.txt README.md ++ doc/README_details.txt doc/README_win32.txt ++ DESTINATION "${CMAKE_INSTALL_DOCDIR}") ++ install(FILES COPYING doc/README_malloc.txt doc/README_stack.txt ++ DESTINATION "${CMAKE_INSTALL_DOCDIR}") ++endif(enable_docs) ++ ++# CMake config/targets files. ++install(EXPORT Atomic_opsTargets FILE Atomic_opsTargets.cmake ++ NAMESPACE Atomic_ops:: ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/atomic_ops") ++ ++configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/Atomic_opsConfig.cmake" ++ INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/atomic_ops" ++ NO_SET_AND_CHECK_MACRO) ++ ++write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/Atomic_opsConfigVersion.cmake" ++ VERSION "${PACKAGE_VERSION}" COMPATIBILITY AnyNewerVersion) ++ ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Atomic_opsConfig.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/Atomic_opsConfigVersion.cmake" ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/atomic_ops") ++ ++export(EXPORT Atomic_opsTargets ++ FILE "${CMAKE_CURRENT_BINARY_DIR}/Atomic_opsTargets.cmake") +diff --git a/Config.cmake.in b/Config.cmake.in +new file mode 100644 +index 0000000..034b456 +--- /dev/null ++++ b/Config.cmake.in +@@ -0,0 +1,5 @@ ++# The Atomic_ops CMake configuration file. ++ ++@PACKAGE_INIT@ ++include("${CMAKE_CURRENT_LIST_DIR}/Atomic_opsTargets.cmake") ++check_required_components(libatomic_ops) +diff --git a/configure.ac b/configure.ac +index ccf3230..eec3863 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -234,6 +234,12 @@ else + fi + AC_SUBST(THREADDLLIBS) + ++# AO API symbols export control. ++# Compile with AO_DLL defined unless building static libraries. ++if test x$enable_shared = xyes -a x$enable_static = xno; then ++ CFLAGS="-DAO_DLL $CFLAGS" ++fi ++ + AM_CONDITIONAL(ENABLE_SHARED, test x$enable_shared = xyes) + AM_CONDITIONAL(HAVE_PTHREAD_H, test x$have_pthreads = xtrue) + AM_CONDITIONAL(NEED_ASM, test x$need_asm = xtrue) +diff --git a/src/atomic_ops.c b/src/atomic_ops.c +index 5e6577f..1e5f3c9 100644 +--- a/src/atomic_ops.c ++++ b/src/atomic_ops.c +@@ -51,6 +51,10 @@ + # define _GNU_SOURCE 1 + #endif + ++#ifndef AO_BUILD ++# define AO_BUILD ++#endif ++ + #undef AO_REQUIRE_CAS + #include "atomic_ops.h" /* Without cas emulation! */ + +@@ -83,6 +87,8 @@ + + /* Lock for pthreads-based implementation. */ + #ifndef AO_NO_PTHREADS ++ AO_API pthread_mutex_t AO_pt_lock; ++ + pthread_mutex_t AO_pt_lock = PTHREAD_MUTEX_INITIALIZER; + #endif + +@@ -109,7 +115,7 @@ static AO_TS_t AO_locks[AO_HASH_SIZE] = { + AO_TS_INITIALIZER, AO_TS_INITIALIZER, AO_TS_INITIALIZER, AO_TS_INITIALIZER, + }; + +-void AO_pause(int); /* defined below */ ++AO_API void AO_pause(int); /* defined below */ + + static void lock_ool(volatile AO_TS_t *l) + { +@@ -156,8 +162,8 @@ AO_INLINE void unlock(volatile AO_TS_t *l) + } + #endif /* !AO_USE_NO_SIGNALS */ + +-AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, AO_t old_val, +- AO_t new_val) ++AO_API AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, ++ AO_t old_val, AO_t new_val) + { + AO_TS_t *my_lock = AO_locks + AO_HASH(addr); + AO_t fetched_val; +@@ -177,9 +183,10 @@ AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, AO_t old_val, + return fetched_val; + } + +-int AO_compare_double_and_swap_double_emulation(volatile AO_double_t *addr, +- AO_t old_val1, AO_t old_val2, +- AO_t new_val1, AO_t new_val2) ++AO_API int ++AO_compare_double_and_swap_double_emulation(volatile AO_double_t *addr, ++ AO_t old_val1, AO_t old_val2, ++ AO_t new_val1, AO_t new_val2) + { + AO_TS_t *my_lock = AO_locks + AO_HASH(addr); + int result; +@@ -204,7 +211,7 @@ int AO_compare_double_and_swap_double_emulation(volatile AO_double_t *addr, + return result; + } + +-void AO_store_full_emulation(volatile AO_t *addr, AO_t val) ++AO_API void AO_store_full_emulation(volatile AO_t *addr, AO_t val) + { + AO_TS_t *my_lock = AO_locks + AO_HASH(addr); + lock(my_lock); +@@ -237,7 +244,7 @@ static void AO_spin(int n) + AO_store(&spin_dummy, j); + } + +-void AO_pause(int n) ++AO_API void AO_pause(int n) + { + if (n < 12) + AO_spin(n); +diff --git a/src/atomic_ops.h b/src/atomic_ops.h +index 92d1f4a..1f996fe 100644 +--- a/src/atomic_ops.h ++++ b/src/atomic_ops.h +@@ -235,6 +235,30 @@ + # define AO_ALIGNOF_SUPPORTED 1 + #endif + ++#if defined(AO_DLL) && !defined(AO_API) ++# ifdef AO_BUILD ++# if defined(__CEGCC__) || (defined(__MINGW32__) && !defined(__cplusplus)) ++# define AO_API __declspec(dllexport) ++# elif defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__) \ ++ || defined(__DMC__) || defined(__MINGW32__) || defined(__WATCOMC__) ++# define AO_API extern __declspec(dllexport) ++# endif ++# else ++# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CEGCC__) \ ++ || defined(__CYGWIN__) || defined(__DMC__) ++# define AO_API __declspec(dllimport) ++# elif defined(__MINGW32_DELAY_LOAD__) ++# define AO_API __declspec(dllexport) ++# elif defined(__MINGW32__) || defined(__WATCOMC__) ++# define AO_API extern __declspec(dllimport) ++# endif ++# endif ++#endif /* AO_DLL */ ++ ++#ifndef AO_API ++# define AO_API extern ++#endif ++ + #ifdef AO_ALIGNOF_SUPPORTED + # define AO_ASSERT_ADDR_ALIGNED(addr) \ + assert(((size_t)(addr) & (__alignof__(*(addr)) - 1)) == 0) +diff --git a/src/atomic_ops/sysdeps/emul_cas.h b/src/atomic_ops/sysdeps/emul_cas.h +index e52f75a..c322a5b 100644 +--- a/src/atomic_ops/sysdeps/emul_cas.h ++++ b/src/atomic_ops/sysdeps/emul_cas.h +@@ -47,14 +47,15 @@ + extern "C" { + #endif + +-AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, AO_t old_val, +- AO_t new_val); ++AO_API AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, ++ AO_t old_val, AO_t new_val); + +-int AO_compare_double_and_swap_double_emulation(volatile AO_double_t *addr, +- AO_t old_val1, AO_t old_val2, +- AO_t new_val1, AO_t new_val2); ++AO_API int ++AO_compare_double_and_swap_double_emulation(volatile AO_double_t *addr, ++ AO_t old_val1, AO_t old_val2, ++ AO_t new_val1, AO_t new_val2); + +-void AO_store_full_emulation(volatile AO_t *addr, AO_t val); ++AO_API void AO_store_full_emulation(volatile AO_t *addr, AO_t val); + + #ifndef AO_HAVE_fetch_compare_and_swap_full + # define AO_fetch_compare_and_swap_full(addr, old, newval) \ +diff --git a/src/atomic_ops/sysdeps/generic_pthread.h b/src/atomic_ops/sysdeps/generic_pthread.h +index 854cb77..724b148 100644 +--- a/src/atomic_ops/sysdeps/generic_pthread.h ++++ b/src/atomic_ops/sysdeps/generic_pthread.h +@@ -39,7 +39,7 @@ + + /* We define only the full barrier variants, and count on the */ + /* generalization section below to fill in the rest. */ +-extern pthread_mutex_t AO_pt_lock; ++AO_API pthread_mutex_t AO_pt_lock; + + #ifdef __cplusplus + } /* extern "C" */ +diff --git a/src/atomic_ops_malloc.c b/src/atomic_ops_malloc.c +index adced80..19f49b2 100644 +--- a/src/atomic_ops_malloc.c ++++ b/src/atomic_ops_malloc.c +@@ -19,6 +19,10 @@ + # undef HAVE_MMAP + #endif + ++#ifndef AO_BUILD ++# define AO_BUILD ++#endif ++ + #define AO_REQUIRE_CAS + #include "atomic_ops_malloc.h" + +@@ -116,7 +120,7 @@ static volatile AO_t initial_heap_ptr = (AO_t)AO_initial_heap; + + static volatile AO_t mmap_enabled = 0; + +-void ++AO_API void + AO_malloc_enable_mmap(void) + { + # if defined(__sun) +@@ -200,7 +204,7 @@ AO_free_large(char * p) + + #else /* No MMAP */ + +-void ++AO_API void + AO_malloc_enable_mmap(void) + { + } +@@ -319,7 +323,7 @@ static unsigned msb(size_t s) + return result; + } + +-AO_ATTR_MALLOC AO_ATTR_ALLOC_SIZE(1) ++AO_API AO_ATTR_MALLOC AO_ATTR_ALLOC_SIZE(1) + void * + AO_malloc(size_t sz) + { +@@ -349,7 +353,7 @@ AO_malloc(size_t sz) + return result + 1; + } + +-void ++AO_API void + AO_free(void *p) + { + AO_t *base; +diff --git a/src/atomic_ops_malloc.h b/src/atomic_ops_malloc.h +index f9ed900..efd8880 100644 +--- a/src/atomic_ops_malloc.h ++++ b/src/atomic_ops_malloc.h +@@ -66,13 +66,13 @@ + # endif + #endif + +-void AO_free(void *); ++AO_API void AO_free(void *); + +-AO_ATTR_MALLOC AO_ATTR_ALLOC_SIZE(1) ++AO_API AO_ATTR_MALLOC AO_ATTR_ALLOC_SIZE(1) + void * AO_malloc(size_t); + + /* Allow use of mmap to grow the heap. No-op on some platforms. */ +-void AO_malloc_enable_mmap(void); ++AO_API void AO_malloc_enable_mmap(void); + + #ifdef __cplusplus + } /* extern "C" */ +diff --git a/src/atomic_ops_stack.c b/src/atomic_ops_stack.c +index c31c7bf..a5ac859 100644 +--- a/src/atomic_ops_stack.c ++++ b/src/atomic_ops_stack.c +@@ -19,6 +19,10 @@ + #include + #include + ++#ifndef AO_BUILD ++# define AO_BUILD ++#endif ++ + #define AO_REQUIRE_CAS + #include "atomic_ops_stack.h" + +@@ -36,7 +40,7 @@ + + #ifdef AO_USE_ALMOST_LOCK_FREE + +- void AO_pause(int); /* defined in atomic_ops.c */ ++ AO_API void AO_pause(int); /* defined in atomic_ops.c */ + + /* LIFO linked lists based on compare-and-swap. We need to avoid */ + /* the case of a node deletion and reinsertion while I'm deleting */ +@@ -58,8 +62,8 @@ + /* to be inserted. */ + /* Both list headers and link fields contain "perturbed" pointers, i.e. */ + /* pointers with extra bits "or"ed into the low order bits. */ +-void AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x, +- AO_stack_aux *a) ++AO_API void AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x, ++ AO_stack_aux *a) + { + AO_t x_bits = (AO_t)x; + AO_t next; +@@ -139,8 +143,8 @@ void AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x, + # define AO_load_next AO_load + #endif + +-AO_t * +-AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, AO_stack_aux * a) ++AO_API AO_t *AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, ++ AO_stack_aux *a) + { + unsigned i; + int j = 0; +@@ -254,7 +258,7 @@ AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, AO_stack_aux * a) + volatile /* non-static */ AO_t AO_noop_sink; + #endif + +-void AO_stack_push_release(AO_stack_t *list, AO_t *element) ++AO_API void AO_stack_push_release(AO_stack_t *list, AO_t *element) + { + AO_t next; + +@@ -273,7 +277,7 @@ void AO_stack_push_release(AO_stack_t *list, AO_t *element) + # endif + } + +-AO_t *AO_stack_pop_acquire(AO_stack_t *list) ++AO_API AO_t *AO_stack_pop_acquire(AO_stack_t *list) + { + # if defined(__clang__) && !AO_CLANG_PREREQ(3, 5) + AO_t *volatile cptr; +@@ -307,7 +311,7 @@ AO_t *AO_stack_pop_acquire(AO_stack_t *list) + /* We have a wide CAS, but only does an AO_t-wide comparison. */ + /* We can't use the Treiber optimization, since we only check */ + /* for an unchanged version number, not an unchanged pointer. */ +-void AO_stack_push_release(AO_stack_t *list, AO_t *element) ++AO_API void AO_stack_push_release(AO_stack_t *list, AO_t *element) + { + AO_t version; + +@@ -323,7 +327,7 @@ void AO_stack_push_release(AO_stack_t *list, AO_t *element) + version+1, (AO_t) element)); + } + +-AO_t *AO_stack_pop_acquire(AO_stack_t *list) ++AO_API AO_t *AO_stack_pop_acquire(AO_stack_t *list) + { + AO_t *cptr; + AO_t next; +diff --git a/src/atomic_ops_stack.h b/src/atomic_ops_stack.h +index e03c186..4053071 100644 +--- a/src/atomic_ops_stack.h ++++ b/src/atomic_ops_stack.h +@@ -141,11 +141,11 @@ typedef struct AO__stack_aux { + /* The following two routines should not normally be used directly. */ + /* We make them visible here for the rare cases in which it makes sense */ + /* to share the AO_stack_aux between stacks. */ +-void ++AO_API void + AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x, + AO_stack_aux *); + +-AO_t * ++AO_API AO_t * + AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, AO_stack_aux *); + + /* And now AO_stack_t for the real interface: */ +@@ -213,9 +213,9 @@ AO_INLINE void AO_stack_init(AO_stack_t *list) + #define AO_REAL_HEAD_PTR(x) (AO_t *)((x).AO_val2) + #define AO_REAL_NEXT_PTR(x) (AO_t *)(x) + +-void AO_stack_push_release(AO_stack_t *list, AO_t *new_element); ++AO_API void AO_stack_push_release(AO_stack_t *list, AO_t *new_element); + #define AO_HAVE_stack_push_release +-AO_t * AO_stack_pop_acquire(AO_stack_t *list); ++AO_API AO_t *AO_stack_pop_acquire(AO_stack_t *list); + #define AO_HAVE_stack_pop_acquire + + #endif /* Wide CAS case */ +diff --git a/tests/test_atomic.c b/tests/test_atomic.c +index a301ced..a905308 100644 +--- a/tests/test_atomic.c ++++ b/tests/test_atomic.c +@@ -192,11 +192,12 @@ int test_and_set_test(void) + extern "C" { + # endif + +- void AO_store_full_emulation(volatile AO_t *addr, AO_t val); +- AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, AO_t old_val, +- AO_t new_val); ++ AO_API void AO_store_full_emulation(volatile AO_t *addr, AO_t val); ++ AO_API AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, ++ AO_t old_val, AO_t new_val); + # ifdef AO_HAVE_double_t +- int AO_compare_double_and_swap_double_emulation(volatile AO_double_t *, ++ AO_API int ++ AO_compare_double_and_swap_double_emulation(volatile AO_double_t *, + AO_t old_val1, AO_t old_val2, + AO_t new_val1, AO_t new_val2); + # endif diff --git a/recipes/libatomic_ops/all/test_package/CMakeLists.txt b/recipes/libatomic_ops/all/test_package/CMakeLists.txt index 7b9b613cbb24a..2f1810f818b79 100644 --- a/recipes/libatomic_ops/all/test_package/CMakeLists.txt +++ b/recipes/libatomic_ops/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(Atomic_ops CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE Atomic_ops::atomic_ops Atomic_ops::atomic_ops_gpl) diff --git a/recipes/libatomic_ops/all/test_package/conanfile.py b/recipes/libatomic_ops/all/test_package/conanfile.py index 3695635f5e0f5..fde7967ed16f1 100644 --- a/recipes/libatomic_ops/all/test_package/conanfile.py +++ b/recipes/libatomic_ops/all/test_package/conanfile.py @@ -1,10 +1,19 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.build import can_run class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,5 @@ 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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/libatomic_ops/all/test_v1_package/CMakeLists.txt b/recipes/libatomic_ops/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c7f2e8e2e3a34 --- /dev/null +++ b/recipes/libatomic_ops/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(Atomic_ops CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Atomic_ops::atomic_ops Atomic_ops::atomic_ops_gpl) diff --git a/recipes/libatomic_ops/all/test_v1_package/conanfile.py b/recipes/libatomic_ops/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/libatomic_ops/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libatomic_ops/config.yml b/recipes/libatomic_ops/config.yml index 5e2c476125265..c989c79eb8c41 100644 --- a/recipes/libatomic_ops/config.yml +++ b/recipes/libatomic_ops/config.yml @@ -1,7 +1,3 @@ versions: - "7.6.10": - folder: all - "7.6.12": - folder: all "7.6.14": folder: all From 3035519947d670f450a16e3034d771786ead7e76 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 28 Sep 2022 13:25:02 +0200 Subject: [PATCH 224/561] (#13091) bison/3.8.2 * bison/3.8.2 * disable windows * Update conanfile.py * Update recipes/bison/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Update conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/bison/all/conandata.yml | 10 ++++++ recipes/bison/all/conanfile.py | 32 +++++++++++-------- ...e_pipe-uses-O_TEXT-not-O_BINARY-mode.patch | 29 +++++++++++++++++ recipes/bison/config.yml | 2 ++ 4 files changed, 60 insertions(+), 13 deletions(-) create mode 100644 recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch diff --git a/recipes/bison/all/conandata.yml b/recipes/bison/all/conandata.yml index cab26f5d149a0..67b0780a7f658 100644 --- a/recipes/bison/all/conandata.yml +++ b/recipes/bison/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.8.2": + url: "https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.gz" + sha256: "06c9e13bdf7eb24d4ceb6b59205a4f67c2c7e7213119644430fe82fbd14a0abb" "3.7.6": url: "https://ftp.gnu.org/gnu/bison/bison-3.7.6.tar.gz" sha256: "69dc0bb46ea8fc307d4ca1e0b61c8c355eb207d0b0c69f4f8462328e74d7b9ea" @@ -9,6 +12,13 @@ sources: url: "https://ftp.gnu.org/gnu/bison/bison-3.5.3.tar.gz" sha256: "34e201d963156618a0ea5bc87220f660a1e08403dd3c7c7903d4f38db3f40039" patches: + "3.8.2": + - patch_file: "patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + base_path: "source_subfolder" "3.7.6": - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" base_path: "source_subfolder" diff --git a/recipes/bison/all/conanfile.py b/recipes/bison/all/conanfile.py index e52d761c606cd..86d0e584d5c46 100644 --- a/recipes/bison/all/conanfile.py +++ b/recipes/bison/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, apply_conandata_patches, replace_in_file +from conans import AutoToolsBuildEnvironment, tools import contextlib import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class BisonConan(ConanFile): @@ -43,16 +46,20 @@ def configure(self): def requirements(self): self.requires("m4/1.4.19") + def validate(self): + if self.settings.compiler == "Visual Studio" and self.version == "3.8.2": + raise ConanInvalidConfiguration("bison/3.8.2 is not yet ready for Visual Studio, use previous version or open a pull request on https://github.com/conan-io/conan-center-index/pulls") + def build_requirements(self): if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): self.build_requires("msys2/cci.latest") if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.4") + self.build_requires("automake/1.16.5") if self.settings.os != "Windows": self.build_requires("flex/2.6.4") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) @contextlib.contextmanager @@ -105,31 +112,30 @@ def _configure_autotools(self): return self._autotools def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) if self.settings.os == "Windows": # replace embedded unix paths by windows paths - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), + replace_in_file(self, os.path.join(self._source_subfolder, "Makefile.in"), "echo '#define BINDIR \"$(bindir)\"';", "echo '#define BINDIR \"$(shell cygpath -m \"$(bindir)\")\"';") - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), + replace_in_file(self, os.path.join(self._source_subfolder, "Makefile.in"), "echo '#define PKGDATADIR \"$(pkgdatadir)\"';", "echo '#define PKGDATADIR \"$(shell cygpath -m \"$(pkgdatadir)\")\"';") - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), + replace_in_file(self, os.path.join(self._source_subfolder, "Makefile.in"), "echo '#define DATADIR \"$(datadir)\"';", "echo '#define DATADIR \"$(shell cygpath -m \"$(datadir)\")\"';") - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), + replace_in_file(self, os.path.join(self._source_subfolder, "Makefile.in"), "echo '#define DATAROOTDIR \"$(datarootdir)\"';", "echo '#define DATAROOTDIR \"$(shell cygpath -m \"$(datarootdir)\")\"';") - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), + replace_in_file(self, os.path.join(self._source_subfolder, "Makefile.in"), "dist_man_MANS = $(top_srcdir)/doc/bison.1", "dist_man_MANS =") - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "yacc.in"), + replace_in_file(self, os.path.join(self._source_subfolder, "src", "yacc.in"), "@prefix@", "${}_ROOT".format(self.name.upper())) - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "yacc.in"), + replace_in_file(self, os.path.join(self._source_subfolder, "src", "yacc.in"), "@bindir@", "${}_ROOT/bin".format(self.name.upper())) diff --git a/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch b/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch new file mode 100644 index 0000000000000..b40517e5083c9 --- /dev/null +++ b/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch @@ -0,0 +1,29 @@ +From dffa2a21edeba243ef76b75e0c2081ec15fe95bd Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 3 Apr 2019 19:48:12 +0700 +Subject: [PATCH 3/4] 0003 + +--- + lib/spawn-pipe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c +index 3af5167..09e9cad 100644 +--- a/lib/spawn-pipe.c ++++ b/lib/spawn-pipe.c +@@ -213,10 +213,10 @@ create_pipe (const char *progname, + xalloc_die (); + + if (pipe_stdout) +- if (pipe2_safer (ifd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ifd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) +- if (pipe2_safer (ofd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ofd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + /* Data flow diagram: + * +-- +2.7.4.windows.1 + diff --git a/recipes/bison/config.yml b/recipes/bison/config.yml index c06b3140cfec4..7e22e455ae51e 100644 --- a/recipes/bison/config.yml +++ b/recipes/bison/config.yml @@ -1,4 +1,6 @@ versions: + "3.8.2": + folder: all "3.7.6": folder: all "3.7.1": From 39cbee23a4ce1e48f818abdf81e149966b819b5d Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Wed, 28 Sep 2022 13:51:15 +0200 Subject: [PATCH 225/561] (#13092) [bot] Add Access Request users (2022-09-22) --- .c3i/authorized_users.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 9b5da3fce5e98..71549ca17030b 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -941,3 +941,4 @@ authorized_users: - "sproberts92" - "madhat1" - "vince-cheung" + - "mariopil" From 7898fa80e40fb6a9bbe986e618006f48e0c32e24 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 28 Sep 2022 14:06:10 +0200 Subject: [PATCH 226/561] (#13101) github_config: add an action to validate markdown links * github_config: add an action to validate markdown links * no fails in CCI * add encoding headers to support github webpages * Update mlc_config.json --- .github/workflows/marldown-links.yml | 25 +++++++++++++++++++++++++ .github/workflows/mlc_config.json | 13 +++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/marldown-links.yml create mode 100644 .github/workflows/mlc_config.json diff --git a/.github/workflows/marldown-links.yml b/.github/workflows/marldown-links.yml new file mode 100644 index 0000000000000..63b30bcfe82a8 --- /dev/null +++ b/.github/workflows/marldown-links.yml @@ -0,0 +1,25 @@ +name: Check Markdown links + +on: [push, pull_request] + +jobs: + markdown-link-check-push: + if: github.event_name == 'push' && github.repository_owner != 'conan-io' # We do not want to see red in CCI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + config-file: .github/workflows/mlc_config.json + + markdown-link-check-pr: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + config-file: .github/workflows/mlc_config.json + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + check-modified-files-only: 'yes' diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json new file mode 100644 index 0000000000000..d16005bb86641 --- /dev/null +++ b/.github/workflows/mlc_config.json @@ -0,0 +1,13 @@ +{ + "retryOn429": true, + "retryCount": 5, + "fallbackRetryDelay": "30s", + "httpHeaders": [ + { + "urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"], + "headers": { + "Accept-Encoding": "zstd, br, gzip, deflate" + } + } + ] +} From cef290e685aea5351027083e7ef399aff0a85be2 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 28 Sep 2022 14:30:42 +0200 Subject: [PATCH 227/561] (#13125) vulkan-headers: add resdirs in vulkanregistry components --- recipes/vulkan-headers/all/conanfile.py | 9 ++++----- recipes/vulkan-headers/all/test_package/conanfile.py | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/vulkan-headers/all/conanfile.py b/recipes/vulkan-headers/all/conanfile.py index 75fb63bbf7938..2926437171c3e 100644 --- a/recipes/vulkan-headers/all/conanfile.py +++ b/recipes/vulkan-headers/all/conanfile.py @@ -16,12 +16,12 @@ class VulkanHeadersConan(ConanFile): 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) @@ -38,13 +38,12 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "VulkanHeaders") self.cpp_info.components["vulkanheaders"].set_property("cmake_target_name", "Vulkan::Headers") self.cpp_info.components["vulkanheaders"].bindirs = [] - self.cpp_info.components["vulkanheaders"].frameworkdirs = [] self.cpp_info.components["vulkanheaders"].libdirs = [] self.cpp_info.components["vulkanregistry"].set_property("cmake_target_name", "Vulkan::Registry") self.cpp_info.components["vulkanregistry"].includedirs = [os.path.join("res", "vulkan", "registry")] self.cpp_info.components["vulkanregistry"].bindirs = [] - self.cpp_info.components["vulkanregistry"].frameworkdirs = [] self.cpp_info.components["vulkanregistry"].libdirs = [] + self.cpp_info.components["vulkanregistry"].resdirs = ["res"] self.cpp_info.filenames["cmake_find_package"] = "VulkanHeaders" self.cpp_info.filenames["cmake_find_package_multi"] = "VulkanHeaders" diff --git a/recipes/vulkan-headers/all/test_package/conanfile.py b/recipes/vulkan-headers/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/vulkan-headers/all/test_package/conanfile.py +++ b/recipes/vulkan-headers/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() From da7bd9c014fb317625084a1af482dc9c4dff53eb Mon Sep 17 00:00:00 2001 From: chausner <15180557+chausner@users.noreply.github.com> Date: Wed, 28 Sep 2022 15:26:56 +0200 Subject: [PATCH 228/561] (#13128) concurrencpp: Update to 0.1.5 * Update concurrencpp to 0.1.5 * Disable apple-clang Co-authored-by: chausner --- recipes/concurrencpp/all/conandata.yml | 6 ++++++ recipes/concurrencpp/all/conanfile.py | 3 +++ .../all/patches/directory-name-0.1.5.patch | 14 ++++++++++++++ recipes/concurrencpp/config.yml | 2 ++ 4 files changed, 25 insertions(+) create mode 100644 recipes/concurrencpp/all/patches/directory-name-0.1.5.patch diff --git a/recipes/concurrencpp/all/conandata.yml b/recipes/concurrencpp/all/conandata.yml index d56e8bf7aee60..1ea38721cc28a 100644 --- a/recipes/concurrencpp/all/conandata.yml +++ b/recipes/concurrencpp/all/conandata.yml @@ -1,8 +1,14 @@ sources: + "0.1.5": + url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.5.tar.gz" + sha256: "330150ebe11b3d30ffcb3efdecc184a34cf50a6bd43b68e294a496225d286651" "0.1.4": url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.4.tar.gz" sha256: "3ad9424f975b766accc6eaedf4acfe1a20b5fdbb57fa3ae71f400e13d471e86f" patches: + "0.1.5": + - patch_file: "patches/cmake-min-version.patch" + - patch_file: "patches/directory-name-0.1.5.patch" "0.1.4": - patch_file: "patches/cmake-min-version.patch" - patch_file: "patches/directory-name.patch" diff --git a/recipes/concurrencpp/all/conanfile.py b/recipes/concurrencpp/all/conanfile.py index afde9cc0d91a3..b561687e537bb 100644 --- a/recipes/concurrencpp/all/conanfile.py +++ b/recipes/concurrencpp/all/conanfile.py @@ -55,6 +55,9 @@ def validate(self): raise ConanInvalidConfiguration("concurrencpp does not support shared builds with Visual Studio") if self.info.settings.compiler == "gcc": raise ConanInvalidConfiguration("gcc is not supported by concurrencpp") + if Version(self.version) >= "0.1.5" and self.info.settings.compiler == "apple-clang": + # apple-clang does not seem to support the C++20 synchronization library which concurrencpp 0.1.5 depends on + raise ConanInvalidConfiguration("apple-clang is not supported by concurrencpp 0.1.5 and higher") minimum_version = self._minimum_compilers_version.get( str(self.info.settings.compiler), False diff --git a/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch b/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch new file mode 100644 index 0000000000000..73d77806a9b8a --- /dev/null +++ b/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -104,8 +104,8 @@ include(CMakePackageConfigHelpers) + include(CMakePackageConfigHelpers) + include(GNUInstallDirs) + +-set(concurrencpp_directory "concurrencpp-${PROJECT_VERSION}") +-set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}/${concurrencpp_directory}") ++set(concurrencpp_directory "concurrencpp") ++set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}") + + install(TARGETS concurrencpp + EXPORT concurrencppTargets diff --git a/recipes/concurrencpp/config.yml b/recipes/concurrencpp/config.yml index 051f2438869fd..5fafcacd7c8fb 100644 --- a/recipes/concurrencpp/config.yml +++ b/recipes/concurrencpp/config.yml @@ -1,3 +1,5 @@ versions: + "0.1.5": + folder: all "0.1.4": folder: all From 5ca523f1ac0e7f9d81668ea46f012af3da4bcb62 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 28 Sep 2022 15:47:14 +0200 Subject: [PATCH 229/561] (#13135) m4: conan v2 support * conan v2 support * fix mingw build for 1.4.19 * also add M4 to runenv_info * set win_bash in build_requirements * call VirtualBuildEnv before AutotoolsToolchain * move env vars generation before AutotoolsToolchain --- recipes/m4/all/conandata.yml | 13 +- recipes/m4/all/conanfile.py | 163 +++++++++--------- ....19-0004-disable-hardening-in-source.patch | 16 ++ recipes/m4/all/test_package/conanfile.py | 33 ++-- recipes/m4/all/test_v1_package/conanfile.py | 41 +++++ 5 files changed, 150 insertions(+), 116 deletions(-) create mode 100644 recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch create mode 100644 recipes/m4/all/test_v1_package/conanfile.py diff --git a/recipes/m4/all/conandata.yml b/recipes/m4/all/conandata.yml index add3c40a064ae..ce596798ca3a9 100644 --- a/recipes/m4/all/conandata.yml +++ b/recipes/m4/all/conandata.yml @@ -8,27 +8,16 @@ sources: patches: "1.4.19": - patch_file: "patches/1.4.19-0001-open-files-in-binary-mode.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.19-0002-ar-lib.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.19-0003-msvc-debug-assertion.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.4.19-0004-disable-hardening-in-source.patch" "1.4.18": - patch_file: "patches/1.4.18-0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.18-0002-fflush-be-more-paranoid-about-libio.h-change.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.18-0004-fix-checks.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.18-0005-vasnprintf-Fix-for-MSVC-14.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.18-0006-manywarnings-update-for-gcc-7.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.18-0007-vasnprintf-port-to-macos-10.13.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.18-0008-open-files-in-binary-mode.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.18-0009-disable-hardening-in-source.patch" - base_path: "source_subfolder" - patch_file: "patches/1.4.18-0010-c-stack-stop-using-SIGSTKSZ.patch" - base_path: "source_subfolder" diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py index 65f289cb47abe..401139dc39fee 100644 --- a/recipes/m4/all/conanfile.py +++ b/recipes/m4/all/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from contextlib import contextmanager -import functools +from conan import ConanFile +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class M4Conan(ConanFile): @@ -15,116 +19,105 @@ class M4Conan(ConanFile): license = "GPL-3.0-only" settings = "os", "arch", "compiler", "build_type" - exports_sources = "patches/*.patch", - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _is_msvc(self): - return self.settings.compiler == "Visual Studio" or self.settings.compiler == "msvc" + def export_sources(self): + export_conandata_patches(self) - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.settings.compiler + def build_requirements(self): + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + self.win_bash = True + def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @functools.lru_cache(1) - def _configure_autotools(self): - conf_args = [] - autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows") - build_canonical_name = None - host_canonical_name = None - if self._is_msvc: - # The somewhat older configure script of m4 does not understand the canonical names of Visual Studio - build_canonical_name = False - host_canonical_name = False - autotools.flags.append("-FS") + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + env = Environment() + env.prepend_path("PATH", self.source_folder) + env.vars(self).save_script("m4buildenv_help2man_trick") + + if is_msvc(self): + env = Environment() + env.define_path("AR", f"{unix_path(self, self.source_folder)}/build-aux/ar-lib lib") + env.define("LD", "link") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("m4buildenv_msvc_for_autotools") + + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cflags.append("-FS") # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug # Visual Studio does not support the %n format flag: # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string, # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output. - conf_args.extend(["gl_cv_func_printf_directive_n=no", "gl_cv_func_snprintf_directive_n=no", "gl_cv_func_snprintf_directive_n=no"]) + tc.configure_args.extend([ + "gl_cv_func_printf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + ]) if self.settings.build_type in ("Debug", "RelWithDebInfo"): - autotools.link_flags.append("-PDB") + tc.extra_ldflags.append("-PDB") elif self.settings.compiler == "clang": - if tools.Version(self.version) < "1.4.19": - autotools.flags.extend(["-rtlib=compiler-rt", "-Wno-unused-command-line-argument"]) - if self.settings.os == 'Windows': - conf_args.extend(["ac_cv_func__set_invalid_parameter_handler=yes"]) - - autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build_canonical_name, host=host_canonical_name) - return autotools - - @contextmanager - def _build_context(self): - env = {"PATH": [os.path.abspath(self._source_subfolder)]} - if self._is_msvc: - with tools.vcvars(self.settings): - env.update({ - "AR": "{}/build-aux/ar-lib lib".format(tools.unix_path(self._source_subfolder)), - "CC": "cl -nologo", - "CXX": "cl -nologo", - "LD": "link", - "NM": "dumpbin -symbols", - "OBJDUMP": ":", - "RANLIB": ":", - "STRIP": ":", - }) - with tools.environment_append(env): - yield - else: - with tools.environment_append(env): - yield + if Version(self.version) < "1.4.19": + tc.extra_cflags.extend([ + "-rtlib=compiler-rt", + "-Wno-unused-command-line-argument", + ]) + if self.settings.os == "Windows": + tc.configure_args.append("ac_cv_func__set_invalid_parameter_handler=yes") + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) + # dummy file for configure + help2man = os.path.join(self.source_folder, "help2man") + save(self, help2man, "#!/usr/bin/env bash\n:") + if os.name == "posix": + os.chmod(help2man, os.stat(help2man).st_mode | 0o111) def build(self): - with tools.chdir(self._source_subfolder): - tools.save("help2man", '#!/usr/bin/env bash\n:') - if os.name == 'posix': - os.chmod("help2man", os.stat("help2man").st_mode | 0o111) self._patch_sources() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() - if tools.get_env("CONAN_RUN_TESTS", False): - self.output.info("Running m4 checks...") - with tools.chdir("tests"): - autotools.make(target="check") + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) - + # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path bin_ext = ".exe" if self.settings.os == "Windows" else "" - m4_bin = os.path.join(self.package_folder, "bin", "m4{}".format(bin_ext)).replace("\\", "/") + m4_bin = os.path.join(self.package_folder, "bin", f"m4{bin_ext}").replace("\\", "/") + self.runenv_info.define_path("M4", m4_bin) + self.buildenv_info.define_path("M4", m4_bin) - # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path - self.output.info("Setting M4 environment variable: {}".format(m4_bin)) + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.PATH.append(bin_path) self.env_info.M4 = m4_bin diff --git a/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch b/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch new file mode 100644 index 0000000000000..9386ee55aedce --- /dev/null +++ b/recipes/m4/all/patches/1.4.19-0004-disable-hardening-in-source.patch @@ -0,0 +1,16 @@ +This requires linking to ssp on some systems, which might not always present. +If this is really desired: +* add `-lssp` to LDFLAGS, and +* add `-D_FORTIFY_SOURCE=2` to CPPFLAGS/CFLAGS + +--- a/lib/config.hin ++++ b/lib/config.hin +@@ -198,7 +198,7 @@ + /* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting newer glibc. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ +- # define _FORTIFY_SOURCE 2 ++ //# define _FORTIFY_SOURCE 2 + #endif + + diff --git a/recipes/m4/all/test_package/conanfile.py b/recipes/m4/all/test_package/conanfile.py index 5351f6a04f5ac..22e16b15f8118 100644 --- a/recipes/m4/all/test_package/conanfile.py +++ b/recipes/m4/all/test_package/conanfile.py @@ -1,5 +1,5 @@ -from conans import ConanFile, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.tools.files import save from io import StringIO import os import textwrap @@ -7,13 +7,18 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" @property def _m4_input_path(self): return os.path.join(self.build_folder, "input.m4") + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + def build(self): - tools.save(self._m4_input_path, textwrap.dedent("""\ + save(self, self._m4_input_path, textwrap.dedent("""\ m4_define(NAME1, `Harry, Jr.') m4_define(NAME2, `Sally') m4_define(MET, `$1 met $2') @@ -21,21 +26,11 @@ def build(self): """)) def test(self): - if hasattr(self, "settings_build"): - exe_suffix = ".exe" if self.settings.os == "Windows" else "" - m4_bin = os.path.join(self.deps_cpp_info["m4"].rootpath, "bin", "m4" + exe_suffix) - else: - m4_bin = tools.get_env("M4") - if m4_bin is None or not m4_bin.startswith(self.deps_cpp_info["m4"].rootpath): - raise ConanException("M4 environment variable not set") - - if not tools.cross_building(self, skip_x64_x86=True): - self.run("{} --version".format(m4_bin), run_environment=True) - self.run("{} -P {}".format(m4_bin, self._m4_input_path)) - - self.run("m4 -R {0}/frozen.m4f {0}/test.m4".format(self.source_folder), run_environment=True) + self.run("m4 --version") + self.run(f"m4 -P {self._m4_input_path}") - output = StringIO() - self.run("{} -P {}".format(m4_bin, self._m4_input_path), output=output) + self.run(f"m4 -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4") - assert "Harry, Jr. met Sally" in output.getvalue() + output = StringIO() + self.run(f"m4 -P {self._m4_input_path}", output=output) + assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/recipes/m4/all/test_v1_package/conanfile.py b/recipes/m4/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..23409570c2d3d --- /dev/null +++ b/recipes/m4/all/test_v1_package/conanfile.py @@ -0,0 +1,41 @@ +from conans import ConanFile, tools +from conans.errors import ConanException +from io import StringIO +import os +import textwrap + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + @property + def _m4_input_path(self): + return os.path.join(self.build_folder, "input.m4") + + def build(self): + tools.save(self._m4_input_path, textwrap.dedent("""\ + m4_define(NAME1, `Harry, Jr.') + m4_define(NAME2, `Sally') + m4_define(MET, `$1 met $2') + MET(`NAME1', `NAME2') + """)) + + def test(self): + if hasattr(self, "settings_build"): + exe_suffix = ".exe" if self.settings.os == "Windows" else "" + m4_bin = os.path.join(self.deps_cpp_info["m4"].rootpath, "bin", "m4" + exe_suffix) + else: + m4_bin = tools.get_env("M4") + if m4_bin is None or not m4_bin.startswith(self.deps_cpp_info["m4"].rootpath): + raise ConanException("M4 environment variable not set") + + if not tools.cross_building(self, skip_x64_x86=True): + self.run("{} --version".format(m4_bin), run_environment=True) + self.run("{} -P {}".format(m4_bin, self._m4_input_path)) + + self.run("m4 -R {0}/frozen.m4f {0}/test.m4".format(os.path.join(self.source_folder, os.pardir, "test_package"), run_environment=True)) + + output = StringIO() + self.run("{} -P {}".format(m4_bin, self._m4_input_path), output=output) + + assert "Harry, Jr. met Sally" in output.getvalue() From 45d9dc5655f7072551b9a96acc6bda1bf7605bc7 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Sep 2022 23:05:47 +0900 Subject: [PATCH 230/561] (#13136) base64: add version 0.5.0 and support conan v2 * base64: add version 0.5.0 and support conan v2 * use export_conandata_patches * add patch property * remove "---" * fix source file * fix for msvc build * support shared in 0.5.0 * add validation for shared * delete fPIC when shared is True * fix package_info condition --- recipes/base64/all/CMakeLists.txt | 7 - recipes/base64/all/conandata.yml | 21 ++- recipes/base64/all/conanfile.py | 146 +++++++++++------- .../{make.patch => 0.4.0-0001-make.patch} | 0 .../{cmake.patch => 0.4.0-0002-cmake.patch} | 0 .../base64/all/patches/0.5.0-0001-make.patch | 14 ++ .../base64/all/test_package/CMakeLists.txt | 10 +- recipes/base64/all/test_package/conanfile.py | 23 ++- .../{example.c => test_package.c} | 0 .../base64/all/test_v1_package/CMakeLists.txt | 11 ++ .../base64/all/test_v1_package/conanfile.py | 18 +++ recipes/base64/config.yml | 3 +- 12 files changed, 174 insertions(+), 79 deletions(-) delete mode 100644 recipes/base64/all/CMakeLists.txt rename recipes/base64/all/patches/{make.patch => 0.4.0-0001-make.patch} (100%) rename recipes/base64/all/patches/{cmake.patch => 0.4.0-0002-cmake.patch} (100%) create mode 100644 recipes/base64/all/patches/0.5.0-0001-make.patch rename recipes/base64/all/test_package/{example.c => test_package.c} (100%) create mode 100644 recipes/base64/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/base64/all/test_v1_package/conanfile.py diff --git a/recipes/base64/all/CMakeLists.txt b/recipes/base64/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f..0000000000000 --- a/recipes/base64/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/base64/all/conandata.yml b/recipes/base64/all/conandata.yml index 4a9e80d3b3b00..6ebaff03fb45d 100644 --- a/recipes/base64/all/conandata.yml +++ b/recipes/base64/all/conandata.yml @@ -1,10 +1,19 @@ sources: + "0.5.0": + url: "https://github.com/aklomp/base64/archive/v0.5.0.tar.gz" + sha256: "b21be58a90d31302ba86056db7ef77a481393b9359c505be5337d7d54e8a0559" "0.4.0": - sha256: 1fce54059c504b2604c22c20cd930444a71b3340fc81334c037da63976d92002 - url: https://github.com/aklomp/base64/archive/v0.4.0.tar.gz + url: "https://github.com/aklomp/base64/archive/v0.4.0.tar.gz" + sha256: "1fce54059c504b2604c22c20cd930444a71b3340fc81334c037da63976d92002" patches: + "0.5.0": + - patch_file: "patches/0.5.0-0001-make.patch" + patch_description: "add library taget" + patch_type: "conan" "0.4.0": - - base_path: "source_subfolder" - patch_file: "patches/make.patch" - - base_path: "source_subfolder" - patch_file: "patches/cmake.patch" + - patch_file: "patches/0.4.0-0001-make.patch" + patch_description: "add library taget" + patch_type: "conan" + - patch_file: "patches/0.4.0-0002-cmake.patch" + patch_description: "provide CMakeLists.txt for MSVC" + patch_type: "conan" diff --git a/recipes/base64/all/conanfile.py b/recipes/base64/all/conanfile.py index 6db47a061d928..d56ae8c5bcf10 100644 --- a/recipes/base64/all/conanfile.py +++ b/recipes/base64/all/conanfile.py @@ -1,85 +1,125 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import Environment +from conan.tools.files import copy, get, apply_conandata_patches, chdir, export_conandata_patches, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + import os -from conans import ConanFile, AutoToolsBuildEnvironment, CMake, tools +required_conan_version = ">=1.52.0" class Base64Conan(ConanFile): name = "base64" + description = "Fast Base64 stream encoder/decoder" license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/aklomp/base64" - description = "Fast Base64 stream encoder/decoder" - topics = ("base64", "codec") - exports_sources = "patches/**", "CMakeLists.txt" - generators = "cmake" + topics = ("base64", "codec", "encoder", "decoder") settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False] + "shared": [True, False], + "fPIC": [True, False], } default_options = { - "fPIC": True + "shared": False, + "fPIC": True, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == 'Windows': del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass - def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + def layout(self): + if self._use_cmake: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure(build_folder=self._build_subfolder) - return cmake + def validate(self): + if Version(self.version) < "0.5.0" and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support build shared.") - def _build_cmake(self): - cmake = self._configure_cmake() - cmake.build(target="base64") + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + @property + def _use_cmake(self): + return is_msvc(self) or Version(self.version) >= "0.5.0" - def _build_autotools(self): - autotools = AutoToolsBuildEnvironment(self) - if self.settings.arch == "x86" or self.settings.arch == "x86_64": - extra_env = { - "AVX2_CFLAGS": "-mavx2", - "SSSE3_CFLAGS": "-mssse3", - "SSE41_CFLAGS": "-msse4.1", - "SSE42_CFLAGS": "-msse4.2", - "AVX_CFLAGS": "-mavx" - } + def generate(self): + if self._use_cmake: + tc = CMakeToolchain(self) + tc.generate() else: - # ARM-specific instructions can be enabled here - extra_env = {} - with tools.environment_append(extra_env): - with tools.chdir(self._source_subfolder): - autotools.make(target="lib/libbase64.a") + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - self._patch_sources() - if self.settings.compiler == "Visual Studio": - self._build_cmake() + apply_conandata_patches(self) + if self._use_cmake: + cmake = CMake(self) + cmake.configure() + if Version(self.version) >= "0.5.0": + cmake.build() + else: + cmake.build(target="base64") else: - self._build_autotools() + env = Environment() + if self.settings.arch == "x86" or self.settings.arch == "x86_64": + env.append("AVX2_CFLAGS", "-mavx2") + env.append("SSSE3_CFLAGS", "-mssse3") + env.append("SSE41_CFLAGS", "-msse4.1") + env.append("SSE42_CFLAGS", "-msse4.2") + env.append("AVX_CFLAGS", "-mavx") + else: + # ARM-specific instructions can be enabled here + pass + with env.vars(self).apply(), \ + chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make(target="lib/libbase64.a") def package(self): - self.copy(pattern="*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="*.a", dst="lib", keep_path=False) - self.copy(pattern="*.lib", dst="lib", keep_path=False) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self._use_cmake: + cmake = CMake(self) + cmake.install() + if Version(self.version) >= "0.5.0": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib")) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + else: + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) def package_info(self): self.cpp_info.libs = ["base64"] + + if Version(self.version) >= "0.5.0" and not self.options.shared: + self.cpp_info.defines.append("BASE64_STATIC_DEFINE") diff --git a/recipes/base64/all/patches/make.patch b/recipes/base64/all/patches/0.4.0-0001-make.patch similarity index 100% rename from recipes/base64/all/patches/make.patch rename to recipes/base64/all/patches/0.4.0-0001-make.patch diff --git a/recipes/base64/all/patches/cmake.patch b/recipes/base64/all/patches/0.4.0-0002-cmake.patch similarity index 100% rename from recipes/base64/all/patches/cmake.patch rename to recipes/base64/all/patches/0.4.0-0002-cmake.patch diff --git a/recipes/base64/all/patches/0.5.0-0001-make.patch b/recipes/base64/all/patches/0.5.0-0001-make.patch new file mode 100644 index 0000000000000..f20d7ff2ec119 --- /dev/null +++ b/recipes/base64/all/patches/0.5.0-0001-make.patch @@ -0,0 +1,14 @@ +diff --git a/Makefile b/Makefile +index 2bb01e2..200ca73 100644 +--- a/Makefile ++++ b/Makefile +@@ -63,6 +63,9 @@ lib/libbase64.o: $(OBJS) + $(LD) -r -o $@ $^ + $(OBJCOPY) --keep-global-symbols=lib/exports.txt $@ + ++lib/libbase64.a: $(OBJS) ++ $(AR) rc $@ $^ ++ + lib/config.h: + @echo "#define HAVE_AVX2 $(HAVE_AVX2)" > $@ + @echo "#define HAVE_NEON32 $(HAVE_NEON32)" >> $@ diff --git a/recipes/base64/all/test_package/CMakeLists.txt b/recipes/base64/all/test_package/CMakeLists.txt index 48b855b8a30aa..195fdf269b250 100644 --- a/recipes/base64/all/test_package/CMakeLists.txt +++ b/recipes/base64/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(PackageTest C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package C) -add_executable(example example.c) -target_link_libraries(example ${CONAN_LIBS}) +find_package(base64 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE base64::base64) diff --git a/recipes/base64/all/test_package/conanfile.py b/recipes/base64/all/test_package/conanfile.py index 9a662bfeb73fe..a9fb96656f203 100644 --- a/recipes/base64/all/test_package/conanfile.py +++ b/recipes/base64/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 CppcodecTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "example") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/base64/all/test_package/example.c b/recipes/base64/all/test_package/test_package.c similarity index 100% rename from recipes/base64/all/test_package/example.c rename to recipes/base64/all/test_package/test_package.c diff --git a/recipes/base64/all/test_v1_package/CMakeLists.txt b/recipes/base64/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6c32de99d28f7 --- /dev/null +++ b/recipes/base64/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(base64 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE base64::base64) diff --git a/recipes/base64/all/test_v1_package/conanfile.py b/recipes/base64/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/base64/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/base64/config.yml b/recipes/base64/config.yml index 80f918766690c..d13fcfd021b7b 100644 --- a/recipes/base64/config.yml +++ b/recipes/base64/config.yml @@ -1,4 +1,5 @@ ---- versions: + "0.5.0": + folder: all "0.4.0": folder: all From dbf3db0ea40c73fca2a269ce81f184776c22fd3b Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 28 Sep 2022 16:24:57 +0200 Subject: [PATCH 231/561] (#13154) freeglut: use github artifacts * use github artifacts It is the official source. * enable new versions of gcc and clang * fixup Version usage --- recipes/freeglut/all/conandata.yml | 4 ++-- recipes/freeglut/all/conanfile.py | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/recipes/freeglut/all/conandata.yml b/recipes/freeglut/all/conandata.yml index def708014ba21..1b8ca276b4eda 100644 --- a/recipes/freeglut/all/conandata.yml +++ b/recipes/freeglut/all/conandata.yml @@ -1,7 +1,7 @@ sources: "3.2.2": sha256: "c5944a082df0bba96b5756dddb1f75d0cd72ce27b5395c6c1dde85c2ff297a50" - url: "http://downloads.sourceforge.net/freeglut/freeglut/freeglut-3.2.2.tar.gz" + url: "https://github.com/FreeGLUTProject/freeglut/releases/download/v3.2.2/freeglut-3.2.2.tar.gz" "3.2.1": sha256: "d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68" - url: "http://downloads.sourceforge.net/freeglut/freeglut/freeglut-3.2.1.tar.gz" + url: "https://github.com/FreeGLUTProject/freeglut/releases/download/v3.2.1/freeglut-3.2.1.tar.gz" diff --git a/recipes/freeglut/all/conanfile.py b/recipes/freeglut/all/conanfile.py index e5c9e6fa2e2ed..4fbf2e2eb4cf5 100644 --- a/recipes/freeglut/all/conanfile.py +++ b/recipes/freeglut/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conan.tools.files import get, rmdir, collect_libs +from conans import CMake import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.47.0" class freeglutConan(ConanFile): @@ -44,8 +47,6 @@ def _build_subfolder(self): def export_sources(self): self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) def config_options(self): if self.settings.os == "Windows": @@ -69,13 +70,14 @@ def validate(self): # and https://sourceforge.net/p/freeglut/bugs/218/ # also, it seems to require `brew cask install xquartz` raise ConanInvalidConfiguration("%s does not support macos" % self.name) - if (self.settings.compiler == "gcc" and self.settings.compiler.version >= tools.Version("10.0")) or \ - (self.settings.compiler == "clang" and self.settings.compiler.version >= tools.Version("11.0")): - # see https://github.com/dcnieho/FreeGLUT/issues/86 - raise ConanInvalidConfiguration("%s does not support gcc >= 10 and clang >= 11" % self.name) + if Version(self.version) < "3.2.2": + if (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) >= "10.0") or \ + (self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "11.0"): + # see https://github.com/dcnieho/FreeGLUT/issues/86 + raise ConanInvalidConfiguration("%s does not support gcc >= 10 and clang >= 11" % self.name) def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def _configure_cmake(self): @@ -107,8 +109,8 @@ def package(self): self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): config_target = "freeglut" if self.options.shared else "freeglut_static" @@ -122,7 +124,7 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", pkg_config) # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["freeglut_"].libs = tools.collect_libs(self) + self.cpp_info.components["freeglut_"].libs = collect_libs(self) if self.settings.os == "Linux": self.cpp_info.components["freeglut_"].system_libs.extend(["pthread", "m", "dl", "rt"]) elif self.settings.os == "Windows": From b4eef378c1a7bef79639b03edb3f8673fe6af5d5 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Sep 2022 23:45:49 +0900 Subject: [PATCH 232/561] (#13157) c4core: add version 0.1.10 and support conan v2 --- recipes/c4core/all/CMakeLists.txt | 7 -- recipes/c4core/all/conandata.yml | 17 ++++ recipes/c4core/all/conanfile.py | 95 ++++++++++--------- ...0.1.10-0001-make-fast_float-external.patch | 37 ++++++++ .../0.1.8-0001-make-fast_float-external.patch | 37 ++++++++ .../0.1.9-0001-make-fast_float-external.patch | 37 ++++++++ .../c4core/all/test_package/CMakeLists.txt | 10 +- recipes/c4core/all/test_package/conanfile.py | 21 ++-- .../c4core/all/test_v1_package/CMakeLists.txt | 12 +++ .../c4core/all/test_v1_package/conanfile.py | 18 ++++ recipes/c4core/config.yml | 2 + 11 files changed, 231 insertions(+), 62 deletions(-) delete mode 100644 recipes/c4core/all/CMakeLists.txt create mode 100644 recipes/c4core/all/patches/0.1.10-0001-make-fast_float-external.patch create mode 100644 recipes/c4core/all/patches/0.1.8-0001-make-fast_float-external.patch create mode 100644 recipes/c4core/all/patches/0.1.9-0001-make-fast_float-external.patch create mode 100644 recipes/c4core/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c4core/all/test_v1_package/conanfile.py diff --git a/recipes/c4core/all/CMakeLists.txt b/recipes/c4core/all/CMakeLists.txt deleted file mode 100644 index 29ce322870912..0000000000000 --- a/recipes/c4core/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper LANGUAGES CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/c4core/all/conandata.yml b/recipes/c4core/all/conandata.yml index 469f0c16b8b48..622bb4f50ac3a 100644 --- a/recipes/c4core/all/conandata.yml +++ b/recipes/c4core/all/conandata.yml @@ -1,7 +1,24 @@ sources: + "0.1.10": + url: "https://github.com/biojppm/c4core/releases/download/v0.1.10/c4core-0.1.10-src.tgz" + sha256: "e8ab4dedd0e20f86af7c69527cfbe8bc1cf72c84b7fbc0cfd420656f28ae20b2" "0.1.9": url: "https://github.com/biojppm/c4core/releases/download/v0.1.9/c4core-0.1.9-src.tgz" sha256: "818d82456b640d88527fe517e1fef88fe45d8fffb414492eddf54480ee222449" "0.1.8": url: "https://github.com/biojppm/c4core/releases/download/v0.1.8/c4core-0.1.8-src.tgz" sha256: "95c0663192c6bff7a098b50afcb05d22a34dd0fd8e6be2e1b61edad2b9675fde" + +patches: + "0.1.10": + - patch_file: "patches/0.1.10-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.1.9": + - patch_file: "patches/0.1.9-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.1.8": + - patch_file: "patches/0.1.8-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" diff --git a/recipes/c4core/all/conanfile.py b/recipes/c4core/all/conanfile.py index f253607e96591..03aeeafcf1505 100644 --- a/recipes/c4core/all/conanfile.py +++ b/recipes/c4core/all/conanfile.py @@ -1,9 +1,12 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rm, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.43.0" - +required_conan_version = ">=1.52.0" class C4CoreConan(ConanFile): name = "c4core" @@ -11,28 +14,24 @@ class C4CoreConan(ConanFile): "c4core is a library of low-level C++ utilities, written with " "low-latency projects in mind." ) - topics = ("utilities", "low-latency", ) + license = "MIT", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/biojppm/c4core" - license = "MIT", - + topics = ("utilities", "low-latency", ) settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "with_fast_float": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_fast_float": True, } - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package_multi" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -40,51 +39,61 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fast_float/3.4.0") + if self.options.with_fast_float: + self.requires("fast_float/3.5.1") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, "11") - ## clang with libc++ is not supported. It is already fixed at 2022-01-03. - if tools.Version(self.version) <= "0.1.8": - if (self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++"): - raise ConanInvalidConfiguration( - "{}/{} doesn't support clang with libc++".format(self.name, self.version), - ) + ## clang with libc++ is not supported. It is already fixed since 0.1.9. + if Version(self.version) <= "0.1.8": + if self.info.settings.compiler in ["clang", "apple-clang"] and \ + self.info.settings.compiler.get_safe("libcxx") == "libc++": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support clang with libc++") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["C4CORE_WITH_FASTFLOAT"] = bool(self.options.with_fast_float) + tc.generate() - def build(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "c4/ext/fast_float_all.h", "") - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "c4", "ext", "fast_float.hpp"), - '#include "c4/ext/fast_float_all.h"', - '#include "fast_float/fast_float.h"') + deps = CMakeDeps(self) + deps.generate() - cmake = self._configure_cmake() + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "include"), "*.natvis") + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.natvis", os.path.join(self.package_folder, "include")) def package_info(self): + self.cpp_info.libs = ["c4core"] + if not self.options.with_fast_float: + self.cpp_info.defines.append("C4CORE_NO_FAST_FLOAT") + self.cpp_info.set_property("cmake_file_name", "c4core") self.cpp_info.set_property("cmake_target_name", "c4core::c4core") - self.cpp_info.libs = ["c4core"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/c4core/all/patches/0.1.10-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.1.10-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..a530b3907baca --- /dev/null +++ b/recipes/c4core/all/patches/0.1.10-0001-make-fast_float-external.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2450e1..3f52516 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -72,7 +72,6 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -92,7 +91,10 @@ c4_add_library(c4core + SOURCES ${C4CORE_SRC_FILES} + ) + +-if(NOT C4CORE_WITH_FASTFLOAT) ++if(C4CORE_WITH_FASTFLOAT) ++ find_package(FastFloat REQUIRED CONFIG) ++ target_link_libraries(c4core PUBLIC "FastFloat::fast_float") ++else() + target_compile_definitions(c4core PUBLIC -DC4CORE_NO_FAST_FLOAT) + endif() + +diff --git a/src/c4/ext/fast_float.hpp b/src/c4/ext/fast_float.hpp +index 9e75b5e..64aa2a4 100644 +--- a/src/c4/ext/fast_float.hpp ++++ b/src/c4/ext/fast_float.hpp +@@ -15,7 +15,7 @@ + # pragma GCC diagnostic ignored "-Wuseless-cast" + #endif + +-#include "c4/ext/fast_float_all.h" ++#include "fast_float/fast_float.h" + + #ifdef _MSC_VER + # pragma warning(pop) diff --git a/recipes/c4core/all/patches/0.1.8-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.1.8-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..1e139fba70445 --- /dev/null +++ b/recipes/c4core/all/patches/0.1.8-0001-make-fast_float-external.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5bc4b09..ee7a0d8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -69,7 +69,6 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -89,7 +88,10 @@ c4_add_library(c4core + SOURCES ${C4CORE_SRC_FILES} + ) + +-if(NOT C4CORE_WITH_FASTFLOAT) ++if(C4CORE_WITH_FASTFLOAT) ++ find_package(FastFloat REQUIRED CONFIG) ++ target_link_libraries(c4core PUBLIC "FastFloat::fast_float") ++else() + target_compile_definitions(c4core PUBLIC -DC4CORE_NO_FAST_FLOAT) + endif() + +diff --git a/src/c4/ext/fast_float.hpp b/src/c4/ext/fast_float.hpp +index 9e75b5e..64aa2a4 100644 +--- a/src/c4/ext/fast_float.hpp ++++ b/src/c4/ext/fast_float.hpp +@@ -15,7 +15,7 @@ + # pragma GCC diagnostic ignored "-Wuseless-cast" + #endif + +-#include "c4/ext/fast_float_all.h" ++#include "fast_float/fast_float.h" + + #ifdef _MSC_VER + # pragma warning(pop) diff --git a/recipes/c4core/all/patches/0.1.9-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.1.9-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..ae4e2acd03d15 --- /dev/null +++ b/recipes/c4core/all/patches/0.1.9-0001-make-fast_float-external.patch @@ -0,0 +1,37 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index e9412de..7d11193 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -72,7 +72,6 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -92,7 +91,10 @@ c4_add_library(c4core + SOURCES ${C4CORE_SRC_FILES} + ) + +-if(NOT C4CORE_WITH_FASTFLOAT) ++if(C4CORE_WITH_FASTFLOAT) ++ find_package(FastFloat REQUIRED CONFIG) ++ target_link_libraries(c4core PUBLIC "FastFloat::fast_float") ++else() + target_compile_definitions(c4core PUBLIC -DC4CORE_NO_FAST_FLOAT) + endif() + +diff --git a/a/src/c4/ext/fast_float.hpp b/b/src/c4/ext/fast_float.hpp +index 9e75b5e..64aa2a4 100644 +--- a/a/src/c4/ext/fast_float.hpp ++++ b/b/src/c4/ext/fast_float.hpp +@@ -15,7 +15,7 @@ + # pragma GCC diagnostic ignored "-Wuseless-cast" + #endif + +-#include "c4/ext/fast_float_all.h" ++#include "fast_float/fast_float.h" + + #ifdef _MSC_VER + # pragma warning(pop) diff --git a/recipes/c4core/all/test_package/CMakeLists.txt b/recipes/c4core/all/test_package/CMakeLists.txt index d1195867914f9..62cfc706469cd 100644 --- a/recipes/c4core/all/test_package/CMakeLists.txt +++ b/recipes/c4core/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.8) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package CXX) find_package(c4core REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} c4core::c4core) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +target_link_libraries(${PROJECT_NAME} PRIVATE c4core::c4core) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/c4core/all/test_package/conanfile.py b/recipes/c4core/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/c4core/all/test_package/conanfile.py +++ b/recipes/c4core/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/c4core/all/test_v1_package/CMakeLists.txt b/recipes/c4core/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bfd5ba0ad4164 --- /dev/null +++ b/recipes/c4core/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(c4core REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE c4core::c4core) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/c4core/all/test_v1_package/conanfile.py b/recipes/c4core/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/c4core/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/c4core/config.yml b/recipes/c4core/config.yml index af17094a8755f..364da530085a9 100644 --- a/recipes/c4core/config.yml +++ b/recipes/c4core/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.10": + folder: all "0.1.9": folder: all "0.1.8": From 708da6337c00f9bedcfb7546c242ed0f94f96a45 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 28 Sep 2022 17:04:45 +0200 Subject: [PATCH 233/561] (#13158) 7zip: generate gcc11 binaries * 7zip: generate gcc11 binaries * Update conanfile.py * Update recipes/7zip/19.00/conanfile.py Co-authored-by: Uilian Ries * Update conanfile.py Co-authored-by: Uilian Ries --- recipes/7zip/19.00/conanfile.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/recipes/7zip/19.00/conanfile.py b/recipes/7zip/19.00/conanfile.py index 5bca7f358e5d4..d18ee2242a6e7 100644 --- a/recipes/7zip/19.00/conanfile.py +++ b/recipes/7zip/19.00/conanfile.py @@ -1,8 +1,10 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import download, chdir, replace_in_file +from conans import tools, AutoToolsBuildEnvironment import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class SevenZipConan(ConanFile): @@ -18,7 +20,7 @@ class SevenZipConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) - def configure(self): + def validate(self): if self.settings.os != "Windows": raise ConanInvalidConfiguration("Only Windows supported") if self.settings.arch not in ("x86", "x86_64"): @@ -28,21 +30,20 @@ def build_requirements(self): self.build_requires("lzma_sdk/9.20") if self.settings.compiler != "Visual Studio" and self._settings_build.os == "Windows" and "make" not in os.environ.get("CONAN_MAKE_PROGRAM", ""): - self.build_requires("make/4.2.1") + self.build_requires("make/4.3") def package_id(self): del self.info.settings.compiler def _uncompress_7z(self, filename): - self.run("7zr x {}".format(filename)) + self.run(f"7zr x {filename}") def source(self): from six.moves.urllib.parse import urlparse url = self.conan_data["sources"][self.version]["url"] filename = os.path.basename(urlparse(url).path) sha256 = self.conan_data["sources"][self.version]["sha256"] - tools.download(url, filename) - tools.check_sha256(filename, sha256) + download(self, url, filename, sha256) self._uncompress_7z(filename) os.unlink(filename) @@ -55,8 +56,8 @@ def _msvc_platform(self): def _build_msvc(self): with tools.vcvars(self.settings): - with tools.chdir(os.path.join("CPP", "7zip")): - self.run("nmake /f makefile PLATFORM=%s" % self._msvc_platform) + with chdir(self, os.path.join("CPP", "7zip")): + self.run(f"nmake /f makefile PLATFORM={self._msvc_platform}") def _build_autotools(self): # TODO: Enable non-Windows methods in configure @@ -65,15 +66,15 @@ def _build_autotools(self): if self.settings.os == "Windows" and self.settings.compiler == "gcc": extra_env["IS_MINGW"] = "1" with tools.environment_append(extra_env): - with tools.chdir(os.path.join("CPP", "7zip", "Bundles", "LzmaCon")): + with chdir(self, os.path.join("CPP", "7zip", "Bundles", "LzmaCon")): autotools.make(args=["-f", "makefile.gcc"], target="all") def _patch_sources(self): if self.settings.compiler == "Visual Studio": fn = os.path.join("CPP", "Build.mak") os.chmod(fn, 0o644) - tools.replace_in_file(fn, "-MT", "-{}".format(str(self.settings.compiler.runtime))) - tools.replace_in_file(fn, "-MD", "-{}".format(str(self.settings.compiler.runtime))) + replace_in_file(self, fn, "-MT", f"-{self.settings.compiler.runtime}") + replace_in_file(self, fn, "-MD", f"-{self.settings.compiler.runtime}") def build(self): self._patch_sources() @@ -93,5 +94,8 @@ def package(self): def package_info(self): bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.path.append(bin_path) + + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] From 0c8ae4d8376a7e5a28cd7dd142f3731336dff248 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Sep 2022 00:26:08 +0900 Subject: [PATCH 234/561] (#13160) wasmtime: add version 1.0.1 and support conan V2 * wasmtime: add version 1.0.0 and support conan V2 * add version 1.0.1 instread 1.0.0 and add Macos armv8 binary * fix url path in 1.0.1 aarch macos --- recipes/wasmtime/all/conandata.yml | 90 ++++++++----------- recipes/wasmtime/all/conanfile.py | 49 +++++----- .../wasmtime/all/test_package/CMakeLists.txt | 4 +- .../wasmtime/all/test_package/conanfile.py | 20 +++-- .../all/test_v1_package/CMakeLists.txt | 12 +++ .../wasmtime/all/test_v1_package/conanfile.py | 18 ++++ recipes/wasmtime/config.yml | 6 +- 7 files changed, 112 insertions(+), 87 deletions(-) create mode 100644 recipes/wasmtime/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wasmtime/all/test_v1_package/conanfile.py diff --git a/recipes/wasmtime/all/conandata.yml b/recipes/wasmtime/all/conandata.yml index 5941dc599896f..f988f4e2263c8 100644 --- a/recipes/wasmtime/all/conandata.yml +++ b/recipes/wasmtime/all/conandata.yml @@ -1,4 +1,34 @@ sources: + "1.0.1": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-windows-c-api.zip" + sha256: "7b8ae00997d3d6fef21d084141f843db9d2c562ca24aebccb5b20cdbba93c8c2" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-mingw-c-api.zip" + sha256: "ce5b516b3924fdf38e200cad2fd9438ac35bf7ddd734aea3e2dee8f319e275c3" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-linux-c-api.tar.xz" + sha256: "b481b015c8805acabf2d1aad3b005a8564ac11f3c5b360bbbf71ba0f03e2c067" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-linux-c-api.tar.xz" + sha256: "aa950e47fdff4970efb7a59a3ea9e96b965180f9e84be46280915086f0ad7519" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-s390x-linux-c-api.tar.xz" + sha256: "b197a1d8878ae98b2a6ca769bc89aeda9352cb516f94d5a8d84453666ba57ab6" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-macos-c-api.tar.xz" + sha256: "fc570e49cf3c4d66b69770ecee692e1cf27d0fa6a6363c83f3f5cca23ac9dc3b" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-macos-c-api.tar.xz" + sha256: "48fe254302c6519bf289a4d1385dd425a1c65c4dd521d88dc6a1fab6f025bd19" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-linux-c-api.tar.xz" + sha256: "aa950e47fdff4970efb7a59a3ea9e96b965180f9e84be46280915086f0ad7519" "0.39.1": Windows: "x86_64": @@ -22,6 +52,9 @@ sources: "x86_64": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-macos-c-api.tar.xz" sha256: "a045371654222d7eb29ca23520ebf64d8144ea8e1ae0b38df2f39cdeb83e3649" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-aarch64-macos-c-api.tar.xz" + sha256: "a5e0e3b1acf924771d84beec6462baa00d9a436df2d65748bcd202cb8470d267" Android: "armv8": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-aarch64-linux-c-api.tar.xz" @@ -49,6 +82,9 @@ sources: "x86_64": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-x86_64-macos-c-api.tar.xz" sha256: "651c41d4de8958caf80086bab46d0f326bbfa0f328f544a632df52b050f2776c" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-aarch64-macos-c-api.tar.xz" + sha256: "1e424122c73418c972287043a50555569afb09dc721fb6630503bf455cbd2856" Android: "armv8": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.38.0/wasmtime-v0.38.0-aarch64-linux-c-api.tar.xz" @@ -76,6 +112,9 @@ sources: "x86_64": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-x86_64-macos-c-api.tar.xz" sha256: "0f785932fc69105dcecbb2d7c1ceb0cd63dffa5e4b0b3f198c4c56118bdb4ecd" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-aarch64-macos-c-api.tar.xz" + sha256: "0a0f5fd2283f52b3ab725650a5dfc77a8bf53de962344fabc37418af9e5e407a" Android: "armv8": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.37.0/wasmtime-v0.37.0-aarch64-linux-c-api.tar.xz" @@ -188,54 +227,3 @@ sources: "armv8": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.32.0/wasmtime-v0.32.0-aarch64-linux-c-api.tar.xz" sha256: "6d9425829003a44c92af118ff2ae72a887e088ea6ac4a887ae315b41b5e96206" - "0.31.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.31.0/wasmtime-v0.31.0-x86_64-windows-c-api.zip" - sha256: "6514d891f0648f92291945acd2bde57427b7375d94fcb7655d7c0595c763ed51" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.31.0/wasmtime-v0.31.0-x86_64-mingw-c-api.zip" - sha256: "734fa254c65864bec5382f72a89788ba72961e472d5ec7b67b821be20d1aa3ab" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.31.0/wasmtime-v0.31.0-x86_64-linux-c-api.tar.xz" - sha256: "63c7c0d0862d4ac4640676b50e4f2d13d63485e8fa982779d02438095c06d52c" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.31.0/wasmtime-v0.31.0-aarch64-linux-c-api.tar.xz" - sha256: "2a6311ee4ec3d5a00fd656d2134cab277219e180b54694f31aeab705d11cb20c" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.31.0/wasmtime-v0.31.0-s390x-linux-c-api.tar.xz" - sha256: "5c5ef16543a80479d25ddf064c6668340b603be90269d1245478cfc0ae86c4ae" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.31.0/wasmtime-v0.31.0-x86_64-macos-c-api.tar.xz" - sha256: "4f191c3413dcaaba36253783b0c82113d554968f52d02befe4e0a9f1b97c7f34" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.31.0/wasmtime-v0.31.0-aarch64-linux-c-api.tar.xz" - sha256: "2a6311ee4ec3d5a00fd656d2134cab277219e180b54694f31aeab705d11cb20c" - "0.30.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.30.0/wasmtime-v0.30.0-x86_64-windows-c-api.zip" - sha256: "3180c482a9f83a3c07c12a72c6efce73cf02ccad50f918666c805003de6756a5" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.30.0/wasmtime-v0.30.0-x86_64-mingw-c-api.zip" - sha256: "557e774a7fb33de8f6eceda298cdfada7b6aaa7ad30c307d105c3aa74aef79fd" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.30.0/wasmtime-v0.30.0-x86_64-linux-c-api.tar.xz" - sha256: "bf197fedc9fd68f9d78f6b5781e99242e58cee090fef9024dc56fa3f961707fd" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.30.0/wasmtime-v0.30.0-aarch64-linux-c-api.tar.xz" - sha256: "9b9f1bce6c34968923aa8f90869931b5c610d4bc3d5884a5a2ec958c15017dc1" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.30.0/wasmtime-v0.30.0-x86_64-macos-c-api.tar.xz" - sha256: "6299f9cb37b23f4a2d51690a5343f56de271626036a945c8bbf063dab487435d" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.30.0/wasmtime-v0.30.0-aarch64-linux-c-api.tar.xz" - sha256: "9b9f1bce6c34968923aa8f90869931b5c610d4bc3d5884a5a2ec958c15017dc1" diff --git a/recipes/wasmtime/all/conanfile.py b/recipes/wasmtime/all/conanfile.py index 8156e75a8c727..a5da120b3befd 100644 --- a/recipes/wasmtime/all/conanfile.py +++ b/recipes/wasmtime/all/conanfile.py @@ -1,10 +1,12 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +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.microsoft import is_msvc + import os -import shutil -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class WasmtimeConan(ConanFile): @@ -49,11 +51,16 @@ def configure(self): del self.settings.compiler.cppstd del self.settings.compiler.runtime + def package_id(self): + del self.info.settings.compiler.version + if self.settings.compiler == "clang": + self.info.settings.compiler = "gcc" + def validate(self): compiler = self.settings.compiler min_version = self._minimum_compilers_version[str(compiler)] try: - if tools.Version(compiler.version) < min_version: + if Version(compiler.version) < min_version: msg = ( "{} requires C{} features which are not supported by compiler {} {} !!" ).format(self.name, self._minimum_cpp_standard, compiler, compiler.version) @@ -70,37 +77,33 @@ def validate(self): except KeyError: raise ConanInvalidConfiguration("Binaries for this combination of architecture/version/os are not available") - if tools.Version(self.version) <= "0.29.0": + if Version(self.version) <= "0.29.0": if (self.settings.compiler, self.settings.os) == ("gcc", "Windows") and self.options.shared: # https://github.com/bytecodealliance/wasmtime/issues/3168 raise ConanInvalidConfiguration("Shared mingw is currently not possible") - def package_id(self): - del self.info.settings.compiler.version - if self.settings.compiler == "clang": - self.info.settings.compiler = "gcc" - def build(self): # This is packaging binaries so the download needs to be in build - tools.get(**self.conan_data["sources"][self.version][self._sources_os_key][str(self.settings.arch)], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version][self._sources_os_key][str(self.settings.arch)], + destination=self.source_folder, strip_root=True) def package(self): - shutil.copytree(os.path.join(self.source_folder, "include"), - os.path.join(self.package_folder, "include")) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) srclibdir = os.path.join(self.source_folder, "lib") + dstlibdir = os.path.join(self.package_folder, "lib") + dstbindir = os.path.join(self.package_folder, "bin") if self.options.shared: - self.copy("wasmtime.dll.lib", src=srclibdir, dst="lib", keep_path=False) - self.copy("wasmtime.dll", src=srclibdir, dst="bin", keep_path=False) - self.copy("libwasmtime.dll.a", src=srclibdir, dst="lib", keep_path=False) - self.copy("libwasmtime.so*", src=srclibdir, dst="lib", keep_path=False) - self.copy("libwasmtime.dylib", src=srclibdir, dst="lib", keep_path=False) + copy(self, "wasmtime.dll.lib", dst=dstlibdir, src=srclibdir, keep_path=False) + copy(self, "wasmtime.dll", dst=dstbindir, src=srclibdir, keep_path=False) + copy(self, "libwasmtime.dll.a", dst=dstlibdir, src=srclibdir, keep_path=False) + copy(self, "libwasmtime.so*", dst=dstlibdir, src=srclibdir, keep_path=False) + copy(self, "libwasmtime.dylib", dst=dstlibdir, src=srclibdir, keep_path=False) else: - self.copy("wasmtime.lib", src=srclibdir, dst="lib", keep_path=False) - self.copy("libwasmtime.a", src=srclibdir, dst="lib", keep_path=False) + copy(self, "wasmtime.lib", dst=dstlibdir, src=srclibdir, keep_path=False) + copy(self, "libwasmtime.a", dst=dstlibdir, src=srclibdir, keep_path=False) - self.copy("LICENSE", dst="licenses", src=self.source_folder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) def package_info(self): if self.options.shared: diff --git a/recipes/wasmtime/all/test_package/CMakeLists.txt b/recipes/wasmtime/all/test_package/CMakeLists.txt index 9aef72b44e8f5..816132751a9fa 100644 --- a/recipes/wasmtime/all/test_package/CMakeLists.txt +++ b/recipes/wasmtime/all/test_package/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.8) -project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package C) find_package(wasmtime REQUIRED CONFIG) diff --git a/recipes/wasmtime/all/test_package/conanfile.py b/recipes/wasmtime/all/test_package/conanfile.py index 38f4483872d47..a9fbb7f543162 100644 --- a/recipes/wasmtime/all/test_package/conanfile.py +++ b/recipes/wasmtime/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -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", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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 +20,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wasmtime/all/test_v1_package/CMakeLists.txt b/recipes/wasmtime/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..64b9d82f8c453 --- /dev/null +++ b/recipes/wasmtime/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(wasmtime REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE wasmtime::wasmtime) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/wasmtime/all/test_v1_package/conanfile.py b/recipes/wasmtime/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wasmtime/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wasmtime/config.yml b/recipes/wasmtime/config.yml index c74ca85f0e898..807a611cb965c 100644 --- a/recipes/wasmtime/config.yml +++ b/recipes/wasmtime/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.1": + folder: all "0.39.1": folder: all "0.38.0": @@ -13,7 +15,3 @@ versions: folder: all "0.32.0": folder: all - "0.31.0": - folder: all - "0.30.0": - folder: all From 0b39b554509b9f29214380c83238281e27658cf5 Mon Sep 17 00:00:00 2001 From: Jacob Bandes-Storch Date: Wed, 28 Sep 2022 08:45:46 -0700 Subject: [PATCH 235/561] (#13163) mcap: add 0.3.0, 0.4.0, 0.5.0 * mcap: add 0.3.0 * upgrade to conan v2 * Add test_v1_package * fix dependency name * dynamically update license * add 0.4.0 as well * add 0.5.0 --- recipes/mcap/all/conandata.yml | 9 ++++++ recipes/mcap/all/conanfile.py | 29 ++++++++++++------- recipes/mcap/all/test_package/CMakeLists.txt | 11 +++---- recipes/mcap/all/test_package/conanfile.py | 15 ++++++---- .../mcap/all/test_v1_package/CMakeLists.txt | 12 ++++++++ recipes/mcap/all/test_v1_package/conanfile.py | 19 ++++++++++++ recipes/mcap/config.yml | 6 ++++ 7 files changed, 78 insertions(+), 23 deletions(-) create mode 100644 recipes/mcap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mcap/all/test_v1_package/conanfile.py diff --git a/recipes/mcap/all/conandata.yml b/recipes/mcap/all/conandata.yml index a12e743fc57b2..2c7f690cbdc21 100644 --- a/recipes/mcap/all/conandata.yml +++ b/recipes/mcap/all/conandata.yml @@ -8,3 +8,12 @@ sources: 0.1.2: url: https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.2/main.tar.gz sha256: 0f456d6c53730445c3dbf57afd285493cf748c66a02f77d6e48c075128fd0896 + 0.3.0: + url: https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.3.0/main.tar.gz + sha256: ef29ea4c09520b8aaa2d78ce5e79cbbcd87511ed14d6abf3c4b249ae67a4153b + 0.4.0: + url: https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.4.0/main.tar.gz + sha256: c0ab99e51005fa8b74fe9ca1ed23b205cf532b8b0723eedd243f35a28d7b466b + 0.5.0: + url: https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.5.0/main.tar.gz + sha256: 408e255a6c6419b16de38a9ecbdd9729d60adc657767b2d52a234d1da1185349 diff --git a/recipes/mcap/all/conanfile.py b/recipes/mcap/all/conanfile.py index 07e6eeb817206..52080826200a5 100644 --- a/recipes/mcap/all/conanfile.py +++ b/recipes/mcap/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools import files +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class McapConan(ConanFile): @@ -10,7 +13,7 @@ class McapConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/foxglove/mcap" description = "A C++ implementation of the MCAP file format" - license = "Apache-2.0" + license = "MIT" topics = ("mcap", "serialization", "deserialization", "recording") settings = ("os", "compiler", "build_type", "arch") @@ -25,26 +28,30 @@ def _source_package_path(self): return os.path.join(self._source_subfolder, "cpp", "mcap") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def requirements(self): self.requires("lz4/1.9.3") self.requires("zstd/1.5.2") - if tools.Version(self.version) < "0.1.1": + if Version(self.version) < "0.1.1": self.requires("fmt/8.1.1") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") - if self.settings.compiler == "apple-clang" and tools.Version(self.settings.compiler.version) <= 11: + check_min_cppstd(self, "17") + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) <= "11": raise ConanInvalidConfiguration("Compiler version is not supported, c++17 support is required") - if (self.settings.compiler == "gcc" or self.settings.compiler == "clang") and tools.Version(self.settings.compiler.version) <= 8: + if (self.settings.compiler in ("gcc", "clang")) and Version(self.settings.compiler.version) <= "8": raise ConanInvalidConfiguration("Compiler version is not supported, c++17 support is required") - if tools.Version(self.version) < "0.1.1" and self.settings.compiler == "Visual Studio": + if Version(self.version) < "0.1.1" and self.settings.compiler == "Visual Studio": raise ConanInvalidConfiguration("Visual Studio compiler support is added in 0.1.1") - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < 16: + if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) < "16": raise ConanInvalidConfiguration("Compiler version is not supported, c++17 support is required") + def configure(self): + if Version(self.version) < "0.3.0": + self.license = "Apache-2.0" + def package(self): self.copy("LICENSE", dst="licenses", src=self._source_package_path) self.copy("include/*", src=self._source_package_path) diff --git a/recipes/mcap/all/test_package/CMakeLists.txt b/recipes/mcap/all/test_package/CMakeLists.txt index 6ce93b65ccf57..9d5e985915dd3 100644 --- a/recipes/mcap/all/test_package/CMakeLists.txt +++ b/recipes/mcap/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(mcap REQUIRED CONFIG) -add_executable(test_package test_package.cpp) -set_target_properties(test_package PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) -target_link_libraries(test_package mcap::mcap) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mcap::mcap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mcap/all/test_package/conanfile.py b/recipes/mcap/all/test_package/conanfile.py index 005eae16e0474..14c16cdc02a92 100644 --- a/recipes/mcap/all/test_package/conanfile.py +++ b/recipes/mcap/all/test_package/conanfile.py @@ -1,10 +1,15 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = ("os", "arch", "compiler", "build_type") - generators = ("cmake", "cmake_find_package_multi") + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +17,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mcap/all/test_v1_package/CMakeLists.txt b/recipes/mcap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9cbae78f78b9 --- /dev/null +++ b/recipes/mcap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(mcap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mcap::mcap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mcap/all/test_v1_package/conanfile.py b/recipes/mcap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/mcap/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mcap/config.yml b/recipes/mcap/config.yml index 06a637acf5c81..af633986f7d13 100644 --- a/recipes/mcap/config.yml +++ b/recipes/mcap/config.yml @@ -5,3 +5,9 @@ versions: folder: all 0.1.2: folder: all + 0.3.0: + folder: all + 0.4.0: + folder: all + 0.5.0: + folder: all From 0a633ead8a70146437616e3dff68f97bf4af9ad4 Mon Sep 17 00:00:00 2001 From: chausner <15180557+chausner@users.noreply.github.com> Date: Wed, 28 Sep 2022 18:04:50 +0200 Subject: [PATCH 236/561] (#13164) drmp3: update to 0.6.34 * Update drmp3 to 0.6.34 * Update config.yml * Revert CMake target name change * Remove unnecessary source export * Revert "Remove unnecessary source export" This reverts commit 8b6cd2dcb5585ec80155c14745cc3249dd77a61e. Co-authored-by: chausner --- recipes/drmp3/all/CMakeLists.txt | 17 ++++--- recipes/drmp3/all/conandata.yml | 4 ++ recipes/drmp3/all/conanfile.py | 44 +++++++++---------- recipes/drmp3/all/test_package/CMakeLists.txt | 5 +-- recipes/drmp3/all/test_package/conanfile.py | 21 ++++++--- .../drmp3/all/test_v1_package/CMakeLists.txt | 11 +++++ .../drmp3/all/test_v1_package/conanfile.py | 17 +++++++ recipes/drmp3/config.yml | 2 + 8 files changed, 77 insertions(+), 44 deletions(-) create mode 100644 recipes/drmp3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/drmp3/all/test_v1_package/conanfile.py diff --git a/recipes/drmp3/all/CMakeLists.txt b/recipes/drmp3/all/CMakeLists.txt index c5aad107a6862..c44a0bb77d180 100644 --- a/recipes/drmp3/all/CMakeLists.txt +++ b/recipes/drmp3/all/CMakeLists.txt @@ -1,18 +1,17 @@ cmake_minimum_required(VERSION 3.4) -project(dr_mp3 C) +project(dr_mp3 LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +include(GNUInstallDirs) option(NO_SIMD "Build with define DR_MP3_NO_SIMD" OFF) option(NO_STDIO "Build with define DR_MP3_NO_STDIO" OFF) add_library(${CMAKE_PROJECT_NAME} dr_mp3.c) -target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE source_subfolder) +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRMP3_SRC_DIR}) set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES - PUBLIC_HEADER source_subfolder/dr_mp3.h + PUBLIC_HEADER ${DRMP3_SRC_DIR}/dr_mp3.h C_STANDARD 99 ) @@ -27,8 +26,8 @@ if(NO_STDIO) endif() install(TARGETS ${CMAKE_PROJECT_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - PUBLIC_HEADER DESTINATION include + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/recipes/drmp3/all/conandata.yml b/recipes/drmp3/all/conandata.yml index 70b1ddd16bfdf..a26d9e9dbb871 100644 --- a/recipes/drmp3/all/conandata.yml +++ b/recipes/drmp3/all/conandata.yml @@ -1,4 +1,8 @@ sources: + # NOTE: https://github.com/mackron/dr_libs/blob/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb/dr_mp3.h#L3 + "0.6.34": + url: https://github.com/mackron/dr_libs/archive/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb.zip + sha256: "077d6b29a78da5132065fcc9b44ca50e7e168b94250f2c25614101d3f808bcc1" # NOTE: https://github.com/mackron/dr_libs/blob/9497270f581f43e6b795ce5d98d8764861fb6a50/dr_mp3.h#L3 "0.6.32": url: https://github.com/mackron/dr_libs/archive/9497270f581f43e6b795ce5d98d8764861fb6a50.zip diff --git a/recipes/drmp3/all/conanfile.py b/recipes/drmp3/all/conanfile.py index fed3d6f624287..e21eeff31877c 100644 --- a/recipes/drmp3/all/conanfile.py +++ b/recipes/drmp3/all/conanfile.py @@ -1,6 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.46.0" class Drmp3Conan(ConanFile): @@ -10,7 +13,7 @@ class Drmp3Conan(ConanFile): topics = ("audio", "mp3", "sound") license = ("Unlicense", "MIT-0") url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -23,19 +26,10 @@ class Drmp3Conan(ConanFile): "no_simd": False, "no_stdio": False } - generators = "cmake" exports_sources = ["CMakeLists.txt", "dr_mp3.c"] _cmake = None - @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 @@ -46,25 +40,27 @@ def configure(self): del self.settings.compiler.cppstd del self.settings.compiler.libcxx + def layout(self): + cmake_layout(self) + def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["NO_SIMD"] = self.options.no_simd - self._cmake.definitions["NO_STDIO"] = self.options.no_stdio - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DRMP3_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["NO_SIMD"] = self.options.no_simd + tc.variables["NO_STDIO"] = self.options.no_stdio + tc.generate() def build(self): - cmake = self._configure_cmake() + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/drmp3/all/test_package/CMakeLists.txt b/recipes/drmp3/all/test_package/CMakeLists.txt index 3c9aefac6058f..b5b2e6102e202 100644 --- a/recipes/drmp3/all/test_package/CMakeLists.txt +++ b/recipes/drmp3/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(drmp3 CONFIG REQUIRED) diff --git a/recipes/drmp3/all/test_package/conanfile.py b/recipes/drmp3/all/test_package/conanfile.py index a145e03938e8e..3a8c6c5442b33 100644 --- a/recipes/drmp3/all/test_package/conanfile.py +++ b/recipes/drmp3/all/test_package/conanfile.py @@ -1,11 +1,18 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" -class Drmp3TestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +20,6 @@ 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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/drmp3/all/test_v1_package/CMakeLists.txt b/recipes/drmp3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..bfd7908ef1c6f --- /dev/null +++ b/recipes/drmp3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(drmp3 CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} drmp3::drmp3) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/drmp3/all/test_v1_package/conanfile.py b/recipes/drmp3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/drmp3/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/drmp3/config.yml b/recipes/drmp3/config.yml index a231e824ba399..dda44114b507b 100644 --- a/recipes/drmp3/config.yml +++ b/recipes/drmp3/config.yml @@ -1,3 +1,5 @@ versions: + "0.6.34": + folder: all "0.6.32": folder: all From 2bb5db0d7363b029bf71df7e7f2d512f9276516b Mon Sep 17 00:00:00 2001 From: chausner <15180557+chausner@users.noreply.github.com> Date: Wed, 28 Sep 2022 18:24:52 +0200 Subject: [PATCH 237/561] (#13165) drwav: update to 0.13.7 * Update drwav to 0.13.7 * Update config.yml * Revert CMake target name change * Remove unnecessary source export * Revert "Remove unnecessary source export" This reverts commit a16e4dea759e5ec2790532e9f4a68a99ea513d64. Co-authored-by: chausner --- recipes/drwav/all/CMakeLists.txt | 21 ++++--- recipes/drwav/all/conandata.yml | 4 ++ recipes/drwav/all/conanfile.py | 55 +++++++++---------- recipes/drwav/all/test_package/CMakeLists.txt | 5 +- recipes/drwav/all/test_package/conanfile.py | 21 ++++--- .../drwav/all/test_v1_package/CMakeLists.txt | 11 ++++ .../drwav/all/test_v1_package/conanfile.py | 17 ++++++ recipes/drwav/config.yml | 2 + 8 files changed, 88 insertions(+), 48 deletions(-) create mode 100644 recipes/drwav/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/drwav/all/test_v1_package/conanfile.py diff --git a/recipes/drwav/all/CMakeLists.txt b/recipes/drwav/all/CMakeLists.txt index 474406a6484d5..64cb2f4533122 100644 --- a/recipes/drwav/all/CMakeLists.txt +++ b/recipes/drwav/all/CMakeLists.txt @@ -1,18 +1,18 @@ cmake_minimum_required(VERSION 3.4) -project(dr_wav C) +project(dr_wav LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +include(GNUInstallDirs) option(NO_CONVERSION_API "Build with define DR_WAV_NO_CONVERSION_API" OFF) option(NO_STDIO "Build with define DR_WAV_NO_STDIO" OFF) +option(NO_WCHAR "Build with define DR_WAV_NO_WCHAR" OFF) add_library(${CMAKE_PROJECT_NAME} dr_wav.c) -target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE source_subfolder) +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRWAV_SRC_DIR}) set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES - PUBLIC_HEADER source_subfolder/dr_wav.h + PUBLIC_HEADER ${DRWAV_SRC_DIR}/dr_wav.h C_STANDARD 99 ) @@ -25,10 +25,13 @@ endif() if(NO_STDIO) target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_WAV_NO_STDIO) endif() +if(NO_WCHAR) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_WAV_NO_WCHAR) +endif() install(TARGETS ${CMAKE_PROJECT_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - PUBLIC_HEADER DESTINATION include + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/recipes/drwav/all/conandata.yml b/recipes/drwav/all/conandata.yml index 65fecfb0a75c8..449e35d180bee 100644 --- a/recipes/drwav/all/conandata.yml +++ b/recipes/drwav/all/conandata.yml @@ -1,4 +1,8 @@ sources: + # NOTE: https://github.com/mackron/dr_libs/blob/4f6da71ed357ade92dc91f00e6be7301ec9a82a3/dr_wav.h#L3 + "0.13.7": + url: https://github.com/mackron/dr_libs/archive/4f6da71ed357ade92dc91f00e6be7301ec9a82a3.zip + sha256: "0a77850ca558633e0516a68383481fb36823064256f2c50911056714420bc5b1" # NOTE: https://github.com/mackron/dr_libs/blob/15f37e3ab01654c1a3bc98cff2a9ca64e8296fa9/dr_wav.h#L3 "0.13.6": url: https://github.com/mackron/dr_libs/archive/15f37e3ab01654c1a3bc98cff2a9ca64e8296fa9.zip diff --git a/recipes/drwav/all/conanfile.py b/recipes/drwav/all/conanfile.py index e41ae45bae883..634d49129395e 100644 --- a/recipes/drwav/all/conanfile.py +++ b/recipes/drwav/all/conanfile.py @@ -1,6 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.46.0" class DrwavConan(ConanFile): @@ -10,32 +13,23 @@ class DrwavConan(ConanFile): topics = ("audio", "wav", "wave", "sound") license = ("Unlicense", "MIT-0") url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "no_conversion_api": [True, False], - "no_stdio": [True, False] + "no_stdio": [True, False], + "no_wchar": [True, False] } default_options = { "shared": False, "fPIC": True, "no_conversion_api": False, - "no_stdio": False + "no_stdio": False, + "no_wchar": False } - generators = "cmake" exports_sources = ["CMakeLists.txt", "dr_wav.c"] - _cmake = None - - @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 @@ -46,25 +40,28 @@ def configure(self): del self.settings.compiler.cppstd del self.settings.compiler.libcxx + def layout(self): + cmake_layout(self) + def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["NO_CONVERSION_API"] = self.options.no_conversion_api - self._cmake.definitions["NO_STDIO"] = self.options.no_stdio - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DRWAV_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["NO_CONVERSION_API"] = self.options.no_conversion_api + tc.variables["NO_STDIO"] = self.options.no_stdio + tc.variables["NO_WCHAR"] = self.options.no_wchar + tc.generate() def build(self): - cmake = self._configure_cmake() + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): @@ -75,3 +72,5 @@ def package_info(self): self.cpp_info.defines.append("DR_WAV_NO_CONVERSION_API") if self.options.no_stdio: self.cpp_info.defines.append("DR_WAV_NO_STDIO") + if self.options.no_wchar: + self.cpp_info.defines.append("DR_WAV_NO_WCHAR") diff --git a/recipes/drwav/all/test_package/CMakeLists.txt b/recipes/drwav/all/test_package/CMakeLists.txt index 1df2c3edd2222..8eb51f5f1843e 100644 --- a/recipes/drwav/all/test_package/CMakeLists.txt +++ b/recipes/drwav/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(drwav CONFIG REQUIRED) diff --git a/recipes/drwav/all/test_package/conanfile.py b/recipes/drwav/all/test_package/conanfile.py index bb25bb74037a3..3a8c6c5442b33 100644 --- a/recipes/drwav/all/test_package/conanfile.py +++ b/recipes/drwav/all/test_package/conanfile.py @@ -1,11 +1,18 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" -class DrwavTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +20,6 @@ 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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/drwav/all/test_v1_package/CMakeLists.txt b/recipes/drwav/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b7b4d6635b758 --- /dev/null +++ b/recipes/drwav/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(drwav CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} drwav::drwav) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/drwav/all/test_v1_package/conanfile.py b/recipes/drwav/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/drwav/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/drwav/config.yml b/recipes/drwav/config.yml index 6d9e481111084..6c8f065f79d49 100644 --- a/recipes/drwav/config.yml +++ b/recipes/drwav/config.yml @@ -1,3 +1,5 @@ versions: + "0.13.7": + folder: all "0.13.6": folder: all From 0e1bfbf7bf77115235426258bb571a7aabdd6e81 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Sep 2022 01:45:07 +0900 Subject: [PATCH 238/561] (#13180) osmanip: add version 4.2.1 and support conan v2 --- recipes/osmanip/all/CMakeLists.txt | 35 +++++---- recipes/osmanip/all/conandata.yml | 7 +- recipes/osmanip/all/conanfile.py | 78 +++++++++++-------- .../osmanip/all/test_package/CMakeLists.txt | 5 +- recipes/osmanip/all/test_package/conanfile.py | 19 +++-- .../all/test_v1_package/CMakeLists.txt | 12 +++ .../osmanip/all/test_v1_package/conanfile.py | 18 +++++ recipes/osmanip/config.yml | 2 + 8 files changed, 117 insertions(+), 59 deletions(-) create mode 100644 recipes/osmanip/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/osmanip/all/test_v1_package/conanfile.py diff --git a/recipes/osmanip/all/CMakeLists.txt b/recipes/osmanip/all/CMakeLists.txt index d2b860e0e9996..ae515532d7df7 100644 --- a/recipes/osmanip/all/CMakeLists.txt +++ b/recipes/osmanip/all/CMakeLists.txt @@ -1,28 +1,33 @@ cmake_minimum_required(VERSION 3.13) project(osmanip LANGUAGES CXX) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - find_package(arsenalgear REQUIRED CONFIG) add_library(osmanip) target_sources(osmanip PRIVATE - source_subfolder/src/graphics/canvas.cpp - source_subfolder/src/graphics/plot_2D.cpp + ${OSMANIP_SRC_DIR}/src/graphics/canvas.cpp + ${OSMANIP_SRC_DIR}/src/graphics/plot_2D.cpp + $<$: + ${OSMANIP_SRC_DIR}/src/manipulators/colsty.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/common.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/cursor.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/decorator.cpp + > + $<$,$>: + ${OSMANIP_SRC_DIR}/src/manipulators/colsty.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/common.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/cursor.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/printer.cpp + > $<$: - source_subfolder/src/manipulators/csmanip.cpp + ${OSMANIP_SRC_DIR}/src/manipulators/csmanip.cpp > - $<$: - source_subfolder/src/manipulators/printer.cpp - source_subfolder/src/manipulators/cursor.cpp - source_subfolder/src/manipulators/common.cpp - source_subfolder/src/manipulators/colsty.cpp + $<$: + ${OSMANIP_SRC_DIR}/src/progressbar/progress_bar.cpp > - source_subfolder/src/progressbar/progress_bar.cpp - source_subfolder/src/utility/windows.cpp + ${OSMANIP_SRC_DIR}/src/utility/windows.cpp ) -target_include_directories(osmanip PUBLIC source_subfolder/include/) +target_include_directories(osmanip PUBLIC ${OSMANIP_SRC_DIR}/include/) target_compile_features(osmanip PUBLIC cxx_std_17) set_target_properties(osmanip PROPERTIES PUBLIC_HEADER "${osmanip_inc}" @@ -44,6 +49,6 @@ install( ) install( - DIRECTORY source_subfolder/include/ + DIRECTORY ${OSMANIP_SRC_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/osmanip ) diff --git a/recipes/osmanip/all/conandata.yml b/recipes/osmanip/all/conandata.yml index 0006776795ddd..3812e99a092c4 100644 --- a/recipes/osmanip/all/conandata.yml +++ b/recipes/osmanip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.2.1": + url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.2.1.tar.gz" + sha256: "1d1ba3fac66edc7a7e4c480a0c080493d19193f9b63b70d417e2683f8741bf1c" "4.1.0": url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.1.0.tar.gz" sha256: "9830316fea29300aeebadb0cd6cddd6f291a8fa04c397bca9666d045815d1d53" @@ -8,6 +11,6 @@ sources: patches: "4.0.0": - # This patch is for function renaming on arsenalgear/1.2.2. - patch_file: "patches/0001-replace-runtime_error_func.patch" - base_path: "source_subfolder" + patch_description: "following function renaming on arsenalgear/1.2.2" + patch_type: "conan" diff --git a/recipes/osmanip/all/conanfile.py b/recipes/osmanip/all/conanfile.py index b15545e08eb49..c94cc31732659 100644 --- a/recipes/osmanip/all/conanfile.py +++ b/recipes/osmanip/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -required_conan_version = ">=1.33.0" +import os + +required_conan_version = ">=1.52.0" class OsmanipConan(ConanFile): name = "osmanip" @@ -20,16 +25,10 @@ class OsmanipConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake", "cmake_find_package_multi" - - @property - def _source_subfolder(self): - return "source_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -37,52 +36,65 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC # once removed by config_options, need try..except for a second del + except Exception: + pass def requirements(self): - self.requires("boost/1.79.0") + self.requires("boost/1.80.0") self.requires("arsenalgear/1.2.2") + @property + def _minimum_cpp_standard(self): + return 17 + @property def _compiler_required_cpp17(self): return { "Visual Studio": "16", + "msvc": "191", "gcc": "8", "clang": "7", "apple-clang": "12.0", } def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) - minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) + minimum_version = self._compiler_required_cpp17.get(str(self.info.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) + if Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") else: - self.output.warn("{0} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + self.output.warn(f"{self.ref} requires C++{self._minimum_cpp_standard}. Your compiler is unknown. Assuming it supports C++{self._minimum_cpp_standard}") + + def layout(self): + cmake_layout(self, src_folder="src") 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], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["OSMANIP_VERSION"] = str(self.version) - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OSMANIP_VERSION"] = str(self.version) + tc.variables["OSMANIP_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/osmanip/all/test_package/CMakeLists.txt b/recipes/osmanip/all/test_package/CMakeLists.txt index a8ff5f965b314..02a74d2349c2e 100644 --- a/recipes/osmanip/all/test_package/CMakeLists.txt +++ b/recipes/osmanip/all/test_package/CMakeLists.txt @@ -2,11 +2,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(osmanip REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} osmanip::osmanip) +target_link_libraries(${PROJECT_NAME} PRIVATE osmanip::osmanip) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/osmanip/all/test_package/conanfile.py b/recipes/osmanip/all/test_package/conanfile.py index a500b98343c74..a9fbb7f543162 100644 --- a/recipes/osmanip/all/test_package/conanfile.py +++ b/recipes/osmanip/all/test_package/conanfile.py @@ -1,9 +1,18 @@ -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", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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,6 +20,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/osmanip/all/test_v1_package/CMakeLists.txt b/recipes/osmanip/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..fbf268aae5e4a --- /dev/null +++ b/recipes/osmanip/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(osmanip REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE osmanip::osmanip) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/osmanip/all/test_v1_package/conanfile.py b/recipes/osmanip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/osmanip/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/osmanip/config.yml b/recipes/osmanip/config.yml index 12265c7300e2e..0532c75dfff27 100644 --- a/recipes/osmanip/config.yml +++ b/recipes/osmanip/config.yml @@ -1,4 +1,6 @@ versions: + "4.2.1": + folder: all "4.1.0": folder: all "4.0.0": From 567c6745f2ccf740769705c71e6ae3b6351a2fa8 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 28 Sep 2022 19:05:25 +0200 Subject: [PATCH 239/561] (#13191) [docs] update the order of attributes --- docs/reviewing.md | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/docs/reviewing.md b/docs/reviewing.md index d830691bd757f..2abd57e16085c 100644 --- a/docs/reviewing.md +++ b/docs/reviewing.md @@ -54,26 +54,9 @@ def _build_subfolder(self): Prefer the following order of documented methods in python code (`conanfile.py`, `test_package/conanfile.py`): -- init -- set_name -- set_version -- export -- export_sources -- config_options -- configure -- layout -- requirements -- package_id -- validate -- build_id -- build_requirements -- system_requirements -- source -- generate -- imports -- build -- package -- package_info +For `conan create` the order is listed [here](https://docs.conan.io/en/latest/reference/commands/creator/create.html#methods-execution-order) +test packages recipes should append the following methods: + - deploy - test From 533faa969c95059f77ae548c6d27f410e415c570 Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Wed, 28 Sep 2022 19:30:50 +0200 Subject: [PATCH 240/561] (#13193) [community] Add jwillikers as community reviewer Co-authored-by: ericLemanissier --- .c3i/reviewers.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.c3i/reviewers.yml b/.c3i/reviewers.yml index bc47c10472b07..68688a3dec35d 100644 --- a/.c3i/reviewers.yml +++ b/.c3i/reviewers.yml @@ -75,3 +75,6 @@ reviewers: - user: "paulocoutinhox" type: "community" request_reviews: false + - user: "jwillikers" + type: "community" + request_reviews: false From 10533db5fc70dce56434e5962cd5870f0121725e Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 28 Sep 2022 19:45:06 +0200 Subject: [PATCH 241/561] (#13176) [nettle] support Conan 2.0 and add 3.8.1 * nettle: support Conan 2.0 Signed-off-by: Uilian Ries * update libtool version Signed-off-by: Uilian Ries * add 3.8.1 to config.yml Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- recipes/nettle/all/conandata.yml | 3 + recipes/nettle/all/conanfile.py | 130 +++++++++++------- .../nettle/all/test_package/CMakeLists.txt | 5 +- recipes/nettle/all/test_package/conanfile.py | 21 ++- .../nettle/all/test_v1_package/CMakeLists.txt | 10 ++ .../nettle/all/test_v1_package/conanfile.py | 17 +++ recipes/nettle/config.yml | 2 + 7 files changed, 130 insertions(+), 58 deletions(-) create mode 100644 recipes/nettle/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nettle/all/test_v1_package/conanfile.py diff --git a/recipes/nettle/all/conandata.yml b/recipes/nettle/all/conandata.yml index 346e8e5aad534..8e0d6c4f8c0c7 100644 --- a/recipes/nettle/all/conandata.yml +++ b/recipes/nettle/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.8.1": + url: "https://ftp.gnu.org/gnu/nettle/nettle-3.8.1.tar.gz" + sha256: "364f3e2b77cd7dcde83fd7c45219c834e54b0c75e428b6f894a23d12dd41cbfe" "3.6": url: "https://ftp.gnu.org/gnu/nettle/nettle-3.6.tar.gz" sha256: "d24c0d0f2abffbc8f4f34dcf114b0f131ec3774895f3555922fe2f40f3d5e3f1" diff --git a/recipes/nettle/all/conanfile.py b/recipes/nettle/all/conanfile.py index 0f476a9033e95..5768cf2b5f267 100644 --- a/recipes/nettle/all/conanfile.py +++ b/recipes/nettle/all/conanfile.py @@ -1,15 +1,23 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.tools.files import get, replace_in_file, copy, rmdir +from conan.tools.layout import basic_layout +from conan.tools.build import cross_building +from conan.tools.microsoft import unix_path +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class NettleTLS(ConanFile): name = "nettle" description = "The Nettle and Hogweed low-level cryptographic libraries" homepage = "https://www.lysator.liu.se/~nisse/nettle" - topics = ("conan", "nettle", "crypto", "low-level-cryptographic", "cryptographic") + topics = ("crypto", "low-level-cryptographic", "cryptographic") license = ("GPL-2.0-or-later", "GPL-3.0-or-later") url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" @@ -30,12 +38,6 @@ class NettleTLS(ConanFile): "x86_shani": False, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -47,18 +49,32 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + if self.settings.os == "Windows": + self.win_bash = True def requirements(self): if self.options.public_key: self.requires("gmp/6.2.1") + def layout(self): + basic_layout(self, src_folder="src") + def validate(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("Nettle cannot be built using Visual Studio") - if tools.Version(self.version) < "3.6" and self.options.get_safe("fat") and self.settings.arch == "x86_64": + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} cannot be built using '{self.settings.compiler}'") + if Version(self.version) < "3.6" and self.info.options.get_safe("fat") and self.info.settings.arch == "x86_64": raise ConanInvalidConfiguration("fat support is broken on this nettle release (due to a missing x86_64/sha_ni/sha1-compress.asm source)") @property @@ -66,65 +82,81 @@ def _settings_build(self): return getattr(self, "settings_build", self.settings) def build_requirements(self): - self.build_requires("libtool/2.4.6") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") 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], destination=self.source_folder, strip_root=True) - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + def generate(self): + tc = AutotoolsToolchain(self) conf_args = [ "--enable-public-key" if self.options.public_key else "--disable-public-key", "--enable-fat" if self.options.get_safe("fat") else "--disable-fat", "--enable-x86-aesni" if self.options.get_safe("x86_aesni") else "--disable-x86-aesni", "--enable-x86_sshni" if self.options.get_safe("x86_sshni") else "--disable-x86_sshni", ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - # srcdir in unix path causes some troubles in asm files on Windows - if self.settings.os == "Windows": - tools.replace_in_file(os.path.join(self.build_folder, "config.m4"), - tools.unix_path(os.path.join(self.build_folder, self._source_subfolder)), - os.path.join(self.build_folder, self._source_subfolder).replace("\\", "/")) - return self._autotools + tc.configure_args.extend(conf_args) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") def _patch_sources(self): - makefile_in = os.path.join(self._source_subfolder, "Makefile.in") - tools.replace_in_file(makefile_in, + makefile_in = os.path.join(self.source_folder, "Makefile.in") + # discard subdirs + replace_in_file(self, makefile_in, "SUBDIRS = tools testsuite examples", "SUBDIRS = ") # Fix broken tests for compilers like apple-clang with -Werror,-Wimplicit-function-declaration - tools.replace_in_file(os.path.join(self._source_subfolder, "aclocal.m4"), + replace_in_file(self, os.path.join(self.source_folder, "aclocal.m4"), "cat >conftest.c <conftest.c <") def build(self): self._patch_sources() - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.autoreconf() + # srcdir in unix path causes some troubles in asm files on Windows + if self.settings.os == "Windows": + replace_in_file(self, os.path.join(self.build_folder, "config.m4"), + unix_path(self, os.path.join(self.build_folder, self.source_folder)), + os.path.join(self.build_folder, self.source_folder).replace("\\", "/")) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="COPYING*", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() + copy(self, pattern="COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.components["hogweed"].names["pkgconfig"] = "hogweed" + self.cpp_info.set_property("cmake_file_name", "Nettle") + + self.cpp_info.components["hogweed"].set_property("pkg_config_name", "hogweed") + self.cpp_info.components["hogweed"].set_property("cmake_target_name", "Nettle::Hogweed") self.cpp_info.components["hogweed"].libs = ["hogweed"] if self.options.public_key: self.cpp_info.components["hogweed"].requires.append("gmp::libgmp") - self.cpp_info.components["libnettle"].libs = ["nettle"] - self.cpp_info.components["libnettle"].requires = ["hogweed"] - self.cpp_info.components["libnettle"].names["pkgconfig"] = "nettle" + self.cpp_info.components["nettle"].libs = ["nettle"] + self.cpp_info.components["nettle"].requires = ["hogweed"] + self.cpp_info.components["nettle"].set_property("pkg_config_name", "nettle") + self.cpp_info.components["nettle"].set_property("cmake_target_name", "Nettle::Nettle") + + # TODO: Remove after Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "Nettle" + self.cpp_info.names["cmake_find_package_multi"] = "Nettle" + self.cpp_info.components["hogweed"].names["cmake_find_package"] = "Hogweed" + self.cpp_info.components["hogweed"].names["cmake_find_package_multi"] = "Hogweed" + self.cpp_info.components["nettle"].names["cmake_find_package"] = "Nettle" + self.cpp_info.components["nettle"].names["cmake_find_package_multi"] = "Nettle" diff --git a/recipes/nettle/all/test_package/CMakeLists.txt b/recipes/nettle/all/test_package/CMakeLists.txt index 7b9b613cbb24a..9e41051d67311 100644 --- a/recipes/nettle/all/test_package/CMakeLists.txt +++ b/recipes/nettle/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(Nettle REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE Nettle::Nettle Nettle::Hogweed) diff --git a/recipes/nettle/all/test_package/conanfile.py b/recipes/nettle/all/test_package/conanfile.py index bd7165a553cf4..a9fb96656f203 100644 --- a/recipes/nettle/all/test_package/conanfile.py +++ b/recipes/nettle/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" + 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,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nettle/all/test_v1_package/CMakeLists.txt b/recipes/nettle/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e74ead530485f --- /dev/null +++ b/recipes/nettle/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Nettle REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Nettle::Nettle Nettle::Hogweed) diff --git a/recipes/nettle/all/test_v1_package/conanfile.py b/recipes/nettle/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/nettle/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/nettle/config.yml b/recipes/nettle/config.yml index 0b500b1c6ae57..e749bd36291ee 100644 --- a/recipes/nettle/config.yml +++ b/recipes/nettle/config.yml @@ -1,4 +1,6 @@ versions: + "3.8.1": + folder: "all" "3.6": folder: "all" "3.5": From 64c0fd98cf861f4312c6e20c68c2013d1ae692cd Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Wed, 28 Sep 2022 19:26:02 +0100 Subject: [PATCH 242/561] (#13177) [gilb] apply patch to fix static asserts in clang * [glib] bump dependency versions * [glib] add patch for static assert in clang * [glib] supply separate patches for 2.73 and 2.74 * [glib] apply patches using tools helper --- recipes/glib/all/conandata.yml | 12 +++++++ recipes/glib/all/conanfile.py | 12 +++---- .../0001-2.73.3-clang-static-assert.patch | 33 +++++++++++++++++++ .../0001-2.74.0-clang-static-assert.patch | 15 +++++++++ 4 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch create mode 100644 recipes/glib/all/patches/0001-2.74.0-clang-static-assert.patch diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml index 0cfaa0cfe4e33..5ac40dbf86130 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -30,6 +30,18 @@ sources: url: "https://download.gnome.org/sources/glib/2.74/glib-2.74.0.tar.xz" sha256: "3652c7f072d7b031a6b5edd623f77ebc5dcd2ae698598abcc89ff39ca75add30" patches: + "2.74.0": + - patch_file: "patches/0001-2.74.0-clang-static-assert.patch" + patch_type: backport + patch_description: fix for clang compilation + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2898 + base_path: "source_subfolder" + "2.73.3": + - patch_file: "patches/0001-2.73.3-clang-static-assert.patch" + patch_type: backport + patch_description: fix for clang compilation + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2898 + base_path: "source_subfolder" "2.73.1": - patch_file: "patches/f2ea67ae441bc6059b43a1051dd0b750fe5f6301.patch" base_path: "source_subfolder" diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index d2ec7ab6cd157..43c40dd234783 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -10,7 +10,7 @@ from conan.tools.microsoft import is_msvc from conans import tools, Meson, VisualStudioBuildEnvironment -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class GLibConan(ConanFile): @@ -52,8 +52,7 @@ def _build_subfolder(self): def export_sources(self): self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + files.export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -107,8 +106,8 @@ def validate(self): raise ConanInvalidConfiguration("libelf dependency can't be disabled in glib < 2.67.0") def build_requirements(self): - self.build_requires("meson/0.61.2") - self.build_requires("pkgconf/1.7.4") + self.tool_requires("meson/0.63.2") + self.tool_requires("pkgconf/1.9.3") def source(self): files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) @@ -142,8 +141,7 @@ def _configure_meson(self): return meson def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + files.apply_conandata_patches(self) if scm.Version(self.version) < "2.67.2": tools.replace_in_file( os.path.join(self._source_subfolder, "meson.build"), diff --git a/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch b/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch new file mode 100644 index 0000000000000..c46f5e071d71c --- /dev/null +++ b/recipes/glib/all/patches/0001-2.73.3-clang-static-assert.patch @@ -0,0 +1,33 @@ +diff --git a/gio/gio-launch-desktop.c b/gio/gio-launch-desktop.c +index 29bf9d5d4..47717b987 100644 +--- a/gio/gio-launch-desktop.c ++++ b/gio/gio-launch-desktop.c +@@ -39,7 +39,6 @@ + + #if defined(__linux__) && !defined(__BIONIC__) + #include +-#include + #include + #include + #include +@@ -48,6 +47,9 @@ + #include + + #include "gjournal-private.h" ++#define GLIB_COMPILATION ++#include "gmacros.h" /* For G_STATIC_ASSERT define */ ++#undef GLIB_COMPILATION + + /* + * write_all: +@@ -119,8 +121,8 @@ journal_stream_fd (const char *identifier, + /* Arbitrary large size for the sending buffer, from systemd */ + int large_buffer_size = 8 * 1024 * 1024; + +- static_assert (LOG_EMERG == 0, "Linux ABI defines LOG_EMERG"); +- static_assert (LOG_DEBUG == 7, "Linux ABI defines LOG_DEBUG"); ++ G_STATIC_ASSERT (LOG_EMERG == 0 && sizeof "Linux ABI defines LOG_EMERG"); ++ G_STATIC_ASSERT (LOG_DEBUG == 7 && sizeof "Linux ABI defines LOG_DEBUG"); + + fd = socket (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); + diff --git a/recipes/glib/all/patches/0001-2.74.0-clang-static-assert.patch b/recipes/glib/all/patches/0001-2.74.0-clang-static-assert.patch new file mode 100644 index 0000000000000..c9481d079569d --- /dev/null +++ b/recipes/glib/all/patches/0001-2.74.0-clang-static-assert.patch @@ -0,0 +1,15 @@ +diff --git a/gio/gio-launch-desktop.c b/gio/gio-launch-desktop.c +index 26b9ae1a1..47717b987 100644 +--- a/gio/gio-launch-desktop.c ++++ b/gio/gio-launch-desktop.c +@@ -121,8 +121,8 @@ journal_stream_fd (const char *identifier, + /* Arbitrary large size for the sending buffer, from systemd */ + int large_buffer_size = 8 * 1024 * 1024; + +- G_STATIC_ASSERT (LOG_EMERG == 0 && "Linux ABI defines LOG_EMERG"); +- G_STATIC_ASSERT (LOG_DEBUG == 7 && "Linux ABI defines LOG_DEBUG"); ++ G_STATIC_ASSERT (LOG_EMERG == 0 && sizeof "Linux ABI defines LOG_EMERG"); ++ G_STATIC_ASSERT (LOG_DEBUG == 7 && sizeof "Linux ABI defines LOG_DEBUG"); + + fd = socket (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); + From 1ef53db72d001784e7fad7a4b00dae559e9a31ed Mon Sep 17 00:00:00 2001 From: Pat Mancuso <46453397+patmantru@users.noreply.github.com> Date: Wed, 28 Sep 2022 15:04:33 -0400 Subject: [PATCH 243/561] (#13200) opentdf-client: add version 1.2.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/opentdf-client/all/conandata.yml | 3 +++ recipes/opentdf-client/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/opentdf-client/all/conandata.yml b/recipes/opentdf-client/all/conandata.yml index a449831989d2e..0cad19d535f11 100644 --- a/recipes/opentdf-client/all/conandata.yml +++ b/recipes/opentdf-client/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/opentdf/client-cpp/archive/1.2.0.tar.gz" + sha256: "15828038809ed291ff7881206a675abc5162e1175c8b515363b9c584aebb08f7" "1.1.6": url: "https://github.com/opentdf/client-cpp/archive/1.1.6.tar.gz" sha256: "83992c37c9a58ae2152660a4ffbf1784fe63d7a9e7b8466d10ca1074697b3d3a" diff --git a/recipes/opentdf-client/config.yml b/recipes/opentdf-client/config.yml index 56aaeb1ead047..a4bdd24b34b43 100644 --- a/recipes/opentdf-client/config.yml +++ b/recipes/opentdf-client/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.6": folder: all "1.1.5": From ccf1568efd045ca9af92f0e1bb64680b82985efa Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Sep 2022 04:24:24 +0900 Subject: [PATCH 244/561] (#13201) highway: add version 1.0.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/highway/all/conandata.yml | 3 +++ recipes/highway/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/highway/all/conandata.yml b/recipes/highway/all/conandata.yml index 143cf0ab290eb..c75bfd6cd5a4b 100644 --- a/recipes/highway/all/conandata.yml +++ b/recipes/highway/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.1": + url: "https://github.com/google/highway/archive/1.0.1.tar.gz" + sha256: "7ca6af7dc2e3e054de9e17b9dfd88609a7fd202812b1c216f43cc41647c97311" "1.0.0": url: "https://github.com/google/highway/archive/1.0.0.tar.gz" sha256: "ab4f5f864932268356f9f6aa86f612fa4430a7db3c8de0391076750197e876b8" diff --git a/recipes/highway/config.yml b/recipes/highway/config.yml index db7479c93d942..eb41394c69dcd 100644 --- a/recipes/highway/config.yml +++ b/recipes/highway/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.1": + folder: all "1.0.0": folder: all "0.17.0": From cad5f921c16ea8ae8fae58a2c1d65163917aec0d Mon Sep 17 00:00:00 2001 From: Commander Keen Date: Thu, 29 Sep 2022 09:04:37 +0300 Subject: [PATCH 245/561] (#13008) [mosquitto] support threading options in recipe fixes #13006 --- recipes/mosquitto/2.x/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/mosquitto/2.x/conanfile.py b/recipes/mosquitto/2.x/conanfile.py index 8b1f31453b306..a2b39f2d1e5d0 100644 --- a/recipes/mosquitto/2.x/conanfile.py +++ b/recipes/mosquitto/2.x/conanfile.py @@ -26,6 +26,7 @@ class Mosquitto(ConanFile): "cjson": [True, False], "build_cpp": [True, False], "websockets": [True, False], + "threading": [True, False], } default_options = { "shared": False, @@ -37,6 +38,7 @@ class Mosquitto(ConanFile): "cjson": True, # https://github.com/eclipse/mosquitto/commit/bbe0afbfbe7bb392361de41e275759ee4ef06b1c "build_cpp": True, "websockets": False, + "threading": True, } exports_sources = ["CMakeLists.txt"] generators = "cmake", "cmake_find_package" @@ -93,7 +95,7 @@ def _configure_cmake(self): self._cmake.definitions["WITH_APPS"] = self.options.apps self._cmake.definitions["WITH_PLUGINS"] = False self._cmake.definitions["WITH_LIB_CPP"] = self.options.build_cpp - self._cmake.definitions["WITH_THREADING"] = self.settings.compiler != "Visual Studio" + self._cmake.definitions["WITH_THREADING"] = self.settings.compiler != "Visual Studio" and self.options.threading self._cmake.definitions["WITH_WEBSOCKETS"] = self.options.get_safe("websockets", False) self._cmake.definitions["STATIC_WEBSOCKETS"] = self.options.get_safe("websockets", False) and not self.options["libwebsockets"].shared self._cmake.definitions["DOCUMENTATION"] = False From 441d9161edf93d241ee49ec0317ed9ebd6c634c4 Mon Sep 17 00:00:00 2001 From: Fernando Pelliccioni Date: Thu, 29 Sep 2022 07:04:17 -0300 Subject: [PATCH 246/561] (#12859) jemalloc: support v5.3.0 * jemalloc: support v5.3.0 * Update recipes/jemalloc/all/conandata.yml Co-authored-by: Uilian Ries * macOS on armv8 is still not supported * fix * fix * fix * use same patch * fix * do not apply patches * patch files * do not fail in replace_in_files * use new rename function * Update recipes/jemalloc/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/jemalloc/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/jemalloc/all/conanfile.py Co-authored-by: Uilian Ries * adds layout Co-authored-by: Uilian Ries --- recipes/jemalloc/all/conandata.yml | 6 ++- recipes/jemalloc/all/conanfile.py | 72 ++++++++++++++++-------------- recipes/jemalloc/config.yml | 2 + 3 files changed, 44 insertions(+), 36 deletions(-) diff --git a/recipes/jemalloc/all/conandata.yml b/recipes/jemalloc/all/conandata.yml index f1812081247f8..01ec764057557 100644 --- a/recipes/jemalloc/all/conandata.yml +++ b/recipes/jemalloc/all/conandata.yml @@ -1,9 +1,11 @@ sources: + "5.3.0": + url: "https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2" + sha256: "2db82d1e7119df3e71b7640219b6dfe84789bc0537983c3b7ac4f7189aecfeaa" "5.2.1": url: "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2" sha256: "34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6" patches: "5.2.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch" + - patch_file: "patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch" diff --git a/recipes/jemalloc/all/conanfile.py b/recipes/jemalloc/all/conanfile.py index fecc2916a3e25..03cf37de219b0 100644 --- a/recipes/jemalloc/all/conanfile.py +++ b/recipes/jemalloc/all/conanfile.py @@ -1,11 +1,15 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conans import AutoToolsBuildEnvironment, MSBuild +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conans import tools as tools_legacy +from conan.tools.files import apply_conandata_patches, get, rename, replace_in_file +from conan.tools.layout import basic_layout import os import shutil import string -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.51.3" class JemallocConan(ConanFile): name = "jemalloc" @@ -49,10 +53,6 @@ class JemallocConan(ConanFile): _autotools = None - @property - def _source_subfolder(self): - return "source_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -68,7 +68,7 @@ def validate(self): if self.options.enable_cxx and \ self.settings.compiler.get_safe("libcxx") == "libc++" and \ self.settings.compiler == "clang" and \ - tools.Version(self.settings.compiler.version) < "10": + Version(self.settings.compiler.version) < "10": raise ConanInvalidConfiguration("clang and libc++ version {} (< 10) is missing a mutex implementation".format(self.settings.compiler.version)) if self.settings.compiler == "Visual Studio" and \ self.options.shared and \ @@ -81,20 +81,24 @@ def validate(self): raise ConanInvalidConfiguration("Only Release and Debug build_types are supported") if self.settings.compiler == "Visual Studio" and self.settings.arch not in ("x86_64", "x86"): raise ConanInvalidConfiguration("Unsupported arch") - if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) <= "3.9": + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) <= "3.9": raise ConanInvalidConfiguration("Unsupported compiler version") + if self.settings.os == "Macos" and self.settings.arch not in ("x86_64", "x86"): + raise ConanInvalidConfiguration("Unsupported arch") + + def layout(self): + basic_layout(self, src_folder="src") @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): + if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): self.build_requires("msys2/cci.latest") 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], destination=self.source_folder, strip_root=True) @property def _autotools_args(self): @@ -122,8 +126,8 @@ def _autotools_args(self): def _configure_autotools(self): if self._autotools: return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.configure(args=self._autotools_args, configure_dir=self._source_subfolder) + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools_legacy.os_info.is_windows) + self._autotools.configure(args=self._autotools_args, configure_dir=self.source_folder) return self._autotools @property @@ -135,32 +139,32 @@ def _msvc_build_type(self): def _patch_sources(self): if self.settings.os == "Windows": - makefile_in = os.path.join(self._source_subfolder, "Makefile.in") - tools.replace_in_file(makefile_in, + makefile_in = os.path.join(self.source_folder, "Makefile.in") + replace_in_file(self, makefile_in, "DSO_LDFLAGS = @DSO_LDFLAGS@", - "DSO_LDFLAGS = @DSO_LDFLAGS@ -Wl,--out-implib,lib/libjemalloc.a") - tools.replace_in_file(makefile_in, + "DSO_LDFLAGS = @DSO_LDFLAGS@ -Wl,--out-implib,lib/libjemalloc.a", strict=False) + replace_in_file(self, makefile_in, "\t$(INSTALL) -d $(LIBDIR)\n" "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)", "\t$(INSTALL) -d $(BINDIR)\n" "\t$(INSTALL) -d $(LIBDIR)\n" "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\n" - "\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)") + "\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)", strict=False) + + apply_conandata_patches(self) - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) def build(self): self._patch_sources() if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): - with tools.environment_append({"CC": "cl", "CXX": "cl"}) if self.settings.compiler == "Visual Studio" else tools.no_op(): - with tools.chdir(self._source_subfolder): + with tools_legacy.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools_legacy.no_op(): + with tools_legacy.environment_append({"CC": "cl", "CXX": "cl"}) if self.settings.compiler == "Visual Studio" else tools_legacy.no_op(): + with tools_legacy.chdir(self.source_folder): # Do not use AutoToolsBuildEnvironment because we want to run configure as ./configure - self.run("./configure {}".format(" ".join(self._autotools_args)), win_bash=tools.os_info.is_windows) + self.run("./configure {}".format(" ".join(self._autotools_args)), win_bash=tools_legacy.os_info.is_windows) msbuild = MSBuild(self) # Do not use the 2015 solution: unresolved external symbols: test_hooks_libc_hook and test_hooks_arena_new_hook - sln_file = os.path.join(self._source_subfolder, "msvc", "jemalloc_vc2017.sln") + sln_file = os.path.join(self.source_folder, "msvc", "jemalloc_vc2017.sln") msbuild.build(sln_file, targets=["jemalloc"], build_type=self._msvc_build_type) else: autotools = self._configure_autotools() @@ -174,7 +178,7 @@ def _library_name(self): if self.settings.build_type == "Debug": libname += "d" else: - toolset = tools.msvs_toolset(self.settings) + toolset = tools_legacy.msvs_toolset(self.settings) toolset_number = "".join(c for c in toolset if c in string.digits) libname += "-vc{}-{}".format(toolset_number, self._msvc_build_type) else: @@ -187,16 +191,16 @@ def _library_name(self): return libname def package(self): - self.copy(pattern="COPYING", src=self._source_subfolder, dst="licenses") + self.copy(pattern="COPYING", src=self.source_folder, dst="licenses") if self.settings.compiler == "Visual Studio": arch_subdir = { "x86_64": "x64", "x86": "x86", }[str(self.settings.arch)] - self.copy("*.lib", src=os.path.join(self._source_subfolder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "lib")) - self.copy("*.dll", src=os.path.join(self._source_subfolder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "bin")) - self.copy("jemalloc.h", src=os.path.join(self._source_subfolder, "include", "jemalloc"), dst=os.path.join(self.package_folder, "include", "jemalloc"), keep_path=True) - shutil.copytree(os.path.join(self._source_subfolder, "include", "msvc_compat"), + self.copy("*.lib", src=os.path.join(self.source_folder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "lib")) + self.copy("*.dll", src=os.path.join(self.source_folder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "bin")) + self.copy("jemalloc.h", src=os.path.join(self.source_folder, "include", "jemalloc"), dst=os.path.join(self.package_folder, "include", "jemalloc"), keep_path=True) + shutil.copytree(os.path.join(self.source_folder, "include", "msvc_compat"), os.path.join(self.package_folder, "include", "msvc_compat")) else: autotools = self._configure_autotools() @@ -204,7 +208,7 @@ def package(self): autotools.make(target="install_lib_shared" if self.options.shared else "install_lib_static") autotools.make(target="install_include") if self.settings.os == "Windows" and self.settings.compiler == "gcc": - tools.rename(os.path.join(self.package_folder, "lib", "{}.lib".format(self._library_name)), + rename(self, os.path.join(self.package_folder, "lib", "{}.lib".format(self._library_name)), os.path.join(self.package_folder, "lib", "lib{}.a".format(self._library_name))) if not self.options.shared: os.unlink(os.path.join(self.package_folder, "lib", "jemalloc.lib")) diff --git a/recipes/jemalloc/config.yml b/recipes/jemalloc/config.yml index 7be9a7ca5a898..28cb9a5ecdcdf 100644 --- a/recipes/jemalloc/config.yml +++ b/recipes/jemalloc/config.yml @@ -1,3 +1,5 @@ versions: "5.2.1": folder: all + "5.3.0": + folder: all From 652065a1c4e84eb60489cd08a2efa10d0d106f44 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Sep 2022 19:28:50 +0900 Subject: [PATCH 247/561] (#12999) arrow: support conan v2 * arrow: support conan v2 * support conan v2 * support thrift * support cross compiling on armv8 * use `is_msvc_static_runtime()` * support arrow 1.0.0 * support arrow 2.0.0 * remove debug routine * fix boost package name * fix ARROW_BOOST_REQUIRED condition * support 7.0.0 * support 8.0.0,8.0.1 --- recipes/arrow/all/CMakeLists.txt | 7 - recipes/arrow/all/conandata.yml | 103 +++-- recipes/arrow/all/conanfile.py | 325 ++++++++------ .../arrow/all/patches/1.0.0-0001-cmake.patch | 92 ---- .../all/patches/1.0.0-0002-jemalloc.patch | 43 -- .../1.0.0-0005-fix-make12-namespace.patch | 22 + .../all/patches/1.0.0-0006-fix-cmake.patch | 333 ++++++++++++++ .../arrow/all/patches/2.0.0-0001-cmake.patch | 19 - .../all/patches/2.0.0-0002-jemalloc.patch | 43 -- .../patches/2.0.0-0006-gandiva-llvm-re2.patch | 78 ---- .../patches/2.0.0-0007-fix-protoc-cmake.patch | 11 - .../all/patches/2.0.0-0008-fix-cmake.patch | 273 +++++++++++ .../arrow/all/patches/7.0.0-0001-cmake.patch | 13 - .../all/patches/7.0.0-0002-jemalloc.patch | 26 -- .../patches/7.0.0-0005-use-find-package.patch | 418 ----------------- .../all/patches/7.0.0-0007-fix-cmake.patch | 347 ++++++++++++++ .../arrow/all/patches/8.0.0-0001-cmake.patch | 13 - .../all/patches/8.0.0-0002-jemalloc.patch | 26 -- .../patches/8.0.0-0004-use-find-package.patch | 379 ---------------- .../all/patches/8.0.0-0006-fix-cmake.patch | 425 ++++++++++++++++++ recipes/arrow/all/test_package/CMakeLists.txt | 3 +- recipes/arrow/all/test_package/conanfile.py | 22 +- .../arrow/all/test_v1_package/CMakeLists.txt | 13 + .../arrow/all/test_v1_package/conanfile.py | 18 + 24 files changed, 1675 insertions(+), 1377 deletions(-) delete mode 100644 recipes/arrow/all/CMakeLists.txt delete mode 100644 recipes/arrow/all/patches/1.0.0-0001-cmake.patch delete mode 100644 recipes/arrow/all/patches/1.0.0-0002-jemalloc.patch create mode 100644 recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch create mode 100644 recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch delete mode 100644 recipes/arrow/all/patches/2.0.0-0001-cmake.patch delete mode 100644 recipes/arrow/all/patches/2.0.0-0002-jemalloc.patch delete mode 100644 recipes/arrow/all/patches/2.0.0-0006-gandiva-llvm-re2.patch delete mode 100644 recipes/arrow/all/patches/2.0.0-0007-fix-protoc-cmake.patch create mode 100644 recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch delete mode 100644 recipes/arrow/all/patches/7.0.0-0001-cmake.patch delete mode 100644 recipes/arrow/all/patches/7.0.0-0002-jemalloc.patch delete mode 100644 recipes/arrow/all/patches/7.0.0-0005-use-find-package.patch create mode 100644 recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch delete mode 100644 recipes/arrow/all/patches/8.0.0-0001-cmake.patch delete mode 100644 recipes/arrow/all/patches/8.0.0-0002-jemalloc.patch delete mode 100644 recipes/arrow/all/patches/8.0.0-0004-use-find-package.patch create mode 100644 recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch create mode 100644 recipes/arrow/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/arrow/all/test_v1_package/conanfile.py diff --git a/recipes/arrow/all/CMakeLists.txt b/recipes/arrow/all/CMakeLists.txt deleted file mode 100644 index 5fce337b405db..0000000000000 --- a/recipes/arrow/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/cpp) diff --git a/recipes/arrow/all/conandata.yml b/recipes/arrow/all/conandata.yml index 57dc370908163..d1871e991c44b 100644 --- a/recipes/arrow/all/conandata.yml +++ b/recipes/arrow/all/conandata.yml @@ -16,59 +16,58 @@ sources: sha256: "08fbd4c633c08939850d619ca0224c75d7a0526467c721c0838b8aa7efccb270" patches: "8.0.1": - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0001-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0002-jemalloc.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0003-mallctl-takes-size_t.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0004-use-find-package.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0005-install-utils.patch" + - patch_file: "patches/8.0.0-0003-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/8.0.0-0005-install-utils.patch" + patch_description: "enable utilis installation" + patch_type: "conan" + - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "8.0.0": - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0001-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0002-jemalloc.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0003-mallctl-takes-size_t.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0004-use-find-package.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0005-install-utils.patch" + - patch_file: "patches/8.0.0-0003-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/8.0.0-0005-install-utils.patch" + patch_description: "enable utilis installation" + patch_type: "conan" + - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "7.0.0": - - base_path: "source_subfolder" - patch_file: "patches/7.0.0-0001-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/7.0.0-0002-jemalloc.patch" - - base_path: "source_subfolder" - patch_file: "patches/7.0.0-0003-mallctl-takes-size_t.patch" - - base_path: "source_subfolder" - patch_file: "patches/7.0.0-0005-use-find-package.patch" - - base_path: "source_subfolder" - patch_file: "patches/7.0.0-0006-install-utils.patch" + - patch_file: "patches/7.0.0-0003-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/7.0.0-0006-install-utils.patch" + patch_description: "enable utilis installation" + patch_type: "conan" + - patch_file: "patches/7.0.0-0007-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.0.0": - - base_path: "source_subfolder" - patch_file: "patches/2.0.0-0001-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/2.0.0-0002-jemalloc.patch" - - base_path: "source_subfolder" - patch_file: "patches/2.0.0-0003-fix-shared-msvc.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0004-mallctl-takes-size_t.patch" - - base_path: "source_subfolder" - patch_file: "patches/2.0.0-0005-gandiva-engine.patch" - - base_path: "source_subfolder" - patch_file: "patches/2.0.0-0006-gandiva-llvm-re2.patch" - - base_path: "source_subfolder" - patch_file: "patches/2.0.0-0007-fix-protoc-cmake.patch" + - patch_file: "patches/2.0.0-0003-fix-shared-msvc.patch" + patch_description: "make shared enabled in msvc" + patch_type: "backport" + - patch_file: "patches/1.0.0-0004-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/2.0.0-0005-gandiva-engine.patch" + patch_description: "fix grandiva compilation error" + patch_type: "backport" + - patch_file: "patches/2.0.0-0008-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "1.0.0": - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0001-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0002-jemalloc.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0003-fix-shared-msvc.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0004-mallctl-takes-size_t.patch" + - patch_file: "patches/1.0.0-0003-fix-shared-msvc.patch" + patch_description: "make shared enabled in msvc" + patch_type: "backport" + - patch_file: "patches/1.0.0-0004-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/1.0.0-0005-fix-make12-namespace.patch" + patch_description: "fix ambiguous `make12` function between std and date" + patch_type: "backport" + - patch_file: "patches/1.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" diff --git a/recipes/arrow/all/conanfile.py b/recipes/arrow/all/conanfile.py index 5a8b65c292e20..2569b3fd96866 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -1,10 +1,15 @@ -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.files import apply_conandata_patches, get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + import os import glob -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.51.3" class ArrowConan(ConanFile): name = "arrow" @@ -43,6 +48,7 @@ class ArrowConan(ConanFile): "with_grpc": ["auto", True, False], "with_hiveserver2": [True, False], "with_jemalloc": ["auto", True, False], + "with_mimalloc": ["auto", True, False], "with_json": [True, False], "with_llvm": ["auto", True, False], "with_openssl": ["auto", True, False], @@ -87,6 +93,7 @@ class ArrowConan(ConanFile): "with_gcs": False, "with_gflags": "auto", "with_jemalloc": "auto", + "with_mimalloc": False, "with_glog": "auto", "with_grpc": "auto", "with_hiveserver2": False, @@ -104,39 +111,38 @@ class ArrowConan(ConanFile): "with_zlib": False, "with_zstd": False, } - generators = "cmake", "cmake_find_package_multi" short_paths = True - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + for p in self.conan_data.get("patches", {}).get(self.version, []): + copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if tools.Version(self.version) < "2.0.0": + if Version(self.version) < "2.0.0": del self.options.simd_level del self.options.runtime_simd_level - elif tools.Version(self.version) < "6.0.0": + elif Version(self.version) < "6.0.0": self.options.simd_level = "sse4_2" - if tools.Version(self.version) < "6.0.0": + if Version(self.version) < "6.0.0": del self.options.with_gcs - if tools.Version(self.version) < "7.0.0": + if Version(self.version) < "7.0.0": del self.options.skyhook del self.options.with_flight_sql del self.options.with_opentelemetry - if tools.Version(self.version) < "8.0.0": + if Version(self.version) < "8.0.0": del self.options.substrait + def configure(self): + if self.options.shared: + try: + del self.options.fPIC # once removed by config_options, need try..except for a second del + except Exception: + pass + def validate(self): - if self.settings.compiler == "clang" and self.settings.compiler.version <= tools.Version("3.9"): + if self.info.settings.compiler == "clang" and self.info.settings.compiler.version <= Version("3.9"): raise ConanInvalidConfiguration("This recipe does not support this compiler version") if self.options.shared: @@ -180,8 +186,8 @@ def validate(self): if self.options["jemalloc"].enable_cxx: raise ConanInvalidConfiguration("jemmalloc.enable_cxx of a static jemalloc must be disabled") - if tools.Version(self.version) < "6.0.0" and self.options.get_safe("simd_level") == "default": - raise ConanInvalidConfiguration("In {}/{}, simd_level options is not supported `default` value.".format(self.name, self.version)) + if Version(self.version) < "6.0.0" and self.options.get_safe("simd_level") == "default": + raise ConanInvalidConfiguration(f"In {self.ref}, simd_level options is not supported `default` value.") def _compute(self, required=False): if required or self.options.compute == "auto": @@ -209,7 +215,11 @@ def _with_jemalloc(self, required=False): def _with_re2(self, required=False): if required or self.options.with_re2 == "auto": - return bool(self.options.gandiva) + if self.options.gandiva or self.options.parquet: + return True + if Version(self) >= "7.0.0" and (self._compute() or self._dataset_modules()): + return True + return False else: return bool(self.options.with_re2) @@ -247,12 +257,12 @@ def _with_boost(self, required=False): if required or self.options.with_boost == "auto": if self.options.gandiva: return True - version = tools.Version(self.version) + version = Version(self.version) if version.major == "1": - if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < tools.Version("4.9"): + if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): return True elif version.major >= "2": - if self.settings.compiler == "Visual Studio": + if is_msvc(self): return True return False else: @@ -280,15 +290,24 @@ def _with_openssl(self, required=False): else: return bool(self.options.with_openssl) + def _with_rapidjson(self): + if self.options.with_json: + return True + if Version(self.version) >= "7.0.0" and self.options.encryption: + return True + return False + def requirements(self): if self._with_thrift(): - self.requires("thrift/0.16.0") + self.requires("thrift/0.17.0") if self._with_protobuf(): - self.requires("protobuf/3.21.1") + self.requires("protobuf/3.21.4") if self._with_jemalloc(): self.requires("jemalloc/5.2.1") + if self.options.with_mimalloc: + self.requires("mimalloc/1.7.6") if self._with_boost(): - self.requires("boost/1.79.0") + self.requires("boost/1.80.0") if self._with_gflags(): self.requires("gflags/2.2.2") if self._with_glog(): @@ -296,8 +315,8 @@ def requirements(self): if self.options.get_safe("with_gcs"): self.requires("google-cloud-cpp/1.40.1") if self._with_grpc(): - self.requires("grpc/1.47.0") - if self.options.with_json: + self.requires("grpc/1.48.0") + if self._with_rapidjson(): self.requires("rapidjson/1.1.0") if self._with_llvm(): self.requires("llvm-core/13.0.0") @@ -316,10 +335,10 @@ def requirements(self): if self.options.with_bz2: self.requires("bzip2/1.0.8") if self.options.with_lz4: - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.4") if self.options.with_snappy: self.requires("snappy/1.1.9") - if tools.Version(self.version) >= "6.0.0" and \ + if Version(self.version) >= "6.0.0" and \ self.options.get_safe("simd_level") != None or \ self.options.get_safe("runtime_simd_level") != None: self.requires("xsimd/8.1.0") @@ -328,135 +347,138 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.2") if self._with_re2(): - self.requires("re2/20220201") + self.requires("re2/20220601") if self._with_utf8proc(): self.requires("utf8proc/2.7.0") if self.options.with_backtrace: self.requires("libbacktrace/cci.20210118") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - if tools.cross_building(self.settings): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist + tc = CMakeToolchain(self) + if cross_building(self): cmake_system_processor = { "armv8": "aarch64", "armv8.3": "aarch64", }.get(str(self.settings.arch), str(self.settings.arch)) - self._cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor - if self.settings.compiler == "Visual Studio": - self._cmake.definitions["ARROW_USE_STATIC_CRT"] = "MT" in str(self.settings.compiler.runtime) - self._cmake.definitions["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" - self._cmake.definitions["ARROW_GANDIVA"] = self.options.gandiva - self._cmake.definitions["ARROW_PARQUET"] = self._parquet() - self._cmake.definitions["ARROW_SUBSTRAIT"] = self.options.get_safe("substrait", False) - self._cmake.definitions["ARROW_PLASMA"] = self.options.plasma - self._cmake.definitions["ARROW_DATASET"] = self._dataset_modules() - self._cmake.definitions["ARROW_FILESYSTEM"] = self.options.filesystem_layer - self._cmake.definitions["PARQUET_REQUIRE_ENCRYPTION"] = self.options.encryption - self._cmake.definitions["ARROW_HDFS"] = self.options.hdfs_bridgs - self._cmake.definitions["ARROW_VERBOSE_THIRDPARTY_BUILD"] = True - self._cmake.definitions["ARROW_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["ARROW_BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["ARROW_NO_DEPRECATED_API"] = not self.options.deprecated - self._cmake.definitions["ARROW_FLIGHT"] = self._with_flight_rpc() - self._cmake.definitions["ARROW_FLIGHT_SQL"] = self.options.get_safe("with_flight_sql", False) - self._cmake.definitions["ARROW_HIVESERVER2"] = self.options.with_hiveserver2 - self._cmake.definitions["ARROW_COMPUTE"] = self._compute() - self._cmake.definitions["ARROW_CSV"] = self.options.with_csv - self._cmake.definitions["ARROW_CUDA"] = self.options.with_cuda - self._cmake.definitions["ARROW_JEMALLOC"] = self._with_jemalloc() - self._cmake.definitions["ARROW_JSON"] = self.options.with_json - self._cmake.definitions["ARROW_GCS"] = self.options.get_safe("with_gcs", False) - - self._cmake.definitions["BOOST_SOURCE"] = "SYSTEM" - self._cmake.definitions["Protobuf_SOURCE"] = "SYSTEM" + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor + if cmake_system_processor == "aarch64": + tc.variables["ARROW_CPU_FLAG"] = "armv8" + if is_msvc(self): + tc.variables["ARROW_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" + tc.variables["ARROW_GANDIVA"] = bool(self.options.gandiva) + tc.variables["ARROW_PARQUET"] = self._parquet() + tc.variables["ARROW_SUBSTRAIT"] = bool(self.options.get_safe("substrait", False)) + tc.variables["ARROW_PLASMA"] = bool(self.options.plasma) + tc.variables["ARROW_DATASET"] = self._dataset_modules() + tc.variables["ARROW_FILESYSTEM"] = bool(self.options.filesystem_layer) + tc.variables["PARQUET_REQUIRE_ENCRYPTION"] = bool(self.options.encryption) + tc.variables["ARROW_HDFS"] = bool(self.options.hdfs_bridgs) + tc.variables["ARROW_VERBOSE_THIRDPARTY_BUILD"] = True + tc.variables["ARROW_BUILD_SHARED"] = bool(self.options.shared) + tc.variables["ARROW_BUILD_STATIC"] = not bool(self.options.shared) + tc.variables["ARROW_NO_DEPRECATED_API"] = not bool(self.options.deprecated) + tc.variables["ARROW_FLIGHT"] = self._with_flight_rpc() + tc.variables["ARROW_FLIGHT_SQL"] = bool(self.options.get_safe("with_flight_sql", False)) + tc.variables["ARROW_HIVESERVER2"] = bool(self.options.with_hiveserver2) + tc.variables["ARROW_COMPUTE"] = self._compute() + tc.variables["ARROW_CSV"] = bool(self.options.with_csv) + tc.variables["ARROW_CUDA"] = bool(self.options.with_cuda) + tc.variables["ARROW_JEMALLOC"] = self._with_jemalloc() + tc.variables["ARROW_MIMALLOC"] = bool(self.options.with_mimalloc) + tc.variables["ARROW_JSON"] = bool(self.options.with_json) + tc.variables["google_cloud_cpp_SOURCE"] = "SYSTEM" + tc.variables["ARROW_GCS"] = bool(self.options.get_safe("with_gcs", False)) + tc.variables["BOOST_SOURCE"] = "SYSTEM" + tc.variables["Protobuf_SOURCE"] = "SYSTEM" if self._with_protobuf(): - self._cmake.definitions["ARROW_PROTOBUF_USE_SHARED"] = self.options["protobuf"].shared - self._cmake.definitions["gRPC_SOURCE"] = "SYSTEM" + tc.variables["ARROW_PROTOBUF_USE_SHARED"] = bool(self.options["protobuf"].shared) + tc.variables["gRPC_SOURCE"] = "SYSTEM" if self._with_grpc(): - self._cmake.definitions["ARROW_GRPC_USE_SHARED"] = self.options["grpc"].shared - self._cmake.definitions["ARROW_HDFS"] = self.options.hdfs_bridgs - self._cmake.definitions["ARROW_USE_GLOG"] = self._with_glog() - self._cmake.definitions["GLOG_SOURCE"] = "SYSTEM" - self._cmake.definitions["ARROW_WITH_BACKTRACE"] = self.options.with_backtrace - self._cmake.definitions["ARROW_WITH_BROTLI"] = self.options.with_brotli - self._cmake.definitions["Brotli_SOURCE"] = "SYSTEM" + tc.variables["ARROW_GRPC_USE_SHARED"] = bool(self.options["grpc"].shared) + + tc.variables["ARROW_USE_GLOG"] = self._with_glog() + tc.variables["GLOG_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_BACKTRACE"] = bool(self.options.with_backtrace) + tc.variables["ARROW_WITH_BROTLI"] = bool(self.options.with_brotli) + tc.variables["brotli_SOURCE"] = "SYSTEM" if self.options.with_brotli: - self._cmake.definitions["ARROW_BROTLI_USE_SHARED"] = self.options["brotli"].shared - self._cmake.definitions["gflags_SOURCE"] = "SYSTEM" + tc.variables["ARROW_BROTLI_USE_SHARED"] = bool(self.options["brotli"].shared) + tc.variables["gflags_SOURCE"] = "SYSTEM" if self._with_gflags(): - self._cmake.definitions["ARROW_BROTLI_USE_SHARED"] = self.options["gflags"].shared - self._cmake.definitions["ARROW_WITH_BZ2"] = self.options.with_bz2 - self._cmake.definitions["BZip2_SOURCE"] = "SYSTEM" + tc.variables["ARROW_GFLAGS_USE_SHARED"] = bool(self.options["gflags"].shared) + tc.variables["ARROW_WITH_BZ2"] = bool(self.options.with_bz2) + tc.variables["BZip2_SOURCE"] = "SYSTEM" if self.options.with_bz2: - self._cmake.definitions["ARROW_BZ2_USE_SHARED"] = self.options["bzip2"].shared - self._cmake.definitions["ARROW_WITH_LZ4"] = self.options.with_lz4 - self._cmake.definitions["Lz4_SOURCE"] = "SYSTEM" + tc.variables["ARROW_BZ2_USE_SHARED"] = bool(self.options["bzip2"].shared) + tc.variables["ARROW_WITH_LZ4"] = bool(self.options.with_lz4) + tc.variables["lz4_SOURCE"] = "SYSTEM" if self.options.with_lz4: - self._cmake.definitions["ARROW_LZ4_USE_SHARED"] = self.options["lz4"].shared - self._cmake.definitions["ARROW_WITH_SNAPPY"] = self.options.with_snappy - self._cmake.definitions["Snappy_SOURCE"] = "SYSTEM" + tc.variables["ARROW_LZ4_USE_SHARED"] = bool(self.options["lz4"].shared) + tc.variables["ARROW_WITH_SNAPPY"] = bool(self.options.with_snappy) + tc.variables["RapidJSON_SOURCE"] = "SYSTEM" + tc.variables["Snappy_SOURCE"] = "SYSTEM" if self.options.with_snappy: - self._cmake.definitions["ARROW_SNAPPY_USE_SHARED"] = self.options["snappy"].shared - self._cmake.definitions["ARROW_WITH_ZLIB"] = self.options.with_zlib - self._cmake.definitions["RE2_SOURCE"] = "SYSTEM" - self._cmake.definitions["ZLIB_SOURCE"] = "SYSTEM" - - self._cmake.definitions["ARROW_WITH_ZSTD"] = self.options.with_zstd - if tools.Version(self.version) >= "2.0": - self._cmake.definitions["zstd_SOURCE"] = "SYSTEM" - self._cmake.definitions["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() - self._cmake.definitions["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() + tc.variables["ARROW_SNAPPY_USE_SHARED"] = bool(self.options["snappy"].shared) + tc.variables["ARROW_WITH_ZLIB"] = bool(self.options.with_zlib) + tc.variables["RE2_SOURCE"] = "SYSTEM" + tc.variables["ZLIB_SOURCE"] = "SYSTEM" + tc.variables["xsimd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_ZSTD"] = bool(self.options.with_zstd) + if Version(self.version) >= "2.0": + tc.variables["zstd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() + tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() else: - self._cmake.definitions["ZSTD_SOURCE"] = "SYSTEM" + tc.variables["ZSTD_SOURCE"] = "SYSTEM" if self.options.with_zstd: - self._cmake.definitions["ARROW_ZSTD_USE_SHARED"] = self.options["zstd"].shared - self._cmake.definitions["ORC_SOURCE"] = "SYSTEM" - self._cmake.definitions["ARROW_WITH_THRIFT"] = self._with_thrift() - self._cmake.definitions["Thrift_SOURCE"] = "SYSTEM" + tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.options["zstd"].shared) + tc.variables["ORC_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_THRIFT"] = self._with_thrift() + tc.variables["Thrift_SOURCE"] = "SYSTEM" if self._with_thrift(): - self._cmake.definitions["THRIFT_VERSION"] = self.deps_cpp_info["thrift"].version # a recent thrift does not require boost - self._cmake.definitions["ARROW_THRIFT_USE_SHARED"] = self.options["thrift"].shared - self._cmake.definitions["ARROW_USE_OPENSSL"] = self._with_openssl() + tc.variables["THRIFT_VERSION"] = bool(self.deps_cpp_info["thrift"].version) # a recent thrift does not require boost + tc.variables["ARROW_THRIFT_USE_SHARED"] = bool(self.options["thrift"].shared) + tc.variables["ARROW_USE_OPENSSL"] = self._with_openssl() if self._with_openssl(): - self._cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath.replace("\\", "/") - self._cmake.definitions["ARROW_OPENSSL_USE_SHARED"] = self.options["openssl"].shared + tc.variables["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath.replace("\\", "/") + tc.variables["ARROW_OPENSSL_USE_SHARED"] = bool(self.options["openssl"].shared) if self._with_boost(): - self._cmake.definitions["ARROW_BOOST_USE_SHARED"] = self.options["boost"].shared - self._cmake.definitions["ARROW_S3"] = self.options.with_s3 - self._cmake.definitions["AWSSDK_SOURCE"] = "SYSTEM" - - self._cmake.definitions["ARROW_BUILD_UTILITIES"] = self.options.cli - self._cmake.definitions["ARROW_BUILD_INTEGRATION"] = False - self._cmake.definitions["ARROW_INSTALL_NAME_RPATH"] = False - self._cmake.definitions["ARROW_BUILD_EXAMPLES"] = False - self._cmake.definitions["ARROW_BUILD_TESTS"] = False - self._cmake.definitions["ARROW_ENABLE_TIMING_TESTS"] = False - self._cmake.definitions["ARROW_BUILD_BENCHMARKS"] = False - self._cmake.definitions["LLVM_SOURCE"] = "SYSTEM" - self._cmake.definitions["ARROW_WITH_UTF8PROC"] = self._with_utf8proc() - self._cmake.definitions["utf8proc_SOURCE"] = "SYSTEM" + tc.variables["ARROW_BOOST_USE_SHARED"] = bool(self.options["boost"].shared) + tc.variables["ARROW_S3"] = bool(self.options.with_s3) + tc.variables["AWSSDK_SOURCE"] = "SYSTEM" + tc.variables["ARROW_BUILD_UTILITIES"] = bool(self.options.cli) + tc.variables["ARROW_BUILD_INTEGRATION"] = False + tc.variables["ARROW_INSTALL_NAME_RPATH"] = False + tc.variables["ARROW_BUILD_EXAMPLES"] = False + tc.variables["ARROW_BUILD_TESTS"] = False + tc.variables["ARROW_ENABLE_TIMING_TESTS"] = False + tc.variables["ARROW_BUILD_BENCHMARKS"] = False + tc.variables["LLVM_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_UTF8PROC"] = self._with_utf8proc() + tc.variables["ARROW_BOOST_REQUIRED"] = self._with_boost() + tc.variables["utf8proc_SOURCE"] = "SYSTEM" if self._with_utf8proc(): - self._cmake.definitions["ARROW_UTF8PROC_USE_SHARED"] = self.options["utf8proc"].shared - self._cmake.definitions["BUILD_WARNING_LEVEL"] = "PRODUCTION" - if self.settings.compiler == "Visual Studio": - self._cmake.definitions["ARROW_USE_STATIC_CRT"] = "MT" in str(self.settings.compiler.runtime) - + tc.variables["ARROW_UTF8PROC_USE_SHARED"] = bool(self.options["utf8proc"].shared) + tc.variables["BUILD_WARNING_LEVEL"] = "PRODUCTION" + if is_msvc(self): + tc.variables["ARROW_USE_STATIC_CRT"] = "MT" in str(self.settings.compiler.runtime) if self._with_llvm(): - self._cmake.definitions["LLVM_DIR"] = self.deps_cpp_info["llvm-core"].rootpath.replace("\\", "/") - self._cmake.configure() - return self._cmake + tc.variables["LLVM_DIR"] = self.deps_cpp_info["llvm-core"].rootpath.replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if tools.Version(self.version) >= "7.0.0": - for filename in glob.glob(os.path.join(self._source_subfolder, "cpp", "cmake_modules", "Find*.cmake")): + apply_conandata_patches(self) + if Version(self.version) >= "7.0.0": + for filename in glob.glob(os.path.join(self.source_folder, "cpp", "cmake_modules", "Find*.cmake")): if os.path.basename(filename) not in [ "FindArrow.cmake", "FindArrowCUDA.cmake", @@ -476,27 +498,27 @@ def _patch_sources(self): def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake =CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "cpp")) cmake.build() def package(self): - self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") - self.copy("NOTICE.txt", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="NOTICE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake =CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def _lib_name(self, name): - if self.settings.compiler == "Visual Studio" and not self.options.shared: + if is_msvc(self) and not self.options.shared: return "{}_static".format(name) else: return "{}".format(name) def package_id(self): - self.info.options.with_jemalloc = self._with_jemalloc() self.info.options.with_gflags = self._with_gflags() self.info.options.with_protobuf = self._with_protobuf() self.info.options.with_re2 = self._with_re2() @@ -572,9 +594,9 @@ def package_info(self): if self.options.gandiva: # FIXME: only filesystem component is used self.cpp_info.components["libgandiva"].requires.append("boost::boost") - if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < tools.Version("4.9"): + if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): self.cpp_info.components["libparquet"].requires.append("boost::boost") - if tools.Version(self.version) >= "2.0": + if Version(self.version) >= "2.0": # FIXME: only headers components is used self.cpp_info.components["libarrow"].requires.append("boost::boost") if self._with_openssl(): @@ -585,6 +607,8 @@ def package_info(self): self.cpp_info.components["libarrow"].requires.append("glog::glog") if self._with_jemalloc(): self.cpp_info.components["libarrow"].requires.append("jemalloc::jemalloc") + if self.options.with_mimalloc: + self.cpp_info.components["libarrow"].requires.append("mimalloc::mimalloc") if self._with_re2(): self.cpp_info.components["libgandiva"].requires.append("re2::re2") if self._with_llvm(): @@ -601,7 +625,7 @@ def package_info(self): self.cpp_info.components["libarrow"].requires.append("cuda::cuda") if self.options.with_hiveserver2: self.cpp_info.components["libarrow"].requires.append("hiveserver2::hiveserver2") - if self.options.with_json: + if self._with_rapidjson(): self.cpp_info.components["libarrow"].requires.append("rapidjson::rapidjson") if self.options.with_s3: self.cpp_info.components["libarrow"].requires.append("aws-sdk-cpp::s3") @@ -625,6 +649,9 @@ def package_info(self): self.cpp_info.components["libarrow"].requires.append("zlib::zlib") if self.options.with_zstd: self.cpp_info.components["libarrow"].requires.append("zstd::zstd") + if self._with_boost(): + self.cpp_info.components["libarrow"].requires.append("boost::boost") + if self._with_grpc(): + self.cpp_info.components["libarrow"].requires.append("grpc::grpc") if self._with_flight_rpc(): - self.cpp_info.components["libarrow_flight"].requires.append("grpc::grpc") self.cpp_info.components["libarrow_flight"].requires.append("protobuf::protobuf") diff --git a/recipes/arrow/all/patches/1.0.0-0001-cmake.patch b/recipes/arrow/all/patches/1.0.0-0001-cmake.patch deleted file mode 100644 index c227f1860e305..0000000000000 --- a/recipes/arrow/all/patches/1.0.0-0001-cmake.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- cpp/cmake_modules/DefineOptions.cmake -+++ cpp/cmake_modules/DefineOptions.cmake -@@ -76,7 +76,7 @@ macro(define_option_string name description default) - endmacro() - - # Top level cmake dir --if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") -+if(1) - #---------------------------------------------------------------------- - set_option_category("Compile and link") - ---- cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -854,7 +854,7 @@ if(ARROW_WITH_SNAPPY) - # location. - # https://bugzilla.redhat.com/show_bug.cgi?id=1679727 - # https://src.fedoraproject.org/rpms/snappy/pull-request/1 -- find_package(Snappy QUIET HINTS "${CMAKE_ROOT}/Modules/") -+ find_package(Snappy REQUIRED) - if(NOT Snappy_FOUND) - find_package(SnappyAlt) - endif() -@@ -866,7 +866,7 @@ - elseif(Snappy_SOURCE STREQUAL "SYSTEM") - # SnappyConfig.cmake is not installed on Ubuntu/Debian - # TODO: Make a bug report upstream -- find_package(Snappy HINTS "${CMAKE_ROOT}/Modules/") -+ find_package(Snappy REQUIRED) - if(NOT Snappy_FOUND) - find_package(SnappyAlt REQUIRED) - endif() -@@ -1139,8 +1139,8 @@ - build_gflags() - elseif(gflags_SOURCE STREQUAL "SYSTEM") -- # gflagsConfig.cmake is not installed on Ubuntu/Debian -- # TODO: Make a bug report upstream -- find_package(gflags ${ARROW_GFLAGS_REQUIRED_VERSION}) -+ find_package(gflags REQUIRED) -+ add_library(gflags-shared INTERFACE) -+ target_link_libraries(gflags-shared INTERFACE gflags::gflags) - if(NOT gflags_FOUND) - find_package(gflagsAlt ${ARROW_GFLAGS_REQUIRED_VERSION} REQUIRED) - endif() -@@ -1329,6 +1329,6 @@ macro(build_protobuf) - endmacro() -- - if(ARROW_WITH_PROTOBUF) -+ find_package(Protobuf REQUIRED) - if(ARROW_WITH_GRPC) - # gRPC 1.21.0 or later require Protobuf 3.7.0 or later. - set(ARROW_PROTOBUF_REQUIRED_VERSION "3.7.0") -@@ -1365,9 +1365,9 @@ if(ARROW_WITH_PROTOBUF) - set(ARROW_PROTOBUF_LIBPROTOC arrow::protobuf::libprotoc) - else() - if(NOT TARGET protobuf::libprotoc) -+ set(Protobuf_PROTOC_LIBRARY protoc) - if(PROTOBUF_PROTOC_LIBRARY AND NOT Protobuf_PROTOC_LIBRARY) -- # Old CMake versions have a different casing. -- set(Protobuf_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY}) -+ set(Protobuf_PROTOC_LIBRARY protoc) - endif() - if(NOT Protobuf_PROTOC_LIBRARY) - message(FATAL_ERROR "libprotoc was set to ${Protobuf_PROTOC_LIBRARY}") -@@ -1802,7 +1802,7 @@ if(ARROW_WITH_RAPIDJSON) - elseif(RapidJSON_SOURCE STREQUAL "SYSTEM") - # Fedora packages place the package information at the wrong location. - # https://bugzilla.redhat.com/show_bug.cgi?id=1680400 -- find_package(RapidJSON ${ARROW_RAPIDJSON_REQUIRED_VERSION} HINTS "${CMAKE_ROOT}") -+ find_package(RapidJSON REQUIRED) - if(RapidJSON_FOUND) - set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS}) - else() -@@ -2088,7 +2088,7 @@ if(ARROW_WITH_BZ2) - PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") - endif() -- include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") -+ include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") - endif() - - macro(build_utf8proc) ---- cpp/cmake_modules/SetupCxxFlags.cmake -+++ cpp/cmake_modules/SetupCxxFlags.cmake -@@ -188,7 +188,7 @@ - message(STATUS "Arrow build warning level: ${BUILD_WARNING_LEVEL}") - - macro(arrow_add_werror_if_debug) -- if("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") -+ if(0) - # Treat all compiler warnings as errors - if(MSVC) - set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX") diff --git a/recipes/arrow/all/patches/1.0.0-0002-jemalloc.patch b/recipes/arrow/all/patches/1.0.0-0002-jemalloc.patch deleted file mode 100644 index 7e8bd1ed08039..0000000000000 --- a/recipes/arrow/all/patches/1.0.0-0002-jemalloc.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -1407,6 +1407,6 @@ endif() - # jemalloc - Unix-only high-performance allocator -- - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1465,6 +1465,8 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED) -+endif() - endif() -- - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft ---- cpp/src/arrow/CMakeLists.txt -+++ cpp/src/arrow/CMakeLists.txt -@@ -292,7 +292,7 @@ - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) - list(APPEND _allocator_dependencies mimalloc_ep) ---- cpp/src/arrow/memory_pool.cc -+++ cpp/src/arrow/memory_pool.cc -@@ -31,7 +31,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch b/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch new file mode 100644 index 0000000000000..5f0f6f4c52d5c --- /dev/null +++ b/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch @@ -0,0 +1,22 @@ +diff --git a/cpp/src/arrow/vendored/datetime/date.h b/cpp/src/arrow/vendored/datetime/date.h +index 02a4909..2b168d2 100644 +--- a/cpp/src/arrow/vendored/datetime/date.h ++++ b/cpp/src/arrow/vendored/datetime/date.h +@@ -5152,7 +5152,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, + if (modified == CharT{}) + #endif + { +- auto h = *fmt == CharT{'I'} ? make12(hms.hours()) : hms.hours(); ++ auto h = *fmt == CharT{'I'} ? arrow_vendored::date::make12(hms.hours()) : hms.hours(); + if (h < hours{10}) + os << CharT{'0'}; + os << h.count(); +@@ -5366,7 +5366,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, + save_ostream _(os); + os.fill('0'); + os.width(2); +- os << make12(tod.hours()).count() << CharT{':'}; ++ os << arrow_vendored::date::make12(tod.hours()).count() << CharT{':'}; + os.width(2); + os << tod.minutes().count() << CharT{':'}; + os.width(2); diff --git a/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch b/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch new file mode 100644 index 0000000000000..eb6816262214b --- /dev/null +++ b/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch @@ -0,0 +1,333 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 300f043..0127a7a 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -654,7 +654,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + endif() +@@ -664,7 +664,7 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) + endif() + + if(ARROW_WITH_SNAPPY) +@@ -800,8 +800,11 @@ endif() + + if(ARROW_MIMALLOC) + add_definitions(-DARROW_MIMALLOC) +- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) ++ if (TARGET mimalloc-static) ++ list(APPEND ARROW_LINK_LIBS mimalloc-static) ++ else() ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) ++ endif() + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake +index eb10ebe..9c81017 100644 +--- a/cpp/cmake_modules/BuildUtils.cmake ++++ b/cpp/cmake_modules/BuildUtils.cmake +@@ -165,10 +165,10 @@ function(create_merged_static_lib output_target) + set(ar_script_path ${CMAKE_BINARY_DIR}/${ARG_NAME}.ar) + + file(WRITE ${ar_script_path}.in "CREATE ${output_lib_path}\n") +- file(APPEND ${ar_script_path}.in "ADDLIB $\n") ++ file(APPEND ${ar_script_path}.in "ADDLIB $\n") + + foreach(lib ${ARG_TO_MERGE}) +- file(APPEND ${ar_script_path}.in "ADDLIB $\n") ++ file(APPEND ${ar_script_path}.in "ADDLIB $\n") + endforeach() + + file(APPEND ${ar_script_path}.in "SAVE\nEND\n") +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index 807e2b9..016c8db 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -154,16 +154,7 @@ macro(build_dependency DEPENDENCY_NAME) + endmacro() + + macro(resolve_dependency DEPENDENCY_NAME) +- if(${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO") +- find_package(${DEPENDENCY_NAME} MODULE) +- if(NOT ${${DEPENDENCY_NAME}_FOUND}) +- build_dependency(${DEPENDENCY_NAME}) +- endif() +- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "BUNDLED") +- build_dependency(${DEPENDENCY_NAME}) +- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM") +- find_package(${DEPENDENCY_NAME} REQUIRED) +- endif() ++ find_package(${DEPENDENCY_NAME} REQUIRED) + endmacro() + + macro(resolve_dependency_with_version DEPENDENCY_NAME REQUIRED_VERSION) +@@ -765,6 +756,7 @@ endif() + # - Tests need Boost at runtime. + # - S3FS and Flight benchmarks need Boost at runtime. + if(ARROW_BUILD_INTEGRATION ++ OR ARROW_BOOST_REQUIRED + OR ARROW_BUILD_TESTS + OR ARROW_GANDIVA + OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) +@@ -785,7 +777,7 @@ if(ARROW_BOOST_REQUIRED) + elseif(BOOST_SOURCE STREQUAL "BUNDLED") + build_boost() + elseif(BOOST_SOURCE STREQUAL "SYSTEM") +- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) ++ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) + endif() + + if(TARGET Boost::system) +@@ -936,11 +928,11 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli) ++ resolve_dependency(brotli) + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon ++ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) +- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) ++ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) + endif() + + if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) +@@ -1146,9 +1138,10 @@ if(ARROW_NEED_GFLAGS) + endif() + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) ++ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) + +- if(NOT TARGET ${GFLAGS_LIBRARIES}) ++ if(0) + if(TARGET gflags-shared) + set(GFLAGS_LIBRARIES gflags-shared) + elseif(TARGET gflags_shared) +@@ -1237,12 +1230,13 @@ endmacro() + if(ARROW_WITH_THRIFT) + # We already may have looked for Thrift earlier, when considering whether + # to build Boost, so don't look again if already found. +- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) ++ if(0) + # Thrift c++ code generated by 0.13 requires 0.11 or greater + resolve_dependency_with_version(Thrift 0.11.0) + endif() ++ find_package(Thrift CONFIG REQUIRED) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + endif() + + # ---------------------------------------------------------------------- +@@ -1407,6 +1401,7 @@ endif() + # jemalloc - Unix-only high-performance allocator + + if(ARROW_JEMALLOC) ++if(0) + message(STATUS "Building (vendored) jemalloc from source") + # We only use a vendored jemalloc as we want to control its version. + # Also our build of jemalloc is specially prefixed so that it will not +@@ -1465,12 +1460,18 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- + # mimalloc - Cross-platform high-performance allocator, from Microsoft + + if(ARROW_MIMALLOC) ++if(0) + message(STATUS "Building (vendored) mimalloc from source") + # We only use a vendored mimalloc as we want to control its build options. + +@@ -1518,6 +1519,11 @@ if(ARROW_MIMALLOC) + add_dependencies(toolchain mimalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) ++else() ++ find_package(mimalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- +@@ -1918,11 +1924,16 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4) ++ resolve_dependency(lz4) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) +- include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) ++ if(TARGET LZ4::lz4_static) ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() ++ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) + endif() + + macro(build_zstd) +@@ -2037,10 +2048,10 @@ macro(build_re2) + endmacro() + + if(ARROW_GANDIVA) +- resolve_dependency(RE2) ++ resolve_dependency(re2) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${RE2_INCLUDE_DIR}) + endif() + +@@ -2480,17 +2491,24 @@ if(ARROW_WITH_GRPC) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) ++ # get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) ++ if(grpc_INCLUDE_DIRS_RELEASE) ++ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) ++ elseif(grpc_INCLUDE_DIRS_DEBUG) ++ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) ++ endif() + include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) ++ include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(GRPC_VENDORED) + set(GRPCPP_PP_INCLUDE TRUE) + else() + # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp + # depending on the gRPC version. +- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") ++ if(EXISTS ${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) + set(GRPCPP_PP_INCLUDE TRUE) +- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") ++ elseif(EXISTS ${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) + set(GRPCPP_PP_INCLUDE FALSE) + else() + message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index 5797a78..da6bd4d 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -292,10 +292,15 @@ set(ARROW_TESTING_SRCS + + set(_allocator_dependencies "") # Empty list + if(ARROW_JEMALLOC) +- list(APPEND _allocator_dependencies jemalloc_ep) ++ list(APPEND _allocator_dependencies jemalloc::jemalloc) + endif() ++ + if(ARROW_MIMALLOC) +- list(APPEND _allocator_dependencies mimalloc_ep) ++ if (TARGET mimalloc-static) ++ list(APPEND _allocator_dependencies mimalloc-static) ++ else() ++ list(APPEND _allocator_dependencies mimalloc) ++ endif() + endif() + + if(_allocator_dependencies) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index 784bf7b..8f005a5 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -31,7 +31,7 @@ + // Needed to support jemalloc 3 and 4 + #define JEMALLOC_MANGLE + // Explicitly link to our version of jemalloc +-#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" ++#include "jemalloc/jemalloc.h" + #endif + + #ifdef ARROW_MIMALLOC +diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt +index 85e8db6..cd70c63 100644 +--- a/cpp/src/gandiva/CMakeLists.txt ++++ b/cpp/src/gandiva/CMakeLists.txt +@@ -25,7 +25,7 @@ add_custom_target(gandiva-benchmarks) + + add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) + +-find_package(LLVMAlt REQUIRED) ++find_package(LLVM REQUIRED) + + if(LLVM_VERSION_MAJOR LESS "10") + set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) +@@ -88,9 +88,16 @@ set(SRC_FILES + random_generator_holder.cc + ${GANDIVA_PRECOMPILED_CC_PATH}) + +-set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE RE2::re2) + +-set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE RE2::re2) ++ function(get_all_targets var) ++ set(targets) ++ get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR}) ++ set(${var} ${targets} PARENT_SCOPE) ++endfunction() ++ ++set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core re2::re2) ++ ++set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core re2::re2) + + if(ARROW_GANDIVA_STATIC_LIBSTDCPP + AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)) +@@ -131,7 +138,7 @@ add_arrow_lib(gandiva + arrow_dependencies + precompiled + EXTRA_INCLUDES +- $ ++ $ + SHARED_LINK_FLAGS + ${GANDIVA_SHARED_LINK_FLAGS} + SHARED_LINK_LIBS +@@ -203,7 +210,7 @@ endfunction() + + set(GANDIVA_INTERNALS_TEST_ARGUMENTS) + if(WIN32) +- list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS LLVM::LLVM_INTERFACE) ++ list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS llvm-core::llvm-core) + endif() + add_gandiva_test(internals-test + SOURCES +@@ -225,9 +232,9 @@ add_gandiva_test(internals-test + decimal_type_util_test.cc + random_generator_holder_test.cc + EXTRA_DEPENDENCIES +- LLVM::LLVM_INTERFACE ++ llvm-core::llvm-core + EXTRA_INCLUDES +- $ ++ $ + ${GANDIVA_INTERNALS_TEST_ARGUMENTS}) + + if(ARROW_GANDIVA_JAVA) diff --git a/recipes/arrow/all/patches/2.0.0-0001-cmake.patch b/recipes/arrow/all/patches/2.0.0-0001-cmake.patch deleted file mode 100644 index e275b8cfe872b..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0001-cmake.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- cpp/cmake_modules/DefineOptions.cmake -+++ cpp/cmake_modules/DefineOptions.cmake -@@ -76,7 +76,7 @@ macro(define_option_string name description default) - endmacro() - - # Top level cmake dir --if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") -+if(1) - #---------------------------------------------------------------------- - set_option_category("Compile and link") - ---- cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -1856,3 +1856,3 @@ -- find_package(RapidJSON ${ARROW_RAPIDJSON_REQUIRED_VERSION} HINTS "${CMAKE_ROOT}") -+ find_package(RapidJSON ${ARROW_RAPIDJSON_REQUIRED_VERSION} HINTS "${CMAKE_ROOT}" REQUIRED) - if(RapidJSON_FOUND) -- set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS}) -+ set(RAPIDJSON_INCLUDE_DIR ${RapidJSON_INCLUDE_DIRS}) diff --git a/recipes/arrow/all/patches/2.0.0-0002-jemalloc.patch b/recipes/arrow/all/patches/2.0.0-0002-jemalloc.patch deleted file mode 100644 index 6fd3afbe4a1db..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0002-jemalloc.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -1461,6 +1461,6 @@ - # jemalloc - Unix-only high-performance allocator -- - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1519,6 +1519,8 @@ - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED) -+endif() - endif() -- - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft ---- cpp/src/arrow/CMakeLists.txt -+++ cpp/src/arrow/CMakeLists.txt -@@ -307,7 +307,7 @@ - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) - list(APPEND _allocator_dependencies mimalloc_ep) ---- cpp/src/arrow/memory_pool.cc -+++ cpp/src/arrow/memory_pool.cc -@@ -31,7 +31,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/patches/2.0.0-0006-gandiva-llvm-re2.patch b/recipes/arrow/all/patches/2.0.0-0006-gandiva-llvm-re2.patch deleted file mode 100644 index 84a3edc7fde19..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0006-gandiva-llvm-re2.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- cpp/CMakeLists.txt -+++ cpp/CMakeLists.txt -@@ -109,7 +109,7 @@ set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support") - set(ARROW_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") - set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}") - --set(ARROW_LLVM_VERSIONS "10" "9" "8" "7") -+set(ARROW_LLVM_VERSIONS "12" "11" "10" "9" "8" "7") - list(GET ARROW_LLVM_VERSIONS 0 ARROW_LLVM_VERSION_PRIMARY) - string(REGEX - REPLACE "^([0-9]+)(\\..+)?" "\\1" ARROW_LLVM_VERSION_PRIMARY_MAJOR - ---- cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -2092,10 +2092,11 @@ macro(build_re2) - endmacro() - - if(ARROW_GANDIVA) -- resolve_dependency(RE2) -+ find_package(re2 REQUIRED) -+ resolve_dependency(re2) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) -+ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) - endif() - ---- cpp/src/gandiva/CMakeLists.txt -+++ cpp/src/gandiva/CMakeLists.txt -@@ -25,8 +25,14 @@ add_custom_target(gandiva-benchmarks) - - add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) - -+# Now LLVMAlt is only for finding clang/llvm-link - find_package(LLVMAlt REQUIRED) - -+find_package(llvm-core REQUIRED) -+ -+string(REPLACE "." ";" VERSION_LIST ${llvm-core_VERSION}) -+list(GET VERSION_LIST 0 LLVM_VERSION_MAJOR) -+ - if(LLVM_VERSION_MAJOR LESS "10") - set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) - else() -@@ -88,9 +94,9 @@ set(SRC_FILES - random_generator_holder.cc - ${GANDIVA_PRECOMPILED_CC_PATH}) - --set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE RE2::re2) -+set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core re2::re2) - --set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE RE2::re2) -+set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core re2::re2) - - if(ARROW_GANDIVA_STATIC_LIBSTDCPP - AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)) -@@ -131,7 +137,7 @@ add_arrow_lib(gandiva - arrow_dependencies - precompiled - EXTRA_INCLUDES -- $ -+ $ - SHARED_LINK_FLAGS - ${GANDIVA_SHARED_LINK_FLAGS} - SHARED_LINK_LIBS -@@ -225,9 +231,9 @@ add_gandiva_test(internals-test - decimal_type_util_test.cc - random_generator_holder_test.cc - EXTRA_DEPENDENCIES -- LLVM::LLVM_INTERFACE -+ llvm-core::llvm-core - EXTRA_INCLUDES -- $ -+ $ - ${GANDIVA_INTERNALS_TEST_ARGUMENTS}) - - if(ARROW_GANDIVA_JAVA) diff --git a/recipes/arrow/all/patches/2.0.0-0007-fix-protoc-cmake.patch b/recipes/arrow/all/patches/2.0.0-0007-fix-protoc-cmake.patch deleted file mode 100644 index 2e1c27893d15d..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0007-fix-protoc-cmake.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -1452,7 +1452,7 @@ if(ARROW_WITH_PROTOBUF) - message(STATUS "Found protoc: ${PROTOBUF_PROTOC_EXECUTABLE}") - # Protobuf_PROTOC_LIBRARY is set by all versions of FindProtobuf.cmake - message(STATUS "Found libprotoc: ${Protobuf_PROTOC_LIBRARY}") -- get_target_property(PROTOBUF_LIBRARY ${ARROW_PROTOBUF_LIBPROTOBUF} IMPORTED_LOCATION) -+ # get_target_property(PROTOBUF_LIBRARY ${ARROW_PROTOBUF_LIBPROTOBUF} IMPORTED_LOCATION) - message(STATUS "Found libprotobuf: ${PROTOBUF_LIBRARY}") - message(STATUS "Found protobuf headers: ${PROTOBUF_INCLUDE_DIR}") - endif() diff --git a/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch b/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch new file mode 100644 index 0000000000000..7153d641e0c61 --- /dev/null +++ b/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch @@ -0,0 +1,273 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 515e6af..7488161 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -109,7 +109,7 @@ set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support") + set(ARROW_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") + set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}") + +-set(ARROW_LLVM_VERSIONS "10" "9" "8" "7") ++set(ARROW_LLVM_VERSIONS "13" "12" "11" "10" "9" "8" "7") + list(GET ARROW_LLVM_VERSIONS 0 ARROW_LLVM_VERSION_PRIMARY) + string(REGEX + REPLACE "^([0-9]+)(\\..+)?" "\\1" ARROW_LLVM_VERSION_PRIMARY_MAJOR +@@ -667,7 +667,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + if(Brotli_SOURCE STREQUAL "SYSTEM") +@@ -683,9 +683,9 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) ++ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) + if(Lz4_SOURCE STREQUAL "SYSTEM") +- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS lz4::lz4) + endif() + endif() + +@@ -842,8 +842,14 @@ endif() + + if(ARROW_MIMALLOC) + add_definitions(-DARROW_MIMALLOC) +- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) ++ if (TARGET mimalloc-static) ++ list(APPEND ARROW_LINK_LIBS mimalloc-static) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) ++ else() ++ list(APPEND ARROW_LINK_LIBS mimalloc) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) ++ endif() ++ + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index cc37a3c..8fe6db9 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -171,6 +171,7 @@ macro(provide_find_module DEPENDENCY_NAME) + endmacro() + + macro(resolve_dependency DEPENDENCY_NAME) ++if(0) + set(options) + set(one_value_args REQUIRED_VERSION) + cmake_parse_arguments(ARG +@@ -207,6 +208,14 @@ macro(resolve_dependency DEPENDENCY_NAME) + provide_find_module(${DEPENDENCY_NAME}) + list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) + endif() ++else() ++ if(ARG_REQUIRED_VERSION) ++ find_package(${DEPENDENCY_NAME} ${ARG_REQUIRED_VERSION} REQUIRED) ++ else() ++ find_package(${DEPENDENCY_NAME} REQUIRED) ++ endif() ++ list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) ++endif() + endmacro() + + # ---------------------------------------------------------------------- +@@ -826,6 +835,7 @@ endif() + # - Tests need Boost at runtime. + # - S3FS and Flight benchmarks need Boost at runtime. + if(ARROW_BUILD_INTEGRATION ++ OR ARROW_BOOST_REQUIRED + OR ARROW_BUILD_TESTS + OR ARROW_GANDIVA + OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) +@@ -846,7 +856,7 @@ if(ARROW_BOOST_REQUIRED) + elseif(BOOST_SOURCE STREQUAL "BUNDLED") + build_boost() + elseif(BOOST_SOURCE STREQUAL "SYSTEM") +- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) ++ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) + endif() + + if(TARGET Boost::system) +@@ -973,11 +983,11 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli) ++ resolve_dependency(brotli) + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon ++ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) +- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) ++ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) + endif() + + if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) +@@ -1200,9 +1210,10 @@ if(ARROW_NEED_GFLAGS) + endif() + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) ++ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) + +- if(NOT TARGET ${GFLAGS_LIBRARIES}) ++ if(0) + if(TARGET gflags-shared) + set(GFLAGS_LIBRARIES gflags-shared) + elseif(TARGET gflags_shared) +@@ -1291,12 +1302,13 @@ endmacro() + if(ARROW_WITH_THRIFT) + # We already may have looked for Thrift earlier, when considering whether + # to build Boost, so don't look again if already found. +- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) ++ if(0) + # Thrift c++ code generated by 0.13 requires 0.11 or greater + resolve_dependency(Thrift REQUIRED_VERSION 0.11.0) + endif() ++ find_package(Thrift CONFIG REQUIRED) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + endif() + + # ---------------------------------------------------------------------- +@@ -1461,6 +1473,7 @@ endif() + # jemalloc - Unix-only high-performance allocator + + if(ARROW_JEMALLOC) ++if(0) + message(STATUS "Building (vendored) jemalloc from source") + # We only use a vendored jemalloc as we want to control its version. + # Also our build of jemalloc is specially prefixed so that it will not +@@ -1519,12 +1532,18 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- + # mimalloc - Cross-platform high-performance allocator, from Microsoft + + if(ARROW_MIMALLOC) ++if(0) + message(STATUS "Building (vendored) mimalloc from source") + # We only use a vendored mimalloc as we want to control its build options. + +@@ -1572,6 +1591,11 @@ if(ARROW_MIMALLOC) + add_dependencies(toolchain mimalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) ++else() ++ find_package(mimalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- +@@ -1971,11 +1995,16 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4) ++ resolve_dependency(lz4) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) +- include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) ++ if(TARGET LZ4::lz4_static) ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() ++ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) + endif() + + macro(build_zstd) +@@ -2090,10 +2119,10 @@ macro(build_re2) + endmacro() + + if(ARROW_GANDIVA) +- resolve_dependency(RE2) ++ resolve_dependency(re2) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${RE2_INCLUDE_DIR}) + endif() + +@@ -2541,17 +2570,24 @@ if(ARROW_WITH_GRPC) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) ++ if(grpc_INCLUDE_DIRS_RELEASE) ++ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) ++ elseif(grpc_INCLUDE_DIRS_DEBUG) ++ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) ++ endif() ++ + include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) ++ include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(GRPC_VENDORED) + set(GRPCPP_PP_INCLUDE TRUE) + else() + # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp + # depending on the gRPC version. +- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") ++ if(EXISTS ${gRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) + set(GRPCPP_PP_INCLUDE TRUE) +- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") ++ elseif(EXISTS ${gRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) + set(GRPCPP_PP_INCLUDE FALSE) + else() + message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index 2751254..842fc9e 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -307,10 +307,14 @@ set(ARROW_TESTING_SRCS + + set(_allocator_dependencies "") # Empty list + if(ARROW_JEMALLOC) +- list(APPEND _allocator_dependencies jemalloc_ep) ++ list(APPEND _allocator_dependencies jemalloc::jemalloc) + endif() + if(ARROW_MIMALLOC) +- list(APPEND _allocator_dependencies mimalloc_ep) ++ if (TARGET mimalloc-static) ++ list(APPEND _allocator_dependencies mimalloc-static) ++ else() ++ list(APPEND _allocator_dependencies mimalloc) ++ endif() + endif() + + if(_allocator_dependencies) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index 784bf7b..8f005a5 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -31,7 +31,7 @@ + // Needed to support jemalloc 3 and 4 + #define JEMALLOC_MANGLE + // Explicitly link to our version of jemalloc +-#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" ++#include "jemalloc/jemalloc.h" + #endif + + #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/patches/7.0.0-0001-cmake.patch b/recipes/arrow/all/patches/7.0.0-0001-cmake.patch deleted file mode 100644 index 3a476ed4aeddb..0000000000000 --- a/recipes/arrow/all/patches/7.0.0-0001-cmake.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake -index 0a43ec1..c468d48 100644 ---- a/cpp/cmake_modules/DefineOptions.cmake -+++ b/cpp/cmake_modules/DefineOptions.cmake -@@ -82,7 +82,7 @@ macro(define_option_string name description default) - endmacro() - - # Top level cmake dir --if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") -+if(1) - #---------------------------------------------------------------------- - set_option_category("Compile and link") - diff --git a/recipes/arrow/all/patches/7.0.0-0002-jemalloc.patch b/recipes/arrow/all/patches/7.0.0-0002-jemalloc.patch deleted file mode 100644 index 323f5178065e6..0000000000000 --- a/recipes/arrow/all/patches/7.0.0-0002-jemalloc.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index b984bc1..84975e2 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -323,7 +323,7 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) - list(APPEND _allocator_dependencies mimalloc_ep) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index cf8bf64..cf8966b 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -48,7 +48,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/patches/7.0.0-0005-use-find-package.patch b/recipes/arrow/all/patches/7.0.0-0005-use-find-package.patch deleted file mode 100644 index 64cfa3e6d8f47..0000000000000 --- a/recipes/arrow/all/patches/7.0.0-0005-use-find-package.patch +++ /dev/null @@ -1,418 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 2d7baf1..c2e86e0 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -715,7 +715,7 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) - if(Lz4_SOURCE STREQUAL "SYSTEM") - list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) - endif() -@@ -901,8 +901,8 @@ endif() - if(ARROW_JEMALLOC) - add_definitions(-DARROW_JEMALLOC) - add_definitions(-DARROW_JEMALLOC_INCLUDE_DIR=${JEMALLOC_INCLUDE_DIR}) -- list(APPEND ARROW_LINK_LIBS jemalloc::jemalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS jemalloc::jemalloc) -+ list(APPEND ARROW_LINK_LIBS jemalloc) -+ list(APPEND ARROW_STATIC_LINK_LIBS jemalloc) - endif() - - if(ARROW_MIMALLOC) -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index bc38952..84fc279 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -953,14 +953,7 @@ else() - endif() - - if(ARROW_BOOST_REQUIRED) -- resolve_dependency(Boost -- HAVE_ALT -- TRUE -- REQUIRED_VERSION -- ${ARROW_BOOST_REQUIRED_VERSION} -- IS_RUNTIME_DEPENDENCY -- # libarrow.so doesn't depend on libboost*. -- FALSE) -+ find_package(Boost CONFIG REQUIRED) - - if(TARGET Boost::system) - set(BOOST_SYSTEM_LIBRARY Boost::system) -@@ -1038,6 +1031,7 @@ macro(build_snappy) - endmacro() - - if(ARROW_WITH_SNAPPY) -+ if(0) - resolve_dependency(Snappy PC_PACKAGE_NAMES snappy) - if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND) - get_target_property(SNAPPY_LIB Snappy::snappy IMPORTED_LOCATION) -@@ -1046,6 +1040,8 @@ if(ARROW_WITH_SNAPPY) - # TODO: Don't use global includes but rather target_include_directories - get_target_property(SNAPPY_INCLUDE_DIRS Snappy::snappy INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${SNAPPY_INCLUDE_DIRS}) -+ endif() -+ find_package(Snappy REQUIRED) - endif() - - # ---------------------------------------------------------------------- -@@ -1108,7 +1104,7 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) -+ find_package(Brotli REQUIRED) - # TODO: Don't use global includes but rather target_include_directories - get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) -@@ -1156,6 +1152,15 @@ if(PARQUET_REQUIRE_ENCRYPTION - set(OpenSSL_USE_STATIC_LIBS ON) - set(OPENSSL_USE_STATIC_LIBS ON) - find_package(OpenSSL ${ARROW_OPENSSL_REQUIRED_VERSION} REQUIRED) -+ find_package(OpenSSL REQUIRED CONFIG) -+ message("OPENSSL_FOUND: ${OPENSSL_FOUND}") -+ message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") -+ message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}") -+ message("OPENSSL_CRYPTO_LIBRARIES: ${OPENSSL_CRYPTO_LIBRARIES}") -+ message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}") -+ message("OPENSSL_SSL_LIBRARIES: ${OPENSSL_SSL_LIBRARIES}") -+ message("OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") -+ message("OPENSSL_VERSION: ${OPENSSL_VERSION}") - endif() - set(ARROW_USE_OPENSSL ON) - endif() -@@ -1228,10 +1233,13 @@ macro(build_glog) - endmacro() - - if(ARROW_USE_GLOG) -+ if(0) - resolve_dependency(GLOG PC_PACKAGE_NAMES libglog) - # TODO: Don't use global includes but rather target_include_directories - get_target_property(GLOG_INCLUDE_DIR glog::glog INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${GLOG_INCLUDE_DIR}) -+ endif() -+ find_package(glog REQUIRED) - endif() - - # ---------------------------------------------------------------------- -@@ -1300,17 +1308,11 @@ macro(build_gflags) - endmacro() - - if(ARROW_NEED_GFLAGS) -- set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") -- resolve_dependency(gflags -- HAVE_ALT -- TRUE -- REQUIRED_VERSION -- ${ARROW_GFLAGS_REQUIRED_VERSION} -- IS_RUNTIME_DEPENDENCY -- FALSE) -+ find_package(gflags REQUIRED) - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) - -+if(0) - if(NOT TARGET ${GFLAGS_LIBRARIES}) - if(TARGET gflags-shared) - set(GFLAGS_LIBRARIES gflags-shared) -@@ -1318,6 +1320,10 @@ if(ARROW_NEED_GFLAGS) - set(GFLAGS_LIBRARIES gflags_shared) - endif() - endif() -+else() -+ set(GFLAGS_LIBRARIES gflags::gflags) -+endif() -+ - endif() - - # ---------------------------------------------------------------------- -@@ -1400,6 +1406,7 @@ macro(build_thrift) - endmacro() - - if(ARROW_WITH_THRIFT) -+if (0) - # We already may have looked for Thrift earlier, when considering whether - # to build Boost, so don't look again if already found. - if(NOT Thrift_FOUND) -@@ -1412,6 +1419,9 @@ if(ARROW_WITH_THRIFT) - endif() - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+else() -+ find_package(Thrift REQUIRED CONFIG) -+endif() - - string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) - list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) -@@ -1606,7 +1616,7 @@ if(ARROW_JEMALLOC) - # conflict with the default allocator as well as other jemalloc - # installations. - # find_package(jemalloc) -- -+ if (0) - set(ARROW_JEMALLOC_USE_SHARED OFF) - set(JEMALLOC_PREFIX - "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src/jemalloc_ep/dist/") -@@ -1664,6 +1674,9 @@ if(ARROW_JEMALLOC) - "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src") - add_dependencies(jemalloc::jemalloc jemalloc_ep) - -+ endif() -+ find_package(jemalloc REQUIRED) -+ - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) - endif() - -@@ -1671,6 +1684,8 @@ endif() - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+ if (0) -+ - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1715,6 +1730,13 @@ if(ARROW_MIMALLOC) - add_dependencies(mimalloc::mimalloc mimalloc_ep) - add_dependencies(toolchain mimalloc_ep) - -+ else() -+ -+ find_package(mimalloc CONFIG REQUIRED) -+ add_dependencies(toolchain mimalloc::mimalloc) -+ -+ endif() -+ - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) - endif() - -@@ -1999,6 +2021,7 @@ macro(build_rapidjson) - endmacro() - - if(ARROW_WITH_RAPIDJSON) -+if(0) - set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") - resolve_dependency(RapidJSON - HAVE_ALT -@@ -2011,6 +2034,10 @@ if(ARROW_WITH_RAPIDJSON) - if(RapidJSON_INCLUDE_DIR) - set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}") - endif() -+else() -+ find_package(RapidJSON REQUIRED) -+ set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}") -+endif() - - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR}) -@@ -2036,10 +2063,21 @@ macro(build_xsimd) - set(XSIMD_VENDORED TRUE) - endmacro() - --if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" -- )) -+if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE")) -+ -+ if (0) -+ - set(xsimd_SOURCE "BUNDLED") - resolve_dependency(xsimd) -+ -+ else() -+ -+ find_package(xsimd) -+ set(XSIMD_INCLUDE_DIR "${xsimd_INCLUDE_DIR}") -+ add_dependencies(toolchain xsimd) -+ -+ endif() -+ - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) - endif() -@@ -2082,11 +2120,14 @@ macro(build_zlib) - endmacro() - - if(ARROW_WITH_ZLIB) -+ if(0) - resolve_dependency(ZLIB PC_PACKAGE_NAMES zlib) - - # TODO: Don't use global includes but rather target_include_directories - get_target_property(ZLIB_INCLUDE_DIR ZLIB::ZLIB INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${ZLIB_INCLUDE_DIR}) -+ endif() -+ find_package(ZLIB REQUIRED) - endif() - - macro(build_lz4) -@@ -2140,11 +2181,14 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -+ if(0) - resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) - - # TODO: Don't use global includes but rather target_include_directories - get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) -+ endif() -+ find_package(lz4 REQUIRED) - endif() - - macro(build_zstd) -@@ -2205,6 +2249,7 @@ macro(build_zstd) - endmacro() - - if(ARROW_WITH_ZSTD) -+ if(0) - # ARROW-13384: ZSTD_minCLevel was added in v1.4.0, required by ARROW-13091 - resolve_dependency(zstd - PC_PACKAGE_NAMES -@@ -2232,6 +2277,8 @@ if(ARROW_WITH_ZSTD) - get_target_property(ZSTD_INCLUDE_DIR ${ARROW_ZSTD_LIBZSTD} - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${ZSTD_INCLUDE_DIR}) -+ endif() -+ find_package(zstd REQUIRED) - endif() - - # ---------------------------------------------------------------------- -@@ -2271,6 +2318,7 @@ macro(build_re2) - endmacro() - - if(ARROW_WITH_RE2) -+ if(0) - # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may - # include -std=c++11. It's not compatible with C source and C++ - # source not uses C++ 11. -@@ -2284,6 +2332,8 @@ if(ARROW_WITH_RE2) - # TODO: Don't use global includes but rather target_include_directories - get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) -+ endif() -+ find_package(re2 REQUIRED) - endif() - - macro(build_bzip2) -@@ -2335,10 +2385,7 @@ macro(build_bzip2) - endmacro() - - if(ARROW_WITH_BZ2) -- resolve_dependency(BZip2) -- if(${BZip2_SOURCE} STREQUAL "SYSTEM") -- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") -- endif() -+ find_package(BZip2 REQUIRED) - - if(NOT TARGET BZip2::BZip2) - add_library(BZip2::BZip2 UNKNOWN IMPORTED) -@@ -2390,11 +2437,7 @@ macro(build_utf8proc) - endmacro() - - if(ARROW_WITH_UTF8PROC) -- resolve_dependency(utf8proc -- REQUIRED_VERSION -- "2.2.0" -- PC_PACKAGE_NAMES -- libutf8proc) -+ find_package(utf8proc REQUIRED CONFIG) - - add_definitions(-DARROW_WITH_UTF8PROC) - -@@ -3554,33 +3597,12 @@ if(ARROW_WITH_GRPC) - message(STATUS "Forcing gRPC_SOURCE to Protobuf_SOURCE (${Protobuf_SOURCE})") - set(gRPC_SOURCE "${Protobuf_SOURCE}") - endif() -- resolve_dependency(gRPC -- HAVE_ALT -- TRUE -- REQUIRED_VERSION -- ${ARROW_GRPC_REQUIRED_VERSION} -- PC_PACKAGE_NAMES -- grpc++) -+ find_package(gRPC CONFIG REQUIRED) - - # TODO: Don't use global includes but rather target_include_directories - get_target_property(GRPC_INCLUDE_DIR gRPC::grpc++ INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) - -- if(GRPC_VENDORED) -- set(GRPCPP_PP_INCLUDE TRUE) -- # Examples need to link to static Arrow if we're using static gRPC -- set(ARROW_GRPC_USE_SHARED OFF) -- else() -- # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp -- # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -- set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -- set(GRPCPP_PP_INCLUDE FALSE) -- else() -- message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -- endif() -- endif() - endif() - - # ---------------------------------------------------------------------- -@@ -3770,7 +3792,12 @@ macro(build_google_cloud_cpp_storage) - endmacro() - - if(ARROW_WITH_GOOGLE_CLOUD_CPP) -+if(0) - resolve_dependency(google_cloud_cpp_storage) -+else() -+ find_package(google-cloud-cpp REQUIRED) -+endif() -+ - get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${google_cloud_cpp_storage_INCLUDE_DIR}) -@@ -4097,11 +4124,15 @@ macro(build_opentelemetry) - endmacro() - - if(ARROW_WITH_OPENTELEMETRY) -+if(0) - set(opentelemetry-cpp_SOURCE "AUTO") - resolve_dependency(opentelemetry-cpp) - get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) -+else() -+ find_package(opentelemetry-cpp REQUIRED) -+endif() - message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") - endif() - -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 84975e2..7779c08 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -575,6 +575,10 @@ foreach(LIB_TARGET ${ARROW_LIBRARIES}) - target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING) - endforeach() - -+if(ARROW_BUILD_SHARED AND WIN32) -+ target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) -+endif() -+ - if(ARROW_WITH_BACKTRACE) - find_package(Backtrace) - -@@ -585,6 +589,7 @@ if(ARROW_WITH_BACKTRACE) - endforeach() - endif() - -+if(0) - if(ARROW_BUILD_BUNDLED_DEPENDENCIES) - arrow_car(_FIRST_LIB ${ARROW_BUNDLED_STATIC_LIBS}) - arrow_cdr(_OTHER_LIBS ${ARROW_BUNDLED_STATIC_LIBS}) -@@ -596,6 +601,7 @@ if(ARROW_BUILD_BUNDLED_DEPENDENCIES) - TO_MERGE - ${_OTHER_LIBS}) - endif() -+endif() - - if(ARROW_TESTING) - # that depend on gtest diff --git a/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch b/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch new file mode 100644 index 0000000000000..8b4d5d5518dcc --- /dev/null +++ b/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch @@ -0,0 +1,347 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 2d7baf1..dff5b1a 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -699,7 +699,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + if(Brotli_SOURCE STREQUAL "SYSTEM") +@@ -715,10 +715,17 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) +- if(Lz4_SOURCE STREQUAL "SYSTEM") +- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) +- endif() ++ if (TARGET LZ4::lz4_static) ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) ++ endif() ++ else() ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) ++ endif() ++endif() + endif() + + if(ARROW_WITH_SNAPPY) +@@ -907,8 +914,13 @@ endif() + + if(ARROW_MIMALLOC) + add_definitions(-DARROW_MIMALLOC) +- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) ++ if (TARGET mimalloc-static) ++ list(APPEND ARROW_LINK_LIBS mimalloc-static) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) ++ else() ++ list(APPEND ARROW_LINK_LIBS mimalloc) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) ++ endif() + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index bc38952..62bf314 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -954,7 +954,7 @@ endif() + + if(ARROW_BOOST_REQUIRED) + resolve_dependency(Boost +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_BOOST_REQUIRED_VERSION} +@@ -965,7 +965,7 @@ if(ARROW_BOOST_REQUIRED) + if(TARGET Boost::system) + set(BOOST_SYSTEM_LIBRARY Boost::system) + set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem) +- elseif(BoostAlt_FOUND) ++ elseif(Boost_FOUND) + set(BOOST_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY}) + set(BOOST_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY}) + else() +@@ -1108,9 +1108,9 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) ++ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon ++ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) + endif() +@@ -1302,22 +1302,17 @@ endmacro() + if(ARROW_NEED_GFLAGS) + set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") + resolve_dependency(gflags +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GFLAGS_REQUIRED_VERSION} + IS_RUNTIME_DEPENDENCY + FALSE) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) + +- if(NOT TARGET ${GFLAGS_LIBRARIES}) +- if(TARGET gflags-shared) +- set(GFLAGS_LIBRARIES gflags-shared) +- elseif(TARGET gflags_shared) +- set(GFLAGS_LIBRARIES gflags_shared) +- endif() +- endif() ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${gflags_LIBRARIES_TARGETS}) ++ set(GFLAGS_LIBRARIES gflags::gflags) + endif() + + # ---------------------------------------------------------------------- +@@ -1411,9 +1406,9 @@ if(ARROW_WITH_THRIFT) + thrift) + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + +- string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) ++ string(REPLACE "." ";" VERSION_LIST ${Thrift_VERSION}) + list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) + list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR) + list(GET VERSION_LIST 2 THRIFT_VERSION_PATCH) +@@ -1528,6 +1523,7 @@ if(ARROW_WITH_PROTOBUF) + set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") + endif() + resolve_dependency(Protobuf ++ USE_CONFIG + REQUIRED_VERSION + ${ARROW_PROTOBUF_REQUIRED_VERSION} + PC_PACKAGE_NAMES +@@ -1538,7 +1534,7 @@ if(ARROW_WITH_PROTOBUF) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(TARGET arrow::protobuf::libprotobuf) + set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf) +@@ -1547,9 +1543,9 @@ if(ARROW_WITH_PROTOBUF) + if(NOT TARGET protobuf::libprotobuf) + add_library(protobuf::libprotobuf UNKNOWN IMPORTED) + set_target_properties(protobuf::libprotobuf +- PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}" ++ PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) + endif() +@@ -1569,7 +1565,7 @@ if(ARROW_WITH_PROTOBUF) + set_target_properties(protobuf::libprotoc + PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc) + endif() +@@ -1600,6 +1596,7 @@ endif() + # jemalloc - Unix-only high-performance allocator + + if(ARROW_JEMALLOC) ++if(0) + message(STATUS "Building (vendored) jemalloc from source") + # We only use a vendored jemalloc as we want to control its version. + # Also our build of jemalloc is specially prefixed so that it will not +@@ -1665,12 +1662,18 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS}) ++endif() + endif() + + # ---------------------------------------------------------------------- + # mimalloc - Cross-platform high-performance allocator, from Microsoft + + if(ARROW_MIMALLOC) ++if(0) + message(STATUS "Building (vendored) mimalloc from source") + # We only use a vendored mimalloc as we want to control its build options. + +@@ -1716,6 +1719,11 @@ if(ARROW_MIMALLOC) + add_dependencies(toolchain mimalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) ++else() ++ find_package(mimalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- +@@ -2001,7 +2009,7 @@ endmacro() + if(ARROW_WITH_RAPIDJSON) + set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") + resolve_dependency(RapidJSON +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_RAPIDJSON_REQUIRED_VERSION} +@@ -2038,10 +2046,9 @@ endmacro() + + if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" + )) +- set(xsimd_SOURCE "BUNDLED") + resolve_dependency(xsimd) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) ++ include_directories(SYSTEM ${xsimd_INCLUDE_DIR}) + endif() + + macro(build_zlib) +@@ -2140,10 +2147,14 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) ++ resolve_dependency(lz4) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) ++ if (TARGET LZ4::lz4_static) ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() + include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) + endif() + +@@ -2274,7 +2285,7 @@ if(ARROW_WITH_RE2) + # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may + # include -std=c++11. It's not compatible with C source and C++ + # source not uses C++ 11. +- resolve_dependency(re2 HAVE_ALT TRUE) ++ resolve_dependency(re2 USE_CONFIG TRUE) + if(${re2_SOURCE} STREQUAL "SYSTEM") + get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION) + string(APPEND ARROW_PC_LIBS_PRIVATE " ${RE2_LIB}") +@@ -2337,7 +2348,7 @@ endmacro() + if(ARROW_WITH_BZ2) + resolve_dependency(BZip2) + if(${BZip2_SOURCE} STREQUAL "SYSTEM") +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") ++ string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZip2_LIBRARIES}") + endif() + + if(NOT TARGET BZip2::BZip2) +@@ -2346,7 +2357,7 @@ if(ARROW_WITH_BZ2) + PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") + endif() +- include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") ++ include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") + endif() + + macro(build_utf8proc) +@@ -3555,7 +3566,7 @@ if(ARROW_WITH_GRPC) + set(gRPC_SOURCE "${Protobuf_SOURCE}") + endif() + resolve_dependency(gRPC +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GRPC_REQUIRED_VERSION} +@@ -3573,9 +3584,9 @@ if(ARROW_WITH_GRPC) + else() + # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp + # depending on the gRPC version. +- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") ++ if(EXISTS ${gRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) + set(GRPCPP_PP_INCLUDE TRUE) +- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") ++ elseif(EXISTS ${gPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) + set(GRPCPP_PP_INCLUDE FALSE) + else() + message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") +@@ -4097,9 +4108,9 @@ macro(build_opentelemetry) + endmacro() + + if(ARROW_WITH_OPENTELEMETRY) +- set(opentelemetry-cpp_SOURCE "AUTO") ++ set(opentelemetry-cpp_SOURCE "SYSTEM") + resolve_dependency(opentelemetry-cpp) +- get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api ++ get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::opentelemetry_common + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) + message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index b984bc1..2c78cd9 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -323,10 +323,14 @@ set(ARROW_TESTING_SRCS + + set(_allocator_dependencies "") # Empty list + if(ARROW_JEMALLOC) +- list(APPEND _allocator_dependencies jemalloc_ep) ++ list(APPEND _allocator_dependencies jemalloc::jemalloc) + endif() + if(ARROW_MIMALLOC) +- list(APPEND _allocator_dependencies mimalloc_ep) ++ if (TARGET mimalloc-static) ++ list(APPEND _allocator_dependencies mimalloc-static) ++ else() ++ list(APPEND _allocator_dependencies mimalloc) ++ endif() + endif() + + if(_allocator_dependencies) +diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt +index 2cf8c99..90ebb9a 100644 +--- a/cpp/src/arrow/flight/CMakeLists.txt ++++ b/cpp/src/arrow/flight/CMakeLists.txt +@@ -17,6 +17,9 @@ + + add_custom_target(arrow_flight) + ++# TODO: This is a temporary workaround. absl should be LINKED as TARGET. ++include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ + arrow_install_all_headers("arrow/flight") + + set(ARROW_FLIGHT_LINK_LIBS gRPC::grpc++ ${ARROW_PROTOBUF_LIBPROTOBUF}) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index 2dcfb01..0394c01 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -48,7 +48,7 @@ + // Needed to support jemalloc 3 and 4 + #define JEMALLOC_MANGLE + // Explicitly link to our version of jemalloc +-#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" ++#include "jemalloc/jemalloc.h" + #endif + + #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/patches/8.0.0-0001-cmake.patch b/recipes/arrow/all/patches/8.0.0-0001-cmake.patch deleted file mode 100644 index 893ddf0b07512..0000000000000 --- a/recipes/arrow/all/patches/8.0.0-0001-cmake.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake -index ab7d2ed..6f1e411 100644 ---- a/cpp/cmake_modules/DefineOptions.cmake -+++ b/cpp/cmake_modules/DefineOptions.cmake -@@ -82,7 +82,7 @@ macro(define_option_string name description default) - endmacro() - - # Top level cmake dir --if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") -+if(1) - #---------------------------------------------------------------------- - set_option_category("Compile and link") - diff --git a/recipes/arrow/all/patches/8.0.0-0002-jemalloc.patch b/recipes/arrow/all/patches/8.0.0-0002-jemalloc.patch deleted file mode 100644 index ebc52531e130d..0000000000000 --- a/recipes/arrow/all/patches/8.0.0-0002-jemalloc.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 690c51a..c518b7d 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -326,7 +326,7 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) - list(APPEND _allocator_dependencies mimalloc_ep) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index 2fab6f3..1f8f896 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -52,7 +52,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/patches/8.0.0-0004-use-find-package.patch b/recipes/arrow/all/patches/8.0.0-0004-use-find-package.patch deleted file mode 100644 index b270f53d3516e..0000000000000 --- a/recipes/arrow/all/patches/8.0.0-0004-use-find-package.patch +++ /dev/null @@ -1,379 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index aba18c8..bb463d0 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -721,7 +721,7 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) - if(Lz4_SOURCE STREQUAL "SYSTEM") - list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) - endif() -@@ -907,8 +907,8 @@ endif() - if(ARROW_JEMALLOC) - add_definitions(-DARROW_JEMALLOC) - add_definitions(-DARROW_JEMALLOC_INCLUDE_DIR=${JEMALLOC_INCLUDE_DIR}) -- list(APPEND ARROW_LINK_LIBS jemalloc::jemalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS jemalloc::jemalloc) -+ list(APPEND ARROW_LINK_LIBS jemalloc) -+ list(APPEND ARROW_STATIC_LINK_LIBS jemalloc) - endif() - - if(ARROW_MIMALLOC) -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index f070323..2e2a03b 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -974,6 +974,7 @@ else() - endif() - - if(ARROW_BOOST_REQUIRED) -+if(0) - resolve_dependency(Boost - HAVE_ALT - TRUE -@@ -982,6 +983,9 @@ if(ARROW_BOOST_REQUIRED) - IS_RUNTIME_DEPENDENCY - # libarrow.so doesn't depend on libboost*. - FALSE) -+else() -+ find_package(Boost REQUIRED CONFIG) -+endif() - - if(TARGET Boost::system) - set(BOOST_SYSTEM_LIBRARY Boost::system) -@@ -1059,6 +1063,7 @@ macro(build_snappy) - endmacro() - - if(ARROW_WITH_SNAPPY) -+if(0) - resolve_dependency(Snappy PC_PACKAGE_NAMES snappy) - if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND) - get_target_property(SNAPPY_LIB Snappy::snappy IMPORTED_LOCATION) -@@ -1067,6 +1072,9 @@ if(ARROW_WITH_SNAPPY) - # TODO: Don't use global includes but rather target_include_directories - get_target_property(SNAPPY_INCLUDE_DIRS Snappy::snappy INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${SNAPPY_INCLUDE_DIRS}) -+else() -+ find_package(Snappy REQUIRED) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1129,7 +1137,7 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) -+ find_package(Brotli REQUIRED) - # TODO: Don't use global includes but rather target_include_directories - get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) -@@ -1169,8 +1177,16 @@ if(PARQUET_REQUIRE_ENCRYPTION - set(BUILD_SHARED_LIBS_KEEP ${BUILD_SHARED_LIBS}) - set(BUILD_SHARED_LIBS ON) - -- find_package(OpenSSL ${ARROW_OPENSSL_REQUIRED_VERSION} REQUIRED) -- set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_KEEP}) -+ find_package(OpenSSL REQUIRED CONFIG) -+ message("OPENSSL_FOUND: ${OPENSSL_FOUND}") -+ message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") -+ message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}") -+ message("OPENSSL_CRYPTO_LIBRARIES: ${OPENSSL_CRYPTO_LIBRARIES}") -+ message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}") -+ message("OPENSSL_SSL_LIBRARIES: ${OPENSSL_SSL_LIBRARIES}") -+ message("OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") -+ message("OPENSSL_VERSION: ${OPENSSL_VERSION}") -+ set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_KEEP}) - unset(BUILD_SHARED_LIBS_KEEP) - else() - # Find static OpenSSL headers and libs -@@ -1249,10 +1265,14 @@ macro(build_glog) - endmacro() - - if(ARROW_USE_GLOG) -+if(0) - resolve_dependency(GLOG PC_PACKAGE_NAMES libglog) - # TODO: Don't use global includes but rather target_include_directories - get_target_property(GLOG_INCLUDE_DIR glog::glog INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${GLOG_INCLUDE_DIR}) -+else() -+ find_package(glog REQUIRED) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1321,6 +1341,7 @@ macro(build_gflags) - endmacro() - - if(ARROW_NEED_GFLAGS) -+if(0) - set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") - resolve_dependency(gflags - HAVE_ALT -@@ -1339,6 +1360,10 @@ if(ARROW_NEED_GFLAGS) - set(GFLAGS_LIBRARIES gflags_shared) - endif() - endif() -+else() -+ find_package(gflags REQUIRED) -+ set(GFLAGS_LIBRARIES gflags::gflags) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1718,6 +1756,7 @@ if(ARROW_JEMALLOC) - # installations. - # find_package(jemalloc) - -+if(0) - set(ARROW_JEMALLOC_USE_SHARED OFF) - set(JEMALLOC_PREFIX - "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src/jemalloc_ep/dist/") -@@ -1778,6 +1817,9 @@ if(ARROW_JEMALLOC) - INTERFACE_INCLUDE_DIRECTORIES - "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src") - add_dependencies(jemalloc::jemalloc jemalloc_ep) -+else() -+ find_package(jemalloc REQUIRED) -+endif() - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) - endif() -@@ -1786,6 +1828,7 @@ endif() - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1834,6 +1877,10 @@ if(ARROW_MIMALLOC) - endif() - add_dependencies(mimalloc::mimalloc mimalloc_ep) - add_dependencies(toolchain mimalloc_ep) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ add_dependencies(toolchain mimalloc::mimalloc) -+endif() - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) - endif() -@@ -2119,6 +2166,7 @@ macro(build_rapidjson) - endmacro() - - if(ARROW_WITH_RAPIDJSON) -+if(0) - set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") - resolve_dependency(RapidJSON - HAVE_ALT -@@ -2131,6 +2179,10 @@ if(ARROW_WITH_RAPIDJSON) - if(RapidJSON_INCLUDE_DIR) - set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}") - endif() -+else() -+ find_package(RapidJSON REQUIRED) -+ set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}") -+endif() - - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR}) -@@ -2158,8 +2210,14 @@ endmacro() - - if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" - )) -+if(0) - set(xsimd_SOURCE "BUNDLED") - resolve_dependency(xsimd) -+else() -+ find_package(xsimd) -+ set(XSIMD_INCLUDE_DIR "${xsimd_INCLUDE_DIR}") -+ add_dependencies(toolchain xsimd) -+endif() - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) - endif() -@@ -2202,11 +2260,15 @@ macro(build_zlib) - endmacro() - - if(ARROW_WITH_ZLIB) -+if(0) - resolve_dependency(ZLIB PC_PACKAGE_NAMES zlib) - - # TODO: Don't use global includes but rather target_include_directories - get_target_property(ZLIB_INCLUDE_DIR ZLIB::ZLIB INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${ZLIB_INCLUDE_DIR}) -+else() -+ find_package(ZLIB REQUIRED) -+endif() - endif() - - macro(build_lz4) -@@ -2260,11 +2322,15 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -+if(0) - resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) - - # TODO: Don't use global includes but rather target_include_directories - get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) -+else() -+ find_package(lz4 REQUIRED) -+endif() - endif() - - macro(build_zstd) -@@ -2325,6 +2391,7 @@ macro(build_zstd) - endmacro() - - if(ARROW_WITH_ZSTD) -+if(0) - # ARROW-13384: ZSTD_minCLevel was added in v1.4.0, required by ARROW-13091 - resolve_dependency(zstd - PC_PACKAGE_NAMES -@@ -2352,6 +2419,9 @@ if(ARROW_WITH_ZSTD) - get_target_property(ZSTD_INCLUDE_DIR ${ARROW_ZSTD_LIBZSTD} - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${ZSTD_INCLUDE_DIR}) -+else() -+ find_package(zstd REQUIRED) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -2391,6 +2461,7 @@ macro(build_re2) - endmacro() - - if(ARROW_WITH_RE2) -+if(0) - # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may - # include -std=c++11. It's not compatible with C source and C++ - # source not uses C++ 11. -@@ -2411,6 +2482,9 @@ if(ARROW_WITH_RE2) - # TODO: Don't use global includes but rather target_include_directories - get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) -+else() -+ find_package(re2 REQUIRED) -+endif() - endif() - - macro(build_bzip2) -@@ -2462,6 +2536,7 @@ macro(build_bzip2) - endmacro() - - if(ARROW_WITH_BZ2) -+if(0) - resolve_dependency(BZip2) - if(${BZip2_SOURCE} STREQUAL "SYSTEM") - string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") -@@ -2474,6 +2549,9 @@ if(ARROW_WITH_BZ2) - INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") - endif() - include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") -+else() -+ find_package(BZip2 REQUIRED) -+endif() - endif() - - macro(build_utf8proc) -@@ -2517,6 +2595,7 @@ macro(build_utf8proc) - endmacro() - - if(ARROW_WITH_UTF8PROC) -+if(0) - resolve_dependency(utf8proc - REQUIRED_VERSION - "2.2.0" -@@ -2538,6 +2617,10 @@ if(ARROW_WITH_UTF8PROC) - get_target_property(UTF8PROC_INCLUDE_DIR utf8proc::utf8proc - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${UTF8PROC_INCLUDE_DIR}) -+else() -+ find_package(utf8proc REQUIRED CONFIG) -+ add_definitions(-DARROW_WITH_UTF8PROC) -+endif() - endif() - - macro(build_cares) -@@ -3702,6 +3785,7 @@ macro(build_grpc) - endmacro() - - if(ARROW_WITH_GRPC) -+if(0) - set(ARROW_GRPC_REQUIRED_VERSION "1.17.0") - if(NOT Protobuf_SOURCE STREQUAL gRPC_SOURCE) - # ARROW-15495: Protobuf/gRPC must come from the same source -@@ -3735,6 +3819,9 @@ if(ARROW_WITH_GRPC) - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") - endif() - endif() -+else() -+ find_package(gRPC REQUIRED CONFIG) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -3937,10 +4024,14 @@ macro(build_google_cloud_cpp_storage) - endmacro() - - if(ARROW_WITH_GOOGLE_CLOUD_CPP) -+if(0) - resolve_dependency(google_cloud_cpp_storage) - get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${google_cloud_cpp_storage_INCLUDE_DIR}) -+else() -+ find_package(google-cloud-cpp REQUIRED) -+endif() - get_target_property(absl_base_INCLUDE_DIR absl::base INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${absl_base_INCLUDE_DIR}) - message(STATUS "Found google-cloud-cpp::storage headers: ${google_cloud_cpp_storage_INCLUDE_DIR}" -@@ -4261,6 +4352,7 @@ macro(build_opentelemetry) - endmacro() - - if(ARROW_WITH_OPENTELEMETRY) -+if(0) - # cURL is required whether we build from source or use an existing installation - # (OTel's cmake files do not call find_curl for you) - find_curl() -@@ -4269,7 +4361,10 @@ if(ARROW_WITH_OPENTELEMETRY) - get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) -- message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") -+else() -+ find_package(opentelemetry-cpp REQUIRED) -+endif() -+ message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index c518b7d..40b4853 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -584,6 +584,10 @@ foreach(LIB_TARGET ${ARROW_LIBRARIES}) - target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING) - endforeach() - -+if(ARROW_BUILD_SHARED AND WIN32) -+ target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) -+endif() -+ - if(ARROW_WITH_BACKTRACE) - find_package(Backtrace) - -@@ -594,7 +598,7 @@ if(ARROW_WITH_BACKTRACE) - endforeach() - endif() - --if(ARROW_BUILD_BUNDLED_DEPENDENCIES) -+if(0) - arrow_car(_FIRST_LIB ${ARROW_BUNDLED_STATIC_LIBS}) - arrow_cdr(_OTHER_LIBS ${ARROW_BUNDLED_STATIC_LIBS}) - create_merged_static_lib(arrow_bundled_dependencies diff --git a/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch b/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch new file mode 100644 index 0000000000000..7125204e0d1f9 --- /dev/null +++ b/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch @@ -0,0 +1,425 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index bb463d0..ce2d1df 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -705,7 +705,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + if(Brotli_SOURCE STREQUAL "SYSTEM") +@@ -721,11 +721,18 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) +- if(Lz4_SOURCE STREQUAL "SYSTEM") +- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) ++ if (TARGET LZ4::lz4_static) ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) ++ endif() ++ else() ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) + endif() + endif() ++endif() + + if(ARROW_WITH_SNAPPY) + list(APPEND ARROW_STATIC_LINK_LIBS Snappy::snappy) +@@ -913,8 +920,13 @@ endif() + + if(ARROW_MIMALLOC) + add_definitions(-DARROW_MIMALLOC) +- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) ++ if (TARGET mimalloc-static) ++ list(APPEND ARROW_LINK_LIBS mimalloc-static) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) ++ else() ++ list(APPEND ARROW_LINK_LIBS mimalloc) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) ++ endif() + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index f070323..16faf73 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -959,6 +959,7 @@ endif() + # - Tests need Boost at runtime. + # - S3FS and Flight benchmarks need Boost at runtime. + if(ARROW_BUILD_INTEGRATION ++ OR ARROW_BOOST_REQUIRED + OR ARROW_BUILD_TESTS + OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) + OR (ARROW_S3 AND ARROW_BUILD_BENCHMARKS)) +@@ -975,7 +976,7 @@ endif() + + if(ARROW_BOOST_REQUIRED) + resolve_dependency(Boost +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_BOOST_REQUIRED_VERSION} +@@ -986,7 +987,7 @@ if(ARROW_BOOST_REQUIRED) + if(TARGET Boost::system) + set(BOOST_SYSTEM_LIBRARY Boost::system) + set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem) +- elseif(BoostAlt_FOUND) ++ elseif(Boost_FOUND) + set(BOOST_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY}) + set(BOOST_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY}) + else() +@@ -1129,9 +1130,9 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) ++ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon ++ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) + endif() +@@ -1323,22 +1324,16 @@ endmacro() + if(ARROW_NEED_GFLAGS) + set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") + resolve_dependency(gflags +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GFLAGS_REQUIRED_VERSION} + IS_RUNTIME_DEPENDENCY + FALSE) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) +- +- if(NOT TARGET ${GFLAGS_LIBRARIES}) +- if(TARGET gflags-shared) +- set(GFLAGS_LIBRARIES gflags-shared) +- elseif(TARGET gflags_shared) +- set(GFLAGS_LIBRARIES gflags_shared) +- endif() +- endif() ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${gflags_LIBRARIES_TARGETS}) ++ set(GFLAGS_LIBRARIES gflags::gflags) + endif() + + # ---------------------------------------------------------------------- +@@ -1432,9 +1427,9 @@ if(ARROW_WITH_THRIFT) + thrift) + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + +- string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) ++ string(REPLACE "." ";" VERSION_LIST ${Thrift_VERSION}) + list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) + list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR) + list(GET VERSION_LIST 2 THRIFT_VERSION_PATCH) +@@ -1557,6 +1552,7 @@ if(ARROW_WITH_PROTOBUF) + set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") + endif() + resolve_dependency(Protobuf ++ USE_CONFIG + REQUIRED_VERSION + ${ARROW_PROTOBUF_REQUIRED_VERSION} + PC_PACKAGE_NAMES +@@ -1567,7 +1563,7 @@ if(ARROW_WITH_PROTOBUF) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(TARGET arrow::protobuf::libprotobuf) + set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf) +@@ -1576,9 +1572,9 @@ if(ARROW_WITH_PROTOBUF) + if(NOT TARGET protobuf::libprotobuf) + add_library(protobuf::libprotobuf UNKNOWN IMPORTED) + set_target_properties(protobuf::libprotobuf +- PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}" ++ PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) + endif() +@@ -1598,7 +1594,7 @@ if(ARROW_WITH_PROTOBUF) + set_target_properties(protobuf::libprotoc + PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc) + endif() +@@ -1690,11 +1686,12 @@ macro(build_substrait) + + add_custom_target(substrait_gen ALL DEPENDS ${SUBSTRAIT_PROTO_GEN_ALL}) + +- set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${PROTOBUF_INCLUDE_DIR}) ++ set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${protobuf_INCLUDE_DIR}) + + add_library(substrait STATIC ${SUBSTRAIT_SOURCES}) + set_target_properties(substrait PROPERTIES POSITION_INDEPENDENT_CODE ON) + target_include_directories(substrait PUBLIC ${SUBSTRAIT_INCLUDES}) ++ target_include_directories(substrait PUBLIC ${PROTOBUF_INCLUDE_DIR}) + target_link_libraries(substrait INTERFACE ${ARROW_PROTOBUF_LIBPROTOBUF}) + add_dependencies(substrait substrait_gen) + +@@ -1711,6 +1708,7 @@ endif() + # jemalloc - Unix-only high-performance allocator + + if(ARROW_JEMALLOC) ++if(0) + message(STATUS "Building (vendored) jemalloc from source") + # We only use a vendored jemalloc as we want to control its version. + # Also our build of jemalloc is specially prefixed so that it will not +@@ -1780,12 +1778,18 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS}) ++endif() + endif() + + # ---------------------------------------------------------------------- + # mimalloc - Cross-platform high-performance allocator, from Microsoft + + if(ARROW_MIMALLOC) ++if(0) + message(STATUS "Building (vendored) mimalloc from source") + # We only use a vendored mimalloc as we want to control its build options. + +@@ -1836,6 +1840,11 @@ if(ARROW_MIMALLOC) + add_dependencies(toolchain mimalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) ++else() ++ find_package(mimalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- +@@ -2121,7 +2130,7 @@ endmacro() + if(ARROW_WITH_RAPIDJSON) + set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") + resolve_dependency(RapidJSON +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_RAPIDJSON_REQUIRED_VERSION} +@@ -2158,10 +2167,10 @@ endmacro() + + if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" + )) +- set(xsimd_SOURCE "BUNDLED") ++ set(xsimd_SOURCE "SYSTEM") + resolve_dependency(xsimd) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) ++ include_directories(SYSTEM ${xsimd_INCLUDE_DIR}) + endif() + + macro(build_zlib) +@@ -2260,10 +2269,14 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) ++ resolve_dependency(Lz4) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) ++ if (TARGET LZ4::lz4_static) ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() + include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) + endif() + +@@ -2394,7 +2407,7 @@ if(ARROW_WITH_RE2) + # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may + # include -std=c++11. It's not compatible with C source and C++ + # source not uses C++ 11. +- resolve_dependency(re2 HAVE_ALT TRUE) ++ resolve_dependency(re2 USE_CONFIG TRUE) + if(${re2_SOURCE} STREQUAL "SYSTEM") + get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION_${UPPERCASE_BUILD_TYPE}) + if(NOT RE2_LIB) +@@ -2464,7 +2477,7 @@ endmacro() + if(ARROW_WITH_BZ2) + resolve_dependency(BZip2) + if(${BZip2_SOURCE} STREQUAL "SYSTEM") +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") ++ string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZip2_LIBRARIES}") + endif() + + if(NOT TARGET BZip2::BZip2) +@@ -2473,7 +2486,7 @@ if(ARROW_WITH_BZ2) + PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") + endif() +- include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") ++ include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") + endif() + + macro(build_utf8proc) +@@ -3709,7 +3722,7 @@ if(ARROW_WITH_GRPC) + set(gRPC_SOURCE "${Protobuf_SOURCE}") + endif() + resolve_dependency(gRPC +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GRPC_REQUIRED_VERSION} +@@ -3727,9 +3740,9 @@ if(ARROW_WITH_GRPC) + else() + # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp + # depending on the gRPC version. +- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") ++ if(EXISTS ${gRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) + set(GRPCPP_PP_INCLUDE TRUE) +- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") ++ elseif(EXISTS ${gRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) + set(GRPCPP_PP_INCLUDE FALSE) + else() + message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") +@@ -3937,7 +3950,7 @@ macro(build_google_cloud_cpp_storage) + endmacro() + + if(ARROW_WITH_GOOGLE_CLOUD_CPP) +- resolve_dependency(google_cloud_cpp_storage) ++ resolve_dependency(google_cloud_cpp) + get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${google_cloud_cpp_storage_INCLUDE_DIR}) +@@ -4264,9 +4277,9 @@ if(ARROW_WITH_OPENTELEMETRY) + # cURL is required whether we build from source or use an existing installation + # (OTel's cmake files do not call find_curl for you) + find_curl() +- set(opentelemetry-cpp_SOURCE "AUTO") ++ set(opentelemetry-cpp_SOURCE "SYSTEM") + resolve_dependency(opentelemetry-cpp) +- get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api ++ get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::opentelemetry_common + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) + message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index 690c51a..752f3b9 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -326,10 +326,14 @@ set(ARROW_TESTING_SRCS + + set(_allocator_dependencies "") # Empty list + if(ARROW_JEMALLOC) +- list(APPEND _allocator_dependencies jemalloc_ep) ++ list(APPEND _allocator_dependencies jemalloc::jemalloc) + endif() + if(ARROW_MIMALLOC) +- list(APPEND _allocator_dependencies mimalloc_ep) ++ if (TARGET mimalloc-static) ++ list(APPEND _allocator_dependencies mimalloc-static) ++ else() ++ list(APPEND _allocator_dependencies mimalloc) ++ endif() + endif() + + if(_allocator_dependencies) +diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt +index f9d1356..c9bcf79 100644 +--- a/cpp/src/arrow/flight/CMakeLists.txt ++++ b/cpp/src/arrow/flight/CMakeLists.txt +@@ -17,6 +17,9 @@ + + add_custom_target(arrow_flight) + ++# TODO: This is a temporary workaround. absl should be LINKED as TARGET. ++include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ + arrow_install_all_headers("arrow/flight") + + set(ARROW_FLIGHT_LINK_LIBS gRPC::grpc++ ${ARROW_PROTOBUF_LIBPROTOBUF}) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index ed1c2d8..37a89da 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -52,7 +52,7 @@ + // Needed to support jemalloc 3 and 4 + #define JEMALLOC_MANGLE + // Explicitly link to our version of jemalloc +-#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" ++#include "jemalloc/jemalloc.h" + #endif + + #ifdef ARROW_MIMALLOC +diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt +index 71faf9a..3aabea1 100644 +--- a/cpp/src/gandiva/CMakeLists.txt ++++ b/cpp/src/gandiva/CMakeLists.txt +@@ -25,7 +25,7 @@ add_custom_target(gandiva-benchmarks) + + add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) + +-find_package(LLVMAlt REQUIRED) ++find_package(LLVM REQUIRED) + + if(LLVM_VERSION_MAJOR LESS "10") + set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) +@@ -40,7 +40,7 @@ endif() + + add_definitions(-DGANDIVA_LLVM_VERSION=${LLVM_VERSION_MAJOR}) + +-find_package(OpenSSLAlt REQUIRED) ++find_package(OpenSSL REQUIRED) + + # Set the path where the bitcode file generated, see precompiled/CMakeLists.txt + set(GANDIVA_PRECOMPILED_BC_PATH "${CMAKE_CURRENT_BINARY_DIR}/irhelpers.bc") +@@ -98,10 +98,11 @@ set(SRC_FILES + random_generator_holder.cc + ${GANDIVA_PRECOMPILED_CC_PATH}) + +-set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE +- ${GANDIVA_OPENSSL_LIBS}) ++set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core NTERFACE ++ ${GANDIVA_OPENSSL_LIBS}) ++ ++set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core ${GANDIVA_OPENSSL_LIBS}) + +-set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE ${GANDIVA_OPENSSL_LIBS}) + + if(ARROW_GANDIVA_STATIC_LIBSTDCPP AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX + )) +@@ -139,7 +140,7 @@ add_arrow_lib(gandiva + arrow_dependencies + precompiled + EXTRA_INCLUDES +- $ ++ $ + ${GANDIVA_OPENSSL_INCLUDE_DIR} + ${UTF8PROC_INCLUDE_DIR} + SHARED_LINK_FLAGS diff --git a/recipes/arrow/all/test_package/CMakeLists.txt b/recipes/arrow/all/test_package/CMakeLists.txt index f5dd033e0e7e3..f11eeda92dde4 100644 --- a/recipes/arrow/all/test_package/CMakeLists.txt +++ b/recipes/arrow/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.8) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +project(test_package CXX) find_package(Arrow REQUIRED) diff --git a/recipes/arrow/all/test_package/conanfile.py b/recipes/arrow/all/test_package/conanfile.py index 3da371b660e0a..1111583fea732 100644 --- a/recipes/arrow/all/test_package/conanfile.py +++ b/recipes/arrow/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -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 +# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + 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 +22,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/arrow/all/test_v1_package/CMakeLists.txt b/recipes/arrow/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..00e9abed830ed --- /dev/null +++ b/recipes/arrow/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Arrow REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE arrow::arrow) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_JEMALLOC) diff --git a/recipes/arrow/all/test_v1_package/conanfile.py b/recipes/arrow/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/arrow/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 5e29af82577a27740e716a07ccb54f00e9f974ea Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Thu, 29 Sep 2022 13:05:50 +0200 Subject: [PATCH 248/561] (#13198) add new version diligent-core api_252005 * add new version diligent-core api_252005 * add version 252005 to config.yml * fix typo --- recipes/diligent-core/all/conandata.yml | 3 +++ recipes/diligent-core/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/diligent-core/all/conandata.yml b/recipes/diligent-core/all/conandata.yml index f42eb9cd48eb5..98cb3e947ca09 100644 --- a/recipes/diligent-core/all/conandata.yml +++ b/recipes/diligent-core/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "api.252005": + url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API252005.tar.gz" + sha256: "20d164b36ec6ff6f1ef69aa44210bb46f3244af1c0d9538ac3758ca2437fb2e1" "api.252004": url: "https://github.com/DiligentGraphics/DiligentCore/archive/refs/tags/API252004.tar.gz" sha256: "06e4ee5f95163ae74bbe62f59dcdf1da5e181ff2d6a8e3982319bb5c8f97c53b" diff --git a/recipes/diligent-core/config.yml b/recipes/diligent-core/config.yml index 67c44ebd2001b..c5e517a7e9223 100644 --- a/recipes/diligent-core/config.yml +++ b/recipes/diligent-core/config.yml @@ -1,4 +1,6 @@ versions: + "api.252005": + folder: "all" "api.252004": folder: "all" "api.252003": From 074a75a2d6de061ed183e531c26f4147d0a9af45 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 29 Sep 2022 16:25:31 +0200 Subject: [PATCH 249/561] (#13184) catch2: modernize more * modernize more * cleanup * typo * add shared option since 3.1.0 * convention * honor few cmake options * remove useless patches they are not required with CMakeToolchain * fix CMake options names * allow shared * restore default_reporter * install dll in bin folder --- recipes/catch2/3.x.x/conandata.yml | 18 +++- recipes/catch2/3.x.x/conanfile.py | 90 +++++++++++-------- .../patches/3.0.1-0001-allow-shared.patch | 64 +++++++++++++ .../3.0.1-0001-force-not_usbproject-off.patch | 12 --- ...1-0002-dllimport-global-symbols-msvc.patch | 77 ++++++++++++++++ .../patches/3.1.0-0001-fix-dll-install.patch | 16 ++++ ...0-0002-dllimport-global-symbols-msvc.patch | 77 ++++++++++++++++ .../catch2/3.x.x/test_package/CMakeLists.txt | 25 +++--- .../3.x.x/test_v1_package/CMakeLists.txt | 27 +++--- 9 files changed, 324 insertions(+), 82 deletions(-) create mode 100644 recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch delete mode 100644 recipes/catch2/3.x.x/patches/3.0.1-0001-force-not_usbproject-off.patch create mode 100644 recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch create mode 100644 recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch create mode 100644 recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index 9b3616a81d44c..f7719c6a746e2 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -7,6 +7,20 @@ sources: sha256: "8c4173c68ae7da1b5b505194a0c2d6f1b2aef4ec1e3e7463bde451f26bbaf4e7" patches: "3.1.0": - - patch_file: "patches/3.0.1-0001-force-not_usbproject-off.patch" + - patch_file: "patches/3.1.0-0001-fix-dll-install.patch" + patch_description: "Install dll in bin folder" + patch_type: "backport" + patch_source: "https://github.com/catchorg/Catch2/pull/2485" + - patch_file: "patches/3.1.0-0002-dllimport-global-symbols-msvc.patch" + patch_description: "Fix import of global symbols for msvc shared" + patch_type: "backport" + patch_source: "https://github.com/catchorg/Catch2/pull/2527" "3.0.1": - - patch_file: "patches/3.0.1-0001-force-not_usbproject-off.patch" + - patch_file: "patches/3.0.1-0001-allow-shared.patch" + patch_description: "Allow to build catch2 as a shared library" + patch_type: "backport" + patch_source: "https://github.com/catchorg/Catch2/commit/bea58bf8bbfca887f871c3aa2d720ba62c01f855" + - patch_file: "patches/3.0.1-0002-dllimport-global-symbols-msvc.patch" + patch_description: "Fix import of global symbols for msvc shared" + patch_type: "backport" + patch_source: "https://github.com/catchorg/Catch2/pull/2527" diff --git a/recipes/catch2/3.x.x/conanfile.py b/recipes/catch2/3.x.x/conanfile.py index e3d3e9d81076b..625d3bd779ace 100644 --- a/recipes/catch2/3.x.x/conanfile.py +++ b/recipes/catch2/3.x.x/conanfile.py @@ -1,13 +1,14 @@ -import os from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +import os required_conan_version = ">=1.52.0" + class Catch2Conan(ConanFile): name = "catch2" description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD" @@ -17,51 +18,61 @@ class Catch2Conan(ConanFile): url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" options = { + "shared": [True, False], "fPIC": [True, False], "with_prefix": [True, False], - "default_reporter": "ANY", + "default_reporter": ["ANY"], } default_options = { + "shared": False, "fPIC": True, "with_prefix": False, "default_reporter": None, } @property - def _default_reporter_str(self): - return '"{}"'.format(str(self.options.default_reporter).strip('"')) - - def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + def _min_cppstd(self): + return "14" @property def _compilers_minimum_version(self): return { "gcc": "7", "Visual Studio": "15", + "msvc": "191", "clang": "5", "apple-clang": "10", } + @property + def _default_reporter_str(self): + return '"{}"'.format(str(self.options.default_reporter).strip('"')) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, "14") - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version: - if Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{}/{}: Unsupported compiler: {}-{} " - "(https://github.com/p-ranav/structopt#compiler-compatibility)." - .format(self.name, self.version, self.settings.compiler, self.settings.compiler.version)) - else: - self.output.warn("{}/{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name, self.version)) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler doesn't support", + ) def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -69,8 +80,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False - tc.variables["CATCH_INSTALL_DOCS"] = False - tc.variables["CATCH_INSTALL_HELPERS"] = True + tc.cache_variables["CATCH_INSTALL_DOCS"] = False + tc.cache_variables["CATCH_INSTALL_EXTRAS"] = True + tc.cache_variables["CATCH_DEVELOPMENT_BUILD"] = False tc.variables["CATCH_CONFIG_PREFIX_ALL"] = self.options.with_prefix if self.options.default_reporter: tc.variables["CATCH_CONFIG_DEFAULT_REPORTER"] = self._default_reporter_str @@ -84,44 +96,44 @@ def build(self): def package(self): copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "share")) for cmake_file in ["ParseAndAddCatchTests.cmake", "Catch.cmake", "CatchAddTests.cmake"]: - self.copy( + copy( + self, cmake_file, src=os.path.join(self.source_folder, "extras"), - dst=os.path.join("lib", "cmake", "Catch2"), + dst=os.path.join(self.package_folder, "lib", "cmake", "Catch2"), ) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Catch2") self.cpp_info.set_property("cmake_target_name", "Catch2::Catch2WithMain") self.cpp_info.set_property("pkg_config_name", "catch2-with-main") - self.cpp_info.names["cmake_find_package"] = "Catch2" - self.cpp_info.names["cmake_find_package_multi"] = "Catch2" lib_suffix = "d" if self.settings.build_type == "Debug" else "" self.cpp_info.components["_catch2"].set_property("cmake_target_name", "Catch2::Catch2") self.cpp_info.components["_catch2"].set_property("pkg_config_name", "catch2") - self.cpp_info.components["_catch2"].names["cmake_find_package"] = "Catch2" - self.cpp_info.components["_catch2"].names["cmake_find_package_multi"] = "Catch2" self.cpp_info.components["_catch2"].libs = ["Catch2" + lib_suffix] - self.cpp_info.components["catch2_with_main"].builddirs = [os.path.join("lib", "cmake", "Catch2")] + self.cpp_info.components["catch2_with_main"].builddirs.append(os.path.join("lib", "cmake", "Catch2")) self.cpp_info.components["catch2_with_main"].libs = ["Catch2Main" + lib_suffix] self.cpp_info.components["catch2_with_main"].requires = ["_catch2"] self.cpp_info.components["catch2_with_main"].system_libs = ["log"] if self.settings.os == "Android" else [] self.cpp_info.components["catch2_with_main"].set_property("cmake_target_name", "Catch2::Catch2WithMain") self.cpp_info.components["catch2_with_main"].set_property("pkg_config_name", "catch2-with-main") - self.cpp_info.components["catch2_with_main"].names["cmake_find_package"] = "Catch2WithMain" - self.cpp_info.components["catch2_with_main"].names["cmake_find_package_multi"] = "Catch2WithMain" defines = self.cpp_info.components["catch2_with_main"].defines - if self.options.with_prefix: defines.append("CATCH_CONFIG_PREFIX_ALL") if self.options.default_reporter: - defines.append("CATCH_CONFIG_DEFAULT_REPORTER={}".format(self._default_reporter_str)) + defines.append(f"CATCH_CONFIG_DEFAULT_REPORTER={self._default_reporter_str}") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "Catch2" + self.cpp_info.names["cmake_find_package_multi"] = "Catch2" + self.cpp_info.components["_catch2"].names["cmake_find_package"] = "Catch2" + self.cpp_info.components["_catch2"].names["cmake_find_package_multi"] = "Catch2" + self.cpp_info.components["catch2_with_main"].names["cmake_find_package"] = "Catch2WithMain" + self.cpp_info.components["catch2_with_main"].names["cmake_find_package_multi"] = "Catch2WithMain" diff --git a/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch b/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch new file mode 100644 index 0000000000000..38c31d266b121 --- /dev/null +++ b/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch @@ -0,0 +1,64 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -263,9 +263,7 @@ set(REPORTER_SOURCES + ) + set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES}) + +-# Fixme: STATIC because for dynamic, we would need to handle visibility +-# and I don't want to do the annotations right now +-add_library(Catch2 STATIC ++add_library(Catch2 + ${REPORTER_FILES} + ${INTERNAL_FILES} + ${BENCHMARK_HEADERS} +@@ -318,7 +316,7 @@ target_include_directories(Catch2 + ) + + +-add_library(Catch2WithMain STATIC ++add_library(Catch2WithMain + ${SOURCES_DIR}/internal/catch_main.cpp + ) + add_build_reproducibility_settings(Catch2WithMain) +@@ -338,8 +336,12 @@ if (NOT_SUBPROJECT) + Catch2WithMain + EXPORT + Catch2Targets +- DESTINATION ++ LIBRARY DESTINATION ++ ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION + ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ++ ${CMAKE_INSTALL_BINDIR} + ) + + +@@ -409,3 +411,27 @@ endif() + + list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain) + set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE) ++ ++ ++# We still do not support building dynamic library with hidden visibility ++# so we want to check & warn users if they do this. However, we won't abort ++# the configuration step so that we don't have to also provide an override. ++if (BUILD_SHARED_LIBS) ++ if (MSVC) ++ set_target_properties(Catch2 Catch2WithMain ++ PROPERTIES ++ WINDOWS_EXPORT_ALL_SYMBOLS ON ++ ) ++ endif() ++ ++ get_target_property(_VisPreset Catch2 CXX_VISIBILITY_PRESET) ++ if (NOT MSVC AND _VisPreset STREQUAL "hidden") ++ set_target_properties(Catch2 Catch2WithMain ++ PROPERTIES ++ CXX_VISIBILITY_PRESET "default" ++ VISIBILITY_INLINES_HIDDEN OFF ++ ) ++ message(WARNING "Setting Catch2's visibility to default." ++ " Hidden visibility is not supported.") ++ endif() ++endif() diff --git a/recipes/catch2/3.x.x/patches/3.0.1-0001-force-not_usbproject-off.patch b/recipes/catch2/3.x.x/patches/3.0.1-0001-force-not_usbproject-off.patch deleted file mode 100644 index 55da96838204f..0000000000000 --- a/recipes/catch2/3.x.x/patches/3.0.1-0001-force-not_usbproject-off.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5087361..64b44f6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -7,6 +7,7 @@ if(NOT DEFINED PROJECT_NAME) - else() - set(NOT_SUBPROJECT OFF) - endif() -+set(NOT_SUBPROJECT ON) - - option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON) - option(CATCH_INSTALL_EXTRAS "Install extras (CMake scripts, debugger helpers) alongside library" ON) diff --git a/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch b/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch new file mode 100644 index 0000000000000..c797f9d544f0c --- /dev/null +++ b/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch @@ -0,0 +1,77 @@ +--- a/CMake/CatchConfigOptions.cmake ++++ b/CMake/CatchConfigOptions.cmake +@@ -45,6 +45,7 @@ set(_OverridableOptions + foreach(OptionName ${_OverridableOptions}) + AddOverridableConfigOption(${OptionName}) + endforeach() ++set(CATCH_CONFIG_SHARED_LIBRARY ${BUILD_SHARED_LIBS}) + + set(_OtherConfigOptions + "DISABLE_EXCEPTIONS" +--- a/src/catch2/catch_tostring.hpp ++++ b/src/catch2/catch_tostring.hpp +@@ -296,13 +296,13 @@ namespace Catch { + template<> + struct StringMaker { + static std::string convert(float value); +- static int precision; ++ CATCH_EXPORT static int precision; + }; + + template<> + struct StringMaker { + static std::string convert(double value); +- static int precision; ++ CATCH_EXPORT static int precision; + }; + + template +--- a/src/catch2/catch_user_config.hpp.in ++++ b/src/catch2/catch_user_config.hpp.in +@@ -181,6 +181,8 @@ + #cmakedefine CATCH_CONFIG_PREFIX_ALL + #cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG + ++#cmakedefine CATCH_CONFIG_SHARED_LIBRARY ++ + + // ------ + // "Variable" defines, these have actual values +--- a/src/catch2/internal/catch_compiler_capabilities.hpp ++++ b/src/catch2/internal/catch_compiler_capabilities.hpp +@@ -364,5 +364,15 @@ + # define CATCH_CONFIG_COLOUR_WIN32 + #endif + ++#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \ ++ !defined( CATCH_CONFIG_STATIC ) ++# ifdef Catch2_EXPORTS ++# define CATCH_EXPORT //__declspec( dllexport ) // not needed ++# else ++# define CATCH_EXPORT __declspec( dllimport ) ++# endif ++#else ++# define CATCH_EXPORT ++#endif + + #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED +--- a/src/catch2/internal/catch_context.hpp ++++ b/src/catch2/internal/catch_context.hpp +@@ -8,6 +8,8 @@ + #ifndef CATCH_CONTEXT_HPP_INCLUDED + #define CATCH_CONTEXT_HPP_INCLUDED + ++#include ++ + namespace Catch { + + class IResultCapture; +@@ -28,7 +30,7 @@ namespace Catch { + virtual void setConfig( IConfig const* config ) = 0; + + private: +- static IMutableContext *currentContext; ++ CATCH_EXPORT static IMutableContext *currentContext; + friend IMutableContext& getCurrentMutableContext(); + friend void cleanUpContext(); + static void createContext(); diff --git a/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch b/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch new file mode 100644 index 0000000000000..c7027940432a6 --- /dev/null +++ b/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch @@ -0,0 +1,16 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -359,8 +359,12 @@ if (NOT_SUBPROJECT) + Catch2WithMain + EXPORT + Catch2Targets +- DESTINATION ++ LIBRARY DESTINATION ++ ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION + ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ++ ${CMAKE_INSTALL_BINDIR} + ) + + diff --git a/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch b/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch new file mode 100644 index 0000000000000..63e221c1fb44c --- /dev/null +++ b/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch @@ -0,0 +1,77 @@ +--- a/CMake/CatchConfigOptions.cmake ++++ b/CMake/CatchConfigOptions.cmake +@@ -45,6 +45,7 @@ set(_OverridableOptions + foreach(OptionName ${_OverridableOptions}) + AddOverridableConfigOption(${OptionName}) + endforeach() ++set(CATCH_CONFIG_SHARED_LIBRARY ${BUILD_SHARED_LIBS}) + + set(_OtherConfigOptions + "DISABLE_EXCEPTIONS" +--- a/src/catch2/catch_tostring.hpp ++++ b/src/catch2/catch_tostring.hpp +@@ -296,13 +296,13 @@ namespace Catch { + template<> + struct StringMaker { + static std::string convert(float value); +- static int precision; ++ CATCH_EXPORT static int precision; + }; + + template<> + struct StringMaker { + static std::string convert(double value); +- static int precision; ++ CATCH_EXPORT static int precision; + }; + + template +--- a/src/catch2/catch_user_config.hpp.in ++++ b/src/catch2/catch_user_config.hpp.in +@@ -181,6 +181,8 @@ + #cmakedefine CATCH_CONFIG_PREFIX_ALL + #cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG + ++#cmakedefine CATCH_CONFIG_SHARED_LIBRARY ++ + + // ------ + // "Variable" defines, these have actual values +--- a/src/catch2/internal/catch_compiler_capabilities.hpp ++++ b/src/catch2/internal/catch_compiler_capabilities.hpp +@@ -376,5 +376,15 @@ + # define CATCH_CONFIG_COLOUR_WIN32 + #endif + ++#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \ ++ !defined( CATCH_CONFIG_STATIC ) ++# ifdef Catch2_EXPORTS ++# define CATCH_EXPORT //__declspec( dllexport ) // not needed ++# else ++# define CATCH_EXPORT __declspec( dllimport ) ++# endif ++#else ++# define CATCH_EXPORT ++#endif + + #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED +--- a/src/catch2/internal/catch_context.hpp ++++ b/src/catch2/internal/catch_context.hpp +@@ -8,6 +8,8 @@ + #ifndef CATCH_CONTEXT_HPP_INCLUDED + #define CATCH_CONTEXT_HPP_INCLUDED + ++#include ++ + namespace Catch { + + class IResultCapture; +@@ -28,7 +30,7 @@ namespace Catch { + virtual void setConfig( IConfig const* config ) = 0; + + private: +- static IMutableContext *currentContext; ++ CATCH_EXPORT static IMutableContext *currentContext; + friend IMutableContext& getCurrentMutableContext(); + friend void cleanUpContext(); + static void createContext(); diff --git a/recipes/catch2/3.x.x/test_package/CMakeLists.txt b/recipes/catch2/3.x.x/test_package/CMakeLists.txt index 5747d03f1f75f..1e2b06644735c 100644 --- a/recipes/catch2/3.x.x/test_package/CMakeLists.txt +++ b/recipes/catch2/3.x.x/test_package/CMakeLists.txt @@ -1,19 +1,16 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(Catch2 REQUIRED CONFIG) -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -if(NOT WITH_PREFIX) - add_executable(standalone 100-standalone.cpp) - target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) - add_executable(benchmark 200-benchmark.cpp) - target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) +if(WITH_PREFIX) + add_executable(standalone 300-standalone-with-prefix.cpp) + add_executable(benchmark 400-benchmark-with-prefix.cpp) else() - add_executable(standalone 300-standalone-with-prefix.cpp) - target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) - add_executable(benchmark 400-benchmark-with-prefix.cpp) - target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) + add_executable(standalone 100-standalone.cpp) + add_executable(benchmark 200-benchmark.cpp) endif() +target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) +target_compile_features(standalone PRIVATE cxx_std_14) +target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) +target_compile_features(benchmark PRIVATE cxx_std_14) diff --git a/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt b/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt index c64530cd7a4a6..b0d44d65b5f25 100644 --- a/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt +++ b/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt @@ -1,22 +1,19 @@ -cmake_minimum_required(VERSION 3.12) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +conan_basic_setup(TARGETS) find_package(Catch2 REQUIRED CONFIG) -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -if(NOT WITH_PREFIX) - add_executable(standalone ../test_package/100-standalone.cpp) - target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) - add_executable(benchmark ../test_package/200-benchmark.cpp) - target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) +if(WITH_PREFIX) + add_executable(standalone ../test_package/300-standalone-with-prefix.cpp) + add_executable(benchmark ../test_package/400-benchmark-with-prefix.cpp) else() - add_executable(standalone ../test_package/300-standalone-with-prefix.cpp) - target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) - add_executable(benchmark ../test_package/400-benchmark-with-prefix.cpp) - target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) + add_executable(standalone ../test_package/100-standalone.cpp) + add_executable(benchmark ../test_package/200-benchmark.cpp) endif() +target_link_libraries(standalone PRIVATE Catch2::Catch2WithMain) +target_compile_features(standalone PRIVATE cxx_std_14) +target_link_libraries(benchmark PRIVATE Catch2::Catch2WithMain) +target_compile_features(benchmark PRIVATE cxx_std_14) From f5315df8a5b576650e0a51acc64a6dc9f917d37e Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 29 Sep 2022 16:45:37 +0200 Subject: [PATCH 250/561] (#13199) mozilla-build: generate gcc11 binaries * mozilla-build: generate gcc11 binaries * Update conanfile.py * Update conanfile.py --- recipes/mozilla-build/all/conanfile.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/recipes/mozilla-build/all/conanfile.py b/recipes/mozilla-build/all/conanfile.py index 56f0c507eb671..c13282cd3e215 100644 --- a/recipes/mozilla-build/all/conanfile.py +++ b/recipes/mozilla-build/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import download +from conan.errors import ConanInvalidConfiguration import os +required_conan_version = ">=1.52.0" class MozillaBuildConan(ConanFile): name = "mozilla-build" @@ -21,8 +23,8 @@ def build_requirements(self): def build(self): filename = "mozilla-build.exe" - tools.download(**self.conan_data["sources"][self.version][0], filename=filename) - tools.download(**self.conan_data["sources"][self.version][1], filename="LICENSE") + download(self, **self.conan_data["sources"][self.version][0], filename=filename) + download(self, **self.conan_data["sources"][self.version][1], filename="LICENSE") self.run(f"7z x {filename}", run_environment=True) @@ -35,6 +37,7 @@ def package_id(self): del self.info.settings.compiler def package_info(self): + self.cpp_info.includedirs = [] binpath = os.path.join(self.package_folder, "bin") - self.output.info("Adding to PATH: {}".format(binpath)) + self.output.info(f"Adding to PATH: {binpath}") self.env_info.PATH.append(binpath) From f5d763e438f7c2ad338e0e074fea6a5ad3abcfc9 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 29 Sep 2022 17:05:18 +0200 Subject: [PATCH 251/561] (#13203) xorg-proto: generate gcc11 binaries --- recipes/xorg-proto/all/conanfile.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/recipes/xorg-proto/all/conanfile.py b/recipes/xorg-proto/all/conanfile.py index ad8e696b97953..47a81a9f8ca66 100644 --- a/recipes/xorg-proto/all/conanfile.py +++ b/recipes/xorg-proto/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import rmdir, mkdir, save, load +from conan.tools.files import rmdir, mkdir, save, load, get, apply_conandata_patches from conans import AutoToolsBuildEnvironment, tools import contextlib import glob @@ -7,7 +7,7 @@ import re import yaml -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.41.0" class XorgProtoConan(ConanFile): @@ -54,7 +54,7 @@ def package_id(self): del self.info.settings.compiler def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) @contextlib.contextmanager @@ -78,8 +78,7 @@ def _configure_autotools(self): return self._autotools def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) with self._build_context(): autotools = self._configure_autotools() autotools.make() From a4840119a24f0efd0291695a09278f2c6cb3ad82 Mon Sep 17 00:00:00 2001 From: M Rota Date: Fri, 30 Sep 2022 11:28:39 +0200 Subject: [PATCH 252/561] (#12835) libmodbus: conan v2 support * modernize libmodbus for conanv2 * fix some minor linter warnings * add test_v1_package * temporarely disable vcvars envs definition * fix missing assignment * fix wrong cross_building import * try requiring automake for macos builds * Remove project name from topics Co-authored-by: Uilian Ries * Use is_msvc Co-authored-by: Uilian Ries * Remove unneeded comments Co-authored-by: Uilian Ries * Fix conan.tools.microsoft imports * revert Macos check * add MSVC specific stuff ported following PR #12916 * add apple and destdir fixes * fix linting * remove autoreconf, not really needed * set win_bash in configure stage * use deps_user_info instead of conf to get ar_lib * add -FS to extra_cflags * replace wsock32 system_libs with ws2_32 (see libmodbus configure.ac) * minor changes * fix Windows AR arguments * Apply suggestions for test_v1_package Co-authored-by: Uilian Ries * revert removal of _settings_build for checking if msys2 is needed * Update recipes/libmodbus/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/libmodbus/all/conanfile.py Co-authored-by: Uilian Ries * Re-use test_package.c Co-authored-by: Uilian Ries --- recipes/libmodbus/all/conandata.yml | 1 - recipes/libmodbus/all/conanfile.py | 174 ++++++++++-------- .../all/patches/0001-msvc-fixes.patch | 1 - .../libmodbus/all/test_package/CMakeLists.txt | 7 +- .../libmodbus/all/test_package/conanfile.py | 19 +- .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 20 ++ 7 files changed, 147 insertions(+), 85 deletions(-) create mode 100644 recipes/libmodbus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmodbus/all/test_v1_package/conanfile.py diff --git a/recipes/libmodbus/all/conandata.yml b/recipes/libmodbus/all/conandata.yml index 53ef0226d6976..abf66781fb048 100644 --- a/recipes/libmodbus/all/conandata.yml +++ b/recipes/libmodbus/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "3.1.6": - patch_file: "patches/0001-msvc-fixes.patch" - base_path: "source_subfolder" diff --git a/recipes/libmodbus/all/conanfile.py b/recipes/libmodbus/all/conanfile.py index a5a6aadf80901..0340e921e9e52 100644 --- a/recipes/libmodbus/all/conanfile.py +++ b/recipes/libmodbus/all/conanfile.py @@ -1,15 +1,23 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from contextlib import contextmanager +from conan import ConanFile +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rename, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, 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 -required_conan_version = ">=1.33.0" + +required_conan_version = ">=1.51.3" class LibmodbusConan(ConanFile): name = "libmodbus" description = "libmodbus is a free software library to send/receive data according to the Modbus protocol" homepage = "https://libmodbus.org/" - topics = ("conan", "libmodbus", "modbus", "protocol", "industry", "automation") + topics = ("modbus", "protocol", "industry", "automation") license = "LGPL-2.1" url = "https://github.com/conan-io/conan-center-index" exports_sources = "patches/**" @@ -23,12 +31,6 @@ class LibmodbusConan(ConanFile): "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return self.settings_build if hasattr(self, "settings_build") else self.settings @@ -39,85 +41,109 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC # once removed by config_options, need try..except for a second del + except Exception: + pass + try: + del self.settings.compiler.libcxx # for plain C projects only + except Exception: + pass + try: + del self.settings.compiler.cppstd # for plain C projects only + except Exception: + pass + if self.settings.os == "Windows": + self.win_bash = True def build_requirements(self): - if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.3") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.3") + # see https://github.com/conan-io/conan/issues/11969 + bash_path = os.getenv("CONAN_BASH_PATH") or self.conf.get("tools.microsoft.bash:path") + if self._settings_build.os == "Windows" and not bash_path: + self.tool_requires("msys2/cci.latest") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - conf_args = [ - "--disable-tests", - "--without-documentation", - "--prefix={}".format(tools.unix_path(self.package_folder)), - ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--enable-static", "--disable-shared"]) - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) >= "12": - if self.settings.build_type in ("Debug", "RelWithDebInfo"): - self._autotools.flags.append("-FS") - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools - - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - env = { - "CC": "cl -nologo", - "CXX": "cl -nologo", - "LD": "link -nologo", - "AR": "{} \"lib -nologo -verbose\"".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - "RANLIB": ":", - "STRING": ":", - "NM": "dumpbin -symbols"} - with tools.environment_append(env): - yield - else: - yield + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def validate(self): + # validate the minimum cpp standard supported + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.append("--without-documentation") + tc.configure_args.append("--disable-tests") + + # the following MSVC specific part has been ported from conan v1 following https://github.com/conan-io/conan-center-index/pull/12916 + if is_msvc(self) and Version(self.settings.compiler.version) >= "12": + tc.extra_cflags.append("-FS") + + env = tc.environment() + + if is_msvc(self): + ar_lib = unix_path(self, self.deps_user_info['automake'].ar_lib) + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_lib} \"lib -nologo -verbose\"") + env.define("RANLIB", ":") + env.define("STRING", ":") + env.define("NM", "dumpbin -symbols") + + tc.generate(env) + + # generate dependencies for pkg-config + tc = PkgConfigDeps(self) + tc.generate() + + # generate dependencies for autotools + tc = AutotoolsDeps(self) + tc.generate() + + # inject tools_require env vars in build context + ms = VirtualBuildEnv(self) + ms.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) if not self.options.shared: for decl in ("__declspec(dllexport)", "__declspec(dllimport)"): - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "modbus.h"), decl, "") + replace_in_file(self, os.path.join(self.source_folder, "src", "modbus.h"), decl, "") def build(self): self._patch_sources() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING*", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() - - os.unlink(os.path.join(self.package_folder, "lib", "libmodbus.la")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, pattern="COPYING*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + autotools = Autotools(self) + # see https://github.com/conan-io/conan/issues/12006 + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + + if is_apple_os(self): + fix_apple_shared_install_name(self) + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) if self.settings.compiler == "Visual Studio" and self.options.shared: - tools.rename(os.path.join(self.package_folder, "lib", "modbus.dll.lib"), - os.path.join(self.package_folder, "lib", "modbus.lib")) + rename(self, + os.path.join(self.package_folder, "lib", "modbus.dll.lib"), + os.path.join(self.package_folder, "lib", "modbus.lib")) def package_info(self): - self.cpp_info.names["pkg_config"] = "libmodbus" - self.cpp_info.includedirs.append(os.path.join("include", "modbus")) self.cpp_info.libs = ["modbus"] + + self.cpp_info.set_property("pkg_config_name", "libmodbus") + if self.settings.os == "Windows" and not self.options.shared: - self.cpp_info.system_libs = ["wsock32"] + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/libmodbus/all/patches/0001-msvc-fixes.patch b/recipes/libmodbus/all/patches/0001-msvc-fixes.patch index ef34b4f272cf0..de64a8e50f76f 100644 --- a/recipes/libmodbus/all/patches/0001-msvc-fixes.patch +++ b/recipes/libmodbus/all/patches/0001-msvc-fixes.patch @@ -9,7 +9,6 @@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ -diff -ur source_original/source_subfolder/src/modbus-private.h source/source_subfolder/src/modbus-private.h --- src/modbus-private.h +++ src/modbus-private.h @@ -13,7 +13,7 @@ diff --git a/recipes/libmodbus/all/test_package/CMakeLists.txt b/recipes/libmodbus/all/test_package/CMakeLists.txt index 2869c07a9f766..589d598cde656 100644 --- a/recipes/libmodbus/all/test_package/CMakeLists.txt +++ b/recipes/libmodbus/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libmodbus REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libmodbus::libmodbus) diff --git a/recipes/libmodbus/all/test_package/conanfile.py b/recipes/libmodbus/all/test_package/conanfile.py index 43ee017a2330f..49ea0c6cecc47 100644 --- a/recipes/libmodbus/all/test_package/conanfile.py +++ b/recipes/libmodbus/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" + 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,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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmodbus/all/test_v1_package/CMakeLists.txt b/recipes/libmodbus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d03cbd8daf516 --- /dev/null +++ b/recipes/libmodbus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libmodbus CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmodbus::libmodbus) diff --git a/recipes/libmodbus/all/test_v1_package/conanfile.py b/recipes/libmodbus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3898047081060 --- /dev/null +++ b/recipes/libmodbus/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake +from conans.tools import cross_building +import os + + +# legacy validation with Coann 1.x +class TestPackageV1Conan(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 cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + From f9825b20253393c0eef6130277ba76017ab1b2f0 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 30 Sep 2022 11:44:50 +0200 Subject: [PATCH 253/561] (#13131) odbc: conan v2 support + unvendor libltdl * conan v2 support * handle system libs deps of libltdl * fix ODR violation between odbc & odbccr * fix duplicated symbol in 2.3.11 --- recipes/odbc/all/conandata.yml | 8 +- recipes/odbc/all/conanfile.py | 132 ++++++++++-------- .../0001-duplicated-get-connection.patch | 11 ++ ....patch => 0002-missing-declarations.patch} | 0 recipes/odbc/all/test_package/CMakeLists.txt | 7 +- recipes/odbc/all/test_package/conanfile.py | 28 ++-- .../odbc/all/test_v1_package/CMakeLists.txt | 10 ++ recipes/odbc/all/test_v1_package/conanfile.py | 18 +++ 8 files changed, 138 insertions(+), 76 deletions(-) create mode 100644 recipes/odbc/all/patches/0001-duplicated-get-connection.patch rename recipes/odbc/all/patches/{missing-declarations.patch => 0002-missing-declarations.patch} (100%) create mode 100644 recipes/odbc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/odbc/all/test_v1_package/conanfile.py diff --git a/recipes/odbc/all/conandata.yml b/recipes/odbc/all/conandata.yml index 5dc1a314049d4..d79ee7fbfc269 100644 --- a/recipes/odbc/all/conandata.yml +++ b/recipes/odbc/all/conandata.yml @@ -15,6 +15,10 @@ sources: - "http://www.unixodbc.net/unixODBC-2.3.7.tar.gz" sha256: "45f169ba1f454a72b8fcbb82abd832630a3bf93baa84731cf2949f449e1e3e77" patches: + "2.3.11": + - patch_file: "patches/0001-duplicated-get-connection.patch" + "2.3.9": + - patch_file: "patches/0001-duplicated-get-connection.patch" "2.3.7": - - patch_file: "patches/missing-declarations.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-duplicated-get-connection.patch" + - patch_file: "patches/0002-missing-declarations.patch" diff --git a/recipes/odbc/all/conanfile.py b/recipes/odbc/all/conanfile.py index 52f93e639c109..febbf1708b217 100644 --- a/recipes/odbc/all/conanfile.py +++ b/recipes/odbc/all/conanfile.py @@ -1,10 +1,12 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout import os import shutil -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class OdbcConan(ConanFile): @@ -27,84 +29,106 @@ class OdbcConan(ConanFile): "with_libiconv": True, } - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _user_info_build(self): return getattr(self, "user_info_build", self.deps_user_info) def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): + self.requires("libtool/2.4.7") if self.options.with_libiconv: self.requires("libiconv/1.17") def validate(self): - if self.settings.os == "Windows": + if self.info.settings.os == "Windows": raise ConanInvalidConfiguration("odbc is a system lib on Windows") def build_requirements(self): - self.build_requires("gnu-config/cci.20201022") + self.tool_requires("gnu-config/cci.20210814") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--without-included-ltdl", + f"--with-ltdl-include={self.dependencies['libtool'].cpp_info.includedirs[0]}", + f"--with-ltdl-lib={self.dependencies['libtool'].cpp_info.libdirs[0]}", + "--disable-ltdl-install", + f"--enable-iconv={yes_no(self.options.with_libiconv)}", + "--sysconfdir=/etc", + ]) + if self.options.with_libiconv: + libiconv_prefix = self.dependencies["libiconv"].package_folder + tc.configure_args.append(f"--with-libiconv-prefix={libiconv_prefix}") + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) + # support more triplets shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, - os.path.join(self._source_subfolder, "config.sub")) + os.path.join(self.source_folder, "config.sub")) shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, - os.path.join(self._source_subfolder, "config.guess")) + os.path.join(self.source_folder, "config.guess")) + # allow external libtdl (in libtool recipe) + replace_in_file( + self, + os.path.join(self.source_folder, "configure"), + "if test -f \"$with_ltdl_lib/libltdl.la\";", + "if true;", + ) + libtool_system_libs = self.dependencies["libtool"].cpp_info.system_libs + if libtool_system_libs: + replace_in_file( + self, + os.path.join(self.source_folder, "configure"), + "-L$with_ltdl_lib -lltdl", + "-L$with_ltdl_lib -lltdl -l{}".format(" -l".join(libtool_system_libs)), + ) # relocatable shared libs on macOS for configure in [ - os.path.join(self._source_subfolder, "configure"), - os.path.join(self._source_subfolder, "libltdl", "configure"), + os.path.join(self.source_folder, "configure"), + os.path.join(self.source_folder, "libltdl", "configure"), ]: - tools.replace_in_file(configure, "-install_name \\$rpath/", "-install_name @rpath/") - - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self) - autotools.libs = [] - yes_no = lambda v: "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--enable-ltdl-install", - "--enable-iconv={}".format(yes_no(self.options.with_libiconv)), - "--sysconfdir=/etc", - ] - if self.options.with_libiconv: - libiconv_prefix = self.deps_cpp_info["libiconv"].rootpath - args.append("--with-libiconv-prefix={}".format(libiconv_prefix)) - autotools.configure(configure_dir=self._source_subfolder, args=args) - return autotools + replace_in_file(self, configure, "-install_name \\$rpath/", "-install_name @rpath/") def build(self): self._patch_sources() - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") @@ -119,26 +143,24 @@ def package_info(self): # odbc self.cpp_info.components["_odbc"].set_property("pkg_config_name", "odbc") self.cpp_info.components["_odbc"].libs = ["odbc"] - self.cpp_info.components["_odbc"].requires = ["odbcltdl"] + self.cpp_info.components["_odbc"].requires = ["libtool::libtool"] if self.options.with_libiconv: self.cpp_info.components["_odbc"].requires.append("libiconv::libiconv") # odbcinst self.cpp_info.components["odbcinst"].set_property("pkg_config_name", "odbcinst") self.cpp_info.components["odbcinst"].libs = ["odbcinst"] - self.cpp_info.components["odbcinst"].requires = ["odbcltdl"] + self.cpp_info.components["odbcinst"].requires = ["libtool::libtool"] # odbccr self.cpp_info.components["odbccr"].set_property("pkg_config_name", "odbccr") self.cpp_info.components["odbccr"].libs = ["odbccr"] - self.cpp_info.components["odbcltdl"].libs = ["ltdl"] - if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_odbc"].system_libs = ["pthread"] self.cpp_info.components["odbcinst"].system_libs = ["pthread"] - self.cpp_info.components["odbcltdl"].system_libs = ["dl"] + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/odbc/all/patches/0001-duplicated-get-connection.patch b/recipes/odbc/all/patches/0001-duplicated-get-connection.patch new file mode 100644 index 0000000000000..4357214d44a8d --- /dev/null +++ b/recipes/odbc/all/patches/0001-duplicated-get-connection.patch @@ -0,0 +1,11 @@ +--- a/cur/SQLGetDiagRec.c ++++ b/cur/SQLGetDiagRec.c +@@ -101,8 +101,4 @@ SQLRETURN CLGetDiagRec( SQLSMALLINT handle_type, + text_length_ptr); + } + +-DMHDBC __get_connection( EHEAD * head ) +-{ +- return 0; +-} + diff --git a/recipes/odbc/all/patches/missing-declarations.patch b/recipes/odbc/all/patches/0002-missing-declarations.patch similarity index 100% rename from recipes/odbc/all/patches/missing-declarations.patch rename to recipes/odbc/all/patches/0002-missing-declarations.patch diff --git a/recipes/odbc/all/test_package/CMakeLists.txt b/recipes/odbc/all/test_package/CMakeLists.txt index 5250e0988835b..7079befc5a173 100644 --- a/recipes/odbc/all/test_package/CMakeLists.txt +++ b/recipes/odbc/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(ODBC REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ODBC::ODBC) +target_link_libraries(${PROJECT_NAME} PRIVATE ODBC::ODBC) diff --git a/recipes/odbc/all/test_package/conanfile.py b/recipes/odbc/all/test_package/conanfile.py index 620e449c0ca6b..1278841f61298 100644 --- a/recipes/odbc/all/test_package/conanfile.py +++ b/recipes/odbc/all/test_package/conanfile.py @@ -1,19 +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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # Workaround for CMake bug with error message: - # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # set. This could be because you are using a Mac OS X version less than 10.5 - # or because CMake's platform configuration is corrupt. - # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -21,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") - self.run(bin_path, run_environment=True) - self.run("odbcinst --version", run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + self.run("odbcinst --version", env="conanrun") diff --git a/recipes/odbc/all/test_v1_package/CMakeLists.txt b/recipes/odbc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f2decbd539e08 --- /dev/null +++ b/recipes/odbc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ODBC REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ODBC::ODBC) diff --git a/recipes/odbc/all/test_v1_package/conanfile.py b/recipes/odbc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..dfa9a73cae43c --- /dev/null +++ b/recipes/odbc/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + self.run("odbcinst --version", run_environment=True) From df0e46542456825aad86ecc0a76a4ebbe3d3a76b Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 30 Sep 2022 12:04:56 +0200 Subject: [PATCH 254/561] (#13208) docs: add link to Twitter for more visibility --- docs/community_resources.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/community_resources.md b/docs/community_resources.md index 6a09713749810..265ae610b3327 100644 --- a/docs/community_resources.md +++ b/docs/community_resources.md @@ -13,6 +13,8 @@ This is a curated list of various bots and helpful tools that aim to making appr The community is very active on the [Cpplang's Slack channel](https://cpplang.slack.com/archives/C41CWV9HA), it's a great place to get help. +If you are looking to stay up to date with the last Conan news, follow us on Twitter [@conan_io](https://twitter.com/conan_io) + ## Bots - [Updatable Recipes](https://github.com/qchateau/conan-center-bot): Automatically scans available recipes and checked for new upstream releases and tests one configuration From c68a94226af13cc255ef3c765c547c3b87326e53 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 30 Sep 2022 12:24:47 +0200 Subject: [PATCH 255/561] (#13210) docs: update list of reviewers Plus a few tweaks --- docs/review_process.md | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/docs/review_process.md b/docs/review_process.md index d746d332e894d..df8d39acf31d6 100644 --- a/docs/review_process.md +++ b/docs/review_process.md @@ -72,43 +72,17 @@ Once you're done with your changes, remember to convert from "Draft" to "Normal" ## Getting your pull request reviewed -Each PR must be reviewed by several reviewers before it will be merged. It cannot be just reviews from random people, we have two categories of reviewers: - -### Official reviewers - -The list includes only official Conan developers: - -- [@memsharded](https://github.com/memsharded) -- [@lasote](https://github.com/lasote) -- [@danimtb](https://github.com/danimtb) -- [@jgsogo](https://github.com/jgsogo) -- [@czoido](https://github.com/czoido) -- [@sse4](https://github.com/sse4) -- [@uilianries](https://github.com/uilianries) - -### Community reviewers - -The list includes conan-center-index contributors who are very active and proven to be trusted - they frequently submit pull requests and provide their own useful reviews: - -- [@madebr](https://github.com/madebr) -- [@SpaceIm](https://github.com/SpaceIm) -- [@ericLemanissier](https://github.com/ericLemanissier) -- [@prince-chrismc](https://github.com/prince-chrismc) -- [@Croydon](https://github.com/Croydon) -- [@intelligide](https://github.com/intelligide) -- [@theirix](https://github.com/theirix) -- [@gocarlos](https://github.com/gocarlos) -- [@mathbunnyru](https://github.com/mathbunnyru) -- [@ericriff](https://github.com/ericriff) -- [@toge](https://github.com/toge) -- [@AndreyMlashkin](https://github.com/AndreyMlashkin) -- [@MartinDelille](https://github.com/MartinDelille) -- [@dmn-star](https://github.com/dmn-star) - -The list, located [here](../.c3i/reviewers.yml), +Each PR must be reviewed by several reviewers before it will be merged. It cannot be just reviews from anyone, we have two categories of reviewers: + +- Official reviewers: these are active team members who are responsible for developing Conan, ConanCenter, and ConanCenterIndex. +- Community reviewers: this list includes former Conan team members and ConanCenterIndex contributors who are very active and proven to be trusted - they frequently submit pull requests and provide their own useful reviews + +The list or reviewers, located [here](../.c3i/reviewers.yml), is not constant and will change periodically based on contribution. That also means **you can be included in this list** as well - submit PRs and provide reviews, and in time you may be added as a trusted contributor. +> **Note**: GitHubs user interface does not support such custom rules so you should not rely solely on the message it provides. + ### Rule of 2 reviews At least 2 approving reviews are required, and at least one of them has to be from the official reviewers. From 37c5d178782cdf7b44549cb4577c4ac47dbd8c7d Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 30 Sep 2022 19:44:37 +0900 Subject: [PATCH 256/561] (#13216) osmanip: add version 4.2.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/osmanip/all/conandata.yml | 3 +++ recipes/osmanip/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/osmanip/all/conandata.yml b/recipes/osmanip/all/conandata.yml index 3812e99a092c4..f7bfb55b13068 100644 --- a/recipes/osmanip/all/conandata.yml +++ b/recipes/osmanip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.2.2": + url: "https://github.com/JustWhit3/osmanip/archive/v4.2.2.tar.gz" + sha256: "841b76bb4f44b66d714858e62661cee75c4fef553300b6da2a6720509421a5fe" "4.2.1": url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.2.1.tar.gz" sha256: "1d1ba3fac66edc7a7e4c480a0c080493d19193f9b63b70d417e2683f8741bf1c" diff --git a/recipes/osmanip/config.yml b/recipes/osmanip/config.yml index 0532c75dfff27..1d6418ec4bbcb 100644 --- a/recipes/osmanip/config.yml +++ b/recipes/osmanip/config.yml @@ -1,4 +1,6 @@ versions: + "4.2.2": + folder: all "4.2.1": folder: all "4.1.0": From bd82b03370b7afd6a4725f9edff5ec80737554ca Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 30 Sep 2022 13:04:40 +0200 Subject: [PATCH 257/561] (#13217) libglvnd: generate gcc11 binaries --- recipes/libglvnd/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/libglvnd/all/conanfile.py b/recipes/libglvnd/all/conanfile.py index 920477bf7faff..7d1919c184d04 100644 --- a/recipes/libglvnd/all/conanfile.py +++ b/recipes/libglvnd/all/conanfile.py @@ -61,15 +61,15 @@ def requirements(self): if self.options.x11: self.requires("xorg/system") if self.options.glx: - self.requires("xorg-proto/2021.4") + self.requires("xorg-proto/2022.2") def validate(self): if self.settings.os not in ['Linux', 'FreeBSD']: raise ConanInvalidConfiguration("libglvnd is only compatible with Linux and FreeBSD") def build_requirements(self): - self.build_requires("meson/0.62.2") - self.build_requires("pkgconf/1.7.4") + self.build_requires("meson/0.63.2") + self.build_requires("pkgconf/1.9.3") def layout(self): basic_layout(self) From 397698c245249516d2998314e5dde7ff3cc8a7b2 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 30 Sep 2022 14:24:54 +0300 Subject: [PATCH 258/561] (#13222) godot_headers: add version 3.5.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/godot_headers/all/conandata.yml | 3 +++ recipes/godot_headers/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/godot_headers/all/conandata.yml b/recipes/godot_headers/all/conandata.yml index 7e0f9e32ac8cf..8764611b2ac9a 100644 --- a/recipes/godot_headers/all/conandata.yml +++ b/recipes/godot_headers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.5.1": + url: "https://github.com/godotengine/godot-headers/archive/godot-3.5.1-stable.tar.gz" + sha256: "1c38268031425a4881c0d6d41926a0f1bf5847f05dc24c29332609e318276b6b" "3.4.4": url: "https://github.com/godotengine/godot-headers/archive/godot-3.4.4-stable.tar.gz" sha256: "bb0eac00a4d5b800a4ca2555d11b4a35981bdb730b630e9bd31a0649fa1d6fd7" diff --git a/recipes/godot_headers/config.yml b/recipes/godot_headers/config.yml index c6a4cef379254..3ded438e58f33 100644 --- a/recipes/godot_headers/config.yml +++ b/recipes/godot_headers/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.1": + folder: all "3.4.4": folder: all "3.4": From 17a90439bbb43bcd91668310201337043bd38c34 Mon Sep 17 00:00:00 2001 From: Nicolai Grodzitski Date: Fri, 30 Sep 2022 13:44:22 +0200 Subject: [PATCH 259/561] (#13229) Add logr v0.5.1 --- recipes/logr/all/conandata.yml | 3 +++ recipes/logr/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/logr/all/conandata.yml b/recipes/logr/all/conandata.yml index 9af49e299416a..9076e1decadad 100644 --- a/recipes/logr/all/conandata.yml +++ b/recipes/logr/all/conandata.yml @@ -11,3 +11,6 @@ sources: "0.4.0": url: "https://github.com/ngrodzitski/logr/archive/v0.4.0.tar.gz" sha256: "c355aa455d0a9c6d1d3bc168a2db0cd7f3c9706b382088e96948ec3a4cf1286f" + "0.5.1": + url: "https://github.com/ngrodzitski/logr/archive/v0.5.1.tar.gz" + sha256: "674be6a53d5b3f40273b1b5710ac9e32d870827032b5008c41621db47f4b3b0e" diff --git a/recipes/logr/config.yml b/recipes/logr/config.yml index 5d8c97aa7e21b..c1a11eb732221 100644 --- a/recipes/logr/config.yml +++ b/recipes/logr/config.yml @@ -9,3 +9,5 @@ versions: folder: all "0.4.0": folder: all + "0.5.1": + folder: all From b58fe95de2b912a481cce34144505cfe3215a2e5 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 30 Sep 2022 22:24:51 +0900 Subject: [PATCH 260/561] (#13187) trantor: add version 1.5.7 and support conan v2 * trantor: add version 1.5.7 and support conan v2 * set BUILD_SHARED_LIBS in trantor/>=1.5.6 * link math lib * fix typo * use msvc_runtime_flag Co-authored-by: Uilian Ries * import msvc_runtime_flag Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/trantor/all/CMakeLists.txt | 7 -- recipes/trantor/all/conandata.yml | 3 + recipes/trantor/all/conanfile.py | 99 ++++++++++--------- .../trantor/all/test_package/CMakeLists.txt | 3 - recipes/trantor/all/test_package/conanfile.py | 19 +++- .../all/test_v1_package/CMakeLists.txt | 12 +++ .../trantor/all/test_v1_package/conanfile.py | 18 ++++ recipes/trantor/config.yml | 2 + 8 files changed, 102 insertions(+), 61 deletions(-) delete mode 100644 recipes/trantor/all/CMakeLists.txt create mode 100644 recipes/trantor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/trantor/all/test_v1_package/conanfile.py diff --git a/recipes/trantor/all/CMakeLists.txt b/recipes/trantor/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/trantor/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/trantor/all/conandata.yml b/recipes/trantor/all/conandata.yml index 455bbc430bc18..689db707a3d3d 100644 --- a/recipes/trantor/all/conandata.yml +++ b/recipes/trantor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.7": + url: "https://github.com/an-tao/trantor/archive/v1.5.7.tar.gz" + sha256: "42576563afbf1e58c7d68f758cf3fca4d193496d4e3f82c80069d8389a7839d5" "1.5.6": url: "https://github.com/an-tao/trantor/archive/v1.5.6.tar.gz" sha256: "827aca30e120244a8ede9d07446481328d9a3869228f01fc4978b19301d66e65" diff --git a/recipes/trantor/all/conanfile.py b/recipes/trantor/all/conanfile.py index 431f2f2574231..403401b84df3b 100644 --- a/recipes/trantor/all/conanfile.py +++ b/recipes/trantor/all/conanfile.py @@ -1,19 +1,22 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import os -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.files import get, copy, 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 -required_conan_version = ">=1.43.0" +import os +required_conan_version = ">=1.52.0" class TrantorConan(ConanFile): name = "trantor" description = "a non-blocking I/O tcp network lib based on c++14/17" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/an-tao/trantor" topics = ("tcp-server", "asynchronous-programming", "non-blocking-io") license = "BSD-3-Clause" - homepage = "https://github.com/an-tao/trantor" - url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -26,16 +29,9 @@ class TrantorConan(ConanFile): "with_c_ares": True, } - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + def _minimum_cpp_standard(self): + return 14 @property def _compilers_minimum_version(self): @@ -52,7 +48,13 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("openssl/1.1.1q") @@ -60,51 +62,55 @@ def requirements(self): self.requires("c-ares/1.18.1") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("trantor requires C++14, which your compiler does not support.") + if Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") else: - self.output.warn("trantor requires C++14. Your compiler is unknown. Assuming it supports C++14.") + self.output.warn(f"{self.ref} requires C++{self._minimum_cpp_standard}. Your compiler is unknown. Assuming it supports C++{self._minimum_cpp_standard}.") - # TODO: Compilation succeeds, but execution of test_package fails on Visual Studio 16 MDd - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) == "16" and \ - self.options.shared == True and self.settings.compiler.runtime == "MDd": - raise ConanInvalidConfiguration("trantor does not support the MDd runtime on Visual Studio 16.") + # TODO: Compilation succeeds, but execution of test_package fails on Visual Studio with MDd + if is_msvc(self) and self.options.shared and "MDd" in msvc_runtime_flag(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support the MDd runtime on Visual Studio.") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "1.5.6": + tc.variables["BUILD_TRANTOR_SHARED"] = self.options.shared + else: + # Trantor's CMakeLists.txt has BUILD_SHARED_LIBS option. + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_C-ARES"] = self.options.with_c_ares + tc.generate() + + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") # fix c-ares imported target - tools.replace_in_file(cmakelists, "c-ares_lib", "c-ares::cares") + replace_in_file(self, cmakelists, "c-ares_lib", "c-ares::cares") # Cleanup rpath in shared lib - tools.replace_in_file(cmakelists, "set(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}\")", "") - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TRANTOR_SHARED"] = self.options.shared - cmake.definitions["BUILD_C-ARES"] = self.options.with_c_ares - cmake.configure(build_folder=self._build_subfolder) - - return cmake + replace_in_file(self, cmakelists, "set(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}\")", "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + 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, pattern="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, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Trantor") @@ -115,6 +121,7 @@ def package_info(self): self.cpp_info.system_libs.append("ws2_32") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("m") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "Trantor" diff --git a/recipes/trantor/all/test_package/CMakeLists.txt b/recipes/trantor/all/test_package/CMakeLists.txt index 55d9d825736a1..6f1ffb862ba14 100644 --- a/recipes/trantor/all/test_package/CMakeLists.txt +++ b/recipes/trantor/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(Trantor CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/trantor/all/test_package/conanfile.py b/recipes/trantor/all/test_package/conanfile.py index 27c426e38df11..a9fbb7f543162 100644 --- a/recipes/trantor/all/test_package/conanfile.py +++ b/recipes/trantor/all/test_package/conanfile.py @@ -1,9 +1,18 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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,6 +20,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/trantor/all/test_v1_package/CMakeLists.txt b/recipes/trantor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b4e59cd2346d6 --- /dev/null +++ b/recipes/trantor/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Trantor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Trantor::Trantor) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/trantor/all/test_v1_package/conanfile.py b/recipes/trantor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/trantor/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/trantor/config.yml b/recipes/trantor/config.yml index 20f69b756a9a7..7ef1237728a27 100644 --- a/recipes/trantor/config.yml +++ b/recipes/trantor/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.7": + folder: "all" "1.5.6": folder: "all" "1.5.5": From 6fa50bbef15e1c20dcd8636b5d677fbb8ff7fb90 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 30 Sep 2022 16:45:01 +0300 Subject: [PATCH 261/561] (#13194) bdwgc: Fix libatomic_ops dependency package/target name * bdwgc: Fix libatomic_ops dependency package/target name * bdwgc: Remove redundant include of libatomic_ops/src for 8.0.x --- recipes/bdwgc/all/conanfile.py | 2 +- recipes/bdwgc/all/patches/update-cmake-8_0_4.patch | 11 ++++------- recipes/bdwgc/all/patches/update-cmake-8_0_6.patch | 11 ++++------- recipes/bdwgc/all/patches/update-cmake-8_2_2.patch | 10 ++++------ 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/recipes/bdwgc/all/conanfile.py b/recipes/bdwgc/all/conanfile.py index 0c861930ab15c..925a47c27595c 100644 --- a/recipes/bdwgc/all/conanfile.py +++ b/recipes/bdwgc/all/conanfile.py @@ -151,7 +151,7 @@ def package_info(self): if self.options.gc_debug: self.cpp_info.components["gc"].defines.append("GC_DEBUG") if self.settings.os == "Windows": - self.cpp_info.components["gc"].requires = ["libatomic_ops::libatomic_ops"] + self.cpp_info.components["gc"].requires = ["libatomic_ops::atomic_ops"] if self.options.cplusplus and self.options.get_safe("throw_bad_alloc_library"): self.cpp_info.components["gctba"].set_property("cmake_target_name", "BDWgc::gctba") diff --git a/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch b/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch index 5a48c4e44df1a..1af6e770494fc 100644 --- a/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch +++ b/recipes/bdwgc/all/patches/update-cmake-8_0_4.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -21,241 +21,606 @@ +@@ -21,241 +21,603 @@ # this will generate gc.sln # @@ -335,13 +335,10 @@ + include_directories(${Threads_INCLUDE_DIR}) + set(THREADDLLIBS ${CMAKE_THREAD_LIBS_INIT}) + endif() -+ include_directories(libatomic_ops/src) + if (MSVC) -+ # TODO: Rename the following to Atomic_ops -+ find_package(libatomic_ops CONFIG) -+ if (libatomic_ops_FOUND) -+ # TODO: Rename the following to Atomic_ops::atomic_ops -+ get_target_property(AO_INCLUDE_DIRS libatomic_ops::libatomic_ops ++ find_package(Atomic_ops CONFIG) ++ if (Atomic_ops_FOUND) ++ get_target_property(AO_INCLUDE_DIRS Atomic_ops::atomic_ops + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${AO_INCLUDE_DIRS}) + endif() diff --git a/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch b/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch index f2b5ba9e75570..10451ed429544 100644 --- a/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch +++ b/recipes/bdwgc/all/patches/update-cmake-8_0_6.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -21,232 +21,602 @@ +@@ -21,232 +21,599 @@ # this will generate gc.sln # @@ -321,13 +321,10 @@ + include_directories(${Threads_INCLUDE_DIR}) + set(THREADDLLIBS ${CMAKE_THREAD_LIBS_INIT}) + endif() -+ include_directories(libatomic_ops/src) + if (MSVC) -+ # TODO: Rename the following to Atomic_ops -+ find_package(libatomic_ops CONFIG) -+ if (libatomic_ops_FOUND) -+ # TODO: Rename the following to Atomic_ops::atomic_ops -+ get_target_property(AO_INCLUDE_DIRS libatomic_ops::libatomic_ops ++ find_package(Atomic_ops CONFIG) ++ if (Atomic_ops_FOUND) ++ get_target_property(AO_INCLUDE_DIRS Atomic_ops::atomic_ops + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${AO_INCLUDE_DIRS}) + endif() diff --git a/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch b/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch index cb46e01322b4c..3d721c976bf45 100644 --- a/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch +++ b/recipes/bdwgc/all/patches/update-cmake-8_2_2.patch @@ -1,14 +1,12 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -161,6 +161,14 @@ if (enable_threads) +@@ -161,6 +161,12 @@ if (enable_threads) message(STATUS "Thread library: ${CMAKE_THREAD_LIBS_INIT}") if (without_libatomic_ops OR BORLAND OR MSVC OR WATCOM) include_directories(libatomic_ops/src) -+ # TODO: Rename the following to Atomic_ops -+ find_package(libatomic_ops CONFIG) -+ if (libatomic_ops_FOUND) -+ # TODO: Rename the following to Atomic_ops::atomic_ops -+ get_target_property(AO_INCLUDE_DIRS libatomic_ops::libatomic_ops ++ find_package(Atomic_ops CONFIG) ++ if (Atomic_ops_FOUND) ++ get_target_property(AO_INCLUDE_DIRS Atomic_ops::atomic_ops + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${AO_INCLUDE_DIRS}) + endif() From 1cfaeee1e5be9f5eebc49a3ff0bb88736b309628 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 30 Sep 2022 23:26:04 +0900 Subject: [PATCH 262/561] (#13226) sqlite3: add version 3.39.4 and remove older versions * sqlite3: add version 3.39.4 and remove older versions * remove pylint skipped --- recipes/sqlite3/all/conandata.yml | 9 +++------ recipes/sqlite3/all/test_v1_package/conanfile.py | 1 - recipes/sqlite3/config.yml | 6 ++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/recipes/sqlite3/all/conandata.yml b/recipes/sqlite3/all/conandata.yml index b98e6fe1c7753..88f3a1d71ab12 100644 --- a/recipes/sqlite3/all/conandata.yml +++ b/recipes/sqlite3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.39.4": + url: "https://sqlite.org/2022/sqlite-amalgamation-3390400.zip" + sha256: "9c99955b21d2374f3a385d67a1f64cbacb1d4130947473d25c77ad609c03b4cd" "3.39.3": url: "https://sqlite.org/2022/sqlite-amalgamation-3390300.zip" sha256: "a89db3030d229d860ae56a8bac50ac9761434047ae886e47e7c8f9f428fa98ad" @@ -23,15 +26,9 @@ sources: "3.38.1": url: "https://sqlite.org/2022/sqlite-amalgamation-3380100.zip" sha256: "6fb55507d4517b5cbc80bd2db57b0cbe1b45880b28f2e4bd6dca4cfe3716a231" - "3.38.0": - url: "https://sqlite.org/2022/sqlite-amalgamation-3380000.zip" - sha256: "e055f6054e97747a135c89e36520c0a423249e8a91c5fc445163f4a6adb20df6" "3.37.2": url: "https://sqlite.org/2022/sqlite-amalgamation-3370200.zip" sha256: "cb25df0fb90b77be6660f6ace641bbea88f3d0441110d394ce418f35f7561bb0" - "3.37.0": - url: "https://sqlite.org/2021/sqlite-amalgamation-3370000.zip" - sha256: "a443aaf5cf345613492efa679ef1c9cc31ba109dcdf37ee377f61ab500d042fe" "3.36.0": url: "https://sqlite.org/2021/sqlite-amalgamation-3360000.zip" sha256: "999826fe4c871f18919fdb8ed7ec9dd8217180854dd1fe21eea96aed36186729" diff --git a/recipes/sqlite3/all/test_v1_package/conanfile.py b/recipes/sqlite3/all/test_v1_package/conanfile.py index 03457f792149b..48965a0bd0577 100644 --- a/recipes/sqlite3/all/test_v1_package/conanfile.py +++ b/recipes/sqlite3/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/sqlite3/config.yml b/recipes/sqlite3/config.yml index 09c0020237894..bf7ba53e39e9d 100644 --- a/recipes/sqlite3/config.yml +++ b/recipes/sqlite3/config.yml @@ -1,4 +1,6 @@ versions: + "3.39.4": + folder: all "3.39.3": folder: all "3.39.2": @@ -15,12 +17,8 @@ versions: folder: all "3.38.1": folder: all - "3.38.0": - folder: all "3.37.2": folder: all - "3.37.0": - folder: all "3.36.0": folder: all "3.35.5": From f1b93438055acf6e08006e9542e4292899ef010a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:04:28 +0200 Subject: [PATCH 263/561] (#13232) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/review_process.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/review_process.md b/docs/review_process.md index df8d39acf31d6..d2b04f728bd6c 100644 --- a/docs/review_process.md +++ b/docs/review_process.md @@ -13,8 +13,6 @@ conan-center-index tries to make the process as smooth and simple as possible fo * [Avoiding conflicts](#avoiding-conflicts) * [Draft](#draft) * [Getting your pull request reviewed](#getting-your-pull-request-reviewed) - * [Official reviewers](#official-reviewers) - * [Community reviewers](#community-reviewers) * [Rule of 2 reviews](#rule-of-2-reviews) * [Reviews from others](#reviews-from-others) * [Addressing review comments](#addressing-review-comments) From 7cf928ce542f740bda526760f9014631115e42e5 Mon Sep 17 00:00:00 2001 From: chausner <15180557+chausner@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:44:27 +0200 Subject: [PATCH 264/561] (#13145) drflac: Update to 0.12.39 * Update drflac to 0.12.39 * Update for conan v2 * Fix license installation * Fix "ANY" * Remove unnecessary source export Co-authored-by: Uilian Ries * Revert CMake target name change * Revert "Remove unnecessary source export" This reverts commit a370a8201bd5aafc6928ad56ed36ff9a35d485a4. * Remove no_wchar option for older versions Co-authored-by: Uilian Ries * Fix compilation Co-authored-by: chausner Co-authored-by: Uilian Ries --- recipes/drflac/all/CMakeLists.txt | 21 +++--- recipes/drflac/all/conandata.yml | 4 ++ recipes/drflac/all/conanfile.py | 66 ++++++++++--------- .../drflac/all/test_package/CMakeLists.txt | 5 +- recipes/drflac/all/test_package/conanfile.py | 21 ++++-- .../drflac/all/test_v1_package/CMakeLists.txt | 11 ++++ .../drflac/all/test_v1_package/conanfile.py | 17 +++++ recipes/drflac/config.yml | 2 + 8 files changed, 95 insertions(+), 52 deletions(-) create mode 100644 recipes/drflac/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/drflac/all/test_v1_package/conanfile.py diff --git a/recipes/drflac/all/CMakeLists.txt b/recipes/drflac/all/CMakeLists.txt index 9947cecd07f94..f2a49258562bf 100644 --- a/recipes/drflac/all/CMakeLists.txt +++ b/recipes/drflac/all/CMakeLists.txt @@ -1,21 +1,21 @@ cmake_minimum_required(VERSION 3.4) -project(dr_flac C) +project(dr_flac LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +include(GNUInstallDirs) set(BUFFER_SIZE "0" CACHE STRING "Value for define DR_FLAC_BUFFER_SIZE. 0 means default buffer size.") option(NO_CRC "Build with define DR_FLAC_NO_CRC" OFF) option(NO_OGG "Build with define DR_FLAC_NO_OGG" OFF) option(NO_SIMD "Build with define DR_FLAC_NO_SIMD" OFF) option(NO_STDIO "Build with define DR_FLAC_NO_STDIO" OFF) +option(NO_WCHAR "Build with define DR_FLAC_NO_WCHAR" OFF) add_library(${CMAKE_PROJECT_NAME} dr_flac.c) -target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE source_subfolder) +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRFLAC_SRC_DIR}) set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES - PUBLIC_HEADER source_subfolder/dr_flac.h + PUBLIC_HEADER ${DRFLAC_SRC_DIR}/dr_flac.h C_STANDARD 99 ) @@ -37,10 +37,13 @@ endif() if(NO_STDIO) target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_FLAC_NO_STDIO) endif() +if(NO_WCHAR) + target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DDR_FLAC_NO_WCHAR) +endif() install(TARGETS ${CMAKE_PROJECT_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - PUBLIC_HEADER DESTINATION include + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/recipes/drflac/all/conandata.yml b/recipes/drflac/all/conandata.yml index a1542e09ff6d5..4b8f26778e5b0 100644 --- a/recipes/drflac/all/conandata.yml +++ b/recipes/drflac/all/conandata.yml @@ -1,4 +1,8 @@ sources: + # NOTE: https://github.com/mackron/dr_libs/blob/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb/dr_flac.h#L3 + "0.12.39": + url: https://github.com/mackron/dr_libs/archive/dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb.zip + sha256: "077d6b29a78da5132065fcc9b44ca50e7e168b94250f2c25614101d3f808bcc1" # NOTE: https://github.com/mackron/dr_libs/blob/089deaa62268e6dacf2026754b1b228e54eb3993/dr_flac.h#L3 "0.12.38": url: https://github.com/mackron/dr_libs/archive/089deaa62268e6dacf2026754b1b228e54eb3993.zip diff --git a/recipes/drflac/all/conanfile.py b/recipes/drflac/all/conanfile.py index b3cc0f89c667c..ae9f5ee425002 100644 --- a/recipes/drflac/all/conanfile.py +++ b/recipes/drflac/all/conanfile.py @@ -1,6 +1,10 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.scm import Version +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.46.0" class DrflacConan(ConanFile): @@ -10,15 +14,16 @@ class DrflacConan(ConanFile): topics = ("audio", "flac", "sound") license = ("Unlicense", "MIT-0") url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "buffer_size": "ANY", + "buffer_size": ["ANY"], "no_crc": [True, False], "no_ogg": [True, False], "no_simd": [True, False], - "no_stdio": [True, False] + "no_stdio": [True, False], + "no_wchar": [True, False] } default_options = { "shared": False, @@ -27,24 +32,16 @@ class DrflacConan(ConanFile): "no_crc": False, "no_ogg": False, "no_simd": False, - "no_stdio": False + "no_stdio": False, + "no_wchar": False } - generators = "cmake" exports_sources = ["CMakeLists.txt", "dr_flac.c"] - _cmake = None - - @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 + if Version(self.version) < "0.12.39": + del self.options.no_wchar def configure(self): if self.options.shared: @@ -52,28 +49,31 @@ def configure(self): del self.settings.compiler.cppstd del self.settings.compiler.libcxx + def layout(self): + cmake_layout(self) + def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUFFER_SIZE"] = self.options.buffer_size - self._cmake.definitions["NO_CRC"] = self.options.no_crc - self._cmake.definitions["NO_OGG"] = self.options.no_ogg - self._cmake.definitions["NO_SIMD"] = self.options.no_simd - self._cmake.definitions["NO_STDIO"] = self.options.no_stdio - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DRFLAC_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["BUFFER_SIZE"] = self.options.buffer_size + tc.variables["NO_CRC"] = self.options.no_crc + tc.variables["NO_OGG"] = self.options.no_ogg + tc.variables["NO_SIMD"] = self.options.no_simd + tc.variables["NO_STDIO"] = self.options.no_stdio + tc.variables["NO_WCHAR"] = self.options.get_safe("no_wchar", False) + tc.generate() def build(self): - cmake = self._configure_cmake() + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): @@ -90,3 +90,5 @@ def package_info(self): self.cpp_info.defines.append("DR_FLAC_NO_SIMD") if self.options.no_stdio: self.cpp_info.defines.append("DR_FLAC_NO_STDIO") + if self.options.get_safe("no_wchar", False): + self.cpp_info.defines.append("DR_FLAC_NO_WCHAR") diff --git a/recipes/drflac/all/test_package/CMakeLists.txt b/recipes/drflac/all/test_package/CMakeLists.txt index 6cc16ae422649..f1c86abcb3be6 100644 --- a/recipes/drflac/all/test_package/CMakeLists.txt +++ b/recipes/drflac/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(drflac CONFIG REQUIRED) diff --git a/recipes/drflac/all/test_package/conanfile.py b/recipes/drflac/all/test_package/conanfile.py index 6a8d179b4301b..3a8c6c5442b33 100644 --- a/recipes/drflac/all/test_package/conanfile.py +++ b/recipes/drflac/all/test_package/conanfile.py @@ -1,11 +1,18 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" -class DrflacTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +20,6 @@ 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 not cross_building(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/drflac/all/test_v1_package/CMakeLists.txt b/recipes/drflac/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d9f4971c6bf0a --- /dev/null +++ b/recipes/drflac/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(drflac CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} drflac::drflac) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/drflac/all/test_v1_package/conanfile.py b/recipes/drflac/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/drflac/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/drflac/config.yml b/recipes/drflac/config.yml index d73a7f8fb45ce..f7ff0941f9f1b 100644 --- a/recipes/drflac/config.yml +++ b/recipes/drflac/config.yml @@ -1,3 +1,5 @@ versions: + "0.12.39": + folder: all "0.12.38": folder: all From 38df1a03b3a703f1b37d2e7d7e629a0ebe1e6c26 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 30 Sep 2022 18:04:51 +0200 Subject: [PATCH 265/561] (#13202) nspr: generate gcc11 binaries * nspr: generate gcc11 binaries * Update conanfile.py * Update conanfile.py * Update conanfile.py * Update recipes/nspr/all/conanfile.py Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/nspr/all/conanfile.py | 54 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/recipes/nspr/all/conanfile.py b/recipes/nspr/all/conanfile.py index 1a69fcc85e883..b0ce8c9099e1b 100644 --- a/recipes/nspr/all/conanfile.py +++ b/recipes/nspr/all/conanfile.py @@ -1,12 +1,14 @@ from conan.tools.microsoft import msvc_runtime_flag -from conan.tools.files import rename -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan.tools.files import rename, get, rmdir, chdir, replace_in_file +from conan.tools.scm import Version +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conans import tools, AutoToolsBuildEnvironment import contextlib import functools import os -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.47.0" class NsprConan(ConanFile): @@ -57,7 +59,7 @@ def configure(self): def validate(self): # https://bugzilla.mozilla.org/show_bug.cgi?id=1658671 - if tools.Version(self.version) < "4.29": + if Version(self.version) < "4.29": if self.settings.os == "Macos" and self.settings.arch == "armv8": raise ConanInvalidConfiguration("NSPR does not support mac M1 before 4.29") @@ -68,10 +70,10 @@ def build_requirements(self): self.build_requires("msys2/cci.latest") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination="tmp", strip_root=True) rename(self, os.path.join("tmp", "nspr"), self._source_subfolder) - tools.rmdir("tmp") + rmdir(self, "tmp") @contextlib.contextmanager def _build_context(self): @@ -120,9 +122,9 @@ def _configure_autotools(self): return autotools def build(self): - with tools.chdir(self._source_subfolder): + with chdir(self, self._source_subfolder): # relocatable shared libs on macOS - tools.replace_in_file( + replace_in_file(self, "configure", "-install_name @executable_path/", "-install_name @rpath/" @@ -133,13 +135,13 @@ def build(self): def package(self): self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - with tools.chdir(self._source_subfolder): + with chdir(self, self._source_subfolder): with self._build_context(): autotools = self._configure_autotools() autotools.install() - tools.rmdir(os.path.join(self.package_folder, "bin")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) if self.settings.os == "Windows": if self.options.shared: os.mkdir(os.path.join(self.package_folder, "bin")) @@ -147,31 +149,31 @@ def package(self): libsuffix = "lib" if self._is_msvc else "a" libprefix = "" if self._is_msvc else "lib" if self.options.shared: - os.unlink(os.path.join(self.package_folder, "lib", "{}{}_s.{}".format(libprefix, lib, libsuffix))) - rename(self, os.path.join(self.package_folder, "lib", "{}.dll".format(lib)), - os.path.join(self.package_folder, "bin", "{}.dll".format(lib))) + os.unlink(os.path.join(self.package_folder, "lib", f"{libprefix}{lib}_s.{libsuffix}")) + rename(self, os.path.join(self.package_folder, "lib", f"{lib}.dll"), + os.path.join(self.package_folder, "bin", f"{lib}.dll")) else: - os.unlink(os.path.join(self.package_folder, "lib", "{}{}.{}".format(libprefix, lib, libsuffix))) - os.unlink(os.path.join(self.package_folder, "lib", "{}.dll".format(lib))) + os.unlink(os.path.join(self.package_folder, "lib", f"{libprefix}{lib}.{libsuffix}")) + os.unlink(os.path.join(self.package_folder, "lib", f"{lib}.dll")) if not self.options.shared: - tools.replace_in_file(os.path.join(self.package_folder, "include", "nspr", "prtypes.h"), + replace_in_file(self, os.path.join(self.package_folder, "include", "nspr", "prtypes.h"), "#define NSPR_API(__type) PR_IMPORT(__type)", "#define NSPR_API(__type) extern __type") - tools.replace_in_file(os.path.join(self.package_folder, "include", "nspr", "prtypes.h"), + replace_in_file(self, os.path.join(self.package_folder, "include", "nspr", "prtypes.h"), "#define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type)", "#define NSPR_DATA_API(__type) extern __type") else: shared_ext = "dylib" if self.settings.os == "Macos" else "so" for lib in self._library_names: if self.options.shared: - os.unlink(os.path.join(self.package_folder, "lib", "lib{}.a".format(lib))) + os.unlink(os.path.join(self.package_folder, "lib", f"lib{lib}.a")) else: - os.unlink(os.path.join(self.package_folder, "lib", "lib{}.{}".format(lib, shared_ext))) + os.unlink(os.path.join(self.package_folder, "lib", f"lib{lib}.{shared_ext}")) if self._is_msvc: if self.settings.build_type == "Debug": for lib in self._library_names: - os.unlink(os.path.join(self.package_folder, "lib", "{}.pdb".format(lib))) + os.unlink(os.path.join(self.package_folder, "lib", f"{lib}.pdb")) if not self.options.shared or self.settings.os == "Windows": for f in os.listdir(os.path.join(self.package_folder, "lib")): @@ -185,7 +187,7 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "nspr") libs = self._library_names if self.settings.os == "Windows" and not self.options.shared: - libs = list("{}_s".format(l) for l in libs) + libs = list(f"{l}_s" for l in libs) self.cpp_info.libs = libs if self.settings.compiler == "gcc" and self.settings.os == "Windows": if self.settings.arch == "x86": @@ -194,12 +196,12 @@ def package_info(self): self.cpp_info.defines.append("_M_X64") self.cpp_info.includedirs.append(os.path.join("include", "nspr")) if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.extend(["dl", "pthread"]) + self.cpp_info.system_libs.extend(["dl", "pthread", "rt"]) elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["winmm", "ws2_32"]) aclocal = tools.unix_path(os.path.join(self.package_folder, "res", "aclocal")) - self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment variable: {}".format(aclocal)) + self.output.info(f"Appending AUTOMAKE_CONAN_INCLUDES environment variable: {aclocal}") self.env_info.AUTOMAKE_CONAN_INCLUDES.append(aclocal) self.cpp_info.resdirs = ["res"] From 0fe1adb4a3b1f45ba42f978d4a5540e37588be4c Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 30 Sep 2022 18:45:11 +0200 Subject: [PATCH 266/561] (#13233) freetype: fix dependencies * freetype: fix dependencies fixes conan-io/conan-center-index#13219 * Update conanfile.py --- recipes/freetype/all/conanfile.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index ed2932bf3082b..cad889a16a33f 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -114,13 +114,27 @@ def _configure_cmake(self): if self._cmake: return self._cmake self._cmake = CMake(self) - self._cmake.definitions["FT_WITH_ZLIB"] = self.options.with_zlib - self._cmake.definitions["FT_WITH_PNG"] = self.options.with_png - self._cmake.definitions["FT_WITH_BZIP2"] = self.options.with_bzip2 - # TODO: Harfbuzz can be added as an option as soon as it is available. - self._cmake.definitions["FT_WITH_HARFBUZZ"] = False - if self._has_with_brotli_option: - self._cmake.definitions["FT_WITH_BROTLI"] = self.options.with_brotli + if scm.Version(self.version) >= "2.11.0": + self._cmake.definitions["FT_REQUIRE_ZLIB"] = self.options.with_zlib + self._cmake.definitions["FT_DISABLE_ZLIB"] = not self.options.with_zlib + self._cmake.definitions["FT_REQUIRE_PNG"] = self.options.with_png + self._cmake.definitions["FT_DISABLE_PNG"] = not self.options.with_png + self._cmake.definitions["FT_REQUIRE_BZIP2"] = self.options.with_bzip2 + self._cmake.definitions["FT_DISABLE_BZIP2"] = not self.options.with_bzip2 + # TODO: Harfbuzz can be added as an option as soon as it is available. + self._cmake.definitions["FT_REQUIRE_HARFBUZZ"] = False + self._cmake.definitions["FT_DISABLE_HARFBUZZ"] = True + if self._has_with_brotli_option: + self._cmake.definitions["FT_REQUIRE_BROTLI"] = self.options.with_brotli + self._cmake.definitions["FT_DISABLE_BROTLI"] = not self.options.with_brotli + else: + self._cmake.definitions["FT_WITH_ZLIB"] = self.options.with_zlib + self._cmake.definitions["FT_WITH_PNG"] = self.options.with_png + self._cmake.definitions["FT_WITH_BZIP2"] = self.options.with_bzip2 + # TODO: Harfbuzz can be added as an option as soon as it is available. + self._cmake.definitions["FT_WITH_HARFBUZZ"] = False + if self._has_with_brotli_option: + self._cmake.definitions["FT_WITH_BROTLI"] = self.options.with_brotli # Generate a relocatable shared lib on Macos self._cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" self._cmake.configure(build_dir=self._build_subfolder) From ff31c5ccd6662fbec9c74ca68a9f9ce3ab4badbd Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 30 Sep 2022 19:04:17 +0200 Subject: [PATCH 267/561] (#13230) docs: fix broken links * docs: fix broken links * revert linters.md removals --- docs/consuming_recipes.md | 2 +- docs/faqs.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/consuming_recipes.md b/docs/consuming_recipes.md index a33b280631cd0..4e01f50335197 100644 --- a/docs/consuming_recipes.md +++ b/docs/consuming_recipes.md @@ -24,7 +24,7 @@ There can be several causes if a recipe (a new revision) might stopped to work i Conan will fail to parse the recipe and will raise a cryptic Python syntax error. - **New Conan Version**: Conan keeps evolving and adding new features, especially on its road to Conan 2.0, - and ConanCenter is committed in this [roadmap](v2_roadmap) as well, and tries to prepare the user base to these + and ConanCenter is committed in this [roadmap](v2_roadmap.md) as well, and tries to prepare the user base to these new features in order to ease the migration to new versions. New recipe revisions can take into account changes that are introduced in new Conan client diff --git a/docs/faqs.md b/docs/faqs.md index 7179c56a26e3a..b0249a7008bbd 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -130,7 +130,7 @@ We often receive new fixes and improvements to the recipes already available for ## Do static libraries tend to be compiled as PIC by default? -Yes! You can learn more about default options in [Packing Policy](packing_policy.md#options). +Yes! You can learn more about default options in [Packaging Policy](packaging_policy.md#options). ## Why PDB files are not allowed? From 4ea0aa10cdcee1701a0f507dc51817e528ff1570 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 30 Sep 2022 19:24:30 +0200 Subject: [PATCH 268/561] (#13240) catch2: fix default_reporter option in conan v2 mode --- recipes/catch2/3.x.x/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/catch2/3.x.x/conanfile.py b/recipes/catch2/3.x.x/conanfile.py index 625d3bd779ace..44b9f0f8ed4d3 100644 --- a/recipes/catch2/3.x.x/conanfile.py +++ b/recipes/catch2/3.x.x/conanfile.py @@ -21,7 +21,7 @@ class Catch2Conan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_prefix": [True, False], - "default_reporter": ["ANY"], + "default_reporter": [None, "ANY"], } default_options = { "shared": False, From 95dfe78bbcb0f826bfc0d4268002564b3ecd1fb7 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 30 Sep 2022 23:44:35 +0200 Subject: [PATCH 269/561] (#12946) [docs] Add a brief explanation about linters * add linters files Signed-off-by: Uilian Ries * explain all linters Signed-off-by: Uilian Ries * explain all linters Signed-off-by: Uilian Ries * update titles Signed-off-by: Uilian Ries * avoid duplication Signed-off-by: Uilian Ries * Update docs/linters.md Co-authored-by: Chris Mc * ConanFile import from conan is mandatory Signed-off-by: Uilian Ries Co-authored-by: Chris Mc --- docs/linters.md | 147 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 docs/linters.md diff --git a/docs/linters.md b/docs/linters.md new file mode 100644 index 0000000000000..e12d3847e2190 --- /dev/null +++ b/docs/linters.md @@ -0,0 +1,147 @@ +## Conan Center Index Linters + +Some linter configuration files are available in the folder [linter](../linter), which are executed by Github Actions to improve recipe quality. +They consume python scripts which are executed to fit CCI rules. Those scripts use [astroid](https://github.com/PyCQA/astroid) and +[pylint](https://pylint.pycqa.org/en/latest/) classes to parse Conan recipe files and manage their warnings and errors. + +The pylint by itselt is not able to find Conan Center Index rules, so astroid is used to iterate over conanfiles content and +validate CCI conditions. Also, pylint uses [rcfile](https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html) +(a configuration file based on [toml](https://toml.io/en/) format) to configure plugins, warnings and errors which should be enabled or disabled. + +Also, the Github [code review](https://github.com/features/code-review) is integrated with the pylint output, +parsed by [recipe_linter.json](../linter/recipe_linter.json), then presented to all users on the tab `Files changed`. + +### Running Linters + +Of course, you should run any linter locally, before pushing your code, read [Running the linter locally](v2_linter.md#running-the-linter-locally) for instructions. + + +### Pylint configuration files + +#### [Pylint Recipe](../linter/pylintrc_recipe) + +This rcfile lists plugins and rules to be executed over all recipes (not test package) and validate them. + +#### [Pylint Test Package Recipe](../linter/pylintrc_testpackage) + +This rcfile lists plugins and rules to be executed over all recipes in test package folders only: + +### Linter Warning and Errors + +Here is the list of current warning and errors provided by pylint, when using CCI configuration. + + +#### E9006 - conan-import-conanfile: ConanFile should be imported from conan + +```python +from conans import ConanFile +``` + +Should be replaced by: + +```python +from conan import Conanfile +``` + +#### E9004 - conan-package-name: Conan package names must be lower-case + +The package name is always lower-case, even when the upstream uses another format + +```python +def FoobarConanfile(ConanFile): + name = "foobar" +``` + +#### E9005 - conan-missing-name: Every conan recipe must contain the attribute name + +The attribute `name` is always expected. On the other hand, `version` should not be listed. + +```python +def BazConanfile(ConanFile): + name = "baz" +``` + +#### E9007 - conan-test-no-name: Do not add name attribute in test package recipes + +The test package is not a package, thus, it should not have a name + +```python +def TestPackageConanFile(ConanFile): + name = "test_package" # Wrong! +``` + +#### E9008 - conan-import-errors: Deprecated imports should be replaced by new imports. Read [v2_linter](v2_linter.md) + +Regular imports from `conans.tools` are now updated: + +```python +from conans import tools +... + +tools.rmdir(os.path.join(self.package_folder, "shared")) +``` + +Should be replaced by specilized tools, prepared for Conan 2.0 + +```python +from conan.tools.files import rmdir +... + +rmdir(self, os.path.join(self.package_folder, "shared")) +``` + +#### E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead + +```python +from conans.errors import ConanException +``` + +Should be replaced by: + +```python +from conan.errors import ConanException +``` + +Only the namespace `conans` has been replaced by `conan`. + + +#### E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead + +```python +from conans.errors import ConanInvalidConfiguration +``` + +Should be replaced by: + +```python +from conan.errors import ConanInvalidConfiguration +``` + +Only the namespace `conans` has been replaced by `conan`. + +#### E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private + +Documented on [conanfile.tools](https://docs.conan.io/en/latest/reference/conanfile/tools.html): + + +It's not allowed to use `tools.xxx` directly: + +```python +from conan import tools +... + +tools.scm.Version(self.version) +``` + +Neither sub modules: + +```python +from conan.tools.apple.apple import is_apple_os +``` + +Only modules under `conan.tools` and `conan.tools.xxx` are allowed: + +```python +from conan.tools.files import rmdir +from conan.tools import scm +```` From c5cab60fd26ea65e0715a4a8dd77c2dcd7d31ae5 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshev Date: Sat, 1 Oct 2022 01:44:22 +0300 Subject: [PATCH 270/561] (#13246) [libyuv] Update libjpeg to 9e --- recipes/libyuv/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libyuv/all/conanfile.py b/recipes/libyuv/all/conanfile.py index b27a3c8bcb157..6c1cdc0dac668 100644 --- a/recipes/libyuv/all/conanfile.py +++ b/recipes/libyuv/all/conanfile.py @@ -44,7 +44,7 @@ def layout(self): def requirements(self): if self.options.with_jpeg == "libjpeg": - self.requires("libjpeg/9d") + self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.0.5") From dad60543675d9e688c4bbef06ce955a9c095ea28 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 1 Oct 2022 16:43:49 +0900 Subject: [PATCH 271/561] (#13248) c-blosc2: add version 2.4.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/c-blosc2/all/conandata.yml | 5 +++++ recipes/c-blosc2/config.yml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 60f73ddf9c3c7..1d8b50594a371 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" @@ -7,6 +10,8 @@ sources: sha256: "66f9977de26d6bc9ea1c0e623d873c3225e4fff709aa09b3335fd09d41d57c0e" patches: + "2.4.2": + - patch_file: "patches/2.4.1-0001-fix-cmake.patch" "2.4.1": - patch_file: "patches/2.4.1-0001-fix-cmake.patch" "2.2.0": diff --git a/recipes/c-blosc2/config.yml b/recipes/c-blosc2/config.yml index 81f1d75f1c6cd..83b61a4e58cee 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.2": + folder: all "2.4.1": folder: all "2.2.0": From 99f644c29a270296e96a5bef57283472c4f48b64 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 2 Oct 2022 02:43:54 +0900 Subject: [PATCH 272/561] (#13254) mosquitto: add version 2.0.15 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/mosquitto/2.x/conandata.yml | 3 +++ recipes/mosquitto/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/mosquitto/2.x/conandata.yml b/recipes/mosquitto/2.x/conandata.yml index 2b7a331d90143..622f72a77af8b 100644 --- a/recipes/mosquitto/2.x/conandata.yml +++ b/recipes/mosquitto/2.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.15": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.15.tar.gz" + sha256: "26dc3f1758b00c1725a0e4dd32f40c61f374375717f09b6af2bac62c5b44f1eb" "2.0.14": url: "https://github.com/eclipse/mosquitto/archive/v2.0.14.tar.gz" sha256: "c0ce97b1911d1769ccfd65da237e919fd7eaa60209fd190c113d63fbd0c40347" diff --git a/recipes/mosquitto/config.yml b/recipes/mosquitto/config.yml index 83aa878cef82a..7627743e2625f 100644 --- a/recipes/mosquitto/config.yml +++ b/recipes/mosquitto/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.15": + folder: "2.x" "2.0.14": folder: "2.x" "2.0.12": From 59036821e3605dd75d1f48c4452bcb6ef847125d Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Sat, 1 Oct 2022 17:04:33 -0400 Subject: [PATCH 273/561] (#13256) Bump parallel-hashmap version to 1.3.8 --- recipes/parallel-hashmap/all/conandata.yml | 3 +++ recipes/parallel-hashmap/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml index b73f7fb085a53..41fe3e31571e0 100644 --- a/recipes/parallel-hashmap/all/conandata.yml +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.8": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/v1.3.8.tar.gz" + sha256: "c4562ea360dc1dcaddd96a0494c753400364a52c7aa9750de49d8e6a222d28d3" "1.37": url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.37.tar.gz" sha256: "2ac652be0552fcb53a1163c08c1f28f29f0756594fcc587eebb4d8b363153709" diff --git a/recipes/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml index 3b0a16e24b285..2115f091019fe 100644 --- a/recipes/parallel-hashmap/config.yml +++ b/recipes/parallel-hashmap/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.8": + folder: all "1.37": folder: all "1.36": From c914c284ba37aeba8b81af9b5378253e1f95fb68 Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Sat, 1 Oct 2022 17:23:52 -0400 Subject: [PATCH 274/561] (#13257) Bump greg7mdp-gtl version to 1.1.5 --- recipes/greg7mdp-gtl/all/conandata.yml | 3 +++ recipes/greg7mdp-gtl/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/greg7mdp-gtl/all/conandata.yml b/recipes/greg7mdp-gtl/all/conandata.yml index d64a2a2417125..03c557a0c1185 100644 --- a/recipes/greg7mdp-gtl/all/conandata.yml +++ b/recipes/greg7mdp-gtl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.5": + url: "https://github.com/greg7mdp/gtl/archive/v1.1.5.tar.gz" + sha256: "2d943d2ccc33c6c662918efc51782dac414354a1458441f16041a98eec164bda" "1.1.4": url: "https://github.com/greg7mdp/gtl/archive/v1.1.4.tar.gz" sha256: "b51b9951d11fb73ed22360a96a3f6c691c15202c3b14c79dcdd498da80b6502d" diff --git a/recipes/greg7mdp-gtl/config.yml b/recipes/greg7mdp-gtl/config.yml index 4170839cda204..94e2cbf33f6be 100644 --- a/recipes/greg7mdp-gtl/config.yml +++ b/recipes/greg7mdp-gtl/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.5": + folder: all "1.1.4": folder: all "1.1.3": From c55ae44f7ac9be45264c05f9a43aaa6e248488f5 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 2 Oct 2022 09:04:46 +0900 Subject: [PATCH 275/561] (#13259) ctre: add version 3.7.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/ctre/all/conandata.yml | 3 +++ recipes/ctre/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/ctre/all/conandata.yml b/recipes/ctre/all/conandata.yml index a31566c9bce74..b82c82a8db15a 100644 --- a/recipes/ctre/all/conandata.yml +++ b/recipes/ctre/all/conandata.yml @@ -32,3 +32,6 @@ sources: "3.7": url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.7.tar.gz" sha256: "12be2a37f7fe39c489f646d3faee534f965871fd998258162962f36a19a455ef" + "3.7.1": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.7.1.tar.gz" + sha256: "d00d7eaa0e22f2fdaa947a532b81b6fc35880acf4887b50a5ac9bfb7411ced03" diff --git a/recipes/ctre/config.yml b/recipes/ctre/config.yml index f537d25fd0f0b..6b59866d3b987 100644 --- a/recipes/ctre/config.yml +++ b/recipes/ctre/config.yml @@ -21,3 +21,5 @@ versions: folder: all "3.7": folder: all + "3.7.1": + folder: all From ea21ca05e49ae2f38b7e765815d478d10817d743 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 2 Oct 2022 13:03:59 +0900 Subject: [PATCH 276/561] (#13260) paho-mqtt-c: add version 1.3.11 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/paho-mqtt-c/all/conandata.yml | 3 +++ recipes/paho-mqtt-c/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/paho-mqtt-c/all/conandata.yml b/recipes/paho-mqtt-c/all/conandata.yml index e4387aa400019..45923baeaa709 100644 --- a/recipes/paho-mqtt-c/all/conandata.yml +++ b/recipes/paho-mqtt-c/all/conandata.yml @@ -23,6 +23,9 @@ sources: "1.3.10": url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.10.tar.gz" sha256: "c70db96e66adacae411d5d875fbb08bca6ff9945de3d215b3af93cbd22792db5" + "1.3.11": + url: "https://github.com/eclipse/paho.mqtt.c/archive/v1.3.11.tar.gz" + sha256: "d7bba3f8b8978802e11e2b1f28e96e6b7f4ed5d8a268af52a4d3b1bcbd1db16b" patches: "1.3.0": - patch_file: "patches/0001-fix-MinGW-and-OSX-builds-for-1-3-0.patch" diff --git a/recipes/paho-mqtt-c/config.yml b/recipes/paho-mqtt-c/config.yml index 6c3ccc6001750..27420c52474ee 100644 --- a/recipes/paho-mqtt-c/config.yml +++ b/recipes/paho-mqtt-c/config.yml @@ -15,3 +15,5 @@ versions: folder: "all" "1.3.10": folder: "all" + "1.3.11": + folder: "all" From 734fa95430e0379f8868852b4b213239cd63f9c1 Mon Sep 17 00:00:00 2001 From: Julien Pilet Date: Sun, 2 Oct 2022 15:44:28 +0200 Subject: [PATCH 277/561] (#13213) gdal/3.5.2: Update to 3.5.2 and fix with_pcre2 option. * [WIP] Add gdal 3.5.1 * [WIP] treat all dependencies in the same way * works as shared lib * Works with several deps, formatted * Format strings with double quotes * Fix libkml dependency linking * More fixes, add README.md * Remove blank line * Fix build and lint issues * Fix wrong include dir * fix requirements component reference * disable fPIC option with shared * Check if fPIC options exists before evaluating it * Updated readme * Update recipes/gdal/post_3.5.0/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * removed imports: conan.tools.cmake, conans.tools * Simplify patch * Move build in its own folder * Fix windows lib name * import is_msvc * Remove dependency array indirection, replace CONAN_PKG::, address other comments * Support with_jpeg=libjpeg-turbo * support with_mysql * Remove useless line * use get_safe("fPIC") Co-authored-by: Chris Mc * Try to make linter happy * Revert changes on pre-3.5.0 conanfile * Fix cmake error * Remove windows suffixes * Add 'd' suffix for windows debug builds * Address comments * Remove --with_crypto, explain cmake patches * deprecate with_crypto properly * Gdal: update to 3.5.2, fix with_pcre2 * Update libtiff dep * Bump dependencies * Bump libjpeg Co-authored-by: ericLemanissier Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: Chris Mc --- recipes/gdal/config.yml | 2 + recipes/gdal/post_3.5.0/CMakeLists.txt | 5 + recipes/gdal/post_3.5.0/conandata.yml | 6 + recipes/gdal/post_3.5.0/conanfile.py | 51 ++-- .../3.5.2/0-replace-find-package.patch | 266 ++++++++++++++++++ 5 files changed, 306 insertions(+), 24 deletions(-) create mode 100644 recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index 52a62879ed75b..3a324b7465d34 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.2": + folder: "post_3.5.0" "3.5.1": folder: "post_3.5.0" "3.4.3": diff --git a/recipes/gdal/post_3.5.0/CMakeLists.txt b/recipes/gdal/post_3.5.0/CMakeLists.txt index e2ba095f98b6c..c0e666f41f1de 100644 --- a/recipes/gdal/post_3.5.0/CMakeLists.txt +++ b/recipes/gdal/post_3.5.0/CMakeLists.txt @@ -108,5 +108,10 @@ if ("${GDAL_CONAN_PACKAGE_FOR_JPEG}" STREQUAL "libjpeg-turbo") add_library(JPEG::JPEG ALIAS ${TARGET_FOR_JPEG}) endif() +if (${GDAL_USE_PCRE2}) + find_package(PCRE2 REQUIRED) + add_library(PCRE2::PCRE2-8 ALIAS PCRE2::8BIT) +endif() + add_subdirectory("source_subfolder") diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 3d2af160639de..2dbc2d17b374f 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,8 +1,14 @@ sources: + "3.5.2": + url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" + sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" "3.5.1": url: "https://github.com/OSGeo/gdal/releases/download/v3.5.1/gdal-3.5.1.tar.gz" sha256: "7c4406ca010dc8632703a0a326f39e9db25d9f1f6ebaaeca64a963e3fac123d1" patches: + "3.5.2": + - patch_file: "patches/3.5.2/0-replace-find-package.patch" + base_path: "source_subfolder" "3.5.1": - patch_file: "patches/3.5.1/0-replace-find-package.patch" base_path: "source_subfolder" diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 559f688ce0a4f..2c127ca428c98 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -153,14 +153,14 @@ def configure(self): pass def requirements(self): - self.requires("json-c/0.15") + self.requires("json-c/0.16") self.requires("libgeotiff/1.7.1") if self.options.with_armadillo: self.requires("armadillo/10.7.3") if self.options.with_arrow: - self.requires("arrow/8.0.0") + self.requires("arrow/8.0.1") if self.options.with_blosc: self.requires("c-blosc/1.21.1") @@ -169,16 +169,16 @@ def requirements(self): self.requires("cfitsio/4.1.0") if self.options.with_cryptopp: - self.requires("cryptopp/8.6.0") + self.requires("cryptopp/8.7.0") if self.options.with_curl: - self.requires("libcurl/7.83.1") + self.requires("libcurl/7.85.0") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_expat: - self.requires("expat/2.4.8") + self.requires("expat/2.4.9") if self.options.with_exr: self.requires("openexr/3.1.5") @@ -203,12 +203,12 @@ def requirements(self): self.requires("hdf5/1.13.1") if self.options.with_heif: - self.requires("libheif/1.12.0") + self.requires("libheif/1.13.0") if self.options.with_jpeg == "libjpeg": - self.requires("libjpeg/9d") + self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.2") + self.requires("libjpeg-turbo/2.1.4") if self.options.with_kea: self.requires("kealib/1.4.14") @@ -223,16 +223,16 @@ def requirements(self): self.requires("libkml/1.3.0") if self.options.with_libtiff: - self.requires("libtiff/4.3.0") + self.requires("libtiff/4.4.0") if self.options.with_lz4: - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.4") if self.options.with_mongocxx: - self.requires("mongo-cxx-driver/3.6.6") + self.requires("mongo-cxx-driver/3.6.7") if self.options.with_mysql == "libmysqlclient": - self.requires("libmysqlclient/8.0.29") + self.requires("libmysqlclient/8.0.30") elif self.options.with_mysql == "mariadb-connector-c": self.requires("mariadb-connector-c/3.1.12") @@ -240,13 +240,13 @@ def requirements(self): self.requires("netcdf/4.8.1") if self.options.with_odbc: - self.requires("odbc/2.3.9") + self.requires("odbc/2.3.11") if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_openssl: - self.requires("openssl/1.1.1o") + self.requires("openssl/1.1.1q") if self.options.with_pcre: self.requires("pcre/8.45") @@ -255,10 +255,10 @@ def requirements(self): self.requires("pcre2/10.40") if self.options.with_pg: - self.requires("libpq/14.2") + self.requires("libpq/14.5") if self.options.with_png: - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.38") if self.options.with_podofo: self.requires("podofo/0.9.7") @@ -267,16 +267,16 @@ def requirements(self): self.requires("poppler/21.07.0") if self.options.with_proj: - self.requires("proj/9.0.0") + self.requires("proj/9.0.1") if self.options.with_qhull: self.requires("qhull/8.0.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.38.5") + self.requires("sqlite3/3.39.3") if self.options.with_webp: - self.requires("libwebp/1.2.2") + self.requires("libwebp/1.2.4") if self.options.with_xerces: self.requires("xerces-c/3.2.3") @@ -598,13 +598,16 @@ def _configure_cmake(self): else: cmake.definitions["PCRE_FOUND"] = False - cmake.definitions["GDAL_USE_PDFIUM"] = self.options.with_pcre2 + cmake.definitions["GDAL_USE_PCRE2"] = self.options.with_pcre2 if self.options.with_pcre2: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PDFIUM"] = "pcre2" - cmake.definitions["TARGET_FOR_PDFIUM"] = \ + cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PCRE2"] = "pcre2" + cmake.definitions["TARGET_FOR_PCRE2"] = \ self.dependencies["pcre2"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["PDFIUM_FOUND"] = False + cmake.definitions["PCRE2_FOUND"] = False + + cmake.definitions["GDAL_USE_PDFIUM"] = False + cmake.definitions["PDFIUM_FOUND"] = False cmake.definitions["GDAL_USE_POSTGRESQL"] = self.options.with_pg if self.options.with_pg: @@ -840,7 +843,7 @@ def package_info(self): self.cpp_info.requires.extend(['pcre::pcre']) if self.options.with_pcre2: - self.cpp_info.requires.extend(['pcre2::pcre2']) + self.cpp_info.requires.extend(['pcre2::pcre2-8']) if self.options.with_pg: self.cpp_info.requires.extend(['libpq::pq']) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch new file mode 100644 index 0000000000000..b01b5b271034c --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch @@ -0,0 +1,266 @@ +diff --git a/alg/CMakeLists.txt b/alg/CMakeLists.txt +index edf75158c7..4200309ca8 100644 +--- a/alg/CMakeLists.txt ++++ b/alg/CMakeLists.txt +@@ -72,7 +72,7 @@ if (GDAL_USE_OPENCL) + target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp) + endif () + +-gdal_target_link_libraries(alg PRIVATE PROJ::proj) ++target_link_libraries(alg PUBLIC PROJ::proj) + + if (GDAL_USE_QHULL_INTERNAL) + target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL) +diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt +index 8b02cea456..ad4adbfc9e 100644 +--- a/apps/CMakeLists.txt ++++ b/apps/CMakeLists.txt +@@ -25,7 +25,7 @@ target_include_directories( + appslib PRIVATE $ $ + $ $) + +-gdal_target_link_libraries(appslib PRIVATE PROJ::proj) ++target_link_libraries(appslib PUBLIC PROJ::proj) + + set_property(TARGET appslib PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) +diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake +index 0a66b44fec..152ff42ff7 100644 +--- a/cmake/helpers/CheckDependentLibraries.cmake ++++ b/cmake/helpers/CheckDependentLibraries.cmake +@@ -11,7 +11,10 @@ Detect GDAL dependencies and set variable HAVE_* + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++ ++# Conan recipes should rely on config files from generators so let's just disble GDAL's ++include(ConanFindPackage) ++ + include(CheckSymbolExists) + + option( +@@ -111,47 +114,7 @@ macro (gdal_check_package name purpose) + set(_find_dependency_args "") + find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) + if (NOT DEFINED ${key}_FOUND) +- set(_find_package_args) +- if (_GCP_VERSION) +- list(APPEND _find_package_args ${_GCP_VERSION}) +- endif () +- if (_GCP_CONFIG) +- list(APPEND _find_package_args CONFIG) +- endif () +- if (_GCP_COMPONENTS) +- list(APPEND _find_package_args COMPONENTS ${_GCP_COMPONENTS}) +- endif () +- if (_GCP_PATHS) +- list(APPEND _find_package_args PATHS ${_GCP_PATHS}) +- endif () +- if (_GCP_NAMES) +- set(GDAL_CHECK_PACKAGE_${name}_NAMES "${_GCP_NAMES}" CACHE STRING "Config file name for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_NAMES) +- endif () +- if (_GCP_TARGETS) +- set(GDAL_CHECK_PACKAGE_${name}_TARGETS "${_GCP_TARGETS}" CACHE STRING "Target name candidates for ${name}") +- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_TARGETS) +- endif () +- if (GDAL_CHECK_PACKAGE_${name}_NAMES) +- find_package(${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} ${_find_package_args}) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS} REQUIRED) +- if (${name}_FOUND) +- get_filename_component(_find_dependency_args "${${name}_CONFIG}" NAME) +- string(REPLACE ";" " " _find_dependency_args "${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} CONFIGS ${_find_dependency_args} ${_find_package_args}") +- endif () +- endif () +- if (NOT ${name}_FOUND) +- find_package(${name} ${_find_package_args}) +- if (${name}_FOUND) +- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- elseif (${key}_FOUND) # Some find modules do not set _FOUND +- gdal_check_package_target(${key} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) +- set(${name}_FOUND "${key}_FOUND") +- endif () +- if (${name}_FOUND) +- string(REPLACE ";" " " _find_dependency_args "${name} ${_find_package_args}") +- endif() +- endif () ++ message(FATAL_ERROR "Conan recipes should rely on config files from generators so let's just disble GDAL's") + endif () + if (${key}_FOUND OR ${name}_FOUND) + set(HAVE_${key} ON) +@@ -345,14 +308,15 @@ if (GDAL_USE_CRYPTOPP) + endif () + + # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. +-find_package(PROJ 9 CONFIG QUIET) +-if (NOT PROJ_FOUND) +- find_package(PROJ 8 CONFIG QUIET) +-endif() ++find_package2(PROJ) ++target_include_directories(PROJ::proj INTERFACE ${PROJ_INCLUDE_DIRS}) ++#if (NOT PROJ_FOUND) ++# find_package(proj 8 CONFIG QUIET) ++#endif() + if (PROJ_FOUND) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") + else() +- find_package(PROJ 6.0 REQUIRED) ++ find_package(proj 6.0 REQUIRED) + string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ 6.0)\n") + endif () + +@@ -412,15 +376,10 @@ gdal_check_package(JSONC "json-c library (external)" CAN_DISABLE + TARGETS json-c::json-c JSONC::JSONC + ) + gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) +- get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) +- find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) +- list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") +- list(REMOVE_DUPLICATES include_dirs) +- set_target_properties(json-c::json-c PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" +- ) +-endif() ++get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) ++list(APPEND include_dirs "${JSONC_INCLUDE_DIRS}/json-c") ++set_target_properties(json-c::json-c PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include_dirs}") ++message("Setting include for json-c: ${include_dirs}") + + gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) + gdal_internal_library(OPENCAD) +@@ -517,7 +476,7 @@ if (GDAL_USE_RASTERLITE2) + endif () + cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) + +-find_package(LibKML COMPONENTS DOM ENGINE) ++find_package(LibKML COMPONENTS kmlengine kmldom kmlbase) + if (GDAL_USE_LIBKML) + if (NOT LibKML_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") +diff --git a/cmake/helpers/ConanFindPackage.cmake b/cmake/helpers/ConanFindPackage.cmake +new file mode 100644 +index 0000000000..9dfa8193a3 +--- /dev/null ++++ b/cmake/helpers/ConanFindPackage.cmake +@@ -0,0 +1,43 @@ ++ ++function(define_find_package2 pkgname include_file library_name) ++endfunction() ++ ++function(find_package2 pkgname) ++ set(_options QUIET REQUIRED) ++ set(_oneValueArgs OUT_DEPENDENCY) ++ set(_multiValueArgs) ++ cmake_parse_arguments(arg "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) ++ if(arg_QUIET) ++ set(${pkgname}_FIND_QUIETLY TRUE) ++ endif() ++ if(arg_REQUIRED) ++ set(${pkgname}_FIND_REQUIRED TRUE) ++ endif() ++ ++ string(TOUPPER ${pkgname} key) ++ ++ set(docstring "Configured for conan package ${GDAL_CONAN_PACKAGE_FOR_${key}}") ++ if (DEFINED GDAL_CONAN_PACKAGE_FOR_${key}) ++ message("Using conan package ${GDAL_CONAN_PACKAGE_FOR_${key}} for dependency ${pkgname}") ++ set(conan_package ${GDAL_CONAN_PACKAGE_FOR_${key}}) ++ string(TOUPPER ${conan_package} conan_package_upper) ++ ++ set(${key}_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_${conan_package_upper}}" CACHE STRING ${docstring}) ++ if (NOT TARGET_FOR_${key}) ++ set(TARGET_FOR_${key} "${conan_package}::${conan_package}") ++ endif() ++ set(${key}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_INCLUDE_DIRS "CONAN_INCLUDE_DIRS_${conan_package_upper}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${pkgname}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) ++ set(${key}_FOUND TRUE CACHE BOOL ${docstring}) ++ ++ else () ++ message("dependency ${pkgname} has no conan package") ++ set(${key}_FOUND FALSE CACHE BOOL ${docstring}) ++ endif() ++ ++endfunction() +diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt +index e5b7138e91..039cac7361 100644 +--- a/frmts/hfa/CMakeLists.txt ++++ b/frmts/hfa/CMakeLists.txt +@@ -15,7 +15,8 @@ add_gdal_driver( + hfa_overviews.cpp + BUILTIN) + gdal_standard_includes(gdal_HFA) +-target_include_directories(gdal_HFA PRIVATE $) ++target_link_libraries(gdal_HFA INTERFACE PROJ::proj) ++target_include_directories(gdal_HFA PRIVATE ${PROJ_INCLUDE_DIRS}) + target_compile_definitions(gdal_HFA PRIVATE $) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) +diff --git a/gdal.cmake b/gdal.cmake +index 4bae2e2760..7695df40c8 100644 +--- a/gdal.cmake ++++ b/gdal.cmake +@@ -787,25 +787,6 @@ if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK) + ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gdal/) + +- # Generate gdal-config utility command and pkg-config module gdal.pc +- include(GdalGenerateConfig) +- gdal_generate_config( +- TARGET +- "${GDAL_LIB_TARGET_NAME}" +- GLOBAL_PROPERTY +- "gdal_private_link_libraries" +- GDAL_CONFIG +- "${PROJECT_BINARY_DIR}/apps/gdal-config" +- PKG_CONFIG +- "${CMAKE_CURRENT_BINARY_DIR}/gdal.pc") +- install( +- PROGRAMS ${PROJECT_BINARY_DIR}/apps/gdal-config +- DESTINATION ${CMAKE_INSTALL_BINDIR} +- COMPONENT applications) +- install( +- FILES ${CMAKE_CURRENT_BINARY_DIR}/gdal.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +- COMPONENT libraries) + endif () + + configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) +diff --git a/ogr/CMakeLists.txt b/ogr/CMakeLists.txt +index 19ba4e12fe..87cd123c54 100644 +--- a/ogr/CMakeLists.txt ++++ b/ogr/CMakeLists.txt +@@ -88,12 +88,12 @@ endif () + + target_compile_definitions(ogr PRIVATE HAVE_MITAB) + +-gdal_target_link_libraries(ogr PRIVATE PROJ::proj) ++target_link_libraries(ogr PUBLIC PROJ::proj) + + # External libs then + if (GDAL_USE_GEOS) + target_compile_definitions(ogr PRIVATE -DHAVE_GEOS=1) +- gdal_target_link_libraries(ogr PRIVATE ${GEOS_TARGET}) ++ target_link_libraries(ogr PUBLIC ${GEOS_TARGET}) + endif () + + if (GDAL_USE_SFCGAL) +diff --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h +index 88928ad1ad..7cdd587db7 100644 +--- a/ogr/ogr_proj_p.h ++++ b/ogr/ogr_proj_p.h +@@ -29,7 +29,7 @@ + #ifndef OGR_PROJ_P_H_INCLUDED + #define OGR_PROJ_P_H_INCLUDED + +-#include "proj.h" ++#include + + #include "cpl_mem_cache.h" + From f178e95c73ce7c4315aea37cbec43745bd4863fb Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sun, 2 Oct 2022 21:47:39 +0100 Subject: [PATCH 278/561] (#13174) [gdk-pixbuf] update dependencies and modernize * [gdk-pixbuf] bump dependency versions * [gdk-pixbuf] update to new meson toolchain * [gdk-pixbuf] update compiler-rt test * [gdk-pixbuf] remove base path for patches (not required) * [gdk-pixbuf] fix license file copy * [gdk-pixbuf] fix compiler-rt test * [gdk-pixbuf] raise normal exception from compiler-rt check * [gdk-pixbuf] remove the compiler-rt workaround (no longer reproducible) * [gdk-pixbuf] clean up the generate method * [gdk-pixbuf] reinstate compiler-rt flag for clang <= 12 * [gdk-pixbuf] disallow static msvc runtime with shared glib * [gdk-pixbuf] use glib 2.73.0 on MSVC due to #12342 * [gdk-pixbuf] apply review suggestions * [gdk-pixbuf] add v1 test package * [gdk-pixbuf] update test package * Update recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt Co-authored-by: Jordan Williams * [gdk-pixbuf] remove duplicated test source file * [gdk-pixbuf] update dependency options in validate Co-authored-by: Jordan Williams --- recipes/gdk-pixbuf/all/conandata.yml | 1 - recipes/gdk-pixbuf/all/conanfile.py | 211 ++++++++---------- .../all/test_package/CMakeLists.txt | 2 - .../gdk-pixbuf/all/test_package/conanfile.py | 21 +- .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 18 ++ 6 files changed, 140 insertions(+), 123 deletions(-) create mode 100644 recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gdk-pixbuf/all/test_v1_package/conanfile.py diff --git a/recipes/gdk-pixbuf/all/conandata.yml b/recipes/gdk-pixbuf/all/conandata.yml index 6f9d2bf4d0568..13edd95503a08 100644 --- a/recipes/gdk-pixbuf/all/conandata.yml +++ b/recipes/gdk-pixbuf/all/conandata.yml @@ -12,4 +12,3 @@ sources: patches: "2.42.8": - patch_file: "patches/define_dllmain_only_when_shared.patch" - base_path: "source_subfolder" diff --git a/recipes/gdk-pixbuf/all/conanfile.py b/recipes/gdk-pixbuf/all/conanfile.py index 86b05696bec82..d952cc825eb1f 100644 --- a/recipes/gdk-pixbuf/all/conanfile.py +++ b/recipes/gdk-pixbuf/all/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile +from conan.tools.meson import MesonToolchain, Meson +from conan.tools.gnu import PkgConfigDeps +from conan.tools.env import VirtualBuildEnv +from conan.tools.layout import basic_layout from conan.tools import files, scm, microsoft -from conan.errors import ConanInvalidConfiguration, ConanException -from conans import CMake, Meson, tools -from tempfile import TemporaryDirectory -import functools +from conan.errors import ConanInvalidConfiguration + import os -import shutil -required_conan_version = ">=1.50.2" +required_conan_version = ">=1.52.0" class GdkPixbufConan(ConanFile): @@ -36,17 +37,6 @@ class GdkPixbufConan(ConanFile): "with_introspection": False, } - generators = "pkg_config" - exports_sources = "patches/**" - - @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 @@ -59,41 +49,104 @@ def configure(self): if self.options.shared: self.options["glib"].shared = True - def requirements(self): - self.requires("glib/2.73.0") - if self.options.with_libpng: - self.requires("libpng/1.6.37") - if self.options.with_libtiff: - self.requires("libtiff/4.3.0") - if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.2") - elif self.options.with_libjpeg == "libjpeg": - self.requires("libjpeg/9d") + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.options.shared and not self.options["glib"].shared: + if self.info.options.shared and not self.dependencies.direct_host["glib"].options.shared: raise ConanInvalidConfiguration( "Linking a shared library against static glib can cause unexpected behaviour." ) - if self.settings.os == "Macos": + if self.info.settings.os == "Macos": # when running gdk-pixbuf-query-loaders # dyld: malformed mach-o: load commands size (97560) > 32768 raise ConanInvalidConfiguration("This package does not support Macos currently") + if self.dependencies.direct_host["glib"].options.shared and microsoft.is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Linking shared glib with the MSVC static runtime is not supported" + ) + + @property + def _requires_compiler_rt(self): + return self.settings.compiler == "clang" and scm.Version(self.settings.compiler.version) <= "12" and self.settings.build_type == "Debug" + + def generate(self): + def is_enabled(value): + return "enabled" if value else "disabled" + + def is_true(value): + return "true" if value else "false" + + deps = PkgConfigDeps(self) + deps.generate() + + tc = MesonToolchain(self) + tc.project_options.update({ + "builtin_loaders": "all", + "gio_sniffing": "false", + "introspection": is_enabled(self.options.with_introspection), + "docs": "false", + "man": "false", + "installed_tests": "false" + }) + if scm.Version(self.version) < "2.42.0": + tc.project_options["gir"] = "false" + + if scm.Version(self.version) >= "2.42.8": + tc.project_options.update({ + "png": is_enabled(self.options.with_libpng), + "tiff": is_enabled(self.options.with_libtiff), + "jpeg": is_enabled(self.options.with_libjpeg) + }) + else: + tc.project_options.update({ + "png": is_true(self.options.with_libpng), + "tiff": is_true(self.options.with_libtiff), + "jpeg": is_true(self.options.with_libjpeg) + }) + + # Workaround for https://bugs.llvm.org/show_bug.cgi?id=16404 + # Only really for the purposes of building on CCI - end users can + # workaround this by appropriately setting global linker flags in their profile + if self._requires_compiler_rt: + tc.c_link_args.append("-rtlib=compiler-rt") + tc.generate() + + venv = VirtualBuildEnv(self) + venv.generate() + + def requirements(self): + if not microsoft.is_msvc(self): + self.requires("glib/2.74.0") + else: + # Workaround due to https://github.com/conan-io/conan-center-index/issues/12342 + # Test again when the glib recipe is updated to the new meson toolchain + self.requires("glib/2.73.0") + if self.options.with_libpng: + self.requires("libpng/1.6.38") + if self.options.with_libtiff: + self.requires("libtiff/4.4.0") + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + elif self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9e") def build_requirements(self): - self.build_requires("meson/0.61.2") - self.build_requires("pkgconf/1.7.4") + self.tool_requires("meson/0.63.2") + self.tool_requires("pkgconf/1.9.3") if self.options.with_introspection: - self.build_requires("gobject-introspection/1.70.0") + self.tool_requires("gobject-introspection/1.72.0") + + def export_sources(self): + files.export_conandata_patches(self) def source(self): - files.get(self, **self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + files.get(self, **self.conan_data["sources"][self.version], strip_root=True) def _patch_sources(self): files.apply_conandata_patches(self) - meson_build = os.path.join(self._source_subfolder, "meson.build") + meson_build = os.path.join(self.source_folder, "meson.build") files.replace_in_file(self, meson_build, "subdir('tests')", "#subdir('tests')") files.replace_in_file(self, meson_build, "subdir('thumbnailer')", "#subdir('thumbnailer')") files.replace_in_file(self, meson_build, @@ -101,95 +154,24 @@ def _patch_sources(self): else "gmodule_dep.get_pkgconfig_variable('gmodule_supported')", "'true'") # workaround https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/203 if scm.Version(self.version) >= "2.42.6": - files.replace_in_file(self, os.path.join(self._source_subfolder, "build-aux", "post-install.py"), + files.replace_in_file(self, os.path.join(self.source_folder, "build-aux", "post-install.py"), "close_fds=True", "close_fds=(sys.platform != 'win32')") if scm.Version(self.version) >= "2.42.9": files.replace_in_file(self, meson_build, "is_msvc_like ? 'png' : 'libpng'", "'libpng'") files.replace_in_file(self, meson_build, "is_msvc_like ? 'jpeg' : 'libjpeg'", "'libjpeg'") files.replace_in_file(self, meson_build, "is_msvc_like ? 'tiff' : 'libtiff-4'", "'libtiff-4'") - @property - def _requires_compiler_rt(self): - return self.settings.compiler == "clang" and self.settings.build_type == "Debug" - - def _test_for_compiler_rt(self): - cmake = CMake(self) - with TemporaryDirectory() as tmp: - def open_temp_file(file_name): - return open(os.path.join(tmp, file_name), "w", encoding="utf-8") - - with open_temp_file("CMakeLists.txt") as cmake_file: - cmake_file.write(r""" - cmake_minimum_required(VERSION 3.16) - project(compiler_rt_test) - try_compile(HAS_COMPILER_RT ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/test.c OUTPUT_VARIABLE OUTPUT) - if(NOT HAS_COMPILER_RT) - message(FATAL_ERROR compiler-rt not present) - endif()""") - with open_temp_file("test.c") as test_source: - test_source.write(r""" - extern __int128_t __muloti4(__int128_t a, __int128_t b, int* overflow); - int main() { - __int128_t a; - __int128_t b; - int overflow; - __muloti4(a, b, &overflow); - return 0; - }""") - cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = "-rtlib=compiler-rt" - try: - cmake.configure(source_folder=tmp) - except ConanException as ex: - raise ConanInvalidConfiguration("LLVM Compiler RT is required to link gdk-pixbuf in debug mode") from ex - - @functools.lru_cache(1) - def _configure_meson(self): - meson = Meson(self) - defs = {} - if scm.Version(self.version) >= "2.42.0": - defs["introspection"] = "false" - else: - defs["gir"] = "false" - defs["docs"] = "false" - defs["man"] = "false" - defs["installed_tests"] = "false" - if scm.Version(self.version) >= "2.42.8": - defs["png"] = "enabled" if self.options.with_libpng else "disabled" - defs["tiff"] = "enabled" if self.options.with_libtiff else "disabled" - defs["jpeg"] = "enabled" if self.options.with_libjpeg else "disabled" - else: - defs["png"] = "true" if self.options.with_libpng else "false" - defs["tiff"] = "true" if self.options.with_libtiff else "false" - defs["jpeg"] = "true" if self.options.with_libjpeg else "false" - - defs["builtin_loaders"] = "all" - defs["gio_sniffing"] = "false" - defs["introspection"] = "enabled" if self.options.with_introspection else "disabled" - args = [] - # Workaround for https://bugs.llvm.org/show_bug.cgi?id=16404 - # Ony really for the purporses of building on CCI - end users can - # workaround this by appropriately setting global linker flags in their profile - if self._requires_compiler_rt: - args.append('-Dc_link_args="-rtlib=compiler-rt"') - args.append("--wrap-mode=nofallback") - meson.configure(defs=defs, build_folder=self._build_subfolder, source_folder=self._source_subfolder, pkg_config_paths=".", args=args) - return meson - def build(self): - if self._requires_compiler_rt: - self._test_for_compiler_rt() - self._patch_sources() - if self.options.with_libpng: - shutil.copy("libpng.pc", "libpng16.pc") - meson = self._configure_meson() + meson = Meson(self) + meson.configure() meson.build() def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - with tools.environment_append({"LD_LIBRARY_PATH": os.path.join(self.package_folder, "lib")}): - meson = self._configure_meson() - meson.install() + meson = Meson(self) + meson.install() + + files.copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) if microsoft.is_msvc(self) and not self.options.shared: files.rename(self, os.path.join(self.package_folder, "lib", "libgdk_pixbuf-2.0.a"), os.path.join(self.package_folder, "lib", "gdk_pixbuf-2.0.lib")) files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) @@ -217,4 +199,5 @@ def package_info(self): self.cpp_info.names["pkg_config"] = "gdk-pixbuf-2.0" def package_id(self): - self.info.requires["glib"].full_package_mode() + if not self.options["glib"].shared: + self.info.requires["glib"].full_package_mode() diff --git a/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt b/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt index faddb9cd23ec7..f31a35477a32f 100644 --- a/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt +++ b/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) find_package(gdk-pixbuf REQUIRED CONFIG) diff --git a/recipes/gdk-pixbuf/all/test_package/conanfile.py b/recipes/gdk-pixbuf/all/test_package/conanfile.py index 42f6f019466b0..f04bef385c6cc 100644 --- a/recipes/gdk-pixbuf/all/test_package/conanfile.py +++ b/recipes/gdk-pixbuf/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools import build import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,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") - self.run("gdk-pixbuf-pixdata -v", run_environment=True) - self.run(bin_path, run_environment=True) + if not build.can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + self.run("gdk-pixbuf-pixdata -v", env="conanrun") diff --git a/recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt b/recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cb19ae21c7964 --- /dev/null +++ b/recipes/gdk-pixbuf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gdk-pixbuf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} gdk-pixbuf::gdk-pixbuf) diff --git a/recipes/gdk-pixbuf/all/test_v1_package/conanfile.py b/recipes/gdk-pixbuf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..42f6f019466b0 --- /dev/null +++ b/recipes/gdk-pixbuf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run("gdk-pixbuf-pixdata -v", run_environment=True) + self.run(bin_path, run_environment=True) From 76a7e32e4eca9437dd3faf45b180d8f81ec7c885 Mon Sep 17 00:00:00 2001 From: Morwenn Date: Sun, 2 Oct 2022 23:44:32 +0200 Subject: [PATCH 279/561] (#13272) cpp-sort: add version 1.13.1 --- recipes/cpp-sort/all/conandata.yml | 3 +++ recipes/cpp-sort/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cpp-sort/all/conandata.yml b/recipes/cpp-sort/all/conandata.yml index 517e6732e09cc..a5f54c977de7d 100644 --- a/recipes/cpp-sort/all/conandata.yml +++ b/recipes/cpp-sort/all/conandata.yml @@ -32,3 +32,6 @@ sources: "1.13.0": sha256: 646eca5c592d20cbde0fbff41c65527940bb6430be68e0224fb5fcbf38b0df92 url: https://github.com/Morwenn/cpp-sort/archive/1.13.0.tar.gz + "1.13.1": + sha256: 139912c6004df8748bb1cfd3b94f2c6bfc2713885ed4b8e927a783d6b66963a8 + url: https://github.com/Morwenn/cpp-sort/archive/1.13.1.tar.gz diff --git a/recipes/cpp-sort/config.yml b/recipes/cpp-sort/config.yml index 4f77c5195cd73..b668b4b4bca0e 100644 --- a/recipes/cpp-sort/config.yml +++ b/recipes/cpp-sort/config.yml @@ -21,3 +21,5 @@ versions: folder: all "1.13.0": folder: all + "1.13.1": + folder: all From f2d8ddce4b44a17e09cbfa4bd39b7af4455ab858 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Sun, 2 Oct 2022 20:43:55 -0500 Subject: [PATCH 280/561] (#13206) avahi: Support Conan V2 * avahi: Support Conan V2 * Fix the systemdsystemunitdir which is relative to the package folder * Set minimum Conan version to 1.51.0 * Call generators explicitly * Remove cmake_find_package* calls for Avahi This makes the name consistent across CMake generators. --- recipes/avahi/all/conanfile.py | 101 +++++++++--------- recipes/avahi/all/test_package/CMakeLists.txt | 7 +- recipes/avahi/all/test_package/conanfile.py | 21 +++- .../avahi/all/test_v1_package/CMakeLists.txt | 10 ++ .../avahi/all/test_v1_package/conanfile.py | 17 +++ 5 files changed, 93 insertions(+), 63 deletions(-) create mode 100644 recipes/avahi/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/avahi/all/test_v1_package/conanfile.py diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index 793efa5b83afd..7d336892d2337 100644 --- a/recipes/avahi/all/conanfile.py +++ b/recipes/avahi/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.files import copy, get, rmdir, rm +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.51.0" class AvahiConan(ConanFile): @@ -15,7 +19,6 @@ class AvahiConan(ConanFile): homepage = "https://github.com/lathiat/avahi" license = "LGPL-2.1-only" settings = "os", "arch", "compiler", "build_type" - generators = "pkg_config" options = { "shared": [True, False], @@ -26,75 +29,67 @@ class AvahiConan(ConanFile): "fPIC": True } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.68.3") - self.requires("expat/2.4.1") + self.requires("glib/2.74.0") + self.requires("expat/2.4.9") self.requires("libdaemon/0.14") - self.requires("dbus/1.12.20") + self.requires("dbus/1.15.0") self.requires("gdbm/1.19") self.requires("libevent/2.1.12") def validate(self): - if self.settings.os != "Linux" or tools.cross_building(self): + if self.info.settings.os != "Linux": raise ConanInvalidConfiguration("Only Linux is supported for this package.") def configure(self): - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + except Exception: + pass if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @property - def _configure_args(self): - yes_no = lambda v: "yes" if v else "no" - return [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--disable-gtk3", - "--disable-mono", - "--disable-python", - "--disable-qt5", - "--disable-monodoc", - "--enable-compat-libdns_sd", - "--with-systemdsystemunitdir={}/lib/systemd/system".format(self.package_folder), - ] - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - self._autotools.configure(configure_dir=self._source_subfolder, args=self._configure_args) - return self._autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-compat-libdns_sd") + tc.configure_args.append("--disable-gtk3") + tc.configure_args.append("--disable-mono") + tc.configure_args.append("--disable-monodoc") + tc.configure_args.append("--disable-python") + tc.configure_args.append("--disable-qt5") + tc.configure_args.append("--with-systemdsystemunitdir=/lib/systemd/system") + tc.generate() + AutotoolsDeps(self).generate() + PkgConfigDeps(self).generate() def build(self): - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "run")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "Avahi" - self.cpp_info.names["cmake_find_package_multi"] = "Avahi" - for lib in ("client", "common", "core", "glib", "gobject", "libevent", "compat-libdns_sd"): - avahi_lib = "avahi-{}".format(lib) + avahi_lib = f"avahi-{lib}" self.cpp_info.components[lib].names["cmake_find_package"] = lib self.cpp_info.components[lib].names["cmake_find_package_multi"] = lib self.cpp_info.components[lib].names["pkg_config"] = avahi_lib @@ -111,7 +106,7 @@ def package_info(self): self.cpp_info.components["compat-libdns_sd"].requires = ["client"] for app in ("autoipd", "browse", "daemon", "dnsconfd", "publish", "resolve", "set-host-name"): - avahi_app = "avahi-{}".format(app) + avahi_app = f"avahi-{app}" self.cpp_info.components[app].names["cmake_find_package"] = app self.cpp_info.components[app].names["cmake_find_package_multi"] = app self.cpp_info.components[app].names["pkg_config"] = avahi_app @@ -125,5 +120,5 @@ def package_info(self): self.cpp_info.components["set-host-name"].requires = ["client"] bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/avahi/all/test_package/CMakeLists.txt b/recipes/avahi/all/test_package/CMakeLists.txt index 7f438a48c4ea1..fce015c3405a9 100644 --- a/recipes/avahi/all/test_package/CMakeLists.txt +++ b/recipes/avahi/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(Avahi CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} Avahi::compat-libdns_sd) +target_link_libraries(${PROJECT_NAME} PRIVATE avahi::compat-libdns_sd) diff --git a/recipes/avahi/all/test_package/conanfile.py b/recipes/avahi/all/test_package/conanfile.py index 1bf1c7e26255d..704f712573f0d 100644 --- a/recipes/avahi/all/test_package/conanfile.py +++ b/recipes/avahi/all/test_package/conanfile.py @@ -1,9 +1,20 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake +from conan.tools.layout import cmake_layout + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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,6 +22,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/avahi/all/test_v1_package/CMakeLists.txt b/recipes/avahi/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..abd3bb0df681c --- /dev/null +++ b/recipes/avahi/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Avahi CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE avahi::compat-libdns_sd) diff --git a/recipes/avahi/all/test_v1_package/conanfile.py b/recipes/avahi/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b6a26067f365d --- /dev/null +++ b/recipes/avahi/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From cc92855ee3fae12b092b0f254bff6049fc1c6f35 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:44:36 +0200 Subject: [PATCH 281/561] (#13242) libmodbus: several improvements * several improvements - remove useless generators - do not test cppstd, it's a C library - restore includedir to include/modbus - fix compiler=msvc & shared * fix 2 profile with msvc * do not redefine compile --- recipes/libmodbus/all/conanfile.py | 106 ++++++++---------- .../libmodbus/all/test_package/test_package.c | 2 +- .../all/test_v1_package/conanfile.py | 10 +- 3 files changed, 51 insertions(+), 67 deletions(-) diff --git a/recipes/libmodbus/all/conanfile.py b/recipes/libmodbus/all/conanfile.py index 0340e921e9e52..312b39b90e05e 100644 --- a/recipes/libmodbus/all/conanfile.py +++ b/recipes/libmodbus/all/conanfile.py @@ -1,16 +1,15 @@ from conan import ConanFile -from conan.tools.apple import is_apple_os, fix_apple_shared_install_name -from conan.tools.build import check_min_cppstd -from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rename, rm, rmdir -from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, unix_path from conan.tools.scm import Version import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class LibmodbusConan(ConanFile): @@ -20,7 +19,7 @@ class LibmodbusConan(ConanFile): topics = ("modbus", "protocol", "industry", "automation") license = "LGPL-2.1" url = "https://github.com/conan-io/conan-center-index" - exports_sources = "patches/**" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -33,7 +32,14 @@ class LibmodbusConan(ConanFile): @property def _settings_build(self): - return self.settings_build if hasattr(self, "settings_build") else self.settings + return getattr(self, "settings_build", self.settings) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -42,74 +48,58 @@ def config_options(self): def configure(self): if self.options.shared: try: - del self.options.fPIC # once removed by config_options, need try..except for a second del + del self.options.fPIC except Exception: pass try: - del self.settings.compiler.libcxx # for plain C projects only + del self.settings.compiler.libcxx except Exception: pass try: - del self.settings.compiler.cppstd # for plain C projects only + del self.settings.compiler.cppstd except Exception: pass - if self.settings.os == "Windows": - self.win_bash = True + + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): if is_msvc(self): - self.tool_requires("automake/1.16.3") - # see https://github.com/conan-io/conan/issues/11969 - bash_path = os.getenv("CONAN_BASH_PATH") or self.conf.get("tools.microsoft.bash:path") - if self._settings_build.os == "Windows" and not bash_path: - self.tool_requires("msys2/cci.latest") + self.tool_requires("automake/1.16.5") + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + self.win_bash = True def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def validate(self): - # validate the minimum cpp standard supported - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, 11) - - def layout(self): - basic_layout(self, src_folder="src") - def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) tc.configure_args.append("--without-documentation") tc.configure_args.append("--disable-tests") - - # the following MSVC specific part has been ported from conan v1 following https://github.com/conan-io/conan-center-index/pull/12916 - if is_msvc(self) and Version(self.settings.compiler.version) >= "12": + if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ + (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): tc.extra_cflags.append("-FS") - - env = tc.environment() + tc.generate() if is_msvc(self): - ar_lib = unix_path(self, self.deps_user_info['automake'].ar_lib) - env.define("CC", "cl -nologo") - env.define("CXX", "cl -nologo") + env = Environment() + compile_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "compile")) + ar_wrapper = unix_path(self, self._user_info_build["automake"].ar_lib) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") env.define("LD", "link -nologo") - env.define("AR", f"{ar_lib} \"lib -nologo -verbose\"") - env.define("RANLIB", ":") - env.define("STRING", ":") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") env.define("NM", "dumpbin -symbols") - - tc.generate(env) - - # generate dependencies for pkg-config - tc = PkgConfigDeps(self) - tc.generate() - - # generate dependencies for autotools - tc = AutotoolsDeps(self) - tc.generate() - - # inject tools_require env vars in build context - ms = VirtualBuildEnv(self) - ms.generate() + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_libmodbus_msvc") def _patch_sources(self): apply_conandata_patches(self) @@ -124,26 +114,22 @@ def build(self): autotools.make() def package(self): - copy(self, pattern="COPYING*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) # see https://github.com/conan-io/conan/issues/12006 autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) - - if is_apple_os(self): - fix_apple_shared_install_name(self) - rm(self, "*.la", os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - if self.settings.compiler == "Visual Studio" and self.options.shared: + fix_apple_shared_install_name(self) + if is_msvc(self) and self.options.shared: rename(self, os.path.join(self.package_folder, "lib", "modbus.dll.lib"), os.path.join(self.package_folder, "lib", "modbus.lib")) def package_info(self): - self.cpp_info.libs = ["modbus"] - self.cpp_info.set_property("pkg_config_name", "libmodbus") - + self.cpp_info.libs = ["modbus"] + self.cpp_info.includedirs.append(os.path.join("include", "modbus")) if self.settings.os == "Windows" and not self.options.shared: self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/libmodbus/all/test_package/test_package.c b/recipes/libmodbus/all/test_package/test_package.c index bedad43c44404..e9bd9b1a77ac6 100644 --- a/recipes/libmodbus/all/test_package/test_package.c +++ b/recipes/libmodbus/all/test_package/test_package.c @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/recipes/libmodbus/all/test_v1_package/conanfile.py b/recipes/libmodbus/all/test_v1_package/conanfile.py index 3898047081060..a691174f8ed16 100644 --- a/recipes/libmodbus/all/test_v1_package/conanfile.py +++ b/recipes/libmodbus/all/test_v1_package/conanfile.py @@ -1,11 +1,9 @@ -from conans import ConanFile, CMake -from conans.tools import cross_building +from conans import ConanFile, CMake, tools import os -# legacy validation with Coann 1.x -class TestPackageV1Conan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" def build(self): @@ -14,7 +12,7 @@ def build(self): cmake.build() def test(self): - if not cross_building(self.settings): + if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) From 59692dd9540a21c533535eee7491d023859090eb Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 3 Oct 2022 20:04:33 +0900 Subject: [PATCH 282/561] (#13250) xbyak: add version 6.62 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/xbyak/all/conandata.yml | 3 +++ recipes/xbyak/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/xbyak/all/conandata.yml b/recipes/xbyak/all/conandata.yml index 17cf1e26fddfe..2e045a1c8a082 100644 --- a/recipes/xbyak/all/conandata.yml +++ b/recipes/xbyak/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.62": + url: "https://github.com/herumi/xbyak/archive/v6.62.tar.gz" + sha256: "fd5f074d64cdfcacad3bbe8664727a8eab569f131cadd725a778c028fa6b0ccd" "6.61.2": url: "https://github.com/herumi/xbyak/archive/v6.61.2.tar.gz" sha256: "97b88064c9e7cd12bd235e7e600cb017481851d929ccdc95924e9d9e56a0bc3c" diff --git a/recipes/xbyak/config.yml b/recipes/xbyak/config.yml index 462c4bf804643..9006396a7028a 100644 --- a/recipes/xbyak/config.yml +++ b/recipes/xbyak/config.yml @@ -1,4 +1,6 @@ versions: + "6.62": + folder: all "6.61.2": folder: all "6.60.2": From d160c1072b5652cbdb35abd354d5cc9741700c72 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Mon, 3 Oct 2022 13:29:04 +0200 Subject: [PATCH 283/561] (#13212) [bot] Add Access Request users (2022-09-29) --- .c3i/authorized_users.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 71549ca17030b..393a65493cf88 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -942,3 +942,4 @@ authorized_users: - "madhat1" - "vince-cheung" - "mariopil" + - "PikachuHyA" From 8e7a087477ca61e2a847721352ebdb655c10edd5 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Mon, 3 Oct 2022 15:46:35 +0200 Subject: [PATCH 284/561] (#13209) docs: explain why no pdb is useful * docs: explain why no pdb is useful This was Diego answer to me which made a lot of sense * fix broken links * Apply suggestions from code review Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- docs/faqs.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/faqs.md b/docs/faqs.md index b0249a7008bbd..13a42f1804c81 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -142,6 +142,11 @@ However, there are ways to get around this, one of them is through the [/Z7](htt Adding one more common option, it seems the most simple and obvious solution, but it contains a side effect already seen with fPIC. It is necessary to manage the entire recipe, it has become a Boilerplate. So, adding PDB would be one more point to be reviewed for each recipe. In addition, in the future new options could arise, such as sanity or benchmark, further inflating the recipes. For this reason, a new option will not be added. However, the inclusion of the PDB files is discussed in issue [#1982](https://github.com/conan-io/conan-center-index/issues/1982) and there are some ideas for making this possible through a new feature. If you want to comment on the subject, please visit issue. +### Doesn't this make debug builds useless? + +No. The PDBs are only needed to debug dependency code. By providing the libraries you are able to link and build your application and debug your own code. +This is by far the more common scenario which we want to enable. + ## Can I remove an option from a recipe? It's preferable to leave all options (ie. not removing them) because it may break other packages which require those deleted options. @@ -402,4 +407,4 @@ merging to the master branch. Feel free to contribute to a new Github Action tha ## Is it possible to disable Pylint? No. The [pylint](v2_linter.md) has an important role of keeping any recipe prepared for [Conan v2 migration](v2_migration.md). In case you are having -difficult to understand [linter errors](linters.md), please, comment on your pull request about, then the community will help you. +difficult to understand [linter errors](linters.md), please comment on your pull request about the problem to receive help from the community. From ffbd37f8d8b196154c707766f3bfb734bcfca6ee Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 3 Oct 2022 16:04:38 +0200 Subject: [PATCH 285/561] (#13255) nettle: several fixes - requires conan > 1.51.1 - win_bash required if build os is windows - remive useless PkgConfigDeps - relocatable shared libs on macOS - fix install on Windows - restore previous component names & do not suggest unofficial cmake names - hogweed lib requires nettle lib, not the opposite --- recipes/nettle/all/conanfile.py | 67 ++++++++----------- .../nettle/all/test_package/CMakeLists.txt | 6 +- .../nettle/all/test_v1_package/CMakeLists.txt | 6 +- 3 files changed, 34 insertions(+), 45 deletions(-) diff --git a/recipes/nettle/all/conanfile.py b/recipes/nettle/all/conanfile.py index 5768cf2b5f267..6fad71c864b8b 100644 --- a/recipes/nettle/all/conanfile.py +++ b/recipes/nettle/all/conanfile.py @@ -1,19 +1,19 @@ from conan import ConanFile -from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version -from conan.tools.files import get, replace_in_file, copy, rmdir -from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import cross_building -from conan.tools.microsoft import unix_path -from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.51.1" -class NettleTLS(ConanFile): +class NettleConan(ConanFile): name = "nettle" description = "The Nettle and Hogweed low-level cryptographic libraries" homepage = "https://www.lysator.liu.se/~nisse/nettle" @@ -61,19 +61,17 @@ def configure(self): del self.settings.compiler.cppstd except Exception: pass - if self.settings.os == "Windows": - self.win_bash = True + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.public_key: self.requires("gmp/6.2.1") - def layout(self): - basic_layout(self, src_folder="src") - def validate(self): if is_msvc(self): - raise ConanInvalidConfiguration(f"{self.ref} cannot be built using '{self.settings.compiler}'") + raise ConanInvalidConfiguration(f"{self.ref} cannot be built using '{self.info.settings.compiler}'") if Version(self.version) < "3.6" and self.info.options.get_safe("fat") and self.info.settings.arch == "x86_64": raise ConanInvalidConfiguration("fat support is broken on this nettle release (due to a missing x86_64/sha_ni/sha1-compress.asm source)") @@ -83,26 +81,25 @@ def _settings_build(self): def build_requirements(self): self.tool_requires("libtool/2.4.7") - if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): - self.tool_requires("msys2/cci.latest") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): tc = AutotoolsToolchain(self) - conf_args = [ + tc.configure_args.extend([ "--enable-public-key" if self.options.public_key else "--disable-public-key", "--enable-fat" if self.options.get_safe("fat") else "--disable-fat", "--enable-x86-aesni" if self.options.get_safe("x86_aesni") else "--disable-x86-aesni", "--enable-x86_sshni" if self.options.get_safe("x86_sshni") else "--disable-x86_sshni", - ] - tc.configure_args.extend(conf_args) + ]) tc.generate() tc = AutotoolsDeps(self) tc.generate() - tc = PkgConfigDeps(self) - tc.generate() env = VirtualBuildEnv(self) env.generate() if not cross_building(self): @@ -125,7 +122,7 @@ def build(self): autotools = Autotools(self) autotools.autoreconf() # srcdir in unix path causes some troubles in asm files on Windows - if self.settings.os == "Windows": + if self._settings_build.os == "Windows": replace_in_file(self, os.path.join(self.build_folder, "config.m4"), unix_path(self, os.path.join(self.build_folder, self.source_folder)), os.path.join(self.build_folder, self.source_folder).replace("\\", "/")) @@ -135,28 +132,20 @@ def build(self): def package(self): copy(self, pattern="COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) - autotools.install() + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "Nettle") + self.cpp_info.set_property("pkg_config_name", "hogweed") + + self.cpp_info.components["libnettle"].set_property("pkg_config_name", "nettle") + self.cpp_info.components["libnettle"].libs = ["nettle"] self.cpp_info.components["hogweed"].set_property("pkg_config_name", "hogweed") - self.cpp_info.components["hogweed"].set_property("cmake_target_name", "Nettle::Hogweed") self.cpp_info.components["hogweed"].libs = ["hogweed"] + self.cpp_info.components["hogweed"].requires = ["libnettle"] if self.options.public_key: self.cpp_info.components["hogweed"].requires.append("gmp::libgmp") - - self.cpp_info.components["nettle"].libs = ["nettle"] - self.cpp_info.components["nettle"].requires = ["hogweed"] - self.cpp_info.components["nettle"].set_property("pkg_config_name", "nettle") - self.cpp_info.components["nettle"].set_property("cmake_target_name", "Nettle::Nettle") - - # TODO: Remove after Conan 2.0 - self.cpp_info.names["cmake_find_package"] = "Nettle" - self.cpp_info.names["cmake_find_package_multi"] = "Nettle" - self.cpp_info.components["hogweed"].names["cmake_find_package"] = "Hogweed" - self.cpp_info.components["hogweed"].names["cmake_find_package_multi"] = "Hogweed" - self.cpp_info.components["nettle"].names["cmake_find_package"] = "Nettle" - self.cpp_info.components["nettle"].names["cmake_find_package_multi"] = "Nettle" diff --git a/recipes/nettle/all/test_package/CMakeLists.txt b/recipes/nettle/all/test_package/CMakeLists.txt index 9e41051d67311..5392db1d1ea64 100644 --- a/recipes/nettle/all/test_package/CMakeLists.txt +++ b/recipes/nettle/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -find_package(Nettle REQUIRED CONFIG) +find_package(nettle REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Nettle::Nettle Nettle::Hogweed) +target_link_libraries(${PROJECT_NAME} PRIVATE nettle::libnettle nettle::hogweed) diff --git a/recipes/nettle/all/test_v1_package/CMakeLists.txt b/recipes/nettle/all/test_v1_package/CMakeLists.txt index e74ead530485f..6ec75079b3fc2 100644 --- a/recipes/nettle/all/test_v1_package/CMakeLists.txt +++ b/recipes/nettle/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Nettle REQUIRED CONFIG) +find_package(nettle REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Nettle::Nettle Nettle::Hogweed) +target_link_libraries(${PROJECT_NAME} PRIVATE nettle::libnettle nettle::hogweed) From f8cb8aedb1bf4d219298cc4155bbaf8696a00ba5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 3 Oct 2022 16:24:28 +0200 Subject: [PATCH 286/561] (#13258) dbus: conan v2 support * conan v2 support * bump glib --- recipes/dbus/1.x.x/CMakeLists.txt | 7 - recipes/dbus/1.x.x/conandata.yml | 8 +- recipes/dbus/1.x.x/conanfile.py | 130 +++++++++--------- .../1.x.x/patches/0001-cmake-project.patch | 23 ++++ ...ake_configure_checks_list_separator.patch} | 0 .../patches/cmake_current_source_dir.patch | 112 --------------- .../dbus/1.x.x/test_package/CMakeLists.txt | 7 +- recipes/dbus/1.x.x/test_package/conanfile.py | 23 ++-- .../dbus/1.x.x/test_v1_package/CMakeLists.txt | 10 ++ .../dbus/1.x.x/test_v1_package/conanfile.py | 18 +++ 10 files changed, 136 insertions(+), 202 deletions(-) delete mode 100644 recipes/dbus/1.x.x/CMakeLists.txt create mode 100644 recipes/dbus/1.x.x/patches/0001-cmake-project.patch rename recipes/dbus/1.x.x/patches/{cmake_configure_checks_list_separator.patch => 0002-cmake_configure_checks_list_separator.patch} (100%) delete mode 100644 recipes/dbus/1.x.x/patches/cmake_current_source_dir.patch create mode 100644 recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/dbus/1.x.x/test_v1_package/conanfile.py diff --git a/recipes/dbus/1.x.x/CMakeLists.txt b/recipes/dbus/1.x.x/CMakeLists.txt deleted file mode 100644 index b117333a50fcc..0000000000000 --- a/recipes/dbus/1.x.x/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("cmake") diff --git a/recipes/dbus/1.x.x/conandata.yml b/recipes/dbus/1.x.x/conandata.yml index 782da97eb7547..15c5df2d70057 100644 --- a/recipes/dbus/1.x.x/conandata.yml +++ b/recipes/dbus/1.x.x/conandata.yml @@ -10,12 +10,8 @@ sources: sha256: "f77620140ecb4cdc67f37fb444f8a6bea70b5b6461f12f1cbe2cec60fa7de5fe" patches: "1.12.20": - - patch_file: "patches/cmake_current_source_dir.patch" - base_path: "source_subfolder" - patch_type: "portability" - patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/332" - - patch_file: "patches/cmake_configure_checks_list_separator.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-cmake-project.patch" + - patch_file: "patches/0002-cmake_configure_checks_list_separator.patch" patch_type: "portability" url: "https://gitlab.freedesktop.org/dbus/dbus/-/commit/8cd1c2155252938ed38d2612e4d054c7fc0244c3.patch" patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/issues/324" diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index 06afef2d16de7..78abe21349606 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -1,14 +1,13 @@ -import os -import textwrap - from conan import ConanFile -from conan.tools.files import apply_conandata_patches, copy, get, mkdir, rename, rmdir, save, rm from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rmdir, save from conan.tools.scm import Version -from conans import CMake +import os +import textwrap -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class DbusConan(ConanFile): @@ -21,12 +20,12 @@ class DbusConan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = { - "system_socket": "ANY", - "system_pid_file": "ANY", + "system_socket": ["ANY"], + "system_pid_file": ["ANY"], "with_x11": [True, False], "with_glib": [True, False], "with_selinux": [True, False], - "session_socket_dir": "ANY", + "session_socket_dir": ["ANY"], } default_options = { "system_socket": "", @@ -37,29 +36,30 @@ class DbusConan(ConanFile): "session_socket_dir": "/tmp", } - generators = "cmake", "cmake_find_package", "VirtualBuildEnv", "VirtualRunEnv" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os not in ("Linux", "FreeBSD"): del self.options.with_x11 def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("expat/2.4.9") if self.options.with_glib: - self.requires("glib/2.73.3") + self.requires("glib/2.74.0") if self.options.with_selinux: self.requires("selinux/3.3") if self.options.get_safe("with_x11"): @@ -67,52 +67,54 @@ def requirements(self): def validate(self): if Version(self.version) >= "1.14.0": - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7: - raise ConanInvalidConfiguration("dbus requires at least gcc 7.") - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("dbus 1.14.0 does not support windows. contributions are welcome") - - def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) - copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, self._source_subfolder)) + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < 7: + raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.") + if self.info.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} does not support windows. contributions are welcome") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - - self._cmake.definitions["DBUS_BUILD_TESTS"] = False - self._cmake.definitions["DBUS_ENABLE_DOXYGEN_DOCS"] = False - self._cmake.definitions["DBUS_ENABLE_XML_DOCS"] = False - - self._cmake.definitions["DBUS_BUILD_X11"] = self.options.get_safe("with_x11", False) - self._cmake.definitions["DBUS_WITH_GLIB"] = self.options.with_glib - self._cmake.definitions["DBUS_DISABLE_ASSERT"] = is_apple_os(self) - self._cmake.definitions["DBUS_DISABLE_CHECKS"] = False - - # Conan does not provide an EXPAT_LIBRARIES CMake variable for the Expat library. - # Define EXPAT_LIBRARIES to be the expat::expat target provided by Conan to fix linking. - self._cmake.definitions["EXPAT_LIBRARIES"] = "expat::expat" - - # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a - self._cmake.definitions["DBUS_SESSION_SOCKET_DIR"] = self.options.session_socket_dir - - self._cmake.configure(source_folder=self._source_subfolder, - build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DBUS_BUILD_TESTS"] = False + tc.variables["DBUS_ENABLE_DOXYGEN_DOCS"] = False + tc.variables["DBUS_ENABLE_XML_DOCS"] = False + tc.variables["DBUS_BUILD_X11"] = self.options.get_safe("with_x11", False) + tc.variables["DBUS_WITH_GLIB"] = self.options.with_glib + tc.variables["DBUS_DISABLE_ASSERT"] = is_apple_os(self) + tc.variables["DBUS_DISABLE_CHECKS"] = False + # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a + tc.variables["DBUS_SESSION_SOCKET_DIR"] = self.options.session_socket_dir + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Unfortunately, there is currently no other way to force disable + # CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in CMake conan_toolchain. + replace_in_file( + self, + os.path.join(self.generators_folder, "conan_toolchain.cmake"), + "set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)", + "", + strict=False, + ) def build(self): - apply_conandata_patches(self) - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + if Version(self.version) < "1.14.0": + cmake.configure(build_script_folder=os.path.join(self.source_folder, "cmake")) + else: + cmake.configure() cmake.build() def package(self): - self.copy(pattern="COPYING", dst="licenses", - src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "share", "doc")) @@ -123,7 +125,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "systemd")) - rm(self, "*.la", self.package_folder) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( @@ -134,12 +135,12 @@ def package(self): def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) + """) save(self, module_file, content) @property @@ -154,6 +155,7 @@ def package_info(self): os.path.join("include", "dbus-1.0"), os.path.join("lib", "dbus-1.0", "include"), ]) + self.cpp_info.resdirs = ["res"] self.cpp_info.libs = ["dbus-1"] if self.settings.os == "Linux": self.cpp_info.system_libs.append("rt") diff --git a/recipes/dbus/1.x.x/patches/0001-cmake-project.patch b/recipes/dbus/1.x.x/patches/0001-cmake-project.patch new file mode 100644 index 0000000000000..2d00f57d33527 --- /dev/null +++ b/recipes/dbus/1.x.x/patches/0001-cmake-project.patch @@ -0,0 +1,23 @@ +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -1,10 +1,3 @@ +-# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") +- +-# we do not need to have WIN32 defined +-set(CMAKE_LEGACY_CYGWIN_WIN32 0) +- +-project(dbus) + + # we need to be up to date + CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2 FATAL_ERROR) +@@ -19,6 +12,9 @@ if(CMAKE_MAJOR_VERSION GREATER 2) + cmake_policy(SET CMP0054 NEW) + endif() + endif() ++set(CMAKE_LEGACY_CYGWIN_WIN32 0) ++project(dbus) ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") + + # detect version + include(MacrosAutotools) diff --git a/recipes/dbus/1.x.x/patches/cmake_configure_checks_list_separator.patch b/recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch similarity index 100% rename from recipes/dbus/1.x.x/patches/cmake_configure_checks_list_separator.patch rename to recipes/dbus/1.x.x/patches/0002-cmake_configure_checks_list_separator.patch diff --git a/recipes/dbus/1.x.x/patches/cmake_current_source_dir.patch b/recipes/dbus/1.x.x/patches/cmake_current_source_dir.patch deleted file mode 100644 index b4b275a75ae3d..0000000000000 --- a/recipes/dbus/1.x.x/patches/cmake_current_source_dir.patch +++ /dev/null @@ -1,112 +0,0 @@ -diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index 3ac71a5a..9d203d5f 100644 ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -1,5 +1,5 @@ - # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked --list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/modules") - - # we do not need to have WIN32 defined - set(CMAKE_LEGACY_CYGWIN_WIN32 0) -@@ -114,7 +114,7 @@ endif (CYGWIN) - # search for required packages - if (WIN32) - # include local header first to avoid using old installed header -- set (CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${CMAKE_SOURCE_DIR}/..) -+ set (CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${PROJECT_SOURCE_DIR}/..) - find_package(LibIconv) - include(Win32Macros) - addExplorerWrapper(${CMAKE_PROJECT_NAME}) -@@ -148,7 +148,7 @@ add_definitions(-D_GNU_SOURCE) - INCLUDE(ConfigureChecks.cmake) - - # @TODO: how to remove last dir from ${CMAKE_SOURCE_DIR} ? --SET(DBUS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/..) -+SET(DBUS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) - - # make some more macros available - include (MacroLibrary) -@@ -281,7 +281,7 @@ endif (WIN32 OR CYGWIN) - set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) - - # for including config.h and for includes like --include_directories( ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR} ${CMAKE_INCLUDE_PATH} ) -+include_directories( ${PROJECT_SOURCE_DIR}/.. ${PROJECT_BINARY_DIR} ${CMAKE_INCLUDE_PATH} ) - - # linker search directories - link_directories(${DBUS_LIB_DIR} ${LIBRARY_OUTPUT_PATH} ) -diff --git a/cmake/bus/CMakeLists.txt b/cmake/bus/CMakeLists.txt -index 4c5bdcf2..5ac8454c 100644 ---- a/cmake/bus/CMakeLists.txt -+++ b/cmake/bus/CMakeLists.txt -@@ -1,7 +1,7 @@ - add_definitions(-DDBUS_COMPILATION) - - SET(EFENCE "") --SET(BUS_DIR ${CMAKE_SOURCE_DIR}/../bus) -+SET(BUS_DIR ${PROJECT_SOURCE_DIR}/../bus) - - # config files for installation - CONFIGURE_FILE( "${BUS_DIR}/session.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/session.conf" IMMEDIATE @ONLY) -@@ -16,7 +16,7 @@ endif() - - # copy services for local daemon start to local service dir data/dbus-1/services - SET (SERVICE_FILES test/data/valid-service-files) --FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${SERVICE_FILES}/*.service.in" ) -+FILE(GLOB FILES "${PROJECT_SOURCE_DIR}/../${SERVICE_FILES}/*.service.in" ) - FOREACH(FILE ${FILES}) - GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME_WE) - SET (TARGET ${CMAKE_BINARY_DIR}/data/dbus-1/services/${FILENAME}.service) -@@ -84,7 +84,7 @@ endif(DBUS_ENABLE_STATS) - - include_directories( - ${CMAKE_BINARY_DIR} -- ${CMAKE_SOURCE_DIR}/.. -+ ${PROJECT_SOURCE_DIR}/.. - ${EXPAT_INCLUDE_DIR} - ) - -diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt -index 8a01d918..93e541a5 100644 ---- a/cmake/dbus/CMakeLists.txt -+++ b/cmake/dbus/CMakeLists.txt -@@ -1,4 +1,4 @@ --SET(DBUS_DIR ${CMAKE_SOURCE_DIR}/../dbus) -+SET(DBUS_DIR ${PROJECT_SOURCE_DIR}/../dbus) - - configure_file(${DBUS_DIR}/dbus-arch-deps.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h ) - -@@ -98,7 +98,7 @@ set (DBUS_LIB_HEADERS - ${DBUS_DIR}/dbus-transport.h - ${DBUS_DIR}/dbus-transport-protected.h - ${DBUS_DIR}/dbus-watch.h -- ${CMAKE_BINARY_DIR}/config.h -+ ${PROJECT_BINARY_DIR}/config.h - ) - if(UNIX) - set (DBUS_LIB_HEADERS ${DBUS_LIB_HEADERS} -@@ -330,7 +330,7 @@ else(WIN32) - endif(WIN32) - - if (DBUS_ENABLE_EMBEDDED_TESTS) -- add_test_executable(test-dbus ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c ${DBUS_INTERNAL_LIBRARIES}) -+ add_test_executable(test-dbus ${PROJECT_SOURCE_DIR}/../dbus/dbus-test-main.c ${DBUS_INTERNAL_LIBRARIES}) - set_target_properties(test-dbus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS}) - ENDIF (DBUS_ENABLE_EMBEDDED_TESTS) - -diff --git a/cmake/modules/CPackInstallConfig.cmake b/cmake/modules/CPackInstallConfig.cmake -index 46e8fb6d..e2331425 100644 ---- a/cmake/modules/CPackInstallConfig.cmake -+++ b/cmake/modules/CPackInstallConfig.cmake -@@ -9,8 +9,8 @@ endif (DBUS_INSTALL_SYSTEM_LIBS) - - SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "D-BUS For Windows") - SET(CPACK_PACKAGE_VENDOR "D-BUS Windows Team") --SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/../README") --SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/../COPYING") -+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README") -+SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../COPYING") - # duplicated from VERSION - SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) - SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) diff --git a/recipes/dbus/1.x.x/test_package/CMakeLists.txt b/recipes/dbus/1.x.x/test_package/CMakeLists.txt index ac7664d0c79b8..497b3ee2b047c 100644 --- a/recipes/dbus/1.x.x/test_package/CMakeLists.txt +++ b/recipes/dbus/1.x.x/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(DBus1 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} dbus-1) +target_link_libraries(${PROJECT_NAME} PRIVATE dbus-1) diff --git a/recipes/dbus/1.x.x/test_package/conanfile.py b/recipes/dbus/1.x.x/test_package/conanfile.py index 2098e89bdb0f6..3cb242daa016f 100644 --- a/recipes/dbus/1.x.x/test_package/conanfile.py +++ b/recipes/dbus/1.x.x/test_package/conanfile.py @@ -1,13 +1,19 @@ -import os - from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi", "VirtualBuildEnv", "VirtualRunEnv" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -15,6 +21,7 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - self.run("dbus-monitor --help", run_environment=True) - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + self.run("dbus-monitor --help", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt b/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b2f91e4b0e322 --- /dev/null +++ b/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(DBus1 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE dbus-1) diff --git a/recipes/dbus/1.x.x/test_v1_package/conanfile.py b/recipes/dbus/1.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3a412edafcc0d --- /dev/null +++ b/recipes/dbus/1.x.x/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run("dbus-monitor --help", run_environment=True) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From c64e3567bd95123359ced39e3f5899d482d703cf Mon Sep 17 00:00:00 2001 From: Sergey Bobrenok Date: Mon, 3 Oct 2022 17:44:48 +0300 Subject: [PATCH 287/561] (#13266) libsystemd/all: Add missing VirtualBuildEnv We need VirtualBuildEnv in this recipe to guarantee that build_requirements will be used during build. --- recipes/libsystemd/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libsystemd/all/conanfile.py b/recipes/libsystemd/all/conanfile.py index ba52c79934817..80137fb8bde1d 100644 --- a/recipes/libsystemd/all/conanfile.py +++ b/recipes/libsystemd/all/conanfile.py @@ -36,7 +36,7 @@ class LibsystemdConan(ConanFile): "with_xz": True, "with_zstd": True, } - generators = "PkgConfigDeps" + generators = "PkgConfigDeps", "VirtualBuildEnv" exports_sources = "patches/**" def configure(self): From 67d143cca0a083198e0daffb5048b178c75a27fb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 3 Oct 2022 17:05:54 +0200 Subject: [PATCH 288/561] (#13269) libtasn1: conan v2 support * conan v2 support * workaround in test_package for cross-build --- recipes/libtasn1/all/conandata.yml | 3 +- recipes/libtasn1/all/conanfile.py | 122 +++++++++++------- .../libtasn1/all/test_package/CMakeLists.txt | 25 ++-- .../libtasn1/all/test_package/conanfile.py | 24 +++- .../all/test_v1_package/CMakeLists.txt | 24 ++++ .../libtasn1/all/test_v1_package/conanfile.py | 26 ++++ 6 files changed, 158 insertions(+), 66 deletions(-) create mode 100644 recipes/libtasn1/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libtasn1/all/test_v1_package/conanfile.py diff --git a/recipes/libtasn1/all/conandata.yml b/recipes/libtasn1/all/conandata.yml index 2cb642694eeb9..4c2bc670569f5 100644 --- a/recipes/libtasn1/all/conandata.yml +++ b/recipes/libtasn1/all/conandata.yml @@ -4,5 +4,4 @@ sources: sha256: "0e0fb0903839117cb6e3b56e68222771bebf22ad7fc2295a0ed7d576e8d4329d" patches: "4.16.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-do-not-add-static-to-functions-meant-to-be-built.patch" + - patch_file: "patches/0001-do-not-add-static-to-functions-meant-to-be-built.patch" diff --git a/recipes/libtasn1/all/conanfile.py b/recipes/libtasn1/all/conanfile.py index b6fcd3dac48b7..9ec3d89cded7e 100644 --- a/recipes/libtasn1/all/conanfile.py +++ b/recipes/libtasn1/all/conanfile.py @@ -1,19 +1,24 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class LibTasn1Conan(ConanFile): name = "libtasn1" homepage = "https://www.gnu.org/software/libtasn1/" description = "Libtasn1 is the ASN.1 library used by GnuTLS, p11-kit and some other packages." - topics = ("conan", "libtasn", "ASN.1", "cryptography") + topics = ("libtasn", "ASN.1", "cryptography") url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "arch", "build_type" license = "LGPL-2.1-or-later" - exports_sources = "patches/**" + + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -23,11 +28,12 @@ class LibTasn1Conan(ConanFile): "fPIC": True, } - _autotools = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -35,62 +41,78 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("Visual Studio is unsupported by libtasn1") - - @property - def _settings_build(self): - return self.settings_build if hasattr(self, "settings_build") else self.settings + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio") def build_requirements(self): - self.build_requires("bison/3.5.3") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("bison/3.8.2") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - if self.settings.compiler != "Visual Studio": - self._autotools.flags.append("-std=c99") - conf_args = [ - "--disable-doc", - ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(configure_dir=self._source_subfolder, args=conf_args) - return self._autotools + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if not is_msvc(self): + tc.extra_cflags.append("-std=c99") + tc.configure_args.append("--disable-doc") + # Workaround against SIP on macOS + if self.settings.os == "Macos" and self.options.shared: + tc.extra_ldflags.append("-Wl,-rpath,@loader_path/../lib") + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # TODO: use fix_apple_shared_install_name(self) instead, once https://github.com/conan-io/conan/issues/12107 fixed + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "-install_name \\$rpath/", + "-install_name @rpath/") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - autotools = self._configure_autotools() + self._patch_sources() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - os.remove(os.path.join(self.package_folder, "lib", "libtasn1.la")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) def package_info(self): - self.cpp_info.names["pkg_config"] = "libtasn1" + self.cpp_info.set_property("pkg_config_name", "libtasn1") self.cpp_info.libs = ["tasn1"] if not self.options.shared: self.cpp_info.defines = ["ASN1_STATIC"] + # TODO: to remove in conan v2 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/libtasn1/all/test_package/CMakeLists.txt b/recipes/libtasn1/all/test_package/CMakeLists.txt index 2607f861afeb7..7a3bf383182c3 100644 --- a/recipes/libtasn1/all/test_package/CMakeLists.txt +++ b/recipes/libtasn1/all/test_package/CMakeLists.txt @@ -1,12 +1,21 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_program(ASN1_PARSER NAMES asn1Parser) +if(NOT ASN1_PARSER) + message(FATAL_ERROR "asn1Parser not found") +endif() +find_package(libtasn1 REQUIRED CONFIG) -add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pkix_asn1_tab.c" - COMMAND asn1Parser -o "${CMAKE_CURRENT_BINARY_DIR}/pkix_asn1_tab.c" "${CMAKE_CURRENT_SOURCE_DIR}/pkix.asn" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/pkix.asn") +set(PKIX_ASN1_TAB_C "${CMAKE_CURRENT_BINARY_DIR}/pkix_asn1_tab.c") +set(PKIX_ASN_IN "${CMAKE_CURRENT_SOURCE_DIR}/pkix.asn") +add_custom_command( + COMMAND ${ASN1_PARSER} -o ${PKIX_ASN1_TAB_C} ${PKIX_ASN_IN} + OUTPUT ${PKIX_ASN1_TAB_C} + DEPENDS ${PKIX_ASN_IN} +) +add_custom_target(pkix_asn DEPENDS ${PKIX_ASN1_TAB_C}) -add_executable(${PROJECT_NAME} test_package.c "${CMAKE_CURRENT_BINARY_DIR}/pkix_asn1_tab.c") -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} test_package.c ${PKIX_ASN1_TAB_C}) +target_link_libraries(${PROJECT_NAME} PRIVATE libtasn1::libtasn1) +add_dependencies(${PROJECT_NAME} pkix_asn) diff --git a/recipes/libtasn1/all/test_package/conanfile.py b/recipes/libtasn1/all/test_package/conanfile.py index 1c41e93c89e0b..8214a95b5bd16 100644 --- a/recipes/libtasn1/all/test_package/conanfile.py +++ b/recipes/libtasn1/all/test_package/conanfile.py @@ -1,10 +1,22 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,7 +24,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") asn = os.path.join(self.source_folder, "pkix.asn") - self.run("{} {}".format(bin_path, asn), run_environment=True) + self.run(f"{bin_path} {asn}", env="conanrun") diff --git a/recipes/libtasn1/all/test_v1_package/CMakeLists.txt b/recipes/libtasn1/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..717dbb55085ef --- /dev/null +++ b/recipes/libtasn1/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_program(ASN1_PARSER NAMES asn1Parser) +if(NOT ASN1_PARSER) + message(FATAL_ERROR "asn1Parser not found") +endif() +find_package(libtasn1 REQUIRED CONFIG) + +set(PKIX_ASN1_TAB_C "${CMAKE_CURRENT_BINARY_DIR}/pkix_asn1_tab.c") +set(PKIX_ASN_IN "${CMAKE_CURRENT_SOURCE_DIR}/../test_package/pkix.asn") +add_custom_command( + COMMAND ${ASN1_PARSER} -o ${PKIX_ASN1_TAB_C} ${PKIX_ASN_IN} + OUTPUT ${PKIX_ASN1_TAB_C} + DEPENDS ${PKIX_ASN_IN} +) +add_custom_target(pkix_asn DEPENDS ${PKIX_ASN1_TAB_C}) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c ${PKIX_ASN1_TAB_C}) +target_link_libraries(${PROJECT_NAME} PRIVATE libtasn1::libtasn1) +add_dependencies(${PROJECT_NAME} pkix_asn) diff --git a/recipes/libtasn1/all/test_v1_package/conanfile.py b/recipes/libtasn1/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d46bed8f6ac9a --- /dev/null +++ b/recipes/libtasn1/all/test_v1_package/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.build_requires(self.tested_reference_str) + + def build(self): + if not tools.cross_building(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") + asn = os.path.join(self.source_folder, os.pardir, "test_package", "pkix.asn") + self.run(f"{bin_path} {asn}", run_environment=True) From aa66903d52bfc9304ca95c9afef5540d2ef2d40e Mon Sep 17 00:00:00 2001 From: Ayoub Kaanich Date: Mon, 3 Oct 2022 18:25:54 +0200 Subject: [PATCH 289/561] (#12900) Add Windows to pcapplusplus * Add Windows to pcapplusplus * Updates after review * Use libpcap * Revert libpcap and use conan v2 * Use conans.tools for the ones I can't figure out * Fix * Better formatting for msbuild.command * Updates after review * Update recipes/pcapplusplus/all/conanfile.py * Mock wpcap.dll * Use conan v2 style in test * Removed unused tools * Add os check * Update recipes/pcapplusplus/all/test_package/conanfile.py * Update recipes/pcapplusplus/all/conanfile.py * Update conandata to follow the docs * Update recipes/pcapplusplus/all/test_package/conanfile.py * f string * Update recipes/pcapplusplus/all/conanfile.py * Fix flaky md5 failure * Fix the patch format * Different patch for each version * Add TODO for hash-library --- recipes/pcapplusplus/all/conandata.yml | 32 ++++++++++ recipes/pcapplusplus/all/conanfile.py | 62 ++++++++++++++----- .../all/patches/0003-Use-pthreads4w.patch | 18 ++++++ .../all/patches/0004-Fix-md5-include.patch | 11 ++++ .../all/patches/0005-Fix-md5-include.patch | 11 ++++ .../all/patches/0006-Fix-md5-include.patch | 11 ++++ .../all/test_package/conanfile.py | 26 +++++++- 7 files changed, 153 insertions(+), 18 deletions(-) create mode 100644 recipes/pcapplusplus/all/patches/0003-Use-pthreads4w.patch create mode 100644 recipes/pcapplusplus/all/patches/0004-Fix-md5-include.patch create mode 100644 recipes/pcapplusplus/all/patches/0005-Fix-md5-include.patch create mode 100644 recipes/pcapplusplus/all/patches/0006-Fix-md5-include.patch diff --git a/recipes/pcapplusplus/all/conandata.yml b/recipes/pcapplusplus/all/conandata.yml index 1151fcbdcc93d..9786a06e3c7e2 100644 --- a/recipes/pcapplusplus/all/conandata.yml +++ b/recipes/pcapplusplus/all/conandata.yml @@ -11,10 +11,42 @@ sources: patches: "21.05": - patch_file: "patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch" + patch_description: Pass CXXFLAGS and CPPFLAGS when-compiling 3rd party source + patch_type: conan base_path: "source_subfolder" + - patch_file: "patches/0003-Use-pthreads4w.patch" + patch_description: Use pthreads4w from conan center + patch_type: conan + base_path: "source_subfolder" + - patch_file: patches/0004-Fix-md5-include.patch + patch_description: Fix md5 include configuration + patch_type: conan + base_path: source_subfolder + "21.11": - patch_file: "patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch" + patch_description: Pass CXXFLAGS and CPPFLAGS when-compiling 3rd party source + patch_type: conan + base_path: "source_subfolder" + - patch_file: "patches/0003-Use-pthreads4w.patch" + patch_description: Use pthreads4w from conan center + patch_type: conan base_path: "source_subfolder" + - patch_file: patches/0005-Fix-md5-include.patch + patch_description: Fix md5 include configuration + patch_type: conan + base_path: source_subfolder + "22.05": - patch_file: "patches/0002-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch" + patch_description: Pass CXXFLAGS and CPPFLAGS when-compiling 3rd party source + patch_type: conan + base_path: "source_subfolder" + - patch_file: "patches/0003-Use-pthreads4w.patch" + patch_description: Use pthreads4w from conan center + patch_type: conan base_path: "source_subfolder" + - patch_file: patches/0006-Fix-md5-include.patch + patch_description: Fix md5 include configuration + patch_type: conan + base_path: source_subfolder diff --git a/recipes/pcapplusplus/all/conanfile.py b/recipes/pcapplusplus/all/conanfile.py index fc609f1bf6207..ef9a8444da061 100644 --- a/recipes/pcapplusplus/all/conanfile.py +++ b/recipes/pcapplusplus/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools import files +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +from conans import AutoToolsBuildEnvironment, tools +# It has to be this one, the one from conan.tools.microsoft does not pass toolset +from conans import MSBuild import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" class PcapplusplusConan(ConanFile): @@ -34,19 +39,24 @@ def config_options(self): del self.options.fPIC def requirements(self): - if self.settings.os != "Windows": + if self.settings.os == "Windows": + self.requires("pthreads4w/3.0.0") + self.requires("npcap/1.70") + else: self.requires("libpcap/1.9.1") + # TODO: use conan recipe instead of embedded one + # self.requires("hash-library/8.0") + def validate(self): - if self.settings.os == "Windows": - # FIXME: missing winpcap recipe (https://github.com/bincrafters/community/pull/1395) - raise ConanInvalidConfiguration("Can not build on Windows: Winpcap is not available on cci (yet).") - if self.settings.os not in ("FreeBSD", "Linux", "Macos"): - raise ConanInvalidConfiguration("%s is not supported" % self.settings.os) + if self.settings.os == "Windows" and not is_msvc(self): + raise ConanInvalidConfiguration("Can not build on Windows: only msvc compiler is supported.") + if self.settings.os not in ("FreeBSD", "Linux", "Macos", "Windows"): + raise ConanInvalidConfiguration(f"{self.settings.os} is not supported") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + files.get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) @property def _configure_sh_script(self): @@ -58,15 +68,34 @@ def _configure_sh_script(self): }[str(self.settings.os)] def _patch_sources(self): - if not self.options.get_safe("fPIC"): - tools.replace_in_file(os.path.join(self._source_subfolder, "PcapPlusPlus.mk.common"), + if not self.options.get_safe("fPIC") and self.settings.os != "Windows": + files.replace_in_file(self, os.path.join(self._source_subfolder, "PcapPlusPlus.mk.common"), "-fPIC", "") for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + files.patch(self, **patch) def build(self): self._patch_sources() - with tools.chdir(self._source_subfolder): + if self.settings.os == "Windows": + self._build_windows() + else: + self._build_posix() + + def _build_windows(self): + with files.chdir(self, self._source_subfolder): + config_args = [ + "configure-windows-visual-studio.bat", + "--pcap-sdk", self.deps_cpp_info["npcap"].rootpath, + "--pthreads-home", self.deps_cpp_info["pthreads4w"].rootpath, + "--vs-version", "vs2015", + ] + self.run(" ".join(config_args), run_environment=True) + msbuild = MSBuild(self) + targets = ['Common++', 'Packet++', 'Pcap++'] + msbuild.build("mk/vs2015/PcapPlusPlus.sln", targets=targets) + + def _build_posix(self): + with files.chdir(self, self._source_subfolder): config_args = [ "./{}".format(self._configure_sh_script), "--libpcap-include-dir", tools.unix_path(self.deps_cpp_info["libpcap"].include_paths[0]), @@ -87,6 +116,7 @@ def package(self): self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder, keep_path=False) self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "Dist", "header")) self.copy("*.a", dst="lib", src=os.path.join(self._source_subfolder, "Dist"), keep_path=False) + self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "Dist"), keep_path=False) def package_info(self): self.cpp_info.libs = ["Pcap++", "Packet++", "Common++"] @@ -94,3 +124,5 @@ def package_info(self): self.cpp_info.system_libs.append("pthread") if self.settings.os == "Macos": self.cpp_info.frameworks.extend(["CoreFoundation", "Security", "SystemConfiguration"]) + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/pcapplusplus/all/patches/0003-Use-pthreads4w.patch b/recipes/pcapplusplus/all/patches/0003-Use-pthreads4w.patch new file mode 100644 index 0000000000000..d44a98ef07be3 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0003-Use-pthreads4w.patch @@ -0,0 +1,18 @@ +--- mk/vs/PcapPlusPlusPropertySheet.props.template ++++ mk/vs/PcapPlusPlusPropertySheet.props.template +@@ -23,12 +23,11 @@ + + + +- $(PThreadWin32Home)\Pre-built.2\include;%(AdditionalIncludeDirectories) ++ $(PThreadWin32Home)\include;%(AdditionalIncludeDirectories) + HAVE_STRUCT_TIMESPEC;%(PreprocessorDefinitions) + + +- $(PThreadWin32Home)\Pre-built.2\lib\x86;%(AdditionalLibraryDirectories) +- $(PThreadWin32Home)\Pre-built.2\lib\x64;%(AdditionalLibraryDirectories) ++ $(PThreadWin32Home)\lib;%(AdditionalLibraryDirectories) +- pthreadVC2.lib;%(AdditionalDependencies) ++ pthreadVC3.lib;%(AdditionalDependencies) + + diff --git a/recipes/pcapplusplus/all/patches/0004-Fix-md5-include.patch b/recipes/pcapplusplus/all/patches/0004-Fix-md5-include.patch new file mode 100644 index 0000000000000..4232648a089d4 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0004-Fix-md5-include.patch @@ -0,0 +1,11 @@ +--- mk/vs/Packet++.vcxproj.template ++++ mk/vs/Packet++.vcxproj.template +@@ -271,7 +271,7 @@ + + + +- ++ + + + diff --git a/recipes/pcapplusplus/all/patches/0005-Fix-md5-include.patch b/recipes/pcapplusplus/all/patches/0005-Fix-md5-include.patch new file mode 100644 index 0000000000000..4bb47fbc85d17 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0005-Fix-md5-include.patch @@ -0,0 +1,11 @@ +--- mk/vs/Packet++.vcxproj.template ++++ mk/vs/Packet++.vcxproj.template +@@ -273,7 +273,7 @@ + + + +- ++ + + + diff --git a/recipes/pcapplusplus/all/patches/0006-Fix-md5-include.patch b/recipes/pcapplusplus/all/patches/0006-Fix-md5-include.patch new file mode 100644 index 0000000000000..115ab8bfc2026 --- /dev/null +++ b/recipes/pcapplusplus/all/patches/0006-Fix-md5-include.patch @@ -0,0 +1,11 @@ +--- mk/vs/Packet++.vcxproj.template ++++ mk/vs/Packet++.vcxproj.template +@@ -275,7 +275,7 @@ + + + +- ++ + + + diff --git a/recipes/pcapplusplus/all/test_package/conanfile.py b/recipes/pcapplusplus/all/test_package/conanfile.py index 83cd7c3b3fe37..877f6f7b6d86a 100644 --- a/recipes/pcapplusplus/all/test_package/conanfile.py +++ b/recipes/pcapplusplus/all/test_package/conanfile.py @@ -1,18 +1,38 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conans import CMake import os +import shutil class PcapplusplusTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + if can_run(self) and self.settings.os == "Windows": + self.requires("libpcap/1.10.1") + + def configure(self): + if can_run(self) and self.settings.os == "Windows": + self.options["libpcap"].shared = True + def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): + if self.settings.os == "Windows": + # Use libpcap DLL as a replacement for npcap DLL + # It will not provide all the functions + # but it will cover enough to check that what we compiled is correct + shutil.copy( + os.path.join(self.deps_cpp_info['libpcap'].bin_paths[0], "pcap.dll"), + os.path.join("bin", "wpcap.dll") + ) bin_path = os.path.join("bin", "test_package") pcap_file_path = os.path.join(self.source_folder, "1_packet.pcap") - self.run("{0} {1}".format(bin_path, pcap_file_path), run_environment=True) + self.run(f"{bin_path} {pcap_file_path}", run_environment=True) From b66f6d2f59f0b3d22df4c058482433af66c06af0 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 4 Oct 2022 03:24:32 +0900 Subject: [PATCH 290/561] (#13281) unordered_dense: add version 1.4.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/unordered_dense/all/conandata.yml | 3 +++ recipes/unordered_dense/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml index dd610968822a9..f0988e9e8da6d 100644 --- a/recipes/unordered_dense/all/conandata.yml +++ b/recipes/unordered_dense/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.0": + url: "https://github.com/martinus/unordered_dense/archive/v1.4.0.tar.gz" + sha256: "36b6bfe2fe2633f9d9c537b9b808b4be6b77ff51c66d370d855f477517bc3bc9" "1.3.3": url: "https://github.com/martinus/unordered_dense/archive/v1.3.3.tar.gz" sha256: "621a984d7f1de156d3078ecb5e1252bcc2ebc875de6eb6b8635f6c2a0898e496" diff --git a/recipes/unordered_dense/config.yml b/recipes/unordered_dense/config.yml index 1334fb71cef79..bdcc47cf69afb 100644 --- a/recipes/unordered_dense/config.yml +++ b/recipes/unordered_dense/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.0": + folder: all "1.3.3": folder: all "1.3.2": From 5225f30ee00d5f295419dc632cd29d4491a9d394 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 4 Oct 2022 16:04:18 +0900 Subject: [PATCH 291/561] (#13291) aws-c-sdkutils: add version 0.1.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/aws-c-sdkutils/all/conandata.yml | 3 +++ recipes/aws-c-sdkutils/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/aws-c-sdkutils/all/conandata.yml b/recipes/aws-c-sdkutils/all/conandata.yml index a2d7aa973057e..7ec4906cf9a7f 100644 --- a/recipes/aws-c-sdkutils/all/conandata.yml +++ b/recipes/aws-c-sdkutils/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.3": + url: "https://github.com/awslabs/aws-c-sdkutils/archive/v0.1.3.tar.gz" + sha256: "13d99c0877424a8fad40f312762968012dd54ec60a4438fb601ee65ff8b2484b" "0.1.2": url: "https://github.com/awslabs/aws-c-sdkutils/archive/refs/tags/v0.1.2.tar.gz" sha256: "d654670c145212ed3ce0699a988b9f83ebf3e7c44ed74d4d0772dc95ad46b38e" diff --git a/recipes/aws-c-sdkutils/config.yml b/recipes/aws-c-sdkutils/config.yml index eb8addc0ca6d3..b2ced6f0d7ab7 100644 --- a/recipes/aws-c-sdkutils/config.yml +++ b/recipes/aws-c-sdkutils/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.3": + folder: all "0.1.2": folder: all "0.1.1": From 310de28c35aa94303b22da95152b5e285bb301ad Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 4 Oct 2022 19:24:31 +0900 Subject: [PATCH 292/561] (#13295) aws-c-common: add version 0.8.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/aws-c-common/all/conandata.yml | 3 +++ recipes/aws-c-common/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/aws-c-common/all/conandata.yml b/recipes/aws-c-common/all/conandata.yml index 26e66ad5a8e95..773702bbe2c98 100644 --- a/recipes/aws-c-common/all/conandata.yml +++ b/recipes/aws-c-common/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.2": + url: "https://github.com/awslabs/aws-c-common/archive/v0.8.2.tar.gz" + sha256: "36edc6e486c43bbb34059dde227e872c0d41ab54f0b3609d38f188cfbbc6d1f8" "0.7.5": url: "https://github.com/awslabs/aws-c-common/archive/v0.7.5.tar.gz" sha256: "e34fd3d3d32e3597f572205aaabbe995e162f4015e14c7328987b596bd25812c" diff --git a/recipes/aws-c-common/config.yml b/recipes/aws-c-common/config.yml index 6664f0d33a038..5a8e794412c2f 100644 --- a/recipes/aws-c-common/config.yml +++ b/recipes/aws-c-common/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.2": + folder: all "0.7.5": folder: all "0.7.4": From c9955dd23b79240dd72e2c773faee442f11e9d53 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Tue, 4 Oct 2022 12:24:19 +0100 Subject: [PATCH 293/561] (#13298) libtasn1: Restore ability to run test_v1_package when cross-building --- recipes/libtasn1/all/test_v1_package/CMakeLists.txt | 6 +++++- recipes/libtasn1/all/test_v1_package/conanfile.py | 7 +++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/recipes/libtasn1/all/test_v1_package/CMakeLists.txt b/recipes/libtasn1/all/test_v1_package/CMakeLists.txt index 717dbb55085ef..a27809d08ee69 100644 --- a/recipes/libtasn1/all/test_v1_package/CMakeLists.txt +++ b/recipes/libtasn1/all/test_v1_package/CMakeLists.txt @@ -4,7 +4,11 @@ project(test_package LANGUAGES C) include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") conan_basic_setup(TARGETS) -find_program(ASN1_PARSER NAMES asn1Parser) +# Note: See https://github.com/conan-io/conan/issues/12237 +# `NO_CMAKE_PATH` is added to avoid searching in `CMAKE_PREFIX_PATH` +# it should find the correct executable by falling back on the `PATH` +# environment variable defined by Conan during the test_package run. +find_program(ASN1_PARSER NAMES asn1Parser NO_CMAKE_PATH) if(NOT ASN1_PARSER) message(FATAL_ERROR "asn1Parser not found") endif() diff --git a/recipes/libtasn1/all/test_v1_package/conanfile.py b/recipes/libtasn1/all/test_v1_package/conanfile.py index d46bed8f6ac9a..4056b294e223c 100644 --- a/recipes/libtasn1/all/test_v1_package/conanfile.py +++ b/recipes/libtasn1/all/test_v1_package/conanfile.py @@ -14,10 +14,9 @@ def build_requirements(self): self.build_requires(self.tested_reference_str) def build(self): - if not tools.cross_building(self): - cmake = CMake(self) - cmake.configure() - cmake.build() + cmake = CMake(self) + cmake.configure() + cmake.build() def test(self): if not tools.cross_building(self): From bb6041bbaec076d2b1aa7d493484e1041633a743 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 4 Oct 2022 13:45:26 +0200 Subject: [PATCH 294/561] (#13261) libspng: conan v2 support + fix with_miniz option + remove unofficial cmake names * conan v2 support * fix with_miniz option --- recipes/libspng/all/CMakeLists.txt | 9 --- recipes/libspng/all/conandata.yml | 5 +- recipes/libspng/all/conanfile.py | 77 ++++++++++--------- ...patch => 0.7.2-0001-fix-dll-install.patch} | 5 +- .../all/patches/0.7.2-0002-allow-miniz.patch | 62 +++++++++++++++ .../libspng/all/test_package/CMakeLists.txt | 9 +-- recipes/libspng/all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../libspng/all/test_v1_package/conanfile.py | 17 ++++ 9 files changed, 148 insertions(+), 67 deletions(-) delete mode 100644 recipes/libspng/all/CMakeLists.txt rename recipes/libspng/all/patches/{0.7.2-001-fix-install-path.patch => 0.7.2-0001-fix-dll-install.patch} (74%) create mode 100644 recipes/libspng/all/patches/0.7.2-0002-allow-miniz.patch create mode 100644 recipes/libspng/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libspng/all/test_v1_package/conanfile.py diff --git a/recipes/libspng/all/CMakeLists.txt b/recipes/libspng/all/CMakeLists.txt deleted file mode 100644 index 9fb44bd9403ba..0000000000000 --- a/recipes/libspng/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory("source_subfolder") diff --git a/recipes/libspng/all/conandata.yml b/recipes/libspng/all/conandata.yml index 2ca5a76f3d406..7ca9b017ec8e0 100644 --- a/recipes/libspng/all/conandata.yml +++ b/recipes/libspng/all/conandata.yml @@ -2,8 +2,7 @@ sources: "0.7.2": url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.2.tar.gz" sha256: "4acf25571d31f540d0b7ee004f5461d68158e0a13182505376805da99f4ccc4e" - patches: "0.7.2": - - patch_file: "patches/0.7.2-001-fix-install-path.patch" - base_path: "source_subfolder" + - patch_file: "patches/0.7.2-0001-fix-dll-install.patch" + - patch_file: "patches/0.7.2-0002-allow-miniz.patch" diff --git a/recipes/libspng/all/conanfile.py b/recipes/libspng/all/conanfile.py index c675ae7423eb5..10a36008cb491 100644 --- a/recipes/libspng/all/conanfile.py +++ b/recipes/libspng/all/conanfile.py @@ -1,8 +1,10 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import os -import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" + class LibspngConan(ConanFile): name = "libspng" @@ -22,16 +24,9 @@ class LibspngConan(ConanFile): "fPIC": True, "with_miniz": False, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,9 +34,21 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_miniz: @@ -50,41 +57,35 @@ def requirements(self): self.requires("zlib/1.2.12") 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], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["SPNG_SHARED"] = self.options.shared - cmake.definitions["SPNG_STATIC"] = not self.options.shared - cmake.definitions["BUILD_EXAMPLES"] = False - cmake.definitions["CMAKE_C_FLAGS"] = "-DSPNG_USE_MINIZ" if self.options.with_miniz else "" - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SPNG_SHARED"] = self.options.shared + tc.variables["SPNG_STATIC"] = not self.options.shared + tc.variables["SPNG_USE_MINIZ"] = self.options.with_miniz + tc.variables["BUILD_EXAMPLES"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses", ignore_case=True, keep_path=False) - 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "spng") - self.cpp_info.set_property("cmake_target_name", "spng::spng") - - self.cpp_info.names["cmake_find_package"] = "spng" - self.cpp_info.names["cmake_find_package_multi"] = "spng" - + self.cpp_info.set_property("pkg_config_name", "libspng") if not self.options.shared: self.cpp_info.defines = ["SPNG_STATIC"] - self.cpp_info.libs = ["spng"] if self.options.shared else ["spng_static"] if self.settings.os in ["Linux", "Android", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/libspng/all/patches/0.7.2-001-fix-install-path.patch b/recipes/libspng/all/patches/0.7.2-0001-fix-dll-install.patch similarity index 74% rename from recipes/libspng/all/patches/0.7.2-001-fix-install-path.patch rename to recipes/libspng/all/patches/0.7.2-0001-fix-dll-install.patch index 11d9b590d773f..223612a7c7b6c 100644 --- a/recipes/libspng/all/patches/0.7.2-001-fix-install-path.patch +++ b/recipes/libspng/all/patches/0.7.2-0001-fix-dll-install.patch @@ -1,8 +1,6 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a50a31b..478ea43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -32,7 +32,13 @@ endif() +@@ -32,7 +32,12 @@ endif() if(SPNG_SHARED) add_library(spng SHARED ${spng_SOURCES}) target_link_libraries(spng ${spng_LIBS}) @@ -12,7 +10,6 @@ index a50a31b..478ea43 100644 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) if(BUILD_EXAMPLES) diff --git a/recipes/libspng/all/patches/0.7.2-0002-allow-miniz.patch b/recipes/libspng/all/patches/0.7.2-0002-allow-miniz.patch new file mode 100644 index 0000000000000..7393b3d483583 --- /dev/null +++ b/recipes/libspng/all/patches/0.7.2-0002-allow-miniz.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.0) ++cmake_minimum_required(VERSION 3.1) + + project(libspng C) + +@@ -10,19 +10,24 @@ set(SPNG_VERSION ${SPNG_MAJOR}.${SPNG_MINOR}.${SPNG_REVISION}) + option(ENABLE_OPT "Enable architecture-specific optimizations" ON) + option(SPNG_SHARED "Build shared lib" ON) + option(SPNG_STATIC "Build static lib" ON) ++option(SPNG_USE_MINIZ "Use Miniz instead of zlib" OFF) + option(BUILD_EXAMPLES "Build examples" ON) + + include(GNUInstallDirs) + +-find_package(ZLIB REQUIRED) +-include_directories(${ZLIB_INCLUDE_DIRS}) ++if(SPNG_USE_MINIZ) ++ find_package(miniz REQUIRED) ++ set(spng_LIBS miniz::miniz) ++else() ++ find_package(ZLIB REQUIRED) ++ set(spng_LIBS ZLIB::ZLIB) ++endif() + + set(spng_SOURCES spng/spng.c) + +-if(NOT CMAKE_HOST_WIN32) +- set(spng_LIBS -lm ${ZLIB_LIBRARIES}) +-else() +- set(spng_LIBS ${ZLIB_LIBRARIES}) ++find_library(LIBM NAMES m) ++if(LIBM) ++ list(APPEND spng_LIBS ${LIBM}) + endif() + + if(NOT ENABLE_OPT) +@@ -31,7 +36,10 @@ endif() + + if(SPNG_SHARED) + add_library(spng SHARED ${spng_SOURCES}) +- target_link_libraries(spng ${spng_LIBS}) ++ target_link_libraries(spng PRIVATE ${spng_LIBS}) ++ if(SPNG_USE_MINIZ) ++ target_compile_definitions(spng PRIVATE SPNG_USE_MINIZ) ++ endif() + install( + TARGETS spng + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +@@ -48,6 +56,10 @@ endif() + + if(SPNG_STATIC) + add_library(spng_static STATIC ${spng_SOURCES}) ++ target_link_libraries(spng_static PRIVATE ${spng_LIBS}) ++ if(SPNG_USE_MINIZ) ++ target_compile_definitions(spng_static PRIVATE SPNG_USE_MINIZ) ++ endif() + target_compile_definitions(spng_static PUBLIC SPNG_STATIC) + install(TARGETS spng_static DESTINATION lib) + endif() diff --git a/recipes/libspng/all/test_package/CMakeLists.txt b/recipes/libspng/all/test_package/CMakeLists.txt index a213a99dfd093..c8aa2ff46daf5 100644 --- a/recipes/libspng/all/test_package/CMakeLists.txt +++ b/recipes/libspng/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(spng REQUIRED CONFIG) +find_package(libspng REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} spng::spng) +target_link_libraries(${PROJECT_NAME} PRIVATE libspng::libspng) diff --git a/recipes/libspng/all/test_package/conanfile.py b/recipes/libspng/all/test_package/conanfile.py index bc2891a1b03a7..0a6bc68712d90 100644 --- a/recipes/libspng/all/test_package/conanfile.py +++ b/recipes/libspng/all/test_package/conanfile.py @@ -1,12 +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, cmake_layout import os -import re -import subprocess class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -14,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libspng/all/test_v1_package/CMakeLists.txt b/recipes/libspng/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2403e44b66447 --- /dev/null +++ b/recipes/libspng/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libspng REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libspng::libspng) diff --git a/recipes/libspng/all/test_v1_package/conanfile.py b/recipes/libspng/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libspng/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 8d4ccebc7b9e08a3f27118946c2bdebc8a72501b Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 4 Oct 2022 14:44:55 +0200 Subject: [PATCH 295/561] (#13106) nss/3.83 * nss/3.83 * restrict nss 3.83 to gcc >= 11 * Update conanfile.py * bump nspr and sqlite * Update conanfile.py * Update conanfile.py * Update conanfile.py * Update conanfile.py * Update conanfile.py --- recipes/nss/all/conandata.yml | 3 +++ recipes/nss/all/conanfile.py | 50 ++++++++++++++++++++--------------- recipes/nss/config.yml | 2 ++ 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/recipes/nss/all/conandata.yml b/recipes/nss/all/conandata.yml index 3b0108b7efb89..e36371650f732 100644 --- a/recipes/nss/all/conandata.yml +++ b/recipes/nss/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.83": + url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_83_RTM/src/nss-3.83.tar.gz" + sha256: "ab23ea67f964090b8b73c80a674082571c36e5f4eba92057ac648c9c1def0128" "3.77": url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_77_RTM/src/nss-3.77.tar.gz" sha256: "825edf5a2fd35b788a23ff80face591f82919ae3ad2b8f77d424a450d618dedd" diff --git a/recipes/nss/all/conanfile.py b/recipes/nss/all/conanfile.py index 902bc8ad356a9..8eb8f8f823b88 100644 --- a/recipes/nss/all/conanfile.py +++ b/recipes/nss/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import msvc_runtime_flag -import os, glob +from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, get, chdir, rename, rm +from conan.tools.build import cross_building +from conans import tools +import os +import glob +required_conan_version = ">=1.51.3" class NSSConan(ConanFile): name = "nss" @@ -30,7 +36,7 @@ def build_requirements(self): if self.settings.os == "Windows": self.build_requires("mozilla-build/3.3") if hasattr(self, "settings_build"): - self.build_requires("sqlite3/3.38.1") + self.build_requires("sqlite3/3.39.3") def configure(self): self.options["nspr"].shared = True @@ -42,8 +48,8 @@ def configure(self): del self.settings.compiler.cppstd def requirements(self): - self.requires("nspr/4.33") - self.requires("sqlite3/3.38.1") + self.requires("nspr/4.35") + self.requires("sqlite3/3.39.3") self.requires("zlib/1.2.12") def validate(self): @@ -57,10 +63,16 @@ def validate(self): raise ConanInvalidConfiguration("NSS cannot link to static sqlite. Please use option sqlite3:shared=True") if self.settings.arch in ["armv8", "armv8.3"] and self.settings.os in ["Macos"]: raise ConanInvalidConfiguration("Macos ARM64 builds not yet supported. Contributions are welcome.") + if Version(self.version) >= "3.83": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 11: + raise ConanInvalidConfiguration("nss requires at least gcc 11.") + if Version(self.version) < "3.74": + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= 13: + raise ConanInvalidConfiguration("nss < 3.74 requires clang < 13 .") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) @property def _make_args(self): @@ -131,7 +143,7 @@ def _format_libraries(libraries, settings): library += ".lib" result.append(library) else: - result.append("-l%s" % library) + result.append(f"-l{library}") return result @@ -143,21 +155,20 @@ def _format_libraries(libraries, settings): args.append("SQLITE_INCLUDE_DIR=%s" % self.deps_cpp_info["sqlite3"].include_paths[0]) args.append("SQLITE_LIB_DIR=%s" % self.deps_cpp_info["sqlite3"].lib_paths[0]) args.append("NSDISTMODE=copy") - if tools.cross_building(self): + if cross_building(self): args.append("CROSS_COMPILE=1") return args def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(os.path.join(self._source_subfolder, "nss")): + apply_conandata_patches(self) + with chdir(self, os.path.join(self._source_subfolder, "nss")): with tools.vcvars(self) if self.settings.compiler == "Visual Studio" else tools.no_op(): self.run("make %s" % " ".join(self._make_args), run_environment=True) def package(self): self.copy("COPYING", src = os.path.join(self._source_subfolder, "nss"), dst = "licenses") - with tools.chdir(os.path.join(self._source_subfolder, "nss")): + with chdir(self, os.path.join(self._source_subfolder, "nss")): self.run("make install %s" % " ".join(self._make_args)) self.copy("*", src=os.path.join(self._source_subfolder, "dist", "public", "nss"), @@ -171,23 +182,20 @@ def package(self): self.copy("*", src = f) for dll_file in glob.glob(os.path.join(self.package_folder, "lib", "*.dll")): - tools.rename(dll_file, os.path.join(self.package_folder, "bin", os.path.basename(dll_file))) + rename(self, dll_file, os.path.join(self.package_folder, "bin", os.path.basename(dll_file))) if self.options.shared: - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.a") + rm(self, "*.a", os.path.join(self.package_folder, "lib")) else: - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.so") - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.dll") + rm(self, "*.so", os.path.join(self.package_folder, "lib")) + rm(self, "*.dll", os.path.join(self.package_folder, "bin")) def package_info(self): def _library_name(lib,vers): - if self.options.shared: - return "%s%s" % (lib,vers) - else: - return lib + return f"{lib}{vers}" if self.options.shared else lib self.cpp_info.components["libnss"].libs.append(_library_name("nss", 3)) self.cpp_info.components["libnss"].requires = ["nssutil", "nspr::nspr"] diff --git a/recipes/nss/config.yml b/recipes/nss/config.yml index a60acb1f0ed26..4dc342831041e 100644 --- a/recipes/nss/config.yml +++ b/recipes/nss/config.yml @@ -1,4 +1,6 @@ versions: + "3.83": + folder: all "3.77": folder: all "3.76.1": From 7da1e9c0dd6d7f30870dadac528a75236ff4805b Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 4 Oct 2022 22:04:07 +0900 Subject: [PATCH 296/561] (#13170) svector: add recipe * svector: add recipe * fix description, license * remove unused function * remove comment of template Co-authored-by: Uilian Ries * use `self.info.settings` Co-authored-by: Uilian Ries * use self.settings instead of self.info.settings (workaround) Co-authored-by: Uilian Ries --- recipes/svector/all/conandata.yml | 4 ++ recipes/svector/all/conanfile.py | 65 +++++++++++++++++++ .../svector/all/test_package/CMakeLists.txt | 9 +++ recipes/svector/all/test_package/conanfile.py | 26 ++++++++ .../svector/all/test_package/test_package.cpp | 11 ++++ .../all/test_v1_package/CMakeLists.txt | 12 ++++ .../svector/all/test_v1_package/conanfile.py | 18 +++++ recipes/svector/config.yml | 3 + 8 files changed, 148 insertions(+) create mode 100644 recipes/svector/all/conandata.yml create mode 100644 recipes/svector/all/conanfile.py create mode 100644 recipes/svector/all/test_package/CMakeLists.txt create mode 100644 recipes/svector/all/test_package/conanfile.py create mode 100644 recipes/svector/all/test_package/test_package.cpp create mode 100644 recipes/svector/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/svector/all/test_v1_package/conanfile.py create mode 100644 recipes/svector/config.yml diff --git a/recipes/svector/all/conandata.yml b/recipes/svector/all/conandata.yml new file mode 100644 index 0000000000000..876425a447ec4 --- /dev/null +++ b/recipes/svector/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.2": + url: "https://github.com/martinus/svector/archive/refs/tags/v1.0.2.tar.gz" + sha256: "317743113aff89c7c11682ad7ed504a043885be7497f791cb393ba5a7a8d3c41" diff --git a/recipes/svector/all/conanfile.py b/recipes/svector/all/conanfile.py new file mode 100644 index 0000000000000..68edc50346896 --- /dev/null +++ b/recipes/svector/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout + +import os + +required_conan_version = ">=1.52.0" + +class PackageConan(ConanFile): + name = "svector" + description = "Compact SVO optimized vector for C++17 or higher" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinus/svector" + topics = ("vector", "container", "small-vector", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + # FIXME: self.info.settings.compiler does not work with header-only packages + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/svector/all/test_package/CMakeLists.txt b/recipes/svector/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..38ea734d2c8a7 --- /dev/null +++ b/recipes/svector/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(svector REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE svector::svector) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/svector/all/test_package/conanfile.py b/recipes/svector/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/svector/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/svector/all/test_package/test_package.cpp b/recipes/svector/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3e0125d432c37 --- /dev/null +++ b/recipes/svector/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include "ankerl/svector.h" + +int main(void) { + auto vec = ankerl::svector(); + for (int i = 0; i < 100; ++i) { + vec.push_back(i); + } + auto data = vec.data(); + + return 0; +} diff --git a/recipes/svector/all/test_v1_package/CMakeLists.txt b/recipes/svector/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..33ce3d62f2939 --- /dev/null +++ b/recipes/svector/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(svector REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE svector::svector) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/svector/all/test_v1_package/conanfile.py b/recipes/svector/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/svector/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/svector/config.yml b/recipes/svector/config.yml new file mode 100644 index 0000000000000..8457ca9a4a8cd --- /dev/null +++ b/recipes/svector/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.2": + folder: all From 856714cd5c4316a1d3b47a67f11acca673fe4b6b Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 4 Oct 2022 22:24:57 +0900 Subject: [PATCH 297/561] (#13253) arsenalgear: add version 2.0.1 and support conan v2 * arsenalgear: add version 2.0.1 and support conan v2 * remove boost and exprtk in 2.0.1 --- recipes/arsenalgear/all/CMakeLists.txt | 45 ++++----- recipes/arsenalgear/all/conandata.yml | 3 + recipes/arsenalgear/all/conanfile.py | 94 ++++++++++--------- .../all/test_package/CMakeLists.txt | 7 +- .../arsenalgear/all/test_package/conanfile.py | 20 ++-- .../all/test_v1_package/CMakeLists.txt | 12 +++ .../all/test_v1_package/conanfile.py | 18 ++++ recipes/arsenalgear/config.yml | 2 + 8 files changed, 127 insertions(+), 74 deletions(-) create mode 100644 recipes/arsenalgear/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/arsenalgear/all/test_v1_package/conanfile.py diff --git a/recipes/arsenalgear/all/CMakeLists.txt b/recipes/arsenalgear/all/CMakeLists.txt index 595b8c7314510..3656fbcc9d3a0 100644 --- a/recipes/arsenalgear/all/CMakeLists.txt +++ b/recipes/arsenalgear/all/CMakeLists.txt @@ -1,35 +1,34 @@ cmake_minimum_required(VERSION 3.8) project(arsenalgear LANGUAGES CXX) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - include(GNUInstallDirs) -set(arsenalgear_src - source_subfolder/src/operators.cpp - source_subfolder/src/stream.cpp - source_subfolder/src/system.cpp - source_subfolder/src/utils.cpp -) - -set(arsenalgear_inc - source_subfolder/include/constants.hpp - source_subfolder/include/math.hpp - source_subfolder/include/operators.hpp - source_subfolder/include/stream.hpp - source_subfolder/include/system.hpp - source_subfolder/include/utils.hpp -) - add_library(arsenalgear ${arsenalgear_src}) -target_include_directories(arsenalgear PRIVATE "source_subfolder/include") +target_sources(arsenalgear PRIVATE + $<$: + ${ARSENALGEAR_SRC_DIR}/src/operators.cpp + > + ${ARSENALGEAR_SRC_DIR}/src/stream.cpp + ${ARSENALGEAR_SRC_DIR}/src/system.cpp + ${ARSENALGEAR_SRC_DIR}/src/utils.cpp +) +target_include_directories(arsenalgear PRIVATE "${ARSENALGEAR_SRC_DIR}/include") set_target_properties(arsenalgear PROPERTIES PUBLIC_HEADER "${arsenalgear_inc}" WINDOWS_EXPORT_ALL_SYMBOLS ON ) target_compile_features(arsenalgear PUBLIC cxx_std_17) +if(${ARSENALGEAR_VERSION} VERSION_LESS 2.0.0) + find_package(Boost REQUIRED CONFIG) + target_link_libraries(arsenalgear PUBLIC Boost::headers) + + find_package(exprtk CONFIG) + if(${exprtk_FOUND}) + target_link_libraries(arsenalgear PUBLIC exprtk::exprtk) + endif() +endif() + find_library(LIBM m) target_link_libraries(arsenalgear PRIVATE $<$:${LIBM}>) @@ -38,5 +37,9 @@ install( RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arsenalgear +) + +install( + DIRECTORY ${ARSENALGEAR_SRC_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arsenalgear ) diff --git a/recipes/arsenalgear/all/conandata.yml b/recipes/arsenalgear/all/conandata.yml index 99ab6ba4966e7..b30bf921ec7e0 100644 --- a/recipes/arsenalgear/all/conandata.yml +++ b/recipes/arsenalgear/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.1": + url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v2.0.1.tar.gz" + sha256: "d0fa1639abb3c41aa60e596b9d70966281a1206c5527b34a4526f6577c3bac6f" "1.2.2": url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v1.2.2.tar.gz" sha256: "556155d0be0942bcdd5df02fcda258579915e76b5a70e7220de6ef38c8ca7779" diff --git a/recipes/arsenalgear/all/conanfile.py b/recipes/arsenalgear/all/conanfile.py index 2edad27f8a72e..5a83b05e8d8a5 100644 --- a/recipes/arsenalgear/all/conanfile.py +++ b/recipes/arsenalgear/all/conanfile.py @@ -1,9 +1,14 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc -import functools +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -required_conan_version = ">=1.45.0" +import os + +required_conan_version = ">=1.52.0" class ArsenalgearConan(ConanFile): name = "arsenalgear" @@ -21,14 +26,22 @@ class ArsenalgearConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "gcc": "8", + "clang": "7", + "apple-clang": "12.0", + } def export_sources(self): - self.copy("CMakeLists.txt") + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -36,54 +49,51 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - def requirements(self): - self.requires("boost/1.79.0") - if self.settings.os in ["Linux", "Macos"]: - self.requires("exprtk/0.0.1") + def layout(self): + cmake_layout(self, src_folder="src") - @property - def _compiler_required_cpp17(self): - return { - "Visual Studio": "16", - "gcc": "8", - "clang": "7", - "apple-clang": "12.0", - } + def requirements(self): + if Version(self.version) < "2.0.0": + self.requires("boost/1.80.0") + if self.settings.os in ["Linux", "Macos"]: + self.requires("exprtk/0.0.1") def validate(self): - # In 1.2.2, arsenalgear doesn't support Visual Studio. + # arsenalgear doesn't support Visual Studio(yet). if is_msvc(self): - raise ConanInvalidConfiguration("{} doesn't support Visual Studio(yet)".format(self.name)) - - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio(yet)") - minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) - else: - self.output.warn("{0} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") 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], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ARSENALGEAR_VERSION"] = str(self.version) + tc.variables["ARSENALGEAR_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/arsenalgear/all/test_package/CMakeLists.txt b/recipes/arsenalgear/all/test_package/CMakeLists.txt index abd25c367aac4..e3d45800d41b0 100644 --- a/recipes/arsenalgear/all/test_package/CMakeLists.txt +++ b/recipes/arsenalgear/all/test_package/CMakeLists.txt @@ -1,12 +1,9 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(arsenalgear REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} arsenalgear::arsenalgear) +target_link_libraries(${PROJECT_NAME} PRIVATE arsenalgear::arsenalgear) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/arsenalgear/all/test_package/conanfile.py b/recipes/arsenalgear/all/test_package/conanfile.py index 38f4483872d47..a9fbb7f543162 100644 --- a/recipes/arsenalgear/all/test_package/conanfile.py +++ b/recipes/arsenalgear/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -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", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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 +20,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt b/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2340ca5c12b92 --- /dev/null +++ b/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(arsenalgear REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE arsenalgear::arsenalgear) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/arsenalgear/all/test_v1_package/conanfile.py b/recipes/arsenalgear/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/arsenalgear/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/arsenalgear/config.yml b/recipes/arsenalgear/config.yml index af40d9653a378..6d0bf30afb485 100644 --- a/recipes/arsenalgear/config.yml +++ b/recipes/arsenalgear/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.1": + folder: all "1.2.2": folder: all From 8402911a67b8f5845f75d077e0d3de057ece25e2 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 4 Oct 2022 15:44:02 +0200 Subject: [PATCH 298/561] (#13262) pngpp: conan v2 support --- recipes/pngpp/all/conandata.yml | 1 - recipes/pngpp/all/conanfile.py | 35 +++++++++++-------- recipes/pngpp/all/test_package/CMakeLists.txt | 7 ++-- recipes/pngpp/all/test_package/conanfile.py | 19 +++++++--- .../pngpp/all/test_v1_package/CMakeLists.txt | 10 ++++++ .../pngpp/all/test_v1_package/conanfile.py | 17 +++++++++ 6 files changed, 65 insertions(+), 24 deletions(-) create mode 100644 recipes/pngpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pngpp/all/test_v1_package/conanfile.py diff --git a/recipes/pngpp/all/conandata.yml b/recipes/pngpp/all/conandata.yml index 8f572862e9a9d..02dc7457e1b89 100644 --- a/recipes/pngpp/all/conandata.yml +++ b/recipes/pngpp/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "0.2.10": - patch_file: "patches/0001-fix-windows.patch" - base_path: "source_subfolder" diff --git a/recipes/pngpp/all/conanfile.py b/recipes/pngpp/all/conanfile.py index bd480790a26cd..9693d59416e60 100644 --- a/recipes/pngpp/all/conanfile.py +++ b/recipes/pngpp/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class PngppConan(ConanFile): @@ -11,26 +13,31 @@ class PngppConan(ConanFile): topics = ("png++", "png") homepage = "https://www.nongnu.org/pngpp" url = "https://github.com/conan-io/conan-center-index" - exports_sources = "patches/**" + settings = "os", "arch", "compiler", "build_type" - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.38") def package_id(self): - self.info.header_only() + self.info.clear() 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], + destination=self.source_folder, strip_root=True) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("*.hpp", dst=os.path.join("include", "png++"), src=self._source_subfolder) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "png++")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/pngpp/all/test_package/CMakeLists.txt b/recipes/pngpp/all/test_package/CMakeLists.txt index 196188113685c..f5ee715eea307 100644 --- a/recipes/pngpp/all/test_package/CMakeLists.txt +++ b/recipes/pngpp/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(pngpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE pngpp::pngpp) diff --git a/recipes/pngpp/all/test_package/conanfile.py b/recipes/pngpp/all/test_package/conanfile.py index 5216332f39f5c..0a6bc68712d90 100644 --- a/recipes/pngpp/all/test_package/conanfile.py +++ b/recipes/pngpp/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pngpp/all/test_v1_package/CMakeLists.txt b/recipes/pngpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..abf75b3c1f51a --- /dev/null +++ b/recipes/pngpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pngpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pngpp::pngpp) diff --git a/recipes/pngpp/all/test_v1_package/conanfile.py b/recipes/pngpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pngpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From f541237a883d7bee506471e29f4792d5502908ee Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:04:28 +0200 Subject: [PATCH 299/561] (#13264) vcglib: conan v2 support --- recipes/vcglib/all/CMakeLists.txt | 8 +-- recipes/vcglib/all/conandata.yml | 2 - recipes/vcglib/all/conanfile.py | 57 ++++++++++--------- .../vcglib/all/test_package/CMakeLists.txt | 11 ++-- recipes/vcglib/all/test_package/conanfile.py | 19 +++++-- .../vcglib/all/test_v1_package/CMakeLists.txt | 11 ++++ .../vcglib/all/test_v1_package/conanfile.py | 18 ++++++ 7 files changed, 79 insertions(+), 47 deletions(-) create mode 100644 recipes/vcglib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vcglib/all/test_v1_package/conanfile.py diff --git a/recipes/vcglib/all/CMakeLists.txt b/recipes/vcglib/all/CMakeLists.txt index 8c109eb5cb52f..503836eca235b 100644 --- a/recipes/vcglib/all/CMakeLists.txt +++ b/recipes/vcglib/all/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(vcglib) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(VCGLIB_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) +project(vcglib LANGUAGES CXX) find_package(Eigen3 REQUIRED CONFIG) @@ -14,6 +9,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE target_include_directories(${PROJECT_NAME} PUBLIC ${VCGLIB_SRC_DIR}) target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen) +include(GNUInstallDirs) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/vcglib/all/conandata.yml b/recipes/vcglib/all/conandata.yml index 9189efc74ad1c..d8dc31a26ed34 100644 --- a/recipes/vcglib/all/conandata.yml +++ b/recipes/vcglib/all/conandata.yml @@ -8,7 +8,5 @@ sources: patches: "2022.02": - patch_file: "patches/0001-use-external-eigen.patch" - base_path: "source_subfolder" "2020.12": - patch_file: "patches/0001-use-external-eigen.patch" - base_path: "source_subfolder" diff --git a/recipes/vcglib/all/conanfile.py b/recipes/vcglib/all/conanfile.py index fdb554f64e62d..f452d7336181c 100644 --- a/recipes/vcglib/all/conanfile.py +++ b/recipes/vcglib/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, CMake, tools -import functools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class VcglibConan(ConanFile): @@ -22,16 +25,9 @@ class VcglibConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package_multi" - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,34 +35,41 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("eigen/3.4.0") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + if self.info.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["VCGLIB_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/vcglib/all/test_package/CMakeLists.txt b/recipes/vcglib/all/test_package/CMakeLists.txt index 2f5ac307877bf..e31ccdde007c2 100644 --- a/recipes/vcglib/all/test_package/CMakeLists.txt +++ b/recipes/vcglib/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(vcglib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} vcglib::vcglib) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE vcglib::vcglib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vcglib/all/test_package/conanfile.py b/recipes/vcglib/all/test_package/conanfile.py index 8eaf28f5cf632..6ecd0412fd260 100644 --- a/recipes/vcglib/all/test_package/conanfile.py +++ b/recipes/vcglib/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,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.bindirs[0], "test_package") obj_path = os.path.join(self.source_folder, "cube.obj") - self.run("{} {}".format(bin_path, obj_path), run_environment=True) + self.run(f"{bin_path} {obj_path}", env="conanrun") diff --git a/recipes/vcglib/all/test_v1_package/CMakeLists.txt b/recipes/vcglib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b93c9e9b9c66 --- /dev/null +++ b/recipes/vcglib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(vcglib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vcglib::vcglib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vcglib/all/test_v1_package/conanfile.py b/recipes/vcglib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4d2909d5e4d45 --- /dev/null +++ b/recipes/vcglib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + obj_path = os.path.join(self.source_folder, os.pardir, "test_package", "cube.obj") + self.run(f"{bin_path} {obj_path}", run_environment=True) From f9bf94d2b8625a87bf6f4dd539805d614d443ead Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:24:12 +0200 Subject: [PATCH 300/561] (#13265) vc: conan v2 support --- recipes/vc/all/CMakeLists.txt | 7 --- recipes/vc/all/conanfile.py | 55 ++++++++----------- recipes/vc/all/test_package/CMakeLists.txt | 11 ++-- recipes/vc/all/test_package/conanfile.py | 19 +++++-- recipes/vc/all/test_v1_package/CMakeLists.txt | 11 ++++ recipes/vc/all/test_v1_package/conanfile.py | 17 ++++++ 6 files changed, 69 insertions(+), 51 deletions(-) delete mode 100644 recipes/vc/all/CMakeLists.txt create mode 100644 recipes/vc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/vc/all/test_v1_package/conanfile.py diff --git a/recipes/vc/all/CMakeLists.txt b/recipes/vc/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9..0000000000000 --- a/recipes/vc/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/vc/all/conanfile.py b/recipes/vc/all/conanfile.py index 31bfc101182be..7cfaddf7b0838 100644 --- a/recipes/vc/all/conanfile.py +++ b/recipes/vc/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, CMake, tools +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, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" class VcConan(ConanFile): @@ -20,52 +23,40 @@ class VcConan(ConanFile): "fPIC": True, } - exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None - - @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 layout(self): + cmake_layout(self, src_folder="src") + def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + if self.info.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) - def _patch_sources(self): - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") - tools.replace_in_file(cmakelists, "CMAKE_SOURCE_DIR", "CMAKE_CURRENT_SOURCE_DIR") - tools.replace_in_file(cmakelists, "AddCompilerFlag(\"-fPIC\" CXX_FLAGS libvc_compile_flags)", "") + 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): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "AddCompilerFlag(\"-fPIC\" CXX_FLAGS libvc_compile_flags)", "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + 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", 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): self.cpp_info.set_property("cmake_file_name", "Vc") diff --git a/recipes/vc/all/test_package/CMakeLists.txt b/recipes/vc/all/test_package/CMakeLists.txt index 54585e3f38779..f92c2d97f3154 100644 --- a/recipes/vc/all/test_package/CMakeLists.txt +++ b/recipes/vc/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(Vc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} Vc::Vc) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE Vc::Vc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vc/all/test_package/conanfile.py b/recipes/vc/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/vc/all/test_package/conanfile.py +++ b/recipes/vc/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/vc/all/test_v1_package/CMakeLists.txt b/recipes/vc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..492877a81dfa8 --- /dev/null +++ b/recipes/vc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Vc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Vc::Vc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vc/all/test_v1_package/conanfile.py b/recipes/vc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/vc/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From a6b7306193cb8b26c39d4ea808bcf235f212f284 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:44:32 +0200 Subject: [PATCH 301/561] (#13267) sokol: conan v2 support --- recipes/sokol/all/conanfile.py | 33 ++++++++++++------- recipes/sokol/all/test_package/CMakeLists.txt | 7 ++-- recipes/sokol/all/test_package/conanfile.py | 21 ++++++++---- .../sokol/all/test_v1_package/CMakeLists.txt | 10 ++++++ .../sokol/all/test_v1_package/conanfile.py | 17 ++++++++++ 5 files changed, 65 insertions(+), 23 deletions(-) create mode 100644 recipes/sokol/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sokol/all/test_v1_package/conanfile.py diff --git a/recipes/sokol/all/conanfile.py b/recipes/sokol/all/conanfile.py index e66d47c74fe0d..e51b5f383cb38 100644 --- a/recipes/sokol/all/conanfile.py +++ b/recipes/sokol/all/conanfile.py @@ -1,6 +1,9 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -import glob + +required_conan_version = ">=1.50.0" class SokolConan(ConanFile): @@ -10,20 +13,26 @@ class SokolConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/floooh/sokol" license = "Zlib" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob(self.name + "-*/")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.h", dst="include", src=self._source_subfolder) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/sokol/all/test_package/CMakeLists.txt b/recipes/sokol/all/test_package/CMakeLists.txt index 3e933ce337ad7..ecaa904d9733e 100644 --- a/recipes/sokol/all/test_package/CMakeLists.txt +++ b/recipes/sokol/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(PackageTest C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(sokol REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package sokol::sokol) +target_link_libraries(test_package PRIVATE sokol::sokol) diff --git a/recipes/sokol/all/test_package/conanfile.py b/recipes/sokol/all/test_package/conanfile.py index 7e2dfe859bb27..0a6bc68712d90 100644 --- a/recipes/sokol/all/test_package/conanfile.py +++ b/recipes/sokol/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sokol/all/test_v1_package/CMakeLists.txt b/recipes/sokol/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4999ac8ba67d0 --- /dev/null +++ b/recipes/sokol/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(sokol REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.c) +target_link_libraries(test_package PRIVATE sokol::sokol) diff --git a/recipes/sokol/all/test_v1_package/conanfile.py b/recipes/sokol/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/sokol/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 554c840696f1525d5b50cbbd1a9ddbe50762b1d9 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 5 Oct 2022 00:04:51 +0900 Subject: [PATCH 302/561] (#13275) wasmtime-cpp: add version 1.0.0 and support conan v2 --- recipes/wasmtime-cpp/all/conandata.yml | 3 + recipes/wasmtime-cpp/all/conanfile.py | 64 ++++++++++--------- .../all/test_package/CMakeLists.txt | 7 +- .../all/test_package/conanfile.py | 23 ++++--- .../all/test_v1_package/CMakeLists.txt | 13 ++++ .../all/test_v1_package/conanfile.py | 19 ++++++ recipes/wasmtime-cpp/config.yml | 2 + 7 files changed, 87 insertions(+), 44 deletions(-) create mode 100644 recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wasmtime-cpp/all/test_v1_package/conanfile.py diff --git a/recipes/wasmtime-cpp/all/conandata.yml b/recipes/wasmtime-cpp/all/conandata.yml index 902f27be4acb5..0942b81396867 100644 --- a/recipes/wasmtime-cpp/all/conandata.yml +++ b/recipes/wasmtime-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v1.0.0.tar.gz" + sha256: "246e1d7f8f7f61170296d68c6f44ba53232d1549807633da366ca70b19089a7a" "0.39.0": url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/refs/tags/v0.39.0.tar.gz" sha256: "b0b2d4c629d341078f8157a39c3101f9dcd84c643ddb7b25f843ed84eae281ea" diff --git a/recipes/wasmtime-cpp/all/conanfile.py b/recipes/wasmtime-cpp/all/conanfile.py index 2fc85662a49ec..460095d0e84a7 100644 --- a/recipes/wasmtime-cpp/all/conanfile.py +++ b/recipes/wasmtime-cpp/all/conanfile.py @@ -1,9 +1,12 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout import os -import shutil -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class WasmtimeCppConan(ConanFile): name = 'wasmtime-cpp' @@ -20,48 +23,47 @@ def _minimum_cpp_standard(self): return 17 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { "Visual Studio": "16", + "msvc": "192", "apple-clang": "12.0", "clang": "12.0", "gcc": "10.0" } + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): version = str(self.version) - if version == "0.35.0": - version = "0.35.1" - elif version == "0.39.0": - version = "0.39.1" - self.requires(f"wasmtime/{version}") + version_map = { + "0.35.0": "0.35.1", + "0.39.0": "0.39.1", + "1.0.0": "1.0.1", + } + self.requires(f"wasmtime/{version_map.get(version, version)}") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): - compiler = self.settings.compiler - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) - min_version = self._minimum_compilers_version[str(compiler)] - try: - if tools.Version(compiler.version) < min_version: - msg = ( - "{} requires C++{} features which are not supported by compiler {} {} !!" - ).format(self.name, self._minimum_cpp_standard, compiler, compiler.version) - raise ConanInvalidConfiguration(msg) - except KeyError: - msg = ( - "{} recipe lacks information about the {} compiler, " - "support for the required C++{} features is assumed" - ).format(self.name, compiler, self._minimum_cpp_standard) - self.output.warn(msg) + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) def package(self): - shutil.copytree(os.path.join(self.source_folder, "include"), - os.path.join(self.package_folder, "include")) - + copy(self, pattern="*.hh", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) self.copy('LICENSE', dst='licenses', src=self.source_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt b/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt index 30d1f75007b44..bbc7ba2fe6340 100644 --- a/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt +++ b/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt @@ -1,15 +1,12 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(wasmtime-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE wasmtime-cpp::wasmtime-cpp) -target_compile_definitions(${PROJECT_NAME} PUBLIC WASMTIME_EXAMPLES_PATH="${CMAKE_SOURCE_DIR}") -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_compile_definitions(${PROJECT_NAME} PRIVATE WASMTIME_EXAMPLES_PATH="${CMAKE_SOURCE_DIR}") +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF ) diff --git a/recipes/wasmtime-cpp/all/test_package/conanfile.py b/recipes/wasmtime-cpp/all/test_package/conanfile.py index 19f014b0fde37..a9fbb7f543162 100644 --- a/recipes/wasmtime-cpp/all/test_package/conanfile.py +++ b/recipes/wasmtime-cpp/all/test_package/conanfile.py @@ -1,11 +1,18 @@ -from conans import ConanFile, CMake, tools -from conan.tools.build import cross_building +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class WasmtimeCppTestConan(ConanFile): - settings = 'os', 'arch', 'compiler', 'build_type' - generators = 'cmake', 'cmake_find_package_multi' + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - bin_path = os.path.join('bin', 'test_package') - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt b/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3a1b8cf126d6f --- /dev/null +++ b/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(wasmtime-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE wasmtime-cpp::wasmtime-cpp) +target_compile_definitions(${PROJECT_NAME} PRIVATE WASMTIME_EXAMPLES_PATH="${CMAKE_SOURCE_DIR}/../test_package") +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/wasmtime-cpp/all/test_v1_package/conanfile.py b/recipes/wasmtime-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/wasmtime-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wasmtime-cpp/config.yml b/recipes/wasmtime-cpp/config.yml index 782bb03276a8a..3c8b013220755 100644 --- a/recipes/wasmtime-cpp/config.yml +++ b/recipes/wasmtime-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.0": + folder: all "0.39.0": folder: all "0.38.0": From 441732245b22032227d8ced0058371b2c62fbec3 Mon Sep 17 00:00:00 2001 From: Julien Pilet Date: Tue, 4 Oct 2022 17:24:42 +0200 Subject: [PATCH 303/561] (#13276) gdal/3.5.2: fix with_jpeg=libjpeg-turbo option --- recipes/gdal/post_3.5.0/conanfile.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 2c127ca428c98..fe440e544faa4 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -512,8 +512,10 @@ def _configure_cmake(self): print(f'self.options.with_jpeg: {self.options.with_jpeg}') cmake.definitions["GDAL_USE_JPEG"] = True cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg - cmake.definitions["TARGET_FOR_JPEG"] = \ - "JPEG::JPEG" if self.options.with_jpeg == "libjpeg" else "libjpeg-turbo::libjpeg-turbo" + cmake.definitions["TARGET_FOR_JPEG"] = ( + "JPEG::JPEG" if self.options.with_jpeg == "libjpeg" else + self.dependencies["libjpeg-turbo"].cpp_info.components["turbojpeg"] \ + .get_property("cmake_target_name")) else: cmake.definitions["JPEG_FOUND"] = False @@ -808,7 +810,7 @@ def package_info(self): if self.options.with_jpeg == "libjpeg": self.cpp_info.requires.extend(['libjpeg::libjpeg']) elif self.options.with_jpeg == "libjpeg-turbo": - self.cpp_info.requires.extend(['libjpeg-turbo::jpeg']) + self.cpp_info.requires.extend(['libjpeg-turbo::turbojpeg']) if self.options.with_libkml: self.cpp_info.requires.extend(['libkml::kmldom', 'libkml::kmlengine']) From 58ca069e44ec47475ea36f91a590a8d9589d1a06 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 5 Oct 2022 00:44:47 +0900 Subject: [PATCH 304/561] (#13277) erkir: add version 2.0.0 and support conan v2 * erkir: add version 2.0.0 and support conan v2 * remove share * support MSVC static build --- recipes/erkir/all/CMakeLists.txt | 10 --- recipes/erkir/all/conandata.yml | 25 +++++- recipes/erkir/all/conanfile.py | 80 +++++++++++-------- ....patch => 1.0.0-0001-remove-testing.patch} | 0 .../patches/1.0.0-0002-export-symbols.patch | 13 +++ ...0.0-0001-remove-specify-architecture.patch | 13 +++ .../all/patches/2.0.0-0002-fix-cmake.patch | 20 +++++ .../patches/2.0.0-0003-fix-erkir_export.patch | 28 +++++++ recipes/erkir/all/test_package/CMakeLists.txt | 12 ++- recipes/erkir/all/test_package/conanfile.py | 23 ++++-- .../{example.cpp => test_package.cpp} | 6 +- .../erkir/all/test_v1_package/CMakeLists.txt | 12 +++ .../erkir/all/test_v1_package/conanfile.py | 18 +++++ recipes/erkir/config.yml | 2 + 14 files changed, 199 insertions(+), 63 deletions(-) delete mode 100644 recipes/erkir/all/CMakeLists.txt rename recipes/erkir/all/patches/{remove-testing-1.0.0.patch => 1.0.0-0001-remove-testing.patch} (100%) create mode 100644 recipes/erkir/all/patches/1.0.0-0002-export-symbols.patch create mode 100644 recipes/erkir/all/patches/2.0.0-0001-remove-specify-architecture.patch create mode 100644 recipes/erkir/all/patches/2.0.0-0002-fix-cmake.patch create mode 100644 recipes/erkir/all/patches/2.0.0-0003-fix-erkir_export.patch rename recipes/erkir/all/test_package/{example.cpp => test_package.cpp} (89%) create mode 100644 recipes/erkir/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/erkir/all/test_v1_package/conanfile.py diff --git a/recipes/erkir/all/CMakeLists.txt b/recipes/erkir/all/CMakeLists.txt deleted file mode 100644 index 2d29a388d78da..0000000000000 --- a/recipes/erkir/all/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.4) - -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory("source_subfolder") diff --git a/recipes/erkir/all/conandata.yml b/recipes/erkir/all/conandata.yml index 253d5bb957704..24a6857c0b7eb 100644 --- a/recipes/erkir/all/conandata.yml +++ b/recipes/erkir/all/conandata.yml @@ -1,8 +1,25 @@ sources: + "2.0.0": + url: "https://github.com/vahancho/erkir/archive/refs/tags/v2.0.0.tar.gz" + sha256: "98d095adcf0f2f11e3ba345bd5bbe890568cde69de9680b2c2a424f0008453ac" "1.0.0": - url: https://github.com/vahancho/erkir/archive/refs/tags/1.0.0.tar.gz - sha256: 0bc5122fe2fef0f9036de275483af7f8adb947f6e8dd63fc18ac085ef31e9421 + url: "https://github.com/vahancho/erkir/archive/refs/tags/1.0.0.tar.gz" + sha256: "0bc5122fe2fef0f9036de275483af7f8adb947f6e8dd63fc18ac085ef31e9421" patches: + "2.0.0": + - patch_file: "patches/2.0.0-0001-remove-specify-architecture.patch" + patch_description: "fix supported architectures limited to x86/x86_64" + patch_type: "conan" + - patch_file: "patches/2.0.0-0002-fix-cmake.patch" + patch_description: "disable shared and fPIC options" + patch_type: "conan" + - patch_file: "patches/2.0.0-0003-fix-erkir_export.patch" + patch_description: "define ERKIR_EXPORT as empty on static build" + patch_type: "conan" "1.0.0": - - patch_file: patches/remove-testing-1.0.0.patch - base_path: source_subfolder + - patch_file: "patches/1.0.0-0001-remove-testing.patch" + patch_description: "stop executing test codes" + patch_type: "conan" + - patch_file: "patches/1.0.0-0002-export-symbols.patch" + patch_description: "export all symbols on windows" + patch_type: "backport" diff --git a/recipes/erkir/all/conanfile.py b/recipes/erkir/all/conanfile.py index 1511a37648558..66b56ca8db092 100644 --- a/recipes/erkir/all/conanfile.py +++ b/recipes/erkir/all/conanfile.py @@ -1,17 +1,20 @@ -from conans import ConanFile, CMake, tools -import os +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -required_conan_version = ">=1.33.0" +import os +required_conan_version = ">=1.52.0" class ErkirConan(ConanFile): name = "erkir" + description = "a C++ library for geodetic and trigonometric calculations" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/vahancho/erkir" - license = "MIT" - description = "a C++ library for geodetic and trigonometric calculations" topics = ("earth", "geodesy", "geography", "coordinate-systems", "geodetic", "datum") - exports_sources = "CMakeLists.txt", "patches/*" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,13 +24,14 @@ class ErkirConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" - + def _minimum_cpp_standard(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -36,34 +40,46 @@ def configure(self): if self.options.shared: del self.options.fPIC - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CODE_COVERAGE"] = False + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CODE_COVERAGE"] = False - self._cmake.configure() - return self._cmake + deps = CMakeDeps(self) + deps.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("*", src=os.path.join(self._source_subfolder, "include"), dst=os.path.join("include", "erkir")) - self.copy("*.lib", dst="lib", keep_path=False) - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.dylib*", dst="lib", keep_path=False) - self.copy("*.so", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if Version(self.version) < "2.0.0": + copy(self, pattern="*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.dylib*", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.so", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.libs = ["erkir"] + postfix = "d" if Version(self.version) >= "2.0.0" and self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"erkir{postfix}"] diff --git a/recipes/erkir/all/patches/remove-testing-1.0.0.patch b/recipes/erkir/all/patches/1.0.0-0001-remove-testing.patch similarity index 100% rename from recipes/erkir/all/patches/remove-testing-1.0.0.patch rename to recipes/erkir/all/patches/1.0.0-0001-remove-testing.patch diff --git a/recipes/erkir/all/patches/1.0.0-0002-export-symbols.patch b/recipes/erkir/all/patches/1.0.0-0002-export-symbols.patch new file mode 100644 index 0000000000000..190ff9b9a3f95 --- /dev/null +++ b/recipes/erkir/all/patches/1.0.0-0002-export-symbols.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 851f78a..6575859 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,6 +24,8 @@ add_library(erkir::erkir ALIAS erkir) + # Includes + target_include_directories(erkir PUBLIC include) + ++set_target_properties(erkir PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++ + # Coverage support. + option(CODE_COVERAGE "Enable coverage reporting" ON) + if (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") diff --git a/recipes/erkir/all/patches/2.0.0-0001-remove-specify-architecture.patch b/recipes/erkir/all/patches/2.0.0-0001-remove-specify-architecture.patch new file mode 100644 index 0000000000000..0a3aad55accce --- /dev/null +++ b/recipes/erkir/all/patches/2.0.0-0001-remove-specify-architecture.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 52e5571..b97d9d0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,7 +17,7 @@ include(GNUInstallDirs) + option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + option(ENABLE_TESTING "Enable unit test build" OFF) + +-if (NOT MSVC) ++if (0) + # Specify the target architecture (Linux). For Windows based generator use rather + # '-A Win32' or '-A x64 options' + set(TARGET_ARCH x86 CACHE STRING "the target architecture") diff --git a/recipes/erkir/all/patches/2.0.0-0002-fix-cmake.patch b/recipes/erkir/all/patches/2.0.0-0002-fix-cmake.patch new file mode 100644 index 0000000000000..50bd8af00a0b8 --- /dev/null +++ b/recipes/erkir/all/patches/2.0.0-0002-fix-cmake.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b97d9d0..0152f84 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.9) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # The project definition + project(erkir VERSION 2.0.0 +@@ -14,7 +13,6 @@ project(erkir VERSION 2.0.0 + include(GNUInstallDirs) + + # General options +-option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + option(ENABLE_TESTING "Enable unit test build" OFF) + + if (0) diff --git a/recipes/erkir/all/patches/2.0.0-0003-fix-erkir_export.patch b/recipes/erkir/all/patches/2.0.0-0003-fix-erkir_export.patch new file mode 100644 index 0000000000000..cef30fbc03eea --- /dev/null +++ b/recipes/erkir/all/patches/2.0.0-0003-fix-erkir_export.patch @@ -0,0 +1,28 @@ +diff --git a/include/export.h b/include/export.h +index edcb0b3..e090174 100644 +--- a/include/export.h ++++ b/include/export.h +@@ -1,7 +1,7 @@ + #ifndef __EXPORT_H_ + #define __EXPORT_H_ + +-#ifdef _WIN32 ++#if defined(_WIN32) && defined(ERKIR_SHARED) + #ifdef MAKEDLL + # define ERKIR_EXPORT __declspec(dllexport) + #else +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ccb807b..8eb005d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -37,6 +37,10 @@ if (MSVC) + target_compile_definitions(${TARGET} PUBLIC MAKEDLL) + endif() + ++if (BUILD_SHARED_LIBS) ++ target_compile_definitions(${TARGET} PUBLIC ERKIR_SHARED) ++endif() ++ + ############################################################################### + # The installation and packaging + # diff --git a/recipes/erkir/all/test_package/CMakeLists.txt b/recipes/erkir/all/test_package/CMakeLists.txt index 1d7b745144727..135087f122cde 100644 --- a/recipes/erkir/all/test_package/CMakeLists.txt +++ b/recipes/erkir/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) -set(CMAKE_CXX_STANDARD 11) +cmake_minimum_required(VERSION 3.8) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package CXX) find_package(erkir REQUIRED CONFIG) -add_executable(${PROJECT_NAME} example.cpp) -target_link_libraries(${PROJECT_NAME} erkir::erkir) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE erkir::erkir) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/erkir/all/test_package/conanfile.py b/recipes/erkir/all/test_package/conanfile.py index c7f8c914c58a1..a9fb96656f203 100644 --- a/recipes/erkir/all/test_package/conanfile.py +++ b/recipes/erkir/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 ErkirTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/erkir/all/test_package/example.cpp b/recipes/erkir/all/test_package/test_package.cpp similarity index 89% rename from recipes/erkir/all/test_package/example.cpp rename to recipes/erkir/all/test_package/test_package.cpp index 0a2d9f956a461..887871e867da3 100644 --- a/recipes/erkir/all/test_package/example.cpp +++ b/recipes/erkir/all/test_package/test_package.cpp @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include int main(int argc, char **argv) { diff --git a/recipes/erkir/all/test_v1_package/CMakeLists.txt b/recipes/erkir/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b00f9ba781174 --- /dev/null +++ b/recipes/erkir/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(erkir REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE erkir::erkir) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/erkir/all/test_v1_package/conanfile.py b/recipes/erkir/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/erkir/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/erkir/config.yml b/recipes/erkir/config.yml index 40341aa3db6cd..870fb33e55af0 100644 --- a/recipes/erkir/config.yml +++ b/recipes/erkir/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.0": + folder: all "1.0.0": folder: all From 1eb00b5039fbc8d1e0bac2a1685aa9ba1e6fb20a Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 4 Oct 2022 11:24:09 -0500 Subject: [PATCH 305/561] (#13237) Update cmake template * Remove std::endl This is not best practice. If output must be flushed, use `std::flush` instead. * Use check_min_vs to check compiler version This is compatible with both Visual Studio and msvc compiler settings. * Combine commands to delete settings in a single try-catch block This reduces boilerplate. * Remove destination=self.source_folder This argument is not necessary when using the get method in the source method. * Remove if is_msvc check before check_min_vs Co-authored-by: Uilian Ries * Condense output to a single statement * Revert "Remove destination=self.source_folder" This reverts commit 942d84d129bd6a46a100076bdfdc40a05e817278. * Clean up grammar / typos * Revert "Combine commands to delete settings in a single try-catch block" This reverts commit 90f0f1922a0bef094ec0d8e137b06fd15b85f1de. * Fix * Revert "Fix" This reverts commit 6483354cf7062498c32459528934c8611a3aaf8a. * Revert "Clean up grammar / typos" This reverts commit 3f472dbfe8e6908a173416d3e4c374870d9eeffc. * Revert "Condense output to a single statement" This reverts commit 96d7b71965729093448292cbaec98f732873377a. * Revert test_package.cpp Co-authored-by: Uilian Ries --- docs/package_templates/cmake_package/all/conanfile.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index 2e937d45fe90e..9f605b9822995 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +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 @@ -38,7 +38,6 @@ def _minimum_cpp_standard(self): def _compilers_minimum_version(self): return { "gcc": "7", - "Visual Studio": "15.7", "clang": "7", "apple-clang": "10", } @@ -77,9 +76,11 @@ def validate(self): # validate the minimum cpp standard supported. For C++ projects only if self.info.settings.compiler.cppstd: check_min_cppstd(self, self._minimum_cpp_standard) - minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) - if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, 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.info.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") From 02062a19a0df7d3bb2127d2f89c194ecdd954bb8 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 5 Oct 2022 01:44:46 +0900 Subject: [PATCH 306/561] (#13300) aws-c-cal: update dependencies --- recipes/aws-c-cal/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/aws-c-cal/all/conanfile.py b/recipes/aws-c-cal/all/conanfile.py index b05f10499feff..1316e6e52c194 100644 --- a/recipes/aws-c-cal/all/conanfile.py +++ b/recipes/aws-c-cal/all/conanfile.py @@ -56,7 +56,7 @@ def requirements(self): if Version(self.version) <= "0.5.11": self.requires("aws-c-common/0.6.11") else: - self.requires("aws-c-common/0.7.4") + self.requires("aws-c-common/0.8.2") if self._needs_openssl: self.requires("openssl/1.1.1q") From 14d4b455c9fbfd0e9c35d9beb181efaa68bc5275 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 5 Oct 2022 16:04:52 +0900 Subject: [PATCH 307/561] (#13287) simdjson: add version 2.2.3 and set pkg_config_name in 2.2.3 * simdjson: add version 2.2.3 and set pkg_config_name in 2.2.3 * add 2.2.3 to config.yml --- recipes/simdjson/all/conandata.yml | 3 +++ recipes/simdjson/all/conanfile.py | 4 ++++ recipes/simdjson/config.yml | 2 ++ 3 files changed, 9 insertions(+) diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index 954bb312b61ec..a8bb6fe4e100a 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.3": + url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" + sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" "2.2.2": url: "https://github.com/simdjson/simdjson/archive/v2.2.2.tar.gz" sha256: "b0e36beab240bd827c1103b4c66672491595930067871e20946d67b07758c010" diff --git a/recipes/simdjson/all/conanfile.py b/recipes/simdjson/all/conanfile.py index 9ae45e679d546..e8b764c5b7dc2 100644 --- a/recipes/simdjson/all/conanfile.py +++ b/recipes/simdjson/all/conanfile.py @@ -115,10 +115,14 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "simdjson") self.cpp_info.set_property("cmake_target_name", "simdjson::simdjson") + if Version(self.version) >= "2.2.3": + self.cpp_info.set_property("pkg_config_name", "simdjson") + self.cpp_info.libs = ["simdjson"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] diff --git a/recipes/simdjson/config.yml b/recipes/simdjson/config.yml index 16afc75b1f4cf..923cd599435b6 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.3": + folder: all "2.2.2": folder: all "2.2.0": From 9499396689893ef97b2d9f16b5fd3ff621ef3afa Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Wed, 5 Oct 2022 08:44:06 +0100 Subject: [PATCH 308/561] (#13263) [libiconv] conan v2 update * [libiconv] update to v2 toolchain * [libiconv] update test packages vor v2 * [libiconv] fix cross building check * [libiconv] supply '-FS' flag for msvc debug * [libiconv] add destination to source method * Update recipes/libiconv/all/test_v1_package/CMakeLists.txt Co-authored-by: Jordan Williams * [libiconv] handle msvc compiler version Co-authored-by: Jordan Williams --- recipes/libiconv/all/conandata.yml | 1 - recipes/libiconv/all/conanfile.py | 163 ++++++++---------- .../libiconv/all/test_package/CMakeLists.txt | 5 +- .../libiconv/all/test_package/conanfile.py | 26 +-- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../libiconv/all/test_v1_package/conanfile.py | 16 ++ 6 files changed, 113 insertions(+), 108 deletions(-) create mode 100644 recipes/libiconv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libiconv/all/test_v1_package/conanfile.py diff --git a/recipes/libiconv/all/conandata.yml b/recipes/libiconv/all/conandata.yml index c04401d66daca..445cf39835a93 100644 --- a/recipes/libiconv/all/conandata.yml +++ b/recipes/libiconv/all/conandata.yml @@ -11,4 +11,3 @@ sources: patches: "1.16": - patch_file: "patches/0001-libcharset-fix-linkage.patch" - base_path: "source_subfolder" diff --git a/recipes/libiconv/all/conanfile.py b/recipes/libiconv/all/conanfile.py index 4aa83c5f8ef6c..773bef0933d46 100644 --- a/recipes/libiconv/all/conanfile.py +++ b/recipes/libiconv/all/conanfile.py @@ -1,11 +1,23 @@ -from conan.tools.files import rename -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conan.tools.microsoft import is_msvc -from contextlib import contextmanager import os -import functools -required_conan_version = ">=1.45.0" +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rename, + replace_in_file, + rm, + rmdir +) +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class LibiconvConan(ConanFile): @@ -26,20 +38,16 @@ class LibiconvConan(ConanFile): } @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _use_winbash(self): - return tools.os_info.is_windows and (self.settings.compiler == "gcc" or tools.cross_building(self)) + def _is_clang_cl(self): + return (self.settings.compiler == "clang" and self.settings.os == "Windows") \ + or self.settings.get_safe("compiler.toolset") == "ClangCL" @property - def _is_clang_cl(self): - return self.settings.compiler == "clang" and self.settings.os == "Windows" + def _msvc_tools(self): + return ("clang-cl", "llvm-lib", "lld-link") if self._is_clang_cl else ("cl", "lib", "link") def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -55,99 +63,72 @@ def configure(self): def _settings_build(self): return getattr(self, "settings_build", self.settings) - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + def layout(self): + basic_layout(self, src_folder="src") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + def generate(self): + def requires_fs_flag(): + # See https://github.com/conan-io/conan/issues/11158 + return (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ + (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180") + + tc = AutotoolsToolchain(self) + if requires_fs_flag(): + # order of setting flags and environment vars is important + # See https://github.com/conan-io/conan/issues/12228 + tc.extra_cflags.append("-FS") + + env = tc.environment() - @contextmanager - def _build_context(self): - env_vars = {} - if is_msvc(self) or self._is_clang_cl: - cc = "cl" if is_msvc(self) else os.environ.get("CC", "clang-cl") - cxx = "cl" if is_msvc(self) else os.environ.get("CXX", "clang-cl") - lib = "lib" if is_msvc(self) else os.environ.get("AR", "llvm-lib") - build_aux_path = os.path.join(self.build_folder, self._source_subfolder, "build-aux") - lt_compile = tools.unix_path(os.path.join(build_aux_path, "compile")) - lt_ar = tools.unix_path(os.path.join(build_aux_path, "ar-lib")) - env_vars.update({ - "CC": "{} {} -nologo".format(lt_compile, cc), - "CXX": "{} {} -nologo".format(lt_compile, cxx), - "LD": "link", - "STRIP": ":", - "AR": "{} {}".format(lt_ar, lib), - "RANLIB": ":", - "NM": "dumpbin -symbols" - }) - env_vars["win32_target"] = "_WIN32_WINNT_VISTA" - - if not tools.cross_building(self) or is_msvc(self) or self._is_clang_cl: - rc = None - if self.settings.arch == "x86": - rc = "windres --target=pe-i386" - elif self.settings.arch == "x86_64": - rc = "windres --target=pe-x86-64" - if rc: - env_vars["RC"] = rc - env_vars["WINDRES"] = rc - if self._use_winbash: - env_vars["RANLIB"] = ":" - - with tools.vcvars(self.settings) if (is_msvc(self) or self._is_clang_cl) else tools.no_op(): - with tools.chdir(self._source_subfolder): - with tools.environment_append(env_vars): - yield - - @functools.lru_cache(1) - def _configure_autotools(self): - host = None - build = None if is_msvc(self) or self._is_clang_cl: - build = False - if self.settings.arch == "x86": - host = "i686-w64-mingw32" - elif self.settings.arch == "x86_64": - host = "x86_64-w64-mingw32" + cc, lib, link = self._msvc_tools + build_aux_path = os.path.join(self.source_folder, "build-aux") + lt_compile = unix_path(self, os.path.join(build_aux_path, "compile")) + lt_ar = unix_path(self, os.path.join(build_aux_path, "ar-lib")) + env.define("CC", f"{lt_compile} {cc} -nologo") + env.define("CXX", f"{lt_compile} {cc} -nologo") + env.define("LD", f"{link}") + env.define("STRIP", ":") + env.define("AR", f"{lt_ar} {lib}") + env.define("RANLIB", ":") + env.define("NM", "dumpbin -symbols") + env.define("win32_target", "_WIN32_WINNT_VISTA") - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - configure_args = [] - if self.options.shared: - configure_args.extend(["--disable-static", "--enable-shared"]) - else: - configure_args.extend(["--enable-static", "--disable-shared"]) + tc.generate(env) - if (self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) >= "12") or \ - self.settings.compiler == "msvc": - autotools.flags.append("-FS") + env = VirtualBuildEnv(self) + env.generate() - autotools.configure(args=configure_args, host=host, build=build) - return autotools + def build_requirements(self): + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + self.win_bash = True + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) # relocatable shared libs on macOS for configure in ["configure", os.path.join("libcharset", "configure")]: - tools.replace_in_file(os.path.join(self._source_subfolder, configure), + replace_in_file(self, os.path.join(self.source_folder, configure), "-install_name \\$rpath/", "-install_name @rpath/") def build(self): self._patch_sources() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING.LIB", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + copy(self, "COPYING.LIB", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) if (is_msvc(self) or self._is_clang_cl) and self.options.shared: for import_lib in ["iconv", "charset"]: diff --git a/recipes/libiconv/all/test_package/CMakeLists.txt b/recipes/libiconv/all/test_package/CMakeLists.txt index 18f2a726df141..64fa90dede848 100644 --- a/recipes/libiconv/all/test_package/CMakeLists.txt +++ b/recipes/libiconv/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(Iconv REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} Iconv::Iconv) +target_link_libraries(${PROJECT_NAME} PRIVATE Iconv::Iconv) diff --git a/recipes/libiconv/all/test_package/conanfile.py b/recipes/libiconv/all/test_package/conanfile.py index 715ff0b981f7c..12a4269e5efa4 100644 --- a/recipes/libiconv/all/test_package/conanfile.py +++ b/recipes/libiconv/all/test_package/conanfile.py @@ -1,19 +1,20 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) - def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # Workaround for CMake bug with error message: - # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # set. This could be because you are using a Mac OS X version less than 10.5 - # or because CMake's platform configuration is corrupt. - # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -21,5 +22,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libiconv/all/test_v1_package/CMakeLists.txt b/recipes/libiconv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..001545fa55362 --- /dev/null +++ b/recipes/libiconv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Iconv REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Iconv::Iconv) diff --git a/recipes/libiconv/all/test_v1_package/conanfile.py b/recipes/libiconv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a831367c532bc --- /dev/null +++ b/recipes/libiconv/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) From 9cd892b03eb6de5a37e83d3d8ad724430598fa22 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Oct 2022 10:05:20 +0200 Subject: [PATCH 309/561] (#13282) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/faqs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/faqs.md b/docs/faqs.md index 13a42f1804c81..7520683aecc5e 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -19,6 +19,7 @@ This section gathers the most common questions from the community related to pac * [Do static libraries tend to be compiled as PIC by default?](#do-static-libraries-tend-to-be-compiled-as-pic-by-default) * [Why PDB files are not allowed?](#why-pdb-files-are-not-allowed) * [Why is there no option for PDB, as there is for fPIC?](#why-is-there-no-option-for-pdb-as-there-is-for-fpic) + * [Doesn't this make debug builds useless?](#doesnt-this-make-debug-builds-useless) * [Can I remove an option from a recipe?](#can-i-remove-an-option-from-a-recipe) * [Can I split a project into an installer and library package?](#can-i-split-a-project-into-an-installer-and-library-package) * [What license should I use for Public Domain?](#what-license-should-i-use-for-public-domain) From bea932216ba00c7b2a2f64d02adbad33284a06bc Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 5 Oct 2022 11:25:42 +0200 Subject: [PATCH 310/561] (#13310) freetype: bump libpng --- recipes/freetype/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index cad889a16a33f..9008cfe2b91e2 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -67,7 +67,7 @@ def configure(self): def requirements(self): if self.options.with_png: - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.38") if self.options.with_zlib: self.requires("zlib/1.2.12") if self.options.with_bzip2: From a4ffb8f833ba65411de71ec20452bf435d0f3ca6 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 5 Oct 2022 15:44:31 +0200 Subject: [PATCH 311/561] (#13306) [jwt-cpp] Requires conan 1.50.0 at least Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- recipes/jwt-cpp/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/jwt-cpp/all/conanfile.py b/recipes/jwt-cpp/all/conanfile.py index d2f8f0e74f701..67c92deb0d2e6 100644 --- a/recipes/jwt-cpp/all/conanfile.py +++ b/recipes/jwt-cpp/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class JwtCppConan(ConanFile): name = "jwt-cpp" From 2a3cbc506d61ed18e8a3f843e6463ebd471897e3 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 5 Oct 2022 23:04:29 +0900 Subject: [PATCH 312/561] (#13305) aws-c-compression: add version 0.2.15 and update dependencies --- recipes/aws-c-compression/all/conandata.yml | 3 +++ recipes/aws-c-compression/all/conanfile.py | 7 +++++-- recipes/aws-c-compression/config.yml | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/recipes/aws-c-compression/all/conandata.yml b/recipes/aws-c-compression/all/conandata.yml index e91acbde59dd4..1baf0be5b106a 100644 --- a/recipes/aws-c-compression/all/conandata.yml +++ b/recipes/aws-c-compression/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.15": + url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.15.tar.gz" + sha256: "11d58a229e2961b2b36493155a981dea2c8a0bc0d113b0073deb8c3189cfa04e" "0.2.14": url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.14.tar.gz" sha256: "8737863ced57d92f5a0bdde554bf0fe70eaa76aae118fec09a6c361dfc55d0d5" diff --git a/recipes/aws-c-compression/all/conanfile.py b/recipes/aws-c-compression/all/conanfile.py index 5ab1922831568..635a3e71fc9b4 100644 --- a/recipes/aws-c-compression/all/conanfile.py +++ b/recipes/aws-c-compression/all/conanfile.py @@ -30,7 +30,10 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: del self.settings.compiler.libcxx except Exception: @@ -44,7 +47,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.6.19") + self.requires("aws-c-common/0.8.2") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/aws-c-compression/config.yml b/recipes/aws-c-compression/config.yml index 05d0149941499..5a381bb0e6674 100644 --- a/recipes/aws-c-compression/config.yml +++ b/recipes/aws-c-compression/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.15": + folder: all "0.2.14": folder: all "0.2.13": From 6e8593372788a1f410f90cba91ca464dc29ab22e Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 5 Oct 2022 16:45:40 +0200 Subject: [PATCH 313/561] (#13228) openssl: fix cmake variables * openssl: test variables * test with CMakeDeps generator * fixup test source folder * fix cmake variables creation * Apply suggestions from code review Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/openssl/1.x.x/conanfile.py | 17 ++++++-- .../openssl/1.x.x/test_package/CMakeLists.txt | 30 +++++++++++-- .../openssl/1.x.x/test_package/conanfile.py | 40 ++++++++++++------ .../1.x.x/test_v1_package/CMakeLists.txt | 40 ++++++++++++++++++ .../1.x.x/test_v1_package/conanfile.py | 42 +++++++++++++++++++ 5 files changed, 149 insertions(+), 20 deletions(-) create mode 100644 recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/openssl/1.x.x/test_v1_package/conanfile.py diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index 8483f75ebb8be..c863ef20e15b7 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -821,8 +821,7 @@ def package(self): os.path.join(self.package_folder, self._module_file_rel_path) ) - @staticmethod - def _create_cmake_module_variables(module_file): + def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ set(OPENSSL_FOUND TRUE) if(DEFINED OpenSSL_INCLUDE_DIR) @@ -834,6 +833,12 @@ def _create_cmake_module_variables(module_file): ${OpenSSL_Crypto_DEPENDENCIES} ${OpenSSL_Crypto_FRAMEWORKS} ${OpenSSL_Crypto_SYSTEM_LIBS}) + elseif(DEFINED openssl_OpenSSL_Crypto_LIBS_%(config)s) + set(OPENSSL_CRYPTO_LIBRARY ${openssl_OpenSSL_Crypto_LIBS_%(config)s}) + set(OPENSSL_CRYPTO_LIBRARIES ${openssl_OpenSSL_Crypto_LIBS_%(config)s} + ${openssl_OpenSSL_Crypto_DEPENDENCIES_%(config)s} + ${openssl_OpenSSL_Crypto_FRAMEWORKS_%(config)s} + ${openssl_OpenSSL_Crypto_SYSTEM_LIBS_%(config)s}) endif() if(DEFINED OpenSSL_SSL_LIBS) set(OPENSSL_SSL_LIBRARY ${OpenSSL_SSL_LIBS}) @@ -841,6 +846,12 @@ def _create_cmake_module_variables(module_file): ${OpenSSL_SSL_DEPENDENCIES} ${OpenSSL_SSL_FRAMEWORKS} ${OpenSSL_SSL_SYSTEM_LIBS}) + elseif(DEFINED openssl_OpenSSL_SSL_LIBS_%(config)s) + set(OPENSSL_SSL_LIBRARY ${openssl_OpenSSL_SSL_LIBS_%(config)s}) + set(OPENSSL_SSL_LIBRARIES ${openssl_OpenSSL_SSL_LIBS_%(config)s} + ${openssl_OpenSSL_SSL_DEPENDENCIES_%(config)s} + ${openssl_OpenSSL_SSL_FRAMEWORKS_%(config)s} + ${openssl_OpenSSL_SSL_SYSTEM_LIBS_%(config)s}) endif() if(DEFINED OpenSSL_LIBRARIES) set(OPENSSL_LIBRARIES ${OpenSSL_LIBRARIES}) @@ -848,7 +859,7 @@ def _create_cmake_module_variables(module_file): if(DEFINED OpenSSL_VERSION) set(OPENSSL_VERSION ${OpenSSL_VERSION}) endif() - """) + """ % {"config":str(self.settings.build_type).upper()}) tools.save(module_file, content) @property diff --git a/recipes/openssl/1.x.x/test_package/CMakeLists.txt b/recipes/openssl/1.x.x/test_package/CMakeLists.txt index 755a277704a3e..80fb2d894074d 100644 --- a/recipes/openssl/1.x.x/test_package/CMakeLists.txt +++ b/recipes/openssl/1.x.x/test_package/CMakeLists.txt @@ -1,12 +1,34 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - option(OPENSSL_WITH_ZLIB "OpenSSL with zlib support" ON) +set(OpenSSL_DEBUG 1) find_package(OpenSSL REQUIRED) +if(NOT DEFINED OPENSSL_FOUND) + message(FATAL_ERROR "variable OPENSSL_FOUND not set") +endif() +if(NOT DEFINED OPENSSL_INCLUDE_DIR) + message(FATAL_ERROR "variable OPENSSL_INCLUDE_DIR not set") +endif() +if(NOT DEFINED OPENSSL_CRYPTO_LIBRARY) + message(FATAL_ERROR "variable OPENSSL_CRYPTO_LIBRARY not set") +endif() +if(NOT DEFINED OPENSSL_CRYPTO_LIBRARIES) + message(FATAL_ERROR "variable OPENSSL_CRYPTO_LIBRARIES not set") +endif() +if(NOT DEFINED OPENSSL_SSL_LIBRARY) + message(FATAL_ERROR "variable OPENSSL_SSL_LIBRARY not set") +endif() +if(NOT DEFINED OPENSSL_SSL_LIBRARIES) + message(FATAL_ERROR "variable OPENSSL_SSL_LIBRARIES not set") +endif() +if(NOT DEFINED OPENSSL_LIBRARIES) + message(FATAL_ERROR "variable OPENSSL_LIBRARIES not set") +endif() +if(NOT DEFINED OPENSSL_VERSION) + message(FATAL_ERROR "variable OPENSSL_VERSION not set") +endif() add_executable(digest digest.c) target_link_libraries(digest OpenSSL::SSL) diff --git a/recipes/openssl/1.x.x/test_package/conanfile.py b/recipes/openssl/1.x.x/test_package/conanfile.py index 13150b440fe8a..9534143abdfa6 100644 --- a/recipes/openssl/1.x.x/test_package/conanfile.py +++ b/recipes/openssl/1.x.x/test_package/conanfile.py @@ -1,6 +1,7 @@ -from conans import CMake, ConanFile +from conan import ConanFile from conan.tools.scm import Version -from conan.tools.build import cross_building +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" @@ -8,7 +9,8 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" @property def _skip_test(self): @@ -22,21 +24,33 @@ def _skip_test(self): return self.settings.os == "Macos" and self.settings.arch == "armv8" \ and self.options["openssl"].shared + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + if self.settings.os == "Android": + tc.cache_variables["CONAN_LIBCXX"] = "" + openssl = self.dependencies["openssl"] + openssl_version = Version(openssl.ref.version) + if openssl_version.major == "1" and openssl_version.minor == "1": + tc.cache_variables["OPENSSL_WITH_ZLIB"] = False + else: + tc.cache_variables["OPENSSL_WITH_ZLIB"] = not openssl.options.no_zlib + tc.generate() + + def build(self): if not self._skip_test: cmake = CMake(self) - if self.settings.os == "Android": - cmake.definitions["CONAN_LIBCXX"] = "" - openssl_version = Version(self.deps_cpp_info["openssl"].version) - if openssl_version.major == "1" and openssl_version.minor == "1": - cmake.definitions["OPENSSL_WITH_ZLIB"] = False - else: - cmake.definitions["OPENSSL_WITH_ZLIB"] = not self.options["openssl"].no_zlib cmake.configure() cmake.build() def test(self): - if not self._skip_test and not cross_building(self): - bin_path = os.path.join("bin", "digest") - self.run(bin_path, run_environment=True) + if not self._skip_test and can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "digest") + self.run(bin_path, env="conanrun") assert os.path.exists(os.path.join(self.deps_cpp_info["openssl"].rootpath, "licenses", "LICENSE")) diff --git a/recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt b/recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..afde29b3e6bc5 --- /dev/null +++ b/recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +option(OPENSSL_WITH_ZLIB "OpenSSL with zlib support" ON) + +set(OpenSSL_DEBUG 1) +find_package(OpenSSL REQUIRED) +if(NOT DEFINED OPENSSL_FOUND) + message(FATAL_ERROR "variable OPENSSL_FOUND not set") +endif() +if(NOT DEFINED OPENSSL_INCLUDE_DIR) + message(FATAL_ERROR "variable OPENSSL_INCLUDE_DIR not set") +endif() +if(NOT DEFINED OPENSSL_CRYPTO_LIBRARY) + message(FATAL_ERROR "variable OPENSSL_CRYPTO_LIBRARY not set") +endif() +if(NOT DEFINED OPENSSL_CRYPTO_LIBRARIES) + message(FATAL_ERROR "variable OPENSSL_CRYPTO_LIBRARIES not set") +endif() +if(NOT DEFINED OPENSSL_SSL_LIBRARY) + message(FATAL_ERROR "variable OPENSSL_SSL_LIBRARY not set") +endif() +if(NOT DEFINED OPENSSL_SSL_LIBRARIES) + message(FATAL_ERROR "variable OPENSSL_SSL_LIBRARIES not set") +endif() +if(NOT DEFINED OPENSSL_LIBRARIES) + message(FATAL_ERROR "variable OPENSSL_LIBRARIES not set") +endif() +if(NOT DEFINED OPENSSL_VERSION) + message(FATAL_ERROR "variable OPENSSL_VERSION not set") +endif() + +add_executable(digest ../test_package/digest.c) +target_link_libraries(digest OpenSSL::SSL) +if(OPENSSL_WITH_ZLIB) + target_compile_definitions(digest PRIVATE WITH_ZLIB) +endif() diff --git a/recipes/openssl/1.x.x/test_v1_package/conanfile.py b/recipes/openssl/1.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..13150b440fe8a --- /dev/null +++ b/recipes/openssl/1.x.x/test_v1_package/conanfile.py @@ -0,0 +1,42 @@ +from conans import CMake, ConanFile +from conan.tools.scm import Version +from conan.tools.build import cross_building +import os + +required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + @property + def _skip_test(self): + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. + # Actually the workaround should be to add cmake/3.22.0 to build requires, + # but for the specific case of openssl it fails because it is also a requirement of cmake. + # see https://github.com/conan-io/conan/pull/9839 + return self.settings.os == "Macos" and self.settings.arch == "armv8" \ + and self.options["openssl"].shared + + def build(self): + if not self._skip_test: + cmake = CMake(self) + if self.settings.os == "Android": + cmake.definitions["CONAN_LIBCXX"] = "" + openssl_version = Version(self.deps_cpp_info["openssl"].version) + if openssl_version.major == "1" and openssl_version.minor == "1": + cmake.definitions["OPENSSL_WITH_ZLIB"] = False + else: + cmake.definitions["OPENSSL_WITH_ZLIB"] = not self.options["openssl"].no_zlib + cmake.configure() + cmake.build() + + def test(self): + if not self._skip_test and not cross_building(self): + bin_path = os.path.join("bin", "digest") + self.run(bin_path, run_environment=True) + assert os.path.exists(os.path.join(self.deps_cpp_info["openssl"].rootpath, "licenses", "LICENSE")) From c21d14b9f0b36ada8717d5ad17270cb4399812c5 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 6 Oct 2022 00:25:00 +0900 Subject: [PATCH 314/561] (#13301) aws-checksums: add version 0.1.13 and update dependencies --- recipes/aws-checksums/all/conandata.yml | 3 +++ recipes/aws-checksums/all/conanfile.py | 20 ++++++++++---------- recipes/aws-checksums/config.yml | 2 ++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/recipes/aws-checksums/all/conandata.yml b/recipes/aws-checksums/all/conandata.yml index 9b15346931da6..ddf66e3fcf5ae 100644 --- a/recipes/aws-checksums/all/conandata.yml +++ b/recipes/aws-checksums/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.13": + url: "https://github.com/awslabs/aws-checksums/archive/v0.1.13.tar.gz" + sha256: "0f897686f1963253c5069a0e495b85c31635ba146cd3ac38cc2ea31eaf54694d" "0.1.12": url: "https://github.com/awslabs/aws-checksums/archive/v0.1.12.tar.gz" sha256: "394723034b81cc7cd528401775bc7aca2b12c7471c92350c80a0e2fb9d2909fe" diff --git a/recipes/aws-checksums/all/conanfile.py b/recipes/aws-checksums/all/conanfile.py index 2c30304453327..d3412c3a07b16 100644 --- a/recipes/aws-checksums/all/conanfile.py +++ b/recipes/aws-checksums/all/conanfile.py @@ -1,10 +1,9 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir import os -required_conan_version = ">=1.47.0" - +required_conan_version = ">=1.52.0" class AwsChecksums(ConanFile): name = "aws-checksums" @@ -12,11 +11,10 @@ class AwsChecksums(ConanFile): "Cross-Platform HW accelerated CRC32c and CRC32 with fallback to efficient " "SW implementations. C interface with language bindings for each of our SDKs." ) - topics = ("aws", "checksum", ) + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-checksums" - license = "Apache-2.0", - + topics = ("aws", "checksum", ) settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -28,8 +26,7 @@ class AwsChecksums(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -37,7 +34,10 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: del self.settings.compiler.libcxx except Exception: @@ -51,7 +51,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.6.19") + self.requires("aws-c-common/0.8.2") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/aws-checksums/config.yml b/recipes/aws-checksums/config.yml index 9f54b2f6052e0..55fedf4c307f5 100644 --- a/recipes/aws-checksums/config.yml +++ b/recipes/aws-checksums/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.13": + folder: all "0.1.12": folder: all "0.1.11": From bdde7ec2505b3f5f794b8e354ea58ad412d8fbba Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 6 Oct 2022 00:44:19 +0900 Subject: [PATCH 315/561] (#13302) aws-c-sdkutils: update dependencies and support conan v2 --- recipes/aws-c-sdkutils/all/CMakeLists.txt | 7 -- recipes/aws-c-sdkutils/all/conanfile.py | 67 ++++++++++--------- .../all/test_package/CMakeLists.txt | 3 - .../all/test_package/conanfile.py | 21 ++++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../all/test_v1_package/conanfile.py | 18 +++++ 6 files changed, 80 insertions(+), 47 deletions(-) delete mode 100644 recipes/aws-c-sdkutils/all/CMakeLists.txt create mode 100644 recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-sdkutils/all/CMakeLists.txt b/recipes/aws-c-sdkutils/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-c-sdkutils/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-sdkutils/all/conanfile.py b/recipes/aws-c-sdkutils/all/conanfile.py index 37509472eb1f5..43b3b4f755411 100644 --- a/recipes/aws-c-sdkutils/all/conanfile.py +++ b/recipes/aws-c-sdkutils/all/conanfile.py @@ -1,18 +1,17 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.43.0" - +required_conan_version = ">=1.52.0" class AwsCSDKUtils(ConanFile): name = "aws-c-sdkutils" - description = "aws c language sdk utility library." - topics = ("aws", "amazon", "cloud", "utility") + description = "C99 library implementing AWS SDK specific utilities. Includes utilities for ARN parsing, reading AWS profiles, etc..." + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-sdkutils" - license = "Apache-2.0", - exports_sources = "CMakeLists.txt", - generators = "cmake", "cmake_find_package_multi" + topics = ("aws", "amazon", "cloud", "utility", "ARN") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,45 +22,52 @@ class AwsCSDKUtils(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_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 - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.6.19") + self.requires("aws-c-common/0.8.2") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "lib", "aws-c-sdkutils")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-sdkutils")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-sdkutils") @@ -77,4 +83,3 @@ def package_info(self): self.cpp_info.components["aws-c-sdkutils-lib"].libs = ["aws-c-sdkutils"] self.cpp_info.components["aws-c-sdkutils-lib"].requires = ["aws-c-common::aws-c-common-lib"] - diff --git a/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt b/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt index 61121c6334930..4b5efc665c153 100644 --- a/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-sdkutils REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/aws-c-sdkutils/all/test_package/conanfile.py b/recipes/aws-c-sdkutils/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/aws-c-sdkutils/all/test_package/conanfile.py +++ b/recipes/aws-c-sdkutils/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e620de3b4bc3 --- /dev/null +++ b/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-sdkutils REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} AWS::aws-c-sdkutils) diff --git a/recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py b/recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From c4aacc908dafc7f88c34dfccdeaae4644e0d28c8 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 6 Oct 2022 01:04:31 +0900 Subject: [PATCH 316/561] (#13304) aws-c-io: add version 0.13.4 and support conan v2 --- recipes/aws-c-io/all/CMakeLists.txt | 7 -- recipes/aws-c-io/all/conandata.yml | 3 + recipes/aws-c-io/all/conanfile.py | 72 ++++++++++--------- .../aws-c-io/all/test_package/CMakeLists.txt | 3 - .../aws-c-io/all/test_package/conanfile.py | 20 ++++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../aws-c-io/all/test_v1_package/conanfile.py | 18 +++++ recipes/aws-c-io/config.yml | 2 + 8 files changed, 86 insertions(+), 49 deletions(-) delete mode 100644 recipes/aws-c-io/all/CMakeLists.txt create mode 100644 recipes/aws-c-io/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-io/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-io/all/CMakeLists.txt b/recipes/aws-c-io/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-c-io/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-io/all/conandata.yml b/recipes/aws-c-io/all/conandata.yml index 9893bcceca8e0..4a9102a6ede26 100644 --- a/recipes/aws-c-io/all/conandata.yml +++ b/recipes/aws-c-io/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.13.4": + url: "https://github.com/awslabs/aws-c-io/archive/v0.13.4.tar.gz" + sha256: "133bd0aa46caa2041962cd4f6d076209686ce2934af82f86d1a258df4cbdce8b" "0.11.2": url: "https://github.com/awslabs/aws-c-io/archive/v0.11.2.tar.gz" sha256: "b60270d23b6e2f4a5d80e64ca6538ba114cd6044b53752964c940f87e59bf0d9" diff --git a/recipes/aws-c-io/all/conanfile.py b/recipes/aws-c-io/all/conanfile.py index a460634d03107..84b513c37e69f 100644 --- a/recipes/aws-c-io/all/conanfile.py +++ b/recipes/aws-c-io/all/conanfile.py @@ -1,17 +1,18 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.43.0" - +required_conan_version = ">=1.52.0" class AwsCIO(ConanFile): name = "aws-c-io" description = "IO and TLS for application protocols" - topics = ("aws", "amazon", "cloud", "io", "tls",) + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-io" - license = "Apache-2.0", - + topics = ("aws", "amazon", "cloud", "io", "tls",) settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,58 +23,63 @@ class AwsCIO(ConanFile): "fPIC": True, } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_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 - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): # the versions of aws-c-common and aws-c-io are tied since aws-c-common/0.6.12 and aws-c-io/0.10.10 # Please refer https://github.com/conan-io/conan-center-index/issues/7763 - if tools.Version(self.version) <= "0.10.9": + if Version(self.version) <= "0.10.9": self.requires("aws-c-common/0.6.11") self.requires("aws-c-cal/0.5.11") else: - self.requires("aws-c-common/0.6.19") + self.requires("aws-c-common/0.8.2") self.requires("aws-c-cal/0.5.13") if self.settings.os in ["Linux", "FreeBSD", "Android"]: - self.requires("s2n/1.3.9") + self.requires("s2n/1.3.15") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "lib", "aws-c-io")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-io")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-io") diff --git a/recipes/aws-c-io/all/test_package/CMakeLists.txt b/recipes/aws-c-io/all/test_package/CMakeLists.txt index 819bf242a1b07..de3176cc25055 100644 --- a/recipes/aws-c-io/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-io/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-io REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/aws-c-io/all/test_package/conanfile.py b/recipes/aws-c-io/all/test_package/conanfile.py index 38f4483872d47..a9fbb7f543162 100644 --- a/recipes/aws-c-io/all/test_package/conanfile.py +++ b/recipes/aws-c-io/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -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", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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 +20,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e45dc2bc298c6 --- /dev/null +++ b/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-io REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} AWS::aws-c-io) diff --git a/recipes/aws-c-io/all/test_v1_package/conanfile.py b/recipes/aws-c-io/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-io/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-io/config.yml b/recipes/aws-c-io/config.yml index 5fac743e25830..6dca88e3f0554 100644 --- a/recipes/aws-c-io/config.yml +++ b/recipes/aws-c-io/config.yml @@ -1,4 +1,6 @@ versions: + "0.13.4": + folder: all "0.11.2": folder: all "0.10.20": From a345c53aecb46c14af2d4d300d0191e1548314f1 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 6 Oct 2022 01:44:25 +0900 Subject: [PATCH 317/561] (#13314) gcem: add version 1.16.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/gcem/all/conandata.yml | 3 +++ recipes/gcem/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/gcem/all/conandata.yml b/recipes/gcem/all/conandata.yml index c1f3e869f5737..58f1cc5b754a9 100644 --- a/recipes/gcem/all/conandata.yml +++ b/recipes/gcem/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.16.0": + url: "https://github.com/kthohr/gcem/archive/v1.16.0.tar.gz" + sha256: "119c742b9371c0adc7d9cd710c3cbc575459a98fb63f6be4c636215dcf8404ce" "1.14.1": url: "https://github.com/kthohr/gcem/archive/v1.14.1.tar.gz" sha256: "fd0860e89f47eeddf5a2280dd6fb3f9b021ce36fe8798116b3f703fa0e01409d" diff --git a/recipes/gcem/config.yml b/recipes/gcem/config.yml index 0a915e1d20f7d..cc18649bfe195 100644 --- a/recipes/gcem/config.yml +++ b/recipes/gcem/config.yml @@ -1,4 +1,6 @@ versions: + "1.16.0": + folder: all "1.14.1": folder: all "1.13.1": From 78ae8355a06ba0d214d3f39ec42fc1c1a0264505 Mon Sep 17 00:00:00 2001 From: chausner <15180557+chausner@users.noreply.github.com> Date: Wed, 5 Oct 2022 23:04:20 +0200 Subject: [PATCH 318/561] (#13247) [flatbuffers] update to 2.0.8 * Update flatbuffers to 2.0.8 * Fix version variables * Change CMake file names to lowercase * Add CMake build requirement Co-authored-by: chausner --- recipes/flatbuffers/all/conandata.yml | 3 +++ recipes/flatbuffers/all/conanfile.py | 19 ++++++++++++------- .../all/test_package/CMakeLists.txt | 2 +- .../all/test_v1_package/CMakeLists.txt | 2 +- recipes/flatbuffers/config.yml | 2 ++ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/recipes/flatbuffers/all/conandata.yml b/recipes/flatbuffers/all/conandata.yml index 1208a783b9e4f..e9889e6085f44 100644 --- a/recipes/flatbuffers/all/conandata.yml +++ b/recipes/flatbuffers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.8": + url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.8.tar.gz" + sha256: "f97965a727d26386afaefff950badef2db3ab6af9afe23ed6d94bfb65f95f37e" "2.0.6": url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.6.tar.gz" sha256: "e2dc24985a85b278dd06313481a9ca051d048f9474e0f199e372fea3ea4248c9" diff --git a/recipes/flatbuffers/all/conanfile.py b/recipes/flatbuffers/all/conanfile.py index ad32669a4f07f..7a56fe8b533bc 100644 --- a/recipes/flatbuffers/all/conanfile.py +++ b/recipes/flatbuffers/all/conanfile.py @@ -43,6 +43,10 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + def build_requirements(self): + if Version(self.version) >= "2.0.7": + self.tool_requires("cmake/3.24.0") + def configure(self): if self.options.shared or self.options.header_only: del self.options.fPIC @@ -77,9 +81,10 @@ def generate(self): tc.variables["FLATBUFFERS_LIBCXX_WITH_CLANG"] = False # Mimic upstream CMake/Version.cmake removed in _patch_sources() version = Version(self.version) - tc.variables["VERSION_MAJOR"] = version.major - tc.variables["VERSION_MINOR"] = version.minor - tc.variables["VERSION_PATCH"] = version.patch + tc.cache_variables["VERSION_MAJOR"] = str(version.major) + tc.cache_variables["VERSION_MINOR"] = str(version.minor or "0") + tc.cache_variables["VERSION_PATCH"] = str(version.patch or "0") + tc.cache_variables["VERSION_COMMIT"] = str(version.pre or "0") # For msvc shared tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True # Relocatable shared libs on Macos @@ -131,8 +136,8 @@ def _module_path(self): def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_module_file_name", "FlatBuffers") - self.cpp_info.set_property("cmake_file_name", "Flatbuffers") + self.cpp_info.set_property("cmake_module_file_name", "flatbuffers") + self.cpp_info.set_property("cmake_file_name", "flatbuffers") cmake_target = "flatbuffers" if not self.options.header_only and self.options.shared: cmake_target += "_shared" @@ -157,8 +162,8 @@ def package_info(self): self.env_info.PATH.append(bindir) # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "FlatBuffers" - self.cpp_info.filenames["cmake_find_package_multi"] = "Flatbuffers" + self.cpp_info.filenames["cmake_find_package"] = "flatbuffers" + self.cpp_info.filenames["cmake_find_package_multi"] = "flatbuffers" self.cpp_info.names["cmake_find_package"] = "flatbuffers" self.cpp_info.names["cmake_find_package_multi"] = "flatbuffers" self.cpp_info.components["libflatbuffers"].names["cmake_find_package"] = cmake_target diff --git a/recipes/flatbuffers/all/test_package/CMakeLists.txt b/recipes/flatbuffers/all/test_package/CMakeLists.txt index e6501abcaf1ef..e4d22dcbf68fe 100644 --- a/recipes/flatbuffers/all/test_package/CMakeLists.txt +++ b/recipes/flatbuffers/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -find_package(Flatbuffers REQUIRED CONFIG) +find_package(FlatBuffers REQUIRED CONFIG) if(TARGET flatbuffers::flatbuffers_shared) set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared) else() diff --git a/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt b/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt index 82b6707821d58..2afd0f99c22b5 100644 --- a/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt +++ b/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt @@ -4,7 +4,7 @@ project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Flatbuffers REQUIRED CONFIG) +find_package(FlatBuffers REQUIRED CONFIG) if(TARGET flatbuffers::flatbuffers_shared) set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared) else() diff --git a/recipes/flatbuffers/config.yml b/recipes/flatbuffers/config.yml index d58a0e5127c56..35c8973207d4c 100644 --- a/recipes/flatbuffers/config.yml +++ b/recipes/flatbuffers/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.8": + folder: all "2.0.6": folder: all "2.0.5": From 03246e9080a9edaa6c93e8af71c3ae0d791cb323 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 6 Oct 2022 10:04:01 +0200 Subject: [PATCH 319/561] (#13316) meson: add version 0.63.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/meson/all/conandata.yml | 3 +++ recipes/meson/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/meson/all/conandata.yml b/recipes/meson/all/conandata.yml index 8b3154bd5a7bf..29f846d5a47e1 100644 --- a/recipes/meson/all/conandata.yml +++ b/recipes/meson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.63.3": + url: "https://github.com/mesonbuild/meson/archive/0.63.3.tar.gz" + sha256: "7c516c2099b762203e8a0a22412aa465b7396e6f9b1ab728bad6e6db44dc2659" "0.63.2": url: "https://github.com/mesonbuild/meson/archive/0.63.2.tar.gz" sha256: "023a3f7c74e68991154c3205a6975705861eedbf8130e013d15faa1df1af216e" diff --git a/recipes/meson/config.yml b/recipes/meson/config.yml index 07ee0c49f572f..417cdad3ae238 100644 --- a/recipes/meson/config.yml +++ b/recipes/meson/config.yml @@ -1,4 +1,6 @@ versions: + "0.63.3": + folder: all "0.63.2": folder: all "0.63.1": From 847b782357f3ed4da6a466748d3c72e5f6712aeb Mon Sep 17 00:00:00 2001 From: Mikhail Lappo Date: Thu, 6 Oct 2022 16:04:05 +0200 Subject: [PATCH 320/561] (#13326) (#13323) Bump perfetto to v30.0 --- recipes/perfetto/all/conandata.yml | 3 +++ recipes/perfetto/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/perfetto/all/conandata.yml b/recipes/perfetto/all/conandata.yml index 97d1f0a4be081..e47390a0e2f0c 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -29,6 +29,9 @@ sources: "27.1": url: https://github.com/google/perfetto/archive/refs/tags/v27.1.tar.gz sha256: 9edbafd6e2d9feaced4c0153e2f48dbb1da38429c5b1b17dfee70a91fd3101b2 + "30.0": + url: https://github.com/google/perfetto/archive/refs/tags/v30.0.tar.gz + sha256: d1883793a2adb2a4105fc083478bf781badd566d72da45caa99095b61f938a2e patches: "20.1": diff --git a/recipes/perfetto/config.yml b/recipes/perfetto/config.yml index 8e798e3d0b667..6773354515f64 100644 --- a/recipes/perfetto/config.yml +++ b/recipes/perfetto/config.yml @@ -19,3 +19,5 @@ versions: folder: all "27.1": folder: all + "30.0": + folder: all From debec9e84823aac43ffb4bda9d9976ccf919c098 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Thu, 6 Oct 2022 15:23:51 +0100 Subject: [PATCH 321/561] (#13137) Pixman apply fix for clang-16 * [pixman] apply patch for clang-16 * [pixman] modernize * [pixman] use meson toolchain * [pixman] update test package * [pixman] fix windows build * [pixman] patch meson build for 0.38.4 * [pixman] document patch sources * [pixman] use virtual run environment in test package * [pixman] some modernization fixes * [pixman] add v1 test package * [pixman] update test packages * [pixman] conan targets disabled in test package * Revert "[pixman] conan targets disabled in test package" This reverts commit 8c7576c8a00819b164e7cf704959b80f3ce3f389. * [pixman] use multi-config generator in v1 package * Revert "[pixman] use multi-config generator in v1 package" This reverts commit e49dcac4a4303e07a95ffd7a8eccdf02f3dbd85c. * Revert "Revert "[pixman] use multi-config generator in v1 package"" This reverts commit acdf1ab83c5c16b730cc36abb5f6d38719c2c3a1. * [pixman] fix unformatted python string --- recipes/pixman/all/conandata.yml | 11 + recipes/pixman/all/conanfile.py | 114 ++++---- .../0001-incompatible-pointer-types.patch | 21 ++ .../pixman/all/patches/0002-meson-build.patch | 253 ++++++++++++++++++ .../pixman/all/test_package/CMakeLists.txt | 5 +- recipes/pixman/all/test_package/conanfile.py | 20 +- .../pixman/all/test_v1_package/CMakeLists.txt | 10 + .../pixman/all/test_v1_package/conanfile.py | 17 ++ 8 files changed, 375 insertions(+), 76 deletions(-) create mode 100644 recipes/pixman/all/patches/0001-incompatible-pointer-types.patch create mode 100644 recipes/pixman/all/patches/0002-meson-build.patch create mode 100644 recipes/pixman/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pixman/all/test_v1_package/conanfile.py diff --git a/recipes/pixman/all/conandata.yml b/recipes/pixman/all/conandata.yml index a4b924188fcf5..546b34a4fa24c 100644 --- a/recipes/pixman/all/conandata.yml +++ b/recipes/pixman/all/conandata.yml @@ -5,3 +5,14 @@ "0.38.4": "url": "https://www.cairographics.org/releases/pixman-0.38.4.tar.gz" "sha256": "da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7" +patches: + "0.38.4": + - patch_file: "patches/0002-meson-build.patch" + patch_description: "backport meson build files from 0.40.0 to fix windows build" + patch_type: "backport" + patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/tree/pixman-0.40.0" + "0.40.0": + - patch_file: "patches/0001-incompatible-pointer-types.patch" + patch_description: "backport fix for clang build" + patch_type: "backport" + patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/48" diff --git a/recipes/pixman/all/conanfile.py b/recipes/pixman/all/conanfile.py index ce1294aecf05b..5abb4216a4203 100644 --- a/recipes/pixman/all/conanfile.py +++ b/recipes/pixman/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools import files, microsoft +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.52.0" class PixmanConan(ConanFile): @@ -22,12 +27,6 @@ class PixmanConan(ConanFile): "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -47,79 +46,58 @@ def configure(self): del self.settings.compiler.cppstd def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("meson/0.63.2") + + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + tc = MesonToolchain(self) + tc.project_options.update({ + "libpng": "disabled", + "gtk": "disabled" + }) + tc.generate() + + env = VirtualBuildEnv(self) + env.generate() def validate(self): - if self.settings.os == "Windows" and self.options.shared: + if self.info.settings.os == "Windows" and self.info.options.shared: raise ConanInvalidConfiguration("pixman can only be built as a static library on Windows") + def export_sources(self): + files.export_conandata_patches(self) + def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + files.get(self, **self.conan_data["sources"][self.version], strip_root=True) def _patch_sources(self): - if self.settings.compiler == "Visual Studio": - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.win32.common"), - "-MDd ", "-{} ".format(str(self.settings.compiler.runtime))) - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.win32.common"), - "-MD ", "-{} ".format(str(self.settings.compiler.runtime))) - if tools.is_apple_os(self.settings.os): - # https://lists.freedesktop.org/archives/pixman/2014-November/003461.html - test_makefile = os.path.join(self._source_subfolder, "test", "Makefile.in") - tools.replace_in_file(test_makefile, - "region_test_OBJECTS = region-test.$(OBJEXT)", - "region_test_OBJECTS = region-test.$(OBJEXT) utils.$(OBJEXT)") - tools.replace_in_file(test_makefile, - "scaling_helpers_test_OBJECTS = scaling-helpers-test.$(OBJEXT)", - "scaling_helpers_test_OBJECTS = scaling-helpers-test.$(OBJEXT) utils.$(OBJEXT)") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - yes_no = lambda v: "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--disable-libpng", - "--disable-gtk", - ] - self._autotools.configure(configure_dir=self._source_subfolder, args=args) - return self._autotools + files.apply_conandata_patches(self) + files.replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('test')", "") + files.replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('demos')", "") def build(self): self._patch_sources() - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - make_vars = { - "MMX": "on" if self.settings.arch == "x86" else "off", - "SSE2": "on", - "SSSE3": "on", - "CFG": str(self.settings.build_type).lower(), - } - var_args = " ".join("{}={}".format(k, v) for k, v in make_vars.items()) - self.run("make -C {}/pixman -f Makefile.win32 {}".format(self._source_subfolder, var_args), - win_bash=True) - else: - autotools = self._configure_autotools() - autotools.make(target="pixman") + meson = Meson(self) + meson.configure() + meson.build() def package(self): - self.copy(os.path.join(self._source_subfolder, "COPYING"), dst="licenses") - if self.settings.compiler == "Visual Studio": - self.copy(pattern="*.lib", dst="lib", keep_path=False) - self.copy(pattern="*{}pixman.h".format(os.sep), dst=self._includedir, keep_path=False) - self.copy(pattern="*{}pixman-version.h".format(os.sep), dst=self._includedir, keep_path=False) - else: - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + meson = Meson(self) + meson.install() + + files.copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + lib_folder = os.path.join(self.package_folder, "lib") + files.rmdir(self, os.path.join(lib_folder, "pkgconfig")) + files.rm(self, "*.la", lib_folder) + if microsoft.is_msvc(self): + prefix = "libpixman-1" + files.rename(self, os.path.join(lib_folder, f"{prefix}.a"), os.path.join(lib_folder, f"{prefix}.lib")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = files.collect_libs(self) self.cpp_info.includedirs.append(self._includedir) - self.cpp_info.names["pkg_config"] = "pixman-1" + self.cpp_info.set_property("pkg_config_name", "pixman-1") if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch b/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch new file mode 100644 index 0000000000000..ee95a8b091433 --- /dev/null +++ b/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch @@ -0,0 +1,21 @@ +diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c +index 4cfabe3..3832e2b 100644 +--- a/pixman/pixman-bits-image.c ++++ b/pixman/pixman-bits-image.c +@@ -1051,14 +1051,14 @@ dest_write_back_narrow (pixman_iter_t *iter) + iter->y++; + } + +-static const float ++static float + dither_factor_blue_noise_64 (int x, int y) + { + float m = dither_blue_noise_64x64[((y & 0x3f) << 6) | (x & 0x3f)]; + return m * (1. / 4096.f) + (1. / 8192.f); + } + +-static const float ++static float + dither_factor_bayer_8 (int x, int y) + { + uint32_t m; diff --git a/recipes/pixman/all/patches/0002-meson-build.patch b/recipes/pixman/all/patches/0002-meson-build.patch new file mode 100644 index 0000000000000..6063b377301a8 --- /dev/null +++ b/recipes/pixman/all/patches/0002-meson-build.patch @@ -0,0 +1,253 @@ +diff --git a/meson.build b/meson.build +index fad22ee..519441b 100644 +--- a/meson.build ++++ b/meson.build +@@ -23,7 +23,7 @@ project( + ['c'], + version : '0.38.4', + license : 'MIT', +- meson_version : '>= 0.47.2', ++ meson_version : '>= 0.50.0', + default_options : ['buildtype=debugoptimized'], + ) + +@@ -36,6 +36,7 @@ add_project_arguments( + '-Wdeclaration-after-statement', + '-fno-strict-aliasing', + '-fvisibility=hidden', ++ '-Wundef', + ]), + language : ['c'] + ) +@@ -50,7 +51,7 @@ endforeach + + use_loongson_mmi = get_option('loongson-mmi') + have_loongson_mmi = false +-loongson_mmi_flags = ['-march=loongson2f'] ++loongson_mmi_flags = ['-mloongson-mmi'] + if not use_loongson_mmi.disabled() + if host_machine.cpu_family() == 'mips64' and cc.compiles(''' + #ifndef __mips_loongson_vector_rev +@@ -84,9 +85,17 @@ endif + + use_mmx = get_option('mmx') + have_mmx = false +-mmx_flags = ['-mmmx', '-Winline'] ++mmx_flags = [] ++ ++if cc.get_id() == 'msvc' ++ mmx_flags = ['/w14710', '/w14714', '/wd4244'] ++elif cc.get_id() == 'sun' ++ mmx_flags = ['-xarch=sse'] ++else ++ mmx_flags = ['-mmmx', '-Winline'] ++endif + if not use_mmx.disabled() +- if host_machine.cpu_family() == 'x86_64' ++ if host_machine.cpu_family() == 'x86_64' or cc.get_id() == 'msvc' + have_mmx = true + elif host_machine.cpu_family() == 'x86' and cc.compiles(''' + #include +@@ -127,14 +136,23 @@ if not use_mmx.disabled() + endif + + if have_mmx +- config.set10('USE_X86_MMX', true) ++ # Inline assembly do not work on X64 MSVC, so we use ++ # compatibility intrinsics there ++ if cc.get_id() != 'msvc' or host_machine.cpu_family() != 'x86_64' ++ config.set10('USE_X86_MMX', true) ++ endif + elif use_mmx.enabled() + error('MMX Support unavailable, but required') + endif + + use_sse2 = get_option('sse2') + have_sse2 = false +-sse2_flags = ['-msse2', '-Winline'] ++sse2_flags = [] ++if cc.get_id() == 'sun' ++ sse2_flags = ['-xarch=sse2'] ++elif cc.get_id() != 'msvc' ++ sse2_flags = ['-msse2', '-Winline'] ++endif + if not use_sse2.disabled() + if host_machine.cpu_family() == 'x86' + if cc.compiles(''' +@@ -169,8 +187,13 @@ endif + + use_ssse3 = get_option('ssse3') + have_ssse3 = false +-ssse3_flags =['-mssse3', '-Winline'] +-if not use_ssse3.disabled() ++ssse3_flags = [] ++if cc.get_id() != 'msvc' ++ ssse3_flags = ['-mssse3', '-Winline'] ++endif ++ ++# x64 pre-2010 MSVC compilers crashes when building the ssse3 code ++if not use_ssse3.disabled() and not (cc.get_id() == 'msvc' and cc.version().version_compare('<16') and host_machine.cpu_family() == 'x86_64') + if host_machine.cpu_family().startswith('x86') + if cc.compiles(''' + #include +@@ -349,14 +372,21 @@ if get_option('gnuplot') + config.set('PIXMAN_GNUPLOT', 1) + endif + +-dep_openmp = dependency('openmp', required : get_option('openmp')) +-if dep_openmp.found() +- config.set10('USE_OPENMP', true) +-elif meson.version().version_compare('<0.51.0') +-# In versions of meson before 0.51 the openmp dependency can still +-# inject arguments in the the auto case when it is not found, the +-# detection does work correctly in that case however, so we just +-# replace dep_openmp with null_dep to work around this. ++if cc.get_id() != 'msvc' ++ dep_openmp = dependency('openmp', required : get_option('openmp')) ++ if dep_openmp.found() ++ config.set10('USE_OPENMP', true) ++ elif meson.version().version_compare('<0.51.0') ++ # In versions of meson before 0.51 the openmp dependency can still ++ # inject arguments in the the auto case when it is not found, the ++ # detection does work correctly in that case however, so we just ++ # replace dep_openmp with null_dep to work around this. ++ dep_openmp = null_dep ++ endif ++else ++ # the MSVC implementation of openmp is not compliant enough for our ++ # uses here, so we disable it here. ++ # Please see: https://stackoverflow.com/questions/12560243/using-threadprivate-directive-in-visual-studio + dep_openmp = null_dep + endif + +@@ -364,17 +394,56 @@ dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk + dep_glib = dependency('glib-2.0', required : get_option('gtk')) + dep_pixman = dependency('pixman-1', required : get_option('gtk'), + version : '>= ' + meson.project_version()) +-dep_png = dependency('libpng', required : get_option('libpng')) ++ ++dep_png = null_dep ++if not get_option('libpng').disabled() ++ dep_png = dependency('libpng', required : false) ++ ++ # We need to look for the right library to link to for libpng, ++ # when looking for libpng manually ++ foreach png_ver : [ '16', '15', '14', '13', '12', '10' ] ++ if not dep_png.found() ++ dep_png = cc.find_library('libpng@0@'.format(png_ver), has_headers : ['png.h'], required : false) ++ endif ++ endforeach ++ ++ if get_option('libpng').enabled() and not dep_png.found() ++ error('libpng support requested but libpng library not found') ++ endif ++endif ++ + if dep_png.found() + config.set('HAVE_LIBPNG', 1) + endif + dep_m = cc.find_library('m', required : false) + dep_threads = dependency('threads') +-if dep_threads.found() ++ ++# MSVC-style compilers do not come with pthreads, so we must link ++# to it explicitly, currently pthreads-win32 is supported ++pthreads_found = false ++ ++if dep_threads.found() and cc.has_header('pthread.h') ++ if cc.get_argument_syntax() == 'msvc' ++ pthread_lib = null_dep ++ foreach pthread_type : ['VC3', 'VSE3', 'VCE3', 'VC2', 'VSE2', 'VCE2'] ++ if not pthread_lib.found() ++ pthread_lib = cc.find_library('pthread@0@'.format(pthread_type), required : false) ++ endif ++ endforeach ++ if pthread_lib.found() ++ pthreads_found = true ++ dep_threads = pthread_lib ++ endif ++ else ++ pthreads_found = true ++ endif ++endif ++ ++if pthreads_found + config.set('HAVE_PTHREADS', 1) + endif + +-funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap'] ++funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap', 'getisax', 'gettimeofday'] + # mingw claimes to have posix_memalign, but it doesn't + if host_machine.system() != 'windows' + funcs += 'posix_memalign' +@@ -386,10 +455,6 @@ foreach f : funcs + endif + endforeach + +-if cc.has_function('gettimeofday') +- config.set('HAVE_GETTIMEOFDAY', 1) +-endif +- + # This is only used in one test, that defines _GNU_SOURCE + if cc.has_function('feenableexcept', + prefix : '#define _GNU_SOURCE\n#include ', +@@ -407,8 +472,12 @@ foreach h : ['sys/mman.h', 'fenv.h', 'unistd.h'] + endif + endforeach + ++# gcc on Windows only warns that __declspec(thread) isn't supported, ++# passing -Werror=attributes makes it fail. + if (host_machine.system() == 'windows' and +- cc.compiles('int __declspec(thread) foo;', name : 'TLS via __declspec(thread)')) ++ cc.compiles('int __declspec(thread) foo;', ++ args : cc.get_supported_arguments(['-Werror=attributes']), ++ name : 'TLS via __declspec(thread)')) + config.set('TLS', '__declspec(thread)') + elif cc.compiles('int __thread foo;', name : 'TLS via __thread') + config.set('TLS', '__thread') +@@ -445,6 +514,8 @@ if host_machine.endian() == 'big' + config.set('WORDS_BIGENDIAN', 1) + endif + ++config.set('SIZEOF_LONG', cc.sizeof('long')) ++ + # Required to make pixman-private.h + config.set('PACKAGE', 'foo') + +diff --git a/pixman/meson.build b/pixman/meson.build +index 6ce87e7..f48357f 100644 +--- a/pixman/meson.build ++++ b/pixman/meson.build +@@ -30,6 +30,11 @@ version_h = configure_file( + install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'pixman-1') + ) + ++libpixman_extra_cargs = [] ++if cc.has_function_attribute('dllexport') ++ libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)'] ++endif ++ + pixman_simd_libs = [] + simds = [ + # the mmx library can be compiled with mmx on x86/x86_64, iwmmxt on +@@ -97,10 +102,18 @@ pixman_files = files( + 'pixman-utils.c', + ) + +-libpixman = shared_library( ++# We cannot use 'link_with' or 'link_whole' because meson wont do the right ++# thing for static archives. ++_obs = [] ++foreach l : pixman_simd_libs ++ _obs += l.extract_all_objects() ++endforeach ++ ++libpixman = library( + 'pixman-1', + [pixman_files, config_h, version_h], +- link_with : [pixman_simd_libs], ++ objects : _obs, ++ c_args : libpixman_extra_cargs, + dependencies : [dep_m, dep_threads], + version : meson.project_version(), + install : true, diff --git a/recipes/pixman/all/test_package/CMakeLists.txt b/recipes/pixman/all/test_package/CMakeLists.txt index 7b9b613cbb24a..f938457c94703 100644 --- a/recipes/pixman/all/test_package/CMakeLists.txt +++ b/recipes/pixman/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(pixman CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE pixman::pixman) diff --git a/recipes/pixman/all/test_package/conanfile.py b/recipes/pixman/all/test_package/conanfile.py index d4128b0450777..567553303012f 100644 --- a/recipes/pixman/all/test_package/conanfile.py +++ b/recipes/pixman/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools import build + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + 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 +22,6 @@ 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 build.can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pixman/all/test_v1_package/CMakeLists.txt b/recipes/pixman/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c26627b9ba7cf --- /dev/null +++ b/recipes/pixman/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(pixman REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pixman::pixman) diff --git a/recipes/pixman/all/test_v1_package/conanfile.py b/recipes/pixman/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3da371b660e0a --- /dev/null +++ b/recipes/pixman/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 8157c4409a1895ac3ddd5b839db84bca3ec1ff78 Mon Sep 17 00:00:00 2001 From: M Rota Date: Thu, 6 Oct 2022 16:44:14 +0200 Subject: [PATCH 322/561] (#13236) libmodbus: add version 3.1.8 * libmodbus: add version 3.1.8 (TODO: check if patches are still needed) * Add new MVSC patch (remove my_CFLAGS that contains only warning some of which are not valid) * Disable --without-documentation flag for 3.1.8 onwards * Update MSVC patch for 3.1.8 * rename patches for consistency --- recipes/libmodbus/all/conandata.yml | 7 +++++- recipes/libmodbus/all/conanfile.py | 3 ++- ...ixes.patch => 3.1.6-0001-msvc-fixes.patch} | 0 .../all/patches/3.1.8-0001-msvc-fixes.patch | 22 +++++++++++++++++++ recipes/libmodbus/config.yml | 2 ++ 5 files changed, 32 insertions(+), 2 deletions(-) rename recipes/libmodbus/all/patches/{0001-msvc-fixes.patch => 3.1.6-0001-msvc-fixes.patch} (100%) create mode 100644 recipes/libmodbus/all/patches/3.1.8-0001-msvc-fixes.patch diff --git a/recipes/libmodbus/all/conandata.yml b/recipes/libmodbus/all/conandata.yml index abf66781fb048..176711066e07f 100644 --- a/recipes/libmodbus/all/conandata.yml +++ b/recipes/libmodbus/all/conandata.yml @@ -1,7 +1,12 @@ sources: + "3.1.8": + url: "https://github.com/stephane/libmodbus/releases/download/v3.1.8/libmodbus-3.1.8.tar.gz" + sha256: "b122f2bc29f749702a22c0a760a7ca2182d541f5fa26bf25e3431f907b606f3c" "3.1.6": url: "https://libmodbus.org/releases/libmodbus-3.1.6.tar.gz" sha256: "d7d9fa94a16edb094e5fdf5d87ae17a0dc3f3e3d687fead81835d9572cf87c16" patches: + "3.1.8": + - patch_file: "patches/3.1.8-0001-msvc-fixes.patch" "3.1.6": - - patch_file: "patches/0001-msvc-fixes.patch" + - patch_file: "patches/3.1.6-0001-msvc-fixes.patch" diff --git a/recipes/libmodbus/all/conanfile.py b/recipes/libmodbus/all/conanfile.py index 312b39b90e05e..6ec4cc6934e03 100644 --- a/recipes/libmodbus/all/conanfile.py +++ b/recipes/libmodbus/all/conanfile.py @@ -80,7 +80,8 @@ def generate(self): env.generate() tc = AutotoolsToolchain(self) - tc.configure_args.append("--without-documentation") + if Version(self.version) < "3.1.8": + tc.configure_args.append("--without-documentation") tc.configure_args.append("--disable-tests") if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): diff --git a/recipes/libmodbus/all/patches/0001-msvc-fixes.patch b/recipes/libmodbus/all/patches/3.1.6-0001-msvc-fixes.patch similarity index 100% rename from recipes/libmodbus/all/patches/0001-msvc-fixes.patch rename to recipes/libmodbus/all/patches/3.1.6-0001-msvc-fixes.patch diff --git a/recipes/libmodbus/all/patches/3.1.8-0001-msvc-fixes.patch b/recipes/libmodbus/all/patches/3.1.8-0001-msvc-fixes.patch new file mode 100644 index 0000000000000..376a6b3f1ea82 --- /dev/null +++ b/recipes/libmodbus/all/patches/3.1.8-0001-msvc-fixes.patch @@ -0,0 +1,22 @@ +--- src/Makefile.in ++++ src/Makefile.in +@@ -326,7 +326,7 @@ + localstatedir = @localstatedir@ + mandir = @mandir@ + mkdir_p = @mkdir_p@ +-my_CFLAGS = @my_CFLAGS@ ++my_CFLAGS = + oldincludedir = @oldincludedir@ + pdfdir = @pdfdir@ + prefix = @prefix@ +--- src/modbus-private.h ++++ src/modbus-private.h +@@ -13,7 +13,7 @@ + #else + # include "stdint.h" + # include +-typedef int ssize_t; ++//typedef int ssize_t; + #endif + #include + #include diff --git a/recipes/libmodbus/config.yml b/recipes/libmodbus/config.yml index 150202a06b911..49c098a9b7d41 100644 --- a/recipes/libmodbus/config.yml +++ b/recipes/libmodbus/config.yml @@ -1,3 +1,5 @@ versions: + "3.1.8": + folder: all "3.1.6": folder: all From 56f9cdc7a925fa572b2b0f6212cd392fc2e1a5b0 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 6 Oct 2022 17:04:03 +0200 Subject: [PATCH 323/561] (#13328) ninja: add version 1.11.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/ninja/all/conandata.yml | 3 +++ recipes/ninja/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/ninja/all/conandata.yml b/recipes/ninja/all/conandata.yml index 2eabaa966d910..02891869efb97 100644 --- a/recipes/ninja/all/conandata.yml +++ b/recipes/ninja/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.11.1": + url: "https://github.com/ninja-build/ninja/archive/v1.11.1.tar.gz" + sha256: "31747ae633213f1eda3842686f83c2aa1412e0f5691d1c14dbbcc67fe7400cea" "1.11.0": url: "https://github.com/ninja-build/ninja/archive/v1.11.0.tar.gz" sha256: "3c6ba2e66400fe3f1ae83deb4b235faf3137ec20bd5b08c29bfc368db143e4c6" diff --git a/recipes/ninja/config.yml b/recipes/ninja/config.yml index bd5566773f233..0a0061dfb232d 100644 --- a/recipes/ninja/config.yml +++ b/recipes/ninja/config.yml @@ -1,4 +1,6 @@ versions: + "1.11.1": + folder: all "1.11.0": folder: all "1.10.2": From 47bac9d8b832dc9d6b7f60f6c1c77c5d0d16501f Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 6 Oct 2022 18:06:26 +0200 Subject: [PATCH 324/561] (#13309) Add KB-H072 and KB-H073 to docs * Add KB-H072 and KB-H073 to docs Signed-off-by: Uilian Ries * Update docs/error_knowledge_base.md Co-authored-by: Jordan Williams * Update docs/error_knowledge_base.md Co-authored-by: Jordan Williams * Update docs/error_knowledge_base.md Co-authored-by: Chris Mc * Update docs/error_knowledge_base.md Co-authored-by: Jordan Williams Signed-off-by: Uilian Ries Co-authored-by: Jordan Williams Co-authored-by: Chris Mc --- docs/error_knowledge_base.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/error_knowledge_base.md b/docs/error_knowledge_base.md index bbea3128fdd97..8b08e5b00ee35 100644 --- a/docs/error_knowledge_base.md +++ b/docs/error_knowledge_base.md @@ -463,6 +463,14 @@ def package_info(self): self.cpp_info.includedirs = [] ``` +#### **#KB-H072: "PYLINT EXECUTION"** + +Pylint is executed by default over all `conanfile.py` files in ConanCenterIndex and it should not be skipped. It's an important tool which helps us keep a standard level of acceptance. Otherwise, it would be incredibly hard to review all recipes and keep them to the same level of standards. + +#### **#KB-H073: "TEST V1 PACKAGE FOLDER"** + +The legacy content in test_package should not be removed. Instead, rename that folder to `test_v1_package` and create a new `test_package` folder following the [file structure](https://github.com/conan-io/conan-center-index/blob/master/docs/how_to_add_packages.md#recipe-files-structure) related to Conan v2 and v1 compatibility. Also, you can obtain good examples of Conan v2 test packages from the [template packages](https://github.com/conan-io/conan-center-index/tree/master/docs/package_templates) folder. + ## Deprecated errors The following errors from the hooks are deprecated and no longer reported: From 9cd0fcbc3478749ed78fd2ab510c20a2b2648b94 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 6 Oct 2022 18:24:15 +0200 Subject: [PATCH 325/561] (#13331) [docs] Apply python black formatter over recipe templates * Apply python black Signed-off-by: Uilian Ries * Update to 120 chars Signed-off-by: Uilian Ries * Update to 120 chars Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- .../autotools_package/all/conanfile.py | 28 +++++++---- .../cmake_package/all/conanfile.py | 43 ++++++++++------- .../header_only/all/conanfile.py | 26 ++++++---- .../msbuild_package/all/conanfile.py | 48 +++++++++++-------- .../prebuilt_tool_package/all/conanfile.py | 15 ++++-- .../all/test_package/conanfile.py | 4 +- 6 files changed, 103 insertions(+), 61 deletions(-) diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 6f71bb9b45ca6..4bb09b1419198 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -10,14 +10,21 @@ required_conan_version = ">=1.52.0" +# +# INFO: Please, remove all comments before pushing your PR! +# + class PackageConan(ConanFile): name = "package" description = "short description" - license = "" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" - topics = ("topic1", "topic2", "topic3") # no "conan" and project name in topics + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("topic1", "topic2", "topic3") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -42,23 +49,27 @@ def config_options(self): def configure(self): if self.options.shared: try: - del self.options.fPIC # once removed by config_options, need try..except for a second del + # once removed by config_options, need try..except for a second del + del self.options.fPIC except Exception: pass + # for plain C projects only try: - del self.settings.compiler.libcxx # for plain C projects only + del self.settings.compiler.libcxx except Exception: pass try: - del self.settings.compiler.cppstd # for plain C projects only + del self.settings.compiler.cppstd except Exception: pass def layout(self): - basic_layout(self, src_folder="src") # src_folder must use the same source folder name the project + # src_folder must use the same source folder name the project + basic_layout(self, src_folder="src") def requirements(self): - self.requires("dependency/0.8.1") # prefer self.requires method instead of requires attribute + # prefer self.requires method instead of requires attribute + self.requires("dependency/0.8.1") if self.options.with_foobar: self.requires("foobar/0.1.0") @@ -75,8 +86,7 @@ def build_requirements(self): self.tool_requires("pkgconf/x.y.z") 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], destination=self.source_folder, strip_root=True) def generate(self): # autotools usually uses 'yes' and 'no' to enable/disable options diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index 9f605b9822995..d9603ad628b6c 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -11,14 +11,21 @@ required_conan_version = ">=1.52.0" +# +# INFO: Please, remove all comments before pushing your PR! +# + class PackageConan(ConanFile): name = "package" description = "short description" - license = "" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" - topics = ("topic1", "topic2", "topic3") # no "conan" and project name in topics + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("topic1", "topic2", "topic3") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -54,23 +61,27 @@ def config_options(self): def configure(self): if self.options.shared: try: - del self.options.fPIC # once removed by config_options, need try..except for a second del + # once removed by config_options, need try..except for a second del + del self.options.fPIC except Exception: pass + # for plain C projects only try: - del self.settings.compiler.libcxx # for plain C projects only + del self.settings.compiler.libcxx except Exception: pass try: - del self.settings.compiler.cppstd # for plain C projects only + del self.settings.compiler.cppstd except Exception: pass def layout(self): - cmake_layout(self, src_folder="src") # src_folder must use the same source folder name the project + # src_folder must use the same source folder name the project + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("dependency/0.8.1") # prefer self.requires method instead of requires attribute + # prefer self.requires method instead of requires attribute + self.requires("dependency/0.8.1") def validate(self): # validate the minimum cpp standard supported. For C++ projects only @@ -80,7 +91,9 @@ def validate(self): if not is_msvc(self): minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, 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.info.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") @@ -90,8 +103,7 @@ def build_requirements(self): self.tool_requires("tool/x.y.z") 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], destination=self.source_folder, strip_root=True) def generate(self): # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist @@ -116,15 +128,10 @@ def _patch_sources(self): apply_conandata_patches(self) # remove bundled xxhash rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) - replace_in_file( - self, - os.path.join(self.source_folder, "CMakeLists.txt"), - "...", - "", - ) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "...", "") def build(self): - self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed + self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed cmake = CMake(self) cmake.configure() cmake.build() @@ -138,7 +145,7 @@ def package(self): rmdir(self, 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, "share")) - rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index 96ae97d1ec8d6..51cc820f18cfa 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -13,12 +13,16 @@ class PackageConan(ConanFile): name = "package" description = "short description" - license = "" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" - topics = ("topic1", "topic2", "topic3", "header-only") # no "conan" and project name in topics, keep 'header-only' - settings = "os", "arch", "compiler", "build_type" # even for header only - no_copy_source = True # do not copy sources to build folder for header only projects, unless, need to apply patches + # no "conan" and project name in topics. Use topics from the upstream listed on GH + # Keep 'hearder-only' as topic + topics = ("topic1", "topic2", "topic3", "header-only") + settings = "os", "arch", "compiler", "build_type" # even for header only + no_copy_source = True # do not copy sources to build folder for header only projects, unless, need to apply patches @property def _minimum_cpp_standard(self): @@ -59,7 +63,9 @@ def validate(self): check_min_cppstd(self, self._minimum_cpp_standard) minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) if minimum_version and Version(self.info.settings.get_safe("compiler.version")) < minimum_version: - raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) # in case it does not work in another configuration, it should validated here too if self.info.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} can not be used on Windows.") @@ -70,8 +76,7 @@ def build_requirements(self): def source(self): # download source package and extract to source folder - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) # not mandatory when there is no patch, but will suppress warning message about missing build() method def build(self): @@ -81,7 +86,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, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) def package_info(self): # folders not used for header-only diff --git a/docs/package_templates/msbuild_package/all/conanfile.py b/docs/package_templates/msbuild_package/all/conanfile.py index cc1c13ec4b812..5954e93a4051e 100644 --- a/docs/package_templates/msbuild_package/all/conanfile.py +++ b/docs/package_templates/msbuild_package/all/conanfile.py @@ -12,10 +12,13 @@ class PackageConan(ConanFile): name = "package" description = "short description" - license = "" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" - topics = ("topic1", "topic2", "topic3") # no "conan" and project name in topics + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("topic1", "topic2", "topic3") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -38,23 +41,27 @@ def config_options(self): def configure(self): if self.options.shared: try: - del self.options.fPIC # once removed by config_options, need try..except for a second del + # once removed by config_options, need try..except for a second del + del self.options.fPIC except Exception: pass + # for plain C projects only try: - del self.settings.compiler.libcxx # for plain C projects only + del self.settings.compiler.libcxx except Exception: pass try: - del self.settings.compiler.cppstd # for plain C projects only + del self.settings.compiler.cppstd except Exception: pass def layout(self): - vs_layout(self, src_folder="src") # src_folder must use the same source folder name the project + # src_folder must use the same source folder name the project + vs_layout(self, src_folder="src") def requirements(self): - self.requires("dependency/0.8.1") # prefer self.requires method instead of requires attribute + # prefer self.requires method instead of requires attribute + self.requires("dependency/0.8.1") def validate(self): # in case it does not work in another configuration, it should validated here too @@ -66,8 +73,7 @@ def build_requirements(self): self.tool_requires("tool/x.y.z") 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], destination=self.source_folder, strip_root=True) def generate(self): tc = MSBuildToolchain(self) @@ -81,15 +87,10 @@ def _patch_sources(self): apply_conandata_patches(self) # remove bundled xxhash rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) - replace_in_file( - self, - os.path.join(self.source_folder, "CMakeLists.txt"), - "...", - "", - ) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "...", "") def build(self): - self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed + self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed msbuild = MSBuild(self) # customize to Release when RelWithDebInfo msbuild.build_type = "Debug" if self.settings.build_type == "Debug" else "Release" @@ -100,9 +101,18 @@ def build(self): def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) - copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) - copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) + copy( + self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False + ) + copy( + self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False + ) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) def package_info(self): self.cpp_info.libs = ["package_lib"] diff --git a/docs/package_templates/prebuilt_tool_package/all/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/conanfile.py index b4b3859fcb0c8..92e54d11b0db4 100644 --- a/docs/package_templates/prebuilt_tool_package/all/conanfile.py +++ b/docs/package_templates/prebuilt_tool_package/all/conanfile.py @@ -11,11 +11,12 @@ class PackageConan(ConanFile): name = "package" description = "short description" - license = "" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + license = "" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" - topics = ("topic1", "topic2", "topic3", "pre-built") # no "conan" and project name in topics. Use "pre-built" for tooling packages - settings = "os", "arch", "compiler", "build_type" # even for pre-built executables + # no "conan" and project name in topics. Use "pre-built" for tooling packages + topics = ("topic1", "topic2", "topic3", "pre-built") + settings = "os", "arch", "compiler", "build_type" # even for pre-built executables # not needed but supress warning message from conan commands def layout(self): @@ -37,8 +38,12 @@ def source(self): # download the source here, than copy to package folder def build(self): - get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)], - destination=self.source_folder, strip_root=True) + get( + self, + **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)], + destination=self.source_folder, + strip_root=True, + ) # copy all needed files to the package folder def package(self): diff --git a/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py index b84c922d41cb0..74e84fd25127a 100644 --- a/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py +++ b/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py @@ -5,7 +5,7 @@ # It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "VirtualRunEnv" + generators = "VirtualBuildEnv" test_type = "explicit" def build_requirements(self): @@ -15,4 +15,4 @@ def test(self): if can_run(self): # self.run checks the command exit code # the tool must be available on PATH - self.run("tool --version", env="conanrun") + self.run("tool --version") From 22d8d24df06a8f807f23cf9814ba4061adaac319 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Thu, 6 Oct 2022 20:45:25 +0200 Subject: [PATCH 326/561] (#12881) Add mold 142 as build system changed from makefiles to cmake * add version 1.4.2 * add with_mimalloc option * add validate method * add cmake as build requrements * use minmalloc from conan * use minmalloc from conan * use tbb from conan * don't use cmake as requirement for old mold * hotfix * add cmake_find_package generator * add CMakeDeps * don't use old conans import * Update recipes/mold/1.4.x/conanfile.py Co-authored-by: Chris Mc * package licenses * make artifacts match settings * correct package method for mold 1.3.1 * package mold binary differently for gcc and clang * exclude windows builds * delete unneeded CMakeLists * Apply suggestions from code review Co-authored-by: Uilian Ries * import VirtualBuildEnv * add a newline * Apply suggestions from code review Co-authored-by: Uilian Ries * delete package id also for 1.3.1 version * use build_requirements instead of requirements in test * Apply suggestions from code review Co-authored-by: Uilian Ries * Update recipes/mold/1.4.x/test_package/conanfile.py Co-authored-by: Chris Mc * make mold test recipe work again * add version 1.5.1 * rename folder * add test_v1_package Co-authored-by: Chris Mc Co-authored-by: Uilian Ries --- recipes/mold/1.3.1/conandata.yml | 4 + recipes/mold/1.3.1/conanfile.py | 104 ++++++++++++++++++ recipes/mold/1.3.1/test_package/conanfile.py | 9 ++ recipes/mold/all/conandata.yml | 9 +- recipes/mold/all/conanfile.py | 95 ++++++++-------- recipes/mold/all/test_package/conanfile.py | 20 ++-- recipes/mold/all/test_v1_package/conanfile.py | 10 ++ recipes/mold/config.yml | 4 + 8 files changed, 196 insertions(+), 59 deletions(-) create mode 100644 recipes/mold/1.3.1/conandata.yml create mode 100644 recipes/mold/1.3.1/conanfile.py create mode 100644 recipes/mold/1.3.1/test_package/conanfile.py create mode 100644 recipes/mold/all/test_v1_package/conanfile.py diff --git a/recipes/mold/1.3.1/conandata.yml b/recipes/mold/1.3.1/conandata.yml new file mode 100644 index 0000000000000..5d89f31c243f2 --- /dev/null +++ b/recipes/mold/1.3.1/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.3.1.tar.gz" + sha256: "d436e2d4c1619a97aca0e28f26c4e79c0242d10ce24e829c1b43cfbdd196fd77" diff --git a/recipes/mold/1.3.1/conanfile.py b/recipes/mold/1.3.1/conanfile.py new file mode 100644 index 0000000000000..132186858b019 --- /dev/null +++ b/recipes/mold/1.3.1/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.tools.scm import Version +from conan.tools import files +from conan.tools.files import copy +from conan.errors import ConanInvalidConfiguration +from conans import AutoToolsBuildEnvironment +import os + +required_conan_version = ">=1.47.0" + +class MoldConan(ConanFile): + name = "mold" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rui314/mold/" + license = "AGPL-3.0" + description = ("mold is a faster drop-in replacement for existing Unix linkers. It is several times faster than the LLVM lld linker") + topics = ("mold", "ld", "linkage", "compilation") + + settings = "os", "arch", "compiler", "build_type" + + generators = "make" + + def validate(self): + if self.settings.build_type == "Debug": + raise ConanInvalidConfiguration('Mold is a build tool, specify mold:build_type=Release in your build profile, see https://github.com/conan-io/conan-center-index/pull/11536#issuecomment-1195607330') + if self.settings.compiler in ["gcc", "clang", "intel-cc"] and self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration('Mold can only be built with libstdc++11; specify mold:compiler.libcxx=libstdc++11 in your build profile') + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f'{self.name} can not be built on {self.settings.os}.') + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration("GCC version 10 or higher required") + if (self.settings.compiler == "clang" or self.settings.compiler == "apple-clang") and Version(self.settings.compiler.version) < "12": + raise ConanInvalidConfiguration("Clang version 12 or higher required") + if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : + raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def _get_include_path(self, dependency): + include_path = self.deps_cpp_info[dependency].rootpath + include_path = os.path.join(include_path, "include") + return include_path + + def _patch_sources(self): + if self.settings.compiler == "apple-clang" or (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "11"): + files.replace_in_file(self, "source_subfolder/Makefile", "-std=c++20", "-std=c++2a") + + files.replace_in_file(self, "source_subfolder/Makefile", "-Ithird-party/xxhash ", "-I{} -I{} -I{} -I{} -I{}".format( + self._get_include_path("zlib"), + self._get_include_path("openssl"), + self._get_include_path("xxhash"), + self._get_include_path("mimalloc"), + self._get_include_path("onetbb") + )) + + files.replace_in_file(self, "source_subfolder/Makefile", "MOLD_LDFLAGS += -ltbb", "MOLD_LDFLAGS += -L{} -ltbb".format( + self.deps_cpp_info["onetbb"].lib_paths[0])) + + files.replace_in_file(self, "source_subfolder/Makefile", "MOLD_LDFLAGS += -lmimalloc", "MOLD_LDFLAGS += -L{} -lmimalloc".format( + self.deps_cpp_info["mimalloc"].lib_paths[0])) + + def requirements(self): + self.requires("zlib/1.2.12") + self.requires("openssl/1.1.1q") + self.requires("xxhash/0.8.1") + self.requires("onetbb/2021.3.0") + self.requires("mimalloc/2.0.6") + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def build(self): + self._patch_sources() + with files.chdir(self, self._source_subfolder): + autotools = AutoToolsBuildEnvironment(self) + autotools.make(target="mold", args=['SYSTEM_TBB=1', 'SYSTEM_MIMALLOC=1']) + + def package(self): + copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "mold", src="bin", dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "mold", src=self._source_subfolder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + + def package_id(self): + del self.info.settings.compiler + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + mold_location = os.path.join(bindir, "bindir") + + self.output.info('Appending PATH environment variable: {}'.format(bindir)) + self.env_info.PATH.append(bindir) + self.env_info.LD = mold_location + self.buildenv_info.prepend_path("MOLD_ROOT", bindir) + self.cpp_info.includedirs = [] + + if self.settings.os == "Linux": + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/recipes/mold/1.3.1/test_package/conanfile.py b/recipes/mold/1.3.1/test_package/conanfile.py new file mode 100644 index 0000000000000..f4c00d1c189e7 --- /dev/null +++ b/recipes/mold/1.3.1/test_package/conanfile.py @@ -0,0 +1,9 @@ +from conan import ConanFile +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "arch", "build_type", "compiler" + + def test(self): + if not cross_building(self): + self.run("mold -v", run_environment=True) diff --git a/recipes/mold/all/conandata.yml b/recipes/mold/all/conandata.yml index 5d89f31c243f2..b90f73007307f 100644 --- a/recipes/mold/all/conandata.yml +++ b/recipes/mold/all/conandata.yml @@ -1,4 +1,7 @@ sources: - "1.3.1": - url: "https://github.com/rui314/mold/archive/refs/tags/v1.3.1.tar.gz" - sha256: "d436e2d4c1619a97aca0e28f26c4e79c0242d10ce24e829c1b43cfbdd196fd77" + "1.4.2": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.4.2.tar.gz" + sha256: "47e6c48d20f49e5b47dfb8197dd9ffcb11a8833d614f7a03bd29741c658a69cd" + "1.5.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.5.1.tar.gz" + sha256: "ec94aa74758f1bc199a732af95c6304ec98292b87f2f4548ce8436a7c5b054a1" diff --git a/recipes/mold/all/conanfile.py b/recipes/mold/all/conanfile.py index d04bcc560084e..fde5b3dec3293 100644 --- a/recipes/mold/all/conanfile.py +++ b/recipes/mold/all/conanfile.py @@ -1,11 +1,10 @@ +import os from conan import ConanFile -from conan.tools.scm import Version -from conan.tools import files +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import copy, get, rmdir from conan.errors import ConanInvalidConfiguration -from conans import AutoToolsBuildEnvironment -import os - -required_conan_version = ">=1.47.0" +from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv class MoldConan(ConanFile): name = "mold" @@ -16,8 +15,12 @@ class MoldConan(ConanFile): topics = ("mold", "ld", "linkage", "compilation") settings = "os", "arch", "compiler", "build_type" - - generators = "make" + options = { + "with_mimalloc": [True, False], + } + default_options = { + "with_mimalloc": False, + } def validate(self): if self.settings.build_type == "Debug": @@ -28,66 +31,57 @@ def validate(self): raise ConanInvalidConfiguration(f'{self.name} can not be built on {self.settings.os}.') if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "10": raise ConanInvalidConfiguration("GCC version 10 or higher required") - if (self.settings.compiler == "clang" or self.settings.compiler == "apple-clang") and Version(self.settings.compiler.version) < "12": + if self.settings.compiler in ('clang', 'apple-clang') and Version(self.settings.compiler.version) < "12": raise ConanInvalidConfiguration("Clang version 12 or higher required") if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def _get_include_path(self, dependency): - include_path = self.deps_cpp_info[dependency].rootpath - include_path = os.path.join(include_path, "include") - return include_path - - def _patch_sources(self): - if self.settings.compiler == "apple-clang" or (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "11"): - files.replace_in_file(self, "source_subfolder/Makefile", "-std=c++20", "-std=c++2a") - - files.replace_in_file(self, "source_subfolder/Makefile", "-Ithird-party/xxhash ", "-I{} -I{} -I{} -I{} -I{}".format( - self._get_include_path("zlib"), - self._get_include_path("openssl"), - self._get_include_path("xxhash"), - self._get_include_path("mimalloc"), - self._get_include_path("onetbb") - )) + def layout(self): + cmake_layout(self, src_folder="src") - files.replace_in_file(self, "source_subfolder/Makefile", "MOLD_LDFLAGS += -ltbb", "MOLD_LDFLAGS += -L{} -ltbb".format( - self.deps_cpp_info["onetbb"].lib_paths[0])) + def package_id(self): + del self.info.settings.compiler - files.replace_in_file(self, "source_subfolder/Makefile", "MOLD_LDFLAGS += -lmimalloc", "MOLD_LDFLAGS += -L{} -lmimalloc".format( - self.deps_cpp_info["mimalloc"].lib_paths[0])) + def build_requirements(self): + self.tool_requires("cmake/3.24.1") def requirements(self): self.requires("zlib/1.2.12") self.requires("openssl/1.1.1q") self.requires("xxhash/0.8.1") self.requires("onetbb/2021.3.0") - self.requires("mimalloc/2.0.6") + if self.options.with_mimalloc: + self.requires("mimalloc/2.0.6") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MOLD_USE_MIMALLOC"] = self.options.with_mimalloc + tc.variables["MOLD_USE_SYSTEM_MIMALLOC"] = True + tc.variables["MOLD_USE_SYSTEM_TBB"] = True + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + tc = VirtualBuildEnv(self) + tc.generate() def build(self): - self._patch_sources() - with files.chdir(self, self._source_subfolder): - autotools = AutoToolsBuildEnvironment(self) - autotools.make(target="mold", args=['SYSTEM_TBB=1', 'SYSTEM_MIMALLOC=1']) + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("mold", src=self._source_subfolder, dst="bin", keep_path=False) - - def package_id(self): - del self.info.settings.compiler + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + def package_info(self): bindir = os.path.join(self.package_folder, "bin") mold_location = os.path.join(bindir, "bindir") @@ -97,6 +91,9 @@ def package_info(self): self.env_info.LD = mold_location self.buildenv_info.prepend_path("MOLD_ROOT", bindir) self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.resdirs = [] if self.settings.os == "Linux": self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/recipes/mold/all/test_package/conanfile.py b/recipes/mold/all/test_package/conanfile.py index ce72e1030b169..60e9ac3ecf6ee 100644 --- a/recipes/mold/all/test_package/conanfile.py +++ b/recipes/mold/all/test_package/conanfile.py @@ -1,10 +1,16 @@ -import os -from conans import ConanFile, tools -from conan.tools.build import cross_building +from conan import ConanFile +from conan.tools.build import can_run -class TestPackageConan(ConanFile): - settings = "os", "arch", "build_type", "compiler" + +class MoldTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - if not cross_building(self): - self.run("mold -v", run_environment=True) + if can_run(self): + self.run("mold -v") + diff --git a/recipes/mold/all/test_v1_package/conanfile.py b/recipes/mold/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ce72e1030b169 --- /dev/null +++ b/recipes/mold/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +import os +from conans import ConanFile, tools +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "arch", "build_type", "compiler" + + def test(self): + if not cross_building(self): + self.run("mold -v", run_environment=True) diff --git a/recipes/mold/config.yml b/recipes/mold/config.yml index 59334d5077368..73995b17f00b1 100644 --- a/recipes/mold/config.yml +++ b/recipes/mold/config.yml @@ -1,3 +1,7 @@ versions: "1.3.1": + folder: 1.3.1 + "1.4.2": + folder: all + "1.5.1": folder: all From 318053389c781d02566c2609e9e77a1e205ca00a Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 6 Oct 2022 12:06:22 -0700 Subject: [PATCH 327/561] (#13102) docs: Document working locally + Conan 2.0 commands * docs: Document working locally + Conan 2.0 commands I also snuck in some format and link fixes * Apply suggestions from code review Co-authored-by: Uilian Ries * Update docs/README.md * Update docs/developing_recipes_locally.md * Apply suggestions from code review Co-authored-by: Jordan Williams * Update CONTRIBUTING.md Co-authored-by: Uilian Ries * merge linters into dev locally * links and touch ups * fix links * Apply suggestions from code review Co-authored-by: Jordan Williams Co-authored-by: Uilian Ries Co-authored-by: Jordan Williams --- CONTRIBUTING.md | 30 ++-- docs/README.md | 17 ++- docs/consuming_recipes.md | 8 +- docs/developing_recipes_locally.md | 214 +++++++++++++++++++++++++++++ docs/how_to_add_packages.md | 61 +++----- docs/labels.md | 23 +++- docs/linters.md | 60 ++++---- docs/review_process.md | 7 +- docs/v2_linter.md | 31 +---- 9 files changed, 312 insertions(+), 139 deletions(-) create mode 100644 docs/developing_recipes_locally.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 22027379ce53b..8a8847b489ef4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,27 +11,28 @@ The following summarizes the process for contributing to the CCI (Conan Center I ## Community -Conan Center Index is an Open Source MIT licensed project. -Conan Center Index is developed by the Conan maintainers and a great community of contributors. +ConanCenterIndex is an Open Source MIT licensed project; it is developed by the Conan maintainers and a great community of contributors. ## Dev-flow & Pull Requests CCI follows the ["GitFlow"](https://datasift.github.io/gitflow/IntroducingGitFlow.html) branching model. Issues are triaged and categorized mainly by type (package request, bug...) and priority (high, medium...) using GitHub - labels. +labels. To contribute follow the next steps: 1. Comment in the corresponding issue that you want to contribute the package/fix proposed. If there is no open issue, we strongly suggest - to open one to gather feedback. -2. Check the [how_to_add_packages.md](docs/how_to_add_packages.md) if are - contributing for a new package. -3. Fork the [CCI repository](https://github.com/conan-io/conan-center-index) and create a `package/xxx` branch from the `master` branch and develop + opening one to gather feedback. +2. Get setup by following [Developing Recipes](docs/developing_recipes_locally.md) guide and learn the basic commands. +3. Check the [How To Add Packages](docs/how_to_add_packages.md) for the break down ConanCenterIndex specific conventions and practices. +4. In your fork create a `package/xxx` branch from the `master` branch and develop your fix/packages as discussed in previous step. -4. Try to keep your branch updated with the `master` branch to avoid conflicts. -5. Add the text (besides other comments): "fixes #IssueNumber" in the body of the PR, referring to the issue of step 1. +5. [Submit a pull request](docs/how_to_add_packages.md#submitting-a-package) once you are ready. This can be when you + got everything working or even if you need help. Add the text to the issue body (besides other comments): "fixes #IssueNumber" + in the body of the PR, referring to the issue of step 1. -The ``conan-io`` organization maintainers will review and help with the packaging. +The Conan Community works hard to review all the pull requests and provided assistance where need. +The [Review Process](docs/review_process.md) is partially automated with the help of @conan-center-index-bot :rocket: ## Issues @@ -50,10 +51,5 @@ For any suggestion, feature request or question open an issue indicating the fol - Try to explain the motivation, what are you trying to do, what is the pain it tries to solve. - What do you expect from CCI. -We use the following tags to control the status of the issues: - -- **infrastructure**: Waiting on tools or services belonging to the infra. -- **library request**: Request a new package to be created. -- **question**: Further information is requested . -- **upstream update**: Bump a new package version. -- **conan.io/center**: Issues and features related to Web UI . +We use the following tags to control the status of the issues and pull requests, you can learn more in [Labels](docs/labels.md) document +which details the important one and their roles. diff --git a/docs/README.md b/docs/README.md index bd72287edf75b..fa7ea9eebb77b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,9 @@ +This repository, ConanCenterIndex, contains recipes for the remote [JFrog ConanCenter](https://conan.io/center/). +This remote is added by default to a clean installation of the Conan client. Recipes are contributed by opening pull requests as explained in the sections below. +When pull requests are merged, the CI will upload the generated packages to the [ConanCenter](https://conan.io/center/) remote. + # Documentation * [Code of conduct](code_of_conduct.md) @@ -7,14 +11,13 @@ * User documentation + [Contributing to Conan Center Index](../CONTRIBUTING.md) - + [Adding Packages to ConanCenter](how_to_add_packages.md) - + [Policy about patching](policy_patching.md) + + [Developing Recipes Locally](developing_recipes_locally.md) + + [Adding Packages to ConanCenter](how_to_add_packages.md) :point_left: Best place to learn how to contribute + + [Errors from the conan-center hook (KB-Hxxx)](error_knowledge_base.md) + [Review Process](review_process.md) - + [Packaging policy](packaging_policy.md) + + [Labels](labels.md) + [Supported platforms and configurations](supported_platforms_and_configurations.md) - + [Errors from the conan-center hook (KB-Hxxx)](error_knowledge_base.md) - + [FAQs](faqs.md) + + [Consuming Recipes](consuming_recipes.md) :information_source: Learn how to limit the impact of recipe changes + [Community Resources](community_resources.md) - + [Review Guidelines](reviewing.md) - + [Labels](labels.md) + [Preparing recipes for Conan 2.0](v2_migration.md) + + [FAQs](faqs.md) diff --git a/docs/consuming_recipes.md b/docs/consuming_recipes.md index 4e01f50335197..ee80883fc7130 100644 --- a/docs/consuming_recipes.md +++ b/docs/consuming_recipes.md @@ -32,7 +32,7 @@ There can be several causes if a recipe (a new revision) might stopped to work i This use case is covered by the [`required_conan_version`](https://docs.conan.io/en/latest/reference/conanfile/other.html?highlight=required_conan_version#requiring-a-conan-version-for-the-recipe) feature. It will substitute the syntax error by one nicer error provided by Conan client. - + To be sure that people using these new experimental features are using the required Conan version and testing the actual behavior of those features (feedback about them is very important to Conan). @@ -47,8 +47,8 @@ Here are a few choices: - [Running your own Conan Server](https://docs.conan.io/en/latest/uploading_packages/running_your_server.html) - great for local ad-hoc setups - [Cache recipes in your own ArtifactoryCE](https://docs.conan.io/en/latest/uploading_packages/using_artifactory.html) - recommended for production environments -Using your own ArtifactoryCE instance is easy. You can [deploy it on-premise](https://conan.io/downloads.html) or use a -[cloud provided solution](https://jfrog.com/community/start-free) for **free**. Your project should +Using your own ArtifactoryCE instance is easy. You can [deploy it on-premise](https://conan.io/downloads.html) or use a +[cloud provided solution](https://jfrog.com/community/start-free) for **free**. Your project should [use only this remote](https://docs.conan.io/en/latest/reference/commands/misc/remote.html?highlight=add%20new) and new recipe revisions are only pushed to your Artifactory after they have been validated in your project. @@ -59,7 +59,7 @@ The minimum solution, if still choosing to rely on ConanCenter directly, involve This feature needs to be enabled in Conan 1.x, see the [Activation Instructions](https://docs.conan.io/en/latest/versioning/revisions.html#how-to-activate-the-revisions) for details. - [Lockfiles](https://docs.conan.io/en/latest/versioning/lockfiles.html) can be created with the `conan lock create` and read with by adding `--lockfile=conan.lock` to `conan install` or `conan create` commands. See the [lockfile introduction](https://docs.conan.io/en/latest/versioning/lockfiles/introduction.html#) for more information. - + > **Warning** Please, be aware there are some known bugs related to lockfiles that are not being fixed in Conan v1.x - we are really excited for the 2.0 improvements to be widely used. Both of these give you better control and will allow you to choose when to upgrade your Conan client. diff --git a/docs/developing_recipes_locally.md b/docs/developing_recipes_locally.md new file mode 100644 index 0000000000000..682ae2dd3eee0 --- /dev/null +++ b/docs/developing_recipes_locally.md @@ -0,0 +1,214 @@ +# Developing Recipes Locally + +Before you can contribute any code changes, you'll need to make sure you are familiar with the Conan client and have an environment that is conducive to developing recipes. + +This file is intended to provide all the commands you need to run in order to be an expert ConanCenter contributor. + + +## Contents + + * [Clone your fork](#clone-your-fork) + * [Setup your environment](#setup-your-environment) + * [Installing the ConanCenter Hooks](#installing-the-conancenter-hooks) + * [Updating conan hooks on your machine](#updating-conan-hooks-on-your-machine) + * [Basic Commands](#basic-commands) + * [Try it yourself](#try-it-yourself) + * [Debugging Failed Builds](#debugging-failed-builds) + * [Running the Python Linters](#running-the-python-linters) + * [Testing the different `test__package`](#testing-the-different-test__package) + * [Testing more environments](#testing-more-environments) + * [Using Conan 2.0](#using-conan-20) + +## Clone your fork + +1. Follow the GitHub UI to [fork this repository](https://github.com/conan-io/conan-center-index/fork) +2. [Clone your fork](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) + +## Setup your environment + +1. Install a C++ development toolchain - ConanCenter's [build images](#testing-more-environments) are available +2. [Install the Conan client](https://docs.conan.io/en/latest/installation.html) - make sure to keep it up to date! +3. Install CMake - this is the only tool which is assumed to be present + [see FAQ](faqs.md#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default) for details. + +> **Note**: It's recommended to use a dedicated Python virtualenv when installing with `pip`. + +### Installing the ConanCenter Hooks + +The system will use the [conan-center hooks](https://github.com/conan-io/hooks) to perform some quality checks. You can install the hooks by running: + +```sh +conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks +conan config set hooks.conan-center +``` + +The hooks will show error messages but the `conan create` won’t fail unless you export the environment variable `CONAN_HOOK_ERROR_LEVEL=40`. +All hooks checks will print a similar message: + +```txt +[HOOK - conan-center.py] post_source(): [LIBCXX MANAGEMENT (KB-H011)] OK +[HOOK - conan-center.py] post_package(): ERROR: [PACKAGE LICENSE] No package licenses found +``` + +#### Updating conan hooks on your machine + +The hooks are updated from time to time, so it's worth keeping your own copy of the hooks updated regularly. To do this, simply run: + +```sh +conan config install +``` + +## Basic Commands + +We recommend working from the `recipes/project` folder itself. You can learn about the [recipe file structure](how_to_add_packages.md#recipe-files-structure) to understand the folder and files located there. + +> **Note**: You can only change one recipe per pull request, and working from the [_recipe folder_](how_to_add_packages.md#the-recipe-folder-conanfilepy) will help prevent making a few mistakes. The default for this folder is `all`, follow the link above to learn more. + +The [entire workflow of a recipe](https://docs.conan.io/en/latest/developing_packages/package_dev_flow.html) can be execute with the [`conan create`](https://docs.conan.io/en/latest/reference/commands/creator/create.html). This should look like: + +* `conan create all/conanfile.py 0.0.0@ -pr:b=default -pr:h=default` + +ConanCenter also has a few [support settings and options](supported_platforms_and_configurations.md) which highly recommend to test. For example +`conan create all/conanfile.py 0.0.0@ -o project:shared=True -s build_type=Debug` is a easy way to test more configurations ensuring the package is correct. + +### Try it yourself + +For instance you can create packages for `fmt` in various supported configurations by running: + +```sh +cd recipes/fmt +conan create all/conanfile.py fmt/9.0.0@ -pr:b=default -pr:h=default +conan create all/conanfile.py fmt/9.0.0@ -o fmt:header_only=True -pr:b=default -pr:h=default +conan create all/conanfile.py fmt/9.0.0@ -s build_type=Debug -o fmt:shared=True -pr:b=default -pr:h=default +``` + +## Debugging Failed Builds + +Some common errors related to Conan can be found on [troubleshooting](https://docs.conan.io/en/latest/faq/troubleshooting.html) section. +For ConanCenter Hook errors, go to the [Error Knowledge Base](error_knowledge_base.md) page to know more about those. + +To test with the same environment, the [build images](supported_platforms_and_configurations.md#build-images) are available. +Instructions for using these images can be found in [Testing more environments](#testing-more-environments) section. + +In ConanCenterIndex, the most common failure point is upstream +build script that are tailored to their specific use cases. It's not uncommon to [patch build scripts](policy_patching.md#policy-about-patching) but make sure to read the [patch policy](policy_patching.md). You are encouraged to submit pull requests upstream. + +## Running the Python Linters + +Linters are always executed by Github actions to validate parts of your recipe, for instance, if it uses migrated Conan tools imports. + +It is possible to run the linter locally the same way it is being run [using Github actions](../.github/workflows/linter-conan-v2.yml) by: + +* (Recommended) Use a dedicated Python virtualenv. +* Ensure you have required tools installed: `conan` and `pylint` (better to uses fixed versions) + + ```sh + pip install conan~=1.0 pylint==2.14 + ``` + +* Set environment variable `PYTHONPATH` to the root of the repository + + ```sh + export PYTHONPATH=your/path/conan-center-index + ``` + +* Now you just need to execute the `pylint` commands: + + ```sh + # Lint a recipe: + pylint --rcfile=linter/pylintrc_recipe recipes/fmt/all/conanfile.py + + # Lint the test_package + pylint --rcfile=linter/pylintrc_testpackage recipes/fmt/all/test_package/conanfile.py + ``` + +## Testing the different `test_*_package` + +This can be selected when calling `conan create` or separately with `conan test` + +```sh +# By adding the `-tf` argument +conan create recipes/fmt/all/conanfile.py 9.0.0@ -tf test_v1_package/ -pr:b=default -pr:h=default +``` + +```sh +# Passing test package's conanfile directly (make sure to export first) +conan test recipes/fmt/all/test_v1_package/conanfile.py fmt/9.0.0@ -pr:h=default -pr:b=default +``` + +## Testing more environments + +This can be difficult for some platforms given virtualization support. + +For Windows and MacOS users, you can test the Linux build environments with the Docker build images. + +Assuming you've already tested it locally and it's been successfully exported to your cache, you can: + +1. Creating a new profile. + * You can also download them from CCI build summary +2. Build missing packages + +Example. + +```sh +docker run -v/Users/barbarian/.conan:/home/conan/.conan conanio/gcc8 bash -c "conan profile new --detect gcc8" +docker run -v/Users/barbarian/.conan:/home/conan/.conan conanio/gcc8 bash -c "conan install -pr gcc8 fmt/9.0.0@ --build missing" +``` + +> **Note**: If you are running on Mac M1, the follow Docker argument is required: `--platform=linux/amd64` + +## Using Conan 2.0 + +Everything you need to know about the methods, commands line, outputs can be found in the +[Conan 2.0 Migrations](https://docs.conan.io/en/latest/conan_v2.html) docs. + +This should be non-intrusive. Conan 2.0 by default has a different `CONAN_USER_HOME` location, which means that it has separate caches, profiles, and settings. +This will leave your Conan 1.0 setup completely intact when using Conan 2.0. + +> **Note**: There are substantial changes to the CLI so very few of the commands will remain the same. +> The new [Unified Command Pattern](https://docs.conan.io/en/latest/migrating_to_2.0/commands.html#unified-patterns-in-command-arguments), +> as an example, changes how settings and options are passed. + +### Installing Conan 2.0 beta + +Simply install Conan 2.0 with `pip install conan --upgrade --pre`. + +You can confirm the installation with: + +```sh +$ conan --version +Conan version 2.0.0-beta3 +$ conan config home +Current Conan home: /Users/barbarian/.conan2 +``` + +> **Note**: You will most likely see +> +> ```sh +> Initialized file: '/Users/barbarian/.conan2/settings.yml' +> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/compatibility.py' +> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/app_compat.py' +> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/cppstd_compat.py' +> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/profile.py' +> ``` +> +> When running the client for the first time. + +You will need to setup profiles. This is one of the changes in 2.0. The default profile is now opt-in and no longer generated automatically. + +```sh +conan profile detect +``` + +> **Warning**: This is a best guess, you need to make sure it's correct. + +### Trying it out + +Try building an existing recipe. We'll repeat the 1.x example with `fmt` to build the same configurations: + +```sh +cd recipes/fmt +conan create all/conanfile.py --version 9.0.0 +conan create all/conanfile.py --version 9.0.0 -o fmt/9.0.0:header_only=True +conan create all/conanfile.py --version 9.0.0 -s build_type=Debug -o fmt/9.0.0:shared=True +``` diff --git a/docs/how_to_add_packages.md b/docs/how_to_add_packages.md index 6a48eaf22075b..a0457a78b8d51 100644 --- a/docs/how_to_add_packages.md +++ b/docs/how_to_add_packages.md @@ -1,8 +1,11 @@ # Adding Packages to ConanCenter -The [conan-center-index](https://github.com/conan-io/conan-center-index) (this repository) contains recipes for the remote [JFrog ConanCenter](https://conan.io/center/). -This remote is added by default to a clean installation of the Conan client. Recipes are contributed by opening pull requests as explained in the sections below. -When pull requests are merged, the CI will upload the generated packages to the [conancenter](https://conan.io/center/) remote. +ConanCenterIndex aims to provide the best quality packages of any open source project. +Any C/C++ project can be made available by contributing a "recipe". + +Getting started is easy. Try building an existing package with our [developing recipes](developing_recipes_locally.md) tutorial. +To deepen you understanding, start with the [How to provide a good recipe](#how-to-provide-a-good-recipe) section. +You can follow the three steps (:one: :two: :three:) described below! :tada: ## Contents @@ -27,9 +30,7 @@ When pull requests are merged, the CI will upload the generated packages to the * [Verifying Dependency Options](#verifying-dependency-options) * [Test the recipe locally](#test-the-recipe-locally) * [Hooks](#hooks) - * [Updating conan hooks on your machine](#updating-conan-hooks-on-your-machine) - * [Linters](#linters) - * [Debugging failed builds](#debugging-failed-builds) + * [Linters](#linters) ## Request access @@ -154,13 +155,14 @@ Also, **every `conanfile.py` should be accompanied by one or several folder to t All the packages in this repository need to be tested before they join ConanCenter. A `test_package` folder with its corresponding `conanfile.py` and a minimal project to test the package is strictly required. You can read about it in the - [Conan documentation](https://docs.conan.io/en/latest/creating_packages/getting_started.html). + Sometimes it is useful to test the package using different build systems (CMake, Autotools,...). Instead of adding complex logic to one `test_package/conanfile.py` file, it is better to add another `test_/conanfile.py` file with a minimal example for that build system. That way the examples will be short and easy to understand and maintain. In some other situations it could be useful to test different Conan generators -(`cmake_find_package`, `CMakeDeps`,...) using different folders and `conanfile.py` files ([see example](https://github.com/conan-io/conan-center-index/tree/master/recipes/fmt/all)). +(`cmake_find_package`, `CMakeDeps`,...) using different folders and `conanfile.py` files +([see example](https://github.com/conan-io/conan-center-index/tree/master/recipes/fmt/all)). When using more than one `test_` folder, create a different project for each of them to keep the content of the `conanfile.py` and the project files as simple as possible, without the need of extra logic to handle different scenarios. @@ -260,46 +262,17 @@ An example of this can be found in the [sdl_image recipe](https://github.com/con ### Hooks -The system will use the [conan-center hook](https://github.com/conan-io/hooks) to perform some quality checks. You can install the hook running: - -```sh -conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks -conan config set hooks.conan-center -``` - -The hook will show error messages but the `conan create` won’t fail unless you export the environment variable `CONAN_HOOK_ERROR_LEVEL=40`. -All hook checks will print a similar message: - -``` -[HOOK - conan-center.py] post_source(): [LIBCXX MANAGEMENT (KB-H011)] OK -[HOOK - conan-center.py] post_package(): ERROR: [PACKAGE LICENSE] No package licenses found -``` - -Call `conan create . lib/1.0@ -pr:b=default -pr:h=default` in the folder of the recipe using the profile you want to test. For instance: +The system will use the [conan-center hook](https://github.com/conan-io/hooks) to perform some quality checks. These are required for the +the CI to merge any pull request. -```sh -cd conan-center-index/recipes/boost/all -conan create conanfile.py boost/1.77.0@ -pr:b=default -pr:h=default -``` - -### Updating conan hooks on your machine - -The hooks are updated from time to time, so it's worth keeping your own copy of the hooks updated regularly. To do this: +Follow the [Developing Recipes Locally](developing_recipes_locally.md#installing-the-conancenter-hooks) guide for instructions. -```sh -conan config install -``` +Go to the [Error Knowledge Base](error_knowledge_base.md) page to know more about Conan Center hook errors. +Some common errors related to Conan can be found on the [troubleshooting](https://docs.conan.io/en/latest/faq/troubleshooting.html) section. ### Linters Linters are always executed by Github actions to validate parts of your recipe, for instance, if it uses migrated Conan tools imports. All executed linters are documented in [linters.md](linters.md). -To understand how to run linters locally, read [V2 linter](v2_linter.md) documentation. - -## Debugging failed builds - -Go to the [Error Knowledge Base](error_knowledge_base.md) page to know more about Conan Center hook errors. - -Some common errors related to Conan can be found on [troubleshooting](https://docs.conan.io/en/latest/faq/troubleshooting.html) section. - -To test with the same enviroment, the [build images](supported_platforms_and_configurations.md#build-images) are available. +Check the [Developing Recipes](developing_recipes_locally.md#running-the-python-linters) page for running them locally. +Check the [Developing Recipes](developing_recipes_locally.md#running-the-python-linters) for running them locally. diff --git a/docs/labels.md b/docs/labels.md index 2646caeaa41cf..30b4d0a7eeb46 100644 --- a/docs/labels.md +++ b/docs/labels.md @@ -12,7 +12,11 @@ special meaning: * [Infrastructure](#infrastructure) * [Stale](#stale) * [Unexpected Error](#unexpected-error) - * [User-approval pending](#user-approval-pending) + * [User-approval pending](#user-approval-pending) + * [Library Request](#library-request) + * [Question](#question) + * [Upstream Update](#upstream-update) + * [conan.io/center](#conaniocenter) ## Bump dependencies @@ -62,3 +66,20 @@ will be changed to the status `Pending — This commit is being built` to signal Label [`User-approval pending`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22User-approval+pending%22) signals the pull request that have been submitted by an user who is not yet approved in ConanCenter. Once the user is approved these pull requests will be triggered again automatically. + +## Library Request + +Request a new package to be created. + +## Question + +Further information is requested. Usually these are for issue where help is needed to solve a specific issue. These are a great way +to look for advice or recommendation about making changes to recipes. + +## Upstream Update + +Request a bump of a new package version. + +## conan.io/center + +Issues and features related to Web UI. diff --git a/docs/linters.md b/docs/linters.md index e12d3847e2190..76db1f45b3502 100644 --- a/docs/linters.md +++ b/docs/linters.md @@ -1,37 +1,33 @@ -## Conan Center Index Linters +# ConanCenterIndex Linters Some linter configuration files are available in the folder [linter](../linter), which are executed by Github Actions to improve recipe quality. They consume python scripts which are executed to fit CCI rules. Those scripts use [astroid](https://github.com/PyCQA/astroid) and [pylint](https://pylint.pycqa.org/en/latest/) classes to parse Conan recipe files and manage their warnings and errors. -The pylint by itselt is not able to find Conan Center Index rules, so astroid is used to iterate over conanfiles content and +Pylint by itself is not able to find ConanCenterIndex rules, so astroid is used to iterate over conanfiles content and validate CCI conditions. Also, pylint uses [rcfile](https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html) (a configuration file based on [toml](https://toml.io/en/) format) to configure plugins, warnings and errors which should be enabled or disabled. Also, the Github [code review](https://github.com/features/code-review) is integrated with the pylint output, parsed by [recipe_linter.json](../linter/recipe_linter.json), then presented to all users on the tab `Files changed`. -### Running Linters + +## Contents -Of course, you should run any linter locally, before pushing your code, read [Running the linter locally](v2_linter.md#running-the-linter-locally) for instructions. +## Running the linter locally +Check the [Developing Recipes](developing_recipes_locally.md#running-the-python-linters) page for details. -### Pylint configuration files +## Pylint configuration files -#### [Pylint Recipe](../linter/pylintrc_recipe) +- [Pylint Recipe](../linter/pylintrc_recipe): This `rcfile` lists plugins and rules to be executed over all recipes (not test package) and validate them. +- [Pylint Test Package Recipe](../linter/pylintrc_testpackage): This `rcfile` lists plugins and rules to be executed over all recipes in test package folders only: -This rcfile lists plugins and rules to be executed over all recipes (not test package) and validate them. - -#### [Pylint Test Package Recipe](../linter/pylintrc_testpackage) - -This rcfile lists plugins and rules to be executed over all recipes in test package folders only: - -### Linter Warning and Errors +## Linter Warning and Errors Here is the list of current warning and errors provided by pylint, when using CCI configuration. - -#### E9006 - conan-import-conanfile: ConanFile should be imported from conan +### E9006 - conan-import-conanfile: ConanFile should be imported from conan ```python from conans import ConanFile @@ -43,35 +39,36 @@ Should be replaced by: from conan import Conanfile ``` -#### E9004 - conan-package-name: Conan package names must be lower-case +### E9005 - conan-missing-name: Every conan recipe must contain the attribute name -The package name is always lower-case, even when the upstream uses another format +The attribute `name` is always expected. On the other hand, `version` should not be listed. ```python -def FoobarConanfile(ConanFile): - name = "foobar" +def BazConanfile(ConanFile): + name = "baz" ``` -#### E9005 - conan-missing-name: Every conan recipe must contain the attribute name +### E9004 - conan-package-name: Conan package names must be lower-case -The attribute `name` is always expected. On the other hand, `version` should not be listed. +The package name is always lower-case, even when the upstream uses another format ```python -def BazConanfile(ConanFile): - name = "baz" +def FoobarConanfile(ConanFile): + name = "foobar" ``` -#### E9007 - conan-test-no-name: Do not add name attribute in test package recipes +### E9007 - conan-test-no-name: Do not add name attribute in test package recipes -The test package is not a package, thus, it should not have a name +The test package is not a recipe, thus, it should not have a name ```python def TestPackageConanFile(ConanFile): name = "test_package" # Wrong! ``` -#### E9008 - conan-import-errors: Deprecated imports should be replaced by new imports. Read [v2_linter](v2_linter.md) +### E9008 - conan-import-errors: Deprecated imports should be replaced by new imports +Read [v2_linter](v2_linter.md) for a list of mappings of v1 to v2. Regular imports from `conans.tools` are now updated: ```python @@ -81,7 +78,7 @@ from conans import tools tools.rmdir(os.path.join(self.package_folder, "shared")) ``` -Should be replaced by specilized tools, prepared for Conan 2.0 +Should be replaced by specialized tools, prepared for Conan 2.0 ```python from conan.tools.files import rmdir @@ -90,7 +87,7 @@ from conan.tools.files import rmdir rmdir(self, os.path.join(self.package_folder, "shared")) ``` -#### E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead +### E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead ```python from conans.errors import ConanException @@ -104,8 +101,7 @@ from conan.errors import ConanException Only the namespace `conans` has been replaced by `conan`. - -#### E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead +### E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead ```python from conans.errors import ConanInvalidConfiguration @@ -119,11 +115,9 @@ from conan.errors import ConanInvalidConfiguration Only the namespace `conans` has been replaced by `conan`. -#### E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private +### E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private Documented on [conanfile.tools](https://docs.conan.io/en/latest/reference/conanfile/tools.html): - - It's not allowed to use `tools.xxx` directly: ```python diff --git a/docs/review_process.md b/docs/review_process.md index d2b04f728bd6c..e29387f248578 100644 --- a/docs/review_process.md +++ b/docs/review_process.md @@ -49,13 +49,8 @@ If you struggle to fix build errors yourself, you may want to ask for help from ### Unexpected error Sometimes, build fails with `Unexpected error` message. This indicates an infrastructure problem, and usually it's unrelated to the changes within PR itself. -Keep in mind conan-center-index is still *under development*, and there can be some instabilities. Especially, as we're using lots of external services, -which might be inaccessible (GitHub API, docker hub, etc.) and may result in intermittent failures. -So, what to do once `Unexpected error` was encountered? You may consider re-running the build by closing your pull request, waiting 15 seconds, and then re-opening it again. -Sometimes it's necessary to restart the build several times. -If an `Unexpected error` persists, tag [@jgsogo](https://github.com/jgsogo) and [@danimtb](https://github.com/danimtb) asking for the help with CI. -Alternatively, just [open a new issue](https://github.com/conan-io/conan-center-index/issues/new/choose). +To learn more, checkout the [label definition](labels.md#unexpected-error). ## Avoiding conflicts diff --git a/docs/v2_linter.md b/docs/v2_linter.md index 89a67d715db42..bf0e494551dd5 100644 --- a/docs/v2_linter.md +++ b/docs/v2_linter.md @@ -21,6 +21,10 @@ if perfectly valid in Conan v1, the recipe might fail here because it is not v2- Here you can find some examples of the extra rules we are adding: +## Running the linter locally + +Check the [Developing Recipes](developing_recipes_locally.md#running-the-python-linters) for details. + ## Import ConanFile from `conan` The module `conans` is deprecated in Conan v2. Now all the imports should be done from @@ -65,30 +69,3 @@ Here is a list of different imports and their new equivalent (note that the inte | conans.errors.ConanException | [conan.errors.ConanException](https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#migrating-the-recipes) | 1.47.0 | --- - -## Running the linter locally - -It is possible to run the linter locally the same way it is being run [using Github actions](../.github/workflows/linter-conan-v2.yml): - - * (Recommended) Use a dedicated Python virtualenv. - * Ensure you have required tools installed: `conan` and `pylint` (better to uses fixed versions) - - ``` - pip install conan~=1.0 pylint==2.14 - ``` - - * Set environment variable `PYTHONPATH` to the root of the repository - - ``` - export PYTHONPATH=your/path/conan-center-index - ``` - - * Now you just need to execute the `pylint` commands: - - ``` - # Lint a recipe: - pylint --rcfile=linter/pylintrc_recipe recipes/boost/all/conanfile.py - - # Lint the test_package - pylint --rcfile=linter/pylintrc_testpackage recipes/boost/all/test_package/conanfile.py - ``` From ae6f8ceb954d7754597b8dc1689befdbe239b023 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Oct 2022 09:33:21 +0200 Subject: [PATCH 328/561] (#13337) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/developing_recipes_locally.md | 4 +++- docs/linters.md | 14 +++++++++++++- docs/v2_linter.md | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/developing_recipes_locally.md b/docs/developing_recipes_locally.md index 682ae2dd3eee0..0ee32ef6f4a23 100644 --- a/docs/developing_recipes_locally.md +++ b/docs/developing_recipes_locally.md @@ -17,7 +17,9 @@ This file is intended to provide all the commands you need to run in order to be * [Running the Python Linters](#running-the-python-linters) * [Testing the different `test__package`](#testing-the-different-test__package) * [Testing more environments](#testing-more-environments) - * [Using Conan 2.0](#using-conan-20) + * [Using Conan 2.0](#using-conan-20) + * [Installing Conan 2.0 beta](#installing-conan-20-beta) + * [Trying it out](#trying-it-out) ## Clone your fork diff --git a/docs/linters.md b/docs/linters.md index 76db1f45b3502..8f4023733d1ba 100644 --- a/docs/linters.md +++ b/docs/linters.md @@ -12,7 +12,19 @@ Also, the Github [code review](https://github.com/features/code-review) is integ parsed by [recipe_linter.json](../linter/recipe_linter.json), then presented to all users on the tab `Files changed`. -## Contents +## Contents + + * [Running the linter locally](#running-the-linter-locally) + * [Pylint configuration files](#pylint-configuration-files) + * [Linter Warning and Errors](#linter-warning-and-errors) + * [E9006 - conan-import-conanfile: ConanFile should be imported from conan](#e9006---conan-import-conanfile-conanfile-should-be-imported-from-conan) + * [E9005 - conan-missing-name: Every conan recipe must contain the attribute name](#e9005---conan-missing-name-every-conan-recipe-must-contain-the-attribute-name) + * [E9004 - conan-package-name: Conan package names must be lower-case](#e9004---conan-package-name-conan-package-names-must-be-lower-case) + * [E9007 - conan-test-no-name: Do not add name attribute in test package recipes](#e9007---conan-test-no-name-do-not-add-name-attribute-in-test-package-recipes) + * [E9008 - conan-import-errors: Deprecated imports should be replaced by new imports](#e9008---conan-import-errors-deprecated-imports-should-be-replaced-by-new-imports) + * [E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead](#e9009---conan-import-error-conanexception-conanserrors-is-deprecated-and-conanerrors-should-be-used-instead) + * [E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead](#e9010---conan-import-error-conaninvalidconfiguration-conanserrors-is-deprecated-and-conanerrors-should-be-used-instead) + * [E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private](#e9011---conan-import-tools-importing-conantools-or-conantoolsxxxzzzyyy-should-be-considered-as-private) ## Running the linter locally diff --git a/docs/v2_linter.md b/docs/v2_linter.md index bf0e494551dd5..a2358f657f524 100644 --- a/docs/v2_linter.md +++ b/docs/v2_linter.md @@ -3,9 +3,9 @@ ## Contents + * [Running the linter locally](#running-the-linter-locally) * [Import ConanFile from `conan`](#import-conanfile-from-conan) - * [Import tools from `conan`](#import-tools-from-conan) - * [Running the linter locally](#running-the-linter-locally) + * [Import tools from `conan`](#import-tools-from-conan) On our [path to Conan v2](v2_roadmap.md) we are leveraging on custom Pylint rules. This linter will run for every pull-request that is submitted to the repository and will From cb835ef9f99b51068bd290bf95b5c59a958a5ed6 Mon Sep 17 00:00:00 2001 From: Eric Riff <57375845+ericriff@users.noreply.github.com> Date: Fri, 7 Oct 2022 04:44:19 -0300 Subject: [PATCH 329/561] (#13225) Modernize opengv recipe * Modernize opengv recipe * Bump pybind11 version * Fix license * Modernize test package * Copy license file to the correct folder * Disable clang-12 builds since they fail on Conan CI * Add test package for conan V1.x * Include and use the VirtualRunEnv generator on the Conan v2 test package * Extract souurces into src subfolder and be explicit about the destination on get * Ditch collect_libs in favor of the explicit list * Do not import collect_libs, we're not longer using it * Remove duplicated, unused file * Replace replace_in_file calls with patches * Remove unused import * Update minimum conan version Co-authored-by: Chris Mc * Include patch descriptions Co-authored-by: Chris Mc * Fix indentation Co-authored-by: Chris Mc --- recipes/opengv/all/CMakeLists.txt | 11 -- recipes/opengv/all/conandata.yml | 11 ++ recipes/opengv/all/conanfile.py | 104 ++++++------------ .../patches/0001-use-conans-pybind11.patch | 9 ++ .../all/patches/0002-use-conans-eigen.patch | 13 +++ ...003-let-conan-handle-shared-and-fpic.patch | 13 +++ .../opengv/all/test_package/CMakeLists.txt | 3 - recipes/opengv/all/test_package/conanfile.py | 21 +++- .../opengv/all/test_v1_package/CMakeLists.txt | 11 ++ .../opengv/all/test_v1_package/conanfile.py | 17 +++ 10 files changed, 121 insertions(+), 92 deletions(-) delete mode 100644 recipes/opengv/all/CMakeLists.txt create mode 100644 recipes/opengv/all/patches/0001-use-conans-pybind11.patch create mode 100644 recipes/opengv/all/patches/0002-use-conans-eigen.patch create mode 100644 recipes/opengv/all/patches/0003-let-conan-handle-shared-and-fpic.patch create mode 100644 recipes/opengv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opengv/all/test_v1_package/conanfile.py diff --git a/recipes/opengv/all/CMakeLists.txt b/recipes/opengv/all/CMakeLists.txt deleted file mode 100644 index 2ccaa2e599ec0..0000000000000 --- a/recipes/opengv/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -if(NOT CMAKE_SYSTEM_PROCESSOR) - set(CMAKE_SYSTEM_PROCESSOR ${CONAN_OPENGV_SYSTEM_PROCESSOR}) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/opengv/all/conandata.yml b/recipes/opengv/all/conandata.yml index 5ed5228ad47c9..c763b6fef7e02 100644 --- a/recipes/opengv/all/conandata.yml +++ b/recipes/opengv/all/conandata.yml @@ -2,3 +2,14 @@ sources: "cci.20200806": url: "https://github.com/laurentkneip/opengv/archive/91f4b19c73450833a40e463ad3648aae80b3a7f3.tar.gz" sha256: "b03f61ff597a6c16a32b8939c3e49e9f240ae7b4da3358f1430e9743e093d596" +patches: + "cci.20200806": + - patch_file: "patches/0001-use-conans-pybind11.patch" + patch_description: "fix call to pybind to use conan provided config file" + patch_type: "conan" + - patch_file: "patches/0002-use-conans-eigen.patch" + patch_description: "fix call to find_package to use conan provided file" + patch_type: "conan" + - patch_file: "patches/0003-let-conan-handle-shared-and-fpic.patch" + patch_description: "disable some options such that conan manages values" + patch_type: "conan" diff --git a/recipes/opengv/all/conanfile.py b/recipes/opengv/all/conanfile.py index f30c29e4d5cc8..9e3ce9fa9da3d 100644 --- a/recipes/opengv/all/conanfile.py +++ b/recipes/opengv/all/conanfile.py @@ -1,10 +1,12 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os import textwrap -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import get, copy, rmdir, save, apply_conandata_patches, export_conandata_patches +required_conan_version = ">=1.52.0" class opengvConan(ConanFile): name = "opengv" @@ -13,8 +15,8 @@ class opengvConan(ConanFile): homepage = "https://github.com/laurentkneip/opengv" license = "BSD-3-Clause" topics = ("computer", "vision", "geometric", "pose", "triangulation", "point-cloud") - settings = "os", "arch", "compiler", "build_type" + options = { "shared": [True, False], "fPIC": [True, False], @@ -26,13 +28,8 @@ class opengvConan(ConanFile): "with_python_bindings": False, } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -45,7 +42,7 @@ def configure(self): def requirements(self): self.requires("eigen/3.4.0") if self.options.with_python_bindings: - self.requires("pybind11/2.8.1") + self.requires("pybind11/2.10.0") def validate(self): # Disable windows builds since they error out. @@ -54,72 +51,36 @@ def validate(self): #FIXME disable this one CCI has more RAM available if self.settings.compiler == "gcc" and self.options.shared: raise ConanInvalidConfiguration("Shared builds not supported with gcc since CCI errors out due to excessive memory usage.") + if self.settings.compiler == "clang" and self.settings.compiler.version == 12: + raise ConanInvalidConfiguration("Clang 12 builds fail on Conan CI.") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTS"] = False - self._cmake.definitions["BUILD_PYTHON"] = self.options.with_python_bindings - self._cmake.definitions["BUILD_POSITION_INDEPENDENT_CODE"] = self.settings.os != "Windows" and self.options.get_safe("fPIC", True) - if tools.cross_building(self): - cmake_system_processor = { - "armv8": "aarch64", - "armv8.3": "aarch64", - }.get(str(self.settings.arch), str(self.settings.arch)) - self._cmake.definitions["CONAN_OPENGV_SYSTEM_PROCESSOR"] = cmake_system_processor - self._cmake.configure() - return self._cmake - - def _patch_sources(self): - # Use conan's Eigen - old = """\ - find_package(Eigen REQUIRED) - set(ADDITIONAL_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIR}/unsupported)""" - - new = """\ - find_package(Eigen3 REQUIRED) - set(ADDITIONAL_INCLUDE_DIRS ${Eigen3_INCLUDE_DIRS} ${Eigen3_INCLUDE_DIR}/unsupported)""" - - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - textwrap.dedent(old), - textwrap.dedent(new) - ) - - # Use conan's pybind11 - tools.replace_in_file(os.path.join(self._source_subfolder, "python", "CMakeLists.txt"), - "add_subdirectory(pybind11)", - "find_package(pybind11 REQUIRED)" - ) + def layout(self): + cmake_layout(self, src_folder="src") - # Let conan handle fPIC / shared - old = """\ - IF(MSVC) - set(BUILD_SHARED_LIBS OFF)""" + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - new = """\ - IF(1) - #set(BUILD_SHARED_LIBS OFF)""" + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_PYTHON"] = self.options.with_python_bindings + tc.variables["BUILD_POSITION_INDEPENDENT_CODE"] = self.settings.os != "Windows" and self.options.get_safe("fPIC", True) + tc.generate() - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - textwrap.dedent(old), - textwrap.dedent(new) - ) + cd = CMakeDeps(self) + cd.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -127,8 +88,7 @@ def package(self): {"opengv": "opengv::opengv"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): content += textwrap.dedent("""\ @@ -137,7 +97,7 @@ def _create_cmake_module_alias_targets(module_file, targets): set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + save(self, module_file, content) @property def _module_file_rel_path(self): @@ -146,7 +106,7 @@ def _module_file_rel_path(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "opengv") self.cpp_info.set_property("cmake_target_name", "opengv") - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["opengv"] if self.options.with_python_bindings: opengv_dist_packages = os.path.join(self.package_folder, "lib", "python3", "dist-packages") self.runenv_info.prepend_path("PYTHONPATH", opengv_dist_packages) diff --git a/recipes/opengv/all/patches/0001-use-conans-pybind11.patch b/recipes/opengv/all/patches/0001-use-conans-pybind11.patch new file mode 100644 index 0000000000000..8b5fc6651a5e9 --- /dev/null +++ b/recipes/opengv/all/patches/0001-use-conans-pybind11.patch @@ -0,0 +1,9 @@ +--- python/CMakeLists.txt 2020-08-06 09:02:15.000000000 -0300 ++++ python/CMakeLists.txt 2022-10-06 12:38:05.123192352 -0300 +@@ -1,5 +1,5 @@ + +-add_subdirectory(pybind11) ++find_package(pybind11 REQUIRED) + + include_directories(${PYTHON_INCLUDE_DIRS}) + diff --git a/recipes/opengv/all/patches/0002-use-conans-eigen.patch b/recipes/opengv/all/patches/0002-use-conans-eigen.patch new file mode 100644 index 0000000000000..3acd32a886cf6 --- /dev/null +++ b/recipes/opengv/all/patches/0002-use-conans-eigen.patch @@ -0,0 +1,13 @@ +--- CMakeLists.txt 2020-08-06 09:02:15.000000000 -0300 ++++ CMakeLists.txt 2022-10-06 12:32:08.838766142 -0300 +@@ -54,8 +54,8 @@ + ENDIF() + + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/") +-find_package(Eigen REQUIRED) +-set(ADDITIONAL_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIR}/unsupported) ++find_package(Eigen3 REQUIRED) ++set(ADDITIONAL_INCLUDE_DIRS ${Eigen3_INCLUDE_DIRS} ${Eigen3_INCLUDE_DIR}/unsupported) + + set( OPENGV_SOURCE_FILES + src/absolute_pose/modules/main.cpp diff --git a/recipes/opengv/all/patches/0003-let-conan-handle-shared-and-fpic.patch b/recipes/opengv/all/patches/0003-let-conan-handle-shared-and-fpic.patch new file mode 100644 index 0000000000000..f39224cadb138 --- /dev/null +++ b/recipes/opengv/all/patches/0003-let-conan-handle-shared-and-fpic.patch @@ -0,0 +1,13 @@ +--- CMakeLists.txt 2020-08-06 09:02:15.000000000 -0300 ++++ CMakeLists.txt 2022-10-06 12:39:57.766560501 -0300 +@@ -19,8 +19,8 @@ + OPTION(BUILD_TESTS "Build tests" ON) + OPTION(BUILD_PYTHON "Build Python extension" OFF) + +-IF(MSVC) +- set(BUILD_SHARED_LIBS OFF) ++IF(1) ++ #set(BUILD_SHARED_LIBS OFF) + ELSE() + OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF) + OPTION(BUILD_POSITION_INDEPENDENT_CODE "Build position independent code (-fPIC)" ON) diff --git a/recipes/opengv/all/test_package/CMakeLists.txt b/recipes/opengv/all/test_package/CMakeLists.txt index 93f2ed4e10baf..17768c1b86abd 100644 --- a/recipes/opengv/all/test_package/CMakeLists.txt +++ b/recipes/opengv/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(opengv REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/opengv/all/test_package/conanfile.py b/recipes/opengv/all/test_package/conanfile.py index 38f4483872d47..0a318ba85a952 100644 --- a/recipes/opengv/all/test_package/conanfile.py +++ b/recipes/opengv/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools import os - +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake +from conan.tools.layout import cmake_layout class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opengv/all/test_v1_package/CMakeLists.txt b/recipes/opengv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..56b29eaba3a22 --- /dev/null +++ b/recipes/opengv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(opengv REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} opengv) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/opengv/all/test_v1_package/conanfile.py b/recipes/opengv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/opengv/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 2b077296912f020be8cc2b732c5343eb9ac59ee2 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 7 Oct 2022 17:05:28 +0900 Subject: [PATCH 330/561] (#13334) aws-c-event-stream: add version 0.2.15 and support conan v2 --- recipes/aws-c-event-stream/all/CMakeLists.txt | 7 -- recipes/aws-c-event-stream/all/conandata.yml | 9 ++- recipes/aws-c-event-stream/all/conanfile.py | 81 ++++++++++--------- .../all/test_package/CMakeLists.txt | 5 +- .../all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/aws-c-event-stream/config.yml | 6 +- 8 files changed, 99 insertions(+), 59 deletions(-) delete mode 100644 recipes/aws-c-event-stream/all/CMakeLists.txt create mode 100644 recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-event-stream/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-event-stream/all/CMakeLists.txt b/recipes/aws-c-event-stream/all/CMakeLists.txt deleted file mode 100644 index 969e73de12b57..0000000000000 --- a/recipes/aws-c-event-stream/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-event-stream/all/conandata.yml b/recipes/aws-c-event-stream/all/conandata.yml index 494754a3729b1..61428e916296b 100644 --- a/recipes/aws-c-event-stream/all/conandata.yml +++ b/recipes/aws-c-event-stream/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.15": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.15.tar.gz" + sha256: "4ff2ada07ede3c6afa4b8e6e20de541e717038307f29b38c27efa7c4d875ee26" "0.2.12": url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.12.tar.gz" sha256: "cc4ebfe715d8df5b9e3f4a3ce9b67d5f480017a7ebbbfa1d5e64ea53ec672580" @@ -13,7 +16,5 @@ sources: sha256: "f1b423a487b5d6dca118bfc0d0c6cc596dc476b282258a3228e73a8f730422d4" patches: "0.1.5": - - base_path: "source_subfolder" - patch_file: "patches/0001-disable-tests-bin.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-use-PROJECT_SOURCE_DIR.patch" + - patch_file: "patches/0001-disable-tests-bin.patch" + - patch_file: "patches/0002-use-PROJECT_SOURCE_DIR.patch" diff --git a/recipes/aws-c-event-stream/all/conanfile.py b/recipes/aws-c-event-stream/all/conanfile.py index 08ef8038f7003..aa10e76f28262 100644 --- a/recipes/aws-c-event-stream/all/conanfile.py +++ b/recipes/aws-c-event-stream/all/conanfile.py @@ -1,18 +1,18 @@ -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.43.0" - +required_conan_version = ">=1.52.0" class AwsCEventStream(ConanFile): name = "aws-c-event-stream" description = "C99 implementation of the vnd.amazon.eventstream content-type" - topics = ("aws", "eventstream", "content", ) + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-event-stream" - license = "Apache-2.0", - exports_sources = "CMakeLists.txt", "aws_eventstream_target.cmake", "patches/*" - generators = "cmake", "cmake_find_package" + topics = ("aws", "eventstream", "content", ) settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,11 +23,8 @@ class AwsCEventStream(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -35,41 +32,53 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-checksums/0.1.12") - self.requires("aws-c-common/0.6.19") - if tools.Version(self.version) >= "0.2": - self.requires("aws-c-io/0.11.2") + self.requires("aws-checksums/0.1.13") + self.requires("aws-c-common/0.8.2") + if Version(self.version) >= "0.2": + self.requires("aws-c-io/0.13.4") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_BINARIES"] = False + tc.variables["BUILD_TESTING"] = False + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_BINARIES"] = False - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "lib", "aws-c-event-stream")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-event-stream")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-event-stream") @@ -82,5 +91,5 @@ def package_info(self): self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package_multi"] = "aws-c-event-stream" self.cpp_info.components["aws-c-event-stream-lib"].libs = ["aws-c-event-stream"] self.cpp_info.components["aws-c-event-stream-lib"].requires = ["aws-c-common::aws-c-common-lib", "aws-checksums::aws-checksums"] - if tools.Version(self.version) >= "0.2": + if Version(self.version) >= "0.2": self.cpp_info.components["aws-c-event-stream-lib"].requires.append("aws-c-io::aws-c-io-lib") diff --git a/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt b/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt index 360ccf8545330..05cae5027e20e 100644 --- a/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-event-stream REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-event-stream) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-event-stream) diff --git a/recipes/aws-c-event-stream/all/test_package/conanfile.py b/recipes/aws-c-event-stream/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/aws-c-event-stream/all/test_package/conanfile.py +++ b/recipes/aws-c-event-stream/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..674dc4a319004 --- /dev/null +++ b/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-event-stream REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-event-stream) diff --git a/recipes/aws-c-event-stream/all/test_v1_package/conanfile.py b/recipes/aws-c-event-stream/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-event-stream/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-event-stream/config.yml b/recipes/aws-c-event-stream/config.yml index a93345494d8de..96ac653286f12 100644 --- a/recipes/aws-c-event-stream/config.yml +++ b/recipes/aws-c-event-stream/config.yml @@ -1,9 +1,11 @@ versions: + "0.2.15": + folder: all "0.2.12": folder: all "0.2.11": folder: all - 0.2.7: + "0.2.7": folder: all - 0.1.5: + "0.1.5": folder: all From fb5380857d2595a6e5b9fbc01b3dc1d6c4d3f9d8 Mon Sep 17 00:00:00 2001 From: theirix Date: Fri, 7 Oct 2022 11:44:07 +0300 Subject: [PATCH 331/561] (#13335) simdjson: add version 3.0.0 --- recipes/simdjson/all/conandata.yml | 3 +++ recipes/simdjson/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index a8bb6fe4e100a..e558cc7c52740 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.0": + url: "https://github.com/simdjson/simdjson/archive/v3.0.0.tar.gz" + sha256: "e6dd4bfaad2fd9599e6a026476db39a3bb9529436d3508ac3ae643bc663526c5" "2.2.3": url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" diff --git a/recipes/simdjson/config.yml b/recipes/simdjson/config.yml index 923cd599435b6..26b2f3b73c2d7 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.0": + folder: all "2.2.3": folder: all "2.2.2": From 4bb538837cb10f7f1b85b0a9e517171772979be8 Mon Sep 17 00:00:00 2001 From: SSE4 Date: Fri, 7 Oct 2022 17:44:52 +0700 Subject: [PATCH 332/561] (#12331) - [glib] use MesonToolchain * - [glib] use MesonToolchain Signed-off-by: SSE4 * Update conanfile.py * - tempory workaround to get rid of bad framework paths... Signed-off-by: SSE4 * - set up an Apple SDK path Signed-off-by: SSE4 * - configure SDK only for Apple Signed-off-by: SSE4 * - fix signature Signed-off-by: SSE4 * - apply_conandata_patches Signed-off-by: SSE4 * - remove *.pdb from bin Signed-off-by: SSE4 * - base_path isn't needed Signed-off-by: SSE4 * - not needed (aready patched above) Signed-off-by: SSE4 * - adjust imports for 2.0 compat Signed-off-by: SSE4 * - resolve duplicated imports Signed-off-by: SSE4 * - fix linter Signed-off-by: SSE4 * - remove libexec (contains only .desktop files) Signed-off-by: SSE4 * - remove unneeded lines from rebase Signed-off-by: SSE4 * Update recipes/glib/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/glib/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/glib/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py Co-authored-by: Javier G. Sogo * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update recipes/glib/all/conanfile.py * Update conanfile.py * Update conandata.yml * Update recipes/glib/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/glib/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/glib/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/glib/all/conanfile.py Co-authored-by: Chris Mc * Update recipes/glib/all/conanfile.py Co-authored-by: Chris Mc Signed-off-by: SSE4 Co-authored-by: Uilian Ries Co-authored-by: Javier G. Sogo Co-authored-by: Chris Mc --- recipes/glib/all/conandata.yml | 3 - recipes/glib/all/conanfile.py | 167 ++++++++++++++++++--------------- 2 files changed, 89 insertions(+), 81 deletions(-) diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml index 5ac40dbf86130..d737b8773d159 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -35,13 +35,10 @@ patches: patch_type: backport patch_description: fix for clang compilation patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2898 - base_path: "source_subfolder" "2.73.3": - patch_file: "patches/0001-2.73.3-clang-static-assert.patch" patch_type: backport patch_description: fix for clang compilation patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2898 - base_path: "source_subfolder" "2.73.1": - patch_file: "patches/f2ea67ae441bc6059b43a1051dd0b750fe5f6301.patch" - base_path: "source_subfolder" diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index 43c40dd234783..f7f42cfa72f8a 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -1,14 +1,15 @@ -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.gnu import PkgConfigDeps, AutotoolsDeps +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, replace_in_file, rmdir, chdir, rm, copy +from conan.tools.apple import is_apple_os import os import glob import shutil -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building -from conan.tools import files, scm -from conan.tools.microsoft import is_msvc -from conans import tools, Meson, VisualStudioBuildEnvironment required_conan_version = ">=1.52.0" @@ -40,7 +41,6 @@ class GLibConan(ConanFile): } short_paths = True - generators = "pkg_config" @property def _source_subfolder(self): @@ -51,13 +51,13 @@ def _build_subfolder(self): return "build_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - files.export_conandata_patches(self) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if scm.Version(self.version) < "2.71.1": + if Version(self.version) < "2.71.1": self.options.shared = True if self.settings.os != "Linux": del self.options.with_mount @@ -75,7 +75,7 @@ def requirements(self): self.requires("zlib/1.2.12") self.requires("libffi/3.4.2") if self.options.with_pcre: - if scm.Version(self.version) >= "2.73.2": + if Version(self.version) >= "2.73.2": self.requires("pcre2/10.40") else: self.requires("pcre/8.45") @@ -89,20 +89,18 @@ def requirements(self): # for Linux, gettext is provided by libc self.requires("libgettext/0.21") - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): self.requires("libiconv/1.17") def validate(self): - if hasattr(self, 'settings_build') and cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("Cross-building not implemented") - if scm.Version(self.version) >= "2.69.0" and not self.options.with_pcre: + if Version(self.version) >= "2.69.0" and not self.info.options.with_pcre: raise ConanInvalidConfiguration("option glib:with_pcre must be True for glib >= 2.69.0") - if self.settings.os == "Windows" and not self.options.shared and scm.Version(self.version) < "2.71.1": + if self.info.settings.os == "Windows" and not self.info.options.shared and Version(self.version) < "2.71.1": raise ConanInvalidConfiguration( "glib < 2.71.1 can not be built as static library on Windows. " "see https://gitlab.gnome.org/GNOME/glib/-/issues/692" ) - if scm.Version(self.version) < "2.67.0" and not is_msvc(self) and not self.options.with_elf: + if Version(self.version) < "2.67.0" and not is_msvc(self) and not self.info.options.with_elf: raise ConanInvalidConfiguration("libelf dependency can't be disabled in glib < 2.67.0") def build_requirements(self): @@ -110,69 +108,86 @@ def build_requirements(self): self.tool_requires("pkgconf/1.9.3") def source(self): - files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - @functools.lru_cache(1) - def _configure_meson(self): - meson = Meson(self) - defs = {} - if tools.is_apple_os(self.settings.os): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def layout(self): + self.folders.build = self._build_subfolder + self.folders.source = self._source_subfolder + + def generate(self): + + tc = PkgConfigDeps(self) + tc.generate() + tc = AutotoolsDeps(self) + # bug? meson toolchain doesn't read CPPFLAGS + cppflags = tc.vars().get("CPPFLAGS") + tc.environment.append('CFLAGS', cppflags) + tc.environment.append('CXXFLAGS', cppflags) + # conan or meson bug? LIBPATH is ignored + ldflags = tc.vars().get("LDFLAGS") + ldflags = ldflags.replace("-LIBPATH", "/LIBPATH") + tc.environment.define('LDFLAGS', ldflags) + tc.generate() + # it's needed so MesonToolchain reads from AutotoolsDeps, should it be automatic? + self.buildenv.compose_env(tc.environment) + tc = MesonToolchain(self) + + defs = dict() + if is_apple_os(self): defs["iconv"] = "external" # https://gitlab.gnome.org/GNOME/glib/issues/1557 defs["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled" defs["libmount"] = "enabled" if self.options.get_safe("with_mount") else "disabled" - if scm.Version(self.version) < "2.69.0": + if Version(self.version) < "2.69.0": defs["internal_pcre"] = not self.options.with_pcre if self.settings.os == "FreeBSD": defs["xattr"] = "false" - if scm.Version(self.version) >= "2.67.2": + if Version(self.version) >= "2.67.2": defs["tests"] = "false" - if scm.Version(self.version) >= "2.67.0": + if Version(self.version) >= "2.67.0": defs["libelf"] = "enabled" if self.options.get_safe("with_elf") else "disabled" - meson.configure( - source_folder=self._source_subfolder, - args=["--wrap-mode=nofallback"], - build_folder=self._build_subfolder, - defs=defs, - ) - return meson + for name, value in defs.items(): + tc.project_options[name] = value + tc.project_options["libdir"] = "lib" + tc.generate() def _patch_sources(self): - files.apply_conandata_patches(self) - if scm.Version(self.version) < "2.67.2": - tools.replace_in_file( - os.path.join(self._source_subfolder, "meson.build"), + apply_conandata_patches(self) + if Version(self.version) < "2.67.2": + replace_in_file(self, + os.path.join(self.source_folder, "meson.build"), "build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper())", "build_tests = false", ) - tools.replace_in_file( - os.path.join(self._source_subfolder, "meson.build"), + replace_in_file(self, + os.path.join(self.source_folder, "meson.build"), "subdir('fuzzing')", "#subdir('fuzzing')", ) # https://gitlab.gnome.org/GNOME/glib/-/issues/2152 - if scm.Version(self.version) < "2.73.2": + if Version(self.version) < "2.73.2": for filename in [ - os.path.join(self._source_subfolder, "meson.build"), - os.path.join(self._source_subfolder, "glib", "meson.build"), - os.path.join(self._source_subfolder, "gobject", "meson.build"), - os.path.join(self._source_subfolder, "gio", "meson.build"), + os.path.join(self.source_folder, "meson.build"), + os.path.join(self.source_folder, "glib", "meson.build"), + os.path.join(self.source_folder, "gobject", "meson.build"), + os.path.join(self.source_folder, "gio", "meson.build"), ]: - tools.replace_in_file(filename, "subdir('tests')", "#subdir('tests')") + replace_in_file(self, filename, "subdir('tests')", "#subdir('tests')") if self.settings.os != "Linux": # allow to find gettext - tools.replace_in_file( - os.path.join(self._source_subfolder, "meson.build"), - "libintl = cc.find_library('intl', required : false)" if scm.Version(self.version) < "2.73.1" \ + replace_in_file(self, + os.path.join(self.source_folder, "meson.build"), + "libintl = cc.find_library('intl', required : false)" if Version(self.version) < "2.73.1" \ else "libintl = dependency('intl', required: false)", "libintl = dependency('libgettext', method : 'pkg-config', required : false)", ) - tools.replace_in_file( + replace_in_file(self, os.path.join( - self._source_subfolder, + self.source_folder, "gio", "gdbus-2.0", "codegen", @@ -181,47 +196,38 @@ def _patch_sources(self): "'share'", "'res'", ) - if self.settings.os != "Linux": - tools.replace_in_file( - os.path.join(self._source_subfolder, "meson.build"), - "if cc.has_function('ngettext'", - "if false #cc.has_function('ngettext'", - ) def build(self): self._patch_sources() - with tools.environment_append( - VisualStudioBuildEnvironment(self).vars - ) if is_msvc(self) else tools.no_op(): - meson = self._configure_meson() - meson.build() + meson = Meson(self) + meson.configure() + meson.build() def _fix_library_names(self): if self.settings.compiler == "Visual Studio": - with tools.chdir(os.path.join(self.package_folder, "lib")): + with chdir(self, os.path.join(self.package_folder, "lib")): for filename_old in glob.glob("*.a"): filename_new = filename_old[3:-2] + ".lib" self.output.info(f"rename {filename_old} into {filename_new}") shutil.move(filename_old, filename_new) def package(self): - if scm.Version(self.version) < "2.73.0": - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + if Version(self.version) < "2.73.0": + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) else: - self.copy(pattern="LGPL-2.1-or-later.txt", dst="licenses", src=os.path.join(self._source_subfolder, "LICENSES")) - with tools.environment_append( - VisualStudioBuildEnvironment(self).vars - ) if is_msvc(self) else tools.no_op(): - meson = self._configure_meson() - meson.install() - self._fix_library_names() - files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, pattern="LGPL-2.1-or-later.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "LICENSES")) + meson = Meson(self) + meson.install() + self._fix_library_names() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "libexec")) shutil.move( os.path.join(self.package_folder, "share"), os.path.join(self.package_folder, "res"), ) - for pdb_file in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): - os.unlink(pdb_file) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pc", os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.components["glib-2.0"].set_property("pkg_config_name", "glib-2.0") @@ -230,9 +236,11 @@ def package_info(self): os.path.join("include", "glib-2.0"), os.path.join("lib", "glib-2.0", "include") ] + self.cpp_info.components["glib-2.0"].libdirs = ["lib"] self.cpp_info.components["gmodule-no-export-2.0"].set_property("pkg_config_name", "gmodule-no-export-2.0") self.cpp_info.components["gmodule-no-export-2.0"].libs = ["gmodule-2.0"] + self.cpp_info.components["gmodule-no-export-2.0"].libdirs = ["lib"] self.cpp_info.components["gmodule-no-export-2.0"].requires.append("glib-2.0") self.cpp_info.components["gmodule-export-2.0"].set_property("pkg_config_name", "gmodule-export-2.0") @@ -243,14 +251,17 @@ def package_info(self): self.cpp_info.components["gobject-2.0"].set_property("pkg_config_name", "gobject-2.0") self.cpp_info.components["gobject-2.0"].libs = ["gobject-2.0"] + self.cpp_info.components["gobject-2.0"].libdirs = ["lib"] self.cpp_info.components["gobject-2.0"].requires += ["glib-2.0", "libffi::libffi"] self.cpp_info.components["gthread-2.0"].set_property("pkg_config_name", "gthread-2.0") self.cpp_info.components["gthread-2.0"].libs = ["gthread-2.0"] + self.cpp_info.components["gthread-2.0"].libdirs = ["lib"] self.cpp_info.components["gthread-2.0"].requires.append("glib-2.0") self.cpp_info.components["gio-2.0"].set_property("pkg_config_name", "gio-2.0") self.cpp_info.components["gio-2.0"].libs = ["gio-2.0"] + self.cpp_info.components["gio-2.0"].libdirs = ["lib"] self.cpp_info.components["gio-2.0"].requires += ["glib-2.0", "gobject-2.0", "gmodule-2.0", "zlib::zlib"] self.cpp_info.components["gresource"].set_property("pkg_config_name", "gresource") @@ -279,11 +290,11 @@ def package_info(self): self.cpp_info.components["glib-2.0"].frameworks += ["Foundation", "CoreServices", "CoreFoundation"] self.cpp_info.components["gio-2.0"].frameworks.append("AppKit") - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): self.cpp_info.components["glib-2.0"].requires.append("libiconv::libiconv") if self.options.with_pcre: - if scm.Version(self.version) >= "2.73.2": + if Version(self.version) >= "2.73.2": self.cpp_info.components["glib-2.0"].requires.append("pcre2::pcre2") else: self.cpp_info.components["glib-2.0"].requires.append("pcre::pcre") From 54a05ea9872ef5633029963c3f73fbb3cbedec7e Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 7 Oct 2022 13:24:00 +0200 Subject: [PATCH 333/561] (#13345) dbus/1.15.2 --- recipes/dbus/1.x.x/conandata.yml | 3 +++ recipes/dbus/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/dbus/1.x.x/conandata.yml b/recipes/dbus/1.x.x/conandata.yml index 15c5df2d70057..27f1f2bc83407 100644 --- a/recipes/dbus/1.x.x/conandata.yml +++ b/recipes/dbus/1.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.15.2": + url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.2.tar.xz" + sha256: "7e640803084af59f5e477b7ded11fd888b5380910a895c51ca3aedd63c0626ca" "1.15.0": url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.15.0.tar.xz" sha256: "5073c8cb9ad20226647bb38f4965182b762a6e1f595ccdc8e59411014bfd640a" diff --git a/recipes/dbus/config.yml b/recipes/dbus/config.yml index 390e432df5f56..cc866e2f4cf3b 100644 --- a/recipes/dbus/config.yml +++ b/recipes/dbus/config.yml @@ -1,4 +1,6 @@ versions: + "1.15.2": + folder: 1.x.x "1.15.0": folder: 1.x.x "1.14.0": From 278e7aa483a2ae078d829a7977ae7fd318e6004a Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Fri, 7 Oct 2022 15:05:38 +0300 Subject: [PATCH 334/561] (#13324) boost: fix output shared library extension on iOS/tvOS/watchOS must be .dylib instead of .so --- recipes/boost/all/conanfile.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index 0342414637931..cc2f76d2b6808 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -253,6 +253,10 @@ def _python_executable(self): def _is_windows_platform(self): return self.settings.os in ["Windows", "WindowsStore", "WindowsCE"] + @property + def _is_apple_embedded_platform(self): + return self.settings.os in ["iOS", "watchOS", "tvOS"] + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -359,7 +363,7 @@ def _shared(self): @property def _stacktrace_addr2line_available(self): - if (self.settings.os in ["iOS", "watchOS", "tvOS"] or self.settings.get_safe("os.subsystem") == "catalyst"): + if (self._is_apple_embedded_platform or self.settings.get_safe("os.subsystem") == "catalyst"): # sandboxed environment - cannot launch external processes (like addr2line), system() function is forbidden return False return not self.options.header_only and not self.options.without_stacktrace and self.settings.os != "Windows" @@ -969,7 +973,7 @@ def _build_flags(self): flags.append("numa=on") # https://www.boost.org/doc/libs/1_70_0/libs/context/doc/html/context/architectures.html - if self._b2_os: + if not self._is_apple_embedded_platform and self._b2_os: flags.append(f"target-os={self._b2_os}") if self._b2_architecture: flags.append(f"architecture={self._b2_architecture}") @@ -1277,6 +1281,9 @@ def create_library_config(deps_name, name): if asflags.strip(): contents += f'"{asflags.strip()}" ' + if self._is_apple_embedded_platform: + contents += f'"{self._b2_os}" ' + contents += " ;" self.output.warn(contents) From f47ff2901878cbc6b462a14b98a73bdd34ca7a22 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 8 Oct 2022 00:44:51 +0900 Subject: [PATCH 335/561] (#13340) protopuf: add recipe * protopuf: add version * update compilers minimum version * update gcc minimum version * update clang minimum version * downgrade required_conan_version Co-authored-by: Uilian Ries * remove unused functions Co-authored-by: Uilian Ries * drop support of apple-clang * include array header * update conan version to 1.50.0 Co-authored-by: Jordan Williams * fix error message Co-authored-by: Jordan Williams * remove CMakeUserPresets.json Co-authored-by: Uilian Ries Co-authored-by: Jordan Williams --- recipes/protopuf/all/conandata.yml | 4 + recipes/protopuf/all/conanfile.py | 75 +++++++++++++++++++ .../protopuf/all/test_package/CMakeLists.txt | 9 +++ .../protopuf/all/test_package/conanfile.py | 26 +++++++ .../all/test_package/test_package.cpp | 32 ++++++++ .../all/test_v1_package/CMakeLists.txt | 12 +++ .../protopuf/all/test_v1_package/conanfile.py | 18 +++++ recipes/protopuf/config.yml | 3 + 8 files changed, 179 insertions(+) create mode 100644 recipes/protopuf/all/conandata.yml create mode 100644 recipes/protopuf/all/conanfile.py create mode 100644 recipes/protopuf/all/test_package/CMakeLists.txt create mode 100644 recipes/protopuf/all/test_package/conanfile.py create mode 100644 recipes/protopuf/all/test_package/test_package.cpp create mode 100644 recipes/protopuf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/protopuf/all/test_v1_package/conanfile.py create mode 100644 recipes/protopuf/config.yml diff --git a/recipes/protopuf/all/conandata.yml b/recipes/protopuf/all/conandata.yml new file mode 100644 index 0000000000000..79e20bb300b58 --- /dev/null +++ b/recipes/protopuf/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.2.0": + url: "https://github.com/PragmaTwice/protopuf/archive/refs/tags/v2.2.0.tar.gz" + sha256: "f19aed66c7ff44fee2ae980f869746e2000fb484893f53f2e4ea021352444ea9" diff --git a/recipes/protopuf/all/conanfile.py b/recipes/protopuf/all/conanfile.py new file mode 100644 index 0000000000000..0bd58c86f61b8 --- /dev/null +++ b/recipes/protopuf/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.50.0" + + +class ProtopufConan(ConanFile): + name = "protopuf" + description = "Protocol Puffers: A little, highly templated, and protobuf-compatible serialization/deserialization header-only library written in C++20" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/PragmaTwice/protopuf" + topics = ("serialization", "protobuf", "metaprogramming", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "10", + "clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration( + f"{self.ref} does not yet support apple-clang." + ) + + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.get_safe("compiler.version")) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/protopuf/all/test_package/CMakeLists.txt b/recipes/protopuf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c049a9a330ddf --- /dev/null +++ b/recipes/protopuf/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) + +find_package(protopuf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE protopuf::protopuf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/protopuf/all/test_package/conanfile.py b/recipes/protopuf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/protopuf/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/protopuf/all/test_package/test_package.cpp b/recipes/protopuf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4204c6dc97e2a --- /dev/null +++ b/recipes/protopuf/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include + +#include "protopuf/message.h" + +using namespace pp; +using namespace std; + +using Student = message< + uint32_field<"id", 1>, + string_field<"name", 3> +>; + +using Class = message< + string_field<"name", 8>, + message_field<"students", 3, Student, repeated> +>; + +int main() { + // serialization + Student twice{123, "twice"}, tom{456, "tom"}, jerry{123456, "jerry"}; + Class myClass{"class 101", {tom, jerry}}; + myClass["students"_f].push_back(twice); + + array buffer{}; + auto bufferEnd = message_coder::encode(myClass, buffer); + + // deserialization + auto [yourClass, bufferEnd2] = message_coder::decode(buffer); + + + return 0; +} diff --git a/recipes/protopuf/all/test_v1_package/CMakeLists.txt b/recipes/protopuf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4bda6274e3037 --- /dev/null +++ b/recipes/protopuf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(protopuf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE protopuf::protopuf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/protopuf/all/test_v1_package/conanfile.py b/recipes/protopuf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/protopuf/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/protopuf/config.yml b/recipes/protopuf/config.yml new file mode 100644 index 0000000000000..1979b3114ab95 --- /dev/null +++ b/recipes/protopuf/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.0": + folder: all From d77b5cdea7dbd4207a4e8d1735065fb176959787 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 7 Oct 2022 19:04:01 +0200 Subject: [PATCH 336/561] (#12516) [conan 2] Migrate box2d 2.4.x recipe * [conan 2] Migrate box2d 2.4.x recipe * remove base path for patch * fix shared builds * fix patch * linter * delete pdb files * Update recipes/box2d/2.4.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/box2d/2.4.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/box2d/2.4.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/box2d/2.4.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/box2d/2.4.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/box2d/2.4.x/conanfile.py Co-authored-by: Uilian Ries * Update recipes/box2d/2.4.x/test_package/conanfile.py Co-authored-by: Uilian Ries * Update recipes/box2d/2.4.x/conanfile.py Co-authored-by: Uilian Ries * review Co-authored-by: Uilian Ries --- recipes/box2d/2.4.x/CMakeLists.txt | 7 -- recipes/box2d/2.4.x/conandata.yml | 3 +- recipes/box2d/2.4.x/conanfile.py | 67 ++++++++++--------- ...ch => 0001-install-and-allow-shared.patch} | 0 .../box2d/2.4.x/test_package/CMakeLists.txt | 3 - recipes/box2d/2.4.x/test_package/conanfile.py | 19 ++++-- .../2.4.x/test_v1_package/CMakeLists.txt | 11 +++ .../box2d/2.4.x/test_v1_package/conanfile.py | 17 +++++ .../2.4.x/test_v1_package/test_package.cpp | 16 +++++ 9 files changed, 93 insertions(+), 50 deletions(-) delete mode 100644 recipes/box2d/2.4.x/CMakeLists.txt rename recipes/box2d/2.4.x/patches/{install-and-allow-shared.patch => 0001-install-and-allow-shared.patch} (100%) create mode 100644 recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/box2d/2.4.x/test_v1_package/conanfile.py create mode 100644 recipes/box2d/2.4.x/test_v1_package/test_package.cpp diff --git a/recipes/box2d/2.4.x/CMakeLists.txt b/recipes/box2d/2.4.x/CMakeLists.txt deleted file mode 100644 index c986d294c7547..0000000000000 --- a/recipes/box2d/2.4.x/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/box2d/2.4.x/conandata.yml b/recipes/box2d/2.4.x/conandata.yml index 3e9aef1571a09..c7372e2a8f037 100644 --- a/recipes/box2d/2.4.x/conandata.yml +++ b/recipes/box2d/2.4.x/conandata.yml @@ -7,5 +7,4 @@ sources: sha256: "d6b4650ff897ee1ead27cf77a5933ea197cbeef6705638dd181adc2e816b23c2" patches: "2.4.0": - - patch_file: "patches/install-and-allow-shared.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-install-and-allow-shared.patch" diff --git a/recipes/box2d/2.4.x/conanfile.py b/recipes/box2d/2.4.x/conanfile.py index 0a37f41d13d33..ae09ce435deda 100644 --- a/recipes/box2d/2.4.x/conanfile.py +++ b/recipes/box2d/2.4.x/conanfile.py @@ -1,7 +1,10 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rm, rmdir, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version -required_conan_version = ">=1.29.1" +required_conan_version = ">=1.52.0" class Box2dConan(ConanFile): @@ -16,55 +19,53 @@ class Box2dConan(ConanFile): "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True,} - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("box2d-%s" % self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BOX2D_BUILD_TESTBED"] = False - self._cmake.definitions["BOX2D_BUILD_UNIT_TESTS"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.variables["BOX2D_BUILD_TESTBED"] = False + tc.variables["BOX2D_BUILD_UNIT_TESTS"] = False + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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.configure() cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): self.cpp_info.names["cmake_find_package"] = "box2d" self.cpp_info.names["cmake_find_package_multi"] = "box2d" self.cpp_info.libs = ["box2d"] - if tools.Version(self.version) >= "2.4.1" and self.options.shared: + if Version(self.version) >= "2.4.1" and self.options.shared: self.cpp_info.defines.append("B2_SHARED") diff --git a/recipes/box2d/2.4.x/patches/install-and-allow-shared.patch b/recipes/box2d/2.4.x/patches/0001-install-and-allow-shared.patch similarity index 100% rename from recipes/box2d/2.4.x/patches/install-and-allow-shared.patch rename to recipes/box2d/2.4.x/patches/0001-install-and-allow-shared.patch diff --git a/recipes/box2d/2.4.x/test_package/CMakeLists.txt b/recipes/box2d/2.4.x/test_package/CMakeLists.txt index 373fb5bb61846..fb4d8d7f5888a 100644 --- a/recipes/box2d/2.4.x/test_package/CMakeLists.txt +++ b/recipes/box2d/2.4.x/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(box2d REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/box2d/2.4.x/test_package/conanfile.py b/recipes/box2d/2.4.x/test_package/conanfile.py index 7513484720425..d1ce1a2cbc477 100644 --- a/recipes/box2d/2.4.x/test_package/conanfile.py +++ b/recipes/box2d/2.4.x/test_package/conanfile.py @@ -1,10 +1,19 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout class Box2DTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt b/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..373fb5bb61846 --- /dev/null +++ b/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(box2d REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} box2d::box2d) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/box2d/2.4.x/test_v1_package/conanfile.py b/recipes/box2d/2.4.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7513484720425 --- /dev/null +++ b/recipes/box2d/2.4.x/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class Box2DTestConan(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.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/box2d/2.4.x/test_v1_package/test_package.cpp b/recipes/box2d/2.4.x/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..7dfa813bc1d2e --- /dev/null +++ b/recipes/box2d/2.4.x/test_v1_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include "box2d/box2d.h" + +int main(void) { + b2Vec2 gravity(0.0f, -10.0f); + b2World world(gravity); + + b2BodyDef groundBodyDef; + groundBodyDef.position.Set(0.0f, -10.0f); + + b2Body* groundBody = world.CreateBody(&groundBodyDef); + b2PolygonShape groundBox; + groundBox.SetAsBox(50.0f, 10.0f); + + return 0; +} From 4bf114eefecf85163341d07233fa94b6186ae97c Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sat, 8 Oct 2022 07:24:26 +0300 Subject: [PATCH 337/561] (#13354) qt5: don't create PrintSupport module for iOS/tvOS/watchOS --- recipes/qt/5.x.x/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index aab3bf9121a6a..00b46f073d571 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -1138,7 +1138,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): build_modules.append(self._cmake_qt5_private_file("Widgets")) self.cpp_info.components["qtWidgets"].build_modules["cmake_find_package"].append(self._cmake_qt5_private_file("Widgets")) self.cpp_info.components["qtWidgets"].build_modules["cmake_find_package_multi"].append(self._cmake_qt5_private_file("Widgets")) - if self.options.gui and self.options.widgets: + if self.options.gui and self.options.widgets and not self.settings.os in ["iOS", "watchOS", "tvOS"]: _create_module("PrintSupport", ["Gui", "Widgets"]) if self.options.get_safe("opengl", "no") != "no" and self.options.gui: _create_module("OpenGL", ["Gui"]) From 6b771d60998345455f7335f75bf7dda8e51caf81 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 10 Oct 2022 15:44:08 +0900 Subject: [PATCH 338/561] (#13167) fmtlog: add recipe * fmtlog: add recipe * add "export all symbols" * fix license name Co-authored-by: Uilian Ries * remove comment of template Co-authored-by: Uilian Ries * use `self.info.settings` Co-authored-by: Uilian Ries * use `self.info.settings` part 2 Co-authored-by: Uilian Ries * use self.settings instead of self.info.settings (workaround) Co-authored-by: Uilian Ries * remove VirtualBuildENv Co-authored-by: Uilian Ries * remove VirtualBuildEnv(2) Co-authored-by: Uilian Ries * first return if header_only Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/fmtlog/all/conandata.yml | 9 ++ recipes/fmtlog/all/conanfile.py | 119 ++++++++++++++++++ .../all/patches/2.2.1-0001-fix-cmake.patch | 39 ++++++ .../fmtlog/all/test_package/CMakeLists.txt | 9 ++ recipes/fmtlog/all/test_package/conanfile.py | 26 ++++ .../fmtlog/all/test_package/test_package.cpp | 5 + .../fmtlog/all/test_v1_package/CMakeLists.txt | 12 ++ .../fmtlog/all/test_v1_package/conanfile.py | 18 +++ recipes/fmtlog/config.yml | 3 + 9 files changed, 240 insertions(+) create mode 100644 recipes/fmtlog/all/conandata.yml create mode 100644 recipes/fmtlog/all/conanfile.py create mode 100644 recipes/fmtlog/all/patches/2.2.1-0001-fix-cmake.patch create mode 100644 recipes/fmtlog/all/test_package/CMakeLists.txt create mode 100644 recipes/fmtlog/all/test_package/conanfile.py create mode 100644 recipes/fmtlog/all/test_package/test_package.cpp create mode 100644 recipes/fmtlog/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fmtlog/all/test_v1_package/conanfile.py create mode 100644 recipes/fmtlog/config.yml diff --git a/recipes/fmtlog/all/conandata.yml b/recipes/fmtlog/all/conandata.yml new file mode 100644 index 0000000000000..181d1e80ed96e --- /dev/null +++ b/recipes/fmtlog/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.2.1": + url: "https://github.com/MengRao/fmtlog/archive/refs/tags/v2.2.1.tar.gz" + sha256: "9bc2f1ea37eece0f4807689962b529d2d4fa07654baef184f051319b4eac9304" +patches: + "2.2.1": + - patch_file: "patches/2.2.1-0001-fix-cmake.patch" + patch_description: "make shared, static library separately" + patch_type: "conan" diff --git a/recipes/fmtlog/all/conanfile.py b/recipes/fmtlog/all/conanfile.py new file mode 100644 index 0000000000000..e1fd99b8fca24 --- /dev/null +++ b/recipes/fmtlog/all/conanfile.py @@ -0,0 +1,119 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +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.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "fmtlog" + description = "fmtlog is a performant fmtlib-style logging library with latency in nanoseconds." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/MengRao/fmtlog" + topics = ("logging", "low-latency", "topic3") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + } + + @property + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15.7", + "msvc": "191", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("fmt/9.1.0") + + def package_id(self): + if self.options.header_only: + self.info.clear() + + def validate(self): + # FIXME: self.info.settings.compiler does not work with header-only packages + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + 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._minimum_cpp_standard}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + if self.options.header_only: + return + + tc = CMakeToolchain(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + if self.options.header_only: + return + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.options.header_only: + copy(self, pattern="fmtlog*.h", dst=os.path.join(self.package_folder, "include", "fmtlog"), src=self.source_folder) + else: + cmake = CMake(self) + cmake.install() + + def package_info(self): + if self.options.header_only: + self.cpp_info.defines.append("FMTLOG_HEADER_ONLY") + else: + self.cpp_info.libs = ["fmtlog-shared" if self.options.shared else "fmtlog-static"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/fmtlog/all/patches/2.2.1-0001-fix-cmake.patch b/recipes/fmtlog/all/patches/2.2.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..08354bb048c10 --- /dev/null +++ b/recipes/fmtlog/all/patches/2.2.1-0001-fix-cmake.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c45e569..6dc75d4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,23 +12,24 @@ else() + link_libraries(pthread) + endif() + +-link_directories(.) +-include_directories(fmt/include) ++find_package(fmt REQUIRED CONFIG) + ++if(BUILD_SHARED_LIBS) + add_library(fmtlog-shared SHARED fmtlog.cc) +-if(MSVC) +- target_link_libraries(fmtlog-shared fmt) ++if(1) ++ target_link_libraries(fmtlog-shared PUBLIC fmt::fmt) + endif() ++set_property(TARGET fmtlog-shared PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) + install(TARGETS fmtlog-shared) + ++else() ++ + add_library(fmtlog-static fmtlog.cc) +-if(MSVC) +- target_link_libraries(fmtlog-static fmt) ++if(1) ++ target_link_libraries(fmtlog-static PUBLIC fmt::fmt) + endif() + install(TARGETS fmtlog-static) + +-add_subdirectory(fmt) +-add_subdirectory(test) +-if(NOT MSVC) +- add_subdirectory(bench) + endif() ++ ++install(FILES fmtlog.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fmtlog) diff --git a/recipes/fmtlog/all/test_package/CMakeLists.txt b/recipes/fmtlog/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..42a1ef5c3a35e --- /dev/null +++ b/recipes/fmtlog/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(fmtlog REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fmtlog::fmtlog) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/fmtlog/all/test_package/conanfile.py b/recipes/fmtlog/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/fmtlog/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fmtlog/all/test_package/test_package.cpp b/recipes/fmtlog/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..25429fa8fbed2 --- /dev/null +++ b/recipes/fmtlog/all/test_package/test_package.cpp @@ -0,0 +1,5 @@ +#include "fmtlog/fmtlog.h" +int main() +{ + FMTLOG(fmtlog::INF, "The answer is {}.", 42); +} diff --git a/recipes/fmtlog/all/test_v1_package/CMakeLists.txt b/recipes/fmtlog/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..885bdb9ba0ee8 --- /dev/null +++ b/recipes/fmtlog/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fmtlog REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fmtlog::fmtlog) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/fmtlog/all/test_v1_package/conanfile.py b/recipes/fmtlog/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/fmtlog/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fmtlog/config.yml b/recipes/fmtlog/config.yml new file mode 100644 index 0000000000000..a816d92f78ee3 --- /dev/null +++ b/recipes/fmtlog/config.yml @@ -0,0 +1,3 @@ +versions: + "2.2.1": + folder: all From 367027d0367b76e320c61d0562b1ee86305f9855 Mon Sep 17 00:00:00 2001 From: cguentherTUChemnitz Date: Mon, 10 Oct 2022 09:25:19 +0200 Subject: [PATCH 339/561] (#13344) leptonica recipe enhancement: option with_jpeg: select jpeg provider instead of binary switch * add transitive libjpeg dependency switching between libjpeg and libjpeg-turbo as used in other projects like opencv * reorder parameters to fit layout of other reciepes --- recipes/leptonica/all/conanfile.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index 1dbbdf5af8280..a16caf47de37b 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/all/conanfile.py @@ -25,7 +25,7 @@ class LeptonicaConan(ConanFile): "fPIC": [True, False], "with_zlib": [True, False], "with_gif": [True, False], - "with_jpeg": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo"], "with_png": [True, False], "with_tiff": [True, False], "with_openjpeg": [True, False], @@ -36,7 +36,7 @@ class LeptonicaConan(ConanFile): "fPIC": True, "with_zlib": True, "with_gif": True, - "with_jpeg": True, + "with_jpeg": "libjpeg", "with_png": True, "with_tiff": True, "with_openjpeg": True, @@ -73,12 +73,15 @@ def requirements(self): self.requires("zlib/1.2.12") if self.options.with_gif: self.requires("giflib/5.2.1") - if self.options.with_jpeg: - self.requires("libjpeg/9d") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + if self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") if self.options.with_png: self.requires("libpng/1.6.38") if self.options.with_tiff: self.requires("libtiff/4.4.0") + self.options["libtiff"].jpeg = self.options.with_jpeg if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_webp: From f28fd511ac82df493b48d34a1b906f81e7bc64aa Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Mon, 10 Oct 2022 01:05:15 -0700 Subject: [PATCH 340/561] (#13338) restinio: update to conan v2 * restinio: update to conan v2 * fix dst dir for copy * Update recipes/restinio/all/conanfile.py Co-authored-by: Uilian Ries * fix method order Co-authored-by: Uilian Ries * Update recipes/restinio/all/conanfile.py Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/restinio/all/CMakeLists.txt | 7 -- recipes/restinio/all/conandata.yml | 60 ++++++------ recipes/restinio/all/conanfile.py | 93 +++++++++---------- .../restinio/all/test_package/CMakeLists.txt | 3 - .../restinio/all/test_package/conanfile.py | 18 +++- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../restinio/all/test_v1_package/conanfile.py | 16 ++++ recipes/restinio/config.yml | 20 ++-- 8 files changed, 127 insertions(+), 101 deletions(-) delete mode 100644 recipes/restinio/all/CMakeLists.txt create mode 100644 recipes/restinio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/restinio/all/test_v1_package/conanfile.py diff --git a/recipes/restinio/all/CMakeLists.txt b/recipes/restinio/all/CMakeLists.txt deleted file mode 100644 index 5ba180246ce0e..0000000000000 --- a/recipes/restinio/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/dev/restinio) diff --git a/recipes/restinio/all/conandata.yml b/recipes/restinio/all/conandata.yml index b4a2e1e8e8118..b680851d1b67a 100644 --- a/recipes/restinio/all/conandata.yml +++ b/recipes/restinio/all/conandata.yml @@ -1,34 +1,34 @@ sources: - "0.6.8": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.tar.gz - sha256: 92ab0faa9f9de582df787e133acf5c10fb6ab7cecbd96c128997554d8ceda0cd - "0.6.8.1": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.1.tar.gz - sha256: 6a365ce645fc7188c287602886eba1a99c797e01b734f0c69bcb370b3494b54c - "0.6.9": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.9.tar.gz - sha256: fcb05e15a346b4ff27757b89741289864f82f71affe61364325ce70dddefe31f - "0.6.10": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.10.tar.gz - sha256: dc9cad7e19f1bc255532cee53ab2027c93108c79e27f9fbe971f3ea0b10274a5 - "0.6.11": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.11.tar.gz - sha256: 66c25c19efd9dc9683d60f540e9ac09b66245c5afde096fc05ec69cbb502fc5d - "0.6.12": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.12.tar.gz - sha256: 7176d608afb8e5cd29eec2216e747be262215f5b3ab3df2b3c86e691f1cec79e - "0.6.13": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.13.tar.gz - sha256: 72d7ad40c8d34e69cd79f42145b4059e8a7356114fb13864c3c0ad5a5607b44f - "0.6.14": - url: https://github.com/Stiffstream/restinio/archive/v.0.6.14.tar.gz - sha256: 9742c051e7199d826697f86e6ba4a9fcb7f00c71a408b5c172134b2206404c4e - "0.6.15": - url: "https://github.com/Stiffstream/restinio/archive/v.0.6.15.tar.gz" - sha256: "5977e7a21064a42dc690a644adc7ba03037eb4007bfbc36586faf715583967bd" - "0.6.16": - url: "https://github.com/Stiffstream/restinio/archive/v.0.6.16.tar.gz" - sha256: "b3208d746087ba979f51b3a32e08463718c33d58720247d53ffb5bda99f4f92a" "0.6.17": url: "https://github.com/Stiffstream/restinio/archive/v.0.6.17.tar.gz" sha256: "0140b23f50bb964f6917d1f99205476eba92203dc586673bdf2ea48d7406f2c4" + "0.6.16": + url: "https://github.com/Stiffstream/restinio/archive/v.0.6.16.tar.gz" + sha256: "b3208d746087ba979f51b3a32e08463718c33d58720247d53ffb5bda99f4f92a" + "0.6.15": + url: "https://github.com/Stiffstream/restinio/archive/v.0.6.15.tar.gz" + sha256: "5977e7a21064a42dc690a644adc7ba03037eb4007bfbc36586faf715583967bd" + "0.6.14": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.14.tar.gz + sha256: 9742c051e7199d826697f86e6ba4a9fcb7f00c71a408b5c172134b2206404c4e + "0.6.13": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.13.tar.gz + sha256: 72d7ad40c8d34e69cd79f42145b4059e8a7356114fb13864c3c0ad5a5607b44f + "0.6.12": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.12.tar.gz + sha256: 7176d608afb8e5cd29eec2216e747be262215f5b3ab3df2b3c86e691f1cec79e + "0.6.11": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.11.tar.gz + sha256: 66c25c19efd9dc9683d60f540e9ac09b66245c5afde096fc05ec69cbb502fc5d + "0.6.10": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.10.tar.gz + sha256: dc9cad7e19f1bc255532cee53ab2027c93108c79e27f9fbe971f3ea0b10274a5 + "0.6.9": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.9.tar.gz + sha256: fcb05e15a346b4ff27757b89741289864f82f71affe61364325ce70dddefe31f + "0.6.8.1": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.1.tar.gz + sha256: 6a365ce645fc7188c287602886eba1a99c797e01b734f0c69bcb370b3494b54c + "0.6.8": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.tar.gz + sha256: 92ab0faa9f9de582df787e133acf5c10fb6ab7cecbd96c128997554d8ceda0cd diff --git a/recipes/restinio/all/conanfile.py b/recipes/restinio/all/conanfile.py index 65cf395c7d3c3..a9df43d526e76 100644 --- a/recipes/restinio/all/conanfile.py +++ b/recipes/restinio/all/conanfile.py @@ -1,9 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps +from conan.tools.files import get, copy, rmdir +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.50.0" class RestinioConan(ConanFile): @@ -28,21 +33,13 @@ class RestinioConan(ConanFile): "with_pcre": None, } - generators = "cmake" - exports_sources = ["CMakeLists.txt"] - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def layout(self): + basic_layout(self) def requirements(self): self.requires("http_parser/2.9.4") - if tools.Version(self.version) >= "0.6.16": + if Version(self.version) >= "0.6.16": self.requires("fmt/9.0.0") else: self.requires("fmt/8.1.1") @@ -53,12 +50,12 @@ def requirements(self): self.requires("variant-lite/2.0.0") if self.options.asio == "standalone": - if tools.Version(self.version) >= "0.6.9": + if Version(self.version) >= "0.6.9": self.requires("asio/1.22.1") else: self.requires("asio/1.16.1") else: - if tools.Version(self.version) >= "0.6.9": + if Version(self.version) >= "0.6.9": self.requires("boost/1.78.0") else: self.requires("boost/1.73.0") @@ -75,51 +72,53 @@ def requirements(self): self.requires("pcre2/10.40") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): minimal_cpp_standard = "14" - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, minimal_cpp_standard) + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, minimal_cpp_standard) minimal_version = { "gcc": "5", "clang": "3.4", "apple-clang": "10", - "Visual Studio": "15" } - compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) - self.output.warn( - "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) - return - version = tools.Version(self.settings.compiler.version) - if version < minimal_version[compiler]: - raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + check_min_vs(self, 190) + if not is_msvc(self): + minimum_version = minimal_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{minimal_cpp_standard}, which your compiler does not support." + ) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["RESTINIO_INSTALL"] = True + tc.variables["RESTINIO_FIND_DEPS"] = False + tc.variables["RESTINIO_USE_EXTERNAL_EXPECTED_LITE"] = True + tc.variables["RESTINIO_USE_EXTERNAL_OPTIONAL_LITE"] = True + tc.variables["RESTINIO_USE_EXTERNAL_STRING_VIEW_LITE"] = True + tc.variables["RESTINIO_USE_EXTERNAL_VARIANT_LITE"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["RESTINIO_INSTALL"] = True - cmake.definitions["RESTINIO_FIND_DEPS"] = False - cmake.definitions["RESTINIO_USE_EXTERNAL_EXPECTED_LITE"] = True - cmake.definitions["RESTINIO_USE_EXTERNAL_OPTIONAL_LITE"] = True - cmake.definitions["RESTINIO_USE_EXTERNAL_STRING_VIEW_LITE"] = True - cmake.definitions["RESTINIO_USE_EXTERNAL_VARIANT_LITE"] = True - cmake.configure(build_folder=self._build_subfolder) - return cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "dev", "restinio")) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] self.cpp_info.set_property("cmake_file_name", "restinio") self.cpp_info.set_property("cmake_target_name", "restinio::restinio") self.cpp_info.defines.extend(["RESTINIO_EXTERNAL_EXPECTED_LITE", "RESTINIO_EXTERNAL_OPTIONAL_LITE", diff --git a/recipes/restinio/all/test_package/CMakeLists.txt b/recipes/restinio/all/test_package/CMakeLists.txt index d1fbedb5ea13c..742ee15cf57c4 100644 --- a/recipes/restinio/all/test_package/CMakeLists.txt +++ b/recipes/restinio/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(restinio REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/restinio/all/test_package/conanfile.py b/recipes/restinio/all/test_package/conanfile.py index 9b63bd176646b..a9fb96656f203 100644 --- a/recipes/restinio/all/test_package/conanfile.py +++ b/recipes/restinio/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", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/restinio/all/test_v1_package/CMakeLists.txt b/recipes/restinio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..259507f226840 --- /dev/null +++ b/recipes/restinio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(restinio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} restinio::restinio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/restinio/all/test_v1_package/conanfile.py b/recipes/restinio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9b63bd176646b --- /dev/null +++ b/recipes/restinio/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/restinio/config.yml b/recipes/restinio/config.yml index 29781bb078232..b071e4e40bed7 100644 --- a/recipes/restinio/config.yml +++ b/recipes/restinio/config.yml @@ -1,23 +1,23 @@ versions: - "0.6.8": + "0.6.17": folder: all - "0.6.8.1": + "0.6.16": folder: all - "0.6.9": + "0.6.15": folder: all - "0.6.10": + "0.6.14": folder: all - "0.6.11": + "0.6.13": folder: all "0.6.12": folder: all - "0.6.13": + "0.6.11": folder: all - "0.6.14": + "0.6.10": folder: all - "0.6.15": + "0.6.9": folder: all - "0.6.16": + "0.6.8.1": folder: all - "0.6.17": + "0.6.8": folder: all From 123ee2026fee3feaf158efc585a331ca3846bc8a Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 10 Oct 2022 17:44:33 +0900 Subject: [PATCH 341/561] (#13346) osmanip: update dependencies --- recipes/osmanip/all/conanfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/osmanip/all/conanfile.py b/recipes/osmanip/all/conanfile.py index c94cc31732659..19f4bf94ed4c8 100644 --- a/recipes/osmanip/all/conanfile.py +++ b/recipes/osmanip/all/conanfile.py @@ -37,13 +37,16 @@ def config_options(self): def configure(self): if self.options.shared: try: - del self.options.fPIC # once removed by config_options, need try..except for a second del + del self.options.fPIC except Exception: pass def requirements(self): self.requires("boost/1.80.0") - self.requires("arsenalgear/1.2.2") + if Version(self.version) < "4.2.0": + self.requires("arsenalgear/1.2.2") + else: + self.requires("arsenalgear/2.0.1") @property def _minimum_cpp_standard(self): From 46780ac423f7a16282a6d0f0494cd65fa9f296e3 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 10 Oct 2022 04:04:42 -0500 Subject: [PATCH 342/561] (#13348) Ignore CMakeUserPresets.json files These files are not meant to be committed to version control. They are meant for developer-specific configuration. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index d4f0278522f81..13fc7ab5fabfa 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ conaninfo.txt graph_info.json build/ +# CMake +CMakeUserPresets.json + # IDEs .idea .vscode From f947a5dd38bf44974e5887961bb8006af9383e95 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 10 Oct 2022 18:24:22 +0900 Subject: [PATCH 343/561] (#13350) rapidyaml: update dependencies and support conan v2 * rapidyaml: update dependencies and support conan v2 * remove CMakeUserPresets * remove unused functions * disable internal c4core in 0.3.0 * simplify validate() * remove unused functions --- recipes/rapidyaml/all/CMakeLists.txt | 7 -- recipes/rapidyaml/all/conandata.yml | 9 +- recipes/rapidyaml/all/conanfile.py | 88 +++++++++---------- .../0.3.0-001-remove-internal-c4core.patch | 16 +++- .../rapidyaml/all/test_package/CMakeLists.txt | 5 +- .../rapidyaml/all/test_package/conanfile.py | 19 ++-- .../all/test_v1_package/CMakeLists.txt | 15 ++++ .../all/test_v1_package/conanfile.py | 18 ++++ 8 files changed, 108 insertions(+), 69 deletions(-) delete mode 100644 recipes/rapidyaml/all/CMakeLists.txt create mode 100644 recipes/rapidyaml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidyaml/all/test_v1_package/conanfile.py diff --git a/recipes/rapidyaml/all/CMakeLists.txt b/recipes/rapidyaml/all/CMakeLists.txt deleted file mode 100644 index 205ebe3efea98..0000000000000 --- a/recipes/rapidyaml/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/rapidyaml/all/conandata.yml b/recipes/rapidyaml/all/conandata.yml index 9ff2ab225f75a..28db57dc0078f 100644 --- a/recipes/rapidyaml/all/conandata.yml +++ b/recipes/rapidyaml/all/conandata.yml @@ -11,10 +11,13 @@ sources: patches: "0.4.1": - patch_file: "patches/0.4.1-001-remove-internal-c4core.patch" - base_path: "source_subfolder" + patch_description: "disable using internal c4core" + patch_type: "conan" "0.4.0": - patch_file: "patches/0.4.0-001-remove-internal-c4core.patch" - base_path: "source_subfolder" + patch_description: "disable using internal c4core" + patch_type: "conan" "0.3.0": - patch_file: "patches/0.3.0-001-remove-internal-c4core.patch" - base_path: "source_subfolder" + patch_description: "disable using internal c4core" + patch_type: "conan" diff --git a/recipes/rapidyaml/all/conanfile.py b/recipes/rapidyaml/all/conanfile.py index a66b93f7411bc..fbdfd5da9b5b7 100644 --- a/recipes/rapidyaml/all/conanfile.py +++ b/recipes/rapidyaml/all/conanfile.py @@ -1,17 +1,20 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.microsoft import check_min_vs +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class RapidYAMLConan(ConanFile): name = "rapidyaml" description = "a library to parse and emit YAML, and do it fast." - topics = ("yaml", "parser", "emitter") license = "MIT", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/biojppm/rapidyaml" + topics = ("yaml", "parser", "emitter") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,73 +28,64 @@ class RapidYAMLConan(ConanFile): "with_default_callbacks": True, "with_tab_tokens": False, } - generators = "cmake", "cmake_find_package_multi" - - _compiler_required_cpp11 = { - "Visual Studio": "13", - "gcc": "6", - "clang": "4", - } @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + return 11 def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if tools.Version(self.version) < "0.4.0": + if Version(self.version) < "0.4.0": del self.options.with_tab_tokens def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("c4core/0.1.9") + self.requires("c4core/0.1.10") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) - - minimum_version = self._compiler_required_cpp11.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++11, which your compiler does not support.".format(self.name)) - else: - self.output.warn("{0} requires C++11. Your compiler is unknown. Assuming it supports C++11.".format(self.name)) + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + check_min_vs(self, 190) 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], destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["RYML_DEFAULT_CALLBACKS"] = self.options.with_default_callbacks - if tools.Version(self.version) >= "0.4.0": - cmake.definitions["RYML_WITH_TAB_TOKENS"] = self.options.with_tab_tokens - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["RYML_DEFAULT_CALLBACKS"] = self.options.with_default_callbacks + if Version(self.version) >= "0.4.0": + tc.variables["RYML_WITH_TAB_TOKENS"] = self.options.with_tab_tokens + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "include"), "*.natvis") + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.natvis", os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "ryml") diff --git a/recipes/rapidyaml/all/patches/0.3.0-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.3.0-001-remove-internal-c4core.patch index e9fdf4bb8cbc8..124d310efbad6 100644 --- a/recipes/rapidyaml/all/patches/0.3.0-001-remove-internal-c4core.patch +++ b/recipes/rapidyaml/all/patches/0.3.0-001-remove-internal-c4core.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index a75251a..a55654e 100644 +index a75251a..3a5d087 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(ryml @@ -11,7 +11,17 @@ index a75251a..a55654e 100644 AUTHOR "Joao Paulo Magalhaes ") -@@ -52,8 +52,7 @@ c4_add_library(ryml +@@ -17,8 +17,7 @@ option(RYML_DBG "Enable (very verbose) ryml debug prints." OFF) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core) ++find_package(c4core REQUIRED CONFIG) + + c4_add_library(ryml + SOURCES +@@ -52,8 +51,7 @@ c4_add_library(ryml INC_DIRS $ $ @@ -21,7 +31,7 @@ index a75251a..a55654e 100644 ) if(NOT RYML_DEFAULT_CALLBACKS) -@@ -68,7 +67,6 @@ endif() +@@ -68,7 +66,6 @@ endif() #------------------------------------------------------- c4_install_target(ryml) diff --git a/recipes/rapidyaml/all/test_package/CMakeLists.txt b/recipes/rapidyaml/all/test_package/CMakeLists.txt index 41b3142802c8c..bc844b7829375 100644 --- a/recipes/rapidyaml/all/test_package/CMakeLists.txt +++ b/recipes/rapidyaml/all/test_package/CMakeLists.txt @@ -1,13 +1,10 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(ryml REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ryml::ryml) +target_link_libraries(${PROJECT_NAME} PRIVATE ryml::ryml) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) if(ryml_VERSION VERSION_GREATER_EQUAL "0.4.0") target_compile_definitions(${PROJECT_NAME} PRIVATE RYML_USE_PARSE_IN_ARENA) diff --git a/recipes/rapidyaml/all/test_package/conanfile.py b/recipes/rapidyaml/all/test_package/conanfile.py index 38f4483872d47..a9fb96656f203 100644 --- a/recipes/rapidyaml/all/test_package/conanfile.py +++ b/recipes/rapidyaml/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", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt b/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2cbec639fb36c --- /dev/null +++ b/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ryml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ryml::ryml) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(ryml_VERSION VERSION_GREATER_EQUAL "0.4.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE RYML_USE_PARSE_IN_ARENA) +endif() diff --git a/recipes/rapidyaml/all/test_v1_package/conanfile.py b/recipes/rapidyaml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/rapidyaml/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 75962ea62ee092d56a380ce2619a3fa016cfc5bf Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 10 Oct 2022 18:44:18 +0900 Subject: [PATCH 344/561] (#13360) aws-c-cal: add version 0.5.20 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/aws-c-cal/all/conandata.yml | 8 ++++++++ recipes/aws-c-cal/config.yml | 2 ++ 2 files changed, 10 insertions(+) diff --git a/recipes/aws-c-cal/all/conandata.yml b/recipes/aws-c-cal/all/conandata.yml index d3b93a72f80e4..e1b848e4dfa2d 100644 --- a/recipes/aws-c-cal/all/conandata.yml +++ b/recipes/aws-c-cal/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.20": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.20.tar.gz" + sha256: "acc352359bd06f8597415c366cf4ec4f00d0b0da92d637039a73323dd55b6cd0" "0.5.19": url: "https://github.com/awslabs/aws-c-cal/archive/refs/tags/v0.5.19.tar.gz" sha256: "23452ab7960c480f1ec0a96ac55bde32d7d27c4a664baeadc248923b19c12086" @@ -15,6 +18,11 @@ sources: url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.11.tar.gz" sha256: "ef46e121b2231a0b19afce8af4b32d77501df4d470e926990918456636cd83c0" patches: + "0.5.20": + - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" "0.5.19": - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" patch_description: "Link to CoreFoundation on Apple" diff --git a/recipes/aws-c-cal/config.yml b/recipes/aws-c-cal/config.yml index 1e3606a0136b8..f969df4acc583 100644 --- a/recipes/aws-c-cal/config.yml +++ b/recipes/aws-c-cal/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.20": + folder: all "0.5.19": folder: all "0.5.17": From 65825f57152523e6f483eb7e84d1c48432d72109 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Mon, 10 Oct 2022 12:04:58 +0200 Subject: [PATCH 345/561] (#13368) harfbuzz: add version 5.3.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/harfbuzz/all/conandata.yml | 6 ++++++ recipes/harfbuzz/config.yml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml index 92d73bd800af2..f77bff879e408 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -11,6 +11,9 @@ sources: "5.2.0": url: "https://github.com/harfbuzz/harfbuzz/releases/download/5.2.0/harfbuzz-5.2.0.tar.xz" sha256: "735a94917b47936575acb4d4fa7e7986522f8a89527e4635721474dee2bc942c" + "5.3.0": + url: "https://github.com/harfbuzz/harfbuzz/archive/5.3.0.tar.gz" + sha256: "94712b8cdae68f0b585ec8e3cd8c5160fdc241218119572236497a62dae770de" patches: "3.2.0": - patch_file: "patches/icu-3.0.x.patch" @@ -24,3 +27,6 @@ patches: "5.2.0": - patch_file: "patches/icu-5.2.x.patch" base_path: "source_subfolder" + "5.3.0": + - patch_file: "patches/icu-5.2.x.patch" + base_path: "source_subfolder" diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml index f7ebfff60979f..864b963b7b4b1 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -7,3 +7,5 @@ versions: folder: all "5.2.0": folder: all + "5.3.0": + folder: all From 3a4a0ead016bed0d817bb845d502160a8a8e07b7 Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Mon, 10 Oct 2022 13:24:28 +0300 Subject: [PATCH 346/561] (#13173) gdcm: conan v2 support * gdcm: fix compilation on gcc11 * gdcm: bump dependencies * gdcm: conan v2 support * fix typo * replace tools.is_apple_os * fix order of parameters * remove unused sha256 for patches * enforce usage of FinxEXPAT.cmake through patch * Do not use self.info.options.shared in generate * Update recipes/gdcm/all/test_package/conanfile.py Co-authored-by: Uilian Ries * Revert "Update recipes/gdcm/all/test_package/conanfile.py" This reverts commit 542d364e167a6974b0852be6be8c635f16fbabb9. * Use CMAKE_CXX_STANDARD Co-authored-by: Uilian Ries * fix wrong variable name * Replace cache_variables in favor of variables Co-authored-by: Chris Mc Co-authored-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/gdcm/all/CMakeLists.txt | 7 - recipes/gdcm/all/conandata.yml | 9 +- recipes/gdcm/all/conanfile.py | 169 ++++++++---------- .../all/patches/0003-gcc-11-compilation.patch | 68 +++++++ .../gdcm/all/patches/0004-find-expat.patch | 11 ++ recipes/gdcm/all/test_package/CMakeLists.txt | 7 +- recipes/gdcm/all/test_package/conanfile.py | 23 ++- .../gdcm/all/test_package/test_package.cpp | 2 +- .../gdcm/all/test_v1_package/CMakeLists.txt | 12 ++ recipes/gdcm/all/test_v1_package/conanfile.py | 23 +++ 10 files changed, 218 insertions(+), 113 deletions(-) delete mode 100644 recipes/gdcm/all/CMakeLists.txt create mode 100644 recipes/gdcm/all/patches/0003-gcc-11-compilation.patch create mode 100644 recipes/gdcm/all/patches/0004-find-expat.patch create mode 100644 recipes/gdcm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gdcm/all/test_v1_package/conanfile.py diff --git a/recipes/gdcm/all/CMakeLists.txt b/recipes/gdcm/all/CMakeLists.txt deleted file mode 100644 index 1a5609e8abe82..0000000000000 --- a/recipes/gdcm/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.9.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(src) diff --git a/recipes/gdcm/all/conandata.yml b/recipes/gdcm/all/conandata.yml index e4eb70c004754..e971686ce6195 100644 --- a/recipes/gdcm/all/conandata.yml +++ b/recipes/gdcm/all/conandata.yml @@ -5,6 +5,11 @@ sources: patches: "3.0.9": - patch_file: "patches/0001-charls-linking.patch" - base_path: "src" - patch_file: "patches/0002-openjpeg-integration.patch" - base_path: "src" + - patch_file: "patches/0003-gcc-11-compilation.patch" + patch_description: "add missing includes for GCC 11" + patch_type: "backport" + patch_source: "https://github.com/malaterre/GDCM/commit/4404b770be337bd0d5d3c2289abfd34426433db2" + - patch_file: "patches/0004-find-expat.patch" + patch_description: "enforce usage of FindEXPAT.cmake" + patch_type: "conan" diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py index 6eebe789201e9..6e328856e2550 100644 --- a/recipes/gdcm/all/conanfile.py +++ b/recipes/gdcm/all/conanfile.py @@ -1,20 +1,25 @@ -from conan.tools.microsoft import msvc_runtime_flag -from conans import ConanFile, CMake, 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.microsoft import is_msvc_static_runtime +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, save +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os import textwrap -required_conan_version = ">=1.43.0" + +required_conan_version = ">=1.52.0" class GDCMConan(ConanFile): name = "gdcm" - topics = ("dicom", "images") - homepage = "http://gdcm.sourceforge.net/" - url = "https://github.com/conan-io/conan-center-index" - license = "BSD-3-Clause" description = "C++ library for DICOM medical files" - + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://gdcm.sourceforge.net/" + topics = ("dicom", "images") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,25 +30,12 @@ class GDCMConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "src" - - @property - def _build_subfolder(self): - return "build" - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def _minimum_cpp_standard(self): + return 11 def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -51,75 +43,73 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.4.8") - self.requires("openjpeg/2.4.0") + self.requires("expat/2.4.9") + self.requires("openjpeg/2.5.0") self.requires("zlib/1.2.12") def validate(self): - if self.options.shared and self._is_msvc and "MT" in msvc_runtime_flag(self): - raise ConanInvalidConfiguration("shared gdcm can't be built with MT or MTd") - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + if is_msvc_static_runtime(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support shared and static runtime together.") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - def _configure_cmake(self): - if self._cmake: - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - self._cmake = CMake(self) - self._cmake.definitions["GDCM_BUILD_DOCBOOK_MANPAGES"] = False - self._cmake.definitions["GDCM_BUILD_SHARED_LIBS"] = self.options.shared + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GDCM_BUILD_DOCBOOK_MANPAGES"] = False + tc.variables["GDCM_BUILD_SHARED_LIBS"] = bool(self.options.shared) # FIXME: unvendor deps https://github.com/conan-io/conan-center-index/pull/5705#discussion_r647224146 - self._cmake.definitions["GDCM_USE_SYSTEM_EXPAT"] = True - self._cmake.definitions["GDCM_USE_SYSTEM_OPENJPEG"] = True - self._cmake.definitions["GDCM_USE_SYSTEM_ZLIB"] = True - if not tools.valid_min_cppstd(self, 11): - self._cmake.definitions["CMAKE_CXX_STANDARD"] = 11 - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["GDCM_USE_SYSTEM_EXPAT"] = True + tc.variables["GDCM_USE_SYSTEM_OPENJPEG"] = True + tc.variables["GDCM_USE_SYSTEM_ZLIB"] = True + if not self.settings.compiler.cppstd: + tc.variables["CMAKE_CXX_STANDARD"] = self._minimum_cpp_standard + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("Copyright.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="Copyright.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() + if self.settings.os == "Windows": bin_dir = os.path.join(self.package_folder, "bin") - tools.remove_files_by_mask(bin_dir, "[!gs]*.dll") - tools.remove_files_by_mask(bin_dir, "*.pdb") - lib_dir = os.path.join(self.package_folder, "lib") - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(lib_dir, self._gdcm_subdir), "[!U]*.cmake") #leave UseGDCM.cmake untouched + rm(self, "[!gs]*.dll", bin_dir) + rm(self, "*.pdb", bin_dir) + + rm(self, "[!U]*.cmake", os.path.join(self.package_folder, "lib", self._gdcm_subdir)) #leave UseGDCM.cmake untouched + rmdir(self, os.path.join(self.package_folder, "share")) self._create_cmake_variables(os.path.join(self.package_folder, self._gdcm_cmake_variables_path)) # TODO: to remove in conan v2 once cmake_find_package* generators removed - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._gdcm_cmake_module_aliases_path), - {library: "GDCM::{}".format(library) for library in self._gdcm_libraries}, - ) + self._create_cmake_module_alias_targets() def _create_cmake_variables(self, variables_file): - v = tools.Version(self.version) - content = textwrap.dedent("""\ + v = Version(self.version) + content = textwrap.dedent(f"""\ # The GDCM version number. - set(GDCM_MAJOR_VERSION "{v_major}") - set(GDCM_MINOR_VERSION "{v_minor}") - set(GDCM_BUILD_VERSION "{v_patch}") + set(GDCM_MAJOR_VERSION "{v.major}") + set(GDCM_MINOR_VERSION "{v.minor}") + set(GDCM_BUILD_VERSION "{v.patch}") get_filename_component(SELF_DIR "${{CMAKE_CURRENT_LIST_FILE}}" PATH) @@ -130,7 +120,7 @@ def _create_cmake_variables(self, variables_file): set(GDCM_CMAKE_DIR "") # The configuration options. - set(GDCM_BUILD_SHARED_LIBS "{build_shared_libs}") + set(GDCM_BUILD_SHARED_LIBS "{"ON" if self.options.shared else "OFF"}") set(GDCM_USE_VTK "OFF") @@ -140,33 +130,25 @@ def _create_cmake_variables(self, variables_file): # The VTK options. set(GDCM_VTK_DIR "") - get_filename_component(GDCM_INCLUDE_ROOT "${{SELF_DIR}}/../../include/{gdcm_subdir}" ABSOLUTE) + get_filename_component(GDCM_INCLUDE_ROOT "${{SELF_DIR}}/../../include/{self._gdcm_subdir}" ABSOLUTE) set(GDCM_INCLUDE_DIRS ${{GDCM_INCLUDE_ROOT}}) get_filename_component(GDCM_LIB_ROOT "${{SELF_DIR}}/../../lib" ABSOLUTE) set(GDCM_LIBRARY_DIRS ${{GDCM_LIB_ROOT}}) - """.format(v_major=v.major, - v_minor=v.minor, - v_patch=v.patch, - build_shared_libs="ON" if self.options.shared else "OFF", - gdcm_subdir=self._gdcm_subdir)) - tools.save(variables_file, content) - - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + """) + save(self, variables_file, content) + + def _create_cmake_module_alias_targets(self): + module_file = os.path.join(self.package_folder, self._gdcm_cmake_module_aliases_path) + targets = {library: f"GDCM::{library}" for library in self._gdcm_libraries} content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) - - @property - def _gdcm_subdir(self): - v = tools.Version(self.version) - return "gdcm-{}.{}".format(v.major, v.minor) + """) + save(self, module_file, content) @property def _gdcm_builddir(self): @@ -203,6 +185,11 @@ def _gdcm_libraries(self): gdcm_libs.append("gdcmuuid") return gdcm_libs + @property + def _gdcm_subdir(self): + v = Version(self.version) + return f"gdcm-{v.major}.{v.minor}" + def package_info(self): self.cpp_info.set_property("cmake_file_name", "GDCM") self.cpp_info.set_property("cmake_build_modules", [self._gdcm_cmake_variables_path]) @@ -234,7 +221,7 @@ def package_info(self): self.cpp_info.components["gdcmMSFF"].requires.append("gdcmuuid") self.cpp_info.components["gdcmCommon"].system_libs = ["dl"] - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): self.cpp_info.components["gdcmCommon"].frameworks = ["CoreFoundation"] # TODO: to remove in conan v2 once cmake_find_package* generators removed diff --git a/recipes/gdcm/all/patches/0003-gcc-11-compilation.patch b/recipes/gdcm/all/patches/0003-gcc-11-compilation.patch new file mode 100644 index 0000000000000..ff438c185dc4f --- /dev/null +++ b/recipes/gdcm/all/patches/0003-gcc-11-compilation.patch @@ -0,0 +1,68 @@ +From 4404b770be337bd0d5d3c2289abfd34426433db2 Mon Sep 17 00:00:00 2001 +From: Axel Braun +Date: Mon, 7 Jun 2021 16:27:52 +0200 +Subject: [PATCH] gdcm fails to build with gcc11 compiler + +gdcm fails to build with gcc11 compiler: +cd +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/build/Source/MediaStorageAndFileFormat +&& /usr/bin/c++ -DgdcmMSFF_EXPORTS +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/Common +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/build/Source/Common +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/DataStructureAndEncodingDefinition +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/DataDictionary +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/InformationObjectDefinition +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Utilities +-I/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/build/Utilities +-I/usr/include/charls -I/usr/include/openjpeg-2.4 -I/usr/include/json-c +-I/usr/include/json -O2 -Wall -D_FORTIFY_SOURCE=2 +-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables +-fstack-clash-protection -Werror=return-type -flto=auto -g -fpermissive +-O2 -g -DNDEBUG -fPIC -MD -MT +Source/MediaStorageAndFileFormat/CMakeFiles/gdcmMSFF.dir/gdcmImageChangePhotometricInterpretation.cxx.o +-MF +CMakeFiles/gdcmMSFF.dir/gdcmImageChangePhotometricInterpretation.cxx.o.d +-o +CMakeFiles/gdcmMSFF.dir/gdcmImageChangePhotometricInterpretation.cxx.o +-c +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.cxx +[ 131s] In file included from +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.cxx:14: +[ 131s] +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h: +In function 'T gdcm::Clamp(int)': +[ 131s] +/home/abuild/rpmbuild/BUILD/gdcm-3.0.8/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:67:32: +error: 'numeric_limits' is not a member of 'std' +[ 131s] 67 | return v < 0 ? 0 : (v > std::numeric_limits::max() +? std::numeric_limits::max() : v); +--- + Source/MediaStorageAndFileFormat/gdcmImage.cxx | 1 + + .../gdcmImageChangePhotometricInterpretation.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/Source/MediaStorageAndFileFormat/gdcmImage.cxx b/Source/MediaStorageAndFileFormat/gdcmImage.cxx +index f59fdd7b7..78a1f7a5c 100644 +--- a/Source/MediaStorageAndFileFormat/gdcmImage.cxx ++++ b/Source/MediaStorageAndFileFormat/gdcmImage.cxx +@@ -20,6 +20,7 @@ + #include "gdcmFragment.h" + + #include ++#include + + namespace gdcm + { +diff --git a/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h b/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h +index d55a5ee47..798d3dfa6 100644 +--- a/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h ++++ b/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h +@@ -16,6 +16,7 @@ + + #include "gdcmImageToImageFilter.h" + #include "gdcmPhotometricInterpretation.h" ++#include + + namespace gdcm + { diff --git a/recipes/gdcm/all/patches/0004-find-expat.patch b/recipes/gdcm/all/patches/0004-find-expat.patch new file mode 100644 index 0000000000000..174d4de82d842 --- /dev/null +++ b/recipes/gdcm/all/patches/0004-find-expat.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -423,7 +423,7 @@ endif() + + if(GDCM_USE_SYSTEM_EXPAT) + # If user say so, then this is a requirement ! +- find_package(EXPAT REQUIRED) ++ find_package(EXPAT REQUIRED MODULE) + set(GDCM_EXPAT_LIBRARIES ${EXPAT_LIBRARIES}) + else() + set(GDCM_EXPAT_LIBRARIES "gdcmexpat") diff --git a/recipes/gdcm/all/test_package/CMakeLists.txt b/recipes/gdcm/all/test_package/CMakeLists.txt index 10a69d9c406b3..5465ea8e54b6d 100644 --- a/recipes/gdcm/all/test_package/CMakeLists.txt +++ b/recipes/gdcm/all/test_package/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package CXX) find_package(GDCM REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) include(${GDCM_USE_FILE}) -target_link_libraries(${PROJECT_NAME} gdcmMSFF) +target_link_libraries(${PROJECT_NAME} PRIVATE gdcmMSFF) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gdcm/all/test_package/conanfile.py b/recipes/gdcm/all/test_package/conanfile.py index 76c08c761eb2b..1f94130dd62ec 100644 --- a/recipes/gdcm/all/test_package/conanfile.py +++ b/recipes/gdcm/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 +from conan.tools.files import mkdir import os - class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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,10 +21,10 @@ 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.bindirs[0], "test_package") input_file = os.path.join(self.source_folder, "DCMTK_JPEGExt_12Bits.dcm") test_dir = "test_dir" - tools.mkdir(test_dir) + mkdir(self, test_dir) output_file = os.path.join(test_dir, "output.dcm") - self.run([bin_path, input_file, output_file], run_environment=True) + self.run(f"\"{bin_path}\" \"{input_file}\" \"{output_file}\"", env="conanrun") diff --git a/recipes/gdcm/all/test_package/test_package.cpp b/recipes/gdcm/all/test_package/test_package.cpp index bce75e82a246e..7b76c7b67dbb7 100644 --- a/recipes/gdcm/all/test_package/test_package.cpp +++ b/recipes/gdcm/all/test_package/test_package.cpp @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) std::cerr << "Could not write: " << outfilename << std::endl; return 1; } - + std::cout << "GDCM test: success\n"; return 0; } diff --git a/recipes/gdcm/all/test_v1_package/CMakeLists.txt b/recipes/gdcm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..512caf660b529 --- /dev/null +++ b/recipes/gdcm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(GDCM REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +include(${GDCM_USE_FILE}) +target_link_libraries(${PROJECT_NAME} gdcmMSFF) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/gdcm/all/test_v1_package/conanfile.py b/recipes/gdcm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..df093a58e7f1c --- /dev/null +++ b/recipes/gdcm/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +from conan.tools.files import mkdir +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + input_file = os.path.join(self.source_folder, "..", "test_package", "DCMTK_JPEGExt_12Bits.dcm") + test_dir = "test_dir" + mkdir(self, test_dir) + output_file = os.path.join(test_dir, "output.dcm") + self.run([bin_path, input_file, output_file], run_environment=True) From 64f422e189d7c094422e695dbf9a22be7c371652 Mon Sep 17 00:00:00 2001 From: Gudmundur Adalsteinsson Date: Mon, 10 Oct 2022 10:44:12 +0000 Subject: [PATCH 347/561] (#13374) cppzmq: add version v4.9.0 --- recipes/cppzmq/all/conandata.yml | 3 +++ recipes/cppzmq/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cppzmq/all/conandata.yml b/recipes/cppzmq/all/conandata.yml index cff7b41edaca6..263917af47c65 100644 --- a/recipes/cppzmq/all/conandata.yml +++ b/recipes/cppzmq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.9.0": + url: "https://github.com/zeromq/cppzmq/archive/v4.9.0.tar.gz" + sha256: "3fdf5b100206953f674c94d40599bdb3ea255244dcc42fab0d75855ee3645581" "4.8.1": url: "https://github.com/zeromq/cppzmq/archive/v4.8.1.tar.gz" sha256: "7a23639a45f3a0049e11a188e29aaedd10b2f4845f0000cf3e22d6774ebde0af" diff --git a/recipes/cppzmq/config.yml b/recipes/cppzmq/config.yml index 45c1476bb5ca0..a52b8593d6634 100644 --- a/recipes/cppzmq/config.yml +++ b/recipes/cppzmq/config.yml @@ -1,4 +1,6 @@ versions: + "4.9.0": + folder: all "4.8.1": folder: all "4.7.1": From a86301c046fed27cb36ea3577f833a0e4414977b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 10 Oct 2022 13:04:21 +0200 Subject: [PATCH 348/561] (#13376) Bump plf_list/2.52 --- recipes/plf_list/all/conandata.yml | 3 +++ recipes/plf_list/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/plf_list/all/conandata.yml b/recipes/plf_list/all/conandata.yml index b39f43243cee6..0df661a8bd89c 100644 --- a/recipes/plf_list/all/conandata.yml +++ b/recipes/plf_list/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.52": + url: "https://github.com/mattreecebentley/plf_list/archive/76115adac11a5f362b7a8eea8362314d547284df.tar.gz" + sha256: "897ff5309c399ec0f7c875b398c7eb07ebe3cd80a75ce337a0bd70456668116b" "2.50": url: "https://github.com/mattreecebentley/plf_list/archive/b520008d5d076402da2344994dd2c1e3cc097460.tar.gz" sha256: "086a1ecad544202c93a3fa4bb7d26cf4140db7ebc2bb39af3e75620050c78f23" diff --git a/recipes/plf_list/config.yml b/recipes/plf_list/config.yml index f5a353305c680..15af51efc0240 100644 --- a/recipes/plf_list/config.yml +++ b/recipes/plf_list/config.yml @@ -1,4 +1,6 @@ versions: + "2.52": + folder: all "2.50": folder: all "2.03": From f5ffb92b817a7acee5af80989e83cc262e7d3070 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 10 Oct 2022 13:24:14 +0200 Subject: [PATCH 349/561] (#13377) Bump plf_colony/7.03 --- recipes/plf_colony/all/conandata.yml | 3 +++ recipes/plf_colony/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/plf_colony/all/conandata.yml b/recipes/plf_colony/all/conandata.yml index 4344d38b83b8c..273a9af551ece 100644 --- a/recipes/plf_colony/all/conandata.yml +++ b/recipes/plf_colony/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.03": + url: "https://github.com/mattreecebentley/plf_colony/archive/f182529ea6f125fc9cee5ca57f499284c777cecb.tar.gz" + sha256: "8fa98993283a158779596f0de17217bd7ef2923fbfc116861172f4ba20f4bc81" "7.00": url: "https://github.com/mattreecebentley/plf_colony/archive/b648c57dab032d326d1487f812e6dbda23b42d20.tar.gz" sha256: "6faae2a68c49ac237c0dff3b1abc2d9b0ebf936ea883d3553c6e6adb6eaa2b4d" diff --git a/recipes/plf_colony/config.yml b/recipes/plf_colony/config.yml index 7e019a19d6be2..934e8ec85091c 100644 --- a/recipes/plf_colony/config.yml +++ b/recipes/plf_colony/config.yml @@ -1,4 +1,6 @@ versions: + "7.03": + folder: all "7.00": folder: all "6.25": From de87dc995cff3818e91599eab9792d9592647456 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 10 Oct 2022 13:46:15 +0200 Subject: [PATCH 350/561] (#13378) Bump plf_queue/1.21 --- recipes/plf_queue/all/conandata.yml | 3 +++ recipes/plf_queue/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/plf_queue/all/conandata.yml b/recipes/plf_queue/all/conandata.yml index 31ccdbb5e7773..c0640bf1dd909 100644 --- a/recipes/plf_queue/all/conandata.yml +++ b/recipes/plf_queue/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.21": + url: "https://github.com/mattreecebentley/plf_queue/archive/67c5de0cc2c21a865dd1fae180eb765d39f2d2c5.tar.gz" + sha256: "baa01a5b0709e5742b87b1bcd7ddbb116e0c841beb22c4553f0d64f54e5a829d" "1.19": url: "https://github.com/mattreecebentley/plf_queue/archive/991661f3674ff30c3f469120f6973556804b8a00.tar.gz" sha256: "7e9a36c0fde9c131c4552d61bd4cf3a71dc78536fba4dc60d8f33b92bf5f4e8d" diff --git a/recipes/plf_queue/config.yml b/recipes/plf_queue/config.yml index 71aadeff7d8a0..229075fd3b93f 100644 --- a/recipes/plf_queue/config.yml +++ b/recipes/plf_queue/config.yml @@ -1,3 +1,5 @@ versions: + "1.21": + folder: all "1.19": folder: all From 431d1f955f63e451a39c02677a49eabaf57ec7b3 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:04:24 +0200 Subject: [PATCH 351/561] (#13380) libyuv: add 1845 + modernize more * add libyuv/1845 * modernize more --- recipes/libyuv/all/conandata.yml | 6 ++++++ recipes/libyuv/all/conanfile.py | 12 +++++++----- recipes/libyuv/config.yml | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/recipes/libyuv/all/conandata.yml b/recipes/libyuv/all/conandata.yml index 3c694384c5d83..0096cb0d06e2f 100644 --- a/recipes/libyuv/all/conandata.yml +++ b/recipes/libyuv/all/conandata.yml @@ -1,11 +1,17 @@ # Versions from LIBYUV_VERSION definition in include/libyuv/version.h # Pay attention to package commits incrementing this definition sources: + "1845": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/b9adaef1133ee835efc8970d1dcdcf23a5b68eba.tar.gz" "1841": url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/f71c83552d373f0ff41833b17e2880632d8561d7.tar.gz" "1768": url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/dfaf7534e0e536f7e5ef8ddd7326797bd09b8622.tar.gz" patches: + "1845": + - patch_file: "patches/0001-fix-cmake-1841.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "compatibility" "1841": - patch_file: "patches/0001-fix-cmake-1841.patch" patch_description: "Fix CMake to be more robust & predictable" diff --git a/recipes/libyuv/all/conanfile.py b/recipes/libyuv/all/conanfile.py index 6c1cdc0dac668..3c7a9857e98ba 100644 --- a/recipes/libyuv/all/conanfile.py +++ b/recipes/libyuv/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.52.0" class LibyuvConan(ConanFile): @@ -28,8 +28,7 @@ class LibyuvConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -37,7 +36,10 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/libyuv/config.yml b/recipes/libyuv/config.yml index 29082e49652b8..336e0262a0b45 100644 --- a/recipes/libyuv/config.yml +++ b/recipes/libyuv/config.yml @@ -1,4 +1,6 @@ versions: + "1845": + folder: all "1841": folder: all "1768": From 07c8af0ec1c919aeaa265b302a6f54200ee349f1 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Mon, 10 Oct 2022 05:44:15 -0700 Subject: [PATCH 352/561] (#13385) templates: Update cmake templates usage of cache variables the normal ones are enough in 99% of cases so those should be prefered --- docs/package_templates/cmake_package/all/conanfile.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index d9603ad628b6c..af351727d56bf 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -109,13 +109,15 @@ def generate(self): # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist tc = CMakeToolchain(self) # Boolean values are preferred instead of "ON"/"OFF" - tc.cache_variables["PACKAGE_CUSTOM_DEFINITION"] = True + tc.variables["PACKAGE_CUSTOM_DEFINITION"] = True if is_msvc(self): # don't use self.settings.compiler.runtime - tc.cache_variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) # deps_cpp_info, deps_env_info and deps_user_info are no longer used if self.dependencies["dependency"].options.foobar: - tc.cache_variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs + tc.variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs + # cache_variables should be used sparingly, example setting cmake policies + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() # In case there are dependencies listed on requirements, CMakeDeps should be used tc = CMakeDeps(self) From 9c9dfca1906fa98aa576d76c92a48b97d52fddb5 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Mon, 10 Oct 2022 15:05:38 +0200 Subject: [PATCH 353/561] (#13391) jom: modernize * jom: modernize * Update conanfile.py --- recipes/jom/all/conanfile.py | 39 +++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/recipes/jom/all/conanfile.py b/recipes/jom/all/conanfile.py index df5ddcdd86ee8..d1824504b7e54 100644 --- a/recipes/jom/all/conanfile.py +++ b/recipes/jom/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import get, download +from conan.errors import ConanInvalidConfiguration import os +required_conan_version = ">=1.47.0" class JomInstallerConan(ConanFile): name = "jom" @@ -9,21 +11,40 @@ class JomInstallerConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://wiki.qt.io/Jom" license = "GPL-3.0" - topics = ("conan", "jom", "build", "makefile", "make") + topics = ("build", "makefile", "make") - settings = "os" + settings = "os", "arch", "compiler", "build_type" - def configure(self): + # not needed but supress warning message from conan commands + def layout(self): + pass + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def validate(self): if self.settings.os != "Windows": raise ConanInvalidConfiguration("Only Windows supported") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - tools.download('https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v%s' % self.version, filename='LICENSE.GPL') + get(self, **self.conan_data["sources"][self.version]) + download(self, f'https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v{self.version}', filename='LICENSE.GPL') def package(self): self.copy("LICENSE.GPL", dst= 'licenses', src='') self.copy("*.exe", dst="bin", src="") - + def package_info(self): - self.env_info.path.append(os.path.join(self.package_folder, "bin")) + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + bin_folder = os.path.join(self.package_folder, "bin") + # In case need to find packaged tools when building a package + self.buildenv_info.append("PATH", bin_folder) + # In case need to find packaged tools at runtime + self.runenv_info.append("PATH", bin_folder) + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.PATH.append(bin_folder) From 65a681f9a758a287b0053d5a123f55a4130dd8d3 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 10 Oct 2022 15:25:01 -0500 Subject: [PATCH 354/561] (#13375) boost-ext-ut: Minor updates * boost-ext-ut: Minor updates * Update recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt Co-authored-by: Uilian Ries * Update recipes/boost-ext-ut/all/test_package/CMakeLists.txt Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/boost-ext-ut/all/conanfile.py | 15 +++++++-------- .../boost-ext-ut/all/test_package/CMakeLists.txt | 9 +++------ .../boost-ext-ut/all/test_package/conanfile.py | 1 + .../all/test_v1_package/CMakeLists.txt | 11 ++++------- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/recipes/boost-ext-ut/all/conanfile.py b/recipes/boost-ext-ut/all/conanfile.py index df8a7ffd45545..4cac41db520ea 100644 --- a/recipes/boost-ext-ut/all/conanfile.py +++ b/recipes/boost-ext-ut/all/conanfile.py @@ -3,12 +3,12 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class UTConan(ConanFile): @@ -37,8 +37,7 @@ def _minimum_compilers_version(self): } def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, patch["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if Version(self.version) <= "1.1.8": @@ -47,13 +46,13 @@ def config_options(self): self.options.disable_module = True def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) if Version(self.version) <= "1.1.8" and is_msvc(self): - raise ConanInvalidConfiguration(f"{self.name} version 1.1.8 may not be built with MSVC. " + raise ConanInvalidConfiguration(f"{self.ref} may not be built with MSVC. " "Please use at least version 1.1.9 with MSVC.") if is_msvc(self): @@ -64,12 +63,12 @@ def validate(self): min_version = self._minimum_compilers_version.get( str(self.settings.compiler)) if not min_version: - self.output.warn(f"{self.name} recipe lacks information about the {self.settings.compiler} " + self.output.warn(f"{self.ref} recipe lacks information about the {self.settings.compiler} " "compiler support.") else: if Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration( - f"{self.name} requires C++{self._minimum_cpp_standard} support. " + f"{self.ref} requires C++{self._minimum_cpp_standard} support. " f"The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") def source(self): diff --git a/recipes/boost-ext-ut/all/test_package/CMakeLists.txt b/recipes/boost-ext-ut/all/test_package/CMakeLists.txt index 99ad6ec453970..d07eea68c3c10 100644 --- a/recipes/boost-ext-ut/all/test_package/CMakeLists.txt +++ b/recipes/boost-ext-ut/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.16) -project(test_package) - -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED yes) -set(CMAKE_CXX_EXTENSIONS no) +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) find_package(ut REQUIRED CONFIG) add_executable(test_package test_package.cpp) target_link_libraries(test_package PRIVATE boost::ut) +target_compile_features(test_package PRIVATE cxx_std_20) diff --git a/recipes/boost-ext-ut/all/test_package/conanfile.py b/recipes/boost-ext-ut/all/test_package/conanfile.py index 87a7297528bf3..cb68885270b30 100644 --- a/recipes/boost-ext-ut/all/test_package/conanfile.py +++ b/recipes/boost-ext-ut/all/test_package/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt b/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt index 05c457be73ade..b19f5e628f367 100644 --- a/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt +++ b/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt @@ -1,9 +1,5 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED yes) -set(CMAKE_CXX_EXTENSIONS no) +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) @@ -11,4 +7,5 @@ conan_basic_setup(TARGETS) find_package(ut REQUIRED CONFIG) add_executable(test_package ../test_package/test_package.cpp) -target_link_libraries(test_package boost::ut) +target_link_libraries(test_package PRIVATE boost::ut) +target_compile_features(test_package PRIVATE cxx_std_20) From 8445a7ba0d2cab1287041bc2409d1538301768a5 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Tue, 11 Oct 2022 09:46:19 +0300 Subject: [PATCH 355/561] (#13336) libpng 1.6.38: pass PNG_EXECUTABLES=OFF + fix v2 linter error * libpng: pass PNG_EXECUTABLES=OFF for v1.6.38 and later no need to build executables as they're removed in package() anyway * fix linter v2 error --- recipes/libpng/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index 1db57c71fff2b..fab92b5657a56 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.scm import Version from conan.tools.files import apply_conandata_patches, get, rmdir, replace_in_file, copy, rm from conan.tools.microsoft import is_msvc -from conan.tools.build.cross_building import cross_building +from conan.tools.build import cross_building from conan.tools.apple import is_apple_os from conan.errors import ConanInvalidConfiguration import os @@ -149,6 +149,9 @@ def generate(self): tc.variables["PNG_INTEL_SSE"] = self._neon_msa_sse_vsx_mapping[str(self.options.sse)] if self._has_vsx_support: tc.variables["PNG_POWERPC_VSX"] = self._neon_msa_sse_vsx_mapping[str(self.options.vsx)] + if Version(self.version) >= "1.6.38": + tc.variables["PNG_EXECUTABLES"] = False + tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False tc.generate() tc = CMakeDeps(self) From 8e8536d829c3eec845ac19140e3681d4fe3f7a31 Mon Sep 17 00:00:00 2001 From: FireWolf <10460478+0xFireWolf@users.noreply.github.com> Date: Tue, 11 Oct 2022 15:06:38 -0700 Subject: [PATCH 356/561] (#12902) antlr4-cppruntime: Upgrade to 4.11.0/4.11.1 * antlr4-cppruntime: Upgrade to 4.11.1. * antlr4-cppruntime: No longer requires libuuid as of 4.11. * antlr4-cppruntime: The minimum version of GCC is now 8. * antlr4-cppruntime: Revert the minimum version of GCC to 7. * antlr4-cppruntime: Add the patches that fix the compiler errors reported by GCC 7. * antlr4-cppruntime: Remove the trailing space at the end of each patch file. * antlr4-cppruntime: Fix the version key in conandata.yml. * antlr4-cppruntime: CI seems to be stuck. * Prepare for Conan 2.0 Signed-off-by: Uilian Ries * Fix the comparisons. Co-authored-by: Uilian Ries * Retrigger the CI. * antlr4-cppruntime: Add patch files that drop the `libuuid` dependency from 4.9.3, 4.10 and 4.10.1. * antlr4-cppruntime: Register patch files for 4.9.3, 4.10 and 4.10.1. * antlr4-cppruntime: Remove the requirement of `libuuid/1.0.3` and its build requirements from the Conan file. * antlr4-cppruntime: Enable ARM builds on all supported versions. * antlr4-cppruntime: Remove `PkgConfigDeps` from the Conan file since `libuuid` has been dropped. * antlr4-cppruntime: `_create_cmake_module_alias_targets` should not be a static function. * antlr4-cppruntime: Simplify the implementation and fix the typos in `validate()`. * antlr4-cppruntime: Restore the CMake wrapper otherwise antlr's runtime library (< 4.11) is always linked against the static MSVC runtime. * antlr4-cppruntime: Use the new function `check_min_vs()`` to handle both `Visual Studio` and `msvc` easily. * antlr4-cppruntime: Remove the dead releases, 4.10.0 and 4.11.0. * antlr4-cppruntime: Add the metadata for each patch for better record keeping. * antlr4-cppruntime: Remove `VirtualBuildEnv` since there is no more build requirement. * antlr4-cppruntime: Fix the minimum version of the MSVC compiler; should be `192` instead of `1920`. * antlr4-cppruntime: Set `WITH_STATIC_CRT` in CMakeToolchain's cached variables. * antlr4-cppruntime: Remove the `CMakeLists.txt` wrapper with the new cache variable set in the toolchain. * antlr4-cppruntime: Simplify the implementation of `validate()`. * antlr4-cppruntime: Remove 4.10 and 4.11 from `config.yml`. * antlr4-cppruntime: Remove `Visual Studio` and `msvc` from the C++17 dictionary. The first `check_min_vs()` call already ensures that MSVC supports C++17. Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/antlr4-cppruntime/all/CMakeLists.txt | 7 - recipes/antlr4-cppruntime/all/conandata.yml | 33 +++- recipes/antlr4-cppruntime/all/conanfile.py | 165 ++++++++---------- .../all/patches/0002-update-FlatHashSet.patch | 15 ++ .../all/patches/0003-update-FlatHashMap.patch | 15 ++ .../0004-update-DropLibuuid-4.10.x-1.patch | 13 ++ .../0004-update-DropLibuuid-4.10.x-2.patch | 14 ++ .../0004-update-DropLibuuid-4.9.3-1.patch | 13 ++ .../0004-update-DropLibuuid-4.9.3-2.patch | 14 ++ .../all/test_package/CMakeLists.txt | 5 +- .../all/test_package/conanfile.py | 21 ++- .../all/test_v1_package/CMakeLists.txt | 15 ++ .../all/test_v1_package/conanfile.py | 17 ++ recipes/antlr4-cppruntime/config.yml | 4 +- 14 files changed, 237 insertions(+), 114 deletions(-) delete mode 100644 recipes/antlr4-cppruntime/all/CMakeLists.txt create mode 100644 recipes/antlr4-cppruntime/all/patches/0002-update-FlatHashSet.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0003-update-FlatHashMap.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-1.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-2.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-1.patch create mode 100644 recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-2.patch create mode 100644 recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py diff --git a/recipes/antlr4-cppruntime/all/CMakeLists.txt b/recipes/antlr4-cppruntime/all/CMakeLists.txt deleted file mode 100644 index 327601d6d347e..0000000000000 --- a/recipes/antlr4-cppruntime/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder/runtime/Cpp) diff --git a/recipes/antlr4-cppruntime/all/conandata.yml b/recipes/antlr4-cppruntime/all/conandata.yml index 7cbac2212a675..2605966cb79dc 100644 --- a/recipes/antlr4-cppruntime/all/conandata.yml +++ b/recipes/antlr4-cppruntime/all/conandata.yml @@ -2,13 +2,38 @@ sources: "4.9.3": url: "https://github.com/antlr/antlr4/archive/refs/tags/4.9.3.tar.gz" sha256: "efe4057d75ab48145d4683100fec7f77d7f87fa258707330cadd1f8e6f7eecae" - "4.10": - url: "https://github.com/antlr/antlr4/archive/refs/tags/4.10.tar.gz" - sha256: "39b2604fc75fa77323bd7046f2fb750c818cf11fcce2cd6cca06b6697f60ffbb" "4.10.1": url: "https://github.com/antlr/antlr4/archive/refs/tags/4.10.1.tar.gz" sha256: "a320568b738e42735946bebc5d9d333170e14a251c5734e8b852ad1502efa8a2" + "4.11.1": + url: "https://github.com/antlr/antlr4/archive/refs/tags/4.11.1.tar.gz" + sha256: "81f87f03bb83b48da62e4fc8bfdaf447efb9fb3b7f19eb5cbc37f64e171218cf" patches: "4.9.3": - patch_file: "patches/0001-update-cmakelist.patch" - base_path: "source_subfolder" + - patch_file: "patches/0004-update-DropLibuuid-4.9.3-1.patch" + patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#1) which is not used since 4.9." + patch_type: "backport" + patch_source: "https://github.com/antlr/antlr4/pull/3787" + - patch_file: "patches/0004-update-DropLibuuid-4.9.3-2.patch" + patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#2) which is not used since 4.9." + patch_type: "backport" + patch_source: "https://github.com/antlr/antlr4/pull/3787" + "4.10.1": + - patch_file: "patches/0004-update-DropLibuuid-4.10.x-1.patch" + patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#1) which is not used since 4.9." + patch_type: "backport" + patch_source: "https://github.com/antlr/antlr4/pull/3787" + - patch_file: "patches/0004-update-DropLibuuid-4.10.x-2.patch" + patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#2) which is not used since 4.9." + patch_type: "backport" + patch_source: "https://github.com/antlr/antlr4/pull/3787" + "4.11.1": + - patch_file: "patches/0002-update-FlatHashSet.patch" + patch_description: "Fix the compiler errors reported by GCC 7 due to the new type FlatHashSet introduced in 4.11." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/3885" + - patch_file: "patches/0003-update-FlatHashMap.patch" + patch_description: "Fix the compiler errors reported by GCC 7 due to the new type FlatHashMap introduced in 4.11." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/3885" diff --git a/recipes/antlr4-cppruntime/all/conanfile.py b/recipes/antlr4-cppruntime/all/conanfile.py index 5f1d957aa04fd..e47c4f36aca6b 100644 --- a/recipes/antlr4-cppruntime/all/conanfile.py +++ b/recipes/antlr4-cppruntime/all/conanfile.py @@ -1,11 +1,14 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, check_min_vs +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rm, rmdir, save +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os import textwrap -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.52.0" class Antlr4CppRuntimeConan(ConanFile): @@ -15,6 +18,7 @@ class Antlr4CppRuntimeConan(ConanFile): topics = ("antlr", "parser", "runtime") url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" + settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], "fPIC": [True, False], @@ -23,30 +27,29 @@ class Antlr4CppRuntimeConan(ConanFile): "shared": False, "fPIC": True, } - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "pkg_config" short_paths = True - compiler_required_cpp17 = { - "Visual Studio": "16", + @property + def _minimum_cpp_standard(self): + # Antlr 4.9.3 requires C++11 while newer versions require C++17 + return 17 if Version(self.version) >= "4.10" else 11 + + @property + def _minimum_compiler_versions_cpp17(self): + return { "gcc": "7", "clang": "5", "apple-clang": "9.1" - } - - - @property - def _source_subfolder(self): - return "source_subfolder" + } - @property - def _build_subfolder(self): - return "build_subfolder" + def _check_minimum_compiler_version_cpp17(self): + compiler = self.info.settings.compiler + min_compiler_version = self._minimum_compiler_versions_cpp17.get(str(compiler), False) + if min_compiler_version and Version(compiler.version) < min_compiler_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++17, which your compiler does not support.") def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -54,93 +57,74 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): + # As of 4.11, antlr4-cppruntime no longer requires libuuid. + # Reference: [C++] Remove libuuid dependency (https://github.com/antlr/antlr4/pull/3787) + # Note that the above PR points that libuuid can be removed from 4.9.3, 4.10 and 4.10.1 as well. + # We have patched the CMakeLists.txt to drop the dependency on libuuid from aforementioned antlr versions. self.requires("utfcpp/3.2.1") - if self.settings.os in ("FreeBSD", "Linux"): - self.requires("libuuid/1.0.3") def validate(self): - if str(self.settings.arch).startswith("arm"): - raise ConanInvalidConfiguration("arm architectures are not supported") - # Need to deal with missing libuuid on Arm. - # So far ANTLR delivers macOS binary package. - - compiler = self.settings.compiler - compiler_version = tools.Version(self.settings.compiler.version) - antlr_version = tools.Version(self.version) - - if compiler == "Visual Studio" and compiler_version < "16": - raise ConanInvalidConfiguration("library claims C2668 'Ambiguous call to overloaded function'") - # Compilation of this library on version 15 claims C2668 Error. - # This could be Bogus error or malformed Antl4 libary. - # Version 16 compiles this code correctly. - - if antlr_version >= "4.10": - # Antlr4 for 4.9.3 does not require C++17 - C++11 is enough. - # for newest version we need C++17 compatible compiler here - - if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "17") - - minimum_version = self.compiler_required_cpp17.get(str(self.settings.compiler), False) - if minimum_version: - if compiler_version < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) - else: - self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) - - if is_msvc(self) and antlr_version == "4.10": - raise ConanInvalidConfiguration("{} Antlr4 4.10 version is broken on msvc - Use 4.10.1 or above.".format(self.name)) - - def build_requirements(self): - if self.settings.os in ("FreeBSD", "Linux"): - self.build_requires("pkgconf/1.7.4") + # Compilation of this library on version 15 claims C2668 Error. + # This could be Bogus error or malformed Antlr4 library. + # Guard: The minimum MSVC version is 16 or 1920 (which already supports C++17) + check_min_vs(self, "192") + + # Check the minimum C++ standard + min_cppstd = self._minimum_cpp_standard + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, min_cppstd) + # Check the minimum compiler version + if min_cppstd == 17: + self._check_minimum_compiler_version_cpp17() 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], destination=self.source_folder, strip_root=True) - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["ANTLR4_INSTALL"] = True - cmake.definitions["WITH_LIBCXX"] = self.settings.compiler.get_safe("libcxx") == "libc++" - cmake.definitions["ANTLR_BUILD_CPP_TESTS"] = False + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ANTLR4_INSTALL"] = True + tc.variables["WITH_LIBCXX"] = self.settings.compiler.get_safe("libcxx") == "libc++" + tc.variables["ANTLR_BUILD_CPP_TESTS"] = False if is_msvc(self): - cmake.definitions["WITH_STATIC_CRT"] = is_msvc_static_runtime(self) - cmake.definitions["WITH_DEMO"] = False - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.cache_variables["WITH_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["WITH_DEMO"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder="runtime/Cpp") cmake.build() def package(self): - self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", src=os.path.join(self.source_folder), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() if self.options.shared: - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*antlr4-runtime-static.*") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*antlr4-runtime.a") + rm(self, "*antlr4-runtime-static.*", os.path.join(self.package_folder, "lib")) + rm(self, "*antlr4-runtime.a", os.path.join(self.package_folder, "lib")) else: - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.dll") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "antlr4-runtime.lib") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*antlr4-runtime.so*") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*antlr4-runtime.dll*") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*antlr4-runtime.*dylib") - tools.rmdir(os.path.join(self.package_folder, "share")) + rm(self, "*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "antlr4-runtime.lib", os.path.join(self.package_folder, "lib")) + rm(self, "*antlr4-runtime.so*", os.path.join(self.package_folder, "lib")) + rm(self, "*antlr4-runtime.dll*", os.path.join(self.package_folder, "lib")) + rm(self, "*antlr4-runtime.*dylib", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) # FIXME: this also removes lib/cmake/antlr4-generator # This cmake config script is needed to provide the cmake function `antlr4_generate` - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) # TODO: to remove in conan v2 once cmake_find_package* generatores removed self._create_cmake_module_alias_targets( @@ -148,8 +132,7 @@ def package(self): {"antlr4_shared" if self.options.shared else "antlr4_static": "antlr4-cppruntime::antlr4-cppruntime"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): content += textwrap.dedent(f"""\ @@ -158,7 +141,7 @@ def _create_cmake_module_alias_targets(module_file, targets): set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() """) - tools.save(module_file, content) + save(self, module_file, content) @property def _module_file_rel_path(self): diff --git a/recipes/antlr4-cppruntime/all/patches/0002-update-FlatHashSet.patch b/recipes/antlr4-cppruntime/all/patches/0002-update-FlatHashSet.patch new file mode 100644 index 0000000000000..336271b756971 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0002-update-FlatHashSet.patch @@ -0,0 +1,15 @@ +--- runtime/Cpp/runtime/src/FlatHashSet.h ++++ runtime/Cpp/runtime/src/FlatHashSet.h +@@ -48,9 +48,9 @@ + using FlatHashSet = absl::flat_hash_set; + #else + template ::hasher, +- typename Equal = typename std::unordered_set::key_equal, +- typename Allocator = typename std::unordered_set::allocator_type> ++ typename Hash = std::hash, ++ typename Equal = std::equal_to, ++ typename Allocator = std::allocator> + using FlatHashSet = std::unordered_set; + #endif + diff --git a/recipes/antlr4-cppruntime/all/patches/0003-update-FlatHashMap.patch b/recipes/antlr4-cppruntime/all/patches/0003-update-FlatHashMap.patch new file mode 100644 index 0000000000000..e841ee8933643 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0003-update-FlatHashMap.patch @@ -0,0 +1,15 @@ +--- runtime/Cpp/runtime/src/FlatHashMap.h ++++ runtime/Cpp/runtime/src/FlatHashMap.h +@@ -48,9 +48,9 @@ + using FlatHashMap = absl::flat_hash_map; + #else + template ::hasher, +- typename Equal = typename std::unordered_map::key_equal, +- typename Allocator = typename std::unordered_map::allocator_type> ++ typename Hash = std::hash, ++ typename Equal = std::equal_to, ++ typename Allocator = std::allocator>> + using FlatHashMap = std::unordered_map; + #endif + diff --git a/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-1.patch b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-1.patch new file mode 100644 index 0000000000000..52e813be947a8 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-1.patch @@ -0,0 +1,13 @@ +--- runtime/Cpp/CMakeLists.txt ++++ runtime/Cpp/CMakeLists.txt +@@ -41,10 +41,6 @@ + CMAKE_POLICY(SET CMP0054 OLD) + endif() + +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- find_package(PkgConfig REQUIRED) +- pkg_check_modules(UUID REQUIRED uuid) +-endif() + if(APPLE) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + endif() diff --git a/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-2.patch b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-2.patch new file mode 100644 index 0000000000000..f1fffa5599c8b --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.10.x-2.patch @@ -0,0 +1,14 @@ +--- runtime/Cpp/runtime/CMakeLists.txt ++++ runtime/Cpp/runtime/CMakeLists.txt +@@ -69,10 +69,7 @@ + gtest_discover_tests(antlr4_tests) + endif() + +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- target_link_libraries(antlr4_shared ${UUID_LIBRARIES}) +- target_link_libraries(antlr4_static ${UUID_LIBRARIES}) +-elseif(APPLE) ++if(APPLE) + target_link_libraries(antlr4_shared ${COREFOUNDATION_LIBRARY}) + target_link_libraries(antlr4_static ${COREFOUNDATION_LIBRARY}) + endif() diff --git a/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-1.patch b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-1.patch new file mode 100644 index 0000000000000..6412c93b3d0b5 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-1.patch @@ -0,0 +1,13 @@ +--- runtime/Cpp/CMakeLists.txt ++++ runtime/Cpp/CMakeLists.txt +@@ -39,10 +39,6 @@ + CMAKE_POLICY(SET CMP0054 OLD) + endif() + +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- find_package(PkgConfig REQUIRED) +- pkg_check_modules(UUID REQUIRED uuid) +-endif() + if(APPLE) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + endif() diff --git a/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-2.patch b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-2.patch new file mode 100644 index 0000000000000..a9b062d8bea5a --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0004-update-DropLibuuid-4.9.3-2.patch @@ -0,0 +1,14 @@ +--- runtime/Cpp/runtime/CMakeLists.txt ++++ runtime/Cpp/runtime/CMakeLists.txt +@@ -75,10 +75,7 @@ + endif() + endif() + +-if(CMAKE_SYSTEM_NAME MATCHES "Linux") +- target_link_libraries(antlr4_shared ${UUID_LIBRARIES}) +- target_link_libraries(antlr4_static ${UUID_LIBRARIES}) +-elseif(APPLE) ++if(APPLE) + target_link_libraries(antlr4_shared ${COREFOUNDATION_LIBRARY}) + target_link_libraries(antlr4_static ${COREFOUNDATION_LIBRARY}) + endif() diff --git a/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt b/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt index 90f183c23127a..e1a9346912d37 100644 --- a/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt +++ b/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(antlr4-runtime REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) @@ -12,4 +9,4 @@ if(TARGET antlr4_shared) else() target_link_libraries(${PROJECT_NAME} PRIVATE antlr4_static) endif() -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/antlr4-cppruntime/all/test_package/conanfile.py b/recipes/antlr4-cppruntime/all/test_package/conanfile.py index 90eb89e3f2f46..a9fb96656f203 100644 --- a/recipes/antlr4-cppruntime/all/test_package/conanfile.py +++ b/recipes/antlr4-cppruntime/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", "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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt b/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b9ee4c6f88e3f --- /dev/null +++ b/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(antlr4-runtime REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +if(TARGET antlr4_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE antlr4_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE antlr4_static) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py b/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..90eb89e3f2f46 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/antlr4-cppruntime/config.yml b/recipes/antlr4-cppruntime/config.yml index 9b65d8dc1061b..fd8294e924d85 100644 --- a/recipes/antlr4-cppruntime/config.yml +++ b/recipes/antlr4-cppruntime/config.yml @@ -1,7 +1,7 @@ versions: "4.9.3": folder: all - "4.10": - folder: all "4.10.1": folder: all + "4.11.1": + folder: all From e4b2df4d01c689bd6a6288d06f2b4aedaf11efbf Mon Sep 17 00:00:00 2001 From: Joel Falcou Date: Wed, 12 Oct 2022 00:55:22 +0200 Subject: [PATCH 357/561] (#13303) Update/jfalcou eve * Update EVE to v2022.09 * Proper license * Prepare for Conan v2 Signed-off-by: Uilian Ries * requires conan 1.51.3 Signed-off-by: Uilian Ries * Fix version Signed-off-by: Uilian Ries * Move to use get_safe Co-authored-by: Uilian Ries * Another changes for header only compielr version detection Co-authored-by: Uilian Ries * Update recipes/jfalcou-eve/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/jfalcou-eve/all/conanfile.py Co-authored-by: Uilian Ries * Fix test_package path Co-authored-by: Uilian Ries * Fix licensing 1/2 Co-authored-by: Chris Mc * Fix licensing 2/2 Co-authored-by: Chris Mc Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/jfalcou-eve/all/conandata.yml | 3 + recipes/jfalcou-eve/all/conanfile.py | 60 ++++++++++++------- .../all/test_package/CMakeLists.txt | 13 ++-- .../jfalcou-eve/all/test_package/conanfile.py | 22 +++++-- .../all/test_v1_package/CMakeLists.txt | 11 ++++ .../all/test_v1_package/conanfile.py | 16 +++++ recipes/jfalcou-eve/config.yml | 2 + 7 files changed, 90 insertions(+), 37 deletions(-) create mode 100644 recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jfalcou-eve/all/test_v1_package/conanfile.py diff --git a/recipes/jfalcou-eve/all/conandata.yml b/recipes/jfalcou-eve/all/conandata.yml index 1968e85720cbe..00caa43d324c9 100644 --- a/recipes/jfalcou-eve/all/conandata.yml +++ b/recipes/jfalcou-eve/all/conandata.yml @@ -5,3 +5,6 @@ sources: "v2022.03.0": url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.03.0.tar.gz" sha256: "8bf9faea516806e7dd468e778dcedc81c51f0b2c6a70b9c75987ce12bb759911" + "v2022.09.0": + url: "https://github.com/jfalcou/eve/archive/refs/tags/v2022.09.0.tar.gz" + sha256: "53a4e1944a1080c67380a6d7f4fb42998f1c1db35e2370e02d7853c3ac1e0a33" diff --git a/recipes/jfalcou-eve/all/conanfile.py b/recipes/jfalcou-eve/all/conanfile.py index 552f767f67158..d79178dde59e1 100644 --- a/recipes/jfalcou-eve/all/conanfile.py +++ b/recipes/jfalcou-eve/all/conanfile.py @@ -1,25 +1,29 @@ -from conan import ConanFile, tools +from conan import ConanFile +from conan.tools import files +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy from conan.tools.scm import Version -from conans.errors import ConanInvalidConfiguration +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.51.3" -required_conan_version = ">=1.33.0" class JfalcouEveConan(ConanFile): name = "jfalcou-eve" description = ("Expressive Velocity Engine - reimplementation of the old " "Boost.SIMD on C++20" ) - homepage = "https://github.com/jfalcou/eve" - topics = ("c++", "simd") - license = "MIT" + homepage = "https://jfalcou.github.io/eve/" + topics = ("cpp", "simd") + license = ("MIT", "BSL-1.0") url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" @property def _min_cppstd(self): @@ -29,14 +33,25 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return {"gcc": "11", "Visual Studio": "16.9", + "msvc": "1928", "clang": "13", - "apple-clang": "13", - } + "apple-clang": "13"} + + def configure(self): + version = Version(self.version.strip("v")) + if version.major < 2022 or (version.major == 2022 and version.minor < 9): + self.license = "MIT" + else: + self.license = "BSL-1.0" + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.build.check_min_cppstd(self, self._min_cppstd) - if self.settings.compiler == "Visual Studio": + # FIXME: Need to use self.info.settings for header-only + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + if is_msvc(self): raise ConanInvalidConfiguration("EVE does not support MSVC yet (https://github.com/jfalcou/eve/issues/1022).") if self.settings.compiler == "apple-clang": raise ConanInvalidConfiguration("EVE does not support apple Clang due to an incomplete libcpp.") @@ -49,21 +64,22 @@ def lazy_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn("{} {} requires C++20. Your compiler is unknown. Assuming it supports C++20.".format(self.name, self.version)) + self.output.warn(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} {} requires C++20, which your compiler does not support.".format(self.name, self.version)) + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") def package_id(self): - self.info.header_only() + self.info.clear() def source(self): - tools.files.get(self, **self.conan_data["sources"][self.version], strip_root=True, - destination=self._source_subfolder) + files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self.source_folder) def package(self): - self.copy(pattern="include/*", src=self._source_subfolder) - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + copy(self, pattern="*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) def package_info(self): self.cpp_info.names["cmake_find_package"] = "eve" self.cpp_info.names["cmake_find_package_multi"] = "eve" + self.cpp_info.set_property("cmake_file_name", "eve") + self.cpp_info.set_property("cmake_target_name", "eve::eve") diff --git a/recipes/jfalcou-eve/all/test_package/CMakeLists.txt b/recipes/jfalcou-eve/all/test_package/CMakeLists.txt index 7a2c52ebe962c..07df5491f5a34 100644 --- a/recipes/jfalcou-eve/all/test_package/CMakeLists.txt +++ b/recipes/jfalcou-eve/all/test_package/CMakeLists.txt @@ -1,13 +1,8 @@ cmake_minimum_required(VERSION 3.12) -project(test_package) +project(test_package CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -find_package(eve REQUIRED) +find_package(eve REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} eve::eve) -# FIXME: recipe should transitively sets proper minimum cxx standard. -# See https://github.com/conan-io/conan/issues/7772 about revising cxx std model. -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) +target_link_libraries(${PROJECT_NAME} PRIVATE eve::eve) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/jfalcou-eve/all/test_package/conanfile.py b/recipes/jfalcou-eve/all/test_package/conanfile.py index 2872870378fc1..a9fb96656f203 100644 --- a/recipes/jfalcou-eve/all/test_package/conanfile.py +++ b/recipes/jfalcou-eve/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 JfalcouEveConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt b/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e31b52213165 --- /dev/null +++ b/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(eve REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE eve::eve) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/jfalcou-eve/all/test_v1_package/conanfile.py b/recipes/jfalcou-eve/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..daab8195118f1 --- /dev/null +++ b/recipes/jfalcou-eve/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class JfalcouEveConan(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): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/jfalcou-eve/config.yml b/recipes/jfalcou-eve/config.yml index 0190125da41b4..de70c903b044d 100644 --- a/recipes/jfalcou-eve/config.yml +++ b/recipes/jfalcou-eve/config.yml @@ -3,3 +3,5 @@ versions: folder: all "v2022.03.0": folder: all + "v2022.09.0": + folder: all From 954ccbb8829f4b5c74af512bf15b697ff1235468 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Wed, 12 Oct 2022 02:31:45 +0300 Subject: [PATCH 358/561] (#13361) sdl_image: build improvements for ImageIO option for Apple platforms * fix shared macOS build with ImageIO * add required frameworks to cpp_info in static macOS build with ImageIO * allow other Apple platforms to be built with ImageIO * update libjpeg dependency to 9e fixes CI build error: WARN: libtiff/4.4.0: requirement libjpeg/9e overridden by sdl_image/2.0.5 to libjpeg/9d ERROR: Missing binary: libtiff/4.4.0:f82ef25da4e9f661f118d3aa44ad6c1bfef0bc79 --- recipes/sdl_image/all/CMakeLists.txt | 22 +++++++++++++++++++++- recipes/sdl_image/all/conanfile.py | 21 ++++++++++++++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/recipes/sdl_image/all/CMakeLists.txt b/recipes/sdl_image/all/CMakeLists.txt index 8d9baff2eea9f..0a8d9782df248 100644 --- a/recipes/sdl_image/all/CMakeLists.txt +++ b/recipes/sdl_image/all/CMakeLists.txt @@ -14,7 +14,7 @@ macro(add_image_option type) endmacro() if(APPLE) - option(IMAGEIO "use native Mac OS X frameworks for loading images" ON) + option(IMAGEIO "use native Apple frameworks for loading images" ON) if(IMAGEIO) set(IMAGEIO_SOURCE "${SDL_IMAGE_SRC_DIR}/IMG_ImageIO.m") else() @@ -93,6 +93,26 @@ if(WEBP) target_link_libraries(${PROJECT_NAME} PRIVATE WebP::webp) endif() +if(APPLE AND IMAGEIO AND BUILD_SHARED_LIBS) + if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) + set(extraFrameworks + "-framework ApplicationServices" + ) + else() + set(extraFrameworks + "-framework MobileCoreServices" + "-framework UIKit" + ) + endif() + target_link_libraries(${PROJECT_NAME} PRIVATE + "-framework CoreFoundation" + "-framework CoreGraphics" + "-framework Foundation" + "-framework ImageIO" + ${extraFrameworks} + ) +endif() + install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION "lib" LIBRARY DESTINATION "lib" diff --git a/recipes/sdl_image/all/conanfile.py b/recipes/sdl_image/all/conanfile.py index 23e77d83a0637..b297bb8f25f5a 100644 --- a/recipes/sdl_image/all/conanfile.py +++ b/recipes/sdl_image/all/conanfile.py @@ -1,10 +1,11 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.51.3" class SDLImageConan(ConanFile): @@ -60,7 +61,7 @@ class SDLImageConan(ConanFile): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.os != "Macos": + if not is_apple_os(self): del self.options.imageio def configure(self): @@ -83,7 +84,7 @@ def requirements(self): if self.options.with_libtiff: self.requires("libtiff/4.4.0") if self.options.with_libjpeg: - self.requires("libjpeg/9d") + self.requires("libjpeg/9e") if self.options.with_libpng: self.requires("libpng/1.6.37") if self.options.with_libwebp: @@ -167,3 +168,17 @@ def package_info(self): self.cpp_info.components["_sdl_image"].requires.append("libpng::libpng") if self.options.with_libwebp: self.cpp_info.components["_sdl_image"].requires.append("libwebp::libwebp") + if self.options.get_safe("imageio") and not self.options.shared: + self.cpp_info.components["_sdl_image"].frameworks = [ + "CoreFoundation", + "CoreGraphics", + "Foundation", + "ImageIO", + ] + if self.settings.os == "Macos": + self.cpp_info.components["_sdl_image"].frameworks.append("ApplicationServices") + else: + self.cpp_info.components["_sdl_image"].frameworks.extend([ + "MobileCoreServices", + "UIKit", + ]) From 5e0941cde56e7591ed28da6c62232669f2c59816 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 11 Oct 2022 19:05:21 -0500 Subject: [PATCH 359/561] (#13363) wayland: Fix missing libffi and cross-compilation Now that Conan 1.52.0 is available, this can be done properly. --- recipes/wayland/all/conanfile.py | 35 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index 1c3a49c45bdba..80563c5f2cd9c 100644 --- a/recipes/wayland/all/conanfile.py +++ b/recipes/wayland/all/conanfile.py @@ -3,12 +3,13 @@ from conan.tools.build import cross_building from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class WaylandConan(ConanFile): @@ -36,11 +37,12 @@ class WaylandConan(ConanFile): "enable_dtd_validation": True, } - generators = "PkgConfigDeps" - def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: del self.settings.compiler.libcxx except Exception: @@ -52,18 +54,18 @@ def configure(self): def requirements(self): if self.options.enable_libraries: - self.requires("libffi/3.4.2") + self.requires("libffi/3.4.3") if self.options.enable_dtd_validation: self.requires("libxml2/2.9.14") - self.requires("expat/2.4.8") + self.requires("expat/2.4.9") def validate(self): if self.info.settings.os != "Linux": raise ConanInvalidConfiguration("Wayland can be built on Linux only") def build_requirements(self): - self.tool_requires("meson/0.63.2") - self.tool_requires("pkgconf/1.7.4") + self.tool_requires("meson/0.63.3") + self.tool_requires("pkgconf/1.9.3") if cross_building(self): self.tool_requires(self.ref) @@ -74,12 +76,21 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + pkg_config_deps = PkgConfigDeps(self) + if cross_building(self): + pkg_config_deps.build_context_activated = ["wayland"] + elif self.dependencies["expat"].is_build_context: # wayland is being built as build_require + # If wayland is the build_require, all its dependencies are treated as build_requires + pkg_config_deps.build_context_activated = [dep.ref.name for _, dep in self.dependencies.host.items()] + pkg_config_deps.generate() tc = MesonToolchain(self) tc.project_options["libdir"] = "lib" tc.project_options["datadir"] = "res" tc.project_options["libraries"] = self.options.enable_libraries tc.project_options["dtd_validation"] = self.options.enable_dtd_validation tc.project_options["documentation"] = False + if cross_building(self): + tc.project_options["build.pkg_config_path"] = self.generators_folder if Version(self.version) >= "1.18.91": tc.project_options["scanner"] = True tc.generate() @@ -94,14 +105,6 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('tests')", "#subdir('tests')") - if cross_building(self): - replace_in_file(self, f"{self.source_folder}/src/meson.build", - "scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())", - "# scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())") - replace_in_file(self, f"{self.source_folder}/src/meson.build", - "wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner'))", - "wayland_scanner_for_build = find_program('wayland-scanner')") - def build(self): self._patch_sources() meson = Meson(self) From 757999d0aa1c13d64e3d321c3ae071ba32f55e29 Mon Sep 17 00:00:00 2001 From: Eric Riff <57375845+ericriff@users.noreply.github.com> Date: Tue, 11 Oct 2022 21:24:28 -0300 Subject: [PATCH 360/561] (#13367) Opengv: Try to re enable gcc/shared builds --- recipes/opengv/all/conanfile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/opengv/all/conanfile.py b/recipes/opengv/all/conanfile.py index 9e3ce9fa9da3d..34bbe096cc7bc 100644 --- a/recipes/opengv/all/conanfile.py +++ b/recipes/opengv/all/conanfile.py @@ -48,9 +48,7 @@ def validate(self): # Disable windows builds since they error out. if self.settings.os == "Windows": raise ConanInvalidConfiguration("Windows builds are not supported by this recipe.") - #FIXME disable this one CCI has more RAM available - if self.settings.compiler == "gcc" and self.options.shared: - raise ConanInvalidConfiguration("Shared builds not supported with gcc since CCI errors out due to excessive memory usage.") + #FIXME this passes locally but fails on CCI with a clang internal error if self.settings.compiler == "clang" and self.settings.compiler.version == 12: raise ConanInvalidConfiguration("Clang 12 builds fail on Conan CI.") From 4d974c48852657b8482abe449943f960ddc14186 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Wed, 12 Oct 2022 03:44:30 +0300 Subject: [PATCH 361/561] (#13372) qt5: fix dependencies for static build on Apple platforms * add missing AccessibilitySupport dependency for macOS platform plugins * add missing Apple system frameworks that are required for static build --- recipes/qt/5.x.x/conanfile.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 00b46f073d571..4365011d42477 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -1083,7 +1083,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_plugin("QAndroidIntegrationPlugin", "qtforandroid", "platforms", android_reqs) self.cpp_info.components["qtQAndroidIntegrationPlugin"].system_libs = ["android", "jnigraphics"] elif self.settings.os == "Macos": - cocoa_reqs = ["Core", "Gui", "ClipboardSupport", "ThemeSupport", "FontDatabaseSupport", "GraphicsSupport"] + cocoa_reqs = ["Core", "Gui", "ClipboardSupport", "ThemeSupport", "FontDatabaseSupport", "GraphicsSupport", "AccessibilitySupport"] if self.options.get_safe("with_vulkan"): cocoa_reqs.append("VulkanSupport") if self.options.widgets: @@ -1095,7 +1095,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): elif self.settings.os in ["iOS", "tvOS"]: _create_plugin("QIOSIntegrationPlugin", "qios", "platforms", ["ClipboardSupport", "FontDatabaseSupport", "GraphicsSupport"]) self.cpp_info.components["QIOSIntegrationPlugin"].frameworks = ["AudioToolbox", "Foundation", "Metal", - "QuartzCore", "UIKit"] + "MobileCoreServices", "OpenGLES", "QuartzCore", "UIKit"] elif self.settings.os == "watchOS": _create_plugin("QMinimalIntegrationPlugin", "qminimal", "platforms", ["EventDispatcherSupport", "FontDatabaseSupport"]) elif self.settings.os == "Emscripten": @@ -1140,6 +1140,8 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components["qtWidgets"].build_modules["cmake_find_package_multi"].append(self._cmake_qt5_private_file("Widgets")) if self.options.gui and self.options.widgets and not self.settings.os in ["iOS", "watchOS", "tvOS"]: _create_module("PrintSupport", ["Gui", "Widgets"]) + if self.settings.os == "Macos" and not self.options.shared: + self.cpp_info.components["PrintSupport"].system_libs.append("cups") if self.options.get_safe("opengl", "no") != "no" and self.options.gui: _create_module("OpenGL", ["Gui"]) if self.options.widgets and self.options.get_safe("opengl", "no") != "no": @@ -1391,14 +1393,17 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.get_safe("qtwinextras"): self.cpp_info.components["qtWinExtras"].system_libs.append("dwmapi") # qtwinextras requires "DwmGetColorizationColor" which is in "dwmapi.lib" library - + if is_apple_os(self): + self.cpp_info.components["qtCore"].frameworks.append("CoreServices" if self.settings.os == "Macos" else "MobileCoreServices") + self.cpp_info.components["qtNetwork"].frameworks.append("SystemConfiguration") + if self.options.with_gssapi: + self.cpp_info.components["qtNetwork"].frameworks.append("GSS") + if not self.options.openssl: # with SecureTransport + self.cpp_info.components["qtNetwork"].frameworks.append("Security") if self.settings.os == "Macos": self.cpp_info.components["qtCore"].frameworks.append("IOKit") # qtcore requires "_IORegistryEntryCreateCFProperty", "_IOServiceGetMatchingService" and much more which are in "IOKit" framework self.cpp_info.components["qtCore"].frameworks.append("Cocoa") # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework self.cpp_info.components["qtCore"].frameworks.append("Security") # qtcore requires "_SecRequirementCreateWithString" and more, which are in "Security" framework - self.cpp_info.components["qtNetwork"].frameworks.append("SystemConfiguration") - if self.options.with_gssapi: - self.cpp_info.components["qtNetwork"].frameworks.append("GSS") self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin","archdatadir","bin")) build_modules.append(self._cmake_core_extras_file) From eb56cb7d74e935f7bbc275f8289dd14ea05dded8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 12 Oct 2022 03:04:48 +0200 Subject: [PATCH 362/561] (#13379) Bump plf_stack/1.63 * add plf_stack/1.62 * add 1.63 instead of 1.62 --- recipes/plf_stack/all/conandata.yml | 3 +++ recipes/plf_stack/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/plf_stack/all/conandata.yml b/recipes/plf_stack/all/conandata.yml index bedf75de4ef79..3ddc3129ad01e 100644 --- a/recipes/plf_stack/all/conandata.yml +++ b/recipes/plf_stack/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.63": + url: "https://github.com/mattreecebentley/plf_stack/archive/96184693b8dcc904b07cf4e97e848be9fe8b2c4e.tar.gz" + sha256: "8789f97d217e9f97ffefc700f14b87f960aaaad25d0c9a27e6d8577d7a52a939" "1.60": url: "https://github.com/mattreecebentley/plf_stack/archive/775456d32a0919bc2a6df9ab9b2b5e96b76c6c24.tar.gz" sha256: "ac09619bef8aa1c946ccf8bebbf623187627b7bb31ad85c60384ad450f0dd0fa" diff --git a/recipes/plf_stack/config.yml b/recipes/plf_stack/config.yml index 1b1859918eba2..268e17f1a2972 100644 --- a/recipes/plf_stack/config.yml +++ b/recipes/plf_stack/config.yml @@ -1,3 +1,5 @@ versions: + "1.63": + folder: all "1.60": folder: all From 1583d537301f54399d7cc515c1ffd3ba1e9757c3 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 12 Oct 2022 03:24:57 +0200 Subject: [PATCH 363/561] (#13383) draco: modernize more for conan v2 --- recipes/draco/all/conanfile.py | 22 ++++++++++--------- recipes/draco/all/test_package/conanfile.py | 11 +++++----- .../draco/all/test_v1_package/conanfile.py | 1 - 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/recipes/draco/all/conanfile.py b/recipes/draco/all/conanfile.py index c2b1fa42ec123..fcf412b2c827e 100644 --- a/recipes/draco/all/conanfile.py +++ b/recipes/draco/all/conanfile.py @@ -1,11 +1,11 @@ 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 apply_conandata_patches, copy, get, rm, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class DracoConan(ConanFile): @@ -43,27 +43,29 @@ class DracoConan(ConanFile): short_paths = True def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass if not self.options.enable_mesh_compression: del self.options.enable_standard_edgebreaker del self.options.enable_predictive_edgebreaker - if self.options.shared: - del self.options.fPIC - - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, 11) def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) diff --git a/recipes/draco/all/test_package/conanfile.py b/recipes/draco/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/draco/all/test_package/conanfile.py +++ b/recipes/draco/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/draco/all/test_v1_package/conanfile.py b/recipes/draco/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/draco/all/test_v1_package/conanfile.py +++ b/recipes/draco/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os From feb510e2e1a940be3ddec2cb94c8760459a0c385 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Wed, 12 Oct 2022 05:04:29 +0300 Subject: [PATCH 364/561] (#13388) libx264: fix building for Apple non-macOS * fix building for Apple non-macOS * fix linter v2 errors --- recipes/libx264/all/conanfile.py | 35 +++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/recipes/libx264/all/conanfile.py b/recipes/libx264/all/conanfile.py index 7105e44bd9989..fcaf19f43215d 100644 --- a/recipes/libx264/all/conanfile.py +++ b/recipes/libx264/all/conanfile.py @@ -1,9 +1,12 @@ -from conan.tools.files import rename -from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.files import get, rename, rmdir +from conans import tools, AutoToolsBuildEnvironment import contextlib import os -required_conan_version = ">=1.38.0" +required_conan_version = ">=1.51.3" class LibX264Conan(ConanFile): @@ -63,8 +66,8 @@ def build_requirements(self): self.build_requires("msys2/cci.latest") 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], + destination=self._source_subfolder, strip_root=True) @contextlib.contextmanager def _build_context(self): @@ -98,16 +101,28 @@ def _configure_autotools(self): args.append("--enable-pic") if self.settings.build_type == "Debug": args.append("--enable-debug") - if self.settings.os == "Macos" and self.settings.arch == "armv8": + if is_apple_os(self) and self.settings.arch == "armv8": # bitstream-a.S:29:18: error: unknown token in expression extra_asflags.append("-arch arm64") extra_ldflags.append("-arch arm64") args.append("--host=aarch64-apple-darwin") + if self.settings.os != "Macos": + deployment_target_flag = tools.apple_deployment_target_flag( + self.settings.os, + self.settings.get_safe("os.version"), + self.settings.get_safe("os.sdk"), + self.settings.get_safe("os.subsystem"), + self.settings.get_safe("arch") + ) + platform_flags = ["-isysroot", tools.XCRun(self.settings).sdk_path, deployment_target_flag] + extra_asflags.extend(platform_flags) + extra_cflags.extend(platform_flags) + extra_ldflags.extend(platform_flags) if self._with_nasm: # FIXME: get using user_build_info self._override_env["AS"] = os.path.join(self.dependencies.build["nasm"].package_folder, "bin", "nasm{}".format(".exe" if tools.os_info.is_windows else "")).replace("\\", "/") - if tools.cross_building(self): + if cross_building(self): if self.settings.os == "Android": # the as of ndk does not work well for building libx264 self._override_env["AS"] = os.environ["CC"] @@ -127,8 +142,8 @@ def _configure_autotools(self): extra_cflags.append("-FS") build_canonical_name = None host_canonical_name = None - if self._is_msvc: - # autotools does not know about the msvc canonical name(s) + if self._is_msvc or self.settings.os in ["iOS", "watchOS", "tvOS"]: + # autotools does not know about the msvc and Apple embedded OS canonical name(s) build_canonical_name = False host_canonical_name = False if extra_asflags: @@ -154,7 +169,7 @@ def package(self): with self._build_context(): autotools = self._configure_autotools() autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self._is_msvc: ext = ".dll.lib" if self.options.shared else ".lib" rename(self, os.path.join(self.package_folder, "lib", "libx264{}".format(ext)), From 558efd79d2053f515cc3691180e640c443342d3a Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 12 Oct 2022 04:28:35 +0200 Subject: [PATCH 365/561] (#13390) gainput: conan v2 support --- recipes/gainput/all/CMakeLists.txt | 7 --- recipes/gainput/all/conandata.yml | 3 - recipes/gainput/all/conanfile.py | 61 +++++++++---------- .../gainput/all/patches/0001-fix-cmake.patch | 26 +++++++- .../0002-fix-cmake-win32-condition.patch | 13 ---- .../gainput/all/test_package/CMakeLists.txt | 7 +-- recipes/gainput/all/test_package/conanfile.py | 19 ++++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../gainput/all/test_v1_package/conanfile.py | 17 ++++++ 9 files changed, 96 insertions(+), 67 deletions(-) delete mode 100644 recipes/gainput/all/CMakeLists.txt delete mode 100644 recipes/gainput/all/patches/0002-fix-cmake-win32-condition.patch create mode 100644 recipes/gainput/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gainput/all/test_v1_package/conanfile.py diff --git a/recipes/gainput/all/CMakeLists.txt b/recipes/gainput/all/CMakeLists.txt deleted file mode 100644 index f62f6ae283c5f..0000000000000 --- a/recipes/gainput/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/gainput/all/conandata.yml b/recipes/gainput/all/conandata.yml index c40ee685fc480..663b4be81a94a 100644 --- a/recipes/gainput/all/conandata.yml +++ b/recipes/gainput/all/conandata.yml @@ -5,6 +5,3 @@ sources: patches: "1.0.0": - patch_file: "patches/0001-fix-cmake.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-cmake-win32-condition.patch" - base_path: "source_subfolder" diff --git a/recipes/gainput/all/conanfile.py b/recipes/gainput/all/conanfile.py index 804c784b2f7e3..609bad1913a9e 100644 --- a/recipes/gainput/all/conanfile.py +++ b/recipes/gainput/all/conanfile.py @@ -1,7 +1,10 @@ -from conans import ConanFile, CMake, tools -import functools +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class GainputConan(ConanFile): @@ -22,16 +25,8 @@ class GainputConan(ConanFile): "fPIC": True, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,35 +34,39 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.settings.os in ["Linux", "FreeBSD"]: self.requires("xorg/system") 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], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["GAINPUT_SAMPLES"] = False - cmake.definitions["GAINPUT_TESTS"] = False - cmake.definitions["GAINPUT_BUILD_SHARED"] = self.options.shared - cmake.definitions["GAINPUT_BUILD_STATIC"] = not self.options.shared - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GAINPUT_SAMPLES"] = False + tc.variables["GAINPUT_TESTS"] = False + tc.variables["GAINPUT_BUILD_SHARED"] = self.options.shared + tc.variables["GAINPUT_BUILD_STATIC"] = not self.options.shared + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): @@ -78,8 +77,8 @@ def package_info(self): self.cpp_info.system_libs.extend(["xinput", "ws2_32"]) elif self.settings.os == "Android": self.cpp_info.system_libs.extend(["native_app_glue", "log", "android"]) - elif tools.is_apple_os(self.settings.os): - self.cpp_info.frameworks.extend(["Foundation", "IOKit", "GameController"]) + elif is_apple_os(self): + self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "Foundation", "IOKit", "GameController"]) if self.settings.os == "iOS": self.cpp_info.frameworks.extend(["UIKit", "CoreMotion"]) else: diff --git a/recipes/gainput/all/patches/0001-fix-cmake.patch b/recipes/gainput/all/patches/0001-fix-cmake.patch index 82814407ce388..39ae12ecf689f 100644 --- a/recipes/gainput/all/patches/0001-fix-cmake.patch +++ b/recipes/gainput/all/patches/0001-fix-cmake.patch @@ -1,6 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,5 @@ + cmake_minimum_required(VERSION 2.8) ++project(gainput) + set(GAINPUT_MAJOR_VERSION 1) + set(GAINPUT_MINOR_VERSION 0) + set(GAINPUT_PATCH_VERSION 0) +@@ -9,7 +10,7 @@ option(GAINPUT_TESTS "Build Tests for Gainput" ON) + option(GAINPUT_BUILD_SHARED "BUILD_SHARED" ON) + option(GAINPUT_BUILD_STATIC "BUILD_STATIC" ON) + +-if(!WIN32) ++if(NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra") + else() + set(XINPUT "Xinput9_1_0") --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -4,7 +4,6 @@ message(STATUS "GAINPUT version ${GAINPUT_VERSION}") +@@ -1,10 +1,8 @@ +-project(gainput) + message(STATUS "GAINPUT version ${GAINPUT_VERSION}") + set(CMAKE_MACOSX_RPATH 1) if(CMAKE_COMPILER_IS_GNUCXX) @@ -8,7 +28,7 @@ endif() include_directories (include/) -@@ -36,12 +35,11 @@ if (GAINPUT_BUILD_STATIC) +@@ -36,12 +34,11 @@ if (GAINPUT_BUILD_STATIC) set(install_libs ${install_libs} gainputstatic) endif (GAINPUT_BUILD_STATIC) @@ -22,7 +42,7 @@ target_link_libraries(gainput native_app_glue log android) elseif(APPLE) find_library(FOUNDATION Foundation) -@@ -58,6 +56,7 @@ elseif(APPLE) +@@ -58,6 +55,7 @@ elseif(APPLE) target_link_libraries(gainput ${APPKIT}) endif() endif() diff --git a/recipes/gainput/all/patches/0002-fix-cmake-win32-condition.patch b/recipes/gainput/all/patches/0002-fix-cmake-win32-condition.patch deleted file mode 100644 index 67267ea9d14b1..0000000000000 --- a/recipes/gainput/all/patches/0002-fix-cmake-win32-condition.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a443b66..2c920eb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,7 +9,7 @@ option(GAINPUT_TESTS "Build Tests for Gainput" ON) - option(GAINPUT_BUILD_SHARED "BUILD_SHARED" ON) - option(GAINPUT_BUILD_STATIC "BUILD_STATIC" ON) - --if(!WIN32) -+if(NOT WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra") - else() - set(XINPUT "Xinput9_1_0") diff --git a/recipes/gainput/all/test_package/CMakeLists.txt b/recipes/gainput/all/test_package/CMakeLists.txt index 9c4193fe391cf..f0a0ee2f13583 100644 --- a/recipes/gainput/all/test_package/CMakeLists.txt +++ b/recipes/gainput/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(gainput REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} gainput::gainput) +target_link_libraries(${PROJECT_NAME} PRIVATE gainput::gainput) diff --git a/recipes/gainput/all/test_package/conanfile.py b/recipes/gainput/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/gainput/all/test_package/conanfile.py +++ b/recipes/gainput/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gainput/all/test_v1_package/CMakeLists.txt b/recipes/gainput/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e3274020b8ef --- /dev/null +++ b/recipes/gainput/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gainput REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gainput::gainput) diff --git a/recipes/gainput/all/test_v1_package/conanfile.py b/recipes/gainput/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gainput/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 1d887da0eb97c08ead9c271e96eae883b7bb6243 Mon Sep 17 00:00:00 2001 From: Kilian <12865310+KingKili@users.noreply.github.com> Date: Wed, 12 Oct 2022 05:04:35 +0200 Subject: [PATCH 366/561] (#13393) wasmedge: add version 0.11.1 * wasmedge: add version 0.11.1 * Update name of wasmedge * Fix v2 linter warning --- recipes/wasmedge/all/conandata.yml | 21 ++++++++++++++++++++ recipes/wasmedge/all/conanfile.py | 32 ++++++++++++++++++++---------- recipes/wasmedge/config.yml | 2 ++ 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/recipes/wasmedge/all/conandata.yml b/recipes/wasmedge/all/conandata.yml index f6bd77980ef83..c52eb9e32d6e4 100644 --- a/recipes/wasmedge/all/conandata.yml +++ b/recipes/wasmedge/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "0.11.1": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-windows.zip" + sha256: "c86f6384555a0484a5dd81faba5636bba78f5e3d6eaf627d880e34843f9e24bf" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-manylinux2014_x86_64.tar.gz" + sha256: "76ce4ea0eb86adfa52c73f6c6b44383626d94990e0923cae8b1e6f060ef2bf5b" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-manylinux2014_aarch64.tar.gz" + sha256: "cb9ea32932360463991cfda80e09879b2cf6c69737f12f3f2b371cd0af4e9ce8" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" "0.10.0": Windows: "x86_64": diff --git a/recipes/wasmedge/all/conanfile.py b/recipes/wasmedge/all/conanfile.py index ba7cc0b861a7c..7b10dc7e45e9a 100644 --- a/recipes/wasmedge/all/conanfile.py +++ b/recipes/wasmedge/all/conanfile.py @@ -1,5 +1,7 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import get, download +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.33.0" @@ -41,10 +43,10 @@ def package_id(self): self.info.settings.compiler = self._compiler_alias def source(self): - tools.get(**self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][0], + get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][0], destination=self._source_subfolder, strip_root=True) - tools.download(filename="LICENSE", - **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][1]) + download(self, filename="LICENSE", + **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][1]) # noqa: E128 def package(self): self.copy("*.h", src=os.path.join(self._source_subfolder, "include"), dst="include", keep_path=True) @@ -52,18 +54,26 @@ def package(self): srclibdir = os.path.join(self._source_subfolder, "lib64" if self.settings.os == "Linux" else "lib") srcbindir = os.path.join(self._source_subfolder, "bin") - - self.copy("wasmedge_c.lib", src=srclibdir, dst="lib", keep_path=False) - self.copy("wasmedge_c.dll", src=srcbindir, dst="bin", keep_path=False) - self.copy("libwasmedge_c.so*", src=srclibdir, dst="lib", keep_path=False) - self.copy("libwasmedge_c.dylib", src=srclibdir, dst="lib", keep_path=False) + if Version(self.version) >= "0.11.1": + self.copy("wasmedge.lib", src=srclibdir, dst="lib", keep_path=False) + self.copy("wasmedge.dll", src=srcbindir, dst="bin", keep_path=False) + self.copy("libwasmedge.so*", src=srclibdir, dst="lib", keep_path=False) + self.copy("libwasmedge.dylib", src=srclibdir, dst="lib", keep_path=False) + else: + self.copy("wasmedge_c.lib", src=srclibdir, dst="lib", keep_path=False) + self.copy("wasmedge_c.dll", src=srcbindir, dst="bin", keep_path=False) + self.copy("libwasmedge_c.so*", src=srclibdir, dst="lib", keep_path=False) + self.copy("libwasmedge_c.dylib", src=srclibdir, dst="lib", keep_path=False) self.copy("wasmedge*", src=srcbindir, dst="bin", keep_path=False) self.copy("LICENSE", dst="licenses", keep_path=False) def package_info(self): - self.cpp_info.libs = ["wasmedge_c"] + if Version(self.version) >= "0.11.1": + self.cpp_info.libs = ["wasmedge"] + else: + self.cpp_info.libs = ["wasmedge_c"] bindir = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH environment variable: {}".format(bindir)) diff --git a/recipes/wasmedge/config.yml b/recipes/wasmedge/config.yml index a319c82cd717d..43f005e3eef73 100644 --- a/recipes/wasmedge/config.yml +++ b/recipes/wasmedge/config.yml @@ -1,4 +1,6 @@ versions: + "0.11.1": + folder: "all" "0.10.0": folder: "all" "0.9.1": From 0d1f263da2ec84f4793c5dada305c0ed91687357 Mon Sep 17 00:00:00 2001 From: Kilian <12865310+KingKili@users.noreply.github.com> Date: Wed, 12 Oct 2022 05:24:14 +0200 Subject: [PATCH 367/561] (#13396) vulkan-headers: add version 1.3.224.1 --- recipes/vulkan-headers/all/conandata.yml | 3 +++ recipes/vulkan-headers/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/vulkan-headers/all/conandata.yml b/recipes/vulkan-headers/all/conandata.yml index 04e004b954592..95d82ebb73d00 100644 --- a/recipes/vulkan-headers/all/conandata.yml +++ b/recipes/vulkan-headers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.224.1": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.224.1.tar.gz" + sha256: "628bd5943c0d007c192769480e789801a088f892445c80cb336fc9b6d236c5ef" "1.3.224.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.224.0.tar.gz" sha256: "ccdfa47cea58a080957481fb6c35908d005d04cc5dd1778150dc0c651ccea077" diff --git a/recipes/vulkan-headers/config.yml b/recipes/vulkan-headers/config.yml index 7892e6ee422a2..4dd6e6190dc8f 100644 --- a/recipes/vulkan-headers/config.yml +++ b/recipes/vulkan-headers/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.224.1": + folder: all "1.3.224.0": folder: all "1.3.221": From e124e9d259077f07487d3ab753cba5b2ee24a4d3 Mon Sep 17 00:00:00 2001 From: Kilian <12865310+KingKili@users.noreply.github.com> Date: Wed, 12 Oct 2022 05:45:39 +0200 Subject: [PATCH 368/561] (#13409) wayland-protocols: add 1.27 --- recipes/wayland-protocols/all/conandata.yml | 3 +++ recipes/wayland-protocols/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/wayland-protocols/all/conandata.yml b/recipes/wayland-protocols/all/conandata.yml index 35f717f4c3d19..57bce2d3e5da6 100644 --- a/recipes/wayland-protocols/all/conandata.yml +++ b/recipes/wayland-protocols/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.27": + url: "https://github.com/wayland-project/wayland-protocols/archive/1.27.tar.gz" + sha256: "6dd6ee86478adf4347f3b8b4f3da62dbe9e44912c9cef21cf99abfe692313df4" "1.26": url: "https://github.com/wayland-project/wayland-protocols/archive/1.26.tar.gz" sha256: "fe56386f436a84e97c3b6a61b76306f205a64425900f247ad0048174b9c32d4d" diff --git a/recipes/wayland-protocols/config.yml b/recipes/wayland-protocols/config.yml index 1bb41705cf242..5a8aa4a9bbac3 100644 --- a/recipes/wayland-protocols/config.yml +++ b/recipes/wayland-protocols/config.yml @@ -1,4 +1,6 @@ versions: + "1.27": + folder: all "1.26": folder: all "1.25": From 3e29edf1eee2bd41f2b8feb59354036c2788f672 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 13 Oct 2022 23:25:41 +0900 Subject: [PATCH 369/561] (#12971) xsimd: add version 9.0.1 * xsimd: add version 9.0.1 * revise test_package.cpp * fix arm compilation error * fix constructor call * fix test_package for xsimd 9.x.x * add condition for neon * workaround for MacOSX M1 compilation error * fix typo * remove special condition for neon * change call of constructor * use float on neon/neon64 * remove skip pylint --- recipes/xsimd/all/conandata.yml | 18 +++--------------- recipes/xsimd/all/conanfile.py | 6 ++++++ .../xsimd/all/test_package/test_package.cpp | 17 +++++++++++++---- recipes/xsimd/all/test_v1_package/conanfile.py | 1 - recipes/xsimd/config.yml | 12 ++---------- 5 files changed, 24 insertions(+), 30 deletions(-) diff --git a/recipes/xsimd/all/conandata.yml b/recipes/xsimd/all/conandata.yml index e6b7679e66c7c..d7e0a0f8a775f 100644 --- a/recipes/xsimd/all/conandata.yml +++ b/recipes/xsimd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.0.1": + url: "https://github.com/xtensor-stack/xsimd/archive/9.0.1.tar.gz" + sha256: "b1bb5f92167fd3a4f25749db0be7e61ed37e0a5d943490f3accdcd2cd2918cc0" "8.1.0": url: "https://github.com/xtensor-stack/xsimd/archive/8.1.0.tar.gz" sha256: "d52551360d37709675237d2a0418e28f70995b5b7cdad7c674626bcfbbf48328" @@ -14,18 +17,3 @@ sources: "7.4.10": url: "https://github.com/xtensor-stack/xsimd/archive/7.4.10.tar.gz" sha256: "df00f476dea0c52ffebad60924e3f0db2a016b80d508f8d5a2399a74c0d134cd" - "7.4.9": - url: "https://github.com/xtensor-stack/xsimd/archive/7.4.9.tar.gz" - sha256: "f6601ffb002864ec0dc6013efd9f7a72d756418857c2d893be0644a2f041874e" - "7.4.8": - sha256: 318676faae48d2082440df9f161a95303a3f29c3f0b03ff32ca24063b12f5699 - url: https://github.com/xtensor-stack/xsimd/archive/7.4.8.tar.gz - "7.4.6": - sha256: 0e70411a9fff76ac17c6ef642465d4f0d1f29d3f3a70e5ece4cfc522bd4fcd0b - url: https://github.com/xtensor-stack/xsimd/archive/7.4.6.tar.gz - "7.4.5": - sha256: 854c0506fb6f0c90a98b30a9407af1d06870338d6c7e63d21ddbbf8b7ce1dd42 - url: https://github.com/xtensor-stack/xsimd/archive/7.4.5.tar.gz - "7.4.4": - sha256: a60d49f638b68117ae5aea73cf2d5586f4afda4de2435962de4310b11214de6a - url: https://github.com/xtensor-stack/xsimd/archive/7.4.4.tar.gz diff --git a/recipes/xsimd/all/conanfile.py b/recipes/xsimd/all/conanfile.py index 611414ef7b0c5..704d20b0065db 100644 --- a/recipes/xsimd/all/conanfile.py +++ b/recipes/xsimd/all/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.files import copy, get, save from conan.tools.layout import basic_layout from conan.tools.scm import Version +from conan.tools.apple import is_apple_os import os import textwrap @@ -83,6 +84,11 @@ def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.resdirs = [] + ## TODO: workaround for arm compilation issue : https://github.com/xtensor-stack/xsimd/issues/735 + if Version(self.version) >= "9.0.0" and \ + is_apple_os(self) and self.settings.arch in ["armv8", "armv8_32", "armv8.3"]: + self.cpp_info.cxxflags.extend(["-flax-vector-conversions", "-fsigned-char",]) + # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/xsimd/all/test_package/test_package.cpp b/recipes/xsimd/all/test_package/test_package.cpp index 6db0f1a3e4d36..be0d55dea1818 100644 --- a/recipes/xsimd/all/test_package/test_package.cpp +++ b/recipes/xsimd/all/test_package/test_package.cpp @@ -3,13 +3,22 @@ namespace xs = xsimd; +#if XSIMD_VERSION_MAJOR >= 9 && (XSIMD_WITH_NEON64 || XSIMD_WITH_NEON) +using number_type = float; +#else +using number_type = double; +#endif + int main(int argc, char *argv[]) { #if XSIMD_VERSION_MAJOR < 8 - xs::batch a(1.5, 2.5, 3.5, 4.5); - xs::batch b(2.5, 3.5, 4.5, 5.5); + xs::batch a(1.5, 2.5, 3.5, 4.5); + xs::batch b(2.5, 3.5, 4.5, 5.5); +#elif XSIMD_VERSION_MAJOR < 9 + xs::batch a({1.5, 2.5, 3.5, 4.5}); + xs::batch b({2.5, 3.5, 4.5, 5.5}); #else - xs::batch a({1.5, 2.5, 3.5, 4.5}); - xs::batch b({2.5, 3.5, 4.5, 5.5}); + xs::batch a{1.5, 2.5, 3.5, 4.5}; + xs::batch b{2.5, 3.5, 4.5, 5.5}; #endif auto mean = (a + b) / 2; diff --git a/recipes/xsimd/all/test_v1_package/conanfile.py b/recipes/xsimd/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/xsimd/all/test_v1_package/conanfile.py +++ b/recipes/xsimd/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/xsimd/config.yml b/recipes/xsimd/config.yml index 15049fc2e83d7..b2648c7641ed6 100644 --- a/recipes/xsimd/config.yml +++ b/recipes/xsimd/config.yml @@ -1,4 +1,6 @@ versions: + "9.0.1": + folder: all "8.1.0": folder: all "8.0.5": @@ -9,13 +11,3 @@ versions: folder: all "7.4.10": folder: all - "7.4.9": - folder: all - "7.4.8": - folder: all - "7.4.6": - folder: all - "7.4.5": - folder: all - "7.4.4": - folder: all From 2681fc535854fa9479cb566757d6e4822b48bafc Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 13 Oct 2022 23:45:57 +0900 Subject: [PATCH 370/561] (#13333) aws-c-http: add version 0.6.22 and support conan v2 * aws-c-http: add version 0.6.21 and support conan v2 * downgrade conan version Co-authored-by: Uilian Ries * add version 0.6.22 Co-authored-by: Uilian Ries --- recipes/aws-c-http/all/CMakeLists.txt | 7 -- recipes/aws-c-http/all/conandata.yml | 3 + recipes/aws-c-http/all/conanfile.py | 69 ++++++++++--------- .../all/test_package/CMakeLists.txt | 5 +- .../aws-c-http/all/test_package/conanfile.py | 21 ++++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/aws-c-http/config.yml | 2 + 8 files changed, 88 insertions(+), 48 deletions(-) delete mode 100644 recipes/aws-c-http/all/CMakeLists.txt create mode 100644 recipes/aws-c-http/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-http/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-http/all/CMakeLists.txt b/recipes/aws-c-http/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-c-http/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-http/all/conandata.yml b/recipes/aws-c-http/all/conandata.yml index 87f7955d95d07..09a36b1a86c13 100644 --- a/recipes/aws-c-http/all/conandata.yml +++ b/recipes/aws-c-http/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.22": + url: "https://github.com/awslabs/aws-c-http/archive/v0.6.22.tar.gz" + sha256: "a178fd04bd1618469cd21afc5b84cbe436d1f9d9e036fefbd3a8f00356da4d4c" "0.6.13": url: "https://github.com/awslabs/aws-c-http/archive/v0.6.13.tar.gz" sha256: "8c69f8fc58b7073039e598383da3e1fd9b23f392cb992dbe769a7b80f342dbaf" diff --git a/recipes/aws-c-http/all/conanfile.py b/recipes/aws-c-http/all/conanfile.py index 6e56f19ff07d9..71f435659cae7 100644 --- a/recipes/aws-c-http/all/conanfile.py +++ b/recipes/aws-c-http/all/conanfile.py @@ -1,17 +1,17 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -from conans import ConanFile, CMake, tools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.47.0" class AwsCHttp(ConanFile): name = "aws-c-http" description = "C99 implementation of the HTTP/1.1 and HTTP/2 specifications" - topics = ("aws", "amazon", "cloud", "http", "http2", ) + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-http" - license = "Apache-2.0", - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" + topics = ("aws", "amazon", "cloud", "http", "http2", ) settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,48 +22,55 @@ class AwsCHttp(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_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 - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.6.19") - self.requires("aws-c-compression/0.2.14") - self.requires("aws-c-io/0.10.20") + self.requires("aws-c-common/0.8.2") + self.requires("aws-c-compression/0.2.15") + self.requires("aws-c-io/0.13.4") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "lib", "aws-c-http")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-http")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-http") diff --git a/recipes/aws-c-http/all/test_package/CMakeLists.txt b/recipes/aws-c-http/all/test_package/CMakeLists.txt index 7b2b79320df60..94387e3cbcded 100644 --- a/recipes/aws-c-http/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-http/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-http REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-http) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-http) diff --git a/recipes/aws-c-http/all/test_package/conanfile.py b/recipes/aws-c-http/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/aws-c-http/all/test_package/conanfile.py +++ b/recipes/aws-c-http/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b3195e120b0b2 --- /dev/null +++ b/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-http REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-http) diff --git a/recipes/aws-c-http/all/test_v1_package/conanfile.py b/recipes/aws-c-http/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-http/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-http/config.yml b/recipes/aws-c-http/config.yml index ac476c864a916..ab4b9f0488086 100644 --- a/recipes/aws-c-http/config.yml +++ b/recipes/aws-c-http/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.22": + folder: all "0.6.13": folder: all "0.6.10": From 1690229c7c4f9597641dcceb21a695ae184a965f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 13 Oct 2022 17:25:36 +0200 Subject: [PATCH 371/561] (#13381) vk-bootstrap: add 0.6 + modernize more * add vk-bootstrap/0.6 * modernize more --- recipes/vk-bootstrap/all/conandata.yml | 5 ++++ recipes/vk-bootstrap/all/conanfile.py | 24 ++++++++++--------- .../all/patches/0001-fix-cmake-0.6.patch | 13 ++++++++++ .../all/test_package/conanfile.py | 7 +++--- recipes/vk-bootstrap/config.yml | 2 ++ 5 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch diff --git a/recipes/vk-bootstrap/all/conandata.yml b/recipes/vk-bootstrap/all/conandata.yml index 3ba36acbcf006..7b7ae61282844 100644 --- a/recipes/vk-bootstrap/all/conandata.yml +++ b/recipes/vk-bootstrap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6": + url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.6.tar.gz" + sha256: "95dedaa5cedf7a271f051d91b24b3b6c78aa3c5b2bc3cf058554c92748a421b2" "0.5": url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.5.tar.gz" sha256: "7ec1017d71d48595c078a4488140b230fd9cad1059986a18a507f356bf00e89b" @@ -12,6 +15,8 @@ sources: url: "https://github.com/charles-lunarg/vk-bootstrap/archive/v0.2.tar.gz" sha256: "45afc9c2c90309f768786c8014913627e6f1cb4db20449a65b98283b58918483" patches: + "0.6": + - patch_file: "patches/0001-fix-cmake-0.6.patch" "0.5": - patch_file: "patches/0001-fix-cmake-0.5.patch" "0.4": diff --git a/recipes/vk-bootstrap/all/conanfile.py b/recipes/vk-bootstrap/all/conanfile.py index 1ebda5ab43574..c8a66635b258c 100644 --- a/recipes/vk-bootstrap/all/conanfile.py +++ b/recipes/vk-bootstrap/all/conanfile.py @@ -2,13 +2,13 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.microsoft import is_msvc from conan.tools.scm import Version from conans import tools as tools_legacy import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class VkBootstrapConan(ConanFile): @@ -44,8 +44,7 @@ def _compilers_minimum_version(self): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -53,13 +52,19 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("vulkan-headers/1.3.224.0") def validate(self): - if self.info.settings.compiler.cppstd: + if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) def loose_lt_semver(v1, v2): @@ -71,14 +76,11 @@ def loose_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) if minimum_version and loose_lt_semver(str(self.info.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration( - f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) if is_msvc(self) and self.info.options.shared: - raise ConanInvalidConfiguration("vk-boostrap shared not supported with Visual Studio") - - def layout(self): - cmake_layout(self, src_folder="src") + raise ConanInvalidConfiguration(f"{self.ref} shared not supported with Visual Studio") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch new file mode 100644 index 0000000000000..a24ee1446f9e5 --- /dev/null +++ b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1e0181..4d154e0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -83,7 +83,7 @@ install(TARGETS vk-bootstrap vk-bootstrap-compiler-warnings vk-bootstrap-vulkan- + + option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) + +-if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) ++if (VK_BOOTSTRAP_TEST) + + add_subdirectory(ext) + add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/test_package/conanfile.py b/recipes/vk-bootstrap/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/vk-bootstrap/all/test_package/conanfile.py +++ b/recipes/vk-bootstrap/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/vk-bootstrap/config.yml b/recipes/vk-bootstrap/config.yml index 67b99f4d61f63..c35636d87baa5 100644 --- a/recipes/vk-bootstrap/config.yml +++ b/recipes/vk-bootstrap/config.yml @@ -1,4 +1,6 @@ versions: + "0.6": + folder: all "0.5": folder: all "0.4": From 683391e1729c672ba05ed88cfa69647b5216ada5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 13 Oct 2022 18:05:19 +0200 Subject: [PATCH 372/561] (#13382) uriparser: add 0.9.7 + modernize more * add uriparser/0.9.7 * modernize more * fix indentation --- recipes/uriparser/all/conandata.yml | 3 +++ recipes/uriparser/all/conanfile.py | 23 +++++++++---------- .../uriparser/all/test_package/conanfile.py | 11 +++++---- .../all/test_v1_package/conanfile.py | 1 - recipes/uriparser/config.yml | 2 ++ 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/recipes/uriparser/all/conandata.yml b/recipes/uriparser/all/conandata.yml index a62cf79ae8ff0..2e0f68c6098de 100644 --- a/recipes/uriparser/all/conandata.yml +++ b/recipes/uriparser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.7": + url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.7/uriparser-0.9.7.tar.xz" + sha256: "1ddae35cb3cc2c36e8199829d46f1c7f8b222e74a723fdae67ec8561e1ac5a39" "0.9.6": url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.6/uriparser-0.9.6.tar.xz" sha256: "a288a06668528c19e85e38c508335938e1de6fdd4b8f2072401b4533fcebf644" diff --git a/recipes/uriparser/all/conanfile.py b/recipes/uriparser/all/conanfile.py index 9418ef35de4dd..79bc7cd3ce078 100644 --- a/recipes/uriparser/all/conanfile.py +++ b/recipes/uriparser/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, collect_libs, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc, msvc_runtime_flag import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class UriparserConan(ConanFile): @@ -30,8 +30,7 @@ class UriparserConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,15 +38,18 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: - del self.settings.compiler.libcxx + del self.settings.compiler.libcxx except Exception: - pass + pass try: - del self.settings.compiler.cppstd + del self.settings.compiler.cppstd except Exception: - pass + pass def layout(self): cmake_layout(self, src_folder="src") @@ -93,6 +95,3 @@ def package_info(self): self.cpp_info.defines.append("URI_NO_ANSI") if not self.options.with_wchar: self.cpp_info.defines.append("URI_NO_UNICODE") - - # TODO: to remove in conan v2 once pkg_config generator removed - self.cpp_info.names["pkg_config"] = "liburiparser" diff --git a/recipes/uriparser/all/test_package/conanfile.py b/recipes/uriparser/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/uriparser/all/test_package/conanfile.py +++ b/recipes/uriparser/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/uriparser/all/test_v1_package/conanfile.py b/recipes/uriparser/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/uriparser/all/test_v1_package/conanfile.py +++ b/recipes/uriparser/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/uriparser/config.yml b/recipes/uriparser/config.yml index 8b143dad4006e..983b5479ac5be 100644 --- a/recipes/uriparser/config.yml +++ b/recipes/uriparser/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.7": + folder: "all" "0.9.6": folder: "all" "0.9.5": From 9af05beb0371148a7e17b07389b49a9f30af811a Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Thu, 13 Oct 2022 19:45:28 +0300 Subject: [PATCH 373/561] (#13387) ffmpeg: add version 4.4.3 * ffmpeg: add version 4.4.3 * fix linking with static library on iOS/tvOS/watchOS * fix linter v2 errors * fix building avdevice for iOS/tvOS/watchOS when with_audiotoolbox is on * use conan.tools.apple.is_apple_os Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- recipes/ffmpeg/all/conandata.yml | 3 ++ recipes/ffmpeg/all/conanfile.py | 51 ++++++++++++++++++-------------- recipes/ffmpeg/config.yml | 2 ++ 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/recipes/ffmpeg/all/conandata.yml b/recipes/ffmpeg/all/conandata.yml index 6aef92a63b2d6..13f029f130a72 100644 --- a/recipes/ffmpeg/all/conandata.yml +++ b/recipes/ffmpeg/all/conandata.yml @@ -2,6 +2,9 @@ sources: "5.0": url: "https://ffmpeg.org/releases/ffmpeg-5.0.tar.bz2" sha256: "c0130b8db2c763430fd1c6905288d61bc44ee0548ad5fcd2dfd650b88432bed9" + "4.4.3": + url: "https://ffmpeg.org/releases/ffmpeg-4.4.3.tar.bz2" + sha256: "33b8c2dbcd530fe1db5710415345609b4ca227bd0da1e3a9332dbb0f11fd273a" "4.4": url: "https://ffmpeg.org/releases/ffmpeg-4.4.tar.bz2" sha256: "42093549751b582cf0f338a21a3664f52e0a9fbe0d238d3c992005e493607d0e" diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index 6dcb1c09c0f02..399ae594e3c1c 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -1,13 +1,17 @@ -from conan.tools.files import rename -from conans import ConanFile, AutoToolsBuildEnvironment, 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 cross_building +from conan.tools.files import get, rename, rmdir +from conan.tools.scm import Version +from conans import AutoToolsBuildEnvironment, tools import os import contextlib import glob import shutil import re -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.51.3" class FFMpegConan(ConanFile): @@ -236,7 +240,7 @@ def config_options(self): del self.options.with_coreimage del self.options.with_audiotoolbox del self.options.with_videotoolbox - if not tools.is_apple_os(self.settings.os): + if not is_apple_os(self): del self.options.with_avfoundation if not self._version_supports_vulkan(): del self.options.with_vulkan @@ -298,7 +302,7 @@ def requirements(self): self.requires("vulkan-loader/1.3.221") def validate(self): - if self.options.with_ssl == "securetransport" and not tools.is_apple_os(self.settings.os): + if self.options.with_ssl == "securetransport" and not is_apple_os(self): raise ConanInvalidConfiguration( "securetransport is only available on Apple") @@ -320,14 +324,13 @@ def build_requirements(self): self.build_requires("msys2/cci.latest") 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], + destination=self._source_subfolder, strip_root=True) @property def _target_arch(self): target_arch, _, _ = tools.get_gnu_triplet( - "Macos" if tools.is_apple_os( - self.settings.os) else str(self.settings.os), + "Macos" if is_apple_os(self) else str(self.settings.os), str(self.settings.arch), str(self.settings.compiler) if self.settings.os == "Windows" else None, ).split("-") @@ -339,8 +342,7 @@ def _target_os(self): return "win32" else: _, _, target_os = tools.get_gnu_triplet( - "Macos" if tools.is_apple_os( - self.settings.os) else str(self.settings.os), + "Macos" if is_apple_os(self) else str(self.settings.os), str(self.settings.arch), str(self.settings.compiler) if self.settings.os == "Windows" else None, ).split("-") @@ -389,7 +391,7 @@ def opt_append_disable_if_set(args, what, v): args = [ "--pkg-config-flags=--static", "--disable-doc", - opt_enable_disable("cross-compile", tools.cross_building(self)), + opt_enable_disable("cross-compile", cross_building(self)), opt_enable_disable("asm", self.options.with_asm), # Libraries opt_enable_disable("shared", self.options.shared), @@ -517,7 +519,7 @@ def opt_append_disable_if_set(args, what, v): if self._version_supports_vulkan(): args.append(opt_enable_disable( "vulkan", self.options.get_safe("with_vulkan"))) - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): # relocatable shared libs args.append("--install-name-dir=@rpath") args.append("--arch={}".format(self._target_arch)) @@ -539,7 +541,7 @@ def opt_append_disable_if_set(args, what, v): args.append("--cxx={}".format(tools.get_env("CXX"))) extra_cflags = [] extra_ldflags = [] - if tools.is_apple_os(self.settings.os) and self.settings.os.version: + if is_apple_os(self) and self.settings.os.version: extra_cflags.append(tools.apple_deployment_target_flag( self.settings.os, self.settings.os.version)) extra_ldflags.append(tools.apple_deployment_target_flag( @@ -550,13 +552,16 @@ def opt_append_disable_if_set(args, what, v): if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) <= "12": # Visual Studio 2013 (and earlier) doesn't support "inline" keyword for C (only for C++) self._autotools.defines.append("inline=__inline") - if tools.cross_building(self): + if cross_building(self): if self._target_os == "emscripten": args.append("--target-os=none") else: args.append("--target-os={}".format(self._target_os)) - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): + if self.options.with_audiotoolbox: + args.append("--disable-outdev=audiotoolbox") + xcrun = tools.XCRun(self.settings) apple_arch = tools.to_apple_arch(str(self.settings.arch)) extra_cflags.extend( @@ -600,8 +605,8 @@ def package(self): autotools = self._configure_autotools() autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) if self._is_msvc: if self.options.shared: @@ -774,7 +779,7 @@ def package_info(self): self.cpp_info.components["avutil"].system_libs = [ "user32", "bcrypt"] self.cpp_info.components["avformat"].system_libs = ["secur32"] - elif tools.is_apple_os(self.settings.os): + elif is_apple_os(self): if self.options.avdevice: self.cpp_info.components["avdevice"].frameworks = [ "CoreFoundation", "Foundation", "CoreGraphics"] @@ -783,7 +788,7 @@ def package_info(self): "CoreGraphics"] if self.options.avcodec: self.cpp_info.components["avcodec"].frameworks = [ - "CoreVideo", "CoreMedia"] + "CoreFoundation", "CoreVideo", "CoreMedia"] if self.settings.os == "Macos": if self.options.avdevice: self.cpp_info.components["avdevice"].frameworks.append( @@ -886,7 +891,7 @@ def package_info(self): if self.options.get_safe("with_coreimage"): self.cpp_info.components["avfilter"].frameworks.append( "CoreImage") - if tools.Version(self.version) >= "5.0" and tools.is_apple_os(self.settings.os): + if Version(self.version) >= "5.0" and is_apple_os(self): self.cpp_info.components["avfilter"].frameworks.append("Metal") if self.options.get_safe("with_vaapi"): @@ -901,4 +906,4 @@ def package_info(self): "vulkan-loader::vulkan-loader") def _version_supports_vulkan(self): - return tools.Version(self.version) >= "4.3.0" + return Version(self.version) >= "4.3.0" diff --git a/recipes/ffmpeg/config.yml b/recipes/ffmpeg/config.yml index a1b74e4cc0f84..bd4009285d1b8 100644 --- a/recipes/ffmpeg/config.yml +++ b/recipes/ffmpeg/config.yml @@ -1,6 +1,8 @@ versions: "5.0": folder: "all" + "4.4.3": + folder: "all" "4.4": folder: "all" "4.3.2": From 41e6e9d79c424987b2505ad4fcff3352cdf76287 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 13 Oct 2022 10:24:53 -0700 Subject: [PATCH 374/561] (#13404) docs: note how to run docker images with sysreq mode * docs: note how to run docker images with sysreq mode I stole this from a comment by uilianries that I can not find again * Update docs/developing_recipes_locally.md Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- docs/developing_recipes_locally.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/developing_recipes_locally.md b/docs/developing_recipes_locally.md index 0ee32ef6f4a23..57d98ecb3a216 100644 --- a/docs/developing_recipes_locally.md +++ b/docs/developing_recipes_locally.md @@ -159,6 +159,12 @@ docker run -v/Users/barbarian/.conan:/home/conan/.conan conanio/gcc8 bash -c "co > **Note**: If you are running on Mac M1, the follow Docker argument is required: `--platform=linux/amd64` +If you are working with packages that have system dependencies that are managed by Conan + +```sh +docker run -e CONAN_SYSREQUIRES_MODE=enabled conanio/gcc11-ubuntu16.04 conan install fmt/9.0.0@ -if build --build missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=yes +``` + ## Using Conan 2.0 Everything you need to know about the methods, commands line, outputs can be found in the From b0d3b0628dc6404e6bbde9588394000f6a382bb5 Mon Sep 17 00:00:00 2001 From: Kilian <12865310+KingKili@users.noreply.github.com> Date: Thu, 13 Oct 2022 19:45:37 +0200 Subject: [PATCH 375/561] (#13410) cmake: add 3.24.2 --- recipes/cmake/3.x.x/conandata.yml | 3 +++ recipes/cmake/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cmake/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml index ef081670dc1d0..80dda4779fb80 100644 --- a/recipes/cmake/3.x.x/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -20,3 +20,6 @@ sources: "3.24.1": url: "https://github.com/Kitware/CMake/archive/v3.24.1.tar.gz" sha256: "fe7fd2eb0ecee1c0ad829bca77ac7b516fdb7a982e862fc47ef8df54e714dbc3" + "3.24.2": + url: "https://github.com/Kitware/CMake/archive/v3.24.2.tar.gz" + sha256: "f4f0772b0a89f93be6d1153d5640b80cc8d64a3bda95cca1799673bc4d03f3b1" diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index f755a4bf578b0..f2af6f8eea1c4 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -13,3 +13,5 @@ versions: folder: "3.x.x" "3.24.1": folder: "3.x.x" + "3.24.2": + folder: "3.x.x" From 78c7b409f5ef5e339db738df77b4540e57dcf13a Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 13 Oct 2022 20:05:29 +0200 Subject: [PATCH 376/561] (#13416) libmysqlclient: remove wrong options * remove options which cannot be disabled * Update conanfile.py * Update conanfile.py --- recipes/libmysqlclient/all/conanfile.py | 30 ++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/recipes/libmysqlclient/all/conanfile.py b/recipes/libmysqlclient/all/conanfile.py index 5173229199ba3..9c52226b333eb 100644 --- a/recipes/libmysqlclient/all/conanfile.py +++ b/recipes/libmysqlclient/all/conanfile.py @@ -24,14 +24,14 @@ class LibMysqlClientCConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "with_ssl": [True, False], - "with_zlib": [True, False], + "with_ssl": [True, False, "deprecated"], + "with_zlib": [True, False, "deprecated"], } default_options = { "shared": False, "fPIC": True, - "with_ssl": True, - "with_zlib": True, + "with_ssl": "deprecated", + "with_zlib": "deprecated", } short_paths = True @@ -69,12 +69,18 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - + if self.options.with_ssl != "deprecated": + self.output.warn("with_ssl option is deprecated, do not use anymore. SSL cannot be disabled") + if self.options.with_zlib != "deprecated": + self.output.warn("with_zlib option is deprecated, do not use anymore. Zlib cannot be disabled") + + def package_id(self): + del self.info.options.with_ssl + del self.info.options.with_zlib + def requirements(self): - if self.options.with_ssl: - self.requires("openssl/1.1.1q") - if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("openssl/1.1.1q") + self.requires("zlib/1.2.12") if self._with_zstd: self.requires("zstd/1.5.2") if self._with_lz4: @@ -223,11 +229,9 @@ def _configure_cmake(self): if is_msvc(self): cmake.definitions["WINDOWS_RUNTIME_MD"] = "MD" in msvc_runtime_flag(self) - if self.options.with_ssl: - cmake.definitions["WITH_SSL"] = self.deps_cpp_info["openssl"].rootpath + cmake.definitions["WITH_SSL"] = self.deps_cpp_info["openssl"].rootpath - if self.options.with_zlib: - cmake.definitions["WITH_ZLIB"] = "system" + cmake.definitions["WITH_ZLIB"] = "system" cmake.configure(source_dir=self._source_subfolder) return cmake From 4e0e81454eb8285eef7b5b4be5dd809f364f2d88 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Thu, 13 Oct 2022 13:25:35 -0500 Subject: [PATCH 377/561] (#13394) glib: Add missing pkg_config_names for PkgConfigDeps generator --- recipes/glib/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index f7f42cfa72f8a..01328eec27f9e 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -279,9 +279,11 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.components["glib-2.0"].system_libs += ["ws2_32", "ole32", "shell32", "user32", "advapi32"] self.cpp_info.components["gio-2.0"].system_libs.extend(["iphlpapi", "dnsapi", "shlwapi"]) + self.cpp_info.components["gio-windows-2.0"].set_property("pkg_config_name", "gio-windows-2.0") self.cpp_info.components["gio-windows-2.0"].requires = ["gobject-2.0", "gmodule-no-export-2.0", "gio-2.0"] self.cpp_info.components["gio-windows-2.0"].includedirs = [os.path.join("include", "gio-win32-2.0")] else: + self.cpp_info.components["gio-unix-2.0"].set_property("pkg_config_name", "gio-unix-2.0") self.cpp_info.components["gio-unix-2.0"].requires += ["gobject-2.0", "gio-2.0"] self.cpp_info.components["gio-unix-2.0"].includedirs = [os.path.join("include", "gio-unix-2.0")] From 78adc3d1032ff1646180da9f4ee8ca0b7abc5e77 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Thu, 13 Oct 2022 20:06:22 +0100 Subject: [PATCH 378/561] (#13419) [sqlite3] Refactor handling of math library --- recipes/sqlite3/all/CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/recipes/sqlite3/all/CMakeLists.txt b/recipes/sqlite3/all/CMakeLists.txt index e82939d256595..4c38e3ebd459a 100644 --- a/recipes/sqlite3/all/CMakeLists.txt +++ b/recipes/sqlite3/all/CMakeLists.txt @@ -150,9 +150,14 @@ if(NOT OMIT_LOAD_EXTENSION) endif() if(ENABLE_FTS5 OR ENABLE_MATH_FUNCTIONS) - find_library(MATH_LIBRARY m) - if(MATH_LIBRARY) - target_link_libraries(${PROJECT_NAME} PRIVATE ${MATH_LIBRARY}) + include(CheckLibraryExists) + # Check if math functionality is on the separate 'libm' library, + # otherwise assume that it is already part of the C runtime. + # The `m` library is part of the compiler toolchain, this checks + # if the compiler can successfully link against the library. + check_library_exists(m log "" HAVE_MATH_LIBRARY) + if(HAVE_MATH_LIBRARY) + target_link_libraries(${PROJECT_NAME} PRIVATE m) endif() endif() From aa071a6831720be0f8dfdf0ea4fc19e0ceb0914c Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 13 Oct 2022 21:44:45 +0200 Subject: [PATCH 379/561] (#13420) aravis: modernize also, bump requirements --- recipes/aravis/all/conanfile.py | 59 +++++++++++++++------------------ 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/recipes/aravis/all/conanfile.py b/recipes/aravis/all/conanfile.py index 9c2e5d3df66d8..3e8bc058b7f3a 100644 --- a/recipes/aravis/all/conanfile.py +++ b/recipes/aravis/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, Meson, RunEnvironment, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rename, chdir, rm, rmdir +from conan.tools.microsoft import is_msvc +from conans import Meson, RunEnvironment, tools import os import glob +required_conan_version = ">=1.52.0" class AravisConan(ConanFile): name = "aravis" @@ -46,10 +50,6 @@ def _build_subfolder(self): def _aravis_api_version(self): return ".".join(self.version.split(".")[0:2]) - @property - def _is_msvc(self): - return self.settings.compiler == "Visual Studio" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -62,7 +62,7 @@ def configure(self): self.options["glib"].shared = True def validate(self): - if self._is_msvc and self.settings.get_safe("compiler.runtime", "").startswith("MT"): + if is_msvc(self) and self.settings.get_safe("compiler.runtime", "").startswith("MT"): raise ConanInvalidConfiguration("Static MT/MTd runtime is not supported on Windows due to GLib issues") if not self.options["glib"].shared and self.options.shared: raise ConanInvalidConfiguration("Shared Aravis cannot link to static GLib") @@ -70,31 +70,26 @@ def validate(self): raise ConanInvalidConfiguration("macOS builds are disabled until conan-io/conan#7324 gets merged to fix macOS SIP issue #8443") def build_requirements(self): - self.build_requires("meson/0.60.2") - self.build_requires("pkgconf/1.7.4") + self.build_requires("meson/0.63.3") + self.build_requires("pkgconf/1.9.3") if self.options.introspection: - self.build_requires("gobject-introspection/1.70.0") + self.build_requires("gobject-introspection/1.72.0") def requirements(self): - self.requires("glib/2.70.1") - self.requires("libxml2/2.9.12") - self.requires("zlib/1.2.11") + self.requires("glib/2.74.0") + self.requires("libxml2/2.9.14") + self.requires("zlib/1.2.12") if self.options.usb: - self.requires("libusb/1.0.24") + self.requires("libusb/1.0.26") if self.options.gst_plugin: self.requires("gstreamer/1.19.2") self.requires("gst-plugins-base/1.19.2") def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def _configure_meson(self): if self._meson: @@ -115,19 +110,19 @@ def _configure_meson(self): return self._meson def build(self): - self._patch_sources() + apply_conandata_patches(self) with tools.environment_append(RunEnvironment(self).vars): meson = self._configure_meson() meson.build() def _fix_library_names(self, path): # https://github.com/mesonbuild/meson/issues/1412 - if not self.options.shared and self._is_msvc: - with tools.chdir(path): + if not self.options.shared and is_msvc(self): + with chdir(self, path): for filename_old in glob.glob("*.a"): filename_new = filename_old[3:-2] + ".lib" - self.output.info("rename %s into %s" % (filename_old, filename_new)) - tools.rename(filename_old, filename_new) + self.output.info(f"rename {filename_old} into {filename_new}") + rename(self, filename_old, filename_new) def package(self): self.copy("COPYING", src=self._source_subfolder, dst="licenses", keep_path=False) @@ -138,10 +133,10 @@ def package(self): self._fix_library_names(os.path.join(self.package_folder, "lib")) if self.options.gst_plugin: self._fix_library_names(os.path.join(self.package_folder, "lib", "gstreamer-1.0")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(self.package_folder, "*.pdb") + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", self.package_folder, recursive=True) if not self.options.tools: - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "arv-*") + rm(self, "arv-*", os.path.join(self.package_folder, "bin")) def package_id(self): self.info.requires["glib"].full_package_mode() @@ -150,7 +145,7 @@ def package_id(self): self.info.requires["gst-plugins-base"].full_package_mode() def package_info(self): - aravis_name = "aravis-{}".format(self._aravis_api_version) + aravis_name = f"aravis-{self._aravis_api_version}" self.cpp_info.names["pkg_config"] = aravis_name self.cpp_info.includedirs = [os.path.join("include", aravis_name)] self.cpp_info.libs = [aravis_name] @@ -161,9 +156,9 @@ def package_info(self): if self.options.tools: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) if self.options.gst_plugin and self.options.shared: gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") - self.output.info("Appending GST_PLUGIN_PATH env var: {}".format(gst_plugin_path)) + self.output.info(f"Appending GST_PLUGIN_PATH env var: {gst_plugin_path}") self.env_info.GST_PLUGIN_PATH.append(gst_plugin_path) From e610d70490073c7cd3e83aff144c57b2d6d93c03 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 14 Oct 2022 05:04:58 +0900 Subject: [PATCH 380/561] (#13426) unordered_dense: add version 2.0.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/unordered_dense/all/conandata.yml | 3 +++ recipes/unordered_dense/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml index f0988e9e8da6d..b8e60c2de9188 100644 --- a/recipes/unordered_dense/all/conandata.yml +++ b/recipes/unordered_dense/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "https://github.com/martinus/unordered_dense/archive/v2.0.0.tar.gz" + sha256: "e838bdcf380a1aeb6f1fee17fbdf59d7a14b6b9fb6dfca32981e4cbd60739d20" "1.4.0": url: "https://github.com/martinus/unordered_dense/archive/v1.4.0.tar.gz" sha256: "36b6bfe2fe2633f9d9c537b9b808b4be6b77ff51c66d370d855f477517bc3bc9" diff --git a/recipes/unordered_dense/config.yml b/recipes/unordered_dense/config.yml index bdcc47cf69afb..331e1c02017bb 100644 --- a/recipes/unordered_dense/config.yml +++ b/recipes/unordered_dense/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.0": + folder: all "1.4.0": folder: all "1.3.3": From 5f7d0270860c60210996339d629341f0cbaac280 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 13 Oct 2022 22:25:13 +0200 Subject: [PATCH 381/561] (#13438) fontconfig: bump expat fixes https://github.com/conan-io/conan-center-index/issues/13436 --- recipes/fontconfig/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/fontconfig/all/conanfile.py b/recipes/fontconfig/all/conanfile.py index e2f97bddbdf34..ee0c2bc6866cb 100644 --- a/recipes/fontconfig/all/conanfile.py +++ b/recipes/fontconfig/all/conanfile.py @@ -56,7 +56,7 @@ def configure(self): def requirements(self): self.requires("freetype/2.12.1") - self.requires("expat/2.4.8") + self.requires("expat/2.4.9") if self.settings.os == "Linux": self.requires("libuuid/1.0.3") From 17d5fb9e32ff73bafb339286a6874468aa033c47 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 13 Oct 2022 23:05:39 +0200 Subject: [PATCH 382/561] (#13401) c-blosc: conan v2 support * conan v2 support * bump lz4 * do not install system libs * another way to not install system libs --- recipes/c-blosc/all/CMakeLists.txt | 7 - recipes/c-blosc/all/conandata.yml | 7 - recipes/c-blosc/all/conanfile.py | 135 +++++++++--------- .../patches/cmake-dependencies-1.18.1-.patch | 9 +- .../patches/cmake-dependencies-1.19.0.patch | 9 +- .../patches/cmake-dependencies-1.20.0+.patch | 9 +- .../patches/cmake-dependencies-1.21.1+.patch | 12 +- .../c-blosc/all/test_package/CMakeLists.txt | 7 +- recipes/c-blosc/all/test_package/conanfile.py | 20 ++- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../c-blosc/all/test_v1_package/conanfile.py | 18 +++ 11 files changed, 130 insertions(+), 113 deletions(-) delete mode 100644 recipes/c-blosc/all/CMakeLists.txt create mode 100644 recipes/c-blosc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/c-blosc/all/test_v1_package/conanfile.py diff --git a/recipes/c-blosc/all/CMakeLists.txt b/recipes/c-blosc/all/CMakeLists.txt deleted file mode 100644 index 541886c829c5a..0000000000000 --- a/recipes/c-blosc/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/c-blosc/all/conandata.yml b/recipes/c-blosc/all/conandata.yml index ce6bd3efcd60b..dfd824d8023f0 100644 --- a/recipes/c-blosc/all/conandata.yml +++ b/recipes/c-blosc/all/conandata.yml @@ -23,22 +23,15 @@ sources: patches: "1.21.1": - patch_file: "patches/cmake-dependencies-1.21.1+.patch" - base_path: "source_subfolder" "1.21.0": - patch_file: "patches/cmake-dependencies-1.20.0+.patch" - base_path: "source_subfolder" "1.20.1": - patch_file: "patches/cmake-dependencies-1.20.0+.patch" - base_path: "source_subfolder" "1.20.0": - patch_file: "patches/cmake-dependencies-1.20.0+.patch" - base_path: "source_subfolder" "1.19.0": - patch_file: "patches/cmake-dependencies-1.19.0.patch" - base_path: "source_subfolder" "1.18.1": - patch_file: "patches/cmake-dependencies-1.18.1-.patch" - base_path: "source_subfolder" "1.17.1": - patch_file: "patches/cmake-dependencies-1.18.1-.patch" - base_path: "source_subfolder" diff --git a/recipes/c-blosc/all/conanfile.py b/recipes/c-blosc/all/conanfile.py index 6d4729341decd..88c3ac390c7a0 100644 --- a/recipes/c-blosc/all/conanfile.py +++ b/recipes/c-blosc/all/conanfile.py @@ -1,9 +1,11 @@ -from conan import ConanFile, tools -from conan.tools.files import apply_conandata_patches -from conans import CMake +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.52.0" class CbloscConan(ConanFile): @@ -34,25 +36,8 @@ class CbloscConan(ConanFile): "with_zstd": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -62,13 +47,25 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_lz4: - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.4") if self.options.with_snappy: self.requires("snappy/1.1.9") if self.options.with_zlib: @@ -77,58 +74,60 @@ def requirements(self): self.requires("zstd/1.5.2") def source(self): - tools.files.get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BLOSC_INSTALL"] = True + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_TESTS"] = False + if Version(self.version) >= "1.20.0": + tc.variables["BUILD_FUZZERS"] = False + tc.variables["BUILD_BENCHMARKS"] = False + simd_intrinsics = self.options.get_safe("simd_intrinsics", False) + tc.variables["DEACTIVATE_SSE2"] = simd_intrinsics not in ["sse2", "avx2"] + tc.variables["DEACTIVATE_AVX2"] = simd_intrinsics != "avx2" + tc.variables["DEACTIVATE_LZ4"] = not self.options.with_lz4 + tc.variables["DEACTIVATE_SNAPPY"] = not self.options.with_snappy + tc.variables["DEACTIVATE_ZLIB"] = not self.options.with_zlib + tc.variables["DEACTIVATE_ZSTD"] = not self.options.with_zstd + tc.variables["DEACTIVATE_SYMBOLS_CHECK"] = True + tc.variables["PREFER_EXTERNAL_LZ4"] = True + if Version(self.version) < "1.19.0": + tc.variables["PREFER_EXTERNAL_SNAPPY"] = True + tc.variables["PREFER_EXTERNAL_ZLIB"] = True + tc.variables["PREFER_EXTERNAL_ZSTD"] = True + tc.variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() - def build(self): - apply_conandata_patches(self) - tools.files.rmdir(self, os.path.join(self._source_subfolder, "cmake")) - cmake = self._configure_cmake() - cmake.build() + deps = CMakeDeps(self) + deps.generate() + def _patch_sources(self): + apply_conandata_patches(self) + rmdir(self, os.path.join(self.source_folder, "cmake")) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BLOSC_INSTALL"] = True - self._cmake.definitions["BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["BUILD_SHARED"] = self.options.shared - self._cmake.definitions["BUILD_TESTS"] = False - if tools.scm.Version(self.version) >= "1.20.0": - self._cmake.definitions["BUILD_FUZZERS"] = False - self._cmake.definitions["BUILD_BENCHMARKS"] = False - simd_intrinsics = self.options.get_safe("simd_intrinsics", False) - self._cmake.definitions["DEACTIVATE_SSE2"] = simd_intrinsics not in ["sse2", "avx2"] - self._cmake.definitions["DEACTIVATE_AVX2"] = simd_intrinsics != "avx2" - self._cmake.definitions["DEACTIVATE_LZ4"] = not self.options.with_lz4 - self._cmake.definitions["DEACTIVATE_SNAPPY"] = not self.options.with_snappy - self._cmake.definitions["DEACTIVATE_ZLIB"] = not self.options.with_zlib - self._cmake.definitions["DEACTIVATE_ZSTD"] = not self.options.with_zstd - self._cmake.definitions["DEACTIVATE_SYMBOLS_CHECK"] = True - self._cmake.definitions["PREFER_EXTERNAL_LZ4"] = True - if tools.scm.Version(self.version) < "1.19.0": - self._cmake.definitions["PREFER_EXTERNAL_SNAPPY"] = True - self._cmake.definitions["PREFER_EXTERNAL_ZLIB"] = True - self._cmake.definitions["PREFER_EXTERNAL_ZSTD"] = True - # Generate a relocatable shared lib on Macos - self._cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): licenses = ["BLOSC.txt", "BITSHUFFLE.txt", "FASTLZ.txt"] for license_file in licenses: - self.copy(license_file, dst="licenses", src=os.path.join(self._source_subfolder, "LICENSES")) - cmake = self._configure_cmake() + copy(self, license_file, src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - tools.files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "blosc") - prefix = "lib" if self._is_msvc and not self.options.shared else "" - self.cpp_info.libs = ["{}blosc".format(prefix)] + prefix = "lib" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}blosc"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") - - # TODO: to remove in conan v2 once pkg_config generator removed - self.cpp_info.names["pkg_config"] = "blosc" diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.18.1-.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.18.1-.patch index 04f2ab0166de3..d4a2354fd9ed0 100644 --- a/recipes/c-blosc/all/patches/cmake-dependencies-1.18.1-.patch +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.18.1-.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -122,12 +122,11 @@ option(PREFER_EXTERNAL_ZLIB +@@ -122,12 +122,12 @@ option(PREFER_EXTERNAL_ZLIB option(PREFER_EXTERNAL_ZSTD "Find and use external Zstd library instead of included sources." OFF) @@ -10,6 +10,7 @@ if(NOT DEACTIVATE_LZ4) if(PREFER_EXTERNAL_LZ4) - find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) + set(LZ4_FOUND TRUE) else() message(STATUS "Using LZ4 internal sources.") @@ -27,7 +28,7 @@ if (NOT DEACTIVATE_ZSTD) if (PREFER_EXTERNAL_ZSTD) - find_package(Zstd) -+ find_package(zstd) ++ find_package(zstd REQUIRED CONFIG) else () message(STATUS "Using ZSTD internal sources.") endif (PREFER_EXTERNAL_ZSTD) @@ -38,7 +39,7 @@ if(NOT DEACTIVATE_LZ4) if(LZ4_FOUND) - set(LIBS ${LIBS} ${LZ4_LIBRARY}) -+ set(LIBS ${LIBS} "CONAN_PKG::lz4") ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) else(LZ4_FOUND) file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) set(SOURCES ${SOURCES} ${LZ4_FILES}) @@ -65,7 +66,7 @@ if (NOT DEACTIVATE_ZSTD) if (ZSTD_FOUND) - set(LIBS ${LIBS} ${ZSTD_LIBRARY}) -+ set(LIBS ${LIBS} "zstd::zstd") ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) else (ZSTD_FOUND) file(GLOB ZSTD_FILES ${ZSTD_LOCAL_DIR}/common/*.c diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.19.0.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.19.0.patch index 5ef7800ef0bef..3f5a9b46096f3 100644 --- a/recipes/c-blosc/all/patches/cmake-dependencies-1.19.0.patch +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.19.0.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -117,12 +117,11 @@ option(PREFER_EXTERNAL_ZLIB +@@ -117,12 +117,12 @@ option(PREFER_EXTERNAL_ZLIB option(PREFER_EXTERNAL_ZSTD "Find and use external Zstd library instead of included sources." OFF) @@ -10,6 +10,7 @@ if(NOT DEACTIVATE_LZ4) if(PREFER_EXTERNAL_LZ4) - find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) + set(LZ4_FOUND TRUE) else() message(STATUS "Using LZ4 internal sources.") @@ -27,7 +28,7 @@ if (NOT DEACTIVATE_ZSTD) if (PREFER_EXTERNAL_ZSTD) - find_package(Zstd) -+ find_package(zstd) ++ find_package(zstd REQUIRED CONFIG) else () message(STATUS "Using ZSTD internal sources.") endif (PREFER_EXTERNAL_ZSTD) @@ -38,7 +39,7 @@ if(NOT DEACTIVATE_LZ4) if(LZ4_FOUND) - set(LIBS ${LIBS} ${LZ4_LIBRARY}) -+ set(LIBS ${LIBS} "CONAN_PKG::lz4") ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) else(LZ4_FOUND) file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) set(SOURCES ${SOURCES} ${LZ4_FILES}) @@ -65,7 +66,7 @@ if (NOT DEACTIVATE_ZSTD) if (ZSTD_FOUND) - set(LIBS ${LIBS} ${ZSTD_LIBRARY}) -+ set(LIBS ${LIBS} "zstd::zstd") ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) else (ZSTD_FOUND) file(GLOB ZSTD_FILES ${ZSTD_LOCAL_DIR}/common/*.c diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.20.0+.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.20.0+.patch index c943456b7a005..428ddd7762cfb 100644 --- a/recipes/c-blosc/all/patches/cmake-dependencies-1.20.0+.patch +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.20.0+.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -121,12 +121,11 @@ option(PREFER_EXTERNAL_ZLIB +@@ -121,12 +121,12 @@ option(PREFER_EXTERNAL_ZLIB option(PREFER_EXTERNAL_ZSTD "Find and use external Zstd library instead of included sources." OFF) @@ -10,6 +10,7 @@ if(NOT DEACTIVATE_LZ4) if(PREFER_EXTERNAL_LZ4) - find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) + set(LZ4_FOUND TRUE) else() message(STATUS "Using LZ4 internal sources.") @@ -27,7 +28,7 @@ if (NOT DEACTIVATE_ZSTD) if (PREFER_EXTERNAL_ZSTD) - find_package(Zstd) -+ find_package(zstd) ++ find_package(zstd REQUIRED CONFIG) else () message(STATUS "Using ZSTD internal sources.") endif (PREFER_EXTERNAL_ZSTD) @@ -38,7 +39,7 @@ if(NOT DEACTIVATE_LZ4) if(LZ4_FOUND) - set(LIBS ${LIBS} ${LZ4_LIBRARY}) -+ set(LIBS ${LIBS} "CONAN_PKG::lz4") ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) else(LZ4_FOUND) file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) set(SOURCES ${SOURCES} ${LZ4_FILES}) @@ -65,7 +66,7 @@ if (NOT DEACTIVATE_ZSTD) if (ZSTD_FOUND) - set(LIBS ${LIBS} ${ZSTD_LIBRARY}) -+ set(LIBS ${LIBS} "zstd::zstd") ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) else (ZSTD_FOUND) file(GLOB ZSTD_FILES ${ZSTD_LOCAL_DIR}/common/*.c diff --git a/recipes/c-blosc/all/patches/cmake-dependencies-1.21.1+.patch b/recipes/c-blosc/all/patches/cmake-dependencies-1.21.1+.patch index 704fd3e436b1d..fb62441ddd89b 100644 --- a/recipes/c-blosc/all/patches/cmake-dependencies-1.21.1+.patch +++ b/recipes/c-blosc/all/patches/cmake-dependencies-1.21.1+.patch @@ -1,5 +1,3 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f5eff9e..92b35f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,12 +121,12 @@ option(PREFER_EXTERNAL_ZLIB @@ -12,7 +10,7 @@ index f5eff9e..92b35f2 100644 if(NOT DEACTIVATE_LZ4) if(PREFER_EXTERNAL_LZ4) - find_package(LZ4) -+ ### find_package(LZ4) ++ find_package(lz4 REQUIRED CONFIG) + set(LZ4_FOUND TRUE) else() message(STATUS "Using LZ4 internal sources.") @@ -30,12 +28,10 @@ index f5eff9e..92b35f2 100644 if (NOT DEACTIVATE_ZSTD) if (PREFER_EXTERNAL_ZSTD) - find_package(Zstd) -+ find_package(zstd) ++ find_package(zstd REQUIRED CONFIG) else () message(STATUS "Using ZSTD internal sources.") endif (PREFER_EXTERNAL_ZSTD) -diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt -index 84b72e5..20b94e0 100644 --- a/blosc/CMakeLists.txt +++ b/blosc/CMakeLists.txt @@ -91,7 +91,7 @@ endif(WIN32) @@ -43,7 +39,7 @@ index 84b72e5..20b94e0 100644 if(NOT DEACTIVATE_LZ4) if(LZ4_FOUND) - set(LIBS ${LIBS} ${LZ4_LIBRARY}) -+ set(LIBS ${LIBS} "CONAN_PKG::lz4") ++ set(LIBS ${LIBS} $,LZ4::lz4_shared,LZ4::lz4_static>) else(LZ4_FOUND) file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) set(SOURCES ${SOURCES} ${LZ4_FILES}) @@ -70,7 +66,7 @@ index 84b72e5..20b94e0 100644 if (NOT DEACTIVATE_ZSTD) if (ZSTD_FOUND) - set(LIBS ${LIBS} ${ZSTD_LIBRARY}) -+ set(LIBS ${LIBS} "zstd::zstd") ++ set(LIBS ${LIBS} $,zstd::libzstd_shared,zstd::libzstd_static>) else (ZSTD_FOUND) file(GLOB ZSTD_FILES ${ZSTD_LOCAL_DIR}/common/*.c diff --git a/recipes/c-blosc/all/test_package/CMakeLists.txt b/recipes/c-blosc/all/test_package/CMakeLists.txt index e54e578850692..e73da46b32d37 100644 --- a/recipes/c-blosc/all/test_package/CMakeLists.txt +++ b/recipes/c-blosc/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(c-blosc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} c-blosc::c-blosc) +target_link_libraries(${PROJECT_NAME} PRIVATE c-blosc::c-blosc) diff --git a/recipes/c-blosc/all/test_package/conanfile.py b/recipes/c-blosc/all/test_package/conanfile.py index 72910d4a2a0b5..0a6bc68712d90 100644 --- a/recipes/c-blosc/all/test_package/conanfile.py +++ b/recipes/c-blosc/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conan import ConanFile, tools -from conans import CMake +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.build.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/c-blosc/all/test_v1_package/CMakeLists.txt b/recipes/c-blosc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..178f209fe3a3a --- /dev/null +++ b/recipes/c-blosc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(c-blosc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE c-blosc::c-blosc) diff --git a/recipes/c-blosc/all/test_v1_package/conanfile.py b/recipes/c-blosc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..72910d4a2a0b5 --- /dev/null +++ b/recipes/c-blosc/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conan import ConanFile, tools +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.build.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From eb76524e38febbe79aa2d0ea6113761d9f3a785e Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 14 Oct 2022 02:25:41 +0200 Subject: [PATCH 383/561] (#13439) glib: bump libffi --- recipes/glib/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index 01328eec27f9e..6008731a1870d 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -73,7 +73,7 @@ def configure(self): def requirements(self): self.requires("zlib/1.2.12") - self.requires("libffi/3.4.2") + self.requires("libffi/3.4.3") if self.options.with_pcre: if Version(self.version) >= "2.73.2": self.requires("pcre2/10.40") From 0321acd8eaac1217a660e098954acd1ee8fc1234 Mon Sep 17 00:00:00 2001 From: Kilian <12865310+KingKili@users.noreply.github.com> Date: Fri, 14 Oct 2022 03:24:27 +0200 Subject: [PATCH 384/561] (#13397) volk: add 1.3.224.1 --- recipes/volk/all/conandata.yml | 3 +++ recipes/volk/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/volk/all/conandata.yml b/recipes/volk/all/conandata.yml index 68f400091e69b..4c743f1d08e6c 100644 --- a/recipes/volk/all/conandata.yml +++ b/recipes/volk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.224.1": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.224.1.tar.gz" + sha256: "86505052a83d3085e34d22f8b9969e9961efc24c0c902fefb0b6b43d496f69b4" "1.3.224.0": url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.224.0.tar.gz" sha256: "c9f9dd80dc8f3cd28b1d3d5716bb5e56be966b88aa9c54b18d793df8f60abc36" diff --git a/recipes/volk/config.yml b/recipes/volk/config.yml index dc9db3ea45dcb..b84efda85dd04 100644 --- a/recipes/volk/config.yml +++ b/recipes/volk/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.224.1": + folder: "all" "1.3.224.0": folder: "all" "1.3.216.0": From 525cb30694d6bc1e5de4f2db25330fd0aa754c0c Mon Sep 17 00:00:00 2001 From: Lefteris Kotsonis Date: Fri, 14 Oct 2022 03:44:36 +0200 Subject: [PATCH 385/561] (#13437) shield: add v0.3 --- recipes/shield/all/conandata.yml | 3 +++ recipes/shield/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/shield/all/conandata.yml b/recipes/shield/all/conandata.yml index d5b1899d245a1..7af74449cf6b7 100644 --- a/recipes/shield/all/conandata.yml +++ b/recipes/shield/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.3": + url: "https://github.com/holoplot/shield/archive/0.3.tar.gz" + sha256: "125767e64c84e701f87eb52d7882b5214db375aa19798a5fda23eacce50bd564" "0.2": url: "https://github.com/holoplot/shield/archive/0.2.tar.gz" sha256: "bbc22d122a73467715074a92cbcd31c51adacf03256e5d24e304613f8f72197e" diff --git a/recipes/shield/config.yml b/recipes/shield/config.yml index 1d955fec74cce..3ff0a59a3da7e 100644 --- a/recipes/shield/config.yml +++ b/recipes/shield/config.yml @@ -1,4 +1,6 @@ versions: + "0.3": + folder: all "0.2": folder: all "0.1": From 701efb021357dd99d9e3080d2007deac0ed021d1 Mon Sep 17 00:00:00 2001 From: Mikhail Lappo Date: Fri, 14 Oct 2022 08:48:03 +0200 Subject: [PATCH 386/561] (#13412) Bug/zlib/CVE 2022 37434 * zlib: Fix CVE-2022-37434 Apply CVE fix and a fix of CVE fix https://github.com/madler/zlib/issues/686 https://github.com/openwrt/openwrt/issues/10582 * Fix linter * Add patches description * Fix review --- recipes/zlib/all/conandata.yml | 12 ++++++- recipes/zlib/all/conanfile.py | 2 +- ...etting-a-gzip-header-extra-field-wit.patch | 35 +++++++++++++++++++ ...processing-bug-that-dereferences-NUL.patch | 32 +++++++++++++++++ recipes/zlib/all/test_package/conanfile.py | 4 +-- recipes/zlib/all/test_v1_package/conanfile.py | 1 - 6 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 recipes/zlib/all/patches/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch create mode 100644 recipes/zlib/all/patches/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch diff --git a/recipes/zlib/all/conandata.yml b/recipes/zlib/all/conandata.yml index 8f93ccd1048c6..d63ae3f0966b2 100644 --- a/recipes/zlib/all/conandata.yml +++ b/recipes/zlib/all/conandata.yml @@ -9,8 +9,18 @@ patches: "1.2.12": - patch_file: "patches/0001-fix-cmake.patch" - patch_file: "patches/0002-gzguts-xcode12-compile-fix.patch" + - patch_file: "patches/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch" + patch_description: "CVE-2022-37434: Fix a bug when getting a gzip header extra field with inflate()" + patch_type: "vulnerability" + patch_source: "https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1" + sha256: "15e3c177dc2a034a22e02490a97ba5b1719aae3f8129a06c16d727b661d1650f" + - patch_file: "patches/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch" + patch_description: "CVE-2022-37434: Fix extra field processing bug that dereferences NULL state->head" + patch_type: "vulnerability" + patch_source: "https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d" + sha256: "cdd69eb3251728b1875c8ecae6427b50aa750b4045ef984ab79b6c07b7e6dd3a" "1.2.11": - patch_file: "patches/0001-fix-cmake.patch" - patch_file: "patches/0002-gzguts-xcode12-compile-fix.patch" - # https://github.com/madler/zlib/issues/268 + # https://github.com/madler/zlib/issues/268 - patch_file: "patches/0003-gzguts-fix-widechar-condition.patch" diff --git a/recipes/zlib/all/conanfile.py b/recipes/zlib/all/conanfile.py index ab204f405974e..74c193ad9cba7 100644 --- a/recipes/zlib/all/conanfile.py +++ b/recipes/zlib/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.49.0" class ZlibConan(ConanFile): diff --git a/recipes/zlib/all/patches/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch b/recipes/zlib/all/patches/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch new file mode 100644 index 0000000000000..80eed3e0c3e95 --- /dev/null +++ b/recipes/zlib/all/patches/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch @@ -0,0 +1,35 @@ +From eff308af425b67093bab25f80f1ae950166bece1 Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Sat, 30 Jul 2022 15:51:11 -0700 +Subject: [PATCH] Fix a bug when getting a gzip header extra field with + inflate(). + +If the extra field was larger than the space the user provided with +inflateGetHeader(), and if multiple calls of inflate() delivered +the extra header data, then there could be a buffer overflow of the +provided space. This commit assures that provided space is not +exceeded. +--- + inflate.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/inflate.c b/inflate.c +index 7be8c63..7a72897 100644 +--- a/inflate.c ++++ b/inflate.c +@@ -763,9 +763,10 @@ int flush; + copy = state->length; + if (copy > have) copy = have; + if (copy) { ++ len = state->head->extra_len - state->length; + if (state->head != Z_NULL && +- state->head->extra != Z_NULL) { +- len = state->head->extra_len - state->length; ++ state->head->extra != Z_NULL && ++ len < state->head->extra_max) { + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); +-- +2.25.1 + diff --git a/recipes/zlib/all/patches/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch b/recipes/zlib/all/patches/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch new file mode 100644 index 0000000000000..f34c4019fbf35 --- /dev/null +++ b/recipes/zlib/all/patches/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch @@ -0,0 +1,32 @@ +From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Mon, 8 Aug 2022 10:50:09 -0700 +Subject: [PATCH] Fix extra field processing bug that dereferences NULL + state->head. + +The recent commit to fix a gzip header extra field processing bug +introduced the new bug fixed here. +--- + inflate.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/inflate.c b/inflate.c +index 7a72897..2a3c4fe 100644 +--- a/inflate.c ++++ b/inflate.c +@@ -763,10 +763,10 @@ int flush; + copy = state->length; + if (copy > have) copy = have; + if (copy) { +- len = state->head->extra_len - state->length; + if (state->head != Z_NULL && + state->head->extra != Z_NULL && +- len < state->head->extra_max) { ++ (len = state->head->extra_len - state->length) < ++ state->head->extra_max) { + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); +-- +2.25.1 + diff --git a/recipes/zlib/all/test_package/conanfile.py b/recipes/zlib/all/test_package/conanfile.py index 3a8c6c5442b33..d120a992c06a6 100644 --- a/recipes/zlib/all/test_package/conanfile.py +++ b/recipes/zlib/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -20,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/zlib/all/test_v1_package/conanfile.py b/recipes/zlib/all/test_v1_package/conanfile.py index 3b064a7464a29..0245c9a8028a3 100644 --- a/recipes/zlib/all/test_v1_package/conanfile.py +++ b/recipes/zlib/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os From 2aa6ade0bf6ed154ef7e7249b12c50d79e071018 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 14 Oct 2022 16:05:59 +0900 Subject: [PATCH 387/561] (#13423) luau: add version 0.548 and support conan v2 * luau: add version 0.548 and support conan v2 * apennd requires to VM for CodeGen * apply review --- recipes/luau/all/CMakeLists.txt | 23 ++-- recipes/luau/all/conandata.yml | 20 +--- recipes/luau/all/conanfile.py | 112 ++++++++++-------- recipes/luau/all/test_package/CMakeLists.txt | 7 +- recipes/luau/all/test_package/conanfile.py | 20 +++- .../luau/all/test_v1_package/CMakeLists.txt | 11 ++ recipes/luau/all/test_v1_package/conanfile.py | 17 +++ recipes/luau/config.yml | 2 + 8 files changed, 125 insertions(+), 87 deletions(-) create mode 100644 recipes/luau/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/luau/all/test_v1_package/conanfile.py diff --git a/recipes/luau/all/CMakeLists.txt b/recipes/luau/all/CMakeLists.txt index a9e2b43449f18..b7e55166bfcf9 100644 --- a/recipes/luau/all/CMakeLists.txt +++ b/recipes/luau/all/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required(VERSION 3.8) -project(conan_wrapper CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) +project(conan_wrapper LANGUAGES CXX) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -add_subdirectory(source_subfolder) +add_subdirectory(${LUAU_SRC_DIR}) ## installer include(GNUInstallDirs) @@ -17,7 +14,7 @@ install( LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) -install(DIRECTORY "source_subfolder/Ast/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(DIRECTORY "${LUAU_SRC_DIR}/Ast/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install( TARGETS Luau.Compiler @@ -26,9 +23,9 @@ install( ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) -install(DIRECTORY "source_subfolder/Compiler/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(DIRECTORY "${LUAU_SRC_DIR}/Compiler/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install(FILES - "source_subfolder/Compiler/include/luacode.h" + "${LUAU_SRC_DIR}/Compiler/include/luacode.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install( @@ -37,7 +34,7 @@ install( LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) -install(DIRECTORY "source_subfolder/CodeGen/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(DIRECTORY "${LUAU_SRC_DIR}/CodeGen/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install( @@ -47,7 +44,7 @@ install( ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) -install(DIRECTORY "source_subfolder/Analysis/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(DIRECTORY "${LUAU_SRC_DIR}/Analysis/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install( TARGETS Luau.VM @@ -57,9 +54,9 @@ install( PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install(FILES - "source_subfolder/VM/include/lua.h" - "source_subfolder/VM/include/luaconf.h" - "source_subfolder/VM/include/lualib.h" + "${LUAU_SRC_DIR}/VM/include/lua.h" + "${LUAU_SRC_DIR}/VM/include/luaconf.h" + "${LUAU_SRC_DIR}/VM/include/lualib.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") if(LUAU_BUILD_CLI) diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml index 749c3d6b15c6a..f9425e7422592 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.548": + url: "https://github.com/Roblox/luau/archive/0.548.tar.gz" + sha256: "1ec0aa919955aaa2d88dbef115801681d3b4dbfa7a276435a03d20230918659c" "0.544": url: "https://github.com/Roblox/luau/archive/0.544.tar.gz" sha256: "c1e2d4e04fe6f191192d1570bd83f96531804fc484a0bc0e00b53248a01d7dee" @@ -22,38 +25,27 @@ sources: sha256: "e6de36e83e9c537d92bcc94852ab498e3c15a310fd2c4cc4e21c616d8ae1a84f" patches: + "0.548": + - patch_file: "patches/0.536-0001-fix-cmake.patch" + - patch_file: "patches/0.536-0002-rename-lerp.patch" "0.544": - patch_file: "patches/0.536-0001-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0.536-0002-rename-lerp.patch" - base_path: "source_subfolder" "0.541": - patch_file: "patches/0.536-0001-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0.536-0002-rename-lerp.patch" - base_path: "source_subfolder" "0.540": - patch_file: "patches/0.536-0001-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0.536-0002-rename-lerp.patch" - base_path: "source_subfolder" "0.539": - patch_file: "patches/0.536-0001-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0.536-0002-rename-lerp.patch" - base_path: "source_subfolder" "0.538": - patch_file: "patches/0.536-0001-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0.536-0002-rename-lerp.patch" - base_path: "source_subfolder" "0.537": - patch_file: "patches/0.536-0001-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0.536-0002-rename-lerp.patch" - base_path: "source_subfolder" "0.536": - patch_file: "patches/0.536-0001-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0.536-0002-rename-lerp.patch" - base_path: "source_subfolder" diff --git a/recipes/luau/all/conanfile.py b/recipes/luau/all/conanfile.py index abfe5f337d960..9b6deee220125 100644 --- a/recipes/luau/all/conanfile.py +++ b/recipes/luau/all/conanfile.py @@ -1,13 +1,18 @@ -from conans import ConanFile, CMake, tools -from conan.tools.microsoft import is_msvc +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + import os -import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class LuauConan(ConanFile): name = "luau" - description = "A fast, small, safe, gradually typed embeddable scripting language derived from Lua " + description = "A fast, small, safe, gradually typed embeddable scripting language derived from Lua" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://luau-lang.org/" @@ -25,16 +30,22 @@ class LuauConan(ConanFile): "with_cli": False, "with_web": False, } - generators = "cmake" @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -42,55 +53,56 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - @property - def _compiler_required_cpp17(self): - return { - "Visual Studio": "16", - "gcc": "8", - "clang": "7", - "apple-clang": "12.0", - } + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) - - minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise tools.ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) - else: - self.output.warn("{0} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + check_min_vs(self, 191) + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) if is_msvc(self) and self.options.shared: - raise tools.ConanInvalidConfiguration("{} does not support shared build in MSVC".format(self.name)) + raise ConanInvalidConfiguration(f"{self.ref} does not support shared build in MSVC") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["LUAU_BUILD_CLI"] = self.options.with_cli - cmake.definitions["LUAU_BUILD_TESTS"] = False - cmake.definitions["LUAU_BUILD_WEB"] = self.options.with_web - cmake.definitions["LUAU_WERROR"] = False - cmake.definitions["LUAU_STATIC_CRT"] = False - cmake.configure() - return cmake + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LUAU_BUILD_CLI"] = self.options.with_cli + tc.variables["LUAU_BUILD_TESTS"] = False + tc.variables["LUAU_BUILD_WEB"] = self.options.with_web + tc.variables["LUAU_WERROR"] = False + tc.variables["LUAU_STATIC_CRT"] = False + tc.variables["LUAU_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) >= "0.548" and self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "VM", "include", "luaconf.h"), + "#define LUAI_FUNC __attribute__((visibility(\"hidden\"))) extern", + "#define LUAI_FUNC extern") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="lua_LICENSE*", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "lua_LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): @@ -122,10 +134,12 @@ def package_info(self): self.cpp_info.components["CodeGen"].libs = ["Luau.CodeGen"] self.cpp_info.components["CodeGen"].set_property("cmake_target_name", "Luau::CodeGen") self.cpp_info.components["CodeGen"].requires = ["Ast"] + if Version(self.version) >= "0.548": + self.cpp_info.components["CodeGen"].requires.append("VM") if self.options.with_cli: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) if self.options.with_web: diff --git a/recipes/luau/all/test_package/CMakeLists.txt b/recipes/luau/all/test_package/CMakeLists.txt index 893cbad04577d..6f927f5fc234f 100644 --- a/recipes/luau/all/test_package/CMakeLists.txt +++ b/recipes/luau/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(Luau REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} Luau::Luau) +target_link_libraries(${PROJECT_NAME} PRIVATE Luau::Luau) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/luau/all/test_package/conanfile.py b/recipes/luau/all/test_package/conanfile.py index 81a08015e01f1..a9fbb7f543162 100644 --- a/recipes/luau/all/test_package/conanfile.py +++ b/recipes/luau/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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 +20,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/luau/all/test_v1_package/CMakeLists.txt b/recipes/luau/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..cbcc5c4d88390 --- /dev/null +++ b/recipes/luau/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Luau REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Luau::Luau) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/luau/all/test_v1_package/conanfile.py b/recipes/luau/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..81a08015e01f1 --- /dev/null +++ b/recipes/luau/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml index 9484f9c30d208..449bbf45f2997 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,4 +1,6 @@ versions: + "0.548": + folder: all "0.544": folder: all "0.541": From a955211dbdff9bbb671df7483fee660fc39ddf73 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Fri, 14 Oct 2022 09:45:32 +0200 Subject: [PATCH 388/561] (#13197) Migrate diligent core to conan v2 * migrate diligent-core to conan v2 * export only needed patches * remove cmake_find_package and source folder * hotfix * Update recipes/diligent-core/all/conanfile.py Co-authored-by: Chris Mc * change package layout a bit * add aliases for spirv-tools targets * change glslang include path var * change include directory name; remove one patch * correct vulkan headers include dir = * Update recipes/diligent-core/all/conanfile.py Co-authored-by: Uilian Ries * use tools.copy instead of self.copy * add subfolder for license * use new tools; don't require wayland on other OS rather then linux * Apply suggestions from code review Co-authored-by: Uilian Ries * import apply_conandata_patches Co-authored-by: Chris Mc Co-authored-by: Uilian Ries --- recipes/diligent-core/all/CMakeLists.txt | 10 +- recipes/diligent-core/all/conandata.yml | 2 - recipes/diligent-core/all/conanfile.py | 94 +++++++++---------- .../patches/0002-use_conan_dependencies.patch | 21 ----- .../patches/0003-use_volk_from_conan.patch | 4 +- ...e_conan_dependencies_in_shader_tools.patch | 21 ----- .../0010-API250014-use_volk_from_conan.patch | 4 +- ...50014-use-vulkan-headers-in-archiver.patch | 4 +- 8 files changed, 57 insertions(+), 103 deletions(-) delete mode 100644 recipes/diligent-core/all/patches/0008-API250014-use_conan_dependencies_in_shader_tools.patch diff --git a/recipes/diligent-core/all/CMakeLists.txt b/recipes/diligent-core/all/CMakeLists.txt index 3c184a638f2ac..a00123a14d403 100644 --- a/recipes/diligent-core/all/CMakeLists.txt +++ b/recipes/diligent-core/all/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.2) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(SPIRV-Tools REQUIRED CONFIG) find_package(spirv-cross REQUIRED CONFIG) find_package(glslang REQUIRED CONFIG) @@ -12,9 +9,14 @@ find_package(xxHash REQUIRED CONFIG) add_library(glslang INTERFACE) target_link_libraries(glslang INTERFACE glslang::glslang) -target_include_directories(glslang INTERFACE ${CONAN_INCLUDE_DIRS_GLSLANG}/glslang) +target_include_directories(glslang INTERFACE ${glslang_INCLUDE_DIR}/glslang) add_library(SPIRV ALIAS glslang::SPIRV) add_library(SPIRV-Headers ALIAS SPIRV-Headers::SPIRV-Headers) +add_library(SPIRV-Tools-opt ALIAS spirv-tools::spirv-tools) +add_library(spirv-tools-core ALIAS spirv-tools::spirv-tools) +add_library(SPIRV-Tools-static ALIAS spirv-tools::spirv-tools) + add_subdirectory(source_subfolder) + diff --git a/recipes/diligent-core/all/conandata.yml b/recipes/diligent-core/all/conandata.yml index 98cb3e947ca09..40a84a121b9a0 100644 --- a/recipes/diligent-core/all/conandata.yml +++ b/recipes/diligent-core/all/conandata.yml @@ -46,8 +46,6 @@ patches: "api.250014": - patch_file: "patches/0007-API250014-remove_warning_as_error.patch" base_path: "source_subfolder" - - patch_file: "patches/0008-API250014-use_conan_dependencies_in_shader_tools.patch" - base_path: "source_subfolder" - patch_file: "patches/0009-API250014-use_conan_dependencies_in_third_party.patch" base_path: "source_subfolder" - patch_file: "patches/0010-API250014-use_volk_from_conan.patch" diff --git a/recipes/diligent-core/all/conanfile.py b/recipes/diligent-core/all/conanfile.py index fd38f8bec8c43..8ad46b51c3b53 100644 --- a/recipes/diligent-core/all/conanfile.py +++ b/recipes/diligent-core/all/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile -from conans import CMake +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building, check_min_cppstd from conan.tools.scm import Version -from conan.tools.files import rm, get, rmdir, rename, collect_libs, patches +from conan.tools.files import rm, get, rmdir, rename, collect_libs, patches, export_conandata_patches, copy, apply_conandata_patches from conan.tools.apple import is_apple_os import os -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class DiligentCoreConan(ConanFile): @@ -28,19 +28,8 @@ class DiligentCoreConan(ConanFile): "fPIC": True, "with_glslang": True } - generators = "cmake_find_package", "cmake", "cmake_find_package_multi" - _cmake = None - exports_sources = ["CMakeLists.txt", "patches/**"] short_paths = True - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property def _minimum_compilers_version(self): return { @@ -68,8 +57,13 @@ def validate(self): if self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime: raise ConanInvalidConfiguration("Visual Studio build with MT runtime is not supported") + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder, keep_path=False) + export_conandata_patches(self) + def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=os.path.join(self.source_folder, "source_subfolder"), strip_root=True) def package_id(self): if self.settings.compiler == "Visual Studio": @@ -78,6 +72,28 @@ def package_id(self): else: self.info.settings.compiler.runtime = "MT/MTd" + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DILIGENT_BUILD_SAMPLES"] = False + tc.variables["DILIGENT_NO_FORMAT_VALIDATION"] = True + tc.variables["DILIGENT_BUILD_TESTS"] = False + tc.variables["DILIGENT_NO_DXC"] = True + tc.variables["DILIGENT_NO_GLSLANG"] = not self.options.with_glslang + tc.variables["SPIRV_CROSS_NAMESPACE_OVERRIDE"] = self.options["spirv-cross"].namespace + tc.variables["BUILD_SHARED_LIBS"] = False + tc.variables["DILIGENT_CLANG_COMPILE_OPTIONS"] = "" + tc.variables["DILIGENT_MSVC_COMPILE_OPTIONS"] = "" + tc.variables["ENABLE_RTTI"] = True + tc.variables["ENABLE_EXCEPTIONS"] = True + tc.variables[self._diligent_platform()] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def layout(self): + cmake_layout(self) + def configure(self): if self.options.shared: del self.options.fPIC @@ -94,7 +110,8 @@ def build_requirements(self): def requirements(self): self.requires("opengl/system") - self.requires("wayland/1.21.0") + if self.settings.os == "Linux": + self.requires("wayland/1.21.0") self.requires("spirv-cross/1.3.216.0") self.requires("spirv-tools/1.3.216.0") @@ -126,34 +143,14 @@ def _diligent_platform(self): elif self.settings.os == "watchOS": return "PLATFORM_TVOS" - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["DILIGENT_BUILD_SAMPLES"] = False - self._cmake.definitions["DILIGENT_NO_FORMAT_VALIDATION"] = True - self._cmake.definitions["DILIGENT_BUILD_TESTS"] = False - self._cmake.definitions["DILIGENT_NO_DXC"] = True - self._cmake.definitions["DILIGENT_NO_GLSLANG"] = not self.options.with_glslang - self._cmake.definitions["SPIRV_CROSS_NAMESPACE_OVERRIDE"] = self.options["spirv-cross"].namespace - self._cmake.definitions["BUILD_SHARED_LIBS"] = False - self._cmake.definitions["DILIGENT_CLANG_COMPILE_OPTIONS"] = "" - self._cmake.definitions["DILIGENT_MSVC_COMPILE_OPTIONS"] = "" - - self._cmake.definitions["ENABLE_RTTI"] = True - self._cmake.definitions["ENABLE_EXCEPTIONS"] = True - - self._cmake.definitions[self._diligent_platform()] = True - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() rename(self, src=os.path.join(self.package_folder, "include", "source_subfolder"), dst=os.path.join(self.package_folder, "include", "DiligentCore")) @@ -161,25 +158,24 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "Licenses")) rmdir(self, os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "bin")) - self.copy("License.txt", dst="licenses", src=self._source_subfolder) + copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.package_folder, self.source_folder, "source_subfolder")) if self.options.shared: - self.copy(pattern="*.dylib", dst="lib", keep_path=False) - self.copy(pattern="*.so", dst="lib", keep_path=False) - self.copy(pattern="*.dll", dst="bin", keep_path=False) + copy(self, pattern="*.dylib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.so", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) rm(self, os.path.join(self.package_folder, "lib"), "*.a", recursive=True) if self.settings.os != "Windows": rm(self, os.path.join(self.package_folder, "lib"), "*.lib", recursive=True) else: - self.copy(pattern="*.a", dst="lib", keep_path=False) - self.copy(pattern="*.lib", dst="lib", keep_path=False) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) rm(self, os.path.join(self.package_folder, "lib"), "*.dylib", recursive=True) rm(self, os.path.join(self.package_folder, "lib"), "*.so", recursive=True) rm(self, os.path.join(self.package_folder, "lib"), "*.dll", recursive=True) - self.copy(pattern="*.fxh", dst="res", keep_path=False) - - self.copy("File2String*", src=os.path.join(self._build_subfolder, "bin"), dst="bin", keep_path=False) + copy(self, pattern="*.fxh", dst=os.path.join(self.package_folder, "res"), src=self.source_folder, keep_path=False) + copy(self, "File2String*", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder, keep_path=False) rm(self, "*.pdb", self.package_folder, recursive=True) # MinGw creates many invalid files, called objects.a, remove them here: rm(self, "objects.a", self.package_folder, recursive=True) diff --git a/recipes/diligent-core/all/patches/0002-use_conan_dependencies.patch b/recipes/diligent-core/all/patches/0002-use_conan_dependencies.patch index 7626749f44005..b6e7c03e3b6d6 100644 --- a/recipes/diligent-core/all/patches/0002-use_conan_dependencies.patch +++ b/recipes/diligent-core/all/patches/0002-use_conan_dependencies.patch @@ -1,24 +1,3 @@ -diff --git a/Graphics/ShaderTools/CMakeLists.txt b/Graphics/ShaderTools/CMakeLists.txt -index 00e63426..ad9041d9 100644 ---- a/Graphics/ShaderTools/CMakeLists.txt -+++ b/Graphics/ShaderTools/CMakeLists.txt -@@ -146,13 +146,13 @@ if(ENABLE_SPIRV) - if (${USE_GLSLANG}) - target_link_libraries(Diligent-ShaderTools - PRIVATE -- SPIRV -- glslang -+ spirv-tools::SPIRV-Tools-opt -+ glslang::SPIRV glslang::glslang glslang::MachineIndependent glslang::GenericCodeGen glslang::OSDependent glslang::OGLCompiler glslang::HLSL - ) - - target_include_directories(Diligent-ShaderTools - PRIVATE -- ../../ThirdParty/glslang -+ ${CONAN_INCLUDE_DIRS_GLSLANG}/glslang/ - ) - endif() - endif() diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt index e329495f..d61520cd 100644 --- a/ThirdParty/CMakeLists.txt diff --git a/recipes/diligent-core/all/patches/0003-use_volk_from_conan.patch b/recipes/diligent-core/all/patches/0003-use_volk_from_conan.patch index 9c4d1d3d9645f..3a247cb516390 100644 --- a/recipes/diligent-core/all/patches/0003-use_volk_from_conan.patch +++ b/recipes/diligent-core/all/patches/0003-use_volk_from_conan.patch @@ -7,8 +7,8 @@ index e760513d..a0d2de9c 100644 include ../../ThirdParty - ../../ThirdParty/Vulkan-Headers/include -+${CONAN_INCLUDE_DIRS_VULKAN-HEADERS}/include/ -+${CONAN_INCLUDE_DIRS_VOLK}/ ++${VulkanHeaders_INCLUDE_DIR} ++${volk_INCLUDE_DIR}/ ) set(PRIVATE_DEPENDENCIES diff --git a/recipes/diligent-core/all/patches/0008-API250014-use_conan_dependencies_in_shader_tools.patch b/recipes/diligent-core/all/patches/0008-API250014-use_conan_dependencies_in_shader_tools.patch deleted file mode 100644 index bb8200d8897d1..0000000000000 --- a/recipes/diligent-core/all/patches/0008-API250014-use_conan_dependencies_in_shader_tools.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/Graphics/ShaderTools/CMakeLists.txt b/Graphics/ShaderTools/CMakeLists.txt -index dc47ac4b..83630de3 100644 ---- a/Graphics/ShaderTools/CMakeLists.txt -+++ b/Graphics/ShaderTools/CMakeLists.txt -@@ -147,13 +147,13 @@ if(ENABLE_SPIRV) - if (${USE_GLSLANG}) - target_link_libraries(Diligent-ShaderTools - PRIVATE -- SPIRV -- glslang -+ spirv-tools::SPIRV-Tools-opt -+ glslang::SPIRV glslang::glslang glslang::MachineIndependent glslang::GenericCodeGen glslang::OSDependent glslang::OGLCompiler glslang::HLSL - ) - - target_include_directories(Diligent-ShaderTools - PRIVATE -- ../../ThirdParty/glslang -+ ${CONAN_INCLUDE_DIRS_GLSLANG}/glslang/ - ) - endif() - endif() diff --git a/recipes/diligent-core/all/patches/0010-API250014-use_volk_from_conan.patch b/recipes/diligent-core/all/patches/0010-API250014-use_volk_from_conan.patch index bd12169aea37c..fd00b73de0f8b 100644 --- a/recipes/diligent-core/all/patches/0010-API250014-use_volk_from_conan.patch +++ b/recipes/diligent-core/all/patches/0010-API250014-use_volk_from_conan.patch @@ -7,8 +7,8 @@ index 34451f2dd..d61797325 100644 include ../../ThirdParty - ../../ThirdParty/Vulkan-Headers/include -+${CONAN_INCLUDE_DIRS_VULKAN-HEADERS}/include/ -+${CONAN_INCLUDE_DIRS_VOLK}/ ++${VulkanHeaders_INCLUDE_DIR} ++${volk_INCLUDE_DIR}/ ) set(PRIVATE_DEPENDENCIES diff --git a/recipes/diligent-core/all/patches/0013-API250014-use-vulkan-headers-in-archiver.patch b/recipes/diligent-core/all/patches/0013-API250014-use-vulkan-headers-in-archiver.patch index eb670a8735544..c6f5c58e9c39c 100644 --- a/recipes/diligent-core/all/patches/0013-API250014-use-vulkan-headers-in-archiver.patch +++ b/recipes/diligent-core/all/patches/0013-API250014-use-vulkan-headers-in-archiver.patch @@ -7,8 +7,8 @@ index 1552937ce..73c77158e 100644 PRIVATE ../GraphicsEngineVulkan/include - ../../ThirdParty/Vulkan-Headers/include -+ ${CONAN_INCLUDE_DIRS_VULKAN-HEADERS}/include/ -+ ${CONAN_INCLUDE_DIRS_VOLK}/ ++ ${VulkanHeaders_INCLUDE_DIR} ++ ${volk_INCLUDE_DIR}/ ) endif() From 15bf556741c49a42189cfab7e384c3282e1e1b80 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 14 Oct 2022 03:25:35 -0500 Subject: [PATCH 389/561] (#13364) swig: Link against dl on Linux, not just for GCC * swig: Link against dl on Linux, not just for GCC * Fix imports * Fix imports --- recipes/swig/all/conanfile.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/recipes/swig/all/conanfile.py b/recipes/swig/all/conanfile.py index a8493d08a9cb3..4cdb8b2645caf 100644 --- a/recipes/swig/all/conanfile.py +++ b/recipes/swig/all/conanfile.py @@ -1,4 +1,6 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conan import ConanFile +from conan.tools.files import get +from conans import AutoToolsBuildEnvironment, tools import contextlib import functools import os @@ -40,8 +42,8 @@ def package_id(self): del self.info.settings.compiler 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], + destination=self._source_subfolder, strip_root=True) @property def _user_info_build(self): @@ -86,7 +88,7 @@ def _configure_autotools(self): "--host={}".format(self.settings.arch), "--with-swiglibdir={}".format(self._swiglibdir), ] - if self.settings.compiler == 'gcc': + if self.settings.os == "Linux": args.append("LIBS=-ldl") host, build = None, None From f513109972d6271c564c2c19ba5452b828eb1f44 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 14 Oct 2022 17:45:28 +0900 Subject: [PATCH 390/561] (#13392) lunasvg: add version 2.3.4 and support conan v2 * lunasvg: add version 2.3.3 and support conan v2 * add end line * add end line * require C++17 since 2.3.3 * add version 2.2.4 --- recipes/lunasvg/all/CMakeLists.txt | 9 -- recipes/lunasvg/all/conandata.yml | 17 ++- recipes/lunasvg/all/conanfile.py | 109 ++++++++++-------- .../lunasvg/all/test_package/CMakeLists.txt | 11 +- recipes/lunasvg/all/test_package/conanfile.py | 21 +++- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../lunasvg/all/test_v1_package/conanfile.py | 17 +++ recipes/lunasvg/config.yml | 2 + 8 files changed, 124 insertions(+), 73 deletions(-) delete mode 100644 recipes/lunasvg/all/CMakeLists.txt create mode 100644 recipes/lunasvg/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lunasvg/all/test_v1_package/conanfile.py diff --git a/recipes/lunasvg/all/CMakeLists.txt b/recipes/lunasvg/all/CMakeLists.txt deleted file mode 100644 index 71d3f2c29c326..0000000000000 --- a/recipes/lunasvg/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/lunasvg/all/conandata.yml b/recipes/lunasvg/all/conandata.yml index 79538b2b85992..c03405668ac21 100644 --- a/recipes/lunasvg/all/conandata.yml +++ b/recipes/lunasvg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.4": + url: "https://github.com/sammycage/lunasvg/archive/v2.3.4.tar.gz" + sha256: "1933bf3fcdec81a1c17702b3c6efb00b9e3380e3fcea508f4ee4b11b0d2e45c0" "2.3.2": url: "https://github.com/sammycage/lunasvg/archive/v2.3.2.tar.gz" sha256: "12abe6865dd030adfac70c30592eaa25c4e34fa81379e5149b0186282721f40c" @@ -7,9 +10,15 @@ sources: sha256: "6492bf0f51982f5382f83f1a42f247bb1bbcbaef4a15963bbd53073cd4944a25" patches: + "2.3.4": + - patch_file: "patches/2.3.1-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" "2.3.2": - - base_path: "source_subfolder" - patch_file: "patches/2.3.1-0001-fix-cmake.patch" + - patch_file: "patches/2.3.1-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" "2.3.1": - - base_path: "source_subfolder" - patch_file: "patches/2.3.1-0001-fix-cmake.patch" + - patch_file: "patches/2.3.1-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" diff --git a/recipes/lunasvg/all/conanfile.py b/recipes/lunasvg/all/conanfile.py index a6afb71ae1817..f0a5243c356d4 100644 --- a/recipes/lunasvg/all/conanfile.py +++ b/recipes/lunasvg/all/conanfile.py @@ -1,15 +1,22 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -required_conan_version = ">=1.33.0" +import os + +required_conan_version = ">=1.52.0" class LunaSVGConan(ConanFile): name = "lunasvg" description = "lunasvg is a standalone SVG rendering library in C++." - topics = ("svg", "renderer", ) license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/sammycage/lunasvg" + topics = ("svg", "renderer", ) settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -19,27 +26,31 @@ class LunaSVGConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake", "cmake_find_package_multi" - - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + if Version(self.version) <= "2.3.2": + return 14 + else: + return 17 @property def _compilers_minimum_version(self): - return { - "Visual Studio": "15", - "gcc": "5", - "clang": "3.5", - "apple-clang": "10" - } + if Version(self.version) <= "2.3.2": + return { + "gcc": "5", + "clang": "3.5", + "apple-clang": "10" + } + else: + return { + "gcc": "7.1", + "clang": "7", + "apple-clang": "12.0" + } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -47,48 +58,52 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("plutovg/cci.20220103") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") - - def lazy_lt_semver(v1, v2): - lv1 = [int(v) for v in v1.split(".")] - lv2 = [int(v) for v in v2.split(".")] - min_length = min(len(lv1), len(lv2)) - return lv1[:min_length] < lv2[:min_length] - - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("{} requires C++14. Your compiler is unknown. Assuming it supports C++14.".format(self.name)) - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("{} requires C++14, which your compiler does not fully support.".format(self.name)) + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + if Version(self.version) <= "2.3.2": + check_min_vs(self, 191) + else: + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) 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], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared - self._cmake.configure() - return self._cmake + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/lunasvg/all/test_package/CMakeLists.txt b/recipes/lunasvg/all/test_package/CMakeLists.txt index 3207e80a2f2ed..1c8a5ea6697c7 100644 --- a/recipes/lunasvg/all/test_package/CMakeLists.txt +++ b/recipes/lunasvg/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) find_package(lunasvg REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} lunasvg::lunasvg) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/lunasvg/all/test_package/conanfile.py b/recipes/lunasvg/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/lunasvg/all/test_package/conanfile.py +++ b/recipes/lunasvg/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/lunasvg/all/test_v1_package/CMakeLists.txt b/recipes/lunasvg/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..596ce1fb31ebb --- /dev/null +++ b/recipes/lunasvg/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lunasvg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/lunasvg/all/test_v1_package/conanfile.py b/recipes/lunasvg/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..81a08015e01f1 --- /dev/null +++ b/recipes/lunasvg/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lunasvg/config.yml b/recipes/lunasvg/config.yml index 73ae77ffcdd83..b3cd458b9f67d 100644 --- a/recipes/lunasvg/config.yml +++ b/recipes/lunasvg/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.4": + folder: all "2.3.2": folder: all "2.3.1": From 44dc411bbc96c4b35f73c3fad9046e19b6c647ab Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 14 Oct 2022 02:04:20 -0700 Subject: [PATCH 391/561] (#13405) docs: add a copy of the CLA for new contributors * docs: add a copy of the CLA for new contributors https://gist.githubusercontent.com/lasote/317ecbdfc8e011cc8a24c3d6cf40051f/raw/2b34f09dcb4e790ae8f5367aa7bb173b3fba70eb/conan-center-index_CLA.md is the source that's being used by cla-assistant.io to fill the web page * add some links are more references so it's less of a surprise * call out req access and cla in contributing * I need to get a better spell checking extension Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- CONTRIBUTING.md | 9 +++++---- docs/CONTRIBUTOR_LICENSE_AGREEMENT.md | 23 +++++++++++++++++++++++ docs/how_to_add_packages.md | 4 ++++ docs/review_process.md | 2 +- 4 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 docs/CONTRIBUTOR_LICENSE_AGREEMENT.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a8847b489ef4..6cf9d3245b80c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,11 +23,12 @@ To contribute follow the next steps: 1. Comment in the corresponding issue that you want to contribute the package/fix proposed. If there is no open issue, we strongly suggest opening one to gather feedback. -2. Get setup by following [Developing Recipes](docs/developing_recipes_locally.md) guide and learn the basic commands. -3. Check the [How To Add Packages](docs/how_to_add_packages.md) for the break down ConanCenterIndex specific conventions and practices. -4. In your fork create a `package/xxx` branch from the `master` branch and develop +2. Make sure to [request access](docs/how_to_add_packages.md#request-access) and be aware there is a [CLA](docs/CONTRIBUTOR_LICENSE_AGREEMENT.md). +3. Get setup by following the [Developing Recipes](docs/developing_recipes_locally.md) guide and learn the basic commands. +4. Check the [How To Add Packages](docs/how_to_add_packages.md) page for the break down of ConanCenterIndex specific conventions and practices. +5. In your fork create a `package/xxx` branch from the `master` branch and develop your fix/packages as discussed in previous step. -5. [Submit a pull request](docs/how_to_add_packages.md#submitting-a-package) once you are ready. This can be when you +6. [Submit a pull request](docs/how_to_add_packages.md#submitting-a-package) once you are ready. This can be when you got everything working or even if you need help. Add the text to the issue body (besides other comments): "fixes #IssueNumber" in the body of the PR, referring to the issue of step 1. diff --git a/docs/CONTRIBUTOR_LICENSE_AGREEMENT.md b/docs/CONTRIBUTOR_LICENSE_AGREEMENT.md new file mode 100644 index 0000000000000..39acf20a7aebd --- /dev/null +++ b/docs/CONTRIBUTOR_LICENSE_AGREEMENT.md @@ -0,0 +1,23 @@ +Conan-Center-Index project Contributor License Agreement +-------------------------------------------------------- + +The following terms are used throughout this agreement: + +- You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it. +- Contribution - any type of work that is submitted to the repository, including any modifications or additions to existing work. +- Project - Conan-Center-Index project (https://github.com/conan-io/conan-center-index) +- Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with the copyright owner, contributors or maintainers. + +1. Grant of Copyright License. + + Subject to the terms and conditions of this agreement, You grant to JFrog LTD, a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your contributions and such derivative works. + +2. Grant of Patent License. + + Subject to the terms and conditions of this agreement, You grant to JFrog LTD, a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your contributions, where such license applies only to those patent claims licensable by you that are necessarily infringed by your contribution or by combination of your contribution with the project to which this contribution was submitted. + + If any entity institutes patent litigation - including cross-claim or counterclaim in a lawsuit - against You alleging that your contribution or any project it was submitted to constitutes or is responsible for direct or contributory patent infringement, then any patent licenses granted to that entity under this agreement shall terminate as of the date such litigation is filed. + +3. Source of Contribution. + + Your contribution is either your original creation, based upon previous work that, to the best of your knowledge, is covered under an appropriate open source license and you have the right under that license to submit that work with modifications, whether created in whole or in part by you, or you have clearly identified the source of the contribution and any license or other restriction (like related patents, trademarks, and license agreements) of which you are personally aware. diff --git a/docs/how_to_add_packages.md b/docs/how_to_add_packages.md index a0457a78b8d51..778b437005387 100644 --- a/docs/how_to_add_packages.md +++ b/docs/how_to_add_packages.md @@ -42,11 +42,15 @@ This process helps conan-center-index against spam and malicious code. The proce > :warning: The requests are reviewed manually, checking the GitHub profile activity of the requester to avoid a misuse of the service. In case of detecting a misuse or inappropriate behavior, the requester will be dropped from the authorized users list and at last instance even banned from the repository. +When submitting a pull request for the first time, you will be prompted to sign the [CLA](CONTRIBUTOR_LICENSE_AGREEMENT.md) for your code contributions. +You can view your signed CLA's by going to and signing in. + ## Submitting a Package :two: To contribute a package, you can submit a [Pull Request](https://github.com/conan-io/conan-center-index/pulls) to this GitHub repository https://github.com/conan-io/conan-center-index. The specific steps to add new packages are: + * Fork the [conan-center-index](https://github.com/conan-io/conan-center-index) git repository, and then clone it locally. * Copy a template from [package_templates](package_templates) folder in the recipes/ folder and rename it to the project name (it should be lower-case). Read templates [documentation](package_templates/README.md) to find more information. * Make sure you are using the latest [Conan client](https://conan.io/downloads) version, as recipes might evolve introducing features of the newer Conan releases. diff --git a/docs/review_process.md b/docs/review_process.md index e29387f248578..55eadf1bd0738 100644 --- a/docs/review_process.md +++ b/docs/review_process.md @@ -101,7 +101,7 @@ The bot runs Automatic Merges every 20 minutes. Currently, it can only merge a s PR is selected for the merge only if: - Author is already [approved](https://github.com/conan-io/conan-center-index/issues/4). -- Author has signed CLA. +- Author has signed the [CLA](CONTRIBUTOR_LICENSE_AGREEMENT.md). - PR is not a Draft. - PR has a green status (successful build). - PR doesn't have merge conflicts with `master` branch. From 05366f269763c2888a038e46e971952c3b2c68ef Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Fri, 14 Oct 2022 10:24:47 +0100 Subject: [PATCH 392/561] (#13428) [gdk-pixbuf] remove windows glib version exception --- recipes/gdk-pixbuf/all/conanfile.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/recipes/gdk-pixbuf/all/conanfile.py b/recipes/gdk-pixbuf/all/conanfile.py index d952cc825eb1f..e05b7d7f21a28 100644 --- a/recipes/gdk-pixbuf/all/conanfile.py +++ b/recipes/gdk-pixbuf/all/conanfile.py @@ -36,6 +36,7 @@ class GdkPixbufConan(ConanFile): "with_libjpeg": "libjpeg", "with_introspection": False, } + short_paths = True def config_options(self): if self.settings.os == "Windows": @@ -116,12 +117,7 @@ def is_true(value): venv.generate() def requirements(self): - if not microsoft.is_msvc(self): - self.requires("glib/2.74.0") - else: - # Workaround due to https://github.com/conan-io/conan-center-index/issues/12342 - # Test again when the glib recipe is updated to the new meson toolchain - self.requires("glib/2.73.0") + self.requires("glib/2.74.0") if self.options.with_libpng: self.requires("libpng/1.6.38") if self.options.with_libtiff: From 1ba694fcd4734690d85f05933f2a5a10ca17b4cd Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Fri, 14 Oct 2022 12:44:42 +0300 Subject: [PATCH 393/561] (#13434) SDL: add v2.24.1 --- recipes/sdl/all/conandata.yml | 3 +++ recipes/sdl/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/sdl/all/conandata.yml b/recipes/sdl/all/conandata.yml index c22695db16adc..df0970773324b 100644 --- a/recipes/sdl/all/conandata.yml +++ b/recipes/sdl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.24.1": + url: "https://www.libsdl.org/release/SDL2-2.24.1.tar.gz" + sha256: bc121588b1105065598ce38078026a414c28ea95e66ed2adab4c44d80b309e1b "2.24.0": url: "https://www.libsdl.org/release/SDL2-2.24.0.tar.gz" sha256: 91e4c34b1768f92d399b078e171448c6af18cafda743987ed2064a28954d6d97 diff --git a/recipes/sdl/config.yml b/recipes/sdl/config.yml index e1345d5d7df9a..66468cd76e50a 100644 --- a/recipes/sdl/config.yml +++ b/recipes/sdl/config.yml @@ -1,4 +1,6 @@ versions: + "2.24.1": + folder: all "2.24.0": folder: all "2.0.20": From 399efd288aab520c5d45420e2b87972385ce6e1d Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 14 Oct 2022 19:09:27 +0900 Subject: [PATCH 394/561] (#13455) daw_header_libraries: add version 2.71.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/daw_header_libraries/all/conandata.yml | 3 +++ recipes/daw_header_libraries/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/daw_header_libraries/all/conandata.yml b/recipes/daw_header_libraries/all/conandata.yml index 72192bfc7e5dc..46964cc5f776f 100644 --- a/recipes/daw_header_libraries/all/conandata.yml +++ b/recipes/daw_header_libraries/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.71.0": + url: "https://github.com/beached/header_libraries/archive/v2.71.0.tar.gz" + sha256: "50b9ddebdbc808a5714408a45f686fafe9d1d3b78c988df3973c12c9928828b9" "2.68.3": url: "https://github.com/beached/header_libraries/archive/v2.68.3.tar.gz" sha256: "9bb7d25d161b89ad4a0ac857c28734c061cf53f6e80212c7fe70b8e0fd14789f" diff --git a/recipes/daw_header_libraries/config.yml b/recipes/daw_header_libraries/config.yml index b96db2d45d6b0..fddfdcec535bc 100644 --- a/recipes/daw_header_libraries/config.yml +++ b/recipes/daw_header_libraries/config.yml @@ -1,4 +1,6 @@ versions: + "2.71.0": + folder: all "2.68.3": folder: all "2.68.1": From 46194a6bcd5af8dc84804bed874f7c2e24fb5511 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 14 Oct 2022 15:05:59 +0200 Subject: [PATCH 395/561] (#13421) libsass: modernize * libsass: modernize * Update conanfile.py * Update recipes/libsass/all/conanfile.py Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- recipes/libsass/all/conanfile.py | 44 +++++++++++++++----------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/recipes/libsass/all/conanfile.py b/recipes/libsass/all/conanfile.py index fa494bccd79fc..374c7b2afb2fd 100644 --- a/recipes/libsass/all/conanfile.py +++ b/recipes/libsass/all/conanfile.py @@ -1,9 +1,11 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import get, chdir, save, replace_in_file, rmdir, rm +from conan.tools.microsoft import is_msvc +from conans import AutoToolsBuildEnvironment, MSBuild, tools import os import re -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class LibsassConan(ConanFile): @@ -33,10 +35,6 @@ def _source_subfolder(self): def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" - @property - def _is_msvc(self): - return self.settings.os == "Windows" and self.settings.compiler == "Visual Studio" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -47,10 +45,10 @@ def configure(self): def build_requirements(self): if self.settings.os != "Windows": - self.build_requires("libtool/2.4.6") + self.tool_requires("libtool/2.4.7") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def _configure_autotools(self): @@ -65,8 +63,8 @@ def _configure_autotools(self): return self._autotools def _build_autotools(self): - with tools.chdir(self._source_subfolder): - tools.save(path="VERSION", content="%s" % self.version) + with chdir(self, self._source_subfolder): + save(self, path="VERSION", content=f"{self.version}") self.run("{} -fiv".format(tools.get_env("AUTORECONF"))) autotools = self._configure_autotools() autotools.make() @@ -77,10 +75,10 @@ def _make_program(self): def _build_mingw(self): makefile = os.path.join(self._source_subfolder, "Makefile") - tools.replace_in_file(makefile, "CFLAGS += -O2", "") - tools.replace_in_file(makefile, "CXXFLAGS += -O2", "") - tools.replace_in_file(makefile, "LDFLAGS += -O2", "") - with tools.chdir(self._source_subfolder): + replace_in_file(self, makefile, "CFLAGS += -O2", "") + replace_in_file(self, makefile, "CXXFLAGS += -O2", "") + replace_in_file(self, makefile, "LDFLAGS += -O2", "") + with chdir(self, self._source_subfolder): env_vars = AutoToolsBuildEnvironment(self).vars env_vars.update({ "BUILD": "shared" if self.options.shared else "static", @@ -91,10 +89,10 @@ def _build_mingw(self): "STATIC_LIBSTDCPP": "0", }) with tools.environment_append(env_vars): - self.run("{} -f Makefile".format(self._make_program)) + self.run(f"{self._make_program} -f Makefile") def _build_visual_studio(self): - with tools.chdir(self._source_subfolder): + with chdir(self, self._source_subfolder): properties = { "LIBSASS_STATIC_LIB": "" if self.options.shared else "true", "WholeProgramOptimization": "true" if any(re.finditer("(^| )[/-]GL($| )", tools.get_env("CFLAGS", ""))) else "false", @@ -109,17 +107,17 @@ def _build_visual_studio(self): def build(self): if self._is_mingw: self._build_mingw() - elif self._is_msvc: + elif is_msvc(self): self._build_visual_studio() else: self._build_autotools() def _install_autotools(self): - with tools.chdir(self._source_subfolder): + with chdir(self, self._source_subfolder): autotools = self._configure_autotools() autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(self.package_folder, "*.la") + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", self.package_folder, recursive=True) def _install_mingw(self): self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) @@ -135,14 +133,14 @@ def package(self): self.copy("LICENSE", src=self._source_subfolder, dst="licenses") if self._is_mingw: self._install_mingw() - elif self._is_msvc: + elif is_msvc(self): self._install_visual_studio() else: self._install_autotools() def package_info(self): self.cpp_info.names["pkg_config"] = "libsass" - self.cpp_info.libs = ["libsass" if self._is_msvc else "sass"] + self.cpp_info.libs = ["libsass" if is_msvc(self) else "sass"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "m"]) if not self.options.shared and tools.stdcpp_library(self): From d55b66e89f47bced1380740c1de401c3be73e452 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 14 Oct 2022 08:24:35 -0500 Subject: [PATCH 396/561] (#13315) dbus: Add with_systemd option and build 1.15.0 with Meson * dbus: Add with_systemd option and build 1.15.0 with Meson Fixes #13280. * Disable monotonic clock functionality from pthread on Macos * Set launchd_agent_dir on macOS * dbus/1.15.0: Patch Meson detection of monotonic clock support on MacOS * Update patch * dbus/1.15.0: Build for Windows * Refactor check for Windows support be clearer * Remove *.pdb files on Windows * Patch 1.15.2 * Use variables instead of cache_variables * Update recipes/dbus/1.x.x/conanfile.py Co-authored-by: Chris Mc * Set cache variable to disable prefer config Co-authored-by: Chris Mc --- recipes/dbus/1.x.x/conandata.yml | 10 ++ recipes/dbus/1.x.x/conanfile.py | 134 ++++++++++++------ .../0003-meson-monotonic-clock-check.patch | 15 ++ 3 files changed, 117 insertions(+), 42 deletions(-) create mode 100644 recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch diff --git a/recipes/dbus/1.x.x/conandata.yml b/recipes/dbus/1.x.x/conandata.yml index 27f1f2bc83407..20ee5e48052c8 100644 --- a/recipes/dbus/1.x.x/conandata.yml +++ b/recipes/dbus/1.x.x/conandata.yml @@ -12,6 +12,16 @@ sources: url: "https://dbus.freedesktop.org/releases/dbus/dbus-1.12.20.tar.gz" sha256: "f77620140ecb4cdc67f37fb444f8a6bea70b5b6461f12f1cbe2cec60fa7de5fe" patches: + "1.15.2": + - patch_file: "patches/0003-meson-monotonic-clock-check.patch" + patch_type: "portability" + patch_description: "Fix detection of necessary monotonic clock functions in pthread" + patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/352" + "1.15.0": + - patch_file: "patches/0003-meson-monotonic-clock-check.patch" + patch_type: "portability" + patch_description: "Fix detection of necessary monotonic clock functions in pthread" + patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/352" "1.12.20": - patch_file: "patches/0001-cmake-project.patch" - patch_file: "patches/0002-cmake_configure_checks_list_separator.patch" diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index 78abe21349606..8e5ffa679d9f5 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -1,8 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rmdir, save +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout, cmake_layout +from conan.tools.meson import Meson, MesonToolchain from conan.tools.scm import Version import os import textwrap @@ -16,14 +20,15 @@ class DbusConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.freedesktop.org/wiki/Software/dbus" description = "D-Bus is a simple system for interprocess communication and coordination." - topics = ("dbus") - + topics = ("bus", "interprocess", "message") settings = "os", "arch", "compiler", "build_type" + short_paths = True options = { "system_socket": ["ANY"], "system_pid_file": ["ANY"], "with_x11": [True, False], "with_glib": [True, False], + "with_systemd": [True, False], "with_selinux": [True, False], "session_socket_dir": ["ANY"], } @@ -32,14 +37,21 @@ class DbusConan(ConanFile): "system_pid_file": "", "with_x11": False, "with_glib": False, + "with_systemd": False, "with_selinux": False, "session_socket_dir": "/tmp", } + @property + def _meson_available(self): + return Version(self.version) >= "1.15.0" + def export_sources(self): export_conandata_patches(self) def config_options(self): + if self.settings.os not in ("Linux", "FreeBSD") or Version(self.version) < "1.14.0": + del self.options.with_systemd if self.settings.os not in ("Linux", "FreeBSD"): del self.options.with_x11 @@ -54,14 +66,24 @@ def configure(self): pass def layout(self): - cmake_layout(self, src_folder="src") + if self._meson_available: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") + + def build_requirements(self): + if self._meson_available: + self.tool_requires("meson/0.63.3") + self.tool_requires("pkgconf/1.9.3") def requirements(self): self.requires("expat/2.4.9") if self.options.with_glib: self.requires("glib/2.74.0") + if self.options.get_safe("with_systemd"): + self.requires("libsystemd/251.4") if self.options.with_selinux: - self.requires("selinux/3.3") + self.requires("libselinux/3.3") if self.options.get_safe("with_x11"): self.requires("xorg/system") @@ -69,54 +91,82 @@ def validate(self): if Version(self.version) >= "1.14.0": if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < 7: raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.") - if self.info.settings.os == "Windows": - raise ConanInvalidConfiguration(f"{self.ref} does not support windows. contributions are welcome") + + if not self._meson_available and self.info.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} does not support Windows. Contributions welcome.") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): - tc = CMakeToolchain(self) - tc.variables["DBUS_BUILD_TESTS"] = False - tc.variables["DBUS_ENABLE_DOXYGEN_DOCS"] = False - tc.variables["DBUS_ENABLE_XML_DOCS"] = False - tc.variables["DBUS_BUILD_X11"] = self.options.get_safe("with_x11", False) - tc.variables["DBUS_WITH_GLIB"] = self.options.with_glib - tc.variables["DBUS_DISABLE_ASSERT"] = is_apple_os(self) - tc.variables["DBUS_DISABLE_CHECKS"] = False - # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a - tc.variables["DBUS_SESSION_SOCKET_DIR"] = self.options.session_socket_dir - tc.generate() - - deps = CMakeDeps(self) - deps.generate() - - def _patch_sources(self): - apply_conandata_patches(self) - # Unfortunately, there is currently no other way to force disable - # CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in CMake conan_toolchain. - replace_in_file( - self, - os.path.join(self.generators_folder, "conan_toolchain.cmake"), - "set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)", - "", - strict=False, - ) + if self._meson_available: + tc = MesonToolchain(self) + tc.project_options["asserts"] = not is_apple_os(self) + tc.project_options["checks"] = False + tc.project_options["doxygen_docs"] = "disabled" + tc.project_options["modular_tests"] = "disabled" + tc.project_options["session_socket_dir"] = str(self.options.session_socket_dir) + tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux", False) else "disabled" + tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd", False) else "disabled" + if self.options.get_safe("with_systemd", False): + tc.project_options["systemd_system_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "system") + tc.project_options["systemd_user_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "user") + if is_apple_os(self): + tc.project_options["launchd_agent_dir"] = os.path.join(self.package_folder, "res", "LaunchAgents") + tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11", False) else "disabled" + tc.project_options["xml_docs"] = "disabled" + tc.generate() + env = VirtualBuildEnv(self) + env.generate(scope="build") + else: + tc = CMakeToolchain(self) + tc.variables["DBUS_BUILD_TESTS"] = False + tc.variables["DBUS_ENABLE_DOXYGEN_DOCS"] = False + tc.variables["DBUS_ENABLE_XML_DOCS"] = False + tc.variables["DBUS_BUILD_X11"] = bool(self.options.get_safe("with_x11", False)) + tc.variables["ENABLE_SYSTEMD"] = "ON" if self.options.get_safe("with_systemd", False) else "OFF" + tc.variables["DBUS_WITH_GLIB"] = bool(self.options.get_safe("with_glib", False)) + tc.variables["DBUS_DISABLE_ASSERT"] = is_apple_os(self) + tc.variables["DBUS_DISABLE_CHECKS"] = False + + # Conan does not provide an EXPAT_LIBRARIES CMake variable for the Expat library. + # Define EXPAT_LIBRARIES to be the expat::expat target provided by Conan to fix linking. + tc.variables["EXPAT_LIBRARIES"] = "expat::expat" + + # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a + tc.variables["DBUS_SESSION_SOCKET_DIR"] = str(self.options.session_socket_dir) + + tc.cache_variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = False + tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() def build(self): - self._patch_sources() - cmake = CMake(self) - if Version(self.version) < "1.14.0": - cmake.configure(build_script_folder=os.path.join(self.source_folder, "cmake")) + apply_conandata_patches(self) + if self._meson_available: + meson = Meson(self) + meson.configure() + meson.build() else: - cmake.configure() - cmake.build() + cmake = CMake(self) + build_script_folder = None + if Version(self.version) < "1.14.0": + build_script_folder = "cmake" + cmake.configure(build_script_folder=build_script_folder) + cmake.build() def package(self): copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - cmake = CMake(self) - cmake.install() + if self._meson_available: + meson = Meson(self) + meson.install() + else: + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) rmdir(self, os.path.join(self.package_folder, "share", "doc")) mkdir(self, os.path.join(self.package_folder, "res")) for i in ["var", "share", "etc"]: diff --git a/recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch b/recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch new file mode 100644 index 0000000000000..7e9e94edfd469 --- /dev/null +++ b/recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch @@ -0,0 +1,15 @@ +diff --git a/meson.build b/meson.build +index 3b5b182c..4e400a52 100644 +--- a/meson.build ++++ b/meson.build +@@ -328,7 +328,9 @@ data_config.set('top_builddir', meson.project_build_root()) + threads = dependency('threads') + config.set( + 'HAVE_MONOTONIC_CLOCK', +- cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC', args: compile_args_c), ++ cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC', args: compile_args_c) ++ and cc.has_header_symbol('pthread.h', 'pthread_condattr_setclock', args: compile_args_c) ++ and cc.has_header_symbol('time.h', 'clock_getres', args: compile_args_c), + ) + + glib = dependency( From 43736c6aa6466d830198401a525429b253801a47 Mon Sep 17 00:00:00 2001 From: Jason Green Date: Fri, 14 Oct 2022 08:45:20 -0500 Subject: [PATCH 397/561] (#13351) p7zip: Add initial package based on 16.02 sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * p7zip: Add initial package based on 16.02 sources - Also adds CVE and build patches from conda-forge and Debian - 7zip already exists but is Windows-only. This is for all other platforms. * Use Conan 2 features Signed-off-by: Uilian Ries * Updated patch_source and patch_description * Fix pylint errors - unused imports * Update recipes/p7zip/all/test_package/conanfile.py 👍 Co-authored-by: Chris Mc Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/p7zip/all/conandata.yml | 24 ++ recipes/p7zip/all/conanfile.py | 86 +++++ .../p7zip/all/patches/06-CVE-2018-5996.patch | 221 +++++++++++++ .../p7zip/all/patches/12-CVE-2016-9296.patch | 23 ++ .../p7zip/all/patches/13-CVE-2017-17969.patch | 35 ++ .../all/patches/14-Fix-g++-warning.patch | 24 ++ .../p7zip/all/patches/CVE-2018-10115.patch | 311 ++++++++++++++++++ recipes/p7zip/all/patches/clang.diff | 49 +++ recipes/p7zip/all/test_package/conanfile.py | 15 + .../p7zip/all/test_v1_package/conanfile.py | 9 + recipes/p7zip/config.yml | 3 + 11 files changed, 800 insertions(+) create mode 100644 recipes/p7zip/all/conandata.yml create mode 100644 recipes/p7zip/all/conanfile.py create mode 100644 recipes/p7zip/all/patches/06-CVE-2018-5996.patch create mode 100644 recipes/p7zip/all/patches/12-CVE-2016-9296.patch create mode 100644 recipes/p7zip/all/patches/13-CVE-2017-17969.patch create mode 100644 recipes/p7zip/all/patches/14-Fix-g++-warning.patch create mode 100644 recipes/p7zip/all/patches/CVE-2018-10115.patch create mode 100644 recipes/p7zip/all/patches/clang.diff create mode 100644 recipes/p7zip/all/test_package/conanfile.py create mode 100644 recipes/p7zip/all/test_v1_package/conanfile.py create mode 100644 recipes/p7zip/config.yml diff --git a/recipes/p7zip/all/conandata.yml b/recipes/p7zip/all/conandata.yml new file mode 100644 index 0000000000000..5693cc1e321ba --- /dev/null +++ b/recipes/p7zip/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "16.02": + url: https://downloads.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2 + sha256: "5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f" +patches: + "16.02": + - patch_file: "patches/12-CVE-2016-9296.patch" + patch_source: "https://github.com/conda-forge/p7zip-feedstock/tree/main/recipe" + patch_description: "Addresses CVE-2016-9296: null pointer check for the variable folders.PackPositions in function CInArchive::ReadAndDecodePackedStreams" + - patch_file: "patches/13-CVE-2017-17969.patch" + patch_source: "https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7" + patch_description: "Addresses CVE-2017-17969: Heap-based buffer overflow in the NCompress::NShrink::CDecoder::CodeReal method" + - patch_file: "patches/14-Fix-g++-warning.patch" + patch_source: "https://github.com/conda-forge/p7zip-feedstock/tree/main/recipe" + patch_description: "Addresses gcc warning: use of an operand of type 'bool' in 'operator++' is deprecated" + - patch_file: "patches/clang.diff" + patch_source: "https://github.com/conda-forge/p7zip-feedstock/tree/main/recipe" + patch_description: "Addresses clang 6.x error: case value evaluates to -2147024809" + - patch_file: "patches/06-CVE-2018-5996.patch" + patch_source: "https://salsa.debian.org/debian/p7zip-rar/-/tree/debian/16.02-3/debian/patches" + patch_description: "Addresses CVE-2018-5996: RAR memory corruptions fix" + - patch_file: "patches/CVE-2018-10115.patch" + patch_source: "https://salsa.debian.org/debian/p7zip-rar/-/tree/debian/16.02-3/debian/patches" + patch_description: "Addresses CVE-2018-10115: Incorrect initialization logic of RAR decoder objects" diff --git a/recipes/p7zip/all/conanfile.py b/recipes/p7zip/all/conanfile.py new file mode 100644 index 0000000000000..0923c8b9413a3 --- /dev/null +++ b/recipes/p7zip/all/conanfile.py @@ -0,0 +1,86 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, replace_in_file, chdir +from conan.tools.layout import basic_layout +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.apple import is_apple_os, to_apple_arch +import os + + +required_conan_version = ">=1.52.0" + + +class PSevenZipConan(ConanFile): + name = "p7zip" + url = "https://github.com/conan-io/conan-center-index" + description = "p7zip is a quick port of 7z.exe and 7za.exe (command line version of 7zip, see www.7-zip.org) for Unix" + license = ("LGPL-2.1", "Unrar") + homepage = "https://sourceforge.net/projects/p7zip/" + topics = ("7zip", "zip", "compression", "decompression") + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + + def validate(self): + if self.info.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows - use `7zip` instead") + if self.info.settings.arch not in ("armv8", "x86_64"): + raise ConanInvalidConfiguration(f"{self.ref} is only supported by x86_64 and armv8") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + + def _patch_compiler(self): + optflags = '' + if is_apple_os(self): + optflags = '-arch ' + to_apple_arch(self) + cc = "clang" if "clang" in str(self.settings.compiler) else str(self.settings.compiler) + cxx = "clang++" if "clang" in str(self.settings.compiler) else str(self.settings.compiler) + if self.settings.compiler == "gcc": + cxx = "g++" + # Replace the hard-coded compilers instead of using the 40 different Makefile permutations + replace_in_file(self, os.path.join(self.source_folder, "makefile.machine"), + "CC=gcc", f"CC={cc}") + replace_in_file(self, os.path.join(self.source_folder, "makefile.machine"), + "CXX=g++", f"CXX={cxx}") + # Manually modify the -O flag here based on the build type + optflags += " -O2" if self.settings.build_type == "Release" else " -O0" + # Silence the warning about `-s` not being valid on clang + if cc != "clang": + optflags += ' -s' + replace_in_file(self, os.path.join(self.source_folder, "makefile.machine"), + "OPTFLAGS=-O -s", "OPTFLAGS=" + optflags) + + def _patch_sources(self): + apply_conandata_patches(self) + self._patch_compiler() + + def build(self): + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make() + + def package(self): + copy(self, "License.txt", src=os.path.join(self.source_folder, "DOC"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "unRarLicense.txt", src=os.path.join(self.source_folder, "DOC"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "7za", src=os.path.join(self.source_folder, "bin"), dst=os.path.join(self.package_folder, "bin")) + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.PATH.append(bin_path) + + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/p7zip/all/patches/06-CVE-2018-5996.patch b/recipes/p7zip/all/patches/06-CVE-2018-5996.patch new file mode 100644 index 0000000000000..6733bff918956 --- /dev/null +++ b/recipes/p7zip/all/patches/06-CVE-2018-5996.patch @@ -0,0 +1,221 @@ +From: Robert Luberda +Date: Sun, 28 Jan 2018 23:47:40 +0100 +Subject: CVE-2018-5996 + +Hopefully fix Memory Corruptions via RAR PPMd (CVE-2018-5996) by +applying a few changes from 7Zip 18.00-beta. + +Bug-Debian: https://bugs.debian.org/#888314 +--- + CPP/7zip/Compress/Rar1Decoder.cpp | 13 +++++++++---- + CPP/7zip/Compress/Rar1Decoder.h | 1 + + CPP/7zip/Compress/Rar2Decoder.cpp | 10 +++++++++- + CPP/7zip/Compress/Rar2Decoder.h | 1 + + CPP/7zip/Compress/Rar3Decoder.cpp | 23 ++++++++++++++++++++--- + CPP/7zip/Compress/Rar3Decoder.h | 2 ++ + 6 files changed, 42 insertions(+), 8 deletions(-) + +diff --git a/CPP/7zip/Compress/Rar1Decoder.cpp b/CPP/7zip/Compress/Rar1Decoder.cpp +index 1aaedcc..68030c7 100644 +--- a/CPP/7zip/Compress/Rar1Decoder.cpp ++++ b/CPP/7zip/Compress/Rar1Decoder.cpp +@@ -29,7 +29,7 @@ public: + }; + */ + +-CDecoder::CDecoder(): m_IsSolid(false) { } ++CDecoder::CDecoder(): m_IsSolid(false), _errorMode(false) { } + + void CDecoder::InitStructures() + { +@@ -406,9 +406,14 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + InitData(); + if (!m_IsSolid) + { ++ _errorMode = false; + InitStructures(); + InitHuff(); + } ++ ++ if (_errorMode) ++ return S_FALSE; ++ + if (m_UnpackSize > 0) + { + GetFlagsBuf(); +@@ -477,9 +482,9 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream + const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress) + { + try { return CodeReal(inStream, outStream, inSize, outSize, progress); } +- catch(const CInBufferException &e) { return e.ErrorCode; } +- catch(const CLzOutWindowException &e) { return e.ErrorCode; } +- catch(...) { return S_FALSE; } ++ catch(const CInBufferException &e) { _errorMode = true; return e.ErrorCode; } ++ catch(const CLzOutWindowException &e) { _errorMode = true; return e.ErrorCode; } ++ catch(...) { _errorMode = true; return S_FALSE; } + } + + STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) +diff --git a/CPP/7zip/Compress/Rar1Decoder.h b/CPP/7zip/Compress/Rar1Decoder.h +index 630f089..01b606b 100644 +--- a/CPP/7zip/Compress/Rar1Decoder.h ++++ b/CPP/7zip/Compress/Rar1Decoder.h +@@ -39,6 +39,7 @@ public: + + Int64 m_UnpackSize; + bool m_IsSolid; ++ bool _errorMode; + + UInt32 ReadBits(int numBits); + HRESULT CopyBlock(UInt32 distance, UInt32 len); +diff --git a/CPP/7zip/Compress/Rar2Decoder.cpp b/CPP/7zip/Compress/Rar2Decoder.cpp +index b3f2b4b..0580c8d 100644 +--- a/CPP/7zip/Compress/Rar2Decoder.cpp ++++ b/CPP/7zip/Compress/Rar2Decoder.cpp +@@ -80,7 +80,8 @@ static const UInt32 kHistorySize = 1 << 20; + static const UInt32 kWindowReservSize = (1 << 22) + 256; + + CDecoder::CDecoder(): +- m_IsSolid(false) ++ m_IsSolid(false), ++ m_TablesOK(false) + { + } + +@@ -100,6 +101,8 @@ UInt32 CDecoder::ReadBits(unsigned numBits) { return m_InBitStream.ReadBits(numB + + bool CDecoder::ReadTables(void) + { ++ m_TablesOK = false; ++ + Byte levelLevels[kLevelTableSize]; + Byte newLevels[kMaxTableSize]; + m_AudioMode = (ReadBits(1) == 1); +@@ -170,6 +173,8 @@ bool CDecoder::ReadTables(void) + } + + memcpy(m_LastLevels, newLevels, kMaxTableSize); ++ m_TablesOK = true; ++ + return true; + } + +@@ -344,6 +349,9 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + return S_FALSE; + } + ++ if (!m_TablesOK) ++ return S_FALSE; ++ + UInt64 startPos = m_OutWindowStream.GetProcessedSize(); + while (pos < unPackSize) + { +diff --git a/CPP/7zip/Compress/Rar2Decoder.h b/CPP/7zip/Compress/Rar2Decoder.h +index 3a0535c..0e9005f 100644 +--- a/CPP/7zip/Compress/Rar2Decoder.h ++++ b/CPP/7zip/Compress/Rar2Decoder.h +@@ -139,6 +139,7 @@ class CDecoder : + + UInt64 m_PackSize; + bool m_IsSolid; ++ bool m_TablesOK; + + void InitStructures(); + UInt32 ReadBits(unsigned numBits); +diff --git a/CPP/7zip/Compress/Rar3Decoder.cpp b/CPP/7zip/Compress/Rar3Decoder.cpp +index 3bf2513..6cb8a6a 100644 +--- a/CPP/7zip/Compress/Rar3Decoder.cpp ++++ b/CPP/7zip/Compress/Rar3Decoder.cpp +@@ -92,7 +92,8 @@ CDecoder::CDecoder(): + _writtenFileSize(0), + _vmData(0), + _vmCode(0), +- m_IsSolid(false) ++ m_IsSolid(false), ++ _errorMode(false) + { + Ppmd7_Construct(&_ppmd); + } +@@ -545,6 +546,9 @@ HRESULT CDecoder::ReadTables(bool &keepDecompressing) + return InitPPM(); + } + ++ TablesRead = false; ++ TablesOK = false; ++ + _lzMode = true; + PrevAlignBits = 0; + PrevAlignCount = 0; +@@ -606,6 +610,9 @@ HRESULT CDecoder::ReadTables(bool &keepDecompressing) + } + } + } ++ if (InputEofError()) ++ return S_FALSE; ++ + TablesRead = true; + + // original code has check here: +@@ -623,6 +630,9 @@ HRESULT CDecoder::ReadTables(bool &keepDecompressing) + RIF(m_LenDecoder.Build(&newLevels[kMainTableSize + kDistTableSize + kAlignTableSize])); + + memcpy(m_LastLevels, newLevels, kTablesSizesSum); ++ ++ TablesOK = true; ++ + return S_OK; + } + +@@ -824,7 +834,12 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + PpmEscChar = 2; + PpmError = true; + InitFilters(); ++ _errorMode = false; + } ++ ++ if (_errorMode) ++ return S_FALSE; ++ + if (!m_IsSolid || !TablesRead) + { + bool keepDecompressing; +@@ -838,6 +853,8 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + bool keepDecompressing; + if (_lzMode) + { ++ if (!TablesOK) ++ return S_FALSE; + RINOK(DecodeLZ(keepDecompressing)) + } + else +@@ -901,8 +918,8 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream + _unpackSize = outSize ? *outSize : (UInt64)(Int64)-1; + return CodeReal(progress); + } +- catch(const CInBufferException &e) { return e.ErrorCode; } +- catch(...) { return S_FALSE; } ++ catch(const CInBufferException &e) { _errorMode = true; return e.ErrorCode; } ++ catch(...) { _errorMode = true; return S_FALSE; } + // CNewException is possible here. But probably CNewException is caused + // by error in data stream. + } +diff --git a/CPP/7zip/Compress/Rar3Decoder.h b/CPP/7zip/Compress/Rar3Decoder.h +index c130cec..2f72d7d 100644 +--- a/CPP/7zip/Compress/Rar3Decoder.h ++++ b/CPP/7zip/Compress/Rar3Decoder.h +@@ -192,6 +192,7 @@ class CDecoder: + UInt32 _lastFilter; + + bool m_IsSolid; ++ bool _errorMode; + + bool _lzMode; + bool _unsupportedFilter; +@@ -200,6 +201,7 @@ class CDecoder: + UInt32 PrevAlignCount; + + bool TablesRead; ++ bool TablesOK; + + CPpmd7 _ppmd; + int PpmEscChar; diff --git a/recipes/p7zip/all/patches/12-CVE-2016-9296.patch b/recipes/p7zip/all/patches/12-CVE-2016-9296.patch new file mode 100644 index 0000000000000..42245c92c0aae --- /dev/null +++ b/recipes/p7zip/all/patches/12-CVE-2016-9296.patch @@ -0,0 +1,23 @@ +From: Robert Luberda +Date: Sat, 19 Nov 2016 08:48:08 +0100 +Subject: Fix nullptr dereference (CVE-2016-9296) + +Patch taken from https://sourceforge.net/p/p7zip/bugs/185/ +--- + CPP/7zip/Archive/7z/7zIn.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp +index b0c6b98..7c6dde2 100644 +--- a/CPP/7zip/Archive/7z/7zIn.cpp ++++ b/CPP/7zip/Archive/7z/7zIn.cpp +@@ -1097,7 +1097,8 @@ HRESULT CInArchive::ReadAndDecodePackedStreams( + if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i]) + ThrowIncorrect(); + } +- HeadersSize += folders.PackPositions[folders.NumPackStreams]; ++ if (folders.PackPositions) ++ HeadersSize += folders.PackPositions[folders.NumPackStreams]; + return S_OK; + } + diff --git a/recipes/p7zip/all/patches/13-CVE-2017-17969.patch b/recipes/p7zip/all/patches/13-CVE-2017-17969.patch new file mode 100644 index 0000000000000..a9787c4a90886 --- /dev/null +++ b/recipes/p7zip/all/patches/13-CVE-2017-17969.patch @@ -0,0 +1,35 @@ +From: =?utf-8?q?Antoine_Beaupr=C3=A9?= +Date: Fri, 2 Feb 2018 11:11:41 +0100 +Subject: Heap-based buffer overflow in 7zip/Compress/ShrinkDecoder.cpp + +Origin: vendor, https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7/attachment/CVE-2017-17969.patch +Forwarded: https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/#27d7 +Bug: https://sourceforge.net/p/p7zip/bugs/204/ +Bug-Debian: https://bugs.debian.org/888297 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17969 +Reviewed-by: Salvatore Bonaccorso +Last-Update: 2018-02-01 +Applied-Upstream: 18.00-beta +--- + CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp +index 80b7e67..ca37764 100644 +--- a/CPP/7zip/Compress/ShrinkDecoder.cpp ++++ b/CPP/7zip/Compress/ShrinkDecoder.cpp +@@ -121,8 +121,13 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + { + _stack[i++] = _suffixes[cur]; + cur = _parents[cur]; ++ if (cur >= kNumItems || i >= kNumItems) ++ break; + } +- ++ ++ if (cur >= kNumItems || i >= kNumItems) ++ break; ++ + _stack[i++] = (Byte)cur; + lastChar2 = (Byte)cur; + diff --git a/recipes/p7zip/all/patches/14-Fix-g++-warning.patch b/recipes/p7zip/all/patches/14-Fix-g++-warning.patch new file mode 100644 index 0000000000000..226e239ee990d --- /dev/null +++ b/recipes/p7zip/all/patches/14-Fix-g++-warning.patch @@ -0,0 +1,24 @@ +From: Robert Luberda +Date: Sun, 28 Jan 2018 22:19:13 +0100 +Subject: Fix g++ warning + +Fix for "use of an operand of type 'bool' in 'operator++' +is deprecated [-Wdeprecated]" warning taken from 7zip 18.00.beta +package. +--- + CPP/7zip/Archive/Wim/WimHandler.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CPP/7zip/Archive/Wim/WimHandler.cpp b/CPP/7zip/Archive/Wim/WimHandler.cpp +index 27d3298..4ff5cfe 100644 +--- a/CPP/7zip/Archive/Wim/WimHandler.cpp ++++ b/CPP/7zip/Archive/Wim/WimHandler.cpp +@@ -298,7 +298,7 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) + + AString res; + +- bool numMethods = 0; ++ unsigned numMethods = 0; + for (unsigned i = 0; i < ARRAY_SIZE(k_Methods); i++) + { + if (methodMask & ((UInt32)1 << i)) diff --git a/recipes/p7zip/all/patches/CVE-2018-10115.patch b/recipes/p7zip/all/patches/CVE-2018-10115.patch new file mode 100644 index 0000000000000..7d9c4bf81f000 --- /dev/null +++ b/recipes/p7zip/all/patches/CVE-2018-10115.patch @@ -0,0 +1,311 @@ +From: Robert Luberda +Date: Tue, 29 May 2018 23:59:09 +0200 +Subject: Fix CVE-2018-10115 + +Apply "patch" taken from https://landave.io/files/patch_7zip_CVE-2018-10115.txt + + +Bugs-Debian: https://bugs.debian.org/897674 +--- + CPP/7zip/Compress/Rar1Decoder.cpp | 16 +++++++++++----- + CPP/7zip/Compress/Rar1Decoder.h | 3 ++- + CPP/7zip/Compress/Rar2Decoder.cpp | 17 +++++++++++++---- + CPP/7zip/Compress/Rar2Decoder.h | 3 ++- + CPP/7zip/Compress/Rar3Decoder.cpp | 19 +++++++++++++++---- + CPP/7zip/Compress/Rar3Decoder.h | 3 ++- + CPP/7zip/Compress/Rar5Decoder.cpp | 8 ++++++++ + CPP/7zip/Compress/Rar5Decoder.h | 1 + + 8 files changed, 54 insertions(+), 16 deletions(-) + +diff --git a/CPP/7zip/Compress/Rar1Decoder.cpp b/CPP/7zip/Compress/Rar1Decoder.cpp +index 68030c7..8c890c8 100644 +--- a/CPP/7zip/Compress/Rar1Decoder.cpp ++++ b/CPP/7zip/Compress/Rar1Decoder.cpp +@@ -29,7 +29,7 @@ public: + }; + */ + +-CDecoder::CDecoder(): m_IsSolid(false), _errorMode(false) { } ++CDecoder::CDecoder(): _isSolid(false), _solidAllowed(false), _errorMode(false) { } + + void CDecoder::InitStructures() + { +@@ -345,7 +345,7 @@ void CDecoder::GetFlagsBuf() + + void CDecoder::InitData() + { +- if (!m_IsSolid) ++ if (!_isSolid) + { + AvrPlcB = AvrLn1 = AvrLn2 = AvrLn3 = NumHuf = Buf60 = 0; + AvrPlc = 0x3500; +@@ -391,6 +391,11 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + if (inSize == NULL || outSize == NULL) + return E_INVALIDARG; + ++ if (_isSolid && !_solidAllowed) ++ return S_FALSE; ++ ++ _solidAllowed = false; ++ + if (!m_OutWindowStream.Create(kHistorySize)) + return E_OUTOFMEMORY; + if (!m_InBitStream.Create(1 << 20)) +@@ -398,13 +403,13 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + + m_UnpackSize = (Int64)*outSize; + m_OutWindowStream.SetStream(outStream); +- m_OutWindowStream.Init(m_IsSolid); ++ m_OutWindowStream.Init(_isSolid); + m_InBitStream.SetStream(inStream); + m_InBitStream.Init(); + + // CCoderReleaser coderReleaser(this); + InitData(); +- if (!m_IsSolid) ++ if (!_isSolid) + { + _errorMode = false; + InitStructures(); +@@ -475,6 +480,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + } + if (m_UnpackSize < 0) + return S_FALSE; ++ _solidAllowed = true; + return m_OutWindowStream.Flush(); + } + +@@ -491,7 +497,7 @@ STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) + { + if (size < 1) + return E_INVALIDARG; +- m_IsSolid = ((data[0] & 1) != 0); ++ _isSolid = ((data[0] & 1) != 0); + return S_OK; + } + +diff --git a/CPP/7zip/Compress/Rar1Decoder.h b/CPP/7zip/Compress/Rar1Decoder.h +index 01b606b..8abb3a3 100644 +--- a/CPP/7zip/Compress/Rar1Decoder.h ++++ b/CPP/7zip/Compress/Rar1Decoder.h +@@ -38,7 +38,8 @@ public: + UInt32 LastLength; + + Int64 m_UnpackSize; +- bool m_IsSolid; ++ bool _isSolid; ++ bool _solidAllowed; + bool _errorMode; + + UInt32 ReadBits(int numBits); +diff --git a/CPP/7zip/Compress/Rar2Decoder.cpp b/CPP/7zip/Compress/Rar2Decoder.cpp +index 0580c8d..be8d842 100644 +--- a/CPP/7zip/Compress/Rar2Decoder.cpp ++++ b/CPP/7zip/Compress/Rar2Decoder.cpp +@@ -80,7 +80,8 @@ static const UInt32 kHistorySize = 1 << 20; + static const UInt32 kWindowReservSize = (1 << 22) + 256; + + CDecoder::CDecoder(): +- m_IsSolid(false), ++ _isSolid(false), ++ _solidAllowed(false), + m_TablesOK(false) + { + } +@@ -320,6 +321,10 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + if (inSize == NULL || outSize == NULL) + return E_INVALIDARG; + ++ if (_isSolid && !_solidAllowed) ++ return S_FALSE; ++ _solidAllowed = false; ++ + if (!m_OutWindowStream.Create(kHistorySize)) + return E_OUTOFMEMORY; + if (!m_InBitStream.Create(1 << 20)) +@@ -330,12 +335,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + UInt64 pos = 0, unPackSize = *outSize; + + m_OutWindowStream.SetStream(outStream); +- m_OutWindowStream.Init(m_IsSolid); ++ m_OutWindowStream.Init(_isSolid); + m_InBitStream.SetStream(inStream); + m_InBitStream.Init(); + + // CCoderReleaser coderReleaser(this); +- if (!m_IsSolid) ++ if (!_isSolid) + { + InitStructures(); + if (unPackSize == 0) +@@ -343,6 +348,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + if (m_InBitStream.GetProcessedSize() + 2 <= m_PackSize) // test it: probably incorrect; + if (!ReadTables()) + return S_FALSE; ++ _solidAllowed = true; + return S_OK; + } + if (!ReadTables()) +@@ -386,6 +392,9 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + + if (!ReadLastTables()) + return S_FALSE; ++ ++ _solidAllowed = true; ++ + return m_OutWindowStream.Flush(); + } + +@@ -402,7 +411,7 @@ STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) + { + if (size < 1) + return E_INVALIDARG; +- m_IsSolid = ((data[0] & 1) != 0); ++ _isSolid = ((data[0] & 1) != 0); + return S_OK; + } + +diff --git a/CPP/7zip/Compress/Rar2Decoder.h b/CPP/7zip/Compress/Rar2Decoder.h +index 0e9005f..370bce2 100644 +--- a/CPP/7zip/Compress/Rar2Decoder.h ++++ b/CPP/7zip/Compress/Rar2Decoder.h +@@ -138,7 +138,8 @@ class CDecoder : + Byte m_LastLevels[kMaxTableSize]; + + UInt64 m_PackSize; +- bool m_IsSolid; ++ bool _isSolid; ++ bool _solidAllowed; + bool m_TablesOK; + + void InitStructures(); +diff --git a/CPP/7zip/Compress/Rar3Decoder.cpp b/CPP/7zip/Compress/Rar3Decoder.cpp +index 6cb8a6a..7b85833 100644 +--- a/CPP/7zip/Compress/Rar3Decoder.cpp ++++ b/CPP/7zip/Compress/Rar3Decoder.cpp +@@ -92,7 +92,8 @@ CDecoder::CDecoder(): + _writtenFileSize(0), + _vmData(0), + _vmCode(0), +- m_IsSolid(false), ++ _isSolid(false), ++ _solidAllowed(false), + _errorMode(false) + { + Ppmd7_Construct(&_ppmd); +@@ -821,7 +822,7 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + { + _writtenFileSize = 0; + _unsupportedFilter = false; +- if (!m_IsSolid) ++ if (!_isSolid) + { + _lzSize = 0; + _winPos = 0; +@@ -840,12 +841,15 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + if (_errorMode) + return S_FALSE; + +- if (!m_IsSolid || !TablesRead) ++ if (!_isSolid || !TablesRead) + { + bool keepDecompressing; + RINOK(ReadTables(keepDecompressing)); + if (!keepDecompressing) ++ { ++ _solidAllowed = true; + return S_OK; ++ } + } + + for (;;) +@@ -870,6 +874,9 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress) + if (!keepDecompressing) + break; + } ++ ++ _solidAllowed = true; ++ + RINOK(WriteBuf()); + UInt64 packSize = m_InBitStream.BitDecoder.GetProcessedSize(); + RINOK(progress->SetRatioInfo(&packSize, &_writtenFileSize)); +@@ -890,6 +897,10 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream + if (!inSize) + return E_INVALIDARG; + ++ if (_isSolid && !_solidAllowed) ++ return S_FALSE; ++ _solidAllowed = false; ++ + if (!_vmData) + { + _vmData = (Byte *)::MidAlloc(kVmDataSizeMax + kVmCodeSizeMax); +@@ -928,7 +939,7 @@ STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) + { + if (size < 1) + return E_INVALIDARG; +- m_IsSolid = ((data[0] & 1) != 0); ++ _isSolid = ((data[0] & 1) != 0); + return S_OK; + } + +diff --git a/CPP/7zip/Compress/Rar3Decoder.h b/CPP/7zip/Compress/Rar3Decoder.h +index 2f72d7d..32c8943 100644 +--- a/CPP/7zip/Compress/Rar3Decoder.h ++++ b/CPP/7zip/Compress/Rar3Decoder.h +@@ -191,7 +191,8 @@ class CDecoder: + CRecordVector _tempFilters; + UInt32 _lastFilter; + +- bool m_IsSolid; ++ bool _isSolid; ++ bool _solidAllowed; + bool _errorMode; + + bool _lzMode; +diff --git a/CPP/7zip/Compress/Rar5Decoder.cpp b/CPP/7zip/Compress/Rar5Decoder.cpp +index dc8830f..a826d5a 100644 +--- a/CPP/7zip/Compress/Rar5Decoder.cpp ++++ b/CPP/7zip/Compress/Rar5Decoder.cpp +@@ -72,6 +72,7 @@ CDecoder::CDecoder(): + _writtenFileSize(0), + _dictSizeLog(0), + _isSolid(false), ++ _solidAllowed(false), + _wasInit(false), + _inputBuf(NULL) + { +@@ -801,7 +802,10 @@ HRESULT CDecoder::CodeReal() + */ + + if (res == S_OK) ++ { ++ _solidAllowed = true; + res = res2; ++ } + + if (res == S_OK && _unpackSize_Defined && _writtenFileSize != _unpackSize) + return S_FALSE; +@@ -821,6 +825,10 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream + { + try + { ++ if (_isSolid && !_solidAllowed) ++ return S_FALSE; ++ _solidAllowed = false; ++ + if (_dictSizeLog >= sizeof(size_t) * 8) + return E_NOTIMPL; + +diff --git a/CPP/7zip/Compress/Rar5Decoder.h b/CPP/7zip/Compress/Rar5Decoder.h +index b0a4dd1..3db5018 100644 +--- a/CPP/7zip/Compress/Rar5Decoder.h ++++ b/CPP/7zip/Compress/Rar5Decoder.h +@@ -271,6 +271,7 @@ class CDecoder: + Byte _dictSizeLog; + bool _tableWasFilled; + bool _isSolid; ++ bool _solidAllowed; + bool _wasInit; + + UInt32 _reps[kNumReps]; diff --git a/recipes/p7zip/all/patches/clang.diff b/recipes/p7zip/all/patches/clang.diff new file mode 100644 index 0000000000000..38056ac99eefe --- /dev/null +++ b/recipes/p7zip/all/patches/clang.diff @@ -0,0 +1,49 @@ +From b6b1782af4aa7f9084d32e4144738dc2535c8d6f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 23 Apr 2018 23:07:21 -0700 +Subject: [PATCH] Fix narrowing errors -Wc++11-narrowing + +Clang 6.x finds these errors + + ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') +[-Wc++11-arrowing] + case E_INVALIDARG : txt = "E_INVALIDARG"; break ; + ^ + +HRESULT causes the macro to be parsed as a signed long, so we need to force it +to be checked as an unsigned long instead. + +also reported here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224930 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + CPP/Windows/ErrorMsg.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/CPP/Windows/ErrorMsg.cpp b/CPP/Windows/ErrorMsg.cpp +index 99684ae..78a64ba 100644 +--- a/CPP/Windows/ErrorMsg.cpp ++++ b/CPP/Windows/ErrorMsg.cpp +@@ -15,13 +15,13 @@ UString MyFormatMessage(DWORD errorCode) + + switch(errorCode) { + case ERROR_NO_MORE_FILES : txt = "No more files"; break ; +- case E_NOTIMPL : txt = "E_NOTIMPL"; break ; +- case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; +- case E_ABORT : txt = "E_ABORT"; break ; +- case E_FAIL : txt = "E_FAIL"; break ; +- case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; +- case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; +- case E_INVALIDARG : txt = "E_INVALIDARG"; break ; ++ case (DWORD) E_NOTIMPL : txt = "E_NOTIMPL"; break ; ++ case (DWORD) E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; ++ case (DWORD) E_ABORT : txt = "E_ABORT"; break ; ++ case (DWORD) E_FAIL : txt = "E_FAIL"; break ; ++ case (DWORD) STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; ++ case (DWORD) E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; ++ case (DWORD) E_INVALIDARG : txt = "E_INVALIDARG"; break ; + case ERROR_DIRECTORY : txt = "Error Directory"; break ; + default: + txt = strerror(errorCode); diff --git a/recipes/p7zip/all/test_package/conanfile.py b/recipes/p7zip/all/test_package/conanfile.py new file mode 100644 index 0000000000000..45e5a32aba828 --- /dev/null +++ b/recipes/p7zip/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("7za", env="conanrun") diff --git a/recipes/p7zip/all/test_v1_package/conanfile.py b/recipes/p7zip/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..58d9c6f21e0ce --- /dev/null +++ b/recipes/p7zip/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("7za", run_environment=True) diff --git a/recipes/p7zip/config.yml b/recipes/p7zip/config.yml new file mode 100644 index 0000000000000..cd6dd6982cb15 --- /dev/null +++ b/recipes/p7zip/config.yml @@ -0,0 +1,3 @@ +versions: + "16.02": + folder: "all" From 0cdd4db78658ed51fe258a400acad4e3503f1c49 Mon Sep 17 00:00:00 2001 From: cguentherTUChemnitz Date: Fri, 14 Oct 2022 16:04:47 +0200 Subject: [PATCH 398/561] (#13398) move option config to configure * move option config to configure * add validation for transitive libjpeg option --- recipes/leptonica/all/conanfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index a16caf47de37b..4bdb50093b6ed 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/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 Environment, VirtualBuildEnv from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, save @@ -51,6 +52,8 @@ def config_options(self): del self.options.fPIC def configure(self): + if self.options.with_tiff: + self.options["libtiff"].jpeg = self.options.with_jpeg if self.options.shared: try: del self.options.fPIC @@ -81,12 +84,16 @@ def requirements(self): self.requires("libpng/1.6.38") if self.options.with_tiff: self.requires("libtiff/4.4.0") - self.options["libtiff"].jpeg = self.options.with_jpeg if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_webp: self.requires("libwebp/1.2.4") + def validate(self): + libtiff = self.dependencies["libtiff"] + if libtiff.options.jpeg != self.info.options.with_jpeg: + raise ConanInvalidConfiguration(f"{self.ref} requires option value {self.name}:with_jpeg equal to libtiff:jpeg.") + def build_requirements(self): if self.options.with_webp or self.options.with_openjpeg: self.tool_requires("pkgconf/1.7.4") From df7efc1f0be63f4c725218503fdbf710ee7663fa Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 14 Oct 2022 23:45:53 +0900 Subject: [PATCH 399/561] (#13442) qcbor: add version 1.1 and support conan v2 --- recipes/qcbor/all/CMakeLists.txt | 7 --- recipes/qcbor/all/conandata.yml | 10 ++- recipes/qcbor/all/conanfile.py | 61 ++++++++++--------- .../all/patches/1.1-0001-fix-cmake.patch | 24 ++++++++ recipes/qcbor/all/test_package/CMakeLists.txt | 7 +-- recipes/qcbor/all/test_package/conanfile.py | 19 ++++-- .../qcbor/all/test_v1_package/CMakeLists.txt | 10 +++ .../qcbor/all/test_v1_package/conanfile.py | 17 ++++++ recipes/qcbor/config.yml | 2 + 9 files changed, 110 insertions(+), 47 deletions(-) delete mode 100644 recipes/qcbor/all/CMakeLists.txt create mode 100644 recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch create mode 100644 recipes/qcbor/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qcbor/all/test_v1_package/conanfile.py diff --git a/recipes/qcbor/all/CMakeLists.txt b/recipes/qcbor/all/CMakeLists.txt deleted file mode 100644 index 221b59e4281f8..0000000000000 --- a/recipes/qcbor/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/qcbor/all/conandata.yml b/recipes/qcbor/all/conandata.yml index 61a8ef6901f17..ffeff9a9da5a8 100644 --- a/recipes/qcbor/all/conandata.yml +++ b/recipes/qcbor/all/conandata.yml @@ -1,8 +1,16 @@ sources: + "1.1": + url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.1.tar.gz" + sha256: "1e7e8986bf918eafb11f5373df9b80fd56811d2cd39c7630d8171130802199b6" "1.0": url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.0.tar.gz" sha256: "961a46eb5a599cc040bfce4f4fade4427e046f1748f37ba4ebbc097fb9cdf1d3" patches: + "1.1": + - patch_file: "patches/1.1-0001-fix-cmake.patch" + patch_description: "link mathlib and add installation" + patch_type: "conan" "1.0": - patch_file: "patches/1.0-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "link mathlib and add installation" + patch_type: "conan" diff --git a/recipes/qcbor/all/conanfile.py b/recipes/qcbor/all/conanfile.py index 4bf44f9907f16..17104f105cbf8 100644 --- a/recipes/qcbor/all/conanfile.py +++ b/recipes/qcbor/all/conanfile.py @@ -1,10 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, load, save +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout + import os -import functools import re -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class QCBORConan(ConanFile): name = "qcbor" @@ -22,16 +23,9 @@ class QCBORConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,35 +33,44 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") 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], destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + 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")) # Extract the License/s from README.md to a file - tmp = tools.load(os.path.join(self._source_subfolder, "inc", "qcbor", "qcbor.h")) + tmp = load(self, os.path.join(self.source_folder, "inc", "qcbor", "qcbor.h")) license_contents = re.search("( Copyright.*) =====", tmp, re.DOTALL)[1] - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package_info(self): self.cpp_info.libs = ["qcbor"] diff --git a/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e5969488c2420 --- /dev/null +++ b/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f0b67b9..4b00b8b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,3 +17,19 @@ set(SOURCE + add_library(qcbor ${SOURCE}) + + target_include_directories(qcbor PUBLIC inc) ++ ++set_target_properties(qcbor PROPERTIES ++ WINDOWS_EXPORT_ALL_SYMBOLS ON ++) ++ ++find_library(LIBM m) ++target_link_libraries(qcbor PRIVATE $<$:${LIBM}>) ++ ++include(GNUInstallDirs) ++install(TARGETS qcbor ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ ++install(DIRECTORY "inc/qcbor" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/qcbor/all/test_package/CMakeLists.txt b/recipes/qcbor/all/test_package/CMakeLists.txt index c047a44489253..bc1e8dfcced62 100644 --- a/recipes/qcbor/all/test_package/CMakeLists.txt +++ b/recipes/qcbor/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package C) find_package(qcbor REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} qcbor::qcbor) +target_link_libraries(${PROJECT_NAME} PRIVATE qcbor::qcbor) diff --git a/recipes/qcbor/all/test_package/conanfile.py b/recipes/qcbor/all/test_package/conanfile.py index 38f4483872d47..a9fb96656f203 100644 --- a/recipes/qcbor/all/test_package/conanfile.py +++ b/recipes/qcbor/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", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/qcbor/all/test_v1_package/CMakeLists.txt b/recipes/qcbor/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..03775e81e82e6 --- /dev/null +++ b/recipes/qcbor/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(qcbor REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE qcbor::qcbor) diff --git a/recipes/qcbor/all/test_v1_package/conanfile.py b/recipes/qcbor/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/qcbor/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qcbor/config.yml b/recipes/qcbor/config.yml index edab1ee152d36..cb6ed8aaedec6 100644 --- a/recipes/qcbor/config.yml +++ b/recipes/qcbor/config.yml @@ -1,3 +1,5 @@ versions: + "1.1": + folder: all "1.0": folder: all From bc130578f7ec1f495969f7df72fe70b745723a92 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 14 Oct 2022 17:05:16 +0200 Subject: [PATCH 400/561] (#13445) libelf: conan v2 support --- recipes/libelf/all/CMakeLists.txt | 40 ++--- recipes/libelf/all/conanfile.py | 162 ++++++++++-------- .../libelf/all/test_package/CMakeLists.txt | 7 +- recipes/libelf/all/test_package/conanfile.py | 21 ++- .../libelf/all/test_v1_package/CMakeLists.txt | 10 ++ .../libelf/all/test_v1_package/conanfile.py | 17 ++ 6 files changed, 149 insertions(+), 108 deletions(-) create mode 100644 recipes/libelf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libelf/all/test_v1_package/conanfile.py diff --git a/recipes/libelf/all/CMakeLists.txt b/recipes/libelf/all/CMakeLists.txt index e3e916bf47bb7..272a6d59618a2 100644 --- a/recipes/libelf/all/CMakeLists.txt +++ b/recipes/libelf/all/CMakeLists.txt @@ -1,33 +1,31 @@ cmake_minimum_required(VERSION 3.4) -project(elf C) +project(elf LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(EXISTS "${PROJECT_SOURCE_DIR}/source_subfolder/lib/sys_elf.h.w32") - file(RENAME "${PROJECT_SOURCE_DIR}/source_subfolder/lib/sys_elf.h.w32" "${PROJECT_SOURCE_DIR}/source_subfolder/lib/sys_elf.h") - file(RENAME "${PROJECT_SOURCE_DIR}/source_subfolder/lib/config.h.w32" "${PROJECT_SOURCE_DIR}/source_subfolder/config.h") +if(EXISTS "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32") + file(RENAME "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32" "${LIBELF_SRC_DIR}/lib/sys_elf.h") + file(RENAME "${LIBELF_SRC_DIR}/lib/config.h.w32" "${LIBELF_SRC_DIR}/config.h") endif() -file(GLOB_RECURSE SOURCES "source_subfolder/lib/*.c") -file(GLOB_RECURSE HEADERS "source_subfolder/lib/*.h") +file(GLOB_RECURSE SOURCES "${LIBELF_SRC_DIR}/lib/*.c") +file(GLOB_RECURSE HEADERS "${LIBELF_SRC_DIR}/lib/*.h") add_library(${PROJECT_NAME} ${SOURCES}) -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}") -target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "source_subfolder/lib") +set_target_properties(${PROJECT_NAME} PROPERTIES + PUBLIC_HEADER "${HEADERS}" + WINDOWS_EXPORT_ALL_SYMBOLS TRUE +) +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${LIBELF_SRC_DIR}/lib") target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_MEMCMP=1 HAVE_MEMCPY=1 HAVE_MEMMOVE=1) -if(MSVC AND BUILD_SHARED_LIBS) - set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) -endif() +include(GNUInstallDirs) install(TARGETS ${PROJECT_NAME} - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin - PUBLIC_HEADER DESTINATION include/libelf + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libelf ) -install(FILES "source_subfolder/lib/libelf.h" DESTINATION include) -install(FILES "source_subfolder/lib/gelf.h" DESTINATION include) -install(FILES "source_subfolder/lib/nlist.h" DESTINATION include) +install(FILES "${LIBELF_SRC_DIR}/lib/libelf.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES "${LIBELF_SRC_DIR}/lib/gelf.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES "${LIBELF_SRC_DIR}/lib/nlist.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/libelf/all/conanfile.py b/recipes/libelf/all/conanfile.py index ef3129a271c50..110e1db07df0f 100644 --- a/recipes/libelf/all/conanfile.py +++ b/recipes/libelf/all/conanfile.py @@ -1,11 +1,16 @@ from conan import ConanFile -from conan.tools import files from conan.errors import ConanInvalidConfiguration -from conans import AutoToolsBuildEnvironment, CMake, tools +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path import os import shutil -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" + class LibelfConan(ConanFile): name = "libelf" @@ -14,22 +19,26 @@ class LibelfConan(ConanFile): homepage = "https://directory.fsf.org/wiki/Libelf" license = "LGPL-2.0" topics = ("elf", "fsf", "libelf", "object-file") - exports_sources = "CMakeLists.txt" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - _autotools = None - _cmake = None + exports_sources = "CMakeLists.txt" @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) @property - def _build_subfolder(self): - return "build_subfolder" + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) def config_options(self): if self.settings.os == "Windows": @@ -37,92 +46,93 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") def validate(self): - if self.options.shared and self.settings.os not in ["Linux", "FreeBSD", "Windows"]: + if self.info.options.shared and self.info.settings.os not in ["Linux", "FreeBSD", "Windows"]: raise ConanInvalidConfiguration("libelf can not be built as shared library on non linux/FreeBSD/windows platforms") def build_requirements(self): if self.settings.os != "Windows": - self.build_requires("autoconf/2.71") - self.build_requires("gnu-config/cci.20210814") + self.tool_requires("autoconf/2.71") + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") def source(self): - files.get(self, **self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - 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 _build_cmake(self): - cmake = self._configure_cmake() - cmake.build() - - def _package_cmake(self): - cmake = self._configure_cmake() - cmake.install() - - def _configure_autotools(self): - if self._autotools: - return self._autotools - with files.chdir(self, self._source_subfolder): - self.run("autoreconf -fiv", run_environment=True) - args = ["--enable-shared={}".format("yes" if self.options.shared else "no")] - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.configure(configure_dir=self._source_subfolder, args=args) - return self._autotools - - def _build_autotools(self): - autotools = self._configure_autotools() - autotools.make() - - def _package_autotools(self): - autotools = self._configure_autotools() - autotools.install() - files.rmdir(self, os.path.join(self.package_folder, "share")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "locale")) - if self.settings.os in ["Linux", "FreeBSD"] and self.options.shared: - os.remove(os.path.join(self.package_folder, "lib", "libelf.a")) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - @property - def _user_info_build(self): - # If using the experimental feature with different context for host and - # build, the 'user_info' attributes of the 'build_requires' packages - # will be located into the 'user_info_build' object. In other cases they - # will be located into the 'deps_user_info' object. - return getattr(self, "user_info_build", None) or self.deps_user_info + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.variables["LIBELF_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + # it's required, libelf doesnt seem to understand DESTDIR + f"--prefix={self.package_folder}", + ]) + tc.generate() def build(self): if self.settings.os == "Windows": - self._build_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() else: - files.replace_in_file(self, os.path.join(self._source_subfolder, "lib", "Makefile.in"), + replace_in_file(self, os.path.join(self.source_folder, "lib", "Makefile.in"), "$(LINK_SHLIB)", "$(LINK_SHLIB) $(LDFLAGS)") # libelf sources contains really outdated 'config.sub' and # 'config.guess' files. It not allows to build libelf for armv8 arch. shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, - os.path.join(self._source_subfolder, "config.sub")) + os.path.join(self.source_folder, "config.sub")) shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, - os.path.join(self._source_subfolder, "config.guess")) - self._build_autotools() + os.path.join(self.source_folder, "config.guess")) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING.LIB", dst="licenses", src=self._source_subfolder) + copy(self, "COPYING.LIB", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if self.settings.os == "Windows": - self._package_cmake() + cmake = CMake(self) + cmake.install() else: - self._package_autotools() - files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "lib", "locale")) + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) self.cpp_info.set_property("pkg_config_name", "libelf") - self.cpp_info.includedirs = [os.path.join("include", "libelf"), "include"] + self.cpp_info.libs = ["elf"] + self.cpp_info.includedirs.append(os.path.join("include", "libelf")) diff --git a/recipes/libelf/all/test_package/CMakeLists.txt b/recipes/libelf/all/test_package/CMakeLists.txt index 839dea5c1b963..715677f6fc466 100644 --- a/recipes/libelf/all/test_package/CMakeLists.txt +++ b/recipes/libelf/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(libelf REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libelf::libelf) +target_link_libraries(${PROJECT_NAME} PRIVATE libelf::libelf) diff --git a/recipes/libelf/all/test_package/conanfile.py b/recipes/libelf/all/test_package/conanfile.py index 49a3a66ea5bad..0a6bc68712d90 100644 --- a/recipes/libelf/all/test_package/conanfile.py +++ b/recipes/libelf/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libelf/all/test_v1_package/CMakeLists.txt b/recipes/libelf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c9a51404b0eba --- /dev/null +++ b/recipes/libelf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libelf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libelf::libelf) diff --git a/recipes/libelf/all/test_v1_package/conanfile.py b/recipes/libelf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libelf/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 489c55e04982a14baaeeae7a5344ab5972043bf4 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 14 Oct 2022 17:24:24 +0200 Subject: [PATCH 401/561] (#13450) libtar: conan v2 support --- recipes/libtar/all/conanfile.py | 101 ++++++++++-------- .../libtar/all/test_package/CMakeLists.txt | 7 +- recipes/libtar/all/test_package/conanfile.py | 28 +++-- .../libtar/all/test_v1_package/CMakeLists.txt | 10 ++ .../libtar/all/test_v1_package/conanfile.py | 39 +++++++ 5 files changed, 128 insertions(+), 57 deletions(-) create mode 100644 recipes/libtar/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libtar/all/test_v1_package/conanfile.py diff --git a/recipes/libtar/all/conanfile.py b/recipes/libtar/all/conanfile.py index ee13476b984cb..b6aa8c881a985 100644 --- a/recipes/libtar/all/conanfile.py +++ b/recipes/libtar/all/conanfile.py @@ -1,14 +1,19 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" class LibTarConan(ConanFile): name = "libtar" description = "libtar is a library for manipulating tar files from within C programs." - topics = ("conan", "libtar") + topics = ("libtar", "tar") license = "BSD-3-Clause" homepage = "https://repo.or.cz/libtar.git" url = "https://github.com/conan-io/conan-center-index" @@ -24,76 +29,84 @@ class LibTarConan(ConanFile): "with_zlib": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_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 - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.11") + self.requires("zlib/1.2.12") def validate(self): - if self.settings.os == "Windows": + if self.info.settings.os == "Windows": raise ConanInvalidConfiguration("libtar does not support Windows") def build_requirements(self): - self.build_requires("libtool/2.4.6") + self.tool_requires("libtool/2.4.7") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.libs = [] - conf_args = [ + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ "--with-zlib" if self.options.with_zlib else "--without-zlib", - ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + ]) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") def _patch_sources(self): if self.options.with_zlib: - tools.replace_in_file(os.path.join(self._source_subfolder, "configure.ac"), - "AC_CHECK_LIB([z], [gzread])", - "AC_CHECK_LIB([{}], [gzread])".format(self.deps_cpp_info["zlib"].libs[0])) + replace_in_file( + self, + os.path.join(self.source_folder, "configure.ac"), + "AC_CHECK_LIB([z], [gzread])", + "AC_CHECK_LIB([{}], [gzread])".format(self.dependencies["zlib"].cpp_info.libs[0]), + ) def build(self): self._patch_sources() - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True, win_bash=tools.os_info.is_windows) - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.autoreconf() + # TODO: use fix_apple_shared_install_name(self) instead, once https://github.com/conan-io/conan/issues/12107 fixed + replace_in_file(self, os.path.join(self.source_folder, "configure"), "-install_name \\$rpath/", "-install_name @rpath/") + autotools.configure() autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - - os.unlink(os.path.join(os.path.join(self.package_folder, "lib", "libtar.la"))) - tools.rmdir(os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["tar"] + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.deps_env_info.PATH.append(bin_path) diff --git a/recipes/libtar/all/test_package/CMakeLists.txt b/recipes/libtar/all/test_package/CMakeLists.txt index 3a403dc404b41..be08382306a84 100644 --- a/recipes/libtar/all/test_package/CMakeLists.txt +++ b/recipes/libtar/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(libtar REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libtar::libtar) diff --git a/recipes/libtar/all/test_package/conanfile.py b/recipes/libtar/all/test_package/conanfile.py index c6abbd84ca12f..cdb17258fdda1 100644 --- a/recipes/libtar/all/test_package/conanfile.py +++ b/recipes/libtar/all/test_package/conanfile.py @@ -1,12 +1,22 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.files import load import os import tarfile class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -25,15 +35,15 @@ def test(self): bio.seek(0) f.addfile(tarinfo, bio) - if not tools.cross_building(self): + if can_run(self): if os.path.exists("hello_world"): raise ConanException("file extracted by tar archive should not exist yet") - bin_path = os.path.join("bin", "test_package") - self.run("{} {}".format(bin_path, "test.tar"), run_environment=True) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} test.tar", env="conanrun") if not os.path.exists("hello_world"): raise ConanException("file not extracted") - extracted_text = tools.load("hello_world") + extracted_text = load(self, "hello_world") if extracted_text != "secret text\n": - raise ConanException("File not loaded correctly. Got \"{}\"".format(repr(extracted_text))) + raise ConanException(f"File not loaded correctly. Got \"{repr(extracted_text)}\"") self.run("libtar -t test.tar", run_environment=True) diff --git a/recipes/libtar/all/test_v1_package/CMakeLists.txt b/recipes/libtar/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9fcc6db676fb9 --- /dev/null +++ b/recipes/libtar/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libtar REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libtar::libtar) diff --git a/recipes/libtar/all/test_v1_package/conanfile.py b/recipes/libtar/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ace7da972a9e0 --- /dev/null +++ b/recipes/libtar/all/test_v1_package/conanfile.py @@ -0,0 +1,39 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os +import tarfile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + with tarfile.open("test.tar", "w", format=tarfile.GNU_FORMAT) as f: + import io + bio = io.BytesIO() + bio.write(b"secret text\n") + tarinfo = tarfile.TarInfo("hello_world") + tarinfo.size = bio.tell() + import time + tarinfo.mtime = time.time() + bio.seek(0) + f.addfile(tarinfo, bio) + + if not tools.cross_building(self): + if os.path.exists("hello_world"): + raise ConanException("file extracted by tar archive should not exist yet") + bin_path = os.path.join("bin", "test_package") + self.run(f"{bin_path} test.tar", run_environment=True) + if not os.path.exists("hello_world"): + raise ConanException("file not extracted") + extracted_text = tools.load("hello_world") + if extracted_text != "secret text\n": + raise ConanException(f"File not loaded correctly. Got \"{repr(extracted_text)}\"") + + self.run("libtar -t test.tar", run_environment=True) From 0acba5915c487bd57dd48f263cd19cdb884ea154 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 14 Oct 2022 17:44:43 +0200 Subject: [PATCH 402/561] (#13403) ccfits: conan v2 support * conan v2 support * bump cfitsio * fix cmake_minimum_required() position --- recipes/ccfits/all/CMakeLists.txt | 11 --- recipes/ccfits/all/conandata.yml | 2 - recipes/ccfits/all/conanfile.py | 70 ++++++++++--------- .../0001-adapt-cmakelists-for-conan-2.5.patch | 12 +++- .../0001-adapt-cmakelists-for-conan-2.6.patch | 6 +- .../ccfits/all/test_package/CMakeLists.txt | 7 +- recipes/ccfits/all/test_package/conanfile.py | 19 +++-- .../ccfits/all/test_v1_package/CMakeLists.txt | 10 +++ .../ccfits/all/test_v1_package/conanfile.py | 17 +++++ 9 files changed, 93 insertions(+), 61 deletions(-) delete mode 100644 recipes/ccfits/all/CMakeLists.txt create mode 100644 recipes/ccfits/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ccfits/all/test_v1_package/conanfile.py diff --git a/recipes/ccfits/all/CMakeLists.txt b/recipes/ccfits/all/CMakeLists.txt deleted file mode 100644 index 10b7b1809aebf..0000000000000 --- a/recipes/ccfits/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -if(MSVC AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/ccfits/all/conandata.yml b/recipes/ccfits/all/conandata.yml index e0fedb47c4fbe..010d52b6753b2 100644 --- a/recipes/ccfits/all/conandata.yml +++ b/recipes/ccfits/all/conandata.yml @@ -8,7 +8,5 @@ sources: patches: "2.6": - patch_file: "patches/0001-adapt-cmakelists-for-conan-2.6.patch" - base_path: "source_subfolder" "2.5": - patch_file: "patches/0001-adapt-cmakelists-for-conan-2.5.patch" - base_path: "source_subfolder" diff --git a/recipes/ccfits/all/conanfile.py b/recipes/ccfits/all/conanfile.py index 6a796847c1324..c9d53caa2f748 100644 --- a/recipes/ccfits/all/conanfile.py +++ b/recipes/ccfits/all/conanfile.py @@ -1,6 +1,11 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.scm import Version +import os -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.52.0" class CcfitsConan(ConanFile): @@ -21,17 +26,8 @@ class CcfitsConan(ConanFile): "fPIC": True, } - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,41 +35,47 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("cfitsio/4.0.0") + self.requires("cfitsio/4.1.0") - def validate(self): - if tools.Version(self.version) >= "2.6": + def validate_build(self): + if Version(self.version) >= "2.6": 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) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # Export symbols for msvc shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("License.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): self.cpp_info.set_property("pkg_config_name", "CCfits") self.cpp_info.libs = ["CCfits"] - - # TODO: to remove in conan v2 once pkg_config generator removed - self.cpp_info.names["pkg_config"] = "CCfits" diff --git a/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.5.patch b/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.5.patch index 1a2902b4075b0..76929726440b1 100644 --- a/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.5.patch +++ b/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.5.patch @@ -1,11 +1,19 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -22,8 +22,6 @@ ENDIF() +@@ -1,5 +1,5 @@ ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + PROJECT(CCfits) +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) + + # Allow the developer to select if Dynamic or Static libraries are built + OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +@@ -22,8 +22,7 @@ ENDIF() #add_subdirectory (src) -find_package(CFITSIO REQUIRED) -INCLUDE_DIRECTORIES(${CFITSIO_INCLUDE_DIR}) ++find_package(cfitsio REQUIRED CONFIG) SET (LIB_TYPE STATIC) IF (BUILD_SHARED_LIBS) @@ -14,7 +22,7 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) -TARGET_LINK_LIBRARIES(${LIB_NAME} ${CFITSIO_LIBRARY} -+TARGET_LINK_LIBRARIES(${LIB_NAME} ${CONAN_LIBS} ++TARGET_LINK_LIBRARIES(${LIB_NAME} cfitsio::cfitsio ) SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES diff --git a/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.6.patch b/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.6.patch index 3e9594078cac8..7d13bff3f3252 100644 --- a/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.6.patch +++ b/recipes/ccfits/all/patches/0001-adapt-cmakelists-for-conan-2.6.patch @@ -1,9 +1,9 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,6 @@ ++CMAKE_MINIMUM_REQUIRED(VERSION 3.8) PROJECT(CCfits) -CMAKE_MINIMUM_REQUIRED(VERSION 3.1) -+CMAKE_MINIMUM_REQUIRED(VERSION 3.8) -set (CMAKE_CXX_STANDARD_REQUIRED on) -set (CMAKE_CXX_STANDARD 11) @@ -16,7 +16,7 @@ -find_package(CFITSIO REQUIRED) -INCLUDE_DIRECTORIES(${CFITSIO_INCLUDE_DIR}) -+ ++find_package(cfitsio REQUIRED CONFIG) SET (LIB_TYPE STATIC) IF (BUILD_SHARED_LIBS) @@ -25,7 +25,7 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) -TARGET_LINK_LIBRARIES(${LIB_NAME} ${CFITSIO_LIBRARY} -+TARGET_LINK_LIBRARIES(${LIB_NAME} ${CONAN_LIBS} ++TARGET_LINK_LIBRARIES(${LIB_NAME} cfitsio::cfitsio ) +TARGET_COMPILE_FEATURES(${LIB_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ccfits/all/test_package/CMakeLists.txt b/recipes/ccfits/all/test_package/CMakeLists.txt index 196188113685c..2112b47f62dd2 100644 --- a/recipes/ccfits/all/test_package/CMakeLists.txt +++ b/recipes/ccfits/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(ccfits REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ccfits::ccfits) diff --git a/recipes/ccfits/all/test_package/conanfile.py b/recipes/ccfits/all/test_package/conanfile.py index 5c09494bc67c0..0a6bc68712d90 100644 --- a/recipes/ccfits/all/test_package/conanfile.py +++ b/recipes/ccfits/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ccfits/all/test_v1_package/CMakeLists.txt b/recipes/ccfits/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..20c81e8e8eb12 --- /dev/null +++ b/recipes/ccfits/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ccfits REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ccfits::ccfits) diff --git a/recipes/ccfits/all/test_v1_package/conanfile.py b/recipes/ccfits/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ccfits/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 79e0679ec707fd573499114836de1d51be3aa801 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 14 Oct 2022 18:05:04 +0200 Subject: [PATCH 403/561] (#13459) openssl 1.x: add empty layout & factorize tests of CMake variables * add layout method it's required for downstream recipes reyling on AutotoolsDeps (see https://github.com/conan-io/conan/issues/12106) * factorize tests of CMake variables --- recipes/openssl/1.x.x/conanfile.py | 3 ++ .../openssl/1.x.x/test_package/CMakeLists.txt | 44 +++++++++---------- .../1.x.x/test_v1_package/CMakeLists.txt | 44 +++++++++---------- 3 files changed, 43 insertions(+), 48 deletions(-) diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index c863ef20e15b7..33409d111d88c 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -227,6 +227,9 @@ def configure(self): del self.settings.compiler.libcxx del self.settings.compiler.cppstd + def layout(self): + pass + def requirements(self): if self._full_version < "1.1.0" and self.options.get_safe("no_zlib") == False: self.requires("zlib/1.2.12") diff --git a/recipes/openssl/1.x.x/test_package/CMakeLists.txt b/recipes/openssl/1.x.x/test_package/CMakeLists.txt index 80fb2d894074d..a28cd01bfb09b 100644 --- a/recipes/openssl/1.x.x/test_package/CMakeLists.txt +++ b/recipes/openssl/1.x.x/test_package/CMakeLists.txt @@ -5,30 +5,26 @@ option(OPENSSL_WITH_ZLIB "OpenSSL with zlib support" ON) set(OpenSSL_DEBUG 1) find_package(OpenSSL REQUIRED) -if(NOT DEFINED OPENSSL_FOUND) - message(FATAL_ERROR "variable OPENSSL_FOUND not set") -endif() -if(NOT DEFINED OPENSSL_INCLUDE_DIR) - message(FATAL_ERROR "variable OPENSSL_INCLUDE_DIR not set") -endif() -if(NOT DEFINED OPENSSL_CRYPTO_LIBRARY) - message(FATAL_ERROR "variable OPENSSL_CRYPTO_LIBRARY not set") -endif() -if(NOT DEFINED OPENSSL_CRYPTO_LIBRARIES) - message(FATAL_ERROR "variable OPENSSL_CRYPTO_LIBRARIES not set") -endif() -if(NOT DEFINED OPENSSL_SSL_LIBRARY) - message(FATAL_ERROR "variable OPENSSL_SSL_LIBRARY not set") -endif() -if(NOT DEFINED OPENSSL_SSL_LIBRARIES) - message(FATAL_ERROR "variable OPENSSL_SSL_LIBRARIES not set") -endif() -if(NOT DEFINED OPENSSL_LIBRARIES) - message(FATAL_ERROR "variable OPENSSL_LIBRARIES not set") -endif() -if(NOT DEFINED OPENSSL_VERSION) - message(FATAL_ERROR "variable OPENSSL_VERSION not set") -endif() + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindOpenSSL.html +# are properly defined in conan generators +set(_custom_vars + OPENSSL_FOUND + OPENSSL_INCLUDE_DIR + OPENSSL_CRYPTO_LIBRARY + OPENSSL_CRYPTO_LIBRARIES + OPENSSL_SSL_LIBRARY + OPENSSL_SSL_LIBRARIES + OPENSSL_LIBRARIES + OPENSSL_VERSION +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED _custom_var) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() add_executable(digest digest.c) target_link_libraries(digest OpenSSL::SSL) diff --git a/recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt b/recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt index afde29b3e6bc5..0219031d70429 100644 --- a/recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt +++ b/recipes/openssl/1.x.x/test_v1_package/CMakeLists.txt @@ -8,30 +8,26 @@ option(OPENSSL_WITH_ZLIB "OpenSSL with zlib support" ON) set(OpenSSL_DEBUG 1) find_package(OpenSSL REQUIRED) -if(NOT DEFINED OPENSSL_FOUND) - message(FATAL_ERROR "variable OPENSSL_FOUND not set") -endif() -if(NOT DEFINED OPENSSL_INCLUDE_DIR) - message(FATAL_ERROR "variable OPENSSL_INCLUDE_DIR not set") -endif() -if(NOT DEFINED OPENSSL_CRYPTO_LIBRARY) - message(FATAL_ERROR "variable OPENSSL_CRYPTO_LIBRARY not set") -endif() -if(NOT DEFINED OPENSSL_CRYPTO_LIBRARIES) - message(FATAL_ERROR "variable OPENSSL_CRYPTO_LIBRARIES not set") -endif() -if(NOT DEFINED OPENSSL_SSL_LIBRARY) - message(FATAL_ERROR "variable OPENSSL_SSL_LIBRARY not set") -endif() -if(NOT DEFINED OPENSSL_SSL_LIBRARIES) - message(FATAL_ERROR "variable OPENSSL_SSL_LIBRARIES not set") -endif() -if(NOT DEFINED OPENSSL_LIBRARIES) - message(FATAL_ERROR "variable OPENSSL_LIBRARIES not set") -endif() -if(NOT DEFINED OPENSSL_VERSION) - message(FATAL_ERROR "variable OPENSSL_VERSION not set") -endif() + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindOpenSSL.html +# are properly defined in conan generators +set(_custom_vars + OPENSSL_FOUND + OPENSSL_INCLUDE_DIR + OPENSSL_CRYPTO_LIBRARY + OPENSSL_CRYPTO_LIBRARIES + OPENSSL_SSL_LIBRARY + OPENSSL_SSL_LIBRARIES + OPENSSL_LIBRARIES + OPENSSL_VERSION +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED _custom_var) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() add_executable(digest ../test_package/digest.c) target_link_libraries(digest OpenSSL::SSL) From 76f760405118edf7faeae9986d16cbf6c7b05605 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 14 Oct 2022 18:44:24 +0200 Subject: [PATCH 404/561] (#13399) qt5: bump reqs --- recipes/qt/5.x.x/conanfile.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 4365011d42477..8435569e0775d 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -161,12 +161,12 @@ def build_requirements(self): if self._settings_build.os == "Windows" and self._is_msvc: self.build_requires("jom/1.1.3") if self.options.qtwebengine: - self.build_requires("ninja/1.11.0") + self.build_requires("ninja/1.11.1") self.build_requires("nodejs/16.3.0") self.build_requires("gperf/3.1") # gperf, bison, flex, python >= 2.7.5 & < 3 if self.settings.os != "Windows": - self.build_requires("bison/3.7.6") + self.build_requires("bison/3.8.2") self.build_requires("flex/2.6.4") else: self.build_requires("winflexbison/2.5.24") @@ -362,7 +362,7 @@ def requirements(self): if is_apple_os(self): self.requires("moltenvk/1.1.10") if self.options.with_glib: - self.requires("glib/2.73.3") + self.requires("glib/2.74.0") # if self.options.with_libiconv: # QTBUG-84708 # self.requires("libiconv/1.16")# QTBUG-84708 if self.options.with_doubleconversion and not self.options.multiconfiguration: @@ -374,24 +374,24 @@ def requirements(self): if self.options.get_safe("with_icu", False): self.requires("icu/71.1") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: - self.requires("harfbuzz/5.1.0") + self.requires("harfbuzz/5.3.0") if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: if self.options.with_libjpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.4") else: - self.requires("libjpeg/9d") + self.requires("libjpeg/9e") if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: - self.requires("libpng/1.6.37") + self.requires("libpng/1.6.38") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.39.2") + self.requires("sqlite3/3.39.4") self.options["sqlite3"].enable_column_metadata = True if self.options.get_safe("with_mysql", False): - self.requires("libmysqlclient/8.0.29") + self.requires("libmysqlclient/8.0.30") if self.options.with_pq: - self.requires("libpq/14.2") + self.requires("libpq/14.5") if self.options.with_odbc: if self.settings.os != "Windows": - self.requires("odbc/2.3.9") + self.requires("odbc/2.3.11") if self.options.get_safe("with_openal", False): self.requires("openal/1.22.2") if self.options.get_safe("with_libalsa", False): @@ -404,11 +404,11 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.2") if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: - self.requires("expat/2.4.8") + self.requires("expat/2.4.9") self.requires("opus/1.3.1") - self.requires("xorg-proto/2021.4") + self.requires("xorg-proto/2022.2") self.requires("libxshmfence/1.3") - self.requires("nss/3.77") + self.requires("nss/3.83") self.requires("libdrm/2.4.109") self.requires("egl/system") if self.options.get_safe("with_gstreamer", False): @@ -416,13 +416,13 @@ def requirements(self): if self.options.get_safe("with_pulseaudio", False): self.requires("pulseaudio/14.2") if self.options.with_dbus: - self.requires("dbus/1.12.20") + self.requires("dbus/1.15.2") if self.options.qtwayland: self.requires("wayland/1.21.0") if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: self.requires("krb5/1.18.3") # conan-io/conan-center-index#4102 if self.options.get_safe("with_atspi"): - self.requires("at-spi2-core/2.45.90") + self.requires("at-spi2-core/2.46.0") if self.options.get_safe("with_md4c", False): self.requires("md4c/0.4.8") From e126415a7a6ac0aa915275f9cb88304728ab8c72 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 14 Oct 2022 12:05:21 -0500 Subject: [PATCH 405/561] (#13460) avahi: Small fix in configure method --- recipes/avahi/all/conanfile.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index 7d336892d2337..1bb65f4a2da31 100644 --- a/recipes/avahi/all/conanfile.py +++ b/recipes/avahi/all/conanfile.py @@ -14,7 +14,7 @@ class AvahiConan(ConanFile): # --enable-compat-libdns_sd means that this recipe provides the mdnsresponder compile interface provides = "mdnsresponder" description = "Avahi - Service Discovery for Linux using mDNS/DNS-SD -- compatible with Bonjour" - topics = ("avahi", "Bonjour", "DNS-SD", "mDNS") + topics = ("bonjour", "dns", "dns-sd", "mdns") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lathiat/avahi" license = "LGPL-2.1-only" @@ -45,16 +45,19 @@ def validate(self): raise ConanInvalidConfiguration("Only Linux is supported for this package.") def configure(self): - try: - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - except Exception: - pass if self.options.shared: try: del self.options.fPIC except Exception: pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From 7f9fdc96d54fa22789db98de276e0d3561c40778 Mon Sep 17 00:00:00 2001 From: Mikhail Lappo Date: Fri, 14 Oct 2022 19:25:06 +0200 Subject: [PATCH 406/561] (#13464) (#13463) zlib: Bump to 1.2.13 * (#13463) zlib: Bump to 1.2.13 Especially important to fix CVE 2022 37434 * Rebase Fix-Cmake patch * Fix typo --- recipes/zlib/all/conandata.yml | 20 +-- .../all/patches/1.2.13/0001-Fix-cmake.patch | 118 ++++++++++++++++++ .../patches/{ => 1.2.x}/0001-fix-cmake.patch | 0 .../0002-gzguts-xcode12-compile-fix.patch | 0 .../0003-gzguts-fix-widechar-condition.patch | 0 ...etting-a-gzip-header-extra-field-wit.patch | 0 ...processing-bug-that-dereferences-NUL.patch | 0 recipes/zlib/config.yml | 2 + 8 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch rename recipes/zlib/all/patches/{ => 1.2.x}/0001-fix-cmake.patch (100%) rename recipes/zlib/all/patches/{ => 1.2.x}/0002-gzguts-xcode12-compile-fix.patch (100%) rename recipes/zlib/all/patches/{ => 1.2.x}/0003-gzguts-fix-widechar-condition.patch (100%) rename recipes/zlib/all/patches/{ => 1.2.x}/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch (100%) rename recipes/zlib/all/patches/{ => 1.2.x}/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch (100%) diff --git a/recipes/zlib/all/conandata.yml b/recipes/zlib/all/conandata.yml index d63ae3f0966b2..e2abd8cd4f339 100644 --- a/recipes/zlib/all/conandata.yml +++ b/recipes/zlib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.13": + url: "https://zlib.net/fossils/zlib-1.2.13.tar.gz" + sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" "1.2.12": url: "https://zlib.net/fossils/zlib-1.2.12.tar.gz" sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9" @@ -6,21 +9,24 @@ sources: url: "https://zlib.net/fossils/zlib-1.2.11.tar.gz" sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" patches: + "1.2.13": + - patch_file: "patches/1.2.13/0001-Fix-cmake.patch" + - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" "1.2.12": - - patch_file: "patches/0001-fix-cmake.patch" - - patch_file: "patches/0002-gzguts-xcode12-compile-fix.patch" - - patch_file: "patches/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch" + - patch_file: "patches/1.2.x/0001-fix-cmake.patch" + - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" + - patch_file: "patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch" patch_description: "CVE-2022-37434: Fix a bug when getting a gzip header extra field with inflate()" patch_type: "vulnerability" patch_source: "https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1" sha256: "15e3c177dc2a034a22e02490a97ba5b1719aae3f8129a06c16d727b661d1650f" - - patch_file: "patches/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch" + - patch_file: "patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch" patch_description: "CVE-2022-37434: Fix extra field processing bug that dereferences NULL state->head" patch_type: "vulnerability" patch_source: "https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d" sha256: "cdd69eb3251728b1875c8ecae6427b50aa750b4045ef984ab79b6c07b7e6dd3a" "1.2.11": - - patch_file: "patches/0001-fix-cmake.patch" - - patch_file: "patches/0002-gzguts-xcode12-compile-fix.patch" + - patch_file: "patches/1.2.x/0001-fix-cmake.patch" + - patch_file: "patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch" # https://github.com/madler/zlib/issues/268 - - patch_file: "patches/0003-gzguts-fix-widechar-condition.patch" + - patch_file: "patches/1.2.x/0003-gzguts-fix-widechar-condition.patch" diff --git a/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch b/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch new file mode 100644 index 0000000000000..ede4babb2e94c --- /dev/null +++ b/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch @@ -0,0 +1,118 @@ +From 9a709a43549fbe23ca41eeb450d4c71e3b78c8c4 Mon Sep 17 00:00:00 2001 +From: Mikhail Lappo +Date: Fri, 14 Oct 2022 13:29:56 +0200 +Subject: [PATCH] Fix cmake + +--- + CMakeLists.txt | 33 +++++++++++++++++++++------------ + 1 file changed, 21 insertions(+), 12 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b412dc7..a5284ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.4.4) ++cmake_minimum_required(VERSION 3.0) # it's important to have https://cmake.org/cmake/help/latest/policy/CMP0042.html#policy:CMP0042 + set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) + + project(zlib C) +@@ -57,7 +57,6 @@ endif() + check_include_file(unistd.h Z_HAVE_UNISTD_H) + + if(MSVC) +- set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +@@ -80,7 +79,7 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein + ${ZLIB_PC} @ONLY) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) +-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) ++include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + + + #============================================================================ +@@ -120,7 +119,7 @@ set(ZLIB_SRCS + zutil.c + ) + +-if(NOT MINGW) ++if(MSVC) + set(ZLIB_DLL_SRCS + win32/zlib1.rc # If present will override custom build rule below. + ) +@@ -131,7 +130,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(WIN32 AND NOT MSVC) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -145,12 +144,15 @@ if(MINGW) + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +-endif(MINGW) ++endif() + ++if(BUILD_SHARED_LIBS) + add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) ++else() ++add_library(zlib STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++endif() + + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -163,19 +165,24 @@ if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) + endif() + +-if(UNIX) ++if(MSVC) ++ if(BUILD_SHARED_LIBS) ++ set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) ++ endif() ++else() + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +-elseif(BUILD_SHARED_LIBS AND WIN32) ++endif() ++if(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version +- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") ++ set_target_properties(zlib PROPERTIES PREFIX "" RUNTIME_OUTPUT_NAME "zlib1") + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +@@ -194,6 +201,7 @@ endif() + # Example binaries + #============================================================================ + ++if(0) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) +@@ -211,3 +219,4 @@ if(HAVE_OFF64_T) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() ++endif() +-- +2.24.3 (Apple Git-128) + diff --git a/recipes/zlib/all/patches/0001-fix-cmake.patch b/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch similarity index 100% rename from recipes/zlib/all/patches/0001-fix-cmake.patch rename to recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch diff --git a/recipes/zlib/all/patches/0002-gzguts-xcode12-compile-fix.patch b/recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch similarity index 100% rename from recipes/zlib/all/patches/0002-gzguts-xcode12-compile-fix.patch rename to recipes/zlib/all/patches/1.2.x/0002-gzguts-xcode12-compile-fix.patch diff --git a/recipes/zlib/all/patches/0003-gzguts-fix-widechar-condition.patch b/recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch similarity index 100% rename from recipes/zlib/all/patches/0003-gzguts-fix-widechar-condition.patch rename to recipes/zlib/all/patches/1.2.x/0003-gzguts-fix-widechar-condition.patch diff --git a/recipes/zlib/all/patches/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch b/recipes/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch similarity index 100% rename from recipes/zlib/all/patches/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch rename to recipes/zlib/all/patches/1.2.x/0004-Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch diff --git a/recipes/zlib/all/patches/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch b/recipes/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch similarity index 100% rename from recipes/zlib/all/patches/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch rename to recipes/zlib/all/patches/1.2.x/0005-Fix-extra-field-processing-bug-that-dereferences-NUL.patch diff --git a/recipes/zlib/config.yml b/recipes/zlib/config.yml index a92270f2d870a..351c06f68201f 100644 --- a/recipes/zlib/config.yml +++ b/recipes/zlib/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.13": + folder: all "1.2.12": folder: all "1.2.11": From 1c28d5cd06dfd8aa4a286867b569b675723d816d Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Fri, 14 Oct 2022 18:44:34 +0100 Subject: [PATCH 407/561] (#13283) Pybind11 fix linkage * [pybind11] update to new toolchain * remove old cmakelists * [pybind11] update test packages * [pybind11] fix missing source in v1 test package * [pybind11] use legacy env tools in test package * [pybind] remove win_bash requirement from test package * [pybind11] fix component linkage order * [pybind11] remove reference to unsupported versions * [pybind11] fix include dir * [pybind11] exception handling not needed * Update recipes/pybind11/all/conanfile.py Co-authored-by: Chris Mc * Update recipes/pybind11/all/test_package/conanfile.py Co-authored-by: Chris Mc * [pybind11] fix typo * [pybind11] ensure translation of win32 path in cmake toolchain file Co-authored-by: Chris Mc --- recipes/pybind11/all/CMakeLists.txt | 7 -- recipes/pybind11/all/conanfile.py | 109 +++++++----------- .../pybind11/all/test_package/CMakeLists.txt | 11 -- .../pybind11/all/test_package/conanfile.py | 39 +++++-- .../all/test_v1_package/CMakeLists.txt | 18 +++ .../pybind11/all/test_v1_package/conanfile.py | 27 +++++ 6 files changed, 119 insertions(+), 92 deletions(-) delete mode 100644 recipes/pybind11/all/CMakeLists.txt create mode 100644 recipes/pybind11/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/pybind11/all/test_v1_package/conanfile.py diff --git a/recipes/pybind11/all/CMakeLists.txt b/recipes/pybind11/all/CMakeLists.txt deleted file mode 100644 index 97030501e5bd7..0000000000000 --- a/recipes/pybind11/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/pybind11/all/conanfile.py b/recipes/pybind11/all/conanfile.py index f7a211fab9108..69246023dbb8e 100644 --- a/recipes/pybind11/all/conanfile.py +++ b/recipes/pybind11/all/conanfile.py @@ -1,12 +1,11 @@ -from conans import ConanFile, CMake -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy, replace_in_file -from conan.tools.scm import Version +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy, replace_in_file, rm import os -import functools -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class PyBind11Conan(ConanFile): @@ -16,83 +15,61 @@ class PyBind11Conan(ConanFile): homepage = "https://github.com/pybind/pybind11" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - exports_sources = "CMakeLists.txt" settings = "os", "arch", "compiler", "build_type" - generators = "cmake" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def validate(self): - if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) >= "11.0": - raise ConanInvalidConfiguration("OSX support is bugged. Check https://github.com/pybind/pybind11/issues/3081") + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PYBIND11_INSTALL"] = True + tc.variables["PYBIND11_TEST"] = False + tc.variables["PYBIND11_CMAKECONFIG_INSTALL_DIR"] = "lib/cmake/pybind11" + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): cmake = CMake(self) - cmake.definitions["PYBIND11_INSTALL"] = True - cmake.definitions["PYBIND11_TEST"] = False - cmake.definitions["PYBIND11_CMAKECONFIG_INSTALL_DIR"] = "lib/cmake/pybind11" cmake.configure() - return cmake - - def build(self): - cmake = self._configure_cmake() cmake.build() def package(self): - copy(self, "LICENSE", src=os.path.join(self.source_folder, self._source_subfolder), dst=os.path.join(self.package_folder, "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() for filename in ["pybind11Targets.cmake", "pybind11Config.cmake", "pybind11ConfigVersion.cmake"]: - try: - os.unlink(os.path.join(self.package_folder, "lib", "cmake", "pybind11", filename)) - except: - pass - if Version(self.version) >= "2.6.0": - replace_in_file(self, os.path.join(self.package_folder, "lib", "cmake", "pybind11", "pybind11Common.cmake"), - "if(TARGET pybind11::lto)", - "if(FALSE)") - replace_in_file(self, os.path.join(self.package_folder, "lib", "cmake", "pybind11", "pybind11Common.cmake"), - "add_library(", - "# add_library(") + rm(self, filename, os.path.join(self.package_folder, "lib", "cmake", "pybind11")) + replace_in_file(self, os.path.join(self.package_folder, "lib", "cmake", "pybind11", "pybind11Common.cmake"), + "if(TARGET pybind11::lto)", + "if(FALSE)") + replace_in_file(self, os.path.join(self.package_folder, "lib", "cmake", "pybind11", "pybind11Common.cmake"), + "add_library(", + "# add_library(") def package_id(self): self.info.clear() def package_info(self): cmake_base_path = os.path.join("lib", "cmake", "pybind11") - if Version(self.version) >= "2.6.0": - self.cpp_info.components["main"].set_property("cmake_module_file_name", "pybind11") - self.cpp_info.components["main"].names["cmake_find_package"] = "pybind11" - self.cpp_info.components["main"].builddirs = [cmake_base_path] - cmake_file = os.path.join(cmake_base_path, "pybind11Common.cmake") - self.cpp_info.set_property("cmake_build_modules", [cmake_file]) - for generator in ["cmake_find_package", "cmake_find_package_multi"]: - self.cpp_info.components["main"].build_modules[generator].append(cmake_file) - self.cpp_info.components["headers"].includedirs = [os.path.join("include", "pybind11")] - self.cpp_info.components["headers"].requires = ["main"] - self.cpp_info.components["embed"].requires = ["main"] - self.cpp_info.components["module"].requires = ["main"] - self.cpp_info.components["python_link_helper"].requires = ["main"] - self.cpp_info.components["windows_extras"].requires = ["main"] - self.cpp_info.components["lto"].requires = ["main"] - self.cpp_info.components["thin_lto"].requires = ["main"] - self.cpp_info.components["opt_size"].requires = ["main"] - self.cpp_info.components["python2_no_register"].requires = ["main"] - else: - self.cpp_info.includedirs.append(os.path.join( - self.package_folder, "include", "pybind11")) - - self.cpp_info.builddirs = [cmake_base_path] - - cmake_files = [os.path.join(cmake_base_path, "FindPythonLibsNew.cmake"), - os.path.join(cmake_base_path, "pybind11Tools.cmake")] - self.cpp_info.set_property("cmake_build_modules", cmake_files) - for generator in ["cmake", "cmake_multi", "cmake_find_package", "cmake_find_package_multi"]: - self.cpp_info.build_modules[generator] = cmake_files + self.cpp_info.set_property("cmake_target_name", "pybind11_all_do_not_use") + self.cpp_info.components["headers"].includedirs = ["include"] + self.cpp_info.components["pybind11_"].set_property("cmake_target_name", "pybind11::pybind11") + self.cpp_info.components["pybind11_"].set_property("cmake_module_file_name", "pybind11") + self.cpp_info.components["pybind11_"].names["cmake_find_package"] = "pybind11" + self.cpp_info.components["pybind11_"].builddirs = [cmake_base_path] + self.cpp_info.components["pybind11_"].requires = ["headers"] + cmake_file = os.path.join(cmake_base_path, "pybind11Common.cmake") + self.cpp_info.set_property("cmake_build_modules", [cmake_file]) + for generator in ["cmake_find_package", "cmake_find_package_multi"]: + self.cpp_info.components["pybind11_"].build_modules[generator].append(cmake_file) + self.cpp_info.components["embed"].requires = ["pybind11_"] + self.cpp_info.components["module"].requires = ["pybind11_"] + self.cpp_info.components["python_link_helper"].requires = ["pybind11_"] + self.cpp_info.components["windows_extras"].requires = ["pybind11_"] + self.cpp_info.components["lto"].requires = ["pybind11_"] + self.cpp_info.components["thin_lto"].requires = ["pybind11_"] + self.cpp_info.components["opt_size"].requires = ["pybind11_"] + self.cpp_info.components["python2_no_register"].requires = ["pybind11_"] diff --git a/recipes/pybind11/all/test_package/CMakeLists.txt b/recipes/pybind11/all/test_package/CMakeLists.txt index 7912a22ff7b4f..d142acb135035 100644 --- a/recipes/pybind11/all/test_package/CMakeLists.txt +++ b/recipes/pybind11/all/test_package/CMakeLists.txt @@ -1,16 +1,5 @@ cmake_minimum_required(VERSION 3.4) project(test_package CXX) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_output_dirs_setup() -conan_set_rpath() -conan_set_std() -conan_set_fpic() -conan_check_compiler() -conan_set_libcxx() -conan_set_vs_runtime() - find_package(pybind11 REQUIRED CONFIG) - pybind11_add_module(test_package MODULE test_package.cpp) set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/pybind11/all/test_package/conanfile.py b/recipes/pybind11/all/test_package/conanfile.py index 844a7165c3fbe..a99c05cf3e7c1 100644 --- a/recipes/pybind11/all/test_package/conanfile.py +++ b/recipes/pybind11/all/test_package/conanfile.py @@ -1,16 +1,38 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualRunEnv +from conan.tools.build import can_run +from conan.tools.layout import cmake_layout +from conans.tools import environment_append + import os +from pathlib import PurePath import sys -from platform import python_version class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + toolchain = CMakeToolchain(self) + toolchain.variables["PYTHON_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() + toolchain.generate() + + run = VirtualRunEnv(self) + run.generate() + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) - cmake.definitions["PYTHON_EXECUTABLE"] = self._python_interpreter cmake.configure() cmake.build() @@ -21,7 +43,8 @@ def _python_interpreter(self): return sys.executable def test(self): - if not tools.cross_building(self): - with tools.environment_append({"PYTHONPATH": "lib"}): - self.run("{} {}".format(self._python_interpreter, os.path.join( - self.source_folder, "test.py")), run_environment=True) + if can_run(self): + python_path = os.path.join(self.build_folder, self.cpp.build.libdirs[0]) + with environment_append({"PYTHONPATH": python_path}): + module_path = os.path.join(self.source_folder, "test.py") + self.run(f"{self._python_interpreter} {module_path}", env="conanrun") diff --git a/recipes/pybind11/all/test_v1_package/CMakeLists.txt b/recipes/pybind11/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..3cee2617c4143 --- /dev/null +++ b/recipes/pybind11/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.4) +project(test_package CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_output_dirs_setup() +conan_set_rpath() +conan_set_std() +conan_set_fpic() +conan_check_compiler() +conan_set_libcxx() +conan_set_vs_runtime() + +find_package(Python COMPONENTS Interpreter Development) +find_package(pybind11 REQUIRED CONFIG) + +Python_add_library(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE pybind11::headers) +set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/pybind11/all/test_v1_package/conanfile.py b/recipes/pybind11/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..922ac10548541 --- /dev/null +++ b/recipes/pybind11/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import ConanFile, CMake, tools +import os +import sys +from platform import python_version + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["PYTHON_EXECUTABLE"] = self._python_interpreter + cmake.configure() + cmake.build() + + @property + def _python_interpreter(self): + if getattr(sys, "frozen", False): + return "python" + return sys.executable + + def test(self): + if not tools.cross_building(self): + with tools.environment_append({"PYTHONPATH": "lib"}): + python_module = os.path.join(self.source_folder, "..", "test_package", "test.py") + self.run(f"{self._python_interpreter} {python_module}", run_environment=True) From 2cdd95ab80c1efef574cb9f2a5f1fc60f877f8fe Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 14 Oct 2022 20:04:40 +0200 Subject: [PATCH 408/561] (#13468) nss 3.84 * nss 3.84 * allow gcc < 11 --- recipes/nss/all/conandata.yml | 6 +++--- recipes/nss/all/conanfile.py | 3 --- recipes/nss/config.yml | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/recipes/nss/all/conandata.yml b/recipes/nss/all/conandata.yml index e36371650f732..bca97bee3dfbb 100644 --- a/recipes/nss/all/conandata.yml +++ b/recipes/nss/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.84": + url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_84_RTM/src/nss-3.84.tar.gz" + sha256: "9a387ffe350ff14f001d943f96cc0c064891551d71e1a97a5ddbffe7f1207a25" "3.83": url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_83_RTM/src/nss-3.83.tar.gz" sha256: "ab23ea67f964090b8b73c80a674082571c36e5f4eba92057ac648c9c1def0128" @@ -8,9 +11,6 @@ sources: "3.76.1": url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_76_1_RTM/src/nss-3.76.1.tar.gz" sha256: "e13104c374e2e1d7890d8f6bc18d0f18eb886ed4dbad4144d1c482f2983d232a" - "3.76": - url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_76_RTM/src/nss-3.76.tar.gz" - sha256: "1b8e0310add364d2ade40620cde0f1c37f4f00a6999b2d3e7ea8dacda4aa1630" "3.72": url: "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_72_RTM/src/nss-3.72.tar.gz" sha256: "6ea60a9ff113e493ea2ab25f41ea75a9fbd10af7903f26f703dac8680732d02e" diff --git a/recipes/nss/all/conanfile.py b/recipes/nss/all/conanfile.py index 8eb8f8f823b88..4a063d42abaeb 100644 --- a/recipes/nss/all/conanfile.py +++ b/recipes/nss/all/conanfile.py @@ -63,9 +63,6 @@ def validate(self): raise ConanInvalidConfiguration("NSS cannot link to static sqlite. Please use option sqlite3:shared=True") if self.settings.arch in ["armv8", "armv8.3"] and self.settings.os in ["Macos"]: raise ConanInvalidConfiguration("Macos ARM64 builds not yet supported. Contributions are welcome.") - if Version(self.version) >= "3.83": - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 11: - raise ConanInvalidConfiguration("nss requires at least gcc 11.") if Version(self.version) < "3.74": if self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= 13: raise ConanInvalidConfiguration("nss < 3.74 requires clang < 13 .") diff --git a/recipes/nss/config.yml b/recipes/nss/config.yml index 4dc342831041e..37bd88a3c62e3 100644 --- a/recipes/nss/config.yml +++ b/recipes/nss/config.yml @@ -1,11 +1,11 @@ versions: + "3.84": + folder: all "3.83": folder: all "3.77": folder: all "3.76.1": folder: all - "3.76": - folder: all "3.72": folder: all From 966c99a8ed97978b6c0d8c4e2406483bda671870 Mon Sep 17 00:00:00 2001 From: Mikhail Lappo Date: Fri, 14 Oct 2022 20:24:17 +0200 Subject: [PATCH 409/561] (#13471) (#13469) Protobuf: Add 3.19.6 For mitigation of CVE 2022-3171 Closes #13469 --- recipes/protobuf/all/conandata.yml | 3 +++ recipes/protobuf/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/protobuf/all/conandata.yml b/recipes/protobuf/all/conandata.yml index bf497f2b2f364..317d01e7c0b1c 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -5,6 +5,9 @@ sources: "3.20.0": url: "https://github.com/protocolbuffers/protobuf/archive/v3.20.0.tar.gz" sha256: "b07772d38ab07e55eca4d50f4b53da2d998bb221575c60a4f81100242d4b4889" + "3.19.6": + url: "https://github.com/protocolbuffers/protobuf/archive/v3.19.6.tar.gz" + sha256: "9a301cf94a8ddcb380b901e7aac852780b826595075577bb967004050c835056" "3.19.4": url: "https://github.com/protocolbuffers/protobuf/archive/v3.19.4.tar.gz" sha256: "3bd7828aa5af4b13b99c191e8b1e884ebfa9ad371b0ce264605d347f135d2568" diff --git a/recipes/protobuf/config.yml b/recipes/protobuf/config.yml index ad95acbdb1bfe..374ad6d0a27d2 100644 --- a/recipes/protobuf/config.yml +++ b/recipes/protobuf/config.yml @@ -3,6 +3,8 @@ versions: folder: all "3.20.0": folder: all + "3.19.6": + folder: all "3.19.4": folder: all "3.18.1": From 05a2fa8e96a8d427e139ab334dfc2de1d0ad6532 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 15 Oct 2022 03:45:18 +0900 Subject: [PATCH 410/561] (#13473) aws-c-auth: add version 0.6.17 and support conan v2 * aws-c-auth: add version 0.6.17 and support conan v2 * downgrade aws-c-io --- recipes/aws-c-auth/all/CMakeLists.txt | 7 -- recipes/aws-c-auth/all/conandata.yml | 3 + recipes/aws-c-auth/all/conanfile.py | 77 ++++++++++--------- .../all/test_package/CMakeLists.txt | 5 +- .../aws-c-auth/all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/aws-c-auth/config.yml | 2 + 8 files changed, 91 insertions(+), 52 deletions(-) delete mode 100644 recipes/aws-c-auth/all/CMakeLists.txt create mode 100644 recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-auth/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-auth/all/CMakeLists.txt b/recipes/aws-c-auth/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-c-auth/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-auth/all/conandata.yml b/recipes/aws-c-auth/all/conandata.yml index 4cdcb1f5bef3d..3f6bee7b4b086 100644 --- a/recipes/aws-c-auth/all/conandata.yml +++ b/recipes/aws-c-auth/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.17": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.17.tar.gz" + sha256: "b43678ad3a779c9c7fccf8f931c162eaaf4d5d64d2955ac1fcfd32e538545c0f" "0.6.11": url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.11.tar.gz" sha256: "d8a0d373cf8b0ff148a014ae2ba24c51f2e7a598b5b0cf3a6e64482c1cd37f90" diff --git a/recipes/aws-c-auth/all/conanfile.py b/recipes/aws-c-auth/all/conanfile.py index 3f61c0db81b14..500a62df5407a 100644 --- a/recipes/aws-c-auth/all/conanfile.py +++ b/recipes/aws-c-auth/all/conanfile.py @@ -1,18 +1,19 @@ -from conans import ConanFile, CMake, tools -import os +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -required_conan_version = ">=1.43.0" +import os +required_conan_version = ">=1.47.0" class AwsCAuth(ConanFile): name = "aws-c-auth" description = "C99 library implementation of AWS client-side authentication: standard credentials providers and signing." - topics = ("aws", "amazon", "cloud", "authentication", "credentials", "providers", "signing") + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-auth" - license = "Apache-2.0", - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" + topics = ("aws", "amazon", "cloud", "authentication", "credentials", "providers", "signing") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,51 +24,57 @@ class AwsCAuth(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_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 - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.6.19") + self.requires("aws-c-common/0.8.2") self.requires("aws-c-cal/0.5.13") - self.requires("aws-c-io/0.10.20") - self.requires("aws-c-http/0.6.13") - if tools.Version(self.version) >= "0.6.5": - self.requires("aws-c-sdkutils/0.1.2") + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") + if Version(self.version) >= "0.6.5": + self.requires("aws-c-sdkutils/0.1.3") 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], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "lib", "aws-c-auth")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-auth")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-auth") @@ -88,5 +95,5 @@ def package_info(self): "aws-c-io::aws-c-io-lib", "aws-c-http::aws-c-http-lib" ] - if tools.Version(self.version) >= "0.6.5": + if Version(self.version) >= "0.6.5": self.cpp_info.components["aws-c-auth-lib"].requires.append("aws-c-sdkutils::aws-c-sdkutils-lib") diff --git a/recipes/aws-c-auth/all/test_package/CMakeLists.txt b/recipes/aws-c-auth/all/test_package/CMakeLists.txt index 61133ac41d950..d0c587e8dd59d 100644 --- a/recipes/aws-c-auth/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-auth/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-auth REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-auth) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-auth) diff --git a/recipes/aws-c-auth/all/test_package/conanfile.py b/recipes/aws-c-auth/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/aws-c-auth/all/test_package/conanfile.py +++ b/recipes/aws-c-auth/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..606180fec87bd --- /dev/null +++ b/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-auth REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-auth) diff --git a/recipes/aws-c-auth/all/test_v1_package/conanfile.py b/recipes/aws-c-auth/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-auth/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-auth/config.yml b/recipes/aws-c-auth/config.yml index 17cbddbaa736f..503ab418198f1 100644 --- a/recipes/aws-c-auth/config.yml +++ b/recipes/aws-c-auth/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.17": + folder: all "0.6.11": folder: all "0.6.8": From d5bb680a6c252ca7e98db85e99ec6866b0d21e7a Mon Sep 17 00:00:00 2001 From: friendlyanon <1736896+friendlyanon@users.noreply.github.com> Date: Fri, 14 Oct 2022 21:24:15 +0200 Subject: [PATCH 411/561] (#13476) boost-ext-ut: Use upstream CMake target namespace in 1.1.9 Co-authored-by: friendlyanon --- recipes/boost-ext-ut/all/conanfile.py | 10 ++++++---- recipes/boost-ext-ut/all/test_package/CMakeLists.txt | 7 ++++++- .../boost-ext-ut/all/test_v1_package/CMakeLists.txt | 7 ++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/recipes/boost-ext-ut/all/conanfile.py b/recipes/boost-ext-ut/all/conanfile.py index 4cac41db520ea..bce6579a06de7 100644 --- a/recipes/boost-ext-ut/all/conanfile.py +++ b/recipes/boost-ext-ut/all/conanfile.py @@ -101,17 +101,19 @@ def package_id(self): self.info.clear() def package_info(self): + newer_than_1_1_8 = Version(self.version) > "1.1.8" + namespace = "Boost" if newer_than_1_1_8 else "boost" self.cpp_info.set_property("cmake_file_name", "ut") - self.cpp_info.set_property("cmake_target_name", "boost::ut") + self.cpp_info.set_property("cmake_target_name", f"{namespace}::ut") - self.cpp_info.names["cmake_find_package"] = "boost" - self.cpp_info.names["cmake_find_package_multi"] = "boost" + self.cpp_info.names["cmake_find_package"] = namespace + self.cpp_info.names["cmake_find_package_multi"] = namespace self.cpp_info.filenames["cmake_find_package"] = "ut" self.cpp_info.filenames["cmake_find_package_multi"] = "ut" self.cpp_info.components["ut"].names["cmake_find_package"] = "ut" self.cpp_info.components["ut"].names["cmake_find_package_multi"] = "ut" - if Version(self.version) > "1.1.8": + if newer_than_1_1_8: self.cpp_info.components["ut"].includedirs = [os.path.join("include", "ut-" + self.version, "include")] if self.options.get_safe("disable_module"): diff --git a/recipes/boost-ext-ut/all/test_package/CMakeLists.txt b/recipes/boost-ext-ut/all/test_package/CMakeLists.txt index d07eea68c3c10..1f234990a3bc2 100644 --- a/recipes/boost-ext-ut/all/test_package/CMakeLists.txt +++ b/recipes/boost-ext-ut/all/test_package/CMakeLists.txt @@ -3,6 +3,11 @@ project(test_package LANGUAGES CXX) find_package(ut REQUIRED CONFIG) +set(namespace Boost) +if(ut_VERSION VERSION_LESS "1.1.9") + set(namespace boost) +endif() + add_executable(test_package test_package.cpp) -target_link_libraries(test_package PRIVATE boost::ut) +target_link_libraries(test_package PRIVATE "${namespace}::ut") target_compile_features(test_package PRIVATE cxx_std_20) diff --git a/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt b/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt index b19f5e628f367..b3e2caed93a69 100644 --- a/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt +++ b/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt @@ -6,6 +6,11 @@ conan_basic_setup(TARGETS) find_package(ut REQUIRED CONFIG) +set(namespace Boost) +if(ut_VERSION VERSION_LESS "1.1.9") + set(namespace boost) +endif() + add_executable(test_package ../test_package/test_package.cpp) -target_link_libraries(test_package PRIVATE boost::ut) +target_link_libraries(test_package PRIVATE "${namespace}::ut") target_compile_features(test_package PRIVATE cxx_std_20) From b535c15f050ceb579d4db8b4ef6a16f855a2d0d2 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 15 Oct 2022 04:44:07 +0900 Subject: [PATCH 412/561] (#13477) modern-cpp-kafka: add version 2022.10.12 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/modern-cpp-kafka/all/conandata.yml | 3 +++ recipes/modern-cpp-kafka/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/modern-cpp-kafka/all/conandata.yml b/recipes/modern-cpp-kafka/all/conandata.yml index bc2b322038f8f..6dcb3eaf368bc 100644 --- a/recipes/modern-cpp-kafka/all/conandata.yml +++ b/recipes/modern-cpp-kafka/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2022.10.12": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2022.10.12.tar.gz" + sha256: "f60c6d6328e64a8ae0c3233921078160fc4e42a3484eb823d9918895f5f1b39f" "2022.08.01": url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2022.08.01.tar.gz" sha256: "77998caf50ffcc55c77713571d9ce04a37020ccff7b713d14abad9eb8ceb05b3" diff --git a/recipes/modern-cpp-kafka/config.yml b/recipes/modern-cpp-kafka/config.yml index a56acb8dfd0e1..7826a4cd0db75 100644 --- a/recipes/modern-cpp-kafka/config.yml +++ b/recipes/modern-cpp-kafka/config.yml @@ -1,4 +1,6 @@ versions: + "2022.10.12": + folder: all "2022.08.01": folder: all "2022.06.15": From 5a52fa195382a6e9c8a439d4a81eb831515da838 Mon Sep 17 00:00:00 2001 From: Eric Riff <57375845+ericriff@users.noreply.github.com> Date: Fri, 14 Oct 2022 17:04:05 -0300 Subject: [PATCH 413/561] (#13444) opengv | Extend patch so conan also handles the -march flags --- recipes/opengv/all/conandata.yml | 2 +- ...3-let-conan-handle-shared-fpic-and-marchs.patch} | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) rename recipes/opengv/all/patches/{0003-let-conan-handle-shared-and-fpic.patch => 0003-let-conan-handle-shared-fpic-and-marchs.patch} (55%) diff --git a/recipes/opengv/all/conandata.yml b/recipes/opengv/all/conandata.yml index c763b6fef7e02..4f45e53b7f2aa 100644 --- a/recipes/opengv/all/conandata.yml +++ b/recipes/opengv/all/conandata.yml @@ -10,6 +10,6 @@ patches: - patch_file: "patches/0002-use-conans-eigen.patch" patch_description: "fix call to find_package to use conan provided file" patch_type: "conan" - - patch_file: "patches/0003-let-conan-handle-shared-and-fpic.patch" + - patch_file: "patches/0003-let-conan-handle-shared-fpic-and-marchs.patch" patch_description: "disable some options such that conan manages values" patch_type: "conan" diff --git a/recipes/opengv/all/patches/0003-let-conan-handle-shared-and-fpic.patch b/recipes/opengv/all/patches/0003-let-conan-handle-shared-fpic-and-marchs.patch similarity index 55% rename from recipes/opengv/all/patches/0003-let-conan-handle-shared-and-fpic.patch rename to recipes/opengv/all/patches/0003-let-conan-handle-shared-fpic-and-marchs.patch index f39224cadb138..87de75e13c94d 100644 --- a/recipes/opengv/all/patches/0003-let-conan-handle-shared-and-fpic.patch +++ b/recipes/opengv/all/patches/0003-let-conan-handle-shared-fpic-and-marchs.patch @@ -1,6 +1,6 @@ --- CMakeLists.txt 2020-08-06 09:02:15.000000000 -0300 +++ CMakeLists.txt 2022-10-06 12:39:57.766560501 -0300 -@@ -19,8 +19,8 @@ +@@ -19,16 +19,16 @@ OPTION(BUILD_TESTS "Build tests" ON) OPTION(BUILD_PYTHON "Build Python extension" OFF) @@ -11,3 +11,14 @@ ELSE() OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF) OPTION(BUILD_POSITION_INDEPENDENT_CODE "Build position independent code (-fPIC)" ON) + ENDIF() + +-IF(MSVC) +- add_compile_options(/wd4514 /wd4267 /bigobj) +- add_definitions(-D_USE_MATH_DEFINES) ++IF(1) ++ #add_compile_options(/wd4514 /wd4267 /bigobj) ++ #add_definitions(-D_USE_MATH_DEFINES) + ELSE() + IF (CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(ARM64)|(aarch64)|(AARCH64)") + add_definitions (-march=armv8-a) From dbf9f46286fb44ea7cd4a54ebb5347a63eb3e3f2 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 15 Oct 2022 05:24:08 +0900 Subject: [PATCH 414/561] (#13465) quickjs: add recipe * quickjs: add recipe * add topics * link pthread * use target_include_directories * remove patch versions * drop support MSVC --- recipes/quickjs/all/CMakeLists.txt | 62 +++++++++++++ recipes/quickjs/all/conandata.yml | 4 + recipes/quickjs/all/conanfile.py | 91 +++++++++++++++++++ .../quickjs/all/test_package/CMakeLists.txt | 7 ++ recipes/quickjs/all/test_package/conanfile.py | 26 ++++++ .../quickjs/all/test_package/test_package.c | 9 ++ .../all/test_v1_package/CMakeLists.txt | 10 ++ .../quickjs/all/test_v1_package/conanfile.py | 18 ++++ recipes/quickjs/config.yml | 3 + 9 files changed, 230 insertions(+) create mode 100644 recipes/quickjs/all/CMakeLists.txt create mode 100644 recipes/quickjs/all/conandata.yml create mode 100644 recipes/quickjs/all/conanfile.py create mode 100644 recipes/quickjs/all/test_package/CMakeLists.txt create mode 100644 recipes/quickjs/all/test_package/conanfile.py create mode 100644 recipes/quickjs/all/test_package/test_package.c create mode 100644 recipes/quickjs/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/quickjs/all/test_v1_package/conanfile.py create mode 100644 recipes/quickjs/config.yml diff --git a/recipes/quickjs/all/CMakeLists.txt b/recipes/quickjs/all/CMakeLists.txt new file mode 100644 index 0000000000000..bd4c048f85e13 --- /dev/null +++ b/recipes/quickjs/all/CMakeLists.txt @@ -0,0 +1,62 @@ +cmake_minimum_required(VERSION 3.4) +project(quickjs C) + +option(USE_BIGNUM "Use bignum" ON) +option(DUMP_LEAKS "dump leaks" OFF) + +file(STRINGS ${QUICKJS_SRC_DIR}/VERSION version) +set(cdef CONFIG_VERSION="${version}" _GNU_SOURCE) + +set(QUICKJS_SRC + ${QUICKJS_SRC_DIR}/quickjs.c + ${QUICKJS_SRC_DIR}/libbf.c + ${QUICKJS_SRC_DIR}/libregexp.c + ${QUICKJS_SRC_DIR}/libunicode.c + ${QUICKJS_SRC_DIR}/cutils.c + ${QUICKJS_SRC_DIR}/quickjs-libc.c +) + +set(QUICKJS_INC + ${QUICKJS_SRC_DIR}/cutils.h + ${QUICKJS_SRC_DIR}/libregexp-opcode.h + ${QUICKJS_SRC_DIR}/libregexp.h + ${QUICKJS_SRC_DIR}/libunicode-table.h + ${QUICKJS_SRC_DIR}/libunicode.h + ${QUICKJS_SRC_DIR}/list.h + ${QUICKJS_SRC_DIR}/quickjs-atom.h + ${QUICKJS_SRC_DIR}/quickjs-libc.h + ${QUICKJS_SRC_DIR}/quickjs-opcode.h + ${QUICKJS_SRC_DIR}/quickjs.h + ${QUICKJS_SRC_DIR}/unicode_gen_def.h +) + +if(USE_BIGNUM) + list(APPEND QUICKJS_SRC ${QUICKJS_SRC_DIR}/libbf.c) + list(APPEND QUICKJS_INC ${QUICKJS_SRC_DIR}/libbf.h) +endif() + +add_library(quickjs ${QUICKJS_SRC}) +target_include_directories(quickjs PRIVATE ${QUICKJS_SRC_DIR}) +set_target_properties(quickjs PROPERTIES + PUBLIC_HEADER "${QUICKJS_INC}" + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +find_library(LIBM m) +target_link_libraries(quickjs PRIVATE $<$:${LIBM}>) + +if(DUMP_LEAKS) + target_compile_definitions(quickjs PRIVATE ${cdef} DUMP_LEAKS) +else() + target_compile_definitions(quickjs PRIVATE ${cdef}) +endif() + +include(GNUInstallDirs) + +install( + TARGETS quickjs + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/quickjs +) diff --git a/recipes/quickjs/all/conandata.yml b/recipes/quickjs/all/conandata.yml new file mode 100644 index 0000000000000..b6c326416c7bf --- /dev/null +++ b/recipes/quickjs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2021-03-27": + url: "https://bellard.org/quickjs/quickjs-2021-03-27.tar.xz" + sha256: "a45bface4c3379538dea8533878d694e289330488ea7028b105f72572fe7fe1a" diff --git a/recipes/quickjs/all/conanfile.py b/recipes/quickjs/all/conanfile.py new file mode 100644 index 0000000000000..8e68a544366f1 --- /dev/null +++ b/recipes/quickjs/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.47.0" + +class QuickJSConan(ConanFile): + name = "quickjs" + description = "QuickJS is a small and embeddable Javascript engine." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://bellard.org/quickjs/" + topics = ("Javascript", "embeddable", "ES2020", "asynchronous") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_bignum": [True, False], + "dump_leaks": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_bignum" : True, + "dump_leaks": False, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def validate(self): + # TODO: there are forked repository to support MSVC. (https://github.com/c-smile/quickjspp) + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} can not be built on Visual Studio and msvc.") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["QUICKJS_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["USE_BIGNUM"] = self.options.use_bignum + tc.variables["DUMP_LEAKS"] = self.options.dump_leaks + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["quickjs"] + + if self.options.use_bignum == True: + self.cpp_info.defines.append("CONFIG_BIGNUM") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/quickjs/all/test_package/CMakeLists.txt b/recipes/quickjs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e6ebd1f3afdc4 --- /dev/null +++ b/recipes/quickjs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(test_package C) + +find_package(quickjs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE quickjs::quickjs) diff --git a/recipes/quickjs/all/test_package/conanfile.py b/recipes/quickjs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/quickjs/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/quickjs/all/test_package/test_package.c b/recipes/quickjs/all/test_package/test_package.c new file mode 100644 index 0000000000000..25a64b9418971 --- /dev/null +++ b/recipes/quickjs/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "quickjs/quickjs.h" + +int main() { + struct JSRuntime* rt = JS_NewRuntime(); + + JS_FreeRuntime(rt); + + return 0; +} diff --git a/recipes/quickjs/all/test_v1_package/CMakeLists.txt b/recipes/quickjs/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4c0436c623e76 --- /dev/null +++ b/recipes/quickjs/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.0) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(quickjs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE quickjs::quickjs) diff --git a/recipes/quickjs/all/test_v1_package/conanfile.py b/recipes/quickjs/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/quickjs/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/quickjs/config.yml b/recipes/quickjs/config.yml new file mode 100644 index 0000000000000..4110c6ceb7c0f --- /dev/null +++ b/recipes/quickjs/config.yml @@ -0,0 +1,3 @@ +versions: + "2021-03-27": + folder: "all" From 6d5250d731f7148be27faaf2da7b519af036a805 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 14 Oct 2022 22:44:44 +0200 Subject: [PATCH 415/561] (#13479) frozen: conan v2 support --- recipes/frozen/all/conandata.yml | 16 ++-- recipes/frozen/all/conanfile.py | 76 ++++++++++++------- .../frozen/all/test_package/CMakeLists.txt | 11 ++- recipes/frozen/all/test_package/conanfile.py | 21 +++-- .../frozen/all/test_v1_package/CMakeLists.txt | 11 +++ .../frozen/all/test_v1_package/conanfile.py | 17 +++++ recipes/frozen/config.yml | 4 +- 7 files changed, 106 insertions(+), 50 deletions(-) create mode 100644 recipes/frozen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/frozen/all/test_v1_package/conanfile.py diff --git a/recipes/frozen/all/conandata.yml b/recipes/frozen/all/conandata.yml index 065252f10ae12..4d9b977925cb2 100644 --- a/recipes/frozen/all/conandata.yml +++ b/recipes/frozen/all/conandata.yml @@ -1,10 +1,10 @@ sources: + "1.1.1": + url: "https://github.com/serge-sans-paille/frozen/archive/1.1.1.tar.gz" + sha256: "f7c7075750e8fceeac081e9ef01944f221b36d9725beac8681cbd2838d26be45" + "1.0.1": + url: "https://github.com/serge-sans-paille/frozen/archive/1.0.1.tar.gz" + sha256: "29ab5de4eb6bebfb803cd4bd33e324777488fb035116dab1aea27f9118809d0d" "1.0.0": - url: https://github.com/serge-sans-paille/frozen/archive/1.0.0.tar.gz - sha256: 590440d45dd53c6150b47df86071bba5128055e823ccc8715b363f75fc531269 - "1.0.1": - url: https://github.com/serge-sans-paille/frozen/archive/1.0.1.tar.gz - sha256: 29ab5de4eb6bebfb803cd4bd33e324777488fb035116dab1aea27f9118809d0d - "1.1.1": - url: https://github.com/serge-sans-paille/frozen/archive/1.1.1.tar.gz - sha256: f7c7075750e8fceeac081e9ef01944f221b36d9725beac8681cbd2838d26be45 + url: "https://github.com/serge-sans-paille/frozen/archive/1.0.0.tar.gz" + sha256: "590440d45dd53c6150b47df86071bba5128055e823ccc8715b363f75fc531269" diff --git a/recipes/frozen/all/conanfile.py b/recipes/frozen/all/conanfile.py index 17ac78e40e9cd..e1444fa2a4c65 100644 --- a/recipes/frozen/all/conanfile.py +++ b/recipes/frozen/all/conanfile.py @@ -1,6 +1,13 @@ +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 import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.50.0" + class FrozenConan(ConanFile): name = "frozen" @@ -9,39 +16,52 @@ class FrozenConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" topics = ("gperf", "constexpr", "header-only") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = "compiler" - _source_subfolder = "source_subfolder" - - def configure(self): - minimal_cpp_standard = "14" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { "gcc": "5", "clang": "3.4", "apple-clang": "10", - "Visual Studio": "14" + "Visual Studio": "14", + "msvc": "190", } - compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) - self.output.warn( - "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) - return - version = tools.Version(self.settings.compiler.version) - if version < minimal_version[compiler]: - raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy(pattern="*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "frozen") + self.cpp_info.set_property("cmake_target_name", "frozen::frozen") + self.cpp_info.set_property("cmake_target_aliases", ["frozen::frozen-headers"]) + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/frozen/all/test_package/CMakeLists.txt b/recipes/frozen/all/test_package/CMakeLists.txt index 3300ff7750277..bf59d5df3d910 100644 --- a/recipes/frozen/all/test_package/CMakeLists.txt +++ b/recipes/frozen/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(frozen REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE frozen::frozen) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/frozen/all/test_package/conanfile.py b/recipes/frozen/all/test_package/conanfile.py index 2cdb1d2b3578c..0a6bc68712d90 100644 --- a/recipes/frozen/all/test_package/conanfile.py +++ b/recipes/frozen/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join(self.build_folder, "bin", "test_package") - self.run(command=bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/frozen/all/test_v1_package/CMakeLists.txt b/recipes/frozen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ed695ba529434 --- /dev/null +++ b/recipes/frozen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(frozen REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE frozen::frozen) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/frozen/all/test_v1_package/conanfile.py b/recipes/frozen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/frozen/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/frozen/config.yml b/recipes/frozen/config.yml index 8e89f9a7945c9..9234b604d8ed1 100644 --- a/recipes/frozen/config.yml +++ b/recipes/frozen/config.yml @@ -1,7 +1,7 @@ versions: - "1.0.0": + "1.1.1": folder: all "1.0.1": folder: all - "1.1.1": + "1.0.0": folder: all From 66b2cc0e5f5507e0eec1bf7c96574a74d7b78850 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 14 Oct 2022 23:04:14 +0200 Subject: [PATCH 416/561] (#13480) stc: conan v2 support --- recipes/stc/all/conanfile.py | 37 +++++++++++++------ recipes/stc/all/test_package/CMakeLists.txt | 12 ++---- recipes/stc/all/test_package/conanfile.py | 19 +++++++--- .../stc/all/test_v1_package/CMakeLists.txt | 16 ++++++++ recipes/stc/all/test_v1_package/conanfile.py | 17 +++++++++ 5 files changed, 77 insertions(+), 24 deletions(-) create mode 100644 recipes/stc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/stc/all/test_v1_package/conanfile.py diff --git a/recipes/stc/all/conanfile.py b/recipes/stc/all/conanfile.py index 038a1aa4252eb..77e55502b4e8e 100644 --- a/recipes/stc/all/conanfile.py +++ b/recipes/stc/all/conanfile.py @@ -1,10 +1,18 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -from conans import ConanFile, tools + +required_conan_version = ">=1.50.0" class StcConan(ConanFile): name = "stc" - description = "A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers." + description = ( + "A modern, user friendly, generic, type-safe and fast C99 container " + "library: String, Vector, Sorted and Unordered Map and Set, Deque, " + "Forward List, Smart Pointers, Bitset and Random numbers." + ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tylov/STC" @@ -12,20 +20,27 @@ class StcConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - def package_id(self): - self.info.header_only() + def build(self): + pass def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if self.version == "1.0.0-rc1": - self.copy("*.h", dst="include", src=self._source_subfolder, keep_path=True) + src_include = self.source_folder else: - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include"), keep_path=True) + src_include = os.path.join(self.source_folder, "include") + copy(self, "*.h", src=src_include, dst=os.path.join(self.package_folder, "include")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/stc/all/test_package/CMakeLists.txt b/recipes/stc/all/test_package/CMakeLists.txt index 7546a0f95c244..83d4a89b6f090 100644 --- a/recipes/stc/all/test_package/CMakeLists.txt +++ b/recipes/stc/all/test_package/CMakeLists.txt @@ -1,17 +1,13 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) find_package(stc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} stc::stc) +target_link_libraries(${PROJECT_NAME} PRIVATE stc::stc) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) if(${stc_VERSION} STREQUAL "1.0.0-rc1") target_compile_definitions(${PROJECT_NAME} PRIVATE STC_VERSION=1) elseif(${stc_VERSION} VERSION_GREATER_EQUAL "3.0.0") target_compile_definitions(${PROJECT_NAME} PRIVATE STC_VERSION=3) endif() -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD_REQUIRED ON) diff --git a/recipes/stc/all/test_package/conanfile.py b/recipes/stc/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/stc/all/test_package/conanfile.py +++ b/recipes/stc/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/stc/all/test_v1_package/CMakeLists.txt b/recipes/stc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ec16b767312b6 --- /dev/null +++ b/recipes/stc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(stc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE stc::stc) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) +if(${stc_VERSION} STREQUAL "1.0.0-rc1") + target_compile_definitions(${PROJECT_NAME} PRIVATE STC_VERSION=1) +elseif(${stc_VERSION} VERSION_GREATER_EQUAL "3.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE STC_VERSION=3) +endif() diff --git a/recipes/stc/all/test_v1_package/conanfile.py b/recipes/stc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/stc/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 9611eed8d11752a6b0ac4e1570006c50c64986aa Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 14 Oct 2022 23:24:22 +0200 Subject: [PATCH 417/561] (#13481) sassc: modernize * sassc: modernize also, bump requirements * Update conanfile.py * Update conanfile.py * Update conanfile.py * Update conanfile.py * Apply suggestions from code review Co-authored-by: Uilian Ries * Update recipes/sassc/all/conanfile.py Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/sassc/all/conanfile.py | 51 +++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py index 34bbfc8292e30..b9452a96ffc40 100644 --- a/recipes/sassc/all/conanfile.py +++ b/recipes/sassc/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools, MSBuild -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, replace_in_file, chdir, save +from conan.tools.microsoft import is_msvc +from conans import AutoToolsBuildEnvironment, tools, MSBuild import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class SasscConan(ConanFile): @@ -21,31 +24,30 @@ class SasscConan(ConanFile): def _source_subfolder(self): return "source_subfolder" - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - def config_options(self): del self.settings.compiler.libcxx del self.settings.compiler.cppstd - def configure(self): - if not self._is_msvc and self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + def package_id(self): + del self.info.settings.compiler + + def validate(self): + if not is_msvc(self) and self.info.settings.os not in ["Linux", "FreeBSD", "Macos"]: raise ConanInvalidConfiguration("sassc supports only Linux, FreeBSD, Macos and Windows Visual Studio at this time, contributions are welcomed") def requirements(self): - self.requires("libsass/3.6.4") + self.requires("libsass/3.6.5") def build_requirements(self): - if not self._is_msvc: - self.build_requires("libtool/2.4.6") + if not is_msvc(self): + self.tool_requires("libtool/2.4.7") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def _patch_sources(self): - tools.replace_in_file( + replace_in_file(self, os.path.join(self.build_folder, self._source_subfolder, "win", "sassc.vcxproj"), "$(LIBSASS_DIR)\\win\\libsass.targets", os.path.join(self.build_folder, "conanbuildinfo.props")) @@ -67,18 +69,18 @@ def _build_msbuild(self): def build(self): self._patch_sources() - with tools.chdir(self._source_subfolder): - if self._is_msvc: + with chdir(self, self._source_subfolder): + if is_msvc(self): self._build_msbuild() else: self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True) - tools.save(path="VERSION", content="%s" % self.version) + save(self, path="VERSION", content=f"{self.version}") autotools = self._configure_autotools() autotools.make() def package(self): - with tools.chdir(self._source_subfolder): - if self._is_msvc: + with chdir(self, self._source_subfolder): + if is_msvc(self): self.copy("*.exe", dst="bin", src=os.path.join(self._source_subfolder, "bin"), keep_path=False) else: autotools = self._configure_autotools() @@ -86,6 +88,11 @@ def package(self): self.copy("LICENSE", src=self._source_subfolder, dst="licenses") def package_info(self): - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var with : {}".format(bin_path)) - self.env_info.PATH.append(bin_path) + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + bin_folder = os.path.join(self.package_folder, "bin") + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.PATH.append(bin_folder) From ab18bcf526a46bec1287a788b2c0bd7c3c7ca415 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 15 Oct 2022 06:45:20 +0900 Subject: [PATCH 418/561] (#13483) aws-c-mqtt: add version 0.7.12 and support conan v2 --- recipes/aws-c-mqtt/all/CMakeLists.txt | 7 -- recipes/aws-c-mqtt/all/conandata.yml | 3 + recipes/aws-c-mqtt/all/conanfile.py | 74 +++++++++++-------- .../all/test_package/CMakeLists.txt | 5 +- .../aws-c-mqtt/all/test_package/conanfile.py | 21 ++++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/aws-c-mqtt/config.yml | 2 + 8 files changed, 92 insertions(+), 48 deletions(-) delete mode 100644 recipes/aws-c-mqtt/all/CMakeLists.txt create mode 100644 recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-mqtt/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-mqtt/all/CMakeLists.txt b/recipes/aws-c-mqtt/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-c-mqtt/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-mqtt/all/conandata.yml b/recipes/aws-c-mqtt/all/conandata.yml index 22b006adcd3d9..6240cf10ee0f5 100644 --- a/recipes/aws-c-mqtt/all/conandata.yml +++ b/recipes/aws-c-mqtt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.12": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.12.tar.gz" + sha256: "cf80f1b4f37aa8a6b8698315fae32cbf2bd944b67784f07b5762f392f18e64df" "0.7.10": url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.10.tar.gz" sha256: "95667477e17bc99d49a1d6674d7fb98f9a0379b6966cb2ed4863152e959d9e8f" diff --git a/recipes/aws-c-mqtt/all/conanfile.py b/recipes/aws-c-mqtt/all/conanfile.py index 1e0ca9593f67c..6c335e69cc40c 100644 --- a/recipes/aws-c-mqtt/all/conanfile.py +++ b/recipes/aws-c-mqtt/all/conanfile.py @@ -1,18 +1,24 @@ -from conans import ConanFile, CMake, tools +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 + import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.47.0" class AwsCMQTT(ConanFile): name = "aws-c-mqtt" description = "C99 implementation of the MQTT 3.1.1 specification." - topics = ("aws", "amazon", "cloud", "mqtt") + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-mqtt" - license = "Apache-2.0", - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" + topics = ("aws", "amazon", "cloud", "mqtt") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,49 +29,55 @@ class AwsCMQTT(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_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 - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass def requirements(self): - self.requires("aws-c-common/0.6.19") + self.requires("aws-c-common/0.8.2") self.requires("aws-c-cal/0.5.13") - self.requires("aws-c-io/0.10.20") - self.requires("aws-c-http/0.6.13") + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") + + def layout(self): + cmake_layout(self, src_folder="src") 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], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "lib", "aws-c-mqtt")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-mqtt")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-mqtt") diff --git a/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt b/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt index 721080a47fbac..04c8de77ba626 100644 --- a/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-mqtt REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-mqtt) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-mqtt) diff --git a/recipes/aws-c-mqtt/all/test_package/conanfile.py b/recipes/aws-c-mqtt/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/aws-c-mqtt/all/test_package/conanfile.py +++ b/recipes/aws-c-mqtt/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..610e2350e6503 --- /dev/null +++ b/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-mqtt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-mqtt) diff --git a/recipes/aws-c-mqtt/all/test_v1_package/conanfile.py b/recipes/aws-c-mqtt/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/aws-c-mqtt/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-mqtt/config.yml b/recipes/aws-c-mqtt/config.yml index 92ca5ab76486c..edbab7e67d700 100644 --- a/recipes/aws-c-mqtt/config.yml +++ b/recipes/aws-c-mqtt/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.12": + folder: all "0.7.10": folder: all "0.7.9": From 90dff75f8bce408fe36008237925345ae33f716c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 15 Oct 2022 04:05:13 +0200 Subject: [PATCH 419/561] (#13458) cyrus-sasl: conan v2 support --- recipes/cyrus-sasl/all/conanfile.py | 129 ++++++++++-------- .../all/test_package/CMakeLists.txt | 7 +- .../cyrus-sasl/all/test_package/conanfile.py | 19 ++- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../all/test_v1_package/conanfile.py | 17 +++ 5 files changed, 114 insertions(+), 68 deletions(-) create mode 100644 recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cyrus-sasl/all/test_v1_package/conanfile.py diff --git a/recipes/cyrus-sasl/all/conanfile.py b/recipes/cyrus-sasl/all/conanfile.py index 80693c3331c36..fb33e27dbce9b 100644 --- a/recipes/cyrus-sasl/all/conanfile.py +++ b/recipes/cyrus-sasl/all/conanfile.py @@ -1,10 +1,15 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path import os import shutil -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.51.1" class CyrusSaslConan(ConanFile): @@ -17,7 +22,7 @@ class CyrusSaslConan(ConanFile): "It can be used on the client or server side " "to provide authentication and authorization services." ) - topics = ("SASL", "authentication", "authorization") + topics = ("sasl", "authentication", "authorization") settings = "os", "arch", "compiler", "build_type" options = { @@ -54,8 +59,8 @@ class CyrusSaslConan(ConanFile): } @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) @property def _user_info_build(self): @@ -67,64 +72,60 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_openssl: self.requires("openssl/1.1.1q") if self.options.with_postgresql: - self.requires("libpq/14.2") + self.requires("libpq/14.5") if self.options.with_mysql: - self.requires("libmysqlclient/8.0.29") + self.requires("libmysqlclient/8.0.30") if self.options.with_sqlite3: - self.requires("sqlite3/3.39.2") + self.requires("sqlite3/3.39.4") if self.options.with_gssapi: raise ConanInvalidConfiguration("with_gssapi requires krb5 recipe, not yet available in CCI") self.requires("krb5/1.18.3") def validate(self): - if self.settings.os == "Windows": + if self.info.settings.os == "Windows": raise ConanInvalidConfiguration( "Cyrus SASL package is not compatible with Windows yet." ) def build_requirements(self): - self.build_requires("gnu-config/cci.20210814") + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, - os.path.join(self._source_subfolder, "config", "config.sub")) - shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, - os.path.join(self._source_subfolder, "config", "config.guess")) - - configure = os.path.join(self._source_subfolder, "configure") - # relocatable shared libs on macOS - tools.replace_in_file(configure, "-install_name \\$rpath/", "-install_name @rpath/") - # avoid SIP issues on macOS when dependencies are shared - if tools.is_apple_os(self.settings.os): - libpaths = ":".join(self.deps_cpp_info.lib_paths) - tools.replace_in_file( - configure, - "#! /bin/sh\n", - "#! /bin/sh\nexport DYLD_LIBRARY_PATH={}:$DYLD_LIBRARY_PATH\n".format(libpaths), - ) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" - rootpath = lambda req: tools.unix_path(self.deps_cpp_info[req].rootpath) - rootpath_no = lambda v, req: rootpath(req) if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), + rootpath_no = lambda v, req: unix_path(self, self.dependencies[req].package_folder) if v else "no" + tc.configure_args.extend([ "--disable-sample", "--disable-macos-framework", "--with-dblib=none", @@ -143,33 +144,45 @@ def _configure_autotools(self): "--with-mysql={}".format(rootpath_no(self.options.with_mysql, "libmysqlclient")), "--without-sqlite", "--with-sqlite3={}".format(rootpath_no(self.options.with_sqlite3, "sqlite3")), - ] + ]) if self.options.with_gssapi: - args.append("--with-gss_impl=mit") + tc.configure_args.append("--with-gss_impl=mit") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") - autotools.configure(configure_dir=self._source_subfolder, args=args) - return autotools + def _patch_sources(self): + shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, + os.path.join(self.source_folder, "config", "config.sub")) + shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, + os.path.join(self.source_folder, "config", "config.guess")) + # relocatable executable & shared libs on macOS + replace_in_file(self, os.path.join(self.source_folder, "configure"), "-install_name \\$rpath/", "-install_name @rpath/") def build(self): self._patch_sources() - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="COPYING", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) def package_info(self): self.cpp_info.set_property("pkg_config_name", "libsasl2") self.cpp_info.libs = ["sasl2"] + # TODO: to remove in conan v2 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) - - # TODO: to remove in conan v2 once pkg_config generator removed - self.cpp_info.names["pkg_config"] = "libsasl2" diff --git a/recipes/cyrus-sasl/all/test_package/CMakeLists.txt b/recipes/cyrus-sasl/all/test_package/CMakeLists.txt index 375b2961c4d5f..b50bb405e7050 100644 --- a/recipes/cyrus-sasl/all/test_package/CMakeLists.txt +++ b/recipes/cyrus-sasl/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(cyrus-sasl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} cyrus-sasl::cyrus-sasl) +target_link_libraries(${PROJECT_NAME} PRIVATE cyrus-sasl::cyrus-sasl) diff --git a/recipes/cyrus-sasl/all/test_package/conanfile.py b/recipes/cyrus-sasl/all/test_package/conanfile.py index e0a85886fc12c..0a6bc68712d90 100644 --- a/recipes/cyrus-sasl/all/test_package/conanfile.py +++ b/recipes/cyrus-sasl/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt b/recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ebb000b804fa7 --- /dev/null +++ b/recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cyrus-sasl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cyrus-sasl::cyrus-sasl) diff --git a/recipes/cyrus-sasl/all/test_v1_package/conanfile.py b/recipes/cyrus-sasl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e0a85886fc12c --- /dev/null +++ b/recipes/cyrus-sasl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 5a274d88a9fa3e53f925b83bbf9917a27e5e439a Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 15 Oct 2022 13:03:51 +0900 Subject: [PATCH 420/561] (#13493) daw_json_link: add version 3.1.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/daw_json_link/all/conandata.yml | 3 +++ recipes/daw_json_link/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/daw_json_link/all/conandata.yml b/recipes/daw_json_link/all/conandata.yml index 8866827f93aee..9c2d497ce2b1b 100644 --- a/recipes/daw_json_link/all/conandata.yml +++ b/recipes/daw_json_link/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.0": + url: "https://github.com/beached/daw_json_link/archive/v3.1.0.tar.gz" + sha256: "c1134fed24794cda598306d23d23c393a0df8ee13d0019cae6ed46b939dad190" "3.0.5": url: "https://github.com/beached/daw_json_link/archive/v3.0.5.tar.gz" sha256: "77abe2ca525083d59a1e4e8e9aa1d2633e5382d98a0d5d838cd2379eaf8d7edf" diff --git a/recipes/daw_json_link/config.yml b/recipes/daw_json_link/config.yml index 5a6f25ed87d19..e7355da02f8ab 100644 --- a/recipes/daw_json_link/config.yml +++ b/recipes/daw_json_link/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.0": + folder: "all" "3.0.5": folder: "all" "3.0.4": From 0abf6034987ed44052dc4ea1299dc2d9037ee078 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Sun, 16 Oct 2022 17:14:19 +0200 Subject: [PATCH 421/561] move conf key from tools to user space Applies code-review comments --- recipes/automake/all/conanfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 792151913668e..784a3abf39515 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -143,7 +143,7 @@ def package_info(self): self.env_info.ACLOCAL = str(aclocal_bin) self.buildenv_info.define_path("ACLOCAL", str(aclocal_bin)) - aclocal_bin_conf_key = "tools.automake:aclocal" + aclocal_bin_conf_key = "user.automake:aclocal" self.output.info(f"Defining path to aclocal binary in configuration as `{aclocal_bin_conf_key}` with value: {aclocal_bin}") self.conf_info.define(aclocal_bin_conf_key, str(aclocal_bin)) @@ -152,27 +152,27 @@ def package_info(self): self.env_info.AUTOMAKE = str(automake_bin) self.buildenv_info.define_path("AUTOMAKE", str(automake_bin)) - automake_bin_conf_key = "tools.automake:automake" + automake_bin_conf_key = "user.automake:automake" self.output.info(f"Defining path to automake binary in configuration as `{automake_bin_conf_key}` with value: {automake_bin}") self.conf_info.define(automake_bin_conf_key, str(automake_bin)) compile_bin = automake_dataroot_path.joinpath("compile") self.output.info(f"Define path to `compile` binary in user_info as: {compile_bin}") self.user_info.compile = str(compile_bin) - compile_conf_key = "tools.automake:compile" + compile_conf_key = "user.automake:compile" self.output.info(f"Defining path to `compile` binary in configuration as `{compile_conf_key}` with value: {compile_bin}") self.conf_info.define(compile_conf_key, str(compile_bin)) ar_lib_bin = automake_dataroot_path.joinpath("ar-lib") self.output.info(f"Define path to ar_lib binary in user_info as: {ar_lib_bin}") self.user_info.ar_lib = str(ar_lib_bin) - ar_lib_conf_key = "tools.automake:ar-lib" + ar_lib_conf_key = "user.automake:ar-lib" self.output.info(f"Defining path to ar-lib binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") self.conf_info.define(ar_lib_conf_key, str(ar_lib_bin)) install_sh_bin = automake_dataroot_path.joinpath("install-sh") self.output.info(f"Define path to install_sh binary in user_info as: {install_sh_bin}") self.user_info.install_sh = str(install_sh_bin) - install_sh_conf_key = "tools.automake:install-sh" + install_sh_conf_key = "user.automake:install-sh" self.output.info(f"Defining path to install_sh binary in configuration as `{install_sh_conf_key}` with value: {install_sh_bin}") self.conf_info.define(install_sh_conf_key, str(install_sh_bin)) From 7a780b2cc919dafed6243519407bc4557c4588a8 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Sun, 16 Oct 2022 17:23:43 +0200 Subject: [PATCH 422/561] use *_folder in favor of *_path Applies code-review comments --- recipes/automake/all/conanfile.py | 65 ++++++++++++++++--------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 784a3abf39515..60d978743f1fc 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -1,3 +1,5 @@ +from os import path + from conan import ConanFile from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir @@ -96,7 +98,7 @@ def build(self): apply_conandata_patches(self) if self.settings.os == "Windows": # tracing using m4 on Windows returns Windows paths => use cygpath to convert to unix paths - replace_in_file(self, self.source_path.joinpath("bin", "aclocal.in"), + replace_in_file(self, path.join(self.source_folder, "bin", "aclocal.in"), " $map_traced_defs{$arg1} = $file;", " $file = `cygpath -u $file`;\n" " $file =~ s/^\\s+|\\s+$//g;\n" @@ -110,69 +112,68 @@ def package(self): autotools = Autotools(self) autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) # Need to specify the `DESTDIR` as a Unix path, aware of the subsystem - copy(self, "COPYING*", src=self.source_folder, dst=self.package_path.joinpath("licenses")) - rmdir(self, self.package_path.joinpath("res", "info")) - rmdir(self, self.package_path.joinpath("res", "man")) - rmdir(self, self.package_path.joinpath("res", "doc")) + copy(self, "COPYING*", src=self.source_folder, dst=path.join(self.package_folder, "licenses")) + for sub_path in ("info", "man", "doc"): + rmdir(self, path.join(self.package_folder, "res", sub_path)) def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] - bin_path = self.package_path.joinpath("bin") + bin_path = path.join(self.package_folder, "bin") self.output.info(f"Appending PATH environment variable: {bin_path}") - self.env_info.PATH.append(str(bin_path)) + self.env_info.PATH.append(bin_path) - dataroot_path = self.package_path.joinpath("res") + dataroot_path = path.join(self.package_folder, "res") self.output.info(f"Defining AUTOMAKE_DATADIR environment variable: {dataroot_path}") - self.env_info.AUTOMAKE_DATADIR = str(dataroot_path) - self.buildenv_info.define_path("AUTOMAKE_DATADIR", str(dataroot_path)) + self.env_info.AUTOMAKE_DATADIR = dataroot_path + self.buildenv_info.define_path("AUTOMAKE_DATADIR", dataroot_path) version = Version(self.version) - automake_dataroot_path = dataroot_path.joinpath(f"automake-{version.major}.{version.minor}") + automake_dataroot_path = path.join(dataroot_path, f"automake-{version.major}.{version.minor}") self.output.info(f"Defining AUTOMAKE_LIBDIR environment variable: {automake_dataroot_path}") - self.env_info.AUTOMAKE_LIBDIR = str(automake_dataroot_path) - self.buildenv_info.define_path("AUTOMAKE_LIBDIR", str(automake_dataroot_path)) + self.env_info.AUTOMAKE_LIBDIR = automake_dataroot_path + self.buildenv_info.define_path("AUTOMAKE_LIBDIR", automake_dataroot_path) self.output.info(f"Defining AUTOMAKE_PERLLIBDIR environment variable: {automake_dataroot_path}") - self.env_info.AUTOMAKE_PERLLIBDIR = str(automake_dataroot_path) - self.buildenv_info.define_path("AUTOMAKE_PERLLIBDIR", str(automake_dataroot_path)) + self.env_info.AUTOMAKE_PERLLIBDIR = automake_dataroot_path + self.buildenv_info.define_path("AUTOMAKE_PERLLIBDIR", automake_dataroot_path) - aclocal_bin = bin_path.joinpath("aclocal") + aclocal_bin = path.join(bin_path, "aclocal") self.output.info(f"Defining ACLOCAL environment variable: {aclocal_bin}") - self.env_info.ACLOCAL = str(aclocal_bin) - self.buildenv_info.define_path("ACLOCAL", str(aclocal_bin)) + self.env_info.ACLOCAL = aclocal_bin + self.buildenv_info.define_path("ACLOCAL", aclocal_bin) aclocal_bin_conf_key = "user.automake:aclocal" self.output.info(f"Defining path to aclocal binary in configuration as `{aclocal_bin_conf_key}` with value: {aclocal_bin}") - self.conf_info.define(aclocal_bin_conf_key, str(aclocal_bin)) + self.conf_info.define(aclocal_bin_conf_key, aclocal_bin) - automake_bin = bin_path.joinpath("automake") + automake_bin = path.join(bin_path, "automake") self.output.info(f"Defining AUTOMAKE environment variable: {automake_bin}") - self.env_info.AUTOMAKE = str(automake_bin) - self.buildenv_info.define_path("AUTOMAKE", str(automake_bin)) + self.env_info.AUTOMAKE = automake_bin + self.buildenv_info.define_path("AUTOMAKE", automake_bin) automake_bin_conf_key = "user.automake:automake" self.output.info(f"Defining path to automake binary in configuration as `{automake_bin_conf_key}` with value: {automake_bin}") - self.conf_info.define(automake_bin_conf_key, str(automake_bin)) + self.conf_info.define(automake_bin_conf_key, automake_bin) - compile_bin = automake_dataroot_path.joinpath("compile") + compile_bin = path.join(automake_dataroot_path, "compile") self.output.info(f"Define path to `compile` binary in user_info as: {compile_bin}") - self.user_info.compile = str(compile_bin) + self.user_info.compile = compile_bin compile_conf_key = "user.automake:compile" self.output.info(f"Defining path to `compile` binary in configuration as `{compile_conf_key}` with value: {compile_bin}") - self.conf_info.define(compile_conf_key, str(compile_bin)) + self.conf_info.define(compile_conf_key, compile_bin) - ar_lib_bin = automake_dataroot_path.joinpath("ar-lib") + ar_lib_bin = path.join(automake_dataroot_path, "ar-lib") self.output.info(f"Define path to ar_lib binary in user_info as: {ar_lib_bin}") - self.user_info.ar_lib = str(ar_lib_bin) + self.user_info.ar_lib = ar_lib_bin ar_lib_conf_key = "user.automake:ar-lib" self.output.info(f"Defining path to ar-lib binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") - self.conf_info.define(ar_lib_conf_key, str(ar_lib_bin)) + self.conf_info.define(ar_lib_conf_key, ar_lib_bin) - install_sh_bin = automake_dataroot_path.joinpath("install-sh") + install_sh_bin = path.join(automake_dataroot_path, "install-sh") self.output.info(f"Define path to install_sh binary in user_info as: {install_sh_bin}") - self.user_info.install_sh = str(install_sh_bin) + self.user_info.install_sh = install_sh_bin install_sh_conf_key = "user.automake:install-sh" self.output.info(f"Defining path to install_sh binary in configuration as `{install_sh_conf_key}` with value: {install_sh_bin}") - self.conf_info.define(install_sh_conf_key, str(install_sh_bin)) + self.conf_info.define(install_sh_conf_key, install_sh_bin) From bdfa9addedab256ad1540c5d9af07a685b4afa57 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Sun, 16 Oct 2022 17:27:22 +0200 Subject: [PATCH 423/561] reuse test_package source files Applies code-review comments --- .../automake/all/test_v1_package/Makefile.am | 4 --- .../automake/all/test_v1_package/conanfile.py | 2 +- .../automake/all/test_v1_package/configure.ac | 28 ------------------- recipes/automake/all/test_v1_package/extra.m4 | 14 ---------- .../all/test_v1_package/test_package.cpp | 9 ------ .../all/test_v1_package/test_package_1.c | 7 ----- 6 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 recipes/automake/all/test_v1_package/Makefile.am delete mode 100644 recipes/automake/all/test_v1_package/configure.ac delete mode 100644 recipes/automake/all/test_v1_package/extra.m4 delete mode 100644 recipes/automake/all/test_v1_package/test_package.cpp delete mode 100644 recipes/automake/all/test_v1_package/test_package_1.c diff --git a/recipes/automake/all/test_v1_package/Makefile.am b/recipes/automake/all/test_v1_package/Makefile.am deleted file mode 100644 index 655db7f1876cb..0000000000000 --- a/recipes/automake/all/test_v1_package/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -# @configure_input@ - -bin_PROGRAMS = test_package -test_package_SOURCES = test_package.cpp diff --git a/recipes/automake/all/test_v1_package/conanfile.py b/recipes/automake/all/test_v1_package/conanfile.py index 5f9c7dc93448a..fe1d1e9caebdd 100644 --- a/recipes/automake/all/test_v1_package/conanfile.py +++ b/recipes/automake/all/test_v1_package/conanfile.py @@ -10,7 +10,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" + exports_sources = "../test_package/configure.ac", "../test_package/Makefile.am", "../test_package/test_package_1.c", "../test_package/test_package.cpp" # DON'T COPY extra.m4 TO BUILD FOLDER!!! test_type = "explicit" diff --git a/recipes/automake/all/test_v1_package/configure.ac b/recipes/automake/all/test_v1_package/configure.ac deleted file mode 100644 index 8a7ae1dc34e7f..0000000000000 --- a/recipes/automake/all/test_v1_package/configure.ac +++ /dev/null @@ -1,28 +0,0 @@ -AC_PREREQ([2.69]) -AC_INIT([test_package], [1.0]) -AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) - -# Safety checks in case user overwritten --srcdir -AC_CONFIG_SRCDIR([test_package.cpp]) - -AC_CANONICAL_HOST - -# Test includes of extra including directories using conan -AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) -AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) - -AC_CONFIG_HEADER([config.h]) - -# Check for CC and CXX compiler -AC_PROG_CC -AC_PROG_CXX -## We can add more checks in this section -# -## Tells automake to create a Makefile -## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html -AC_CONFIG_FILES([Makefile]) -# -## Generate the output -AC_OUTPUT -# diff --git a/recipes/automake/all/test_v1_package/extra.m4 b/recipes/automake/all/test_v1_package/extra.m4 deleted file mode 100644 index 69c85f5ac945d..0000000000000 --- a/recipes/automake/all/test_v1_package/extra.m4 +++ /dev/null @@ -1,14 +0,0 @@ -dnl This file contains a macro to test adding extra include dirs using conan - -AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ - m4_define([CONAN_MACRO_VERSION], [1.3]) - m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), - -1, - [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] - ) -])dnl AUTOMAKE_TEST_PACKAGE_PREREQ - -AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ - echo "Hello world from the extra.m4 script!" - echo "My args were: $*" -])dnl diff --git a/recipes/automake/all/test_v1_package/test_package.cpp b/recipes/automake/all/test_v1_package/test_package.cpp deleted file mode 100644 index cd8c2f27c3587..0000000000000 --- a/recipes/automake/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "config.h" - -#include -#include - -int main(int argc, char** argv) { - std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; - return EXIT_SUCCESS; -} diff --git a/recipes/automake/all/test_v1_package/test_package_1.c b/recipes/automake/all/test_v1_package/test_package_1.c deleted file mode 100644 index 9aaff6c18e30d..0000000000000 --- a/recipes/automake/all/test_v1_package/test_package_1.c +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -int main() { - puts("test_package.c says 'Hello World'!\n"); - return EXIT_SUCCESS; -} From 51ca852880fd1e67adea0ae8e808057b66417690 Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Sun, 16 Oct 2022 18:36:27 +0200 Subject: [PATCH 424/561] Reformat windows path --- recipes/automake/all/test_v1_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/automake/all/test_v1_package/conanfile.py b/recipes/automake/all/test_v1_package/conanfile.py index fe1d1e9caebdd..a6e3a0c477acd 100644 --- a/recipes/automake/all/test_v1_package/conanfile.py +++ b/recipes/automake/all/test_v1_package/conanfile.py @@ -67,7 +67,7 @@ def _build_scripts(self): def _build_autotools(self): """Test autoreconf + configure + make""" with tools.environment_append({"AUTOMAKE_CONAN_INCLUDES": [tools.unix_path(self.source_folder)]}): - self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) + self.run("{} -fiv".format(os.environ["AUTORECONF"].replace("\\", "/")), win_bash=tools.os_info.is_windows) self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")), win_bash=tools.os_info.is_windows) autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) with self._build_context(): From b1bfcc051969d635ac42a1b4a1e5e2d673cc3e23 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 17 Oct 2022 04:44:59 +0900 Subject: [PATCH 425/561] (#13528) minizip-ng: add version 3.0.7 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/minizip-ng/all/conandata.yml | 3 +++ recipes/minizip-ng/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/minizip-ng/all/conandata.yml b/recipes/minizip-ng/all/conandata.yml index 8f3820f91e16d..1cfd7b0934043 100644 --- a/recipes/minizip-ng/all/conandata.yml +++ b/recipes/minizip-ng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.7": + url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.7.tar.gz" + sha256: "39981a0db1bb6da504909bce63d7493286c5e50825c056564544c990d15c55cf" "3.0.6": url: "https://github.com/zlib-ng/minizip-ng/archive/3.0.6.tar.gz" sha256: "383fa1bdc28c482828a8a8db53f758dbd44291b641182724fda5df5b59cce543" diff --git a/recipes/minizip-ng/config.yml b/recipes/minizip-ng/config.yml index ab9b917838ae4..60ae0e8c451f8 100644 --- a/recipes/minizip-ng/config.yml +++ b/recipes/minizip-ng/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.7": + folder: all "3.0.6": folder: all "3.0.5": From db07471762a97a4bb778145061ff534034d05777 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 17 Oct 2022 10:24:32 +0900 Subject: [PATCH 426/561] (#13486) sole: add version 1.0.4 and support conan v2 * sole: add version 1.0.4 and support conan v2 * apply review --- recipes/sole/all/conandata.yml | 10 ++++ recipes/sole/all/conanfile.py | 57 ++++++++++++------- .../patches/1.0.4-0001-fix-clang-error.patch | 30 ++++++++++ recipes/sole/config.yml | 2 + 4 files changed, 78 insertions(+), 21 deletions(-) create mode 100644 recipes/sole/all/patches/1.0.4-0001-fix-clang-error.patch diff --git a/recipes/sole/all/conandata.yml b/recipes/sole/all/conandata.yml index d08464479020e..865e82c642edb 100644 --- a/recipes/sole/all/conandata.yml +++ b/recipes/sole/all/conandata.yml @@ -1,7 +1,17 @@ sources: + "1.0.4": + url: "https://github.com/r-lyeh-archived/sole/archive/1.0.4.tar.gz" + sha256: "2801bd0d275903bfa1086901eb887cfde844bafe5beea6c2a57f28de4e0540cc" "1.0.2": url: "https://github.com/r-lyeh-archived/sole/archive/1.0.2.tar.gz" sha256: "ff82a1d6071cbc9c709864266210ddedecdb2b1e507ac5e7c4290ca6453e89b3" "1.0.1": sha256: 6b65a36df01b10079716288af530642cbe49abb2805ded1984c6564f471296bf url: https://github.com/r-lyeh-archived/sole/archive/refs/tags/1.0.1.tar.gz + +patches: + "1.0.4": + - patch_file: "patches/1.0.4-0001-fix-clang-error.patch" + patch_description: "fix compilation error on clang/apple-clang" + patch_type: "backport" + patch_source: "https://github.com/r-lyeh-archived/sole/issues/42" diff --git a/recipes/sole/all/conanfile.py b/recipes/sole/all/conanfile.py index 2c2c0d5498dab..e15d1c06c6dc1 100644 --- a/recipes/sole/all/conanfile.py +++ b/recipes/sole/all/conanfile.py @@ -1,39 +1,54 @@ -from conans import ConanFile, tools, CMake +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout + import os +required_conan_version = ">=1.52.0" class SoleConan(ConanFile): name = "sole" - homepage = "https://github.com/r-lyeh-archived/sole" description = "Sole is a lightweight C++11 library to generate universally unique identificators (UUID), both v1 and v4." - topics = ("conan", "uuid", "header-only") - url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler" - no_copy_source = True license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/r-lyeh-archived/sole" + topics = ("uuid", "header-only") + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") - def configure(self): + def package_id(self): + self.info.clear() + + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_name = "sole-" + self.version - os.rename(extracted_name, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build(self): + apply_conandata_patches(self) def package(self): - self.copy(pattern="LICENSE", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="*.hpp", dst="include", - src=self._source_subfolder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs.append("rt") - - def package_id(self): - self.info.header_only() diff --git a/recipes/sole/all/patches/1.0.4-0001-fix-clang-error.patch b/recipes/sole/all/patches/1.0.4-0001-fix-clang-error.patch new file mode 100644 index 0000000000000..8e11dd3c1348b --- /dev/null +++ b/recipes/sole/all/patches/1.0.4-0001-fix-clang-error.patch @@ -0,0 +1,30 @@ +diff --git a/sole.hpp b/sole.hpp +index 8673774..35f2524 100644 +--- a/sole.hpp ++++ b/sole.hpp +@@ -201,6 +201,14 @@ namespace std { + # define $msvc $yes + #endif + ++#ifdef _MSC_VER ++# define $thread __declspec(thread) ++#elif defined __clang__ ++# define $thread thread_local ++#else ++# define $thread __thread ++#endif ++ + #if defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 < 50100) + namespace std + { +@@ -665,8 +673,8 @@ namespace sole { + // UUID implementations + + inline uuid uuid4() { +- static $msvc(__declspec(thread)) $melse(__thread) std::random_device rd; +- static $msvc(__declspec(thread)) $melse(__thread) std::uniform_int_distribution dist(0, (uint64_t)(~0)); ++ static $thread std::random_device rd; ++ static $thread std::uniform_int_distribution dist(0, (uint64_t)(~0)); + + uuid my; + diff --git a/recipes/sole/config.yml b/recipes/sole/config.yml index 58d16eae7aa8f..c97d810195d0f 100644 --- a/recipes/sole/config.yml +++ b/recipes/sole/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.4": + folder: all "1.0.2": folder: all "1.0.1": From fbd4d02337b175826f861a3cf4a12b4d5dfe1484 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Mon, 17 Oct 2022 10:26:07 +0300 Subject: [PATCH 427/561] (#13482) qt5: disable bitcode --- recipes/qt/5.x.x/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 8435569e0775d..2f862bb450212 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -441,6 +441,7 @@ def source(self): "-ldbus-1d", "-ldbus-1" ) + open(os.path.join(self.source_folder, "qt5", "qtbase", "mkspecs", "features", "uikit", "bitcode.prf"), "w").close() def _make_program(self): if self._is_msvc: From bd0f0877bf27914ccef7aee5e89e0bad26ce6301 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 17 Oct 2022 16:44:59 +0900 Subject: [PATCH 428/561] (#13533) osmanip: add version 4.3.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/osmanip/all/conandata.yml | 3 +++ recipes/osmanip/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/osmanip/all/conandata.yml b/recipes/osmanip/all/conandata.yml index f7bfb55b13068..ed7a08d71f344 100644 --- a/recipes/osmanip/all/conandata.yml +++ b/recipes/osmanip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.0": + url: "https://github.com/JustWhit3/osmanip/archive/v4.3.0.tar.gz" + sha256: "e0d982d19792c3e438e3be99f789434b66788f9a7114f217b3c5f28d0121af7f" "4.2.2": url: "https://github.com/JustWhit3/osmanip/archive/v4.2.2.tar.gz" sha256: "841b76bb4f44b66d714858e62661cee75c4fef553300b6da2a6720509421a5fe" diff --git a/recipes/osmanip/config.yml b/recipes/osmanip/config.yml index 1d6418ec4bbcb..7561eb3d93641 100644 --- a/recipes/osmanip/config.yml +++ b/recipes/osmanip/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.0": + folder: all "4.2.2": folder: all "4.2.1": From e5fba9e6db4dd0869c2efef3fab70ee81e639189 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 17 Oct 2022 12:05:59 +0200 Subject: [PATCH 429/561] (#13536) [docs] Add Changelog October 17, 2022 Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- docs/changelog.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 32eb65be6d78b..020830e28edf7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,17 @@ # Changelog +### 17-October-2022 - 10:33 CEST + +- [feature] Improve management of GitHub labels on pull requests. +- [feature] New EpochsSummary job to show epoch status for each reference. +- [feature] Save bot comments as labels as job artifacts for easier user feedback. +- [feature] Ability to wait for a job and merge bot messages from another pipeline: Allows to provide feedback to users in PRs from the Conan v2 pipeline in the future. +- [feature] Add timeout to AutomaticMerge job. +- [feature] Add note about Windows SDK on supported platforms documentation. +- [fix] Fix getting package IDs from Artifactory in the Conan v2 pipeline. +- [fix] Bump dependencies pull requests should only consider modified comments. +- [fix] ValidateInfrastructure job parameter for macos executors. + ### 20-September-2022 - 14:27 CEST - [feature] Handle scenarios where some files are removed. From 57f301540e6dcbad70249958b39badf49e0dd897 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 17 Oct 2022 19:45:13 +0900 Subject: [PATCH 430/561] (#13441) bzip3: add version 1.1.6 * bzip3: add version 1.1.6 * use export_conandata_patches * define BZIP3_DLL_EXPORT --- recipes/bzip3/all/CMakeLists.txt | 4 ++++ recipes/bzip3/all/conandata.yml | 3 +++ recipes/bzip3/all/conanfile.py | 12 +++++++----- recipes/bzip3/config.yml | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/recipes/bzip3/all/CMakeLists.txt b/recipes/bzip3/all/CMakeLists.txt index 21fba747c07a0..62b301abbb58e 100644 --- a/recipes/bzip3/all/CMakeLists.txt +++ b/recipes/bzip3/all/CMakeLists.txt @@ -30,6 +30,10 @@ set_target_properties(bzip3 PROPERTIES C_VISIBILITY_PRESET hidden C_EXTENSIONS OFF ) +if (VERSION VERSION_GREATER_EQUAL "1.1.6" AND (MSVC OR MSVC90 OR MSVC10) AND BUILD_SHARED_LIBS) + target_compile_definitions(bzip3 PRIVATE "BZIP3_DLL_EXPORT=1") +endif() + if (BZIP3_WITH_THREAD) find_package(Threads REQUIRED) target_link_libraries(bzip3 PRIVATE Threads::Threads) diff --git a/recipes/bzip3/all/conandata.yml b/recipes/bzip3/all/conandata.yml index 2a3f78f362c7a..87478fcf26ffd 100644 --- a/recipes/bzip3/all/conandata.yml +++ b/recipes/bzip3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.6": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.6/bzip3-1.1.6.tar.bz2" + sha256: "2bfd35dd57ab80b35b25e3ad628e0ff8f1f5e6dea02a8d472914823ea2e07e96" "1.1.5": url: "https://github.com/kspalaiologos/bzip3/releases/download/1.1.5/bzip3-1.1.5.tar.bz2" sha256: "2f5012b0004b6c23d5f606deed9191fdce44849234edbcf26e0316bf7856d114" diff --git a/recipes/bzip3/all/conanfile.py b/recipes/bzip3/all/conanfile.py index 196224b72dc65..2d6313f87447b 100644 --- a/recipes/bzip3/all/conanfile.py +++ b/recipes/bzip3/all/conanfile.py @@ -1,9 +1,9 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get +from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.52.0" class BZip3Conan(ConanFile): @@ -29,8 +29,7 @@ class BZip3Conan(ConanFile): def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -43,7 +42,10 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: del self.settings.compiler.libcxx except Exception: diff --git a/recipes/bzip3/config.yml b/recipes/bzip3/config.yml index 953d7e8cb96d8..fa8612a6d0ffa 100644 --- a/recipes/bzip3/config.yml +++ b/recipes/bzip3/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.6": + folder: all "1.1.5": folder: all "1.1.4": From aeb40c6ec020f63fc749768541bf669839d5b53a Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Mon, 17 Oct 2022 12:04:57 +0100 Subject: [PATCH 431/561] (#13451) [freetype] update toolchain and add layout * [freetype] update test packages * [freetype] fix license folder copy * [freetype] apply review suggestions --- recipes/freetype/all/CMakeLists.txt | 7 - recipes/freetype/all/conanfile.py | 191 +++++++++--------- .../freetype/all/test_package/CMakeLists.txt | 7 +- .../freetype/all/test_package/conanfile.py | 19 +- .../all/test_v1_package/CMakeLists.txt | 10 + .../freetype/all/test_v1_package/conanfile.py | 18 ++ 6 files changed, 141 insertions(+), 111 deletions(-) delete mode 100644 recipes/freetype/all/CMakeLists.txt create mode 100644 recipes/freetype/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/freetype/all/test_v1_package/conanfile.py diff --git a/recipes/freetype/all/CMakeLists.txt b/recipes/freetype/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/freetype/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index 9008cfe2b91e2..a9262f44540d7 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -1,12 +1,22 @@ from conan import ConanFile -from conan.tools import files, scm -from conans import CMake, tools +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps +from conan.tools.files import ( + collect_libs, + copy, + load, + get, + rename, + replace_in_file, + rmdir, + save +) +from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os import re -import shutil import textwrap -required_conan_version = ">=1.50.2" +required_conan_version = ">=1.52.0" class FreetypeConan(ConanFile): @@ -37,21 +47,9 @@ class FreetypeConan(ConanFile): "subpixel": False } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property def _has_with_brotli_option(self): - return scm.Version(self.version) >= "2.10.2" + return Version(self.version) >= "2.10.2" def config_options(self): if self.settings.os == "Windows": @@ -75,93 +73,98 @@ def requirements(self): if self.options.get_safe("with_brotli"): self.requires("brotli/1.0.9") + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + cmake = CMakeToolchain(self) + if Version(self.version) >= "2.11.0": + cmake.variables["FT_REQUIRE_ZLIB"] = self.options.with_zlib + cmake.variables["FT_DISABLE_ZLIB"] = not self.options.with_zlib + cmake.variables["FT_REQUIRE_PNG"] = self.options.with_png + cmake.variables["FT_DISABLE_PNG"] = not self.options.with_png + cmake.variables["FT_REQUIRE_BZIP2"] = self.options.with_bzip2 + cmake.variables["FT_DISABLE_BZIP2"] = not self.options.with_bzip2 + # TODO: Harfbuzz can be added as an option as soon as it is available. + cmake.variables["FT_REQUIRE_HARFBUZZ"] = False + cmake.variables["FT_DISABLE_HARFBUZZ"] = True + if self._has_with_brotli_option: + cmake.variables["FT_REQUIRE_BROTLI"] = self.options.with_brotli + cmake.variables["FT_DISABLE_BROTLI"] = not self.options.with_brotli + else: + cmake.variables["FT_WITH_ZLIB"] = self.options.with_zlib + cmake.variables["FT_WITH_PNG"] = self.options.with_png + cmake.variables["FT_WITH_BZIP2"] = self.options.with_bzip2 + # TODO: Harfbuzz can be added as an option as soon as it is available. + cmake.variables["FT_WITH_HARFBUZZ"] = False + if self._has_with_brotli_option: + cmake.variables["FT_WITH_BROTLI"] = self.options.with_brotli + # Generate a relocatable shared lib on Macos + cmake.variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + + cmake.generate() + def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) def _patch_sources(self): # Do not accidentally enable dependencies we have disabled - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") - find_harfbuzz = "find_package(HarfBuzz {})".format("1.3.0" if scm.Version(self.version) < "2.10.2" else "${HARFBUZZ_MIN_VERSION}") - if_harfbuzz_found = "if ({})".format("HARFBUZZ_FOUND" if scm.Version(self.version) < "2.11.0" else "HarfBuzz_FOUND") - tools.replace_in_file(cmakelists, find_harfbuzz, "") - tools.replace_in_file(cmakelists, if_harfbuzz_found, "if(0)") + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + find_harfbuzz = "find_package(HarfBuzz {})".format("1.3.0" if Version(self.version) < "2.10.2" else "${HARFBUZZ_MIN_VERSION}") + if_harfbuzz_found = "if ({})".format("HARFBUZZ_FOUND" if Version(self.version) < "2.11.0" else "HarfBuzz_FOUND") + replace_in_file(self, cmakelists, find_harfbuzz, "") + replace_in_file(self, cmakelists, if_harfbuzz_found, "if(0)") if not self.options.with_png: - tools.replace_in_file(cmakelists, "find_package(PNG)", "") - tools.replace_in_file(cmakelists, "if (PNG_FOUND)", "if(0)") + replace_in_file(self, cmakelists, "find_package(PNG)", "") + replace_in_file(self, cmakelists, "if (PNG_FOUND)", "if(0)") if not self.options.with_zlib: - tools.replace_in_file(cmakelists, "find_package(ZLIB)", "") - tools.replace_in_file(cmakelists, "if (ZLIB_FOUND)", "if(0)") + replace_in_file(self, cmakelists, "find_package(ZLIB)", "") + replace_in_file(self, cmakelists, "if (ZLIB_FOUND)", "if(0)") if not self.options.with_bzip2: - tools.replace_in_file(cmakelists, "find_package(BZip2)", "") - tools.replace_in_file(cmakelists, "if (BZIP2_FOUND)", "if(0)") + replace_in_file(self, cmakelists, "find_package(BZip2)", "") + replace_in_file(self, cmakelists, "if (BZIP2_FOUND)", "if(0)") if self._has_with_brotli_option: # the custom FindBrotliDec of upstream is too fragile - tools.replace_in_file(cmakelists, + replace_in_file(self, cmakelists, "find_package(BrotliDec REQUIRED)", "find_package(Brotli REQUIRED)\n" "set(BROTLIDEC_FOUND 1)\n" - "set(BROTLIDEC_LIBRARIES \"Brotli::Brotli\")") + "set(BROTLIDEC_LIBRARIES \"brotli::brotli\")") if not self.options.with_brotli: - tools.replace_in_file(cmakelists, "find_package(BrotliDec)", "") - tools.replace_in_file(cmakelists, "if (BROTLIDEC_FOUND)", "if(0)") + replace_in_file(self, cmakelists, "find_package(BrotliDec)", "") + replace_in_file(self, cmakelists, "if (BROTLIDEC_FOUND)", "if(0)") - config_h = os.path.join(self._source_subfolder, "include", "freetype", "config", "ftoption.h") + config_h = os.path.join(self.source_folder, "include", "freetype", "config", "ftoption.h") if self.options.subpixel: - tools.replace_in_file(config_h, "/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */", "#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - if scm.Version(self.version) >= "2.11.0": - self._cmake.definitions["FT_REQUIRE_ZLIB"] = self.options.with_zlib - self._cmake.definitions["FT_DISABLE_ZLIB"] = not self.options.with_zlib - self._cmake.definitions["FT_REQUIRE_PNG"] = self.options.with_png - self._cmake.definitions["FT_DISABLE_PNG"] = not self.options.with_png - self._cmake.definitions["FT_REQUIRE_BZIP2"] = self.options.with_bzip2 - self._cmake.definitions["FT_DISABLE_BZIP2"] = not self.options.with_bzip2 - # TODO: Harfbuzz can be added as an option as soon as it is available. - self._cmake.definitions["FT_REQUIRE_HARFBUZZ"] = False - self._cmake.definitions["FT_DISABLE_HARFBUZZ"] = True - if self._has_with_brotli_option: - self._cmake.definitions["FT_REQUIRE_BROTLI"] = self.options.with_brotli - self._cmake.definitions["FT_DISABLE_BROTLI"] = not self.options.with_brotli - else: - self._cmake.definitions["FT_WITH_ZLIB"] = self.options.with_zlib - self._cmake.definitions["FT_WITH_PNG"] = self.options.with_png - self._cmake.definitions["FT_WITH_BZIP2"] = self.options.with_bzip2 - # TODO: Harfbuzz can be added as an option as soon as it is available. - self._cmake.definitions["FT_WITH_HARFBUZZ"] = False - if self._has_with_brotli_option: - self._cmake.definitions["FT_WITH_BROTLI"] = self.options.with_brotli - # Generate a relocatable shared lib on Macos - self._cmake.definitions["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - self._cmake.configure(build_dir=self._build_subfolder) - return self._cmake + replace_in_file(self,config_h, "/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */", "#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def _make_freetype_config(self, version): - freetype_config_in = os.path.join(self._source_subfolder, "builds", "unix", "freetype-config.in") + freetype_config_in = os.path.join(self.source_folder, "builds", "unix", "freetype-config.in") if not os.path.isdir(os.path.join(self.package_folder, "bin")): os.makedirs(os.path.join(self.package_folder, "bin")) freetype_config = os.path.join(self.package_folder, "bin", "freetype-config") - shutil.copy(freetype_config_in, freetype_config) + rename(self, freetype_config_in, freetype_config) libs = "-lfreetyped" if self.settings.build_type == "Debug" else "-lfreetype" staticlibs = f"-lm {libs}" if self.settings.os == "Linux" else libs - tools.replace_in_file(freetype_config, r"%PKG_CONFIG%", r"/bin/false") # never use pkg-config - tools.replace_in_file(freetype_config, r"%prefix%", r"$conan_prefix") - tools.replace_in_file(freetype_config, r"%exec_prefix%", r"$conan_exec_prefix") - tools.replace_in_file(freetype_config, r"%includedir%", r"$conan_includedir") - tools.replace_in_file(freetype_config, r"%libdir%", r"$conan_libdir") - tools.replace_in_file(freetype_config, r"%ft_version%", r"$conan_ftversion") - tools.replace_in_file(freetype_config, r"%LIBSSTATIC_CONFIG%", r"$conan_staticlibs") - tools.replace_in_file(freetype_config, r"-lfreetype", libs) - tools.replace_in_file(freetype_config, r"export LC_ALL", textwrap.dedent("""\ + replace_in_file(self, freetype_config, r"%PKG_CONFIG%", r"/bin/false") # never use pkg-config + replace_in_file(self, freetype_config, r"%prefix%", r"$conan_prefix") + replace_in_file(self, freetype_config, r"%exec_prefix%", r"$conan_exec_prefix") + replace_in_file(self, freetype_config, r"%includedir%", r"$conan_includedir") + replace_in_file(self, freetype_config, r"%libdir%", r"$conan_libdir") + replace_in_file(self, freetype_config, r"%ft_version%", r"$conan_ftversion") + replace_in_file(self, freetype_config, r"%LIBSSTATIC_CONFIG%", r"$conan_staticlibs") + replace_in_file(self, freetype_config, r"-lfreetype", libs) + replace_in_file(self, freetype_config, r"export LC_ALL", textwrap.dedent("""\ export LC_ALL BINDIR=$(dirname $0) conan_prefix=$(dirname $BINDIR) @@ -173,7 +176,7 @@ def _make_freetype_config(self, version): """).format(version=version, staticlibs=staticlibs)) def _extract_libtool_version(self): - conf_raw = tools.load(os.path.join(self._source_subfolder, "builds", "unix", "configure.raw")) + conf_raw = load(self, os.path.join(self.source_folder, "builds", "unix", "configure.raw")) return next(re.finditer(r"^version_info='([0-9:]+)'", conf_raw, flags=re.M)).group(1).replace(":", ".") @property @@ -181,19 +184,21 @@ def _libtool_version_txt(self): return os.path.join(self.package_folder, "res", "freetype-libtool-version.txt") def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() libtool_version = self._extract_libtool_version() - tools.save(self._libtool_version_txt, libtool_version) + save(self, self._libtool_version_txt, libtool_version) self._make_freetype_config(libtool_version) - self.copy("FTL.TXT", src=os.path.join(self._source_subfolder, "docs"), dst="licenses") - self.copy("GPLv2.TXT", src=os.path.join(self._source_subfolder, "docs"), dst="licenses") - self.copy("LICENSE.TXT", src=os.path.join(self._source_subfolder, "docs"), dst="licenses") + doc_folder = os.path.join(self.source_folder, "docs") + license_folder = os.path.join(self.package_folder, "licenses") + copy(self, "FTL.TXT", doc_folder, license_folder) + copy(self, "GPLv2.TXT", doc_folder, license_folder) + copy(self, "LICENSE.TXT", doc_folder, license_folder) - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - files.rmdir(self, 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")) self._create_cmake_module_variables( os.path.join(self.package_folder, self._module_vars_rel_path) ) @@ -202,8 +207,7 @@ def package(self): {"freetype": "Freetype::Freetype"} ) - @staticmethod - def _create_cmake_module_variables(module_file): + def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ if(DEFINED Freetype_FOUND) set(FREETYPE_FOUND ${Freetype_FOUND}) @@ -218,10 +222,9 @@ def _create_cmake_module_variables(module_file): set(FREETYPE_VERSION_STRING ${Freetype_VERSION}) endif() """) - tools.save(module_file, content) + save(self, module_file, content) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): content += textwrap.dedent("""\ @@ -230,7 +233,7 @@ def _create_cmake_module_alias_targets(module_file, targets): set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + save(self, module_file, content) @property def _module_subfolder(self): @@ -260,7 +263,7 @@ def package_info(self): self.cpp_info.builddirs.append(self._module_subfolder) self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) self.cpp_info.set_property("pkg_config_name", "freetype2") - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") self.cpp_info.includedirs.append(os.path.join("include", "freetype2")) @@ -269,7 +272,7 @@ def package_info(self): self.env_info.FT2_CONFIG = freetype_config self._chmod_plus_x(freetype_config) - libtool_version = tools.load(self._libtool_version_txt).strip() + libtool_version = load(self, self._libtool_version_txt).strip() self.user_info.LIBTOOL_VERSION = libtool_version # FIXME: need to do override the pkg_config version (pkg_config_custom_content does not work) # self.cpp_info.version["pkg_config"] = pkg_config_version diff --git a/recipes/freetype/all/test_package/CMakeLists.txt b/recipes/freetype/all/test_package/CMakeLists.txt index 8fe0c73fa6337..d0f6e7db35f58 100644 --- a/recipes/freetype/all/test_package/CMakeLists.txt +++ b/recipes/freetype/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Freetype REQUIRED) +find_package(Freetype CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} Freetype::Freetype) +target_link_libraries(${PROJECT_NAME} PRIVATE freetype) diff --git a/recipes/freetype/all/test_package/conanfile.py b/recipes/freetype/all/test_package/conanfile.py index e301073d04822..5da019d033eb1 100644 --- a/recipes/freetype/all/test_package/conanfile.py +++ b/recipes/freetype/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,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.bindirs[0], "test_package") font_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") - self.run("{} {}".format(bin_path, font_path), run_environment=True) + self.run(f"{bin_path} {font_path}", env="conanrun") diff --git a/recipes/freetype/all/test_v1_package/CMakeLists.txt b/recipes/freetype/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..29099563ff9fb --- /dev/null +++ b/recipes/freetype/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Freetype REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Freetype::Freetype) diff --git a/recipes/freetype/all/test_v1_package/conanfile.py b/recipes/freetype/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..aed73943409ce --- /dev/null +++ b/recipes/freetype/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" + + 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") + font_path = os.path.join(self.source_folder, "..", "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", run_environment=True) From d83019db3cc820e9d844cb89259d5785c9ea6551 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:31:04 +0200 Subject: [PATCH 432/561] (#13457) [bot] Add Access Request users (2022-10-13) --- .c3i/authorized_users.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 393a65493cf88..94ef38e9a5f6a 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -943,3 +943,14 @@ authorized_users: - "vince-cheung" - "mariopil" - "PikachuHyA" + - "System-Arch" + - "sorny92" + - "cubanpit" + - "winterz" + - "Kidsunbo" + - "antony-jr" + - "tankeco" + - "ElliotMugner" + - "jfaust" + - "morningstar1" + - "lrineau" From 0426ea12f2304e377d3df02963841a23b6adfb8a Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Mon, 17 Oct 2022 13:56:34 +0200 Subject: [PATCH 433/561] (#13461) Move myself to community --- .c3i/reviewers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.c3i/reviewers.yml b/.c3i/reviewers.yml index 68688a3dec35d..9be2aca6c9794 100644 --- a/.c3i/reviewers.yml +++ b/.c3i/reviewers.yml @@ -10,8 +10,8 @@ reviewers: type: "team" request_reviews: false - user: "jgsogo" - type: "team" - request_reviews: true + type: "community" + request_reviews: false - user: "czoido" type: "team" request_reviews: false From 8c9e6336cbdd80d0592aebd7220046e56859661b Mon Sep 17 00:00:00 2001 From: Michael Keck Date: Mon, 17 Oct 2022 14:25:54 +0200 Subject: [PATCH 434/561] (#13491) cmake: add new versions + remove old ones + use official src downloads * cmake: add new versions + remove old ones + use official src downloads * add new versions * remove old versions * use official source downloads for all versions; some used the automated GitHub generated source archives * some additional tiny improvements * cmake: import errors from conan namespace * cmake: create identical `test_v1_package` to satisfy hooks * Use `env="conanrun"` Co-authored-by: Jordan Williams * Use f-string Co-authored-by: Jordan Williams * Use `generators = "VirtualRunEnv"` * Use `test_type = "explicit"` for v1 test_package Co-authored-by: Jordan Williams --- recipes/cmake/3.x.x/conandata.yml | 30 +++++++++---------- recipes/cmake/3.x.x/conanfile.py | 11 +++---- recipes/cmake/3.x.x/test_package/conanfile.py | 11 +++++-- .../cmake/3.x.x/test_v1_package/conanfile.py | 23 ++++++++++++++ recipes/cmake/config.yml | 4 +-- 5 files changed, 52 insertions(+), 27 deletions(-) create mode 100644 recipes/cmake/3.x.x/test_v1_package/conanfile.py diff --git a/recipes/cmake/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml index 80dda4779fb80..57c64254de46e 100644 --- a/recipes/cmake/3.x.x/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -1,25 +1,25 @@ sources: "3.19.8": - sha256: 09b4fa4837aae55c75fb170f6a6e2b44818deba48335d1969deddfbb34e30369 url: https://github.com/Kitware/CMake/releases/download/v3.19.8/cmake-3.19.8.tar.gz + sha256: 09b4fa4837aae55c75fb170f6a6e2b44818deba48335d1969deddfbb34e30369 "3.20.6": - sha256: a0bd485e1a38dd13c0baec89d5f4adbf61c7fd32fddb38eabc69a75bc0b65d72 url: https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6.tar.gz + sha256: a0bd485e1a38dd13c0baec89d5f4adbf61c7fd32fddb38eabc69a75bc0b65d72 "3.21.7": - sha256: 3523c4a5afc61ac3d7c92835301cdf092129c9b672a6ee17e68c92e928c1375a url: https://github.com/Kitware/CMake/releases/download/v3.21.7/cmake-3.21.7.tar.gz - "3.22.5": - sha256: d3987c3f7759fa0a401c5fcd5076be44a19613bfaa8baee1b5d1835750dc5375 - url: https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5.tar.gz - "3.23.3": - url: "https://github.com/Kitware/CMake/archive/v3.23.3.tar.gz" - sha256: "013f688b7da463dcd1e7afde769081af21cb24365aefc246761cfb2e04cd2872" + sha256: 3523c4a5afc61ac3d7c92835301cdf092129c9b672a6ee17e68c92e928c1375a + "3.22.6": + url: https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6.tar.gz + sha256: 73933163670ea4ea95c231549007b0c7243282293506a2cf4443714826ad5ec3 + "3.23.4": + url: "https://github.com/Kitware/CMake/releases/download/v3.23.4/cmake-3.23.4.tar.gz" + sha256: "aa8b6c17a5adf04de06e42c06adc7e25b21e4fe8378f44f703a861e5f6ac59c7" "3.24.0": - url: "https://github.com/Kitware/CMake/archive/v3.24.0.tar.gz" - sha256: "d71f48192a0747c0bd46e8f2128773adf3d650d3900a9b03bd2ee5058619bafd" + url: "https://github.com/Kitware/CMake/releases/download/v3.24.0/cmake-3.24.0.tar.gz" + sha256: "c2b61f7cdecb1576cad25f918a8f42b8685d88a832fd4b62b9e0fa32e915a658" "3.24.1": - url: "https://github.com/Kitware/CMake/archive/v3.24.1.tar.gz" - sha256: "fe7fd2eb0ecee1c0ad829bca77ac7b516fdb7a982e862fc47ef8df54e714dbc3" + url: "https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1.tar.gz" + sha256: "4931e277a4db1a805f13baa7013a7757a0cbfe5b7932882925c7061d9d1fa82b" "3.24.2": - url: "https://github.com/Kitware/CMake/archive/v3.24.2.tar.gz" - sha256: "f4f0772b0a89f93be6d1153d5640b80cc8d64a3bda95cca1799673bc4d03f3b1" + url: "https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2.tar.gz" + sha256: "0d9020f06f3ddf17fb537dc228e1a56c927ee506b486f55fe2dc19f69bf0c8db" diff --git a/recipes/cmake/3.x.x/conanfile.py b/recipes/cmake/3.x.x/conanfile.py index dcee83836341a..6fa70380c571e 100644 --- a/recipes/cmake/3.x.x/conanfile.py +++ b/recipes/cmake/3.x.x/conanfile.py @@ -3,9 +3,9 @@ from conan.tools.scm import Version from conan.tools.files import rmdir, get from conans import tools, AutoToolsBuildEnvironment, CMake -from conans.errors import ConanInvalidConfiguration, ConanException +from conan.errors import ConanInvalidConfiguration, ConanException -required_conan_version = ">=1.35.0" +required_conan_version = ">=1.49.0" class CMakeConan(ConanFile): name = "cmake" @@ -29,9 +29,6 @@ class CMakeConan(ConanFile): _source_subfolder = "source_subfolder" _cmake = None - def _minor_version(self): - return ".".join(str(self.version).split(".")[:2]) - def config_options(self): if self.settings.os == "Windows": self.options.with_openssl = False @@ -125,7 +122,7 @@ def package_id(self): del self.info.settings.compiler def package_info(self): - minor = self._minor_version() + module_version = "{}.{}".format(Version(self.version).major, Version(self.version).minor) bindir = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH environment variable: {}".format(bindir)) @@ -133,7 +130,7 @@ def package_info(self): self.buildenv_info.prepend_path("CMAKE_ROOT", self.package_folder) self.env_info.CMAKE_ROOT = self.package_folder - mod_path = os.path.join(self.package_folder, "share", "cmake-%s" % minor, "Modules") + mod_path = os.path.join(self.package_folder, "share", f"cmake-{module_version}", "Modules") self.buildenv_info.prepend_path("CMAKE_MODULE_PATH", mod_path) self.env_info.CMAKE_MODULE_PATH = mod_path if not os.path.exists(mod_path): diff --git a/recipes/cmake/3.x.x/test_package/conanfile.py b/recipes/cmake/3.x.x/test_package/conanfile.py index b36c2327f2da6..0b0c4858e1c60 100644 --- a/recipes/cmake/3.x.x/test_package/conanfile.py +++ b/recipes/cmake/3.x.x/test_package/conanfile.py @@ -1,15 +1,20 @@ import os from six import StringIO -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run class TestPackageConan(ConanFile): settings = "os", "arch" + generators = "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self): + if can_run(self): output = StringIO() - self.run("cmake --version", output=output, run_environment=True) + self.run("cmake --version", env="conanrun", output=output) output_str = str(output.getvalue()) self.output.info("Installed version: {}".format(output_str)) require_version = str(self.deps_cpp_info["cmake"].version) diff --git a/recipes/cmake/3.x.x/test_v1_package/conanfile.py b/recipes/cmake/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..efb629f7d5725 --- /dev/null +++ b/recipes/cmake/3.x.x/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os +from six import StringIO +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + if can_run(self): + output = StringIO() + self.run("cmake --version", output=output, run_environment=True) + output_str = str(output.getvalue()) + self.output.info("Installed version: {}".format(output_str)) + require_version = str(self.deps_cpp_info["cmake"].version) + self.output.info("Expected version: {}".format(require_version)) + assert_cmake_version = "cmake version %s" % require_version + assert(assert_cmake_version in output_str) diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index f2af6f8eea1c4..df21a50793a9e 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -5,9 +5,9 @@ versions: folder: "3.x.x" "3.21.7": folder: "3.x.x" - "3.22.5": + "3.22.6": folder: "3.x.x" - "3.23.3": + "3.23.4": folder: "3.x.x" "3.24.0": folder: "3.x.x" From 63292eb592b126c577cb6ead970c716883d58e1e Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 17 Oct 2022 21:45:06 +0900 Subject: [PATCH 435/561] (#13495) aws-c-http: change dependeant recipe version for aws-c-s3 * change dependeant recipe version for aws-c-s3 * fix condition --- recipes/aws-c-http/all/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/aws-c-http/all/conanfile.py b/recipes/aws-c-http/all/conanfile.py index 71f435659cae7..5f4b5242c4dbe 100644 --- a/recipes/aws-c-http/all/conanfile.py +++ b/recipes/aws-c-http/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.scm import Version from conan.tools.files import get, copy, rmdir from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os @@ -47,7 +48,10 @@ def layout(self): def requirements(self): self.requires("aws-c-common/0.8.2") self.requires("aws-c-compression/0.2.15") - self.requires("aws-c-io/0.13.4") + if Version(self.version) < "0.6.22": + self.requires("aws-c-io/0.10.20") + else: + self.requires("aws-c-io/0.13.4") def source(self): get(self, **self.conan_data["sources"][self.version], From e236d41ae33dbcc0595dd3e907b4606e42f0575f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 15:26:37 +0200 Subject: [PATCH 436/561] (#13498) libbacktrace: conan v2 support --- recipes/libbacktrace/all/conandata.yml | 2 - recipes/libbacktrace/all/conanfile.py | 152 +++++++++--------- .../all/test_package/CMakeLists.txt | 7 +- .../all/test_package/conanfile.py | 26 +-- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../all/test_v1_package/conanfile.py | 17 ++ 6 files changed, 116 insertions(+), 98 deletions(-) create mode 100644 recipes/libbacktrace/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libbacktrace/all/test_v1_package/conanfile.py diff --git a/recipes/libbacktrace/all/conandata.yml b/recipes/libbacktrace/all/conandata.yml index 1357c342647ac..56d79ce7402eb 100644 --- a/recipes/libbacktrace/all/conandata.yml +++ b/recipes/libbacktrace/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "cci.20210118": - patch_file: "patches/0001-pointer-arithmetic.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-msvc-unistd-alternative.patch" - base_path: "source_subfolder" diff --git a/recipes/libbacktrace/all/conanfile.py b/recipes/libbacktrace/all/conanfile.py index 33119b46895be..ca9c6497fea49 100644 --- a/recipes/libbacktrace/all/conanfile.py +++ b/recipes/libbacktrace/all/conanfile.py @@ -1,11 +1,15 @@ -from conan.tools.files import rename -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import contextlib -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class LibbacktraceConan(ConanFile): @@ -25,21 +29,16 @@ class LibbacktraceConan(ConanFile): "fPIC": True, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -47,82 +46,79 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self._is_msvc and self.options.shared: + if is_msvc(self) and self.info.options.shared: raise ConanInvalidConfiguration("libbacktrace shared is not supported with Visual Studio") def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self._is_msvc: - self.build_requires("automake/1.16.4") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - - @contextlib.contextmanager - def _build_context(self): - if self._is_msvc: - with tools.vcvars(self): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "LD": "{} link -nologo".format(tools.unix_path(self._user_info_build["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self._user_info_build["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield - - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] - if (self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) >= "12") or \ - str(self.settings.compiler) == "msvc": - autotools.flags.append("-FS") - yes_no = lambda v: "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - autotools.configure(args=args, configure_dir=self._source_subfolder) - return autotools - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # relocatable shared lib on macOS - tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), - "-install_name \\$rpath/", - "-install_name @rpath/") + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ + (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): + tc.extra_cflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + compile_wrapper = unix_path(self, self._user_info_build["automake"].compile) + ar_wrapper = unix_path(self, self._user_info_build["automake"].ar_lib) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_libbacktrace_msvc") def build(self): - self._patch_sources() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + # see https://github.com/conan-io/conan/issues/12006 + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) lib_folder = os.path.join(self.package_folder, "lib") - if self._is_msvc: + rm(self, "*.la", lib_folder) + fix_apple_shared_install_name(self) + if is_msvc(self): rename(self, os.path.join(lib_folder, "libbacktrace.lib"), os.path.join(lib_folder, "backtrace.lib")) - tools.remove_files_by_mask(lib_folder, "*.la") def package_info(self): self.cpp_info.libs = ["backtrace"] diff --git a/recipes/libbacktrace/all/test_package/CMakeLists.txt b/recipes/libbacktrace/all/test_package/CMakeLists.txt index 5d15b4b693da0..81b50a3407418 100644 --- a/recipes/libbacktrace/all/test_package/CMakeLists.txt +++ b/recipes/libbacktrace/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(libbacktrace REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package libbacktrace::libbacktrace) +target_link_libraries(test_package PRIVATE libbacktrace::libbacktrace) diff --git a/recipes/libbacktrace/all/test_package/conanfile.py b/recipes/libbacktrace/all/test_package/conanfile.py index 5c8041d4e1827..0a6bc68712d90 100644 --- a/recipes/libbacktrace/all/test_package/conanfile.py +++ b/recipes/libbacktrace/all/test_package/conanfile.py @@ -1,19 +1,19 @@ -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # Workaround for CMake bug with error message: - # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # set. This could be because you are using a Mac OS X version less than 10.5 - # or because CMake's platform configuration is corrupt. - # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -21,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt b/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ee84a5e843025 --- /dev/null +++ b/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libbacktrace REQUIRED CONFIG) + +add_executable(test_package ../test_package/test_package.c) +target_link_libraries(test_package PRIVATE libbacktrace::libbacktrace) diff --git a/recipes/libbacktrace/all/test_v1_package/conanfile.py b/recipes/libbacktrace/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e0a85886fc12c --- /dev/null +++ b/recipes/libbacktrace/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From c6b5db76d48ae06ddcc269271a2ab2359f93d8ed Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 15:45:52 +0200 Subject: [PATCH 437/561] (#13502) xerces-c: conan v2 support --- recipes/xerces-c/all/CMakeLists.txt | 7 -- recipes/xerces-c/all/conandata.yml | 4 - recipes/xerces-c/all/conanfile.py | 96 +++++++++---------- .../xerces-c/all/test_package/CMakeLists.txt | 13 +-- .../xerces-c/all/test_package/conanfile.py | 19 +++- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../xerces-c/all/test_v1_package/conanfile.py | 17 ++++ 7 files changed, 93 insertions(+), 74 deletions(-) delete mode 100644 recipes/xerces-c/all/CMakeLists.txt create mode 100644 recipes/xerces-c/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xerces-c/all/test_v1_package/conanfile.py diff --git a/recipes/xerces-c/all/CMakeLists.txt b/recipes/xerces-c/all/CMakeLists.txt deleted file mode 100644 index 9d48e327cd88a..0000000000000 --- a/recipes/xerces-c/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/xerces-c/all/conandata.yml b/recipes/xerces-c/all/conandata.yml index 1fe9340e9c368..689ea35941ef9 100644 --- a/recipes/xerces-c/all/conandata.yml +++ b/recipes/xerces-c/all/conandata.yml @@ -8,11 +8,7 @@ sources: patches: "3.2.3": - patch_file: "patches/0001-remove-test-samples.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-find-icu-programs.patch" - base_path: "source_subfolder" "3.2.2": - patch_file: "patches/0001-remove-test-samples.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-find-icu-programs.patch" - base_path: "source_subfolder" diff --git a/recipes/xerces-c/all/conanfile.py b/recipes/xerces-c/all/conanfile.py index 06b8a858e9d3e..de59d70169466 100644 --- a/recipes/xerces-c/all/conanfile.py +++ b/recipes/xerces-c/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class XercesCConan(ConanFile): @@ -36,21 +39,8 @@ class XercesCConan(ConanFile): "mutex_manager": "standard", } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -67,13 +57,19 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if "icu" in (self.options.transcoder, self.options.message_loader): - self.requires("icu/70.1") + self.requires("icu/71.1") if self.options.network_accessor == "curl": - self.requires("libcurl/7.80.0") + self.requires("libcurl/7.85.0") def _validate(self, option, value, os): """ @@ -85,7 +81,7 @@ def _validate(self, option, value, os): :param os: either a single string or a tuple of strings containing the OS(es) that `value` is valid on """ - if self.settings.os not in os and getattr(self.options, option) == value: + if self.info.settings.os not in os and getattr(self.info.options, option) == value: raise ConanInvalidConfiguration( "Option '{option}={value}' is only supported on {os}".format( option=option, value=value, os=os @@ -93,7 +89,7 @@ def _validate(self, option, value, os): ) def validate(self): - if self.settings.os not in ("Windows", "Macos", "Linux"): + if self.info.settings.os not in ("Windows", "Macos", "Linux"): raise ConanInvalidConfiguration("OS is not supported") self._validate("char_type", "wchar_t", ("Windows", )) self._validate("network_accessor", "winsock", ("Windows", )) @@ -107,51 +103,51 @@ def validate(self): def build_requirements(self): if hasattr(self, "settings_build") and self.options.message_loader == "icu": - self.build_requires("icu/70.1") + self.tool_requires("icu/71.1") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = CMakeToolchain(self) # https://xerces.apache.org/xerces-c/build-3.html - self._cmake.definitions["network-accessor"] = self.options.network_accessor - self._cmake.definitions["transcoder"] = self.options.transcoder - self._cmake.definitions["message-loader"] = self.options.message_loader - self._cmake.definitions["xmlch-type"] = self.options.char_type - self._cmake.definitions["mutex-manager"] = self.options.mutex_manager + tc.variables["network-accessor"] = self.options.network_accessor + tc.variables["transcoder"] = self.options.transcoder + tc.variables["message-loader"] = self.options.message_loader + tc.variables["xmlch-type"] = self.options.char_type + tc.variables["mutex-manager"] = self.options.mutex_manager # avoid picking up system dependency - self._cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_CURL"] = self.options.network_accessor != "curl" - self._cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_ICU"] = "icu" not in (self.options.transcoder, self.options.message_loader) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_CURL"] = self.options.network_accessor != "curl" + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_ICU"] = "icu" not in (self.options.transcoder, self.options.message_loader) + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="NOTICE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + for license in ("LICENSE", "NOTICE"): + copy(self, license, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - # remove unneeded directories - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, 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, "cmake")) def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "XercesC") self.cpp_info.set_property("cmake_target_name", "XercesC::XercesC") self.cpp_info.set_property("pkg_config_name", "xerces-c") - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os == "Macos": self.cpp_info.frameworks = ["CoreFoundation", "CoreServices"] elif self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/xerces-c/all/test_package/CMakeLists.txt b/recipes/xerces-c/all/test_package/CMakeLists.txt index 71e1760854d13..3f03b5b9ef2cd 100644 --- a/recipes/xerces-c/all/test_package/CMakeLists.txt +++ b/recipes/xerces-c/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(XercesC REQUIRED CONFIG) +find_package(XercesC REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} XercesC::XercesC) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE XercesC::XercesC) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/xerces-c/all/test_package/conanfile.py b/recipes/xerces-c/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/xerces-c/all/test_package/conanfile.py +++ b/recipes/xerces-c/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xerces-c/all/test_v1_package/CMakeLists.txt b/recipes/xerces-c/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7c3c78b82bae7 --- /dev/null +++ b/recipes/xerces-c/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(XercesC REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE XercesC::XercesC) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/xerces-c/all/test_v1_package/conanfile.py b/recipes/xerces-c/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/xerces-c/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 3e2db9b2b12a3e5715e62a1c72235783870b2fe5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 16:24:46 +0200 Subject: [PATCH 438/561] (#13504) oatpp-sqlite: conan v2 support --- recipes/oatpp-sqlite/all/CMakeLists.txt | 7 -- recipes/oatpp-sqlite/all/conanfile.py | 115 ++++++++++-------- .../all/test_package/CMakeLists.txt | 12 +- .../all/test_package/conanfile.py | 25 ++-- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 +++ 6 files changed, 111 insertions(+), 76 deletions(-) delete mode 100644 recipes/oatpp-sqlite/all/CMakeLists.txt create mode 100644 recipes/oatpp-sqlite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-sqlite/all/test_v1_package/conanfile.py diff --git a/recipes/oatpp-sqlite/all/CMakeLists.txt b/recipes/oatpp-sqlite/all/CMakeLists.txt deleted file mode 100644 index 1b8db564f6044..0000000000000 --- a/recipes/oatpp-sqlite/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/oatpp-sqlite/all/conanfile.py b/recipes/oatpp-sqlite/all/conanfile.py index 82525eb53e8d9..75896ed5f3e71 100644 --- a/recipes/oatpp-sqlite/all/conanfile.py +++ b/recipes/oatpp-sqlite/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" class OatppsqliteConan(ConanFile): @@ -12,21 +17,16 @@ class OatppsqliteConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "oat++ SQLite library" topics = ("oat++", "oatpp", "sqlite") - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "cmake", "cmake_find_package" - exports_sources = "CMakeLists.txt" - - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def config_options(self): if self.settings.os == "Windows": @@ -34,60 +34,73 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + def layout(self): + cmake_layout(self, src_folder="src") - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("oatpp-sqlite can not be built as shared library on Windows") + def requirements(self): + self.requires(f"oatpp/{self.version}") + self.requires("sqlite3/3.39.4") - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("oatpp-sqlite requires GCC >=5") + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) - def requirements(self): - self.requires("oatpp/" + self.version) - self.requires("sqlite3/3.37.0") + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared library with msvc") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=5") - def _configure_cmake(self): - if self._cmake: - return self._cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - self._cmake = CMake(self) - self._cmake.definitions["OATPP_BUILD_TESTS"] = False - self._cmake.definitions["OATPP_MODULES_LOCATION"] = "INSTALLED" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OATPP_BUILD_TESTS"] = False + tc.variables["OATPP_MODULES_LOCATION"] = "INSTALLED" + tc.generate() + deps = CMakeDeps(self) + deps.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): - self.cpp_info.filenames["cmake_find_package"] = "oatpp-sqlite" - self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-sqlite" self.cpp_info.set_property("cmake_file_name", "oatpp-sqlite") - self.cpp_info.names["cmake_find_package"] = "oatpp" - self.cpp_info.names["cmake_find_package_multi"] = "oatpp" self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-sqlite") - self.cpp_info.components["_oatpp-sqlite"].names["cmake_find_package"] = "oatpp-sqlite" - self.cpp_info.components["_oatpp-sqlite"].names["cmake_find_package_multi"] = "oatpp-sqlite" - self.cpp_info.components["_oatpp-sqlite"].set_property("cmake_target_name", "oatpp::oatpp-sqlite") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["_oatpp-sqlite"].includedirs = [ - os.path.join("include", "oatpp-{}".format(self.version), "oatpp-sqlite") + os.path.join("include", f"oatpp-{self.version}", "oatpp-sqlite") ] - self.cpp_info.components["_oatpp-sqlite"].libdirs = [os.path.join("lib", "oatpp-{}".format(self.version))] + self.cpp_info.components["_oatpp-sqlite"].libdirs = [os.path.join("lib", f"oatpp-{self.version}")] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["_oatpp-sqlite"].bindirs = [os.path.join("bin", f"oatpp-{self.version}")] + else: + self.cpp_info.components["_oatpp-sqlite"].bindirs = [] self.cpp_info.components["_oatpp-sqlite"].libs = ["oatpp-sqlite"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_oatpp-sqlite"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.filenames["cmake_find_package"] = "oatpp-sqlite" + self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-sqlite" + self.cpp_info.names["cmake_find_package"] = "oatpp" + self.cpp_info.names["cmake_find_package_multi"] = "oatpp" + self.cpp_info.components["_oatpp-sqlite"].names["cmake_find_package"] = "oatpp-sqlite" + self.cpp_info.components["_oatpp-sqlite"].names["cmake_find_package_multi"] = "oatpp-sqlite" + self.cpp_info.components["_oatpp-sqlite"].set_property("cmake_target_name", "oatpp::oatpp-sqlite") self.cpp_info.components["_oatpp-sqlite"].requires = ["oatpp::oatpp", "sqlite3::sqlite3"] diff --git a/recipes/oatpp-sqlite/all/test_package/CMakeLists.txt b/recipes/oatpp-sqlite/all/test_package/CMakeLists.txt index 8b55c43a919b9..ca51c6a39660d 100644 --- a/recipes/oatpp-sqlite/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-sqlite/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(oatpp-sqlite REQUIRED) +find_package(oatpp-sqlite REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) - target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-sqlite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-sqlite/all/test_package/conanfile.py b/recipes/oatpp-sqlite/all/test_package/conanfile.py index 68d108b091ab2..0a6bc68712d90 100644 --- a/recipes/oatpp-sqlite/all/test_package/conanfile.py +++ b/recipes/oatpp-sqlite/all/test_package/conanfile.py @@ -1,21 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools - -class OatppSqliteTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) - # Current dir is "test_package/build/" and CMakeLists.txt is - # in "test_package" cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) - - + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/oatpp-sqlite/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-sqlite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ec8289a60ed9c --- /dev/null +++ b/recipes/oatpp-sqlite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(oatpp-sqlite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-sqlite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-sqlite/all/test_v1_package/conanfile.py b/recipes/oatpp-sqlite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/oatpp-sqlite/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 126c82ea8eda5d5a274c64b9d95727a487783076 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 16:45:38 +0200 Subject: [PATCH 439/561] (#13505) oatpp-openssl: conan v2 support --- recipes/oatpp-openssl/all/CMakeLists.txt | 7 - recipes/oatpp-openssl/all/conanfile.py | 120 ++++++++++-------- .../all/test_package/CMakeLists.txt | 13 +- .../all/test_package/conanfile.py | 20 ++- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 +++ 6 files changed, 115 insertions(+), 73 deletions(-) delete mode 100644 recipes/oatpp-openssl/all/CMakeLists.txt create mode 100644 recipes/oatpp-openssl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-openssl/all/test_v1_package/conanfile.py diff --git a/recipes/oatpp-openssl/all/CMakeLists.txt b/recipes/oatpp-openssl/all/CMakeLists.txt deleted file mode 100644 index 7b920d87ae627..0000000000000 --- a/recipes/oatpp-openssl/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) # Mininum as required oatpp -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/oatpp-openssl/all/conanfile.py b/recipes/oatpp-openssl/all/conanfile.py index b250393d708cc..d109d1b7545bb 100644 --- a/recipes/oatpp-openssl/all/conanfile.py +++ b/recipes/oatpp-openssl/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" + class OatppOpenSSLConan(ConanFile): name = "oatpp-openssl" @@ -11,21 +17,16 @@ class OatppOpenSSLConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "Oat++ OpenSSL library" topics = ("oat++", "oatpp", "openssl") - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "cmake", "cmake_find_package" - exports_sources = "CMakeLists.txt" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def config_options(self): if self.settings.os == "Windows": @@ -33,60 +34,75 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) - - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("oatpp-openssl can not be built as shared library on Windows") - - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("oatpp-openssl requires GCC >=5") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("oatpp/" + self.version) - self.requires("openssl/3.0.1") + self.requires(f"oatpp/{self.version}") + self.requires("openssl/3.0.5") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) - def _configure_cmake(self): - if self._cmake: - return self._cmake + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared library with msvc") - self._cmake = CMake(self) - self._cmake.definitions["OATPP_BUILD_TESTS"] = False - self._cmake.definitions["OATPP_MODULES_LOCATION"] = "INSTALLED" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OATPP_BUILD_TESTS"] = False + tc.variables["OATPP_MODULES_LOCATION"] = "INSTALLED" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.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): - self.cpp_info.filenames["cmake_find_package"] = "oatpp-openssl" - self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-openssl" self.cpp_info.set_property("cmake_file_name", "oatpp-openssl") - self.cpp_info.names["cmake_find_package"] = "oatpp" - self.cpp_info.names["cmake_find_package_multi"] = "oatpp" self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-openssl") - self.cpp_info.components["_oatpp-openssl"].names["cmake_find_package"] = "oatpp-openssl" - self.cpp_info.components["_oatpp-openssl"].names["cmake_find_package_multi"] = "oatpp-openssl" - self.cpp_info.components["_oatpp-openssl"].set_property("cmake_target_name", "oatpp::oatpp-openssl") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["_oatpp-openssl"].includedirs = [ - os.path.join("include", "oatpp-{}".format(self.version), "oatpp-openssl") + os.path.join("include", f"oatpp-{self.version}", "oatpp-openssl") ] - self.cpp_info.components["_oatpp-openssl"].libdirs = [os.path.join("lib", "oatpp-{}".format(self.version))] + self.cpp_info.components["_oatpp-openssl"].libdirs = [os.path.join("lib", f"oatpp-{self.version}")] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["_oatpp-openssl"].bindirs = [os.path.join("bin", f"oatpp-{self.version}")] + else: + self.cpp_info.components["_oatpp-openssl"].bindirs = [] self.cpp_info.components["_oatpp-openssl"].libs = ["oatpp-openssl"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_oatpp-openssl"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.filenames["cmake_find_package"] = "oatpp-openssl" + self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-openssl" + self.cpp_info.names["cmake_find_package"] = "oatpp" + self.cpp_info.names["cmake_find_package_multi"] = "oatpp" + self.cpp_info.components["_oatpp-openssl"].names["cmake_find_package"] = "oatpp-openssl" + self.cpp_info.components["_oatpp-openssl"].names["cmake_find_package_multi"] = "oatpp-openssl" + self.cpp_info.components["_oatpp-openssl"].set_property("cmake_target_name", "oatpp::oatpp-openssl") self.cpp_info.components["_oatpp-openssl"].requires = ["oatpp::oatpp", "openssl::openssl"] diff --git a/recipes/oatpp-openssl/all/test_package/CMakeLists.txt b/recipes/oatpp-openssl/all/test_package/CMakeLists.txt index b28526769f48c..716aedd7390f1 100644 --- a/recipes/oatpp-openssl/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-openssl/all/test_package/CMakeLists.txt @@ -1,13 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(oatpp-openssl REQUIRED) +find_package(oatpp-openssl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) - -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) - target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-openssl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-openssl/all/test_package/conanfile.py b/recipes/oatpp-openssl/all/test_package/conanfile.py index a77f6e7a20977..0a6bc68712d90 100644 --- a/recipes/oatpp-openssl/all/test_package/conanfile.py +++ b/recipes/oatpp-openssl/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, cmake_layout import os -from conans import ConanFile, CMake, tools -class OatppOpenSSLTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/oatpp-openssl/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-openssl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..07d783bdbcaec --- /dev/null +++ b/recipes/oatpp-openssl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(oatpp-openssl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-openssl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-openssl/all/test_v1_package/conanfile.py b/recipes/oatpp-openssl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/oatpp-openssl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 936eef000e6242193174c2d3e875d4c0a04c5150 Mon Sep 17 00:00:00 2001 From: cguentherTUChemnitz Date: Mon, 17 Oct 2022 17:04:47 +0200 Subject: [PATCH 440/561] (#13113) qpdf/11.1.1 add (lib only) package * initial conan qpdf package implementation * make conan check hooks green: missing new line on test_package.cpp * add current cmake as build_requirements * remove comments as requested from review * remove validation check from example, which was not validated for the current pacakge * remove implicit library depdendency from example * remove further comments from example * simplify test_package to just print QPDF_VERSION * provide crypto provider selection * reenable missing system lib dependency m * cope with minor linting warnings * add gnutls option as a placeholder, to activate later on but not change package-id * remove further comments * remove not matching cleanup for packaging * add minimal as possible pdf handling to test_package to ensure link-time dependency check * cope with unused lint warning * introduce jpeg dependency option * add conan v1 test * fix up test_v1_package for shared builds: correct the build env passing to v1 * convert line breaks * fix the visual code version number to select full C++14 supported compilers * try to migrate to is_msvc instead of own version comparison for vs compiler * remove duplicated test package source file * clean import statement * go for string based compiler version comparison * call binaries of the package directly without manual path determination to ensure they are exisiting in PATH * provide pkgconf as explicit build dependency, since msvc has it not preinstalled and the others are only green because of implicit shipment in ci env * revert import review change, since it triggers the linter * patch level update qpdf to 11.1.1 * fix missing version update entry in config.yml * try to fix linter on import statement * add packageConfigDeps and virtual build env to toolchain configure handling * current workaround for missing pkg_config dependency retrieval from cmake qpdf project: set PKG_CONFIG_PATH manually * switch to working openssl version as qpdf dependency * switch to libqpdf build only; patch qpdf cmake build files, injecting conans CMakeDeps * cope with linter warning * remove not anymore compiled binaries from test_v1 * apply review changes * disable mac shared builds * try to get around windows and mac shared lib missing symbols into libjpeg, potentially caused by private linkage of libjpeg * try to fix missing libjpeg symols problem for shared libs on windows according to review * provide cmake dependencies also to shared and static lib target directly and not only to the object lib * try to reenable mac os, since the missing symbols should be caused on windows and mac for same reason * reuse existing target_link_libraries calls and append conan libs to them instead of calling it multiple times * add missing public entries to target_link_libraries * move cmake deps out of atomic library check and set only once for every library type * remove wrongly reintroduces target_link_libraries from overwritten qpdf deps * try to fix msvc tests with code-path avoiding #warning macro * cope with linter error * add necessary compile-definition also to test_v1_package * cope with linter error * Update recipes/qpdf/all/conanfile.py Co-authored-by: Jordan Williams * Update recipes/qpdf/all/test_package/CMakeLists.txt Co-authored-by: Jordan Williams * Update recipes/qpdf/all/test_v1_package/CMakeLists.txt Co-authored-by: Jordan Williams * Update recipes/qpdf/all/conanfile.py Co-authored-by: Jordan Williams * Update recipes/qpdf/all/test_v1_package/CMakeLists.txt Co-authored-by: Jordan Williams * make it link correctly again * remove not anymore necessary way to provide conan dependencies via pkg_config, since we patch CMakeDeps already in the qpdf build * Update recipes/qpdf/all/conanfile.py Co-authored-by: Jordan Williams * Update recipes/qpdf/all/conanfile.py Co-authored-by: Jordan Williams * fix python function name definition * avoid cmake SEND_ERROR and FATAL_ERROR on patched-away dependency handling * fix patch base addresses * Update recipes/qpdf/all/conandata.yml Co-authored-by: Chris Mc * Update recipes/qpdf/all/conanfile.py Co-authored-by: Chris Mc * export example file with fixed path from binary instead of agrument from test_package/conanfile.py * clarify options names: with_crypto -> with_ssl; native -> internal * avoid code-duplication in patch-files, go for conditional python patching of already patched file instead * review-changes: add description and type for patches * follow more precise the documentation guideline * prepare gnutls config * deactivate special windows exernal lib handling * Patch found crypto flags, corresponding to conan options. This should finally fix windows plattform of not enabling openssl sources, even when conan does provide openssl. * update dependencies * remove slightly misleading comment Co-authored-by: Jordan Williams Co-authored-by: Chris Mc --- recipes/qpdf/all/conandata.yml | 12 ++ recipes/qpdf/all/conanfile.py | 181 ++++++++++++++++++ .../0001-libqpdf-cmake-deps-jpeg-zlib.patch | 113 +++++++++++ ...xclude-unnecessary-cmake-subprojects.patch | 17 ++ recipes/qpdf/all/test_package/CMakeLists.txt | 12 ++ recipes/qpdf/all/test_package/conanfile.py | 24 +++ .../qpdf/all/test_package/test_package.cpp | 21 ++ .../qpdf/all/test_v1_package/CMakeLists.txt | 15 ++ recipes/qpdf/all/test_v1_package/conanfile.py | 19 ++ recipes/qpdf/config.yml | 3 + 10 files changed, 417 insertions(+) create mode 100644 recipes/qpdf/all/conandata.yml create mode 100644 recipes/qpdf/all/conanfile.py create mode 100644 recipes/qpdf/all/patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch create mode 100644 recipes/qpdf/all/patches/0002-exclude-unnecessary-cmake-subprojects.patch create mode 100644 recipes/qpdf/all/test_package/CMakeLists.txt create mode 100644 recipes/qpdf/all/test_package/conanfile.py create mode 100644 recipes/qpdf/all/test_package/test_package.cpp create mode 100644 recipes/qpdf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qpdf/all/test_v1_package/conanfile.py create mode 100644 recipes/qpdf/config.yml diff --git a/recipes/qpdf/all/conandata.yml b/recipes/qpdf/all/conandata.yml new file mode 100644 index 0000000000000..6a5e7ead04475 --- /dev/null +++ b/recipes/qpdf/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "11.1.1": + url: "https://github.com/qpdf/qpdf/archive/refs/tags/v11.1.1.tar.gz" + sha256: "785edab622a1bc7e25e1537ad2c325005d48c5c7957f7abedff405deb80fa59a" +patches: + "11.1.1": + - patch_file: "patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch" + patch_description: "Inject Conan Deps, disable qpdf-dep handling: update libqpdf/CMakeLists.txt by disabling cmake fails, caused by pkg_config fail to find dependencies. Add conan generated cmake dependencies instead." + patch_type: "conan" + - patch_file: "patches/0002-exclude-unnecessary-cmake-subprojects.patch" + patch_description: "Exclude unnecessary targets: update CMakeLists.txt removing subdir includes for binaries, tests, examples, docs and fuzzing" + patch_type: "conan" diff --git a/recipes/qpdf/all/conanfile.py b/recipes/qpdf/all/conanfile.py new file mode 100644 index 0000000000000..749ef210e85f2 --- /dev/null +++ b/recipes/qpdf/all/conanfile.py @@ -0,0 +1,181 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.files import replace_in_file, apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.env import VirtualBuildEnv +import os + +required_conan_version = ">=1.52.0" + +class PackageConan(ConanFile): + name = "qpdf" + description = "QPDF is a command-line tool and C++ library that performs content-preserving transformations on PDF files." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/qpdf/qpdf" + topics = ("pdf") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": ["internal", "openssl", "gnutls"], + "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": "openssl", + "with_jpeg": "libjpeg", + } + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://qpdf.readthedocs.io/en/stable/installation.html#basic-dependencies + self.requires("zlib/1.2.13") + if self.options.with_ssl == "openssl": + self.requires("openssl/1.1.1q") + elif self.options.with_ssl == "gnutls": + raise ConanInvalidConfiguration("GnuTLS is not available in Conan Center yet.") + if self.options.with_jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") + + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + if is_msvc(self): + check_min_vs(self, "150") + else: + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support.") + + def build_requirements(self): + self.tool_requires("cmake/3.24.1") + self.tool_requires("pkgconf/1.9.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + # https://qpdf.readthedocs.io/en/latest/installation.html#build-time-crypto-selection + tc.variables["USE_IMPLICIT_CRYPTO"] = False + tc.cache_variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True + if self.options.with_ssl == "internal": + tc.variables["REQUIRE_CRYPTO_NATIVE"] = True + tc.variables["REQUIRE_CRYPTO_GNUTLS"] = False + tc.variables["REQUIRE_CRYPTO_OPENSSL"] = False + if self.options.with_ssl == "openssl": + tc.variables["REQUIRE_CRYPTO_NATIVE"] = False + tc.variables["REQUIRE_CRYPTO_GNUTLS"] = False + tc.variables["REQUIRE_CRYPTO_OPENSSL"] = True + if self.options.with_ssl == "gnutls": + tc.variables["REQUIRE_CRYPTO_NATIVE"] = False + tc.variables["REQUIRE_CRYPTO_GNUTLS"] = True + tc.variables["REQUIRE_CRYPTO_OPENSSL"] = False + tc.generate() + # TODO: after https://github.com/conan-io/conan/issues/11962 is solved + # we might obsolete here cmake deps generation and cmake patching and get + # the possibility to go for to pkg_config based dependency discovery instead. + # At the moment, even with the linked work-around, the linkage is mixed-up + tc = CMakeDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def _patch_sources(self): + apply_conandata_patches(self) + # we generally expect to have one crypto in-place, but need to patch the found mechanics + # since we avoid currently the correct pkg_config + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "set(FOUND_CRYPTO OFF)", "set(FOUND_CRYPTO ON)") + if self.options.with_ssl == "openssl": + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "set(USE_CRYPTO_OPENSSL OFF)", "set(USE_CRYPTO_OPENSSL ON)") + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "find_package(ZLIB REQUIRED)", + "find_package(ZLIB REQUIRED)\nfind_package(OpenSSL REQUIRED)\n") + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "PUBLIC JPEG::JPEG ZLIB::ZLIB", "PUBLIC JPEG::JPEG ZLIB::ZLIB OpenSSL::SSL") + if self.options.with_ssl == "gnutls": + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "set(USE_CRYPTO_GNUTLS OFF)", "set(USE_CRYPTO_GNUTLS ON)") + if self.options.with_ssl == "internal": + replace_in_file(self, os.path.join(self.source_folder, "libqpdf", "CMakeLists.txt"), + "set(USE_CRYPTO_NATIVE OFF)", "set(USE_CRYPTO_NATIVE ON)") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, 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, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "qpdf") + + self.cpp_info.components["libqpdf"].libs = ["qpdf"] + self.cpp_info.components["libqpdf"].set_property("pkg_config_name", "libqpdf") + self.cpp_info.components["libqpdf"].set_property("cmake_target_name", "qpdf::libqpdf") + self.cpp_info.components["libqpdf"].requires.append("zlib::zlib") + self.cpp_info.components["libqpdf"].requires.append(f"{self.options.with_jpeg}::{self.options.with_jpeg}") + + if self.options.with_ssl == "openssl": + self.cpp_info.components["libqpdf"].requires.append("openssl::openssl") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libqpdf"].system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "qpdf" + self.cpp_info.filenames["cmake_find_package_multi"] = "qpdf" + self.cpp_info.names["cmake_find_package"] = "qpdf" + self.cpp_info.names["cmake_find_package_multi"] = "qpdf" + self.cpp_info.components["libqpdf"].names["cmake_find_package"] = "libqpdf" + self.cpp_info.components["libqpdf"].names["cmake_find_package_multi"] = "libqpdf" diff --git a/recipes/qpdf/all/patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch b/recipes/qpdf/all/patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch new file mode 100644 index 0000000000000..0d8edceb557a6 --- /dev/null +++ b/recipes/qpdf/all/patches/0001-libqpdf-cmake-deps-jpeg-zlib.patch @@ -0,0 +1,113 @@ +diff --git a/libqpdf/CMakeLists.txt b/libqpdf/CMakeLists.txt +index 7053e205..9f5962f7 100644 +--- a/libqpdf/CMakeLists.txt ++++ b/libqpdf/CMakeLists.txt +@@ -128,13 +128,8 @@ include(CheckSymbolExists) + set(dep_include_directories) + set(dep_link_directories) + set(dep_link_libraries) +-set(ANYTHING_MISSING 0) + +-if(WIN32 AND (EXISTS ${qpdf_SOURCE_DIR}/external-libs)) +- set(EXTERNAL_LIBS 1) +-else() +- set(EXTERNAL_LIBS 0) +-endif() ++set(EXTERNAL_LIBS 0) + + if(EXTERNAL_LIBS) + set(EXTLIBDIR ${qpdf_SOURCE_DIR}/external-libs) +@@ -161,9 +156,6 @@ if(NOT EXTERNAL_LIBS) + if(ZLIB_H_PATH AND ZLIB_LIB_PATH) + list(APPEND dep_include_directories ${ZLIB_H_PATH}) + list(APPEND dep_link_libraries ${ZLIB_LIB_PATH}) +- else() +- message(SEND_ERROR "zlib not found") +- set(ANYTHING_MISSING 1) + endif() + endif() + endif() +@@ -182,9 +174,6 @@ if(NOT EXTERNAL_LIBS) + list(APPEND dep_include_directories ${LIBJPEG_H_PATH}) + list(APPEND dep_link_libraries ${LIBJPEG_LIB_PATH}) + set(JPEG_INCLUDE ${LIBJPEG_H_PATH}) +- else() +- message(SEND_ERROR "libjpeg not found") +- set(ANYTHING_MISSING 1) + endif() + endif() + endif() +@@ -220,9 +209,6 @@ if(USE_IMPLICIT_CRYPTO OR REQUIRE_CRYPTO_OPENSSL) + list(APPEND dep_link_libraries ${OPENSSL_LIB_PATH}) + set(USE_CRYPTO_OPENSSL ON) + set(FOUND_CRYPTO ON) +- elseif(REQUIRE_CRYPTO_OPENSSL) +- message(SEND_ERROR "openssl not found") +- set(ANYTHING_MISSING 1) + endif() + endif() + endif() +@@ -241,9 +227,6 @@ if(USE_IMPLICIT_CRYPTO OR REQUIRE_CRYPTO_GNUTLS) + list(APPEND dep_link_libraries ${GNUTLS_LIB_PATH}) + set(USE_CRYPTO_GNUTLS ON) + set(FOUND_CRYPTO ON) +- elseif(REQUIRE_CRYPTO_GNUTLS) +- message(SEND_ERROR "gnutls not found") +- set(ANYTHING_MISSING 1) + endif() + endif() + endif() +@@ -268,14 +251,9 @@ if(FOUND_CRYPTO) + set(DEFAULT_CRYPTO "native") + endif() + endif() +-else() +- message(SEND_ERROR "no crypto provider is available") +- set(ANYTHING_MISSING 1) +-endif() +-if(ANYTHING_MISSING) +- message(FATAL_ERROR "Missing dependencies; unable to continue") + endif() + ++ + message(STATUS "") + message(STATUS "*** Crypto Summary ***") + message(STATUS " GNU TLS crypto enabled: " ${USE_CRYPTO_GNUTLS}) +@@ -403,6 +381,10 @@ endif() + # use PIC for the object library so we don't have to compile twice. + set(OBJECT_LIB libqpdf_object) + add_library(${OBJECT_LIB} OBJECT ${libqpdf_SOURCES}) ++find_package(JPEG REQUIRED) ++find_package(ZLIB REQUIRED) ++target_link_libraries(${OBJECT_LIB} PUBLIC JPEG::JPEG ZLIB::ZLIB) ++ + if(OBJECT_LIB_IS_PIC) + target_compile_definitions(${OBJECT_LIB} PRIVATE libqpdf_EXPORTS) + endif() +@@ -498,8 +480,6 @@ if(BUILD_SHARED_LIBS) + PUBLIC + $ + $) +- target_link_directories(${SHARED_LIB} PRIVATE ${dep_link_directories}) +- target_link_libraries(${SHARED_LIB} PRIVATE ${dep_link_libraries}) + if(ATOMIC_LIBRARY) + target_link_libraries(${SHARED_LIB} PRIVATE ${ATOMIC_LIBRARY}) + endif() +@@ -507,6 +487,8 @@ if(BUILD_SHARED_LIBS) + target_link_options(${SHARED_LIB} PRIVATE ${LD_VERSION_FLAGS}) + endif() + ++ target_link_libraries(${SHARED_LIB} PUBLIC JPEG::JPEG ZLIB::ZLIB) ++ + target_include_directories(${SHARED_LIB} + PRIVATE ${qpdf_SOURCE_DIR}/libqpdf ${CMAKE_CURRENT_BINARY_DIR}) + +@@ -544,6 +526,8 @@ if(BUILD_STATIC_LIBS) + target_link_libraries(${STATIC_LIB} INTERFACE ${ATOMIC_LIBRARY}) + endif() + ++ target_link_libraries(${STATIC_LIB} PUBLIC JPEG::JPEG ZLIB::ZLIB) ++ + # Avoid name clashes on Windows with the the DLL import library. + if(NOT DEFINED STATIC_SUFFIX AND BUILD_SHARED_LIBS) + if (WIN32) diff --git a/recipes/qpdf/all/patches/0002-exclude-unnecessary-cmake-subprojects.patch b/recipes/qpdf/all/patches/0002-exclude-unnecessary-cmake-subprojects.patch new file mode 100644 index 0000000000000..2e40ca26d687e --- /dev/null +++ b/recipes/qpdf/all/patches/0002-exclude-unnecessary-cmake-subprojects.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5c0915f3..6c4945d3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -323,12 +323,6 @@ add_test( + # add_subdirectory order affects test order + add_subdirectory(include) + add_subdirectory(libqpdf) +-add_subdirectory(qpdf) +-add_subdirectory(libtests) +-add_subdirectory(examples) +-add_subdirectory(zlib-flate) +-add_subdirectory(manual) +-add_subdirectory(fuzz) + + # We don't need to show everything -- just the things that we really + # need to be sure are right or that are turned on or off with complex diff --git a/recipes/qpdf/all/test_package/CMakeLists.txt b/recipes/qpdf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2892d11ff1f83 --- /dev/null +++ b/recipes/qpdf/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +find_package(qpdf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qpdf::libqpdf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +# msvc has problems consuming #warning macro +# therefore we need a code-path in the include avoiding this warning https://github.com/qpdf/qpdf/issues/804 +target_compile_definitions(${PROJECT_NAME} PUBLIC POINTERHOLDER_TRANSITION=4) diff --git a/recipes/qpdf/all/test_package/conanfile.py b/recipes/qpdf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..57b63cfec4d16 --- /dev/null +++ b/recipes/qpdf/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/qpdf/all/test_package/test_package.cpp b/recipes/qpdf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f79386dd766bb --- /dev/null +++ b/recipes/qpdf/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + std::cout << "QPDF_VERSION " << QPDF_VERSION << "\n"; + + try { + QPDF pdf; + pdf.emptyPDF(); + QPDFWriter w(pdf, "empty_example.pdf"); + w.write(); + } catch (std::exception& e) { + std::cerr << e.what() << "\n"; + exit(2); + } + + return 0; +} diff --git a/recipes/qpdf/all/test_v1_package/CMakeLists.txt b/recipes/qpdf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ccb1cc676af03 --- /dev/null +++ b/recipes/qpdf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(qpdf REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qpdf::libqpdf) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +# msvc has problems consuming #warning macro +# therefore we need a code-path in the include avoiding this warning https://github.com/qpdf/qpdf/issues/804 +target_compile_definitions(${PROJECT_NAME} PUBLIC POINTERHOLDER_TRANSITION=4) diff --git a/recipes/qpdf/all/test_v1_package/conanfile.py b/recipes/qpdf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/qpdf/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qpdf/config.yml b/recipes/qpdf/config.yml new file mode 100644 index 0000000000000..35a13df3f72ef --- /dev/null +++ b/recipes/qpdf/config.yml @@ -0,0 +1,3 @@ +versions: + "11.1.1": + folder: all From 7c9b065df898fe7c4ca94c40f8f12cff13562962 Mon Sep 17 00:00:00 2001 From: Josh Faust <1388377+jfaust@users.noreply.github.com> Date: Mon, 17 Oct 2022 08:24:44 -0700 Subject: [PATCH 441/561] (#13430) cgltf: add version 1.13 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/cgltf/all/conandata.yml | 3 +++ recipes/cgltf/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cgltf/all/conandata.yml b/recipes/cgltf/all/conandata.yml index 690b56f17fa08..e54cb4331e847 100644 --- a/recipes/cgltf/all/conandata.yml +++ b/recipes/cgltf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.13": + url: "https://github.com/jkuhlmann/cgltf/archive/v1.13.tar.gz" + sha256: "053d5320097334767486c6e33d01dd1b1c6224eac82aac2d720f4ec456d8c50b" "1.12": url: "https://github.com/jkuhlmann/cgltf/archive/v1.12.tar.gz" sha256: "2c429bb26256b49bfed2510aef1e5fa9321b27fe4cf226c9ece9a5867150974f" diff --git a/recipes/cgltf/config.yml b/recipes/cgltf/config.yml index 134adfa22de6f..9f334f27c89c6 100644 --- a/recipes/cgltf/config.yml +++ b/recipes/cgltf/config.yml @@ -1,4 +1,6 @@ versions: + "1.13": + folder: all "1.12": folder: all "1.11": From dac3d78e797fb0bc1bf464020caf631539f32fe9 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 17:47:03 +0200 Subject: [PATCH 442/561] (#13501) libe57format: conan v2 support * conan v2 support * add missing include of limits to fix gcc11 * add libm to system libs * use self.dependencies Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/libe57format/all/CMakeLists.txt | 7 -- recipes/libe57format/all/conandata.yml | 4 +- recipes/libe57format/all/conanfile.py | 84 +++++++++---------- .../{fix-pic.patch => 0001-fix-pic.patch} | 0 .../all/patches/0002-missing-include.patch | 11 +++ .../all/test_package/CMakeLists.txt | 11 +-- .../all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../all/test_v1_package/conanfile.py | 17 ++++ 9 files changed, 100 insertions(+), 66 deletions(-) delete mode 100644 recipes/libe57format/all/CMakeLists.txt rename recipes/libe57format/all/patches/{fix-pic.patch => 0001-fix-pic.patch} (100%) create mode 100644 recipes/libe57format/all/patches/0002-missing-include.patch create mode 100644 recipes/libe57format/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libe57format/all/test_v1_package/conanfile.py diff --git a/recipes/libe57format/all/CMakeLists.txt b/recipes/libe57format/all/CMakeLists.txt deleted file mode 100644 index 9719e759ff2b5..0000000000000 --- a/recipes/libe57format/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/libe57format/all/conandata.yml b/recipes/libe57format/all/conandata.yml index 2431f660af552..ca42e36ed36ec 100644 --- a/recipes/libe57format/all/conandata.yml +++ b/recipes/libe57format/all/conandata.yml @@ -4,5 +4,5 @@ sources: url: "https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.2.0.tar.gz" patches: "2.2.0": - - patch_file: "patches/fix-pic.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-fix-pic.patch" + - patch_file: "patches/0002-missing-include.patch" diff --git a/recipes/libe57format/all/conanfile.py b/recipes/libe57format/all/conanfile.py index 0fbd3acb1699a..479e129d3bbf3 100644 --- a/recipes/libe57format/all/conanfile.py +++ b/recipes/libe57format/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class LibE57FormatConan(ConanFile): @@ -13,7 +16,7 @@ class LibE57FormatConan(ConanFile): description = "Library for reading & writing the E57 file format" topics = ("e57", "io", "point-cloud") - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -23,21 +26,8 @@ class LibE57FormatConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -45,66 +35,72 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("xerces-c/3.2.3") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + if self.info.settings.compiler.get_safe("cppstd"): + 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["USING_STATIC_XERCES"] = not self.options["xerces-c"].shared - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USING_STATIC_XERCES"] = not self.dependencies["xerces-c"].options.shared + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.md", 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")) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), {"E57Format": "E57Format::E57Format"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "e57format") self.cpp_info.set_property("cmake_target_name", "E57Format") suffix = "-d" if self.settings.build_type == "Debug" else "" - self.cpp_info.libs = ["E57Format{}".format(suffix)] - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.libs = [f"E57Format{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"] and not self.options.shared: + self.cpp_info.system_libs.extend(["m", "pthread"]) # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "e57format" diff --git a/recipes/libe57format/all/patches/fix-pic.patch b/recipes/libe57format/all/patches/0001-fix-pic.patch similarity index 100% rename from recipes/libe57format/all/patches/fix-pic.patch rename to recipes/libe57format/all/patches/0001-fix-pic.patch diff --git a/recipes/libe57format/all/patches/0002-missing-include.patch b/recipes/libe57format/all/patches/0002-missing-include.patch new file mode 100644 index 0000000000000..50253b05d6c2a --- /dev/null +++ b/recipes/libe57format/all/patches/0002-missing-include.patch @@ -0,0 +1,11 @@ +--- a/src/E57XmlParser.cpp ++++ b/src/E57XmlParser.cpp +@@ -42,6 +42,8 @@ + #include "StringNodeImpl.h" + #include "VectorNodeImpl.h" + ++#include ++ + using namespace e57; + using namespace XERCES_CPP_NAMESPACE; + diff --git a/recipes/libe57format/all/test_package/CMakeLists.txt b/recipes/libe57format/all/test_package/CMakeLists.txt index 2b2a28ed1bc7f..b8de16fa4046c 100644 --- a/recipes/libe57format/all/test_package/CMakeLists.txt +++ b/recipes/libe57format/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(e57format REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) - -find_package(e57format REQUIRED CONFIG) target_link_libraries(${PROJECT_NAME} PRIVATE E57Format) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libe57format/all/test_package/conanfile.py b/recipes/libe57format/all/test_package/conanfile.py index 49a3a66ea5bad..0a6bc68712d90 100644 --- a/recipes/libe57format/all/test_package/conanfile.py +++ b/recipes/libe57format/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libe57format/all/test_v1_package/CMakeLists.txt b/recipes/libe57format/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2bf6344a5bafd --- /dev/null +++ b/recipes/libe57format/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(e57format REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE E57Format) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libe57format/all/test_v1_package/conanfile.py b/recipes/libe57format/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libe57format/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From c6aba0696c3b0e53bb44961e409803ea1b3da8a5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 17 Oct 2022 18:05:07 +0200 Subject: [PATCH 443/561] (#13443) cgal: add version 5.5.1 --- recipes/cgal/all/conandata.yml | 3 +++ recipes/cgal/all/conanfile.py | 4 ++-- recipes/cgal/config.yml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/recipes/cgal/all/conandata.yml b/recipes/cgal/all/conandata.yml index 3e1bbd3d7b2e6..a9e86a3361343 100644 --- a/recipes/cgal/all/conandata.yml +++ b/recipes/cgal/all/conandata.yml @@ -14,3 +14,6 @@ sources: "5.5": sha256: 98ac395ca08aacf38b7a8170a822b650aedf10355df41dd0e4bfb238408e08a6 url: https://github.com/CGAL/cgal/releases/download/v5.5/CGAL-5.5.tar.xz + "5.5.1": + sha256: 091630def028facdcaf00eb5b68ad79eddac1b855cca6e87eef18a031566edfc + url: https://github.com/CGAL/cgal/releases/download/v5.5.1/CGAL-5.5.1.tar.xz diff --git a/recipes/cgal/all/conanfile.py b/recipes/cgal/all/conanfile.py index f62ead24fa3d7..47cc7c6fa95ce 100644 --- a/recipes/cgal/all/conanfile.py +++ b/recipes/cgal/all/conanfile.py @@ -11,8 +11,8 @@ class CgalConan(ConanFile): license = "GPL-3.0-or-later", "LGPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/CGAL/cgal" - description = "C++ library that aims to provide easy access to efficient and reliable algorithms"\ - "in computational geometry." + description = "C++ library that provides easy access to efficient and reliable algorithms"\ + " in computational geometry." topics = ("cgal", "geometry", "algorithms") settings = "os", "compiler", "build_type", "arch" generators = "cmake" diff --git a/recipes/cgal/config.yml b/recipes/cgal/config.yml index 857541c90fe5c..72209e170658c 100644 --- a/recipes/cgal/config.yml +++ b/recipes/cgal/config.yml @@ -9,3 +9,5 @@ versions: folder: all "5.5": folder: all + "5.5.1": + folder: all From 24ea2b48bb76a64cd7d2c8f4ff11fbae5b69c6a6 Mon Sep 17 00:00:00 2001 From: Eric Riff <57375845+ericriff@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:24:44 -0300 Subject: [PATCH 444/561] (#13492) libsvm: Add version 330 & modernize recipe * Add version 330 * Modernize recipe * Use fstring * Clean up topics Co-authored-by: Jordan Williams * Link privately Co-authored-by: Jordan Williams * Link privately * Fix system libs * Use "src" as source subfolder for consistency with other recipes. Pass the source dir as a variable also for consistency. * Use new copy method Co-authored-by: Jordan Williams * Be explicit about the licences path Co-authored-by: Uilian Ries * Add missing GNUInstallDirs include * Fix typo Co-authored-by: Jordan Williams Co-authored-by: Uilian Ries --- recipes/libsvm/all/CMakeLists.txt | 17 +++--- recipes/libsvm/all/conandata.yml | 3 + recipes/libsvm/all/conanfile.py | 61 +++++++++++-------- .../libsvm/all/test_package/CMakeLists.txt | 5 +- recipes/libsvm/all/test_package/conanfile.py | 21 +++++-- .../libsvm/all/test_v1_package/CMakeLists.txt | 10 +++ .../libsvm/all/test_v1_package/conanfile.py | 18 ++++++ recipes/libsvm/config.yml | 2 + 8 files changed, 93 insertions(+), 44 deletions(-) create mode 100644 recipes/libsvm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsvm/all/test_v1_package/conanfile.py diff --git a/recipes/libsvm/all/CMakeLists.txt b/recipes/libsvm/all/CMakeLists.txt index 94b3d9d728f7d..3c3e2d6052401 100644 --- a/recipes/libsvm/all/CMakeLists.txt +++ b/recipes/libsvm/all/CMakeLists.txt @@ -1,20 +1,19 @@ cmake_minimum_required(VERSION 3.4) project(svm C CXX) -include(${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +include(GNUInstallDirs) -add_library(svm source_subfolder/svm.cpp) +add_library(svm ${LIBSVM_SRC_DIR}/svm.cpp) set_property(TARGET svm PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) -set_target_properties(svm PROPERTIES PUBLIC_HEADER source_subfolder/svm.h) +set_target_properties(svm PROPERTIES PUBLIC_HEADER ${LIBSVM_SRC_DIR}/svm.h) -add_executable(svm-predict source_subfolder/svm-predict.c) +add_executable(svm-predict ${LIBSVM_SRC_DIR}/svm-predict.c) target_link_libraries(svm-predict svm) -add_executable(svm-train source_subfolder/svm-train.c) +add_executable(svm-train ${LIBSVM_SRC_DIR}/svm-train.c) target_link_libraries(svm-train svm) -add_executable(svm-scale source_subfolder/svm-scale.c) +add_executable(svm-scale ${LIBSVM_SRC_DIR}/svm-scale.c) install(TARGETS svm RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -23,4 +22,6 @@ install(TARGETS svm PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/svm ) -install(TARGETS svm-predict svm-train svm-scale DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(TARGETS svm-predict svm-train svm-scale + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) diff --git a/recipes/libsvm/all/conandata.yml b/recipes/libsvm/all/conandata.yml index 5cf318b9846a6..5712311441eb3 100644 --- a/recipes/libsvm/all/conandata.yml +++ b/recipes/libsvm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "330": + url: "https://github.com/cjlin1/libsvm/archive/v330.tar.gz" + sha256: "e4fe41308c87cc210aec73e4f5f0fb4da14234d90e7a131763fbad3788ca2d80" "325": url: "https://github.com/cjlin1/libsvm/archive/v325.tar.gz" sha256: "1f587ec0df6fd422dfe50f942f8836ac179b0723b768fe9d2fabdfd1601a0963" diff --git a/recipes/libsvm/all/conanfile.py b/recipes/libsvm/all/conanfile.py index 794619a3eb1c5..897e5749def0c 100644 --- a/recipes/libsvm/all/conanfile.py +++ b/recipes/libsvm/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy -required_conan_version = ">=1.33.0" +import os +required_conan_version = ">=1.52.0" class libsvmConan(ConanFile): name = "libsvm" @@ -10,17 +13,16 @@ class libsvmConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/" license = "BSD-3-Clause" - topics = ("conan", "svm", "vector") - exports_sources = ["CMakeLists.txt"] - generators = "cmake" + topics = "svm", "vector" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } def config_options(self): if self.settings.os == "Windows": @@ -37,30 +39,35 @@ def validate(self): self.options.shared ): raise ConanInvalidConfiguration( - "{} can not be built as shared library + runtime {}.".format( - self.name, - self.settings.compiler.runtime - ) + f"{self.name} can not be built as shared library + runtime {self.settings.compiler.runtime}." ) + def layout(self): + cmake_layout(self, src_folder="src") + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBSVM_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy("COPYRIGHT", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): self.cpp_info.libs = ["svm"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/libsvm/all/test_package/CMakeLists.txt b/recipes/libsvm/all/test_package/CMakeLists.txt index 37cb8eb98e622..40fb8732f7ba3 100644 --- a/recipes/libsvm/all/test_package/CMakeLists.txt +++ b/recipes/libsvm/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libsvm CONFIG REQUIRED) add_executable(test_package test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS}) +target_link_libraries(test_package PRIVATE libsvm::libsvm) diff --git a/recipes/libsvm/all/test_package/conanfile.py b/recipes/libsvm/all/test_package/conanfile.py index a59a26a52c8dc..1a65f5a41c626 100644 --- a/recipes/libsvm/all/test_package/conanfile.py +++ b/recipes/libsvm/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + 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,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libsvm/all/test_v1_package/CMakeLists.txt b/recipes/libsvm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..053cf33af70e5 --- /dev/null +++ b/recipes/libsvm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libsvm CONFIG REQUIRED) + +add_executable(test_package ../test_package/test_package.cpp) +target_link_libraries(test_package PRIVATE libsvm::libsvm) diff --git a/recipes/libsvm/all/test_v1_package/conanfile.py b/recipes/libsvm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c1c8554eae243 --- /dev/null +++ b/recipes/libsvm/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building + +import os + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libsvm/config.yml b/recipes/libsvm/config.yml index eee94a5e39ec3..026fbb9e30356 100644 --- a/recipes/libsvm/config.yml +++ b/recipes/libsvm/config.yml @@ -1,4 +1,6 @@ versions: + "330": + folder: all "325": folder: all "324": From 167806208975d053938a5b60f4b43b2aae04d469 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 18:45:28 +0200 Subject: [PATCH 445/561] (#13506) oatpp-postgresql: conan v2 support --- recipes/oatpp-postgresql/all/CMakeLists.txt | 7 - recipes/oatpp-postgresql/all/conandata.yml | 8 +- recipes/oatpp-postgresql/all/conanfile.py | 125 ++++++++++-------- .../all/test_package/CMakeLists.txt | 9 +- .../all/test_package/conanfile.py | 23 ++-- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 +++ 7 files changed, 118 insertions(+), 82 deletions(-) delete mode 100644 recipes/oatpp-postgresql/all/CMakeLists.txt create mode 100644 recipes/oatpp-postgresql/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-postgresql/all/test_v1_package/conanfile.py diff --git a/recipes/oatpp-postgresql/all/CMakeLists.txt b/recipes/oatpp-postgresql/all/CMakeLists.txt deleted file mode 100644 index d32836cbae4aa..0000000000000 --- a/recipes/oatpp-postgresql/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/oatpp-postgresql/all/conandata.yml b/recipes/oatpp-postgresql/all/conandata.yml index dc5c0e7bf5a99..3a58631f67a6d 100644 --- a/recipes/oatpp-postgresql/all/conandata.yml +++ b/recipes/oatpp-postgresql/all/conandata.yml @@ -11,10 +11,8 @@ sources: patches: "1.3.0": - patch_file: "patches/1.3.0/01-add-bigobj.patch" - base_path: "source_subfolder" "1.2.5": - patch_file: "patches/1.2.5/01-fix-windows-build.patch" - base_path: "source_subfolder" - # patch_type: portability - # patch_source: https://github.com/oatpp/oatpp-postgresql/pull/8 - # patch_description: Fix build error in Windows. + patch_description: Fix build error in Windows. + patch_type: portability + patch_source: https://github.com/oatpp/oatpp-postgresql/pull/8 diff --git a/recipes/oatpp-postgresql/all/conanfile.py b/recipes/oatpp-postgresql/all/conanfile.py index c223c73c7d01d..5aa80c1777d6d 100644 --- a/recipes/oatpp-postgresql/all/conanfile.py +++ b/recipes/oatpp-postgresql/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class OatppPostgresqlConan(ConanFile): @@ -12,25 +17,19 @@ class OatppPostgresqlConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "oat++ PostgreSQL library" topics = ("oat", "postgresql", "orm", "database") - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "cmake", "cmake_find_package" - - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -38,62 +37,76 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + try: + del self.options.fPIC + except Exception: + pass - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("oatpp-postgresql can not be built as shared library on Windows") - - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("oatpp-postgresql requires GCC >=5") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("oatpp/{}".format(self.version)) - self.requires("libpq/13.4") + self.requires(f"oatpp/{self.version}") + self.requires("libpq/14.5") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) - def _configure_cmake(self): - if self._cmake: - return self._cmake + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared library with msvc") - self._cmake = CMake(self) - self._cmake.definitions["OATPP_BUILD_TESTS"] = False - self._cmake.definitions["OATPP_MODULES_LOCATION"] = "INSTALLED" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OATPP_BUILD_TESTS"] = False + tc.variables["OATPP_MODULES_LOCATION"] = "INSTALLED" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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): - self.cpp_info.filenames["cmake_find_package"] = "oatpp-postgresql" - self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-postgresql" self.cpp_info.set_property("cmake_file_name", "oatpp-postgresql") - self.cpp_info.names["cmake_find_package"] = "oatpp" - self.cpp_info.names["cmake_find_package_multi"] = "oatpp" self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-postgresql") - self.cpp_info.components["_oatpp-postgresql"].names["cmake_find_package"] = "oatpp-postgresql" - self.cpp_info.components["_oatpp-postgresql"].names["cmake_find_package_multi"] = "oatpp-postgresql" - self.cpp_info.components["_oatpp-postgresql"].set_property("cmake_target_name", "oatpp::oatpp-postgresql") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["_oatpp-postgresql"].includedirs = [ - os.path.join("include", "oatpp-{}".format(self.version), "oatpp-postgresql") + os.path.join("include", f"oatpp-{self.version}", "oatpp-postgresql") ] - self.cpp_info.components["_oatpp-postgresql"].libdirs = [os.path.join("lib", "oatpp-{}".format(self.version))] + self.cpp_info.components["_oatpp-postgresql"].libdirs = [os.path.join("lib", f"oatpp-{self.version}")] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["_oatpp-postgresql"].bindirs = [os.path.join("bin", f"oatpp-{self.version}")] + else: + self.cpp_info.components["_oatpp-postgresql"].bindirs = [] self.cpp_info.components["_oatpp-postgresql"].libs = ["oatpp-postgresql"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_oatpp-postgresql"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.filenames["cmake_find_package"] = "oatpp-postgresql" + self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-postgresql" + self.cpp_info.names["cmake_find_package"] = "oatpp" + self.cpp_info.names["cmake_find_package_multi"] = "oatpp" + self.cpp_info.components["_oatpp-postgresql"].names["cmake_find_package"] = "oatpp-postgresql" + self.cpp_info.components["_oatpp-postgresql"].names["cmake_find_package_multi"] = "oatpp-postgresql" + self.cpp_info.components["_oatpp-postgresql"].set_property("cmake_target_name", "oatpp::oatpp-postgresql") self.cpp_info.components["_oatpp-postgresql"].requires = ["oatpp::oatpp", "libpq::libpq"] diff --git a/recipes/oatpp-postgresql/all/test_package/CMakeLists.txt b/recipes/oatpp-postgresql/all/test_package/CMakeLists.txt index 6528f26999838..3e6651b60950e 100644 --- a/recipes/oatpp-postgresql/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-postgresql/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(oatpp-postgresql REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-postgresql) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-postgresql/all/test_package/conanfile.py b/recipes/oatpp-postgresql/all/test_package/conanfile.py index 30f0822166f0d..0a6bc68712d90 100644 --- a/recipes/oatpp-postgresql/all/test_package/conanfile.py +++ b/recipes/oatpp-postgresql/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools - -class OatppPostgresqlTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,7 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) - - + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/oatpp-postgresql/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-postgresql/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5d0c80f735ffb --- /dev/null +++ b/recipes/oatpp-postgresql/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(oatpp-postgresql REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-postgresql) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-postgresql/all/test_v1_package/conanfile.py b/recipes/oatpp-postgresql/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/oatpp-postgresql/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 64732d641eab8e2cca89c05d8a87d11c7b380425 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 19:04:38 +0200 Subject: [PATCH 446/561] (#13507) oatpp-swagger: conan v2 support --- recipes/oatpp-swagger/all/CMakeLists.txt | 7 - recipes/oatpp-swagger/all/conanfile.py | 129 ++++++++++-------- .../all/test_package/CMakeLists.txt | 13 +- .../all/test_package/conanfile.py | 23 ++-- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 +++ 6 files changed, 119 insertions(+), 81 deletions(-) delete mode 100644 recipes/oatpp-swagger/all/CMakeLists.txt create mode 100644 recipes/oatpp-swagger/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-swagger/all/test_v1_package/conanfile.py diff --git a/recipes/oatpp-swagger/all/CMakeLists.txt b/recipes/oatpp-swagger/all/CMakeLists.txt deleted file mode 100644 index d32836cbae4aa..0000000000000 --- a/recipes/oatpp-swagger/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/oatpp-swagger/all/conanfile.py b/recipes/oatpp-swagger/all/conanfile.py index 862bd63348b83..0f264dec12f02 100644 --- a/recipes/oatpp-swagger/all/conanfile.py +++ b/recipes/oatpp-swagger/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" + class OatppSwaggerConan(ConanFile): name = "oatpp-swagger" @@ -11,21 +17,16 @@ class OatppSwaggerConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "oat++ Swagger library" topics = ("oat++", "oatpp", "swagger") - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "cmake", "cmake_find_package" - exports_sources = "CMakeLists.txt" - - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def config_options(self): if self.settings.os == "Windows": @@ -33,66 +34,80 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + try: + del self.options.fPIC + except Exception: + pass - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("oatpp-swagger can not be built as shared library on Windows") - - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("oatpp-swagger requires GCC >=5") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("oatpp/" + self.version) + self.requires(f"oatpp/{self.version}") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared library with msvc") - def _configure_cmake(self): - if self._cmake: - return self._cmake + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=5") - self._cmake = CMake(self) - self._cmake.definitions["OATPP_BUILD_TESTS"] = False - self._cmake.definitions["OATPP_MODULES_LOCATION"] = "INSTALLED" - if tools.Version(self.version) >= "1.3.0" and self.settings.compiler == "Visual Studio": - self._cmake.definitions["OATPP_MSVC_LINK_STATIC_RUNTIME"] = self.settings.compiler.runtime in ["MT", "MTd"] - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OATPP_BUILD_TESTS"] = False + tc.variables["OATPP_MODULES_LOCATION"] = "INSTALLED" + if Version(self.version) >= "1.3.0" and is_msvc(self): + tc.variables["OATPP_MSVC_LINK_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.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): - self.cpp_info.filenames["cmake_find_package"] = "oatpp-swagger" - self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-swagger" self.cpp_info.set_property("cmake_file_name", "oatpp-swagger") - self.cpp_info.names["cmake_find_package"] = "oatpp" - self.cpp_info.names["cmake_find_package_multi"] = "oatpp" self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-swagger") - self.cpp_info.components["_oatpp-swagger"].names["cmake_find_package"] = "oatpp-swagger" - self.cpp_info.components["_oatpp-swagger"].names["cmake_find_package_multi"] = "oatpp-swagger" - self.cpp_info.components["_oatpp-swagger"].set_property("cmake_target_name", "oatpp::oatpp-swagger") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["_oatpp-swagger"].includedirs = [ - os.path.join("include", "oatpp-{}".format(self.version), "oatpp-swagger") + os.path.join("include", f"oatpp-{self.version}", "oatpp-swagger") ] - self.cpp_info.components["_oatpp-swagger"].libdirs = [os.path.join("lib", "oatpp-{}".format(self.version))] + self.cpp_info.components["_oatpp-swagger"].libdirs = [os.path.join("lib", f"oatpp-{self.version}")] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["_oatpp-swagger"].bindirs = [os.path.join("bin", f"oatpp-{self.version}")] + else: + self.cpp_info.components["_oatpp-swagger"].bindirs = [] self.cpp_info.components["_oatpp-swagger"].libs = ["oatpp-swagger"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_oatpp-swagger"].system_libs = ["pthread"] - self.cpp_info.components["_oatpp-swagger"].requires = ["oatpp::oatpp"] # export env var - res_path = os.path.join(self.package_folder, "include", "oatpp-{}".format(self.version), "bin", "oatpp-swagger", "res") - self.output.info("Creating OATPP_SWAGGER_RES_PATH environment variable: {}".format(res_path)) - self.env_info.OATPP_SWAGGER_RES_PATH = res_path + res_path = os.path.join(self.package_folder, "include", f"oatpp-{self.version}", "bin", "oatpp-swagger", "res") self.runenv_info.prepend_path("OATPP_SWAGGER_RES_PATH", res_path) + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.filenames["cmake_find_package"] = "oatpp-swagger" + self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-swagger" + self.cpp_info.names["cmake_find_package"] = "oatpp" + self.cpp_info.names["cmake_find_package_multi"] = "oatpp" + self.cpp_info.components["_oatpp-swagger"].names["cmake_find_package"] = "oatpp-swagger" + self.cpp_info.components["_oatpp-swagger"].names["cmake_find_package_multi"] = "oatpp-swagger" + self.cpp_info.components["_oatpp-swagger"].set_property("cmake_target_name", "oatpp::oatpp-swagger") + self.cpp_info.components["_oatpp-swagger"].requires = ["oatpp::oatpp"] + self.env_info.OATPP_SWAGGER_RES_PATH = res_path diff --git a/recipes/oatpp-swagger/all/test_package/CMakeLists.txt b/recipes/oatpp-swagger/all/test_package/CMakeLists.txt index a30f4f9f8f19b..bc689c85dba9b 100644 --- a/recipes/oatpp-swagger/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-swagger/all/test_package/CMakeLists.txt @@ -1,13 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(oatpp-swagger REQUIRED) +find_package(oatpp-swagger REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) - -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) - target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-swagger) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-swagger/all/test_package/conanfile.py b/recipes/oatpp-swagger/all/test_package/conanfile.py index 3cd3965663c04..0a6bc68712d90 100644 --- a/recipes/oatpp-swagger/all/test_package/conanfile.py +++ b/recipes/oatpp-swagger/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools - -class OatppSwaggerTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,7 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) - - + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/oatpp-swagger/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-swagger/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9c51a16ee8925 --- /dev/null +++ b/recipes/oatpp-swagger/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(oatpp-swagger REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-swagger) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-swagger/all/test_v1_package/conanfile.py b/recipes/oatpp-swagger/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/oatpp-swagger/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 0f355ca2f3cdaa72e29483f7344f1c1f6c22f923 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Mon, 17 Oct 2022 20:24:37 +0300 Subject: [PATCH 447/561] (#13386) onetbb: add version 2021.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * check compiler version for all Apple platforms * add version 2021.6.0 * don't skip linter in v1 test package * add required system libs for Linux/FreeBSD Co-authored-by: Christian Günther * raise ConanInvalidConfiguration when attempting to make static build Co-authored-by: Christian Günther --- recipes/onetbb/all/conandata.yml | 3 ++ recipes/onetbb/all/conanfile.py | 28 +++++++++++++++---- .../onetbb/all/test_v1_package/conanfile.py | 1 - recipes/onetbb/config.yml | 2 ++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/recipes/onetbb/all/conandata.yml b/recipes/onetbb/all/conandata.yml index ea0c621b1ec0c..8284437159176 100644 --- a/recipes/onetbb/all/conandata.yml +++ b/recipes/onetbb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2021.6.0": + url: "https://github.com/oneapi-src/oneTBB/archive/v2021.6.0.tar.gz" + sha256: "4897dd106d573e9dacda8509ca5af1a0e008755bf9c383ef6777ac490223031f" "2021.3.0": url: "https://github.com/oneapi-src/oneTBB/archive/v2021.3.0.tar.gz" sha256: "8f616561603695bbb83871875d2c6051ea28f8187dbe59299961369904d1d49e" diff --git a/recipes/onetbb/all/conanfile.py b/recipes/onetbb/all/conanfile.py index 0a0702971da74..c0f1359419b8c 100644 --- a/recipes/onetbb/all/conanfile.py +++ b/recipes/onetbb/all/conanfile.py @@ -1,12 +1,13 @@ 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, load, rmdir from conan.tools.scm import Version import os import re -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.51.3" class OneTBBConan(ConanFile): @@ -26,17 +27,21 @@ class OneTBBConan(ConanFile): "fPIC": [True, False], "tbbmalloc": [True, False], "tbbproxy": [True, False], + "interprocedural_optimization": [True, False], } default_options = { "shared": True, "fPIC": True, "tbbmalloc": False, "tbbproxy": False, + "interprocedural_optimization": True, } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if not (Version(self.version) >= "2021.6.0" and self.options.shared and self.settings.os != "Android"): + del self.options.interprocedural_optimization if Version(self.version) < "2021.2.0": del self.options.shared del self.options.fPIC @@ -46,11 +51,12 @@ def configure(self): del self.options.fPIC def package_id(self): - del self.info.options.tbbmalloc - del self.info.options.tbbproxy + if Version(self.version) < "2021.6.0": + del self.info.options.tbbmalloc + del self.info.options.tbbproxy def validate(self): - if (self.settings.os == "Macos" + if (is_apple_os(self) and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "11.0"): raise ConanInvalidConfiguration( @@ -59,6 +65,12 @@ def validate(self): self.version, )) if not self.options.get_safe("shared", True): + if Version(self.version) >= "2021.6.0": + raise ConanInvalidConfiguration( + "Building oneTBB as a static library is highly discouraged and not supported " + "to avoid unforeseen issues like https://github.com/oneapi-src/oneTBB/issues/920. " + "Please consider fixing at least the aforementioned issue in upstream." + ) self.output.warn( "oneTBB strongly discourages usage of static linkage") if (self.options.tbbproxy @@ -78,6 +90,10 @@ def generate(self): toolchain = CMakeToolchain(self) toolchain.variables["TBB_TEST"] = False toolchain.variables["TBB_STRICT"] = False + if Version(self.version) >= "2021.6.0": + toolchain.variables["TBBMALLOC_BUILD"] = self.options.tbbmalloc + toolchain.variables["TBBMALLOC_PROXY_BUILD"] = self.options.tbbproxy + toolchain.variables["TBB_ENABLE_IPO"] = self.options.get_safe("interprocedural_optimization", False) toolchain.generate() def build(self): @@ -120,7 +136,7 @@ def lib_name(name): ) tbb.libs.append(lib_name("tbb{}".format(binary_version))) if self.settings.os in ["Linux", "FreeBSD"]: - tbb.system_libs = ["dl", "rt", "pthread"] + tbb.system_libs = ["m", "dl", "rt", "pthread"] # tbbmalloc if self.options.tbbmalloc: @@ -138,6 +154,8 @@ def lib_name(name): tbbproxy.set_property("cmake_target_name", "TBB::tbbmalloc_proxy") tbbproxy.libs = [lib_name("tbbmalloc_proxy")] tbbproxy.requires = ["tbbmalloc"] + if self.settings.os in ["Linux", "FreeBSD"]: + tbbproxy.system_libs = ["m", "dl", "pthread"] # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "TBB" diff --git a/recipes/onetbb/all/test_v1_package/conanfile.py b/recipes/onetbb/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/onetbb/all/test_v1_package/conanfile.py +++ b/recipes/onetbb/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/onetbb/config.yml b/recipes/onetbb/config.yml index 198048be7bd45..4fc6c42cf957b 100644 --- a/recipes/onetbb/config.yml +++ b/recipes/onetbb/config.yml @@ -1,4 +1,6 @@ versions: + "2021.6.0": + folder: all "2021.3.0": folder: all "2020.3": From 21fc6a1c96c322dc3489a1f794ab75880fd9c69b Mon Sep 17 00:00:00 2001 From: Sebastian Morgenstern Date: Mon, 17 Oct 2022 19:45:07 +0200 Subject: [PATCH 448/561] (#13435) openssl: updated url for old 1.x versions * openssl: added 1.1.1r fixed url sources * openssl: remove 1.1.1r release * openssl: added new urls to old releases * openssl: fixex yaml syntax * openssl: fixed yaml intentation * openssl: revert url pathes for 3.x * openhab: forgot endofline --- recipes/openssl/1.x.x/conandata.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/openssl/1.x.x/conandata.yml b/recipes/openssl/1.x.x/conandata.yml index b4834a9996ead..f5decdd72359f 100644 --- a/recipes/openssl/1.x.x/conandata.yml +++ b/recipes/openssl/1.x.x/conandata.yml @@ -3,31 +3,31 @@ sources: sha256: ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16 url: [ "https://www.openssl.org/source/openssl-1.0.2u.tar.gz", - "https://www.openssl.org/source/old/openssl-1.0.2u.tar.gz" + "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz" ] 1.1.0l: sha256: 74a2f756c64fd7386a29184dc0344f4831192d61dc2481a93a4c5dd727f41148 url: [ "https://www.openssl.org/source/openssl-1.1.0l.tar.gz", - "https://www.openssl.org/source/old/openssl-1.1.0l.tar.gz" + "https://www.openssl.org/source/old/1.1.0/openssl-1.1.0l.tar.gz" ] 1.1.1o: sha256: 9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f url: [ "https://www.openssl.org/source/openssl-1.1.1o.tar.gz", - "https://www.openssl.org/source/old/openssl-1.1.1o.tar.gz" + "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1o.tar.gz" ] 1.1.1p: sha256: bf61b62aaa66c7c7639942a94de4c9ae8280c08f17d4eac2e44644d9fc8ace6f url: [ "https://www.openssl.org/source/openssl-1.1.1p.tar.gz", - "https://www.openssl.org/source/old/openssl-1.1.1p.tar.gz" + "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1p.tar.gz" ] 1.1.1q: sha256: d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca url: [ "https://www.openssl.org/source/openssl-1.1.1q.tar.gz", - "https://www.openssl.org/source/old/openssl-1.1.1q.tar.gz" + "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1q.tar.gz" ] patches: 1.0.2u: From 4a24d7696fda618f56c5a19499f62bd10ff39568 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 20:41:23 +0200 Subject: [PATCH 449/561] (#13508) oatpp-libressl: conan v2 support --- recipes/oatpp-libressl/all/CMakeLists.txt | 7 - recipes/oatpp-libressl/all/conanfile.py | 120 ++++++++++-------- .../all/test_package/CMakeLists.txt | 17 +-- .../all/test_package/conanfile.py | 20 ++- ...tpp-libressl-test.cpp => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 +++ 7 files changed, 117 insertions(+), 75 deletions(-) delete mode 100644 recipes/oatpp-libressl/all/CMakeLists.txt rename recipes/oatpp-libressl/all/test_package/{oatpp-libressl-test.cpp => test_package.cpp} (100%) create mode 100644 recipes/oatpp-libressl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-libressl/all/test_v1_package/conanfile.py diff --git a/recipes/oatpp-libressl/all/CMakeLists.txt b/recipes/oatpp-libressl/all/CMakeLists.txt deleted file mode 100644 index 7b920d87ae627..0000000000000 --- a/recipes/oatpp-libressl/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) # Mininum as required oatpp -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/oatpp-libressl/all/conanfile.py b/recipes/oatpp-libressl/all/conanfile.py index 64ed19cdac443..6eec475cde13d 100644 --- a/recipes/oatpp-libressl/all/conanfile.py +++ b/recipes/oatpp-libressl/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" + class OatppLibresslConan(ConanFile): name = "oatpp-libressl" @@ -11,21 +17,16 @@ class OatppLibresslConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "oat++ libressl library" topics = ("oat++", "oatpp", "libressl") - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "cmake", "cmake_find_package" - exports_sources = "CMakeLists.txt" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def config_options(self): if self.settings.os == "Windows": @@ -33,60 +34,75 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) - - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("oatpp-libressl can not be built as shared library on Windows") - - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("oatpp-libressl requires GCC >=5") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("oatpp/" + self.version) - self.requires("libressl/3.2.1") + self.requires(f"oatpp/{self.version}") + self.requires("libressl/3.5.3") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) - def _configure_cmake(self): - if self._cmake: - return self._cmake + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared library with msvc") - self._cmake = CMake(self) - self._cmake.definitions["OATPP_BUILD_TESTS"] = False - self._cmake.definitions["OATPP_MODULES_LOCATION"] = "INSTALLED" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OATPP_BUILD_TESTS"] = False + tc.variables["OATPP_MODULES_LOCATION"] = "INSTALLED" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.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): - self.cpp_info.filenames["cmake_find_package"] = "oatpp-libressl" - self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-libressl" self.cpp_info.set_property("cmake_file_name", "oatpp-libressl") - self.cpp_info.names["cmake_find_package"] = "oatpp" - self.cpp_info.names["cmake_find_package_multi"] = "oatpp" self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-libressl") - self.cpp_info.components["_oatpp-libressl"].names["cmake_find_package"] = "oatpp-libressl" - self.cpp_info.components["_oatpp-libressl"].names["cmake_find_package_multi"] = "oatpp-libressl" - self.cpp_info.components["_oatpp-libressl"].set_property("cmake_target_name", "oatpp::oatpp-libressl") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["_oatpp-libressl"].includedirs = [ - os.path.join("include", "oatpp-{}".format(self.version), "oatpp-libressl") + os.path.join("include", f"oatpp-{self.version}", "oatpp-libressl") ] - self.cpp_info.components["_oatpp-libressl"].libdirs = [os.path.join("lib", "oatpp-{}".format(self.version))] + self.cpp_info.components["_oatpp-libressl"].libdirs = [os.path.join("lib", f"oatpp-{self.version}")] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["_oatpp-libressl"].bindirs = [os.path.join("bin", f"oatpp-{self.version}")] + else: + self.cpp_info.components["_oatpp-libressl"].bindirs = [] self.cpp_info.components["_oatpp-libressl"].libs = ["oatpp-libressl"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_oatpp-libressl"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.filenames["cmake_find_package"] = "oatpp-libressl" + self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-libressl" + self.cpp_info.names["cmake_find_package"] = "oatpp" + self.cpp_info.names["cmake_find_package_multi"] = "oatpp" + self.cpp_info.components["_oatpp-libressl"].names["cmake_find_package"] = "oatpp-libressl" + self.cpp_info.components["_oatpp-libressl"].names["cmake_find_package_multi"] = "oatpp-libressl" + self.cpp_info.components["_oatpp-libressl"].set_property("cmake_target_name", "oatpp::oatpp-libressl") self.cpp_info.components["_oatpp-libressl"].requires = ["oatpp::oatpp", "libressl::libressl"] diff --git a/recipes/oatpp-libressl/all/test_package/CMakeLists.txt b/recipes/oatpp-libressl/all/test_package/CMakeLists.txt index 704e2b23f267b..3cc329996c9b0 100644 --- a/recipes/oatpp-libressl/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-libressl/all/test_package/CMakeLists.txt @@ -1,13 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(oatpp-libressl-test CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(oatpp-libressl REQUIRED CONFIG) -find_package(oatpp-libressl REQUIRED) - -add_executable(oatpp-libressl-test oatpp-libressl-test.cpp) - -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) - -target_link_libraries(oatpp-libressl-test PRIVATE oatpp::oatpp-libressl) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-libressl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-libressl/all/test_package/conanfile.py b/recipes/oatpp-libressl/all/test_package/conanfile.py index d63ea54eb1d46..0a6bc68712d90 100644 --- a/recipes/oatpp-libressl/all/test_package/conanfile.py +++ b/recipes/oatpp-libressl/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, cmake_layout import os -from conans import ConanFile, CMake, tools -class OatppLibresslTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "oatpp-libressl-test"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/oatpp-libressl/all/test_package/oatpp-libressl-test.cpp b/recipes/oatpp-libressl/all/test_package/test_package.cpp similarity index 100% rename from recipes/oatpp-libressl/all/test_package/oatpp-libressl-test.cpp rename to recipes/oatpp-libressl/all/test_package/test_package.cpp diff --git a/recipes/oatpp-libressl/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-libressl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..07afded94f59c --- /dev/null +++ b/recipes/oatpp-libressl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(oatpp-libressl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-libressl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-libressl/all/test_v1_package/conanfile.py b/recipes/oatpp-libressl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/oatpp-libressl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 5f0b933b7b6a2688a49087d331c46c9db1743d55 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 21:05:33 +0200 Subject: [PATCH 450/561] (#13509) oatpp-websocket: conan v2 support --- recipes/oatpp-websocket/all/CMakeLists.txt | 7 - recipes/oatpp-websocket/all/conanfile.py | 123 ++++++++++-------- .../all/test_package/CMakeLists.txt | 10 +- .../all/test_package/conanfile.py | 22 +++- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 +++ 6 files changed, 115 insertions(+), 75 deletions(-) delete mode 100644 recipes/oatpp-websocket/all/CMakeLists.txt create mode 100644 recipes/oatpp-websocket/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/oatpp-websocket/all/test_v1_package/conanfile.py diff --git a/recipes/oatpp-websocket/all/CMakeLists.txt b/recipes/oatpp-websocket/all/CMakeLists.txt deleted file mode 100644 index d32836cbae4aa..0000000000000 --- a/recipes/oatpp-websocket/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/oatpp-websocket/all/conanfile.py b/recipes/oatpp-websocket/all/conanfile.py index 8aa50210c01f2..5a8cfa0227561 100644 --- a/recipes/oatpp-websocket/all/conanfile.py +++ b/recipes/oatpp-websocket/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" + class OatppWebSocketConan(ConanFile): name = "oatpp-websocket" @@ -11,21 +17,16 @@ class OatppWebSocketConan(ConanFile): license = "Apache-2.0" topics = ("oat++", "oatpp", "websocket") url = "https://github.com/conan-io/conan-center-index" - generators = "cmake", "cmake_find_package" - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - exports_sources = "CMakeLists.txt" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def config_options(self): if self.settings.os == "Windows": @@ -33,62 +34,76 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) - - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("oatpp-websocket can not be built as shared library on Windows") - - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("oatpp-websocket requires GCC >=5") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - # oatpp and oatpp-websocket are tightly coupled so use the same version - self.requires("oatpp/" + self.version) + self.requires(f"oatpp/{self.version}") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) - def _configure_cmake(self): - if self._cmake: - return self._cmake + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared library with msvc") - self._cmake = CMake(self) - self._cmake.definitions["OATPP_BUILD_TESTS"] = False - self._cmake.definitions["OATPP_MODULES_LOCATION"] = "INSTALLED" - if tools.Version(self.version) >= "1.3.0" and self.settings.compiler == "Visual Studio": - self._cmake.definitions["OATPP_MSVC_LINK_STATIC_RUNTIME"] = self.settings.compiler.runtime in ["MT", "MTd"] - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OATPP_BUILD_TESTS"] = False + tc.variables["OATPP_MODULES_LOCATION"] = "INSTALLED" + if Version(self.version) >= "1.3.0" and is_msvc(self): + tc.variables["OATPP_MSVC_LINK_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.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): - self.cpp_info.filenames["cmake_find_package"] = "oatpp-websocket" - self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-websocket" self.cpp_info.set_property("cmake_file_name", "oatpp-websocket") - self.cpp_info.names["cmake_find_package"] = "oatpp" - self.cpp_info.names["cmake_find_package_multi"] = "oatpp" self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-websocket") - self.cpp_info.components["_oatpp-websocket"].names["cmake_find_package"] = "oatpp-websocket" - self.cpp_info.components["_oatpp-websocket"].names["cmake_find_package_multi"] = "oatpp-websocket" - self.cpp_info.components["_oatpp-websocket"].set_property("cmake_target_name", "oatpp::oatpp-websocket") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["_oatpp-websocket"].includedirs = [ - os.path.join("include", "oatpp-{}".format(self.version), "oatpp-websocket") + os.path.join("include", f"oatpp-{self.version}", "oatpp-websocket") ] - self.cpp_info.components["_oatpp-websocket"].libdirs = [os.path.join("lib", "oatpp-{}".format(self.version))] + self.cpp_info.components["_oatpp-websocket"].libdirs = [os.path.join("lib", f"oatpp-{self.version}")] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.components["_oatpp-websocket"].bindirs = [os.path.join("bin", f"oatpp-{self.version}")] + else: + self.cpp_info.components["_oatpp-websocket"].bindirs = [] self.cpp_info.components["_oatpp-websocket"].libs = ["oatpp-websocket"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_oatpp-websocket"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.filenames["cmake_find_package"] = "oatpp-websocket" + self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-websocket" + self.cpp_info.names["cmake_find_package"] = "oatpp" + self.cpp_info.names["cmake_find_package_multi"] = "oatpp" + self.cpp_info.components["_oatpp-websocket"].names["cmake_find_package"] = "oatpp-websocket" + self.cpp_info.components["_oatpp-websocket"].names["cmake_find_package_multi"] = "oatpp-websocket" + self.cpp_info.components["_oatpp-websocket"].set_property("cmake_target_name", "oatpp::oatpp-websocket") self.cpp_info.components["_oatpp-websocket"].requires = ["oatpp::oatpp"] diff --git a/recipes/oatpp-websocket/all/test_package/CMakeLists.txt b/recipes/oatpp-websocket/all/test_package/CMakeLists.txt index 5ed80d9dbfced..7ec180083e3d0 100644 --- a/recipes/oatpp-websocket/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-websocket/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(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(oatpp-websocket REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) -# Use linking with components to properly test package_info() target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-websocket) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-websocket/all/test_package/conanfile.py b/recipes/oatpp-websocket/all/test_package/conanfile.py index 72a1273530ef4..0a6bc68712d90 100644 --- a/recipes/oatpp-websocket/all/test_package/conanfile.py +++ b/recipes/oatpp-websocket/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools - -class OatppWebSocketTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/oatpp-websocket/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-websocket/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6d7f1dc7c5bad --- /dev/null +++ b/recipes/oatpp-websocket/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(oatpp-websocket REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-websocket) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-websocket/all/test_v1_package/conanfile.py b/recipes/oatpp-websocket/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/oatpp-websocket/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From e6f38f58ca3c642bde33413e4ad5a53f2a9bdeba Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 21:24:50 +0200 Subject: [PATCH 451/561] (#13510) flecs: add 3.1.0 + build either shared or static if >= 3.0.1 * add flecs/3.1.0 * build either shared or static and few improvements --- recipes/flecs/all/conandata.yml | 3 ++ recipes/flecs/all/conanfile.py | 33 +++++++++++-------- recipes/flecs/all/test_package/conanfile.py | 11 ++++--- .../flecs/all/test_v1_package/conanfile.py | 1 - recipes/flecs/config.yml | 2 ++ 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml index 651673d78917b..f290a6a835598 100644 --- a/recipes/flecs/all/conandata.yml +++ b/recipes/flecs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.0": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.0.tar.gz" + sha256: "67e7cf4ff2abe661d9269b9d7f52ec7c39192f22e69bab638f27ef4337c12905" "3.0.4": url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.0.4.tar.gz" sha256: "370e2bf1bd9fd6dc79b515887e7f048be676b0d95e23d43b2c8b76a5e645c8f4" diff --git a/recipes/flecs/all/conanfile.py b/recipes/flecs/all/conanfile.py index 18d41fdbab49c..3a9882b4aabf8 100644 --- a/recipes/flecs/all/conanfile.py +++ b/recipes/flecs/all/conanfile.py @@ -33,15 +33,18 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: - del self.settings.compiler.libcxx + del self.settings.compiler.libcxx except Exception: - pass + pass try: - del self.settings.compiler.cppstd + del self.settings.compiler.cppstd except Exception: - pass + pass def layout(self): cmake_layout(self, src_folder="src") @@ -52,10 +55,14 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["FLECS_STATIC_LIBS"] = not self.options.shared + if Version(self.version) < "3.0.1": + tc.variables["FLECS_STATIC_LIBS"] = not self.options.shared + tc.variables["FLECS_SHARED_LIBS"] = self.options.shared + tc.variables["FLECS_DEVELOPER_WARNINGS"] = False + else: + tc.variables["FLECS_STATIC"] = not self.options.shared + tc.variables["FLECS_SHARED"] = self.options.shared tc.variables["FLECS_PIC"] = self.options.get_safe("fPIC", True) - tc.variables["FLECS_SHARED_LIBS"] = self.options.shared - tc.variables["FLECS_DEVELOPER_WARNINGS"] = False tc.generate() def build(self): @@ -72,10 +79,10 @@ def package(self): def package_info(self): suffix = "" if self.options.shared else "_static" self.cpp_info.set_property("cmake_file_name", "flecs") - self.cpp_info.set_property("cmake_target_name", "flecs::flecs{}".format(suffix)) + self.cpp_info.set_property("cmake_target_name", f"flecs::flecs{suffix}") # TODO: back to global scope once cmake_find_package* generators removed - self.cpp_info.components["_flecs"].libs = ["flecs{}".format(suffix)] + self.cpp_info.components["_flecs"].libs = [f"flecs{suffix}"] if not self.options.shared: self.cpp_info.components["_flecs"].defines.append("flecs_STATIC") if Version(self.version) >= "3.0.0": @@ -87,6 +94,6 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "flecs" self.cpp_info.names["cmake_find_package_multi"] = "flecs" - self.cpp_info.components["_flecs"].names["cmake_find_package"] = "flecs{}".format(suffix) - self.cpp_info.components["_flecs"].names["cmake_find_package_multi"] = "flecs{}".format(suffix) - self.cpp_info.components["_flecs"].set_property("cmake_target_name", "flecs::flecs{}".format(suffix)) + self.cpp_info.components["_flecs"].names["cmake_find_package"] = f"flecs{suffix}" + self.cpp_info.components["_flecs"].names["cmake_find_package_multi"] = f"flecs{suffix}" + self.cpp_info.components["_flecs"].set_property("cmake_target_name", f"flecs::flecs{suffix}") diff --git a/recipes/flecs/all/test_package/conanfile.py b/recipes/flecs/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/flecs/all/test_package/conanfile.py +++ b/recipes/flecs/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/flecs/all/test_v1_package/conanfile.py b/recipes/flecs/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/flecs/all/test_v1_package/conanfile.py +++ b/recipes/flecs/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/flecs/config.yml b/recipes/flecs/config.yml index d116302226cc6..7fb35d9d8030b 100644 --- a/recipes/flecs/config.yml +++ b/recipes/flecs/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.0": + folder: all "3.0.4": folder: all "3.0.1": From f38adf2869f4c182e39b1143c8d0b5778e7ce8c7 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 22:04:45 +0200 Subject: [PATCH 452/561] (#13512) zstr: conan v2 support --- recipes/zstr/all/conanfile.py | 33 ++++++++++--------- recipes/zstr/all/test_package/CMakeLists.txt | 13 +++----- recipes/zstr/all/test_package/conanfile.py | 19 ++++++++--- .../zstr/all/test_v1_package/CMakeLists.txt | 11 +++++++ recipes/zstr/all/test_v1_package/conanfile.py | 17 ++++++++++ 5 files changed, 65 insertions(+), 28 deletions(-) create mode 100644 recipes/zstr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zstr/all/test_v1_package/conanfile.py diff --git a/recipes/zstr/all/conanfile.py b/recipes/zstr/all/conanfile.py index e6352d395c1c2..512be7c200256 100644 --- a/recipes/zstr/all/conanfile.py +++ b/recipes/zstr/all/conanfile.py @@ -1,43 +1,46 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.51.1" class ZstrConan(ConanFile): name = "zstr" description = "A C++ header-only ZLib wrapper." license = "MIT" - topics = ("zstr", "zlib", "compression") + topics = ("zlib", "wrapper", "compression") homepage = "https://github.com/mateidavid/zstr" url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") def package_id(self): - self.info.header_only() + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "src")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "src"), dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/zstr/all/test_package/CMakeLists.txt b/recipes/zstr/all/test_package/CMakeLists.txt index ed1a400183c92..4fae7f3b9f5a3 100644 --- a/recipes/zstr/all/test_package/CMakeLists.txt +++ b/recipes/zstr/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(zstr CONFIG REQUIRED) +find_package(zstr REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} zstr::zstr) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE zstr::zstr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/zstr/all/test_package/conanfile.py b/recipes/zstr/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/zstr/all/test_package/conanfile.py +++ b/recipes/zstr/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zstr/all/test_v1_package/CMakeLists.txt b/recipes/zstr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..629a41f38d6f8 --- /dev/null +++ b/recipes/zstr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(zstr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zstr::zstr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/zstr/all/test_v1_package/conanfile.py b/recipes/zstr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/zstr/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 2296ee1f7056db139bed2e7b50e9fa425fd0da11 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 22:24:36 +0200 Subject: [PATCH 453/561] (#13513) zint: conan v2 support --- recipes/zint/all/CMakeLists.txt | 7 -- recipes/zint/all/conandata.yml | 1 - recipes/zint/all/conanfile.py | 95 ++++++++++--------- recipes/zint/all/test_package/CMakeLists.txt | 5 +- recipes/zint/all/test_package/conanfile.py | 29 ++++-- .../zint/all/test_v1_package/CMakeLists.txt | 20 ++++ recipes/zint/all/test_v1_package/conanfile.py | 21 ++++ 7 files changed, 112 insertions(+), 66 deletions(-) delete mode 100644 recipes/zint/all/CMakeLists.txt create mode 100644 recipes/zint/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zint/all/test_v1_package/conanfile.py diff --git a/recipes/zint/all/CMakeLists.txt b/recipes/zint/all/CMakeLists.txt deleted file mode 100644 index dd348757f3de8..0000000000000 --- a/recipes/zint/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/zint/all/conandata.yml b/recipes/zint/all/conandata.yml index 70cf1cd3fb510..7f452ab653337 100644 --- a/recipes/zint/all/conandata.yml +++ b/recipes/zint/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "2.10.0": - patch_file: "patches/0001-2.10.0-conan-integration.patch" - base_path: "source_subfolder" diff --git a/recipes/zint/all/conanfile.py b/recipes/zint/all/conanfile.py index 5d31fc46df8af..61596c6c982a7 100644 --- a/recipes/zint/all/conanfile.py +++ b/recipes/zint/all/conanfile.py @@ -1,9 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class ZintConan(ConanFile): @@ -28,20 +30,8 @@ class ZintConan(ConanFile): "with_qt": False, } - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -49,57 +39,70 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass if not self.options.with_qt: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_libpng: - self.requires("libpng/1.6.37") - self.requires("zlib/1.2.12") + self.requires("libpng/1.6.38") + self.requires("zlib/1.2.13") if self.options.with_qt: - self.requires("qt/5.15.3") + self.requires("qt/5.15.6") def validate(self): - if self.options.with_qt and not self.options["qt"].gui: - raise ConanInvalidConfiguration(f"{self.name} needs qt:gui=True") + if self.info.options.with_qt and not self.dependencies["qt"].options.gui: + raise ConanInvalidConfiguration(f"{self.ref} needs qt:gui=True") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DATA_INSTALL_DIR"] = os.path.join(self.package_folder, "lib").replace("\\", "/") + tc.variables["ZINT_USE_QT"] = self.options.with_qt + if self.options.with_qt: + tc.variables["QT_VERSION_MAJOR"] = Version(self.dependencies["qt"].ref.version).major + tc.variables["ZINT_USE_PNG"] = self.options.with_libpng + tc.generate() + deps = CMakeDeps(self) + deps.generate() def _patch_source(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) # Don't override CMAKE_OSX_SYSROOT, it can easily break consumers. - tools.replace_in_file( - os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_OSX_SYSROOT \"/\")", "", ) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["DATA_INSTALL_DIR"] = os.path.join(self.package_folder, "lib") - cmake.definitions["ZINT_USE_QT"] = self.options.with_qt - if self.options.with_qt: - cmake.definitions["QT_VERSION_MAJOR"] = tools.Version(self.deps_cpp_info["qt"].version).major - cmake.definitions["ZINT_USE_PNG"] = self.options.with_libpng - cmake.configure() - return cmake - def build(self): self._patch_source() - cmake = self._configure_cmake() + 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", 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): self.cpp_info.set_property("cmake_file_name", "Zint") diff --git a/recipes/zint/all/test_package/CMakeLists.txt b/recipes/zint/all/test_package/CMakeLists.txt index 865d3850ba369..14bd143a5e4a6 100644 --- a/recipes/zint/all/test_package/CMakeLists.txt +++ b/recipes/zint/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) option(ZINT_WITH_QT "Zint has been built with Qt support") if(ZINT_WITH_QT) enable_language(CXX) endif() -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(Zint REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/zint/all/test_package/conanfile.py b/recipes/zint/all/test_package/conanfile.py index 1ce37b6a52e77..1617e37109bc2 100644 --- a/recipes/zint/all/test_package/conanfile.py +++ b/recipes/zint/all/test_package/conanfile.py @@ -1,21 +1,34 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ZINT_WITH_QT"] = self.dependencies["zint"].options.with_qt + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["ZINT_WITH_QT"] = self.options["zint"].with_qt cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") if self.options["zint"].with_qt: - bin_path = os.path.join("bin", "test_package_cpp") - self.run(bin_path, run_environment=True) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/recipes/zint/all/test_v1_package/CMakeLists.txt b/recipes/zint/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d155f1e77d4aa --- /dev/null +++ b/recipes/zint/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +option(ZINT_WITH_QT "Zint has been built with Qt support") +if(ZINT_WITH_QT) + enable_language(CXX) +endif() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Zint REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Zint::Zint) + +if(ZINT_WITH_QT) + add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE Zint::QZint) +endif() diff --git a/recipes/zint/all/test_v1_package/conanfile.py b/recipes/zint/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..1ce37b6a52e77 --- /dev/null +++ b/recipes/zint/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["ZINT_WITH_QT"] = self.options["zint"].with_qt + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + if self.options["zint"].with_qt: + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) From 6d2a713b6a0e10e81168b86f5d101f291c973da5 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 18 Oct 2022 05:44:20 +0900 Subject: [PATCH 454/561] (#13365) grpc: update abseil * grpc: update abseil * use conan.ConanFile * remove `from conan import tools` * remove tools_legacy * define BZIP3_DLL_EXPORT * Revert "define BZIP3_DLL_EXPORT" This reverts commit 4227cfcd8dcad050d560f672f46682d7760ca43b. * remove recipe name from topics Co-authored-by: Jordan Williams * use abseil/20211102.0 when msvc and grpc/1.46.3 Co-authored-by: Jordan Williams --- recipes/grpc/all/conanfile.py | 69 ++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/recipes/grpc/all/conanfile.py b/recipes/grpc/all/conanfile.py index 5c6b96b1c8d43..79d1581f47087 100644 --- a/recipes/grpc/all/conanfile.py +++ b/recipes/grpc/all/conanfile.py @@ -1,9 +1,13 @@ -import shutil -from conan import tools +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.microsoft import visual, is_msvc +from conan.tools.build import cross_building, valid_min_cppstd, check_min_cppstd +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, rename, replace_in_file from conan.tools.scm import Version -from conans import ConanFile, CMake, tools as tools_legacy -from conans.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration +from conans import CMake import os +import shutil required_conan_version = ">=1.49.0" @@ -11,10 +15,10 @@ class grpcConan(ConanFile): name = "grpc" description = "Google's RPC (remote procedure call) library and framework." - topics = ("grpc", "rpc") + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/grpc/grpc" - license = "Apache-2.0" + topics = ("rpc") settings = "os", "arch", "compiler", "build_type" @@ -59,10 +63,6 @@ def _source_subfolder(self): def _build_subfolder(self): return "build_subfolder" - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _grpc_plugin_template(self): return "grpc_plugin_template.cmake.in" @@ -74,8 +74,7 @@ def _cxxstd_required(self): def export_sources(self): self.copy("CMakeLists.txt") self.copy(os.path.join("cmake", self._grpc_plugin_template)) - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -89,7 +88,10 @@ def configure(self): self.options["grpc-proto"].shared = True def requirements(self): - self.requires("abseil/20211102.0") + if is_msvc(self) and Version(self.version) < "1.47": + self.requires("abseil/20211102.0") + else: + self.requires("abseil/20220623.0") self.requires("c-ares/1.18.1") self.requires("openssl/1.1.1q") self.requires("re2/20220601") @@ -99,11 +101,11 @@ def requirements(self): self.requires("grpc-proto/cci.20220627") def validate(self): - if self._is_msvc: + if is_msvc(self): if self.settings.compiler == "Visual Studio": vs_ide_version = self.settings.compiler.version else: - vs_ide_version = tools.microsoft.visual.msvc_version_to_vs_ide_version(self.settings.compiler.version) + vs_ide_version = visual.msvc_version_to_vs_ide_version(self.settings.compiler.version) if Version(vs_ide_version) < "14": raise ConanInvalidConfiguration("gRPC can only be built with Visual Studio 2015 or higher.") @@ -114,7 +116,7 @@ def validate(self): raise ConanInvalidConfiguration("GCC older than 6 is not supported") if self.settings.compiler.get_safe("cppstd"): - tools_legacy.check_min_cppstd(self, self._cxxstd_required) + check_min_cppstd(self, self._cxxstd_required) if self.options.shared and (not self.options["protobuf"].shared or not self.options["googleapis"].shared or not self.options["grpc-proto"].shared): raise ConanInvalidConfiguration("If built as shared, protobuf, googleapis and grpc-proto must be shared as well. Please, use `protobuf:shared=True` and `googleapis:shared=True` and `grpc-proto:shared=True`") @@ -127,11 +129,11 @@ def build_requirements(self): if hasattr(self, "settings_build"): self.build_requires('protobuf/3.21.4') # when cross compiling we need pre compiled grpc plugins for protoc - if tools.build.cross_building(self): + if cross_building(self): self.build_requires('grpc/{}'.format(self.version)) def source(self): - tools.files.get(self, **self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def _configure_cmake(self): @@ -171,41 +173,40 @@ def _configure_cmake(self): self._cmake.definitions["gRPC_BUILD_GRPC_RUBY_PLUGIN"] = self.options.ruby_plugin # Consumed targets (abseil) via interface target_compiler_feature can propagate newer standards - if not tools_legacy.valid_min_cppstd(self, self._cxxstd_required): + if not valid_min_cppstd(self, self._cxxstd_required): self._cmake.definitions["CMAKE_CXX_STANDARD"] = self._cxxstd_required - if tools.build.cross_building(self): + if cross_building(self): # otherwise find_package() can't find config files since # conan doesn't populate CMAKE_FIND_ROOT_PATH self._cmake.definitions["CMAKE_FIND_ROOT_PATH_MODE_PACKAGE"] = "BOTH" - if tools_legacy.is_apple_os(self.settings.os): + if is_apple_os(self): # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable self._cmake.definitions["CMAKE_MACOSX_BUNDLE"] = False - if self._is_msvc and Version(self.version) >= "1.48": + if is_msvc(self) and Version(self.version) >= "1.48": self._cmake.definitions["CMAKE_SYSTEM_VERSION"] = "10.0.18362.0" self._cmake.configure(build_folder=self._build_subfolder) return self._cmake def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools_legacy.patch(**patch) + apply_conandata_patches(self) # Clean existing proto files, they will be taken from requirements shutil.rmtree(os.path.join(self._source_subfolder, "src", "proto", "grpc")) if Version(self.version) >= "1.47": # Take googleapis from requirement instead of vendored/hardcoded version - tools_legacy.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), "if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googleapis)", "if (FALSE) # Do not download, it is provided by Conan" ) # We are fine with protobuf::protoc coming from conan generated Find/config file # TODO: to remove when moving to CMakeToolchain (see https://github.com/conan-io/conan/pull/10186) - tools_legacy.replace_in_file(os.path.join(self._source_subfolder, "cmake", "protobuf.cmake"), + replace_in_file(self, os.path.join(self._source_subfolder, "cmake", "protobuf.cmake"), "find_program(_gRPC_PROTOBUF_PROTOC_EXECUTABLE protoc)", "set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE $)" ) @@ -220,8 +221,8 @@ def package(self): cmake = self._configure_cmake() cmake.install() - tools.files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - tools.files.rmdir(self, 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")) # Create one custom module file per executable in order to emulate # CMake executables imported targets of grpc @@ -272,19 +273,19 @@ def _create_executable_module_file(self, target, executable): # Rename it dst_file = os.path.join(self.package_folder, self._module_path, "{}.cmake".format(executable)) - tools.files.rename(self, os.path.join(self.package_folder, self._module_path, self._grpc_plugin_template), + rename(self, os.path.join(self.package_folder, self._module_path, self._grpc_plugin_template), dst_file) # Replace placeholders - tools_legacy.replace_in_file(dst_file, "@target_name@", target) - tools_legacy.replace_in_file(dst_file, "@executable_name@", executable) + replace_in_file(self, dst_file, "@target_name@", target) + replace_in_file(self, dst_file, "@executable_name@", executable) find_program_var = "{}_PROGRAM".format(executable.upper()) - tools_legacy.replace_in_file(dst_file, "@find_program_variable@", find_program_var) + replace_in_file(self, dst_file, "@find_program_variable@", find_program_var) module_folder_depth = len(os.path.normpath(self._module_path).split(os.path.sep)) rel_path = "".join(["../"] * module_folder_depth) - tools_legacy.replace_in_file(dst_file, "@relative_path@", rel_path) + replace_in_file(self, dst_file, "@relative_path@", rel_path) @property def _module_path(self): @@ -308,7 +309,7 @@ def wsock32(): return ["wsock32"] if self.settings.os == "Windows" else [] def corefoundation(): - return ["CoreFoundation"] if tools_legacy.is_apple_os(self.settings.os) else [] + return ["CoreFoundation"] if is_apple_os(self) else [] components = { "address_sorting": { From fafe0cd91950eb700e1b4704bbc2cc4d57b43cca Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 23:04:35 +0200 Subject: [PATCH 455/561] (#13514) zeromq: conan v2 support * conan v2 support * remove pdb files --- recipes/zeromq/all/CMakeLists.txt | 11 -- recipes/zeromq/all/conandata.yml | 8 +- recipes/zeromq/all/conanfile.py | 140 +++++++++--------- .../0004-cmake-minimum-required-first.patch | 15 ++ .../zeromq/all/test_package/CMakeLists.txt | 14 +- recipes/zeromq/all/test_package/conanfile.py | 31 ++-- .../zeromq/all/test_v1_package/CMakeLists.txt | 25 ++++ .../zeromq/all/test_v1_package/conanfile.py | 20 +++ 8 files changed, 158 insertions(+), 106 deletions(-) delete mode 100644 recipes/zeromq/all/CMakeLists.txt create mode 100644 recipes/zeromq/all/patches/0004-cmake-minimum-required-first.patch create mode 100644 recipes/zeromq/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zeromq/all/test_v1_package/conanfile.py diff --git a/recipes/zeromq/all/CMakeLists.txt b/recipes/zeromq/all/CMakeLists.txt deleted file mode 100644 index 0611895d93c39..0000000000000 --- a/recipes/zeromq/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -if(MSVC) - add_definitions("-D_NOEXCEPT=noexcept") -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/zeromq/all/conandata.yml b/recipes/zeromq/all/conandata.yml index b6f5c8a82efc1..a5145365e9be5 100644 --- a/recipes/zeromq/all/conandata.yml +++ b/recipes/zeromq/all/conandata.yml @@ -11,14 +11,12 @@ sources: patches: "4.3.4": - patch_file: "patches/0003-rpath-macos-4.3.3.patch" - base_path: "source_subfolder" + - patch_file: "patches/0004-cmake-minimum-required-first.patch" "4.3.3": - patch_file: "patches/0003-rpath-macos-4.3.3.patch" - base_path: "source_subfolder" + - patch_file: "patches/0004-cmake-minimum-required-first.patch" "4.3.2": - patch_file: "patches/0001-problem-__try-and-__except-isn-t-universally-supported-on-windows.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-problem-invalid-syntax-for-calling-convention-on-function.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-rpath-macos-4.3.2.patch" - base_path: "source_subfolder" + - patch_file: "patches/0004-cmake-minimum-required-first.patch" diff --git a/recipes/zeromq/all/conanfile.py b/recipes/zeromq/all/conanfile.py index 80aa0c2911613..434e0e5fb3084 100644 --- a/recipes/zeromq/all/conanfile.py +++ b/recipes/zeromq/all/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class ZeroMQConan(ConanFile): @@ -36,21 +40,8 @@ class ZeroMQConan(ConanFile): "with_radix_tree": False, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -58,7 +49,13 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.encryption == "libsodium": @@ -67,91 +64,88 @@ def requirements(self): self.requires("norm/1.5.9") def validate(self): - if self.settings.os == "Windows" and self.options.with_norm: + if self.info.settings.os == "Windows" and self.info.options.with_norm: raise ConanInvalidConfiguration( "Norm and ZeroMQ are not compatible on Windows yet" ) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_CURVE"] = bool(self.options.encryption) - self._cmake.definitions["WITH_LIBSODIUM"] = self.options.encryption == "libsodium" - self._cmake.definitions["ZMQ_BUILD_TESTS"] = False - self._cmake.definitions["WITH_PERF_TOOL"] = False - self._cmake.definitions["BUILD_SHARED"] = self.options.shared - self._cmake.definitions["BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["BUILD_TESTS"] = False - self._cmake.definitions["ENABLE_CPACK"] = False - self._cmake.definitions["WITH_DOCS"] = False - self._cmake.definitions["WITH_DOC"] = False - self._cmake.definitions["WITH_NORM"] = self.options.with_norm - self._cmake.definitions["ENABLE_DRAFTS"] = self.options.with_draft_api - self._cmake.definitions["ENABLE_WS"] = self.options.with_websocket - self._cmake.definitions["ENABLE_RADIX_TREE"] = self.options.with_radix_tree + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_CURVE"] = bool(self.options.encryption) + tc.variables["WITH_LIBSODIUM"] = self.options.encryption == "libsodium" + tc.variables["ZMQ_BUILD_TESTS"] = False + tc.variables["WITH_PERF_TOOL"] = False + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_TESTS"] = False + tc.variables["ENABLE_CPACK"] = False + tc.variables["WITH_DOCS"] = False + tc.variables["WITH_DOC"] = False + tc.variables["WITH_NORM"] = self.options.with_norm + tc.variables["ENABLE_DRAFTS"] = self.options.with_draft_api + tc.variables["ENABLE_WS"] = self.options.with_websocket + tc.variables["ENABLE_RADIX_TREE"] = self.options.with_radix_tree if self.options.poller: - self._cmake.definitions["POLLER"] = self.options.poller - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["POLLER"] = self.options.poller + if is_msvc(self): + tc.preprocessor_definitions["_NOEXCEPT"] = "noexcept" + tc.generate() + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - os.unlink(os.path.join(self._source_subfolder, "builds", "cmake", "Modules", "FindSodium.cmake")) - + apply_conandata_patches(self) if self.options.encryption == "libsodium": - os.rename("Findlibsodium.cmake", "FindSodium.cmake") - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "SODIUM_FOUND", - "libsodium_FOUND") - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "SODIUM_INCLUDE_DIRS", - "libsodium_INCLUDE_DIRS") - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "SODIUM_LIBRARIES", - "libsodium_LIBRARIES") + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + 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\")" + 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") + replace_in_file(self, cmakelists, "${SODIUM_LIBRARIES}", sodium_target) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="COPYING*", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "COPYING*", 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", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "CMake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), - {self._libzmq_target: "ZeroMQ::{}".format(self._libzmq_target)} + {self._libzmq_target: f"ZeroMQ::{self._libzmq_target}"}, ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property def _libzmq_target(self): @@ -163,7 +157,7 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "libzmq") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["libzmq"].libs = tools.collect_libs(self) + self.cpp_info.components["libzmq"].libs = collect_libs(self) if self.settings.os == "Windows": self.cpp_info.components["libzmq"].system_libs = ["iphlpapi", "ws2_32"] elif self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/zeromq/all/patches/0004-cmake-minimum-required-first.patch b/recipes/zeromq/all/patches/0004-cmake-minimum-required-first.patch new file mode 100644 index 0000000000000..75064b1ea9822 --- /dev/null +++ b/recipes/zeromq/all/patches/0004-cmake-minimum-required-first.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,11 +1,11 @@ + # CMake build script for ZeroMQ +-project(ZeroMQ) + + if(1) + cmake_minimum_required(VERSION 3.0.2) + else() + cmake_minimum_required(VERSION 2.8.12) + endif() ++project(ZeroMQ) + + include(CheckIncludeFiles) + include(CheckCCompilerFlag) diff --git a/recipes/zeromq/all/test_package/CMakeLists.txt b/recipes/zeromq/all/test_package/CMakeLists.txt index 4b5e1b762305a..e02c2ff4211bd 100644 --- a/recipes/zeromq/all/test_package/CMakeLists.txt +++ b/recipes/zeromq/all/test_package/CMakeLists.txt @@ -1,24 +1,22 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) option(WITH_LIBSODIUM "zeromq is built with libsodium") - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) +option(WITH_NORM "zeromq is built with norm") find_package(ZeroMQ REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) if(ZEROMQ_SHARED) - target_link_libraries(${PROJECT_NAME} libzmq) + target_link_libraries(${PROJECT_NAME} PRIVATE libzmq) else() - target_link_libraries(${PROJECT_NAME} libzmq-static) + target_link_libraries(${PROJECT_NAME} PRIVATE libzmq-static) endif() if(WITH_LIBSODIUM) - target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_LIBSODIUM") + target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_LIBSODIUM") endif() if(WITH_NORM) - target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_NORM") + target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_NORM") endif() diff --git a/recipes/zeromq/all/test_package/conanfile.py b/recipes/zeromq/all/test_package/conanfile.py index 9703af61ec346..0378d2924042d 100644 --- a/recipes/zeromq/all/test_package/conanfile.py +++ b/recipes/zeromq/all/test_package/conanfile.py @@ -1,20 +1,33 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout 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", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_LIBSODIUM"] = self.dependencies["zeromq"].options.encryption == "libsodium" + tc.variables["ZEROMQ_SHARED"] = self.dependencies["zeromq"].options.shared + tc.variables["WITH_NORM"] = self.dependencies["zeromq"].options.with_norm + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["WITH_LIBSODIUM"] = self.options["zeromq"].encryption == "libsodium" - cmake.definitions["ZEROMQ_SHARED"] = self.options["zeromq"].shared - cmake.definitions["WITH_NORM"] = self.options["zeromq"].with_norm cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zeromq/all/test_v1_package/CMakeLists.txt b/recipes/zeromq/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..226be2dd7b7c3 --- /dev/null +++ b/recipes/zeromq/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +option(WITH_LIBSODIUM "zeromq is built with libsodium") +option(WITH_NORM "zeromq is built with norm") + +find_package(ZeroMQ REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +if(ZEROMQ_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE libzmq) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE libzmq-static) +endif() + +if(WITH_LIBSODIUM) + target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_LIBSODIUM") +endif() + +if(WITH_NORM) + target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_NORM") +endif() diff --git a/recipes/zeromq/all/test_v1_package/conanfile.py b/recipes/zeromq/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..507e0ac53bc64 --- /dev/null +++ b/recipes/zeromq/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_LIBSODIUM"] = self.options["zeromq"].encryption == "libsodium" + cmake.definitions["ZEROMQ_SHARED"] = self.options["zeromq"].shared + cmake.definitions["WITH_NORM"] = self.options["zeromq"].with_norm + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 0742f469f9e9b9e838c499b58b81ea982946fdbb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 17 Oct 2022 23:24:11 +0200 Subject: [PATCH 456/561] (#13515) libcorrect: conan v2 support --- recipes/libcorrect/all/CMakeLists.txt | 7 -- recipes/libcorrect/all/conandata.yml | 3 - recipes/libcorrect/all/conanfile.py | 82 ++++++++++--------- .../all/test_package/CMakeLists.txt | 9 +- .../libcorrect/all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../all/test_v1_package/conanfile.py | 17 ++++ 7 files changed, 90 insertions(+), 59 deletions(-) delete mode 100644 recipes/libcorrect/all/CMakeLists.txt create mode 100644 recipes/libcorrect/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcorrect/all/test_v1_package/conanfile.py diff --git a/recipes/libcorrect/all/CMakeLists.txt b/recipes/libcorrect/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d..0000000000000 --- a/recipes/libcorrect/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/libcorrect/all/conandata.yml b/recipes/libcorrect/all/conandata.yml index 373b501c11a6c..bbabb165203bc 100644 --- a/recipes/libcorrect/all/conandata.yml +++ b/recipes/libcorrect/all/conandata.yml @@ -2,10 +2,7 @@ sources: "20181010": url: "https://github.com/quiet/libcorrect/archive/f5a28c74fba7a99736fe49d3a5243eca29517ae9.tar.gz" sha256: 5a4305aabe6c7d5b58f6677c41c54ad5e8d9003f7a5998f7344d93534e4c5760 - patches: "20181010": - patch_file: "patches/0001-Support-CMake-BUILD_SHARED_LIBS.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-Export-symbols-for-windows.patch" - base_path: "source_subfolder" diff --git a/recipes/libcorrect/all/conanfile.py b/recipes/libcorrect/all/conanfile.py index 0aba3323c9390..a2cd26c5b3b8e 100644 --- a/recipes/libcorrect/all/conanfile.py +++ b/recipes/libcorrect/all/conanfile.py @@ -1,17 +1,20 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" -class LibaecConan(ConanFile): +class LibcorrectConan(ConanFile): name = "libcorrect" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/quiet/libcorrect" description = "C library for Convolutional codes and Reed-Solomon" - topics = ("conan", "dsp", "libaec", "encoding", "decoding") - settings = "os", "compiler", "build_type", "arch" + topics = ("fec", "reed-solomon", "viterbi", "convolutional") + + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -21,17 +24,8 @@ class LibaecConan(ConanFile): "fPIC": True, } - generators = "cmake" - exports_sources = ["CMakeLists.txt", "patches/*"] - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,40 +33,52 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass - 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 _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "-fPIC", "") - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "-fsanitize=address", "") + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-fPIC", "") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-fsanitize=address", "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): self.cpp_info.libs = ["correct"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/libcorrect/all/test_package/CMakeLists.txt b/recipes/libcorrect/all/test_package/CMakeLists.txt index aae00b641388d..37ccc2fe5dfaa 100644 --- a/recipes/libcorrect/all/test_package/CMakeLists.txt +++ b/recipes/libcorrect/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1.3) -project(test_package) +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libcorrect REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libcorrect::libcorrect) diff --git a/recipes/libcorrect/all/test_package/conanfile.py b/recipes/libcorrect/all/test_package/conanfile.py index bd7165a553cf4..0a6bc68712d90 100644 --- a/recipes/libcorrect/all/test_package/conanfile.py +++ b/recipes/libcorrect/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libcorrect/all/test_v1_package/CMakeLists.txt b/recipes/libcorrect/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..37041d4cb4431 --- /dev/null +++ b/recipes/libcorrect/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libcorrect REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libcorrect::libcorrect) diff --git a/recipes/libcorrect/all/test_v1_package/conanfile.py b/recipes/libcorrect/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libcorrect/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 962095cd33556a7907abd60e03fac8520f99892e Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 18 Oct 2022 07:06:01 +0900 Subject: [PATCH 457/561] (#13516) lurlparser: add recipe * lurlparser: add recipe * add WINDOWS_EXPORT_ALL_SYMBOLS * link math lib --- recipes/lurlparser/all/CMakeLists.txt | 21 ++++++ recipes/lurlparser/all/conandata.yml | 4 + recipes/lurlparser/all/conanfile.py | 73 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 ++ .../lurlparser/all/test_package/conanfile.py | 26 +++++++ .../all/test_package/test_package.cpp | 20 +++++ .../all/test_v1_package/CMakeLists.txt | 11 +++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/lurlparser/config.yml | 3 + 9 files changed, 184 insertions(+) create mode 100644 recipes/lurlparser/all/CMakeLists.txt create mode 100644 recipes/lurlparser/all/conandata.yml create mode 100644 recipes/lurlparser/all/conanfile.py create mode 100644 recipes/lurlparser/all/test_package/CMakeLists.txt create mode 100644 recipes/lurlparser/all/test_package/conanfile.py create mode 100644 recipes/lurlparser/all/test_package/test_package.cpp create mode 100644 recipes/lurlparser/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lurlparser/all/test_v1_package/conanfile.py create mode 100644 recipes/lurlparser/config.yml diff --git a/recipes/lurlparser/all/CMakeLists.txt b/recipes/lurlparser/all/CMakeLists.txt new file mode 100644 index 0000000000000..e0daa695ec3ad --- /dev/null +++ b/recipes/lurlparser/all/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.8) +project(LUrlParser LANGUAGES CXX) + +add_library(lurlparser ${LURLPARSER_SRC_DIR}/LUrlParser.cpp) +target_include_directories(lurlparser PRIVATE ${LURLPARSER_SRC_DIR}) +target_compile_features(lurlparser PRIVATE cxx_std_11) +set_target_properties(lurlparser PROPERTIES + PUBLIC_HEADER ${LURLPARSER_SRC_DIR}/LUrlParser.h + CMAKE_CXX_STANDARD_REQUIRED ON + CMAKE_CXX_EXTENSIONS OFF + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +include(GNUInstallDirs) +install( + TARGETS lurlparser + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/lurlparser/all/conandata.yml b/recipes/lurlparser/all/conandata.yml new file mode 100644 index 0000000000000..5f5dd28919386 --- /dev/null +++ b/recipes/lurlparser/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1": + url: "https://github.com/corporateshark/LUrlParser/archive/refs/tags/release-1.1.tar.gz" + sha256: "f697bf9151c78b5e54682ff8f1ff759b15c3cbe73b179576a921b526cdf9ff22" diff --git a/recipes/lurlparser/all/conanfile.py b/recipes/lurlparser/all/conanfile.py new file mode 100644 index 0000000000000..6469f5166a747 --- /dev/null +++ b/recipes/lurlparser/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.50.0" + +class PackageConan(ConanFile): + name = "lurlparser" + description = "Lightweight URL & URI parser (RFC 1738, RFC 3986)" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/corporateshark/LUrlParser/" + topics = ("url", "uri", "parser") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _minimum_cpp_standard(self): + return 11 + + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LURLPARSER_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, pattern="License.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["lurlparser"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/lurlparser/all/test_package/CMakeLists.txt b/recipes/lurlparser/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2160e23166fc3 --- /dev/null +++ b/recipes/lurlparser/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(lurlparser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lurlparser::lurlparser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lurlparser/all/test_package/conanfile.py b/recipes/lurlparser/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/lurlparser/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/lurlparser/all/test_package/test_package.cpp b/recipes/lurlparser/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef4db579b3178 --- /dev/null +++ b/recipes/lurlparser/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include + +#include "LUrlParser.h" + +int main() { + const auto URL = LUrlParser::ParseURL::parseURL("https://John:Dow@github.com:80/corporateshark/LUrlParser"); + + if (URL.isValid()) { + std::cout << "Scheme : " << URL.scheme_ << std::endl; + std::cout << "Host : " << URL.host_ << std::endl; + std::cout << "Port : " << URL.port_ << std::endl; + std::cout << "Path : " << URL.path_ << std::endl; + std::cout << "Query : " << URL.query_ << std::endl; + std::cout << "Fragment : " << URL.fragment_ << std::endl; + std::cout << "User name : " << URL.userName_ << std::endl; + std::cout << "Password : " << URL.password_ << std::endl; + } + + return 0; +} diff --git a/recipes/lurlparser/all/test_v1_package/CMakeLists.txt b/recipes/lurlparser/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..44cd3222ce1e5 --- /dev/null +++ b/recipes/lurlparser/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lurlparser REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lurlparser::lurlparser) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lurlparser/all/test_v1_package/conanfile.py b/recipes/lurlparser/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/lurlparser/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/lurlparser/config.yml b/recipes/lurlparser/config.yml new file mode 100644 index 0000000000000..3f8a45fae5832 --- /dev/null +++ b/recipes/lurlparser/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1": + folder: all From 9cbc92f949e5eb82005c118eefc2fcb2514f66a3 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 00:24:37 +0200 Subject: [PATCH 458/561] (#13517) qt-advanced-docking-system/3.8.3 * qt-advanced-docking-system/3.8.3 * bump qt * add missing imports * Update conanfile.py * Apply suggestions from code review Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- .../all/conandata.yml | 3 +++ .../all/conanfile.py | 23 +++++++++++-------- recipes/qt-advanced-docking-system/config.yml | 2 ++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/recipes/qt-advanced-docking-system/all/conandata.yml b/recipes/qt-advanced-docking-system/all/conandata.yml index 7a2ff50f47cd8..4dc01c8789b06 100644 --- a/recipes/qt-advanced-docking-system/all/conandata.yml +++ b/recipes/qt-advanced-docking-system/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.8.3": + url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/3.8.3.tar.gz" + sha256: "bd5a9469b755bedf33baefd0b3dda6d167b7917a2888e2794eed5abee7d78f74" "3.8.2": url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/3.8.2.tar.gz" sha256: "e56811228fb4d5f5703c31cd83cb39ab2d5a849f581719d383db72f9322ec7f2" diff --git a/recipes/qt-advanced-docking-system/all/conanfile.py b/recipes/qt-advanced-docking-system/all/conanfile.py index ff22ebfa3d3ef..332361aaf6862 100644 --- a/recipes/qt-advanced-docking-system/all/conanfile.py +++ b/recipes/qt-advanced-docking-system/all/conanfile.py @@ -1,6 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir +from conans import CMake import os +required_conan_version = ">=1.52.0" class QtADS(ConanFile): name = "qt-advanced-docking-system" @@ -23,16 +26,19 @@ class QtADS(ConanFile): "shared": False, "fPIC": True, } - exports_sources = ["CMakeLists.txt", "patches/**"] generators = "cmake", "cmake_find_package", "cmake_find_package_multi" _cmake = None - _qt_version = "5.15.2" + _qt_version = "5.15.6" @property def _source_subfolder(self): return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -45,7 +51,7 @@ def requirements(self): self.requires(f"qt/{self._qt_version}") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def _configure_cmake(self): @@ -61,10 +67,9 @@ def _configure_cmake(self): return self._cmake def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) - tools.replace_in_file( + replace_in_file(self, f"{self.source_folder}/{self._source_subfolder}/src/ads_globals.cpp", "#include ", f"#include <{self._qt_version}/QtGui/qpa/qplatformnativeinterface.h>" @@ -79,8 +84,8 @@ def package(self): cmake = self._configure_cmake() cmake.install() self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "license")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "license")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): if self.options.shared: diff --git a/recipes/qt-advanced-docking-system/config.yml b/recipes/qt-advanced-docking-system/config.yml index 6cd510297f45c..63dc53b34436f 100644 --- a/recipes/qt-advanced-docking-system/config.yml +++ b/recipes/qt-advanced-docking-system/config.yml @@ -1,3 +1,5 @@ versions: + "3.8.3": + folder: "all" "3.8.2": folder: "all" From ecdf7fa9d779f1886477341a061672ecb1875522 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 00:45:29 +0200 Subject: [PATCH 459/561] (#13518) qarchive/2.1.1 * qarchive/2.1.1 * bump qt * fixup * Update conanfile.py * Update conanfile.py --- recipes/qarchive/all/conandata.yml | 8 +++++ recipes/qarchive/all/conanfile.py | 35 +++++++++---------- .../all/patches/0002-export-symbols.patch | 3 +- recipes/qarchive/config.yml | 2 ++ 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/recipes/qarchive/all/conandata.yml b/recipes/qarchive/all/conandata.yml index 953df9977dc0c..fbfd467ed4937 100644 --- a/recipes/qarchive/all/conandata.yml +++ b/recipes/qarchive/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/antony-jr/QArchive/archive/v2.1.1.tar.gz" + sha256: "4ed51121a5bc9b5981d2fa3927f951a6a91ccca233d6b6dc4fef55b4ca5a2d92" "2.0.2": url: "https://github.com/antony-jr/QArchive/archive/v2.0.2.tar.gz" sha256: "f59207c0da2d68bbbdaca79751f08018226d3b587e3f97156b3aee994db018f6" @@ -6,6 +9,11 @@ sources: url: "https://github.com/antony-jr/QArchive/archive/v2.0.1.tar.gz" sha256: "ee8e259795f4f991c0465c3d95cf018bea2a72e9a31f744f2344aaa43201f369" patches: + "2.1.1": + - patch_file: "patches/0001-cmake-conan-compatibility.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-export-symbols.patch" + base_path: "source_subfolder" "2.0.2": - patch_file: "patches/0001-cmake-conan-compatibility.patch" base_path: "source_subfolder" diff --git a/recipes/qarchive/all/conanfile.py b/recipes/qarchive/all/conanfile.py index 7f628c0084e94..02aed3975aa2f 100644 --- a/recipes/qarchive/all/conanfile.py +++ b/recipes/qarchive/all/conanfile.py @@ -1,9 +1,11 @@ -from conans import ConanFile, tools, CMake +from conan import ConanFile +from conan.tools.files import get, apply_conandata_patches, rmdir, save, export_conandata_patches +from conans import CMake import functools import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class QarchiveConan(ConanFile): @@ -35,8 +37,7 @@ def _source_subfolder(self): def export_sources(self): self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -47,14 +48,14 @@ def configure(self): del self.options.fPIC def requirements(self): - self.requires("libarchive/3.6.0") - self.requires("qt/5.15.3") + self.requires("libarchive/3.6.1") + self.requires("qt/5.15.6") def build_requirements(self): - self.build_requires("cmake/3.23.1") + self.build_requires("cmake/3.24.2") def source(self): - tools.get(**self.conan_data["sources"][self.version], + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) @functools.lru_cache(1) @@ -64,8 +65,7 @@ def _configure_cmake(self): return cmake def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) cmake = self._configure_cmake() cmake.build() @@ -73,8 +73,8 @@ def package(self): self.copy("LICENSE", src=self._source_subfolder, dst="licenses") cmake = self._configure_cmake() 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")) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( @@ -82,21 +82,20 @@ def package(self): {"QArchive": "QArchive::QArchive"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "QArchive") diff --git a/recipes/qarchive/all/patches/0002-export-symbols.patch b/recipes/qarchive/all/patches/0002-export-symbols.patch index 10ea378156b7a..1ca6edf716eac 100644 --- a/recipes/qarchive/all/patches/0002-export-symbols.patch +++ b/recipes/qarchive/all/patches/0002-export-symbols.patch @@ -1,6 +1,6 @@ --- a/include/qarchive_enums.hpp +++ b/include/qarchive_enums.hpp -@@ -1,11 +1,12 @@ +@@ -1,10 +1,11 @@ #ifndef QARCHIVE_ENUMS_HPP_INCLUDED #define QARCHIVE_ENUMS_HPP_INCLUDED +#include "qarchive_global.hpp" @@ -13,4 +13,3 @@ +QARCHIVE_EXPORT QString errorCodeToString(short); /* - * Common error codes , these are most likely will be diff --git a/recipes/qarchive/config.yml b/recipes/qarchive/config.yml index 45be05c3784b4..8bfd455ac5961 100644 --- a/recipes/qarchive/config.yml +++ b/recipes/qarchive/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.0.2": folder: all "2.0.1": From b59685136816ec69a087b5de28d38c84b82d9e61 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 01:04:56 +0200 Subject: [PATCH 460/561] (#13520) libevent: conan v2 support --- recipes/libevent/all/CMakeLists.txt | 7 -- recipes/libevent/all/conandata.yml | 2 - recipes/libevent/all/conanfile.py | 103 +++++++++--------- .../libevent/all/test_package/CMakeLists.txt | 7 +- .../libevent/all/test_package/conanfile.py | 28 ++--- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../libevent/all/test_v1_package/conanfile.py | 17 +++ 7 files changed, 94 insertions(+), 80 deletions(-) delete mode 100644 recipes/libevent/all/CMakeLists.txt create mode 100644 recipes/libevent/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libevent/all/test_v1_package/conanfile.py diff --git a/recipes/libevent/all/CMakeLists.txt b/recipes/libevent/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/libevent/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libevent/all/conandata.yml b/recipes/libevent/all/conandata.yml index 3b0833457f7a3..f2a195cfe79c1 100644 --- a/recipes/libevent/all/conandata.yml +++ b/recipes/libevent/all/conandata.yml @@ -8,7 +8,5 @@ sources: patches: "2.1.12": - patch_file: patches/fix-cmake-2.1.12.patch - base_path: source_subfolder "2.1.11": - patch_file: patches/fix-cmake-2.1.11.patch - base_path: source_subfolder diff --git a/recipes/libevent/all/conanfile.py b/recipes/libevent/all/conanfile.py index 4f7372e490bb7..a06ee298377ac 100644 --- a/recipes/libevent/all/conanfile.py +++ b/recipes/libevent/all/conanfile.py @@ -1,9 +1,10 @@ -from conan.tools.microsoft import msvc_runtime_flag, is_msvc -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime import os -import functools -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.52.0" class LibeventConan(ConanFile): @@ -28,22 +29,8 @@ class LibeventConan(ConanFile): "disable_threads": False, } - generators = "cmake", "cmake_find_package" - short_paths = True - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -51,57 +38,69 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_openssl: self.requires("openssl/1.1.1q") 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.options.with_openssl: + tc.variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.variables["EVENT__LIBRARY_TYPE"] = "SHARED" if self.options.shared else "STATIC" + tc.variables["EVENT__DISABLE_DEBUG_MODE"] = self.settings.build_type == "Release" + tc.variables["EVENT__DISABLE_OPENSSL"] = not self.options.with_openssl + tc.variables["EVENT__DISABLE_THREAD_SUPPORT"] = self.options.disable_threads + tc.variables["EVENT__DISABLE_BENCHMARK"] = True + tc.variables["EVENT__DISABLE_TESTS"] = True + tc.variables["EVENT__DISABLE_REGRESS"] = True + tc.variables["EVENT__DISABLE_SAMPLES"] = True + # libevent uses static runtime (MT) for static builds by default + if is_msvc(self): + tc.variables["EVENT__MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) # relocatable shared libs on macOS - tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "AddEventLibrary.cmake"), + replace_in_file(self, os.path.join(self.source_folder, "cmake", "AddEventLibrary.cmake"), "INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/lib\"", "") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - if self.options.with_openssl: - cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath - cmake.definitions["EVENT__LIBRARY_TYPE"] = "SHARED" if self.options.shared else "STATIC" - cmake.definitions["EVENT__DISABLE_DEBUG_MODE"] = self.settings.build_type == "Release" - cmake.definitions["EVENT__DISABLE_OPENSSL"] = not self.options.with_openssl - cmake.definitions["EVENT__DISABLE_THREAD_SUPPORT"] = self.options.disable_threads - cmake.definitions["EVENT__DISABLE_BENCHMARK"] = True - cmake.definitions["EVENT__DISABLE_TESTS"] = True - cmake.definitions["EVENT__DISABLE_REGRESS"] = True - cmake.definitions["EVENT__DISABLE_SAMPLES"] = True - # libevent uses static runtime (MT) for static builds by default - if is_msvc(self): - cmake.definitions["EVENT__MSVC_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) - - cmake.configure(build_folder=self._build_subfolder) - return cmake - def build(self): self._patch_sources() - 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", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "cmake")) + rmdir(self, 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, "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Libevent") diff --git a/recipes/libevent/all/test_package/CMakeLists.txt b/recipes/libevent/all/test_package/CMakeLists.txt index 1cc4000b58485..dc7570c75d1b5 100644 --- a/recipes/libevent/all/test_package/CMakeLists.txt +++ b/recipes/libevent/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(Libevent REQUIRED core CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libevent::core) +target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core) diff --git a/recipes/libevent/all/test_package/conanfile.py b/recipes/libevent/all/test_package/conanfile.py index ab912e4e61df1..0a6bc68712d90 100644 --- a/recipes/libevent/all/test_package/conanfile.py +++ b/recipes/libevent/all/test_package/conanfile.py @@ -1,19 +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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # Workaround for CMake bug with error message: - # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # set. This could be because you are using a Mac OS X version less than 10.5 - # or because CMake's platform configuration is corrupt. - # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -21,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libevent/all/test_v1_package/CMakeLists.txt b/recipes/libevent/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..a8d5eec5dd24d --- /dev/null +++ b/recipes/libevent/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Libevent REQUIRED core CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core) diff --git a/recipes/libevent/all/test_v1_package/conanfile.py b/recipes/libevent/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libevent/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 20174227c5495e5643e4f26f3c875268568ae9e7 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 01:24:20 +0200 Subject: [PATCH 461/561] (#13521) tmxlite: conan v2 support --- recipes/tmxlite/all/CMakeLists.txt | 9 -- recipes/tmxlite/all/conandata.yml | 2 +- recipes/tmxlite/all/conanfile.py | 84 ++++++++++--------- ...02-cmake-link-external-miniz-pugixml.patch | 12 +++ .../tmxlite/all/test_package/CMakeLists.txt | 11 ++- recipes/tmxlite/all/test_package/conanfile.py | 19 +++-- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../tmxlite/all/test_v1_package/conanfile.py | 17 ++++ 8 files changed, 103 insertions(+), 62 deletions(-) delete mode 100644 recipes/tmxlite/all/CMakeLists.txt create mode 100644 recipes/tmxlite/all/patches/0002-cmake-link-external-miniz-pugixml.patch create mode 100644 recipes/tmxlite/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tmxlite/all/test_v1_package/conanfile.py diff --git a/recipes/tmxlite/all/CMakeLists.txt b/recipes/tmxlite/all/CMakeLists.txt deleted file mode 100644 index f39f80ce857c2..0000000000000 --- a/recipes/tmxlite/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -link_libraries(${CONAN_LIBS}) - -add_subdirectory(source_subfolder/tmxlite) diff --git a/recipes/tmxlite/all/conandata.yml b/recipes/tmxlite/all/conandata.yml index 33d0e85a50a95..acb2db05df822 100644 --- a/recipes/tmxlite/all/conandata.yml +++ b/recipes/tmxlite/all/conandata.yml @@ -5,4 +5,4 @@ sources: patches: "1.3.0": - patch_file: "patches/0001-include-external-pugixml.patch" - base_path: "source_subfolder" + - patch_file: "patches/0002-cmake-link-external-miniz-pugixml.patch" diff --git a/recipes/tmxlite/all/conanfile.py b/recipes/tmxlite/all/conanfile.py index 38e769ee77b57..44380126b8654 100644 --- a/recipes/tmxlite/all/conanfile.py +++ b/recipes/tmxlite/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class TmxliteConan(ConanFile): @@ -17,21 +21,14 @@ class TmxliteConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "rtti": [True, False], } default_options = { "shared": False, "fPIC": True, - "rtti": True, } - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,59 +36,64 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("miniz/2.1.0") - self.requires("pugixml/1.11") + self.requires("miniz/2.2.0") + self.requires("pugixml/1.12.1") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": raise ConanInvalidConfiguration("gcc < 5 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], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TMXLITE_STATIC_LIB"] = not self.options.shared + tc.variables["PROJECT_STATIC_RUNTIME"] = False + tc.variables["USE_RTTI"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) # unvendor miniz - tools.remove_files_by_mask(os.path.join(self._source_subfolder, "tmxlite", "src"), "miniz*") - tools.replace_in_file(os.path.join(self._source_subfolder, "tmxlite", "src", "CMakeLists.txt"), + rm(self, "miniz*", os.path.join(self.source_folder, "tmxlite", "src")) + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "src", "CMakeLists.txt"), "${PROJECT_DIR}/miniz.c", "") # unvendor pugixml - tools.rmdir(os.path.join(self._source_subfolder, "tmxlite", "src", "detail")) - tools.replace_in_file(os.path.join(self._source_subfolder, "tmxlite", "src", "CMakeLists.txt"), + rmdir(self, os.path.join(self.source_folder, "tmxlite", "src", "detail")) + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "src", "CMakeLists.txt"), "${PROJECT_DIR}/detail/pugixml.cpp", "") # Don't inject -O3 in compile flags - tools.replace_in_file(os.path.join(self._source_subfolder, "tmxlite", "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "CMakeLists.txt"), "-O3", "") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["TMXLITE_STATIC_LIB"] = not self.options.shared - self._cmake.definitions["PROJECT_STATIC_RUNTIME"] = False - self._cmake.definitions["USE_RTTI"] = self.options.rtti - self._cmake.configure() - return self._cmake - def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "tmxlite")) cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if not self.options.shared: self.cpp_info.defines.append("TMXLITE_STATIC") if self.settings.os == "Android": diff --git a/recipes/tmxlite/all/patches/0002-cmake-link-external-miniz-pugixml.patch b/recipes/tmxlite/all/patches/0002-cmake-link-external-miniz-pugixml.patch new file mode 100644 index 0000000000000..f2ca8d92a2ca9 --- /dev/null +++ b/recipes/tmxlite/all/patches/0002-cmake-link-external-miniz-pugixml.patch @@ -0,0 +1,12 @@ +--- a/tmxlite/CMakeLists.txt ++++ b/tmxlite/CMakeLists.txt +@@ -70,6 +70,9 @@ else() + add_library(${PROJECT_NAME} SHARED ${PROJECT_SRC}) + endif() + endif() ++find_package(miniz REQUIRED CONFIG) ++find_package(pugixml REQUIRED CONFIG) ++target_link_libraries(${PROJECT_NAME} PRIVATE miniz::miniz pugixml::pugixml) + + target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) + diff --git a/recipes/tmxlite/all/test_package/CMakeLists.txt b/recipes/tmxlite/all/test_package/CMakeLists.txt index 3300ff7750277..564eece99799e 100644 --- a/recipes/tmxlite/all/test_package/CMakeLists.txt +++ b/recipes/tmxlite/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(tmxlite REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE tmxlite::tmxlite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tmxlite/all/test_package/conanfile.py b/recipes/tmxlite/all/test_package/conanfile.py index 5216332f39f5c..0a6bc68712d90 100644 --- a/recipes/tmxlite/all/test_package/conanfile.py +++ b/recipes/tmxlite/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tmxlite/all/test_v1_package/CMakeLists.txt b/recipes/tmxlite/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ca4979c8e62d9 --- /dev/null +++ b/recipes/tmxlite/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tmxlite REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tmxlite::tmxlite) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tmxlite/all/test_v1_package/conanfile.py b/recipes/tmxlite/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/tmxlite/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 5d957b4fdfc9578353fdbbe31c5f4a030f2be5d1 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 01:44:19 +0200 Subject: [PATCH 462/561] (#13522) tmx: conan v2 support --- recipes/tmx/all/CMakeLists.txt | 7 -- recipes/tmx/all/conanfile.py | 83 ++++++++++--------- recipes/tmx/all/test_package/CMakeLists.txt | 7 +- recipes/tmx/all/test_package/conanfile.py | 19 +++-- .../tmx/all/test_v1_package/CMakeLists.txt | 10 +++ recipes/tmx/all/test_v1_package/conanfile.py | 18 ++++ 6 files changed, 87 insertions(+), 57 deletions(-) delete mode 100644 recipes/tmx/all/CMakeLists.txt create mode 100644 recipes/tmx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tmx/all/test_v1_package/conanfile.py diff --git a/recipes/tmx/all/CMakeLists.txt b/recipes/tmx/all/CMakeLists.txt deleted file mode 100644 index 8315062fd31ee..0000000000000 --- a/recipes/tmx/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper C) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/tmx/all/conanfile.py b/recipes/tmx/all/conanfile.py index d229ad4b32c22..5a3b3214bc42f 100644 --- a/recipes/tmx/all/conanfile.py +++ b/recipes/tmx/all/conanfile.py @@ -1,9 +1,10 @@ -from conans import ConanFile, CMake, tools -import functools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.1" class TmxConan(ConanFile): @@ -28,58 +29,61 @@ class TmxConan(ConanFile): "with_zstd": False, } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_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 - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.9.13") + self.requires("libxml2/2.9.14") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") if self.options.with_zstd: self.requires("zstd/1.5.2") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "${CMAKE_BINARY_DIR}", "${CMAKE_CURRENT_BINARY_DIR}") + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["WANT_ZLIB"] = self.options.with_zlib - cmake.definitions["WANT_ZSTD"] = self.options.with_zstd + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WANT_ZLIB"] = self.options.with_zlib + tc.variables["WANT_ZSTD"] = self.options.with_zstd if self.options.with_zstd: - cmake.definitions["ZSTD_PREFER_STATIC"] = not self.options["zstd"].shared - cmake.configure() - return cmake + tc.variables["ZSTD_PREFER_STATIC"] = not self.dependencies["zstd"].options.shared + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + 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", 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")) # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self._create_cmake_module_alias_targets( @@ -87,21 +91,20 @@ def package(self): {"tmx": "tmx::tmx"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "tmx") diff --git a/recipes/tmx/all/test_package/CMakeLists.txt b/recipes/tmx/all/test_package/CMakeLists.txt index 8caed204543d3..27410290350a8 100644 --- a/recipes/tmx/all/test_package/CMakeLists.txt +++ b/recipes/tmx/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(tmx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} tmx) +target_link_libraries(${PROJECT_NAME} PRIVATE tmx) diff --git a/recipes/tmx/all/test_package/conanfile.py b/recipes/tmx/all/test_package/conanfile.py index 2d4b3d3b837ac..da601c15e4dfc 100644 --- a/recipes/tmx/all/test_package/conanfile.py +++ b/recipes/tmx/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,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.bindirs[0], "test_package") tmx_path = os.path.join(self.source_folder, "externtileset.tmx") - self.run("{} {}".format(bin_path, tmx_path), run_environment=True) + self.run(f"{bin_path} {tmx_path}", env="conanrun") diff --git a/recipes/tmx/all/test_v1_package/CMakeLists.txt b/recipes/tmx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b3630d9b9ae2 --- /dev/null +++ b/recipes/tmx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tmx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tmx) diff --git a/recipes/tmx/all/test_v1_package/conanfile.py b/recipes/tmx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5654af76091cf --- /dev/null +++ b/recipes/tmx/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + tmx_path = os.path.join(self.source_folder, os.pardir, "test_package", "externtileset.tmx") + self.run(f"{bin_path} {tmx_path}", run_environment=True) From 9520538e73da7ae6635dbfe93f595d713b996426 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 02:04:22 +0200 Subject: [PATCH 463/561] (#13523) brynet: conan v2 support --- recipes/brynet/all/conanfile.py | 39 +++++++++++-------- .../brynet/all/test_package/CMakeLists.txt | 11 +++--- recipes/brynet/all/test_package/conanfile.py | 19 ++++++--- .../brynet/all/test_v1_package/CMakeLists.txt | 11 ++++++ .../brynet/all/test_v1_package/conanfile.py | 17 ++++++++ 5 files changed, 70 insertions(+), 27 deletions(-) create mode 100644 recipes/brynet/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/brynet/all/test_v1_package/conanfile.py diff --git a/recipes/brynet/all/conanfile.py b/recipes/brynet/all/conanfile.py index 33bea6b1fd799..f19ddf2cfae85 100644 --- a/recipes/brynet/all/conanfile.py +++ b/recipes/brynet/all/conanfile.py @@ -1,18 +1,21 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class BrynetConan(ConanFile): name = "brynet" description = "Header Only Cross platform high performance TCP network library using C++ 11." license = "MIT" - topics = ("conan", "brynet", "networking", "tcp", "websocket") + topics = ("networking", "tcp", "websocket") homepage = "https://github.com/IronsDu/brynet" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler" + settings = "os", "arch", "compiler", "build_type" options = { "with_openssl": [True, False], } @@ -22,30 +25,34 @@ class BrynetConan(ConanFile): no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1q") + self.requires("openssl/1.1.1q", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) - - def package_id(self): - self.info.header_only() + 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], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] if self.options.with_openssl: self.cpp_info.defines.append("BRYNET_USE_OPENSSL") if self.settings.os == "Windows": diff --git a/recipes/brynet/all/test_package/CMakeLists.txt b/recipes/brynet/all/test_package/CMakeLists.txt index 33ae887aa6aea..d7b3556ccaf55 100644 --- a/recipes/brynet/all/test_package/CMakeLists.txt +++ b/recipes/brynet/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(brynet REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE brynet::brynet) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/brynet/all/test_package/conanfile.py b/recipes/brynet/all/test_package/conanfile.py index 5216332f39f5c..0a6bc68712d90 100644 --- a/recipes/brynet/all/test_package/conanfile.py +++ b/recipes/brynet/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/brynet/all/test_v1_package/CMakeLists.txt b/recipes/brynet/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d6bc29a53890 --- /dev/null +++ b/recipes/brynet/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(brynet REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE brynet::brynet) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/brynet/all/test_v1_package/conanfile.py b/recipes/brynet/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/brynet/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 5dd60f98dc23e5f8a2a63f41a1f8facfd80f39bd Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 02:24:59 +0200 Subject: [PATCH 464/561] (#13525) jxrlib: conan v2 support * conan v2 support * self.info in validate() Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- recipes/jxrlib/all/CMakeLists.txt | 13 +-- recipes/jxrlib/all/conandata.yml | 1 - recipes/jxrlib/all/conanfile.py | 81 ++++++++++--------- .../jxrlib/all/test_package/CMakeLists.txt | 7 +- recipes/jxrlib/all/test_package/conanfile.py | 21 +++-- .../jxrlib/all/test_v1_package/CMakeLists.txt | 10 +++ .../jxrlib/all/test_v1_package/conanfile.py | 18 +++++ 7 files changed, 94 insertions(+), 57 deletions(-) create mode 100644 recipes/jxrlib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jxrlib/all/test_v1_package/conanfile.py diff --git a/recipes/jxrlib/all/CMakeLists.txt b/recipes/jxrlib/all/CMakeLists.txt index a5327c20bf0d3..f4e654c29be7f 100644 --- a/recipes/jxrlib/all/CMakeLists.txt +++ b/recipes/jxrlib/all/CMakeLists.txt @@ -1,16 +1,13 @@ -cmake_minimum_required(VERSION 2.8.12) -project(jxrlib C) +cmake_minimum_required(VERSION 3.1) +project(jxrlib LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(JPEGXR_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) +include(GNUInstallDirs) +include(TestBigEndian) if(NOT MSVC) add_definitions(-D__ANSI__) endif() -include(TestBigEndian) test_big_endian(ISBIGENDIAN) if(ISBIGENDIAN) set(DEF_ENDIAN _BIG__ENDIAN_) @@ -80,8 +77,6 @@ install(TARGETS jxrglue LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) - - install(FILES ${JPEGXR_FOLDER}/jxrgluelib/JXRGlue.h ${JPEGXR_FOLDER}/jxrgluelib/JXRMeta.h diff --git a/recipes/jxrlib/all/conandata.yml b/recipes/jxrlib/all/conandata.yml index bf3b5c5345ec6..478aec5f4b6b6 100644 --- a/recipes/jxrlib/all/conandata.yml +++ b/recipes/jxrlib/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "cci.20170615": - patch_file: patches/0001-missing-declarations.patch - base_path: source_subfolder diff --git a/recipes/jxrlib/all/conanfile.py b/recipes/jxrlib/all/conanfile.py index 8d37497c03a35..d4c71b54de455 100644 --- a/recipes/jxrlib/all/conanfile.py +++ b/recipes/jxrlib/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class JxrlibConan(ConanFile): @@ -10,9 +14,8 @@ class JxrlibConan(ConanFile): homepage = "https://jxrlib.codeplex.com/" url = "https://github.com/conan-io/conan-center-index" license = "BSD-2-Clause" - topics = ("conan", "jxr", "jpeg", "xr") - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" + topics = ("jxr", "jpeg", "xr") + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,15 +26,9 @@ class JxrlibConan(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,44 +36,54 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler == "Visual Studio" and self.options.shared: - raise ConanInvalidConfiguration("jxrlib shared not supported by Visual Studio") + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure(build_dir=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["JPEGXR_FOLDER"] = self.source_folder.replace("\\", "/") + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libjxr") self.cpp_info.libs = ["jxrglue", "jpegxr"] - - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - if self.settings.os != "Windows": + if not is_msvc(self): self.cpp_info.defines.append("__ANSI__") - self.cpp_info.names["pkg_config"] = "libjxr" + # TODO: to remove in conan v2, and do not port this to CMakeDeps, it was a mistake self.cpp_info.names["cmake_find_package"] = "JXR" self.cpp_info.names["cmake_find_package_multi"] = "JXR" diff --git a/recipes/jxrlib/all/test_package/CMakeLists.txt b/recipes/jxrlib/all/test_package/CMakeLists.txt index 7b9b613cbb24a..e7689f4130d27 100644 --- a/recipes/jxrlib/all/test_package/CMakeLists.txt +++ b/recipes/jxrlib/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(jxrlib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE jxrlib::jxrlib) diff --git a/recipes/jxrlib/all/test_package/conanfile.py b/recipes/jxrlib/all/test_package/conanfile.py index d7ad3be43e392..b8d2e695e4b3a 100644 --- a/recipes/jxrlib/all/test_package/conanfile.py +++ b/recipes/jxrlib/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,7 +21,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") img_path = os.path.join(self.source_folder, "test.jxr") - self.run("{0} {1}".format(bin_path, img_path), run_environment=True) + self.run(f"{bin_path} {img_path}", env="conanrun") diff --git a/recipes/jxrlib/all/test_v1_package/CMakeLists.txt b/recipes/jxrlib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..eb386b8f18cc0 --- /dev/null +++ b/recipes/jxrlib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(JXR REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE JXR::JXR) diff --git a/recipes/jxrlib/all/test_v1_package/conanfile.py b/recipes/jxrlib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ffd0b1c74921b --- /dev/null +++ b/recipes/jxrlib/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.jxr") + self.run(f"{bin_path} {img_path}", run_environment=True) From c6d36e209711d50bbdcda0cc576c1ab7d8418c84 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 02:44:16 +0200 Subject: [PATCH 465/561] (#13529) ecos: conan v2 support --- recipes/ecos/all/CMakeLists.txt | 9 --- recipes/ecos/all/conandata.yml | 2 - recipes/ecos/all/conanfile.py | 65 ++++++++++--------- recipes/ecos/all/test_package/CMakeLists.txt | 7 +- recipes/ecos/all/test_package/conanfile.py | 19 ++++-- .../ecos/all/test_v1_package/CMakeLists.txt | 10 +++ recipes/ecos/all/test_v1_package/conanfile.py | 17 +++++ 7 files changed, 79 insertions(+), 50 deletions(-) delete mode 100644 recipes/ecos/all/CMakeLists.txt create mode 100644 recipes/ecos/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/ecos/all/test_v1_package/conanfile.py diff --git a/recipes/ecos/all/CMakeLists.txt b/recipes/ecos/all/CMakeLists.txt deleted file mode 100644 index c5630c8098ba3..0000000000000 --- a/recipes/ecos/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) - -add_subdirectory(source_subfolder) diff --git a/recipes/ecos/all/conandata.yml b/recipes/ecos/all/conandata.yml index ddfac800071fa..3034805590c75 100644 --- a/recipes/ecos/all/conandata.yml +++ b/recipes/ecos/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "2.0.8": - patch_file: "patches/0001-fix-cmake.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-missing-include.patch" - base_path: "source_subfolder" diff --git a/recipes/ecos/all/conanfile.py b/recipes/ecos/all/conanfile.py index 48767c8ddc05e..6947c543e0352 100644 --- a/recipes/ecos/all/conanfile.py +++ b/recipes/ecos/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class EcosConan(ConanFile): @@ -24,13 +26,8 @@ class EcosConan(ConanFile): "use_long": True, } - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -38,41 +35,51 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): # TODO: unvendor suitesparse pass 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], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["USE_LONG"] = self.options.use_long - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_LONG"] = self.options.use_long + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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", 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): - self.cpp_info.names["cmake_find_package"] = "ecos" - self.cpp_info.names["cmake_find_package_multi"] = "ecos" + self.cpp_info.set_property("cmake_file_name", "ecos") + self.cpp_info.set_property("cmake_target_name", "ecos::ecos") self.cpp_info.libs = ["ecos"] self.cpp_info.defines.append("CTRLC=1") if self.options.use_long: diff --git a/recipes/ecos/all/test_package/CMakeLists.txt b/recipes/ecos/all/test_package/CMakeLists.txt index 9bc6a076f7ed2..006729666b6b5 100644 --- a/recipes/ecos/all/test_package/CMakeLists.txt +++ b/recipes/ecos/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(ecos REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ecos::ecos) +target_link_libraries(${PROJECT_NAME} PRIVATE ecos::ecos) diff --git a/recipes/ecos/all/test_package/conanfile.py b/recipes/ecos/all/test_package/conanfile.py index a9f777f7680ff..0a6bc68712d90 100644 --- a/recipes/ecos/all/test_package/conanfile.py +++ b/recipes/ecos/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ecos/all/test_v1_package/CMakeLists.txt b/recipes/ecos/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..465202cc7e581 --- /dev/null +++ b/recipes/ecos/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(ecos REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ecos::ecos) diff --git a/recipes/ecos/all/test_v1_package/conanfile.py b/recipes/ecos/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/ecos/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 41737f9551dcc867d851da1194353edf0f2fa9b5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 03:05:45 +0200 Subject: [PATCH 466/561] (#13531) arcus: conan v2 support * conan v2 support * fix upstream CMakeLists --- recipes/arcus/all/CMakeLists.txt | 7 -- recipes/arcus/all/conandata.yml | 3 + recipes/arcus/all/conanfile.py | 108 +++++++----------- .../arcus/all/patches/0001-fix-cmake.patch | 62 ++++++++++ recipes/arcus/all/test_package/CMakeLists.txt | 11 +- recipes/arcus/all/test_package/conanfile.py | 19 ++- .../arcus/all/test_v1_package/CMakeLists.txt | 11 ++ .../arcus/all/test_v1_package/conanfile.py | 17 +++ 8 files changed, 154 insertions(+), 84 deletions(-) delete mode 100644 recipes/arcus/all/CMakeLists.txt create mode 100644 recipes/arcus/all/patches/0001-fix-cmake.patch create mode 100644 recipes/arcus/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/arcus/all/test_v1_package/conanfile.py diff --git a/recipes/arcus/all/CMakeLists.txt b/recipes/arcus/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9..0000000000000 --- a/recipes/arcus/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/arcus/all/conandata.yml b/recipes/arcus/all/conandata.yml index 9e659afa43d49..beb6b4ed8bb02 100644 --- a/recipes/arcus/all/conandata.yml +++ b/recipes/arcus/all/conandata.yml @@ -2,3 +2,6 @@ sources: "4.9.1": url: "https://github.com/Ultimaker/libArcus/archive/refs/tags/4.9.1.tar.gz" sha256: "18d939fd2428c72fdce35a286c196438327cfc3c8476e463e5ca46570168c9ce" +patches: + "4.9.1": + - patch_file: "patches/0001-fix-cmake.patch" diff --git a/recipes/arcus/all/conanfile.py b/recipes/arcus/all/conanfile.py index b11f3d26915f9..10256ef37f251 100644 --- a/recipes/arcus/all/conanfile.py +++ b/recipes/arcus/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class ArcusConan(ConanFile): @@ -11,7 +15,7 @@ class ArcusConan(ConanFile): "creating a socket in a thread and using this socket to send " \ "and receive messages based on the Protocol Buffers library." license = "LGPL-3.0-or-later" - topics = ("arcus", "protobuf", "socket", "cura") + topics = ("protobuf", "socket", "cura") homepage = "https://github.com/Ultimaker/libArcus" url = "https://github.com/conan-io/conan-center-index" @@ -26,17 +30,8 @@ class ArcusConan(ConanFile): "fPIC": True, } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -44,84 +39,68 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("protobuf/3.17.1") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - # Do not force PIC - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", - "") - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "set_target_properties(Arcus PROPERTIES COMPILE_FLAGS -fPIC)", - "") - # TODO: this patch could be removed when CMake variables fixed in protobuf recipe - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "target_link_libraries(Arcus PUBLIC ${PROTOBUF_LIBRARIES})", - "target_link_libraries(Arcus PUBLIC protobuf::libprotobuf)") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_PYTHON"] = False - self._cmake.definitions["BUILD_EXAMPLES"] = False - self._cmake.definitions["BUILD_STATIC"] = not self.options.shared - if self._is_msvc: - if self.settings.compiler == "Visual Studio": - is_static_runtime = str(self.settings.compiler.runtime).startswith("MT") - else: - is_static_runtime = self.settings.compiler.runtime == "static" - self._cmake.definitions["MSVC_STATIC_RUNTIME"] = is_static_runtime - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_PYTHON"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_STATIC"] = not self.options.shared + if is_msvc(self): + tc.variables["MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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", 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")) + # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), {"Arcus": "Arcus::Arcus"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) - - @property - def _module_subfolder(self): - return os.path.join("lib", "cmake") + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join(self._module_subfolder, - "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "Arcus") @@ -135,6 +114,5 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "Arcus" self.cpp_info.names["cmake_find_package_multi"] = "Arcus" - self.cpp_info.builddirs.append(self._module_subfolder) self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/arcus/all/patches/0001-fix-cmake.patch b/recipes/arcus/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..581de6fa9b257 --- /dev/null +++ b/recipes/arcus/all/patches/0001-fix-cmake.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ ++cmake_minimum_required(VERSION 3.8) + project(arcus) +-cmake_minimum_required(VERSION 3.6) + + include(GNUInstallDirs) + include(CMakePackageConfigHelpers) +@@ -19,7 +19,6 @@ endif() + set(protobuf_MODULE_COMPATIBLE ON CACHE INTERNAL "" FORCE) + find_package(Protobuf 3.0.0 REQUIRED) + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) #Required if a patch to libArcus needs to be made via templates. + + if(BUILD_PYTHON) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +@@ -37,11 +36,7 @@ if(BUILD_PYTHON) + include_directories(python/ src/ ${SIP_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) + endif() + +-set(CMAKE_CXX_STANDARD 11) + +-if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +-endif() + + set(arcus_SRCS + src/Socket.cpp +@@ -63,17 +58,16 @@ set(arcus_HDRS + set(ARCUS_VERSION 1.1.0) + set(ARCUS_SOVERSION 3) + +-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") + + if(BUILD_STATIC) + add_library(Arcus STATIC ${arcus_SRCS}) + if(NOT WIN32 OR CMAKE_COMPILER_IS_GNUCXX) + target_link_libraries(Arcus PRIVATE pthread) +- set_target_properties(Arcus PROPERTIES COMPILE_FLAGS -fPIC) + endif() + else() + add_library(Arcus SHARED ${arcus_SRCS}) + endif() ++target_compile_features(Arcus PUBLIC cxx_std_11) + + if(MSVC_STATIC_RUNTIME) + foreach(flag_var +@@ -97,11 +91,11 @@ target_include_directories(Arcus PUBLIC + $ + ${PROTOBUF_INCLUDE_DIR} + ) +-target_link_libraries(Arcus PUBLIC ${PROTOBUF_LIBRARIES}) ++target_link_libraries(Arcus PUBLIC protobuf::libprotobuf) + + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0600) # Declare we require Vista or higher, this allows us to use IPv6 functions. +- target_link_libraries(Arcus PUBLIC Ws2_32) ++ target_link_libraries(Arcus PUBLIC ws2_32) + endif() + + if(${CMAKE_BUILD_TYPE}) diff --git a/recipes/arcus/all/test_package/CMakeLists.txt b/recipes/arcus/all/test_package/CMakeLists.txt index ef27cd84029d8..376d65791e678 100644 --- a/recipes/arcus/all/test_package/CMakeLists.txt +++ b/recipes/arcus/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(Arcus REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} Arcus) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE Arcus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/arcus/all/test_package/conanfile.py b/recipes/arcus/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/arcus/all/test_package/conanfile.py +++ b/recipes/arcus/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/arcus/all/test_v1_package/CMakeLists.txt b/recipes/arcus/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5b257f71e6bdc --- /dev/null +++ b/recipes/arcus/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Arcus REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Arcus) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/arcus/all/test_v1_package/conanfile.py b/recipes/arcus/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/arcus/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 5ac7587c46c9f102274f4e0f5d06af4773527f57 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 03:24:54 +0200 Subject: [PATCH 467/561] (#13532) gamma: conan v2 support --- recipes/gamma/all/CMakeLists.txt | 39 ++++++------ recipes/gamma/all/conanfile.py | 60 ++++++++++--------- recipes/gamma/all/test_package/CMakeLists.txt | 7 +-- recipes/gamma/all/test_package/conanfile.py | 19 ++++-- .../gamma/all/test_v1_package/CMakeLists.txt | 11 ++++ .../gamma/all/test_v1_package/conanfile.py | 17 ++++++ 6 files changed, 94 insertions(+), 59 deletions(-) create mode 100644 recipes/gamma/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gamma/all/test_v1_package/conanfile.py diff --git a/recipes/gamma/all/CMakeLists.txt b/recipes/gamma/all/CMakeLists.txt index 13eecd482b342..d7ab29edac81b 100644 --- a/recipes/gamma/all/CMakeLists.txt +++ b/recipes/gamma/all/CMakeLists.txt @@ -1,33 +1,28 @@ cmake_minimum_required(VERSION 3.8) -project(Gamma) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) +project(Gamma LANGUAGES CXX) option(GAMMA_AUDIO_IO "Provide Audio Class" ON) option(GAMMA_SOUNDFILE "Provide SoundFile Class" ON) include(GNUInstallDirs) -set(GAMMA_DIR source_subfolder) - -file(GLOB GAMMA_PUBLIC_HEADERS ${GAMMA_DIR}/Gamma/*.h) +file(GLOB GAMMA_PUBLIC_HEADERS ${GAMMA_SRC_DIR}/Gamma/*.h) add_library(Gamma - ${GAMMA_DIR}/src/arr.cpp - ${GAMMA_DIR}/src/Conversion.cpp - ${GAMMA_DIR}/src/Domain.cpp - ${GAMMA_DIR}/src/DFT.cpp - ${GAMMA_DIR}/src/FFT_fftpack.cpp - ${GAMMA_DIR}/src/fftpack++1.cpp - ${GAMMA_DIR}/src/fftpack++2.cpp - ${GAMMA_DIR}/src/Print.cpp - ${GAMMA_DIR}/src/scl.cpp - ${GAMMA_DIR}/src/Recorder.cpp - ${GAMMA_DIR}/src/Scheduler.cpp - ${GAMMA_DIR}/src/Timer.cpp + ${GAMMA_SRC_DIR}/src/arr.cpp + ${GAMMA_SRC_DIR}/src/Conversion.cpp + ${GAMMA_SRC_DIR}/src/Domain.cpp + ${GAMMA_SRC_DIR}/src/DFT.cpp + ${GAMMA_SRC_DIR}/src/FFT_fftpack.cpp + ${GAMMA_SRC_DIR}/src/fftpack++1.cpp + ${GAMMA_SRC_DIR}/src/fftpack++2.cpp + ${GAMMA_SRC_DIR}/src/Print.cpp + ${GAMMA_SRC_DIR}/src/scl.cpp + ${GAMMA_SRC_DIR}/src/Recorder.cpp + ${GAMMA_SRC_DIR}/src/Scheduler.cpp + ${GAMMA_SRC_DIR}/src/Timer.cpp ) -target_include_directories(Gamma PUBLIC ${GAMMA_DIR}) +target_include_directories(Gamma PUBLIC ${GAMMA_SRC_DIR}) target_compile_features(Gamma PUBLIC cxx_std_14) set_target_properties(Gamma PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -39,7 +34,7 @@ endif() if(GAMMA_AUDIO_IO) find_package(portaudio REQUIRED CONFIG) target_link_libraries(Gamma PRIVATE portaudio::portaudio) - target_sources(Gamma PRIVATE ${GAMMA_DIR}/src/AudioIO.cpp) + target_sources(Gamma PRIVATE ${GAMMA_SRC_DIR}/src/AudioIO.cpp) else() list(FILTER GAMMA_PUBLIC_HEADERS EXCLUDE REGEX ".*AudioIO\\.h$") endif() @@ -47,7 +42,7 @@ endif() if(GAMMA_SOUNDFILE) find_package(SndFile REQUIRED CONFIG) target_link_libraries(Gamma PRIVATE SndFile::sndfile) - target_sources(Gamma PRIVATE ${GAMMA_DIR}/src/SoundFile.cpp) + target_sources(Gamma PRIVATE ${GAMMA_SRC_DIR}/src/SoundFile.cpp) target_compile_definitions(Gamma PRIVATE GAM_USE_LIBSNDFILE) else() list(FILTER GAMMA_PUBLIC_HEADERS EXCLUDE REGEX ".*SoundFile\\.h$") diff --git a/recipes/gamma/all/conanfile.py b/recipes/gamma/all/conanfile.py index d791afea8a139..451083af4f13c 100644 --- a/recipes/gamma/all/conanfile.py +++ b/recipes/gamma/all/conanfile.py @@ -1,8 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.51.1" class Gammaconan(ConanFile): @@ -12,7 +15,7 @@ class Gammaconan(ConanFile): "and filtering of signals." ) license = "MIT" - topics = ("gamma", "signal-processing", "sound", "audio") + topics = ("signal-processing", "sound", "audio") homepage = "https://github.com/LancePutnam/Gamma" url = "https://github.com/conan-io/conan-center-index" @@ -31,11 +34,6 @@ class Gammaconan(ConanFile): } exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package_multi" - - @property - def _source_subfolder(self): - return "source_subfolder" def config_options(self): if self.settings.os == "Windows": @@ -43,41 +41,49 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.soundfile: self.requires("libsndfile/1.0.31") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) - if self.options.audio_io: + if self.info.options.audio_io: # TODO: add audio_io support once portaudio added to CCI raise ConanInvalidConfiguration( "gamma:audio_io=True requires portaudio, not available in conan-center yet" ) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["GAMMA_AUDIO_IO"] = self.options.audio_io - cmake.definitions["GAMMA_SOUNDFILE"] = self.options.soundfile - cmake.configure() - return cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["GAMMA_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["GAMMA_AUDIO_IO"] = self.options.audio_io + tc.variables["GAMMA_SOUNDFILE"] = self.options.soundfile + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): diff --git a/recipes/gamma/all/test_package/CMakeLists.txt b/recipes/gamma/all/test_package/CMakeLists.txt index f8bf6bdc344e3..98f55fe7ea287 100644 --- a/recipes/gamma/all/test_package/CMakeLists.txt +++ b/recipes/gamma/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(gamma REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} gamma::gamma) +target_link_libraries(${PROJECT_NAME} PRIVATE gamma::gamma) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/gamma/all/test_package/conanfile.py b/recipes/gamma/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/gamma/all/test_package/conanfile.py +++ b/recipes/gamma/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gamma/all/test_v1_package/CMakeLists.txt b/recipes/gamma/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c32216450f32e --- /dev/null +++ b/recipes/gamma/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(gamma REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gamma::gamma) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/gamma/all/test_v1_package/conanfile.py b/recipes/gamma/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/gamma/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 1a17b4c7dfb2cd3b70b152b418df775ea1eb870f Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 04:04:15 +0200 Subject: [PATCH 468/561] (#13538) xorg: allow cross compilation * xorg: allow cross compilation with arch settings, it always installs the system's default arch for system packages * Update conanfile.py * complete settings --- recipes/xorg/all/conanfile.py | 16 ++++++++-------- recipes/xorg/all/test_v1_package/conanfile.py | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/recipes/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py index 6dfbe525aad48..c1f209e672558 100644 --- a/recipes/xorg/all/conanfile.py +++ b/recipes/xorg/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.gnu import PkgConfig -from conan.tools.system.package_manager import Apt, Dnf, PacMan, Pkg, Yum, Zypper +from conan.tools.system import package_manager from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.47" @@ -12,7 +12,7 @@ class XorgConan(ConanFile): license = "MIT" homepage = "https://www.x.org/wiki/" description = "The X.Org project provides an open source implementation of the X Window System." - settings = "os" + settings = "os", "arch", "compiler", "build_type" topics = ("x11", "xorg") def validate(self): @@ -23,7 +23,7 @@ def package_id(self): self.info.header_only() def system_requirements(self): - apt = Apt(self) + apt = package_manager.Apt(self) apt.install(["libx11-dev", "libx11-xcb-dev", "libfontenc-dev", "libice-dev", "libsm-dev", "libxau-dev", "libxaw7-dev", "libxcomposite-dev", "libxcursor-dev", "libxdamage-dev", "libxdmcp-dev", "libxext-dev", "libxfixes-dev", "libxi-dev", "libxinerama-dev", "libxkbfile-dev", "libxmu-dev", "libxmuu-dev", @@ -35,33 +35,33 @@ def system_requirements(self): apt.install_substitutes( ["libxcb-util-dev"], ["libxcb-util0-dev"], update=True, check=True) - Yum(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + package_manager.Yum(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", "xorg-x11-xtrans-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", "xcb-util-devel", "libuuid-devel", "xkeyboard-config-devel"], update=True, check=True) - Dnf(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + package_manager.Dnf(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", "xorg-x11-xtrans-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", "xcb-util-devel", "libuuid-devel", "xkeyboard-config-devel"], update=True, check=True) - Zypper(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + package_manager.Zypper(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", "xorg-x11-xtrans-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", "xcb-util-devel", "libuuid-devel", "xkeyboard-config"], update=True, check=True) - PacMan(self).install(["libxcb", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", + package_manager.PacMan(self).install(["libxcb", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", "libxdamage", "libxdmcp", "libxtst", "libxinerama", "libxkbfile", "libxrandr", "libxres", "libxss", "libxvmc", "xtrans", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", "libxxf86vm", "libxv", "xkeyboard-config", "xcb-util", "util-linux-libs"], update=True, check=True) - Pkg(self).install(["libX11", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", + package_manager.Pkg(self).install(["libX11", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", "libxdamage", "libxdmcp", "libxtst", "libxinerama", "libxkbfile", "libxrandr", "libxres", "libXScrnSaver", "libxvmc", "xtrans", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", "libxxf86vm", "libxv", "xkeyboard-config", "xcb-util"], update=True, check=True) diff --git a/recipes/xorg/all/test_v1_package/conanfile.py b/recipes/xorg/all/test_v1_package/conanfile.py index 5079d1fb5b083..ce69ba8b754ca 100644 --- a/recipes/xorg/all/test_v1_package/conanfile.py +++ b/recipes/xorg/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os From 79207824dce2b1618e6d7e69a4ea1c597782b711 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 04:24:59 +0200 Subject: [PATCH 469/561] (#13541) opengl: allow cross compilation with arch settings, it always installs the system's default arch for system packages --- recipes/opengl/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/opengl/all/conanfile.py b/recipes/opengl/all/conanfile.py index 264e40ea5e0f0..09a72805491de 100644 --- a/recipes/opengl/all/conanfile.py +++ b/recipes/opengl/all/conanfile.py @@ -11,7 +11,7 @@ class SysConfigOpenGLConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.opengl.org/" license = "MIT" - settings = "os" + settings = "os", "arch", "compiler", "build_type" def package_id(self): self.info.header_only() From 901aebb54f3a6a18c0b1336027d1b481cc873484 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 04:44:22 +0200 Subject: [PATCH 470/561] (#13542) egl: allow cross compilation --- recipes/egl/system/conanfile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipes/egl/system/conanfile.py b/recipes/egl/system/conanfile.py index 818059aea10ed..956446154ca51 100644 --- a/recipes/egl/system/conanfile.py +++ b/recipes/egl/system/conanfile.py @@ -1,5 +1,6 @@ -from conans import ConanFile, tools -from conans.errors import ConanException, ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conans import tools class SysConfigEGLConan(ConanFile): @@ -10,7 +11,7 @@ class SysConfigEGLConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.khronos.org/egl" license = "MIT" - settings = "os" + settings = "os", "arch", "compiler", "build_type" def configure(self): if self.settings.os not in ["Linux", "FreeBSD"]: From 03118e827b8d2b872d286c723fe5aca9c9c1122c Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Tue, 18 Oct 2022 05:14:15 +0200 Subject: [PATCH 471/561] (#13543) [bot] Add Access Request users (2022-10-17) --- .c3i/authorized_users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 94ef38e9a5f6a..b3998b2377562 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -954,3 +954,6 @@ authorized_users: - "jfaust" - "morningstar1" - "lrineau" + - "jwidauer" + - "partiallyderived" + - "Ahajha" From 2af0b4f8a82b8f16fb65c636f3bcee2f861c83e4 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 05:24:38 +0200 Subject: [PATCH 472/561] (#13544) bump github actions * bump github actions these use depcreated nodejs: https://github.com/conan-io/conan-center-index/actions/runs/3264204975 https://github.com/conan-io/conan-center-index/actions/runs/3264790541 https://github.com/conan-io/conan-center-index/actions/runs/3264796403 * Update linter-yaml.yml * Update linter-yaml.yml * Update linter-conan-v2.yml * Update linter-conan-v2.yml --- .github/workflows/linter-conan-v2.yml | 12 ++++++------ .github/workflows/linter-yaml.yml | 10 +++++----- .github/workflows/on-push-do-doco.yml | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/linter-conan-v2.yml b/.github/workflows/linter-conan-v2.yml index d1f78543433e7..618e82492e865 100644 --- a/.github/workflows/linter-conan-v2.yml +++ b/.github/workflows/linter-conan-v2.yml @@ -18,7 +18,7 @@ jobs: with: fetch-depth: 2 - name: Get changed files - uses: tj-actions/changed-files@v20 + uses: tj-actions/changed-files@v32 id: changed_files with: files: | @@ -29,7 +29,7 @@ jobs: uses: mikefarah/yq@master with: cmd: yq '.conan.version' '.c3i/config_v1.yml' - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 if: steps.changed_files.outputs.any_changed == 'true' with: python-version: ${{ env.PYVER }} @@ -87,7 +87,7 @@ jobs: fetch-depth: 2 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v20 + uses: tj-actions/changed-files@v32 with: files: | recipes/*/*/conanfile.py @@ -97,7 +97,7 @@ jobs: uses: mikefarah/yq@master with: cmd: yq '.conan.version' '.c3i/config_v1.yml' - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 if: steps.changed-files.outputs.any_changed == 'true' with: python-version: ${{ env.PYVER }} @@ -122,7 +122,7 @@ jobs: fetch-depth: 2 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v20 + uses: tj-actions/changed-files@v32 with: files: | recipes/*/*/test_*/conanfile.py @@ -132,7 +132,7 @@ jobs: uses: mikefarah/yq@master with: cmd: yq '.conan.version' '.c3i/config_v1.yml' - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 if: steps.changed-files.outputs.any_changed == 'true' with: python-version: ${{ env.PYVER }} diff --git a/.github/workflows/linter-yaml.yml b/.github/workflows/linter-yaml.yml index 511e654ab8bb0..be716fffc216a 100644 --- a/.github/workflows/linter-yaml.yml +++ b/.github/workflows/linter-yaml.yml @@ -20,13 +20,13 @@ jobs: fetch-depth: 2 - name: Get changed files - uses: tj-actions/changed-files@v20 + uses: tj-actions/changed-files@v32 id: changed_files with: files: | linter/** - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 if: steps.changed_files.outputs.any_changed == 'true' with: python-version: ${{ env.PYVER }} @@ -53,7 +53,7 @@ jobs: with: fetch-depth: 2 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: ${{ env.PYVER }} @@ -64,7 +64,7 @@ jobs: - name: Get changed files (config) id: changed_files_config if: always() - uses: tj-actions/changed-files@v20 + uses: tj-actions/changed-files@v32 with: files: | ${{ env.CONFIG_FILES_PATH }} @@ -80,7 +80,7 @@ jobs: - name: Get changed files (conandata) id: changed_files_conandata if: always() - uses: tj-actions/changed-files@v20 + uses: tj-actions/changed-files@v32 with: files: | ${{ env.CONANDATA_FILES_PATH }} diff --git a/.github/workflows/on-push-do-doco.yml b/.github/workflows/on-push-do-doco.yml index fe33f4984dfb3..f5206b720d4a9 100644 --- a/.github/workflows/on-push-do-doco.yml +++ b/.github/workflows/on-push-do-doco.yml @@ -22,7 +22,7 @@ jobs: --toc-level 5 shell: bash - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: branch: bot/action-doc-toc commit-message: "[docs] Regenerate tables of contents" From d78fefe0e2116e4d45deff9a02e59d300ebf622d Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 05:44:22 +0200 Subject: [PATCH 473/561] (#13545) Create dependabot.yml this bot will create automatically pull-request bumping github actions version This avoids obsolescences and vulnerabilities --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000000..90e05c40d0459 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From 42faf2bb9bd52bb22a073313903fad18388592eb Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 18 Oct 2022 13:08:53 +0900 Subject: [PATCH 474/561] (#13527) tcb-span: add vercion cci.20220616 and support conan v2 * tcb-span: add vercion cci.20220616 and support conan v2 * remove Version Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/tcb-span/all/conandata.yml | 3 ++ recipes/tcb-span/all/conanfile.py | 53 ++++++++++++------- .../tcb-span/all/test_package/CMakeLists.txt | 13 ++--- .../tcb-span/all/test_package/conanfile.py | 21 +++++--- .../all/test_v1_package/CMakeLists.txt | 11 ++++ .../tcb-span/all/test_v1_package/conanfile.py | 18 +++++++ recipes/tcb-span/config.yml | 2 + 7 files changed, 88 insertions(+), 33 deletions(-) create mode 100644 recipes/tcb-span/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/tcb-span/all/test_v1_package/conanfile.py diff --git a/recipes/tcb-span/all/conandata.yml b/recipes/tcb-span/all/conandata.yml index 05f7484b6046d..d9462a68d3339 100644 --- a/recipes/tcb-span/all/conandata.yml +++ b/recipes/tcb-span/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20220616": + url: "https://github.com/tcbrindle/span/archive/836dc6a0efd9849cb194e88e4aa2387436bb079b.tar.gz" + sha256: "66650479f85b92c6a6230706e4ac4a1bca18a7c7102fc7e02ad332f86548c9b6" "cci.20200603": url: "https://github.com/tcbrindle/span/archive/5d8d366eca918d0ed3d2d196cbeae6abfd874736.tar.gz" sha256: "c294ec2314eeccbcfe12b549ca6c165fbe9f97d2d52a0ad4c9a28f73fa87861a" diff --git a/recipes/tcb-span/all/conanfile.py b/recipes/tcb-span/all/conanfile.py index 9ede6d7dbfadf..5edd705ca74ca 100644 --- a/recipes/tcb-span/all/conanfile.py +++ b/recipes/tcb-span/all/conanfile.py @@ -1,34 +1,49 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout import os +required_conan_version = ">=1.50.0" class TcbSpanConan(ConanFile): name = "tcb-span" description = "Implementation of C++20's std::span for older C++ standards" - topics = ("conan", "span", "header-only", "tcb-span") - homepage = "https://github.com/tcbrindle/span" - url = "https://github.com/conan-io/conan-center-index" license = "BSL-1.0" - settings = "compiler" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tcbrindle/span" + topics = ("span", "header-only") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + return 11 - def configure(self): - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.info.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) 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], destination=self.source_folder, strip_root=True) def package(self): - include_folder = os.path.join(self._source_subfolder, "include") - self.copy(pattern="LICENSE*.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.hpp", dst="include", src=include_folder) - - def package_id(self): - self.info.header_only() + copy(self, pattern="LICENSE*.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/tcb-span/all/test_package/CMakeLists.txt b/recipes/tcb-span/all/test_package/CMakeLists.txt index 3618b7fc14eb5..858448385983d 100644 --- a/recipes/tcb-span/all/test_package/CMakeLists.txt +++ b/recipes/tcb-span/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(tcb-span REQUIRED CONFIG) -find_package(tcb-span REQUIRED) - -add_executable(test_package test_package.cxx) -target_link_libraries(test_package tcb-span::tcb-span) -set_property(TARGET test_package PROPERTY CXX_STANDARD 17) +add_executable(${PROJECT_NAME} test_package.cxx) +target_link_libraries(${PROJECT_NAME} PRIVATE tcb-span::tcb-span) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tcb-span/all/test_package/conanfile.py b/recipes/tcb-span/all/test_package/conanfile.py index 1d0bdd3779793..a9fb96656f203 100644 --- a/recipes/tcb-span/all/test_package/conanfile.py +++ b/recipes/tcb-span/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" + 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,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tcb-span/all/test_v1_package/CMakeLists.txt b/recipes/tcb-span/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6930ecd6ea58a --- /dev/null +++ b/recipes/tcb-span/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(tcb-span REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cxx) +target_link_libraries(${PROJECT_NAME} PRIVATE tcb-span::tcb-span) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tcb-span/all/test_v1_package/conanfile.py b/recipes/tcb-span/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/tcb-span/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tcb-span/config.yml b/recipes/tcb-span/config.yml index 7208e0ea0a4e0..eb7ad34aa4cc4 100644 --- a/recipes/tcb-span/config.yml +++ b/recipes/tcb-span/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20220616": + folder: all "cci.20200603": folder: all From 71f7dfbf07ce4e2e102b8164fc19e17d1f952a45 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Tue, 18 Oct 2022 06:27:15 +0200 Subject: [PATCH 475/561] (#13549) [doc] Update supported platforms and configurations (2022-10-17) Co-authored-by: CCI bot --- docs/supported_platforms_and_configurations.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md index 6ca6d82cfbdc5..d246cd963f72c 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -39,6 +39,8 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- - Python: 3.7.9 - CMake: 3.21.6 - WinSDK: 10.0.20348 + > WinSDK version is rolled periodically as [discussed previously](https://github.com/conan-io/conan-center-index/issues/4450). + > Please open an issue in case it needs to be updated. - Compilers: Visual Studio: - 2017 (19.16.27048) From dfd7ddc382f7ff95d8a5d2d90851969a3e8be19a Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 18 Oct 2022 08:04:32 +0200 Subject: [PATCH 476/561] (#12747) migrate hash-library to conan v2 * migrate hash-library to conan v2 * Update recipes/hash-library/all/conanfile.py * Update recipes/hash-library/all/conanfile.py * Update recipes/hash-library/all/conanfile.py * Update recipes/hash-library/all/test_package/conanfile.py * Update recipes/hash-library/all/test_package/conanfile.py * complete migration * Apply suggestions from code review Co-authored-by: Chris Mc * Apply suggestions from code review Co-authored-by: Chris Mc Co-authored-by: Daniel Co-authored-by: Chris Mc --- recipes/hash-library/all/CMakeLists.txt | 7 ++-- recipes/hash-library/all/conanfile.py | 33 ++++++++----------- .../all/test_package/CMakeLists.txt | 5 +-- .../all/test_package/conanfile.py | 19 ++++++++--- .../all/test_v1_package/CMakeLists.txt | 10 ++++++ .../all/test_v1_package/conanfile.py | 17 ++++++++++ 6 files changed, 58 insertions(+), 33 deletions(-) create mode 100644 recipes/hash-library/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hash-library/all/test_v1_package/conanfile.py diff --git a/recipes/hash-library/all/CMakeLists.txt b/recipes/hash-library/all/CMakeLists.txt index fcb1139946f46..93df61904faf0 100644 --- a/recipes/hash-library/all/CMakeLists.txt +++ b/recipes/hash-library/all/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(hash-library CXX) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - add_library(${CMAKE_PROJECT_NAME} source_subfolder/crc32.cpp source_subfolder/keccak.cpp @@ -26,7 +23,7 @@ set(HEADERS source_subfolder/sha3.h ) -set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}" ) diff --git a/recipes/hash-library/all/conanfile.py b/recipes/hash-library/all/conanfile.py index ec0cfab1d3887..7eb68b7364340 100644 --- a/recipes/hash-library/all/conanfile.py +++ b/recipes/hash-library/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.cmake import CMake +from conan.tools.files import apply_conandata_patches, get +from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class HashLibraryConan(ConanFile): @@ -13,17 +15,16 @@ class HashLibraryConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" settings = "os", "compiler", "build_type", "arch" options = { - "shared": [True, False], + "shared": [True, False], "fPIC": [True, False] } default_options = { - "shared": False, + "shared": False, "fPIC": True } - generators = "cmake" + generators = "CMakeToolchain" exports_sources = ["CMakeLists.txt", "patches/*"] - _cmake = None @property def _source_subfolder(self): @@ -42,24 +43,18 @@ def configure(self): del self.options.fPIC def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - 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 + get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.install() def package_info(self): diff --git a/recipes/hash-library/all/test_package/CMakeLists.txt b/recipes/hash-library/all/test_package/CMakeLists.txt index 0680bf45d87e9..a7c0d37bd6508 100644 --- a/recipes/hash-library/all/test_package/CMakeLists.txt +++ b/recipes/hash-library/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(TARGETS) - find_package(hash-library CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/hash-library/all/test_package/conanfile.py b/recipes/hash-library/all/test_package/conanfile.py index 1d5e456107c57..6dbd1de388288 100644 --- a/recipes/hash-library/all/test_package/conanfile.py +++ b/recipes/hash-library/all/test_package/conanfile.py @@ -1,11 +1,20 @@ import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout class HashLibraryTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + 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) @@ -13,6 +22,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/hash-library/all/test_v1_package/CMakeLists.txt b/recipes/hash-library/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..ec49a4ac21f18 --- /dev/null +++ b/recipes/hash-library/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(hash-library CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} hash-library::hash-library) diff --git a/recipes/hash-library/all/test_v1_package/conanfile.py b/recipes/hash-library/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4265550ef4aee --- /dev/null +++ b/recipes/hash-library/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, tools, CMake + + +class HashLibraryTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 0bb4601189762008bf1d0aa700569c14b1ec1e8e Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 08:25:48 +0200 Subject: [PATCH 477/561] (#13524) embree3: conan v2 support * conan v2 support * fix position of cmake_minimum_required() * remove vc runtime files --- recipes/embree3/all/CMakeLists.txt | 7 - recipes/embree3/all/conandata.yml | 16 ++ recipes/embree3/all/conanfile.py | 167 +++++++++--------- .../3.12.x-0001-cmake-minimum-required.patch | 17 ++ .../3.13.x-0001-cmake-minimum-required.patch | 17 ++ .../embree3/all/test_package/CMakeLists.txt | 7 +- recipes/embree3/all/test_package/conanfile.py | 19 +- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../embree3/all/test_v1_package/conanfile.py | 17 ++ 9 files changed, 175 insertions(+), 102 deletions(-) delete mode 100644 recipes/embree3/all/CMakeLists.txt create mode 100644 recipes/embree3/all/patches/3.12.x-0001-cmake-minimum-required.patch create mode 100644 recipes/embree3/all/patches/3.13.x-0001-cmake-minimum-required.patch create mode 100644 recipes/embree3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/embree3/all/test_v1_package/conanfile.py diff --git a/recipes/embree3/all/CMakeLists.txt b/recipes/embree3/all/CMakeLists.txt deleted file mode 100644 index 27f20e640dcb8..0000000000000 --- a/recipes/embree3/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/embree3/all/conandata.yml b/recipes/embree3/all/conandata.yml index c3ac808692380..9013cde566800 100644 --- a/recipes/embree3/all/conandata.yml +++ b/recipes/embree3/all/conandata.yml @@ -8,3 +8,19 @@ sources: "3.12.0": url: "https://github.com/embree/embree/archive/refs/tags/v3.12.0.tar.gz" sha256: "f3646977c45a9ece1fb0cfe107567adcc645b1c77c27b36572d0aa98b888190c" +patches: + "3.13.3": + - patch_file: "patches/3.13.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: Fix position of cmake_minimum_required()" + patch_type: "backport" + patch_source: "https://github.com/embree/embree/pull/406" + "3.13.1": + - patch_file: "patches/3.13.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: Fix position of cmake_minimum_required()" + patch_type: "backport" + patch_source: "https://github.com/embree/embree/pull/406" + "3.12.0": + - patch_file: "patches/3.12.x-0001-cmake-minimum-required.patch" + patch_description: "CMake: Fix position of cmake_minimum_required()" + patch_type: "backport" + patch_source: "https://github.com/embree/embree/pull/406" diff --git a/recipes/embree3/all/conanfile.py b/recipes/embree3/all/conanfile.py index 295f4cee2d984..4be8a83904709 100644 --- a/recipes/embree3/all/conanfile.py +++ b/recipes/embree3/all/conanfile.py @@ -1,11 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from conan.tools.files import save, load +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, rm, rmdir, save +from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version import glob import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class EmbreeConan(ConanFile): @@ -59,25 +62,13 @@ class EmbreeConan(ConanFile): "ignore_invalid_rays": False, } - exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property def _has_sse_avx(self): return self.settings.arch in ["x86", "x86_64"] @property def _embree_has_neon_support(self): - return tools.Version(self.version) >= "3.13.0" + return Version(self.version) >= "3.13.0" @property def _has_neon(self): @@ -93,6 +84,9 @@ def _num_isa(self): num_isa += 1 return num_isa + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -105,98 +99,102 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): if not (self._has_sse_avx or (self._embree_has_neon_support and self._has_neon)): raise ConanInvalidConfiguration("Embree {} doesn't support {}".format(self.version, self.settings.arch)) - compiler_version = tools.Version(self.settings.compiler.version) - if self.settings.compiler == "clang" and compiler_version < "4": + compiler_version = Version(self.info.settings.compiler.version) + if self.info.settings.compiler == "clang" and compiler_version < "4": raise ConanInvalidConfiguration("Clang < 4 is not supported") - elif self.settings.compiler == "Visual Studio" and compiler_version < "15": - raise ConanInvalidConfiguration("Visual Studio < 15 is not supported") - if self.settings.os == "Linux" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": - raise ConanInvalidConfiguration("conan recipe for Embree v{0} \ - cannot be built with clang libc++, use libstdc++ instead".format(self.version)) + check_min_vs(self, 191) + + if self.info.settings.os == "Linux" and self.info.settings.compiler == "clang" and self.info.settings.compiler.libcxx == "libc++": + raise ConanInvalidConfiguration(f"{self.ref} cannot be built with clang libc++, use libstdc++ instead") - if self.settings.compiler == "apple-clang" and not self.options.shared and compiler_version >= "9.0" and self._num_isa > 1: + if self.info.settings.compiler == "apple-clang" and not self.info.options.shared and compiler_version >= "9.0" and self._num_isa > 1: raise ConanInvalidConfiguration("Embree static with apple-clang >=9 and multiple ISA (simd) is not supported") if self._num_isa == 0: raise ConanInvalidConfiguration("At least one ISA (simd) must be enabled") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - - # Configure CMake library build: - self._cmake.definitions["EMBREE_STATIC_LIB"] = not self.options.shared - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["EMBREE_TUTORIALS"] = False - self._cmake.definitions["EMBREE_GEOMETRY_CURVE"] = self.options.geometry_curve - self._cmake.definitions["EMBREE_GEOMETRY_GRID"] = self.options.geometry_grid - self._cmake.definitions["EMBREE_GEOMETRY_INSTANCE"] = self.options.geometry_instance - self._cmake.definitions["EMBREE_GEOMETRY_QUAD"] = self.options.geometry_quad - self._cmake.definitions["EMBREE_GEOMETRY_SUBDIVISION"] = self.options.geometry_subdivision - self._cmake.definitions["EMBREE_GEOMETRY_TRIANGLE"] = self.options.geometry_triangle - self._cmake.definitions["EMBREE_GEOMETRY_USER"] = self.options.geometry_user - self._cmake.definitions["EMBREE_RAY_PACKETS"] = self.options.ray_packets - self._cmake.definitions["EMBREE_RAY_MASK"] = self.options.ray_masking - self._cmake.definitions["EMBREE_BACKFACE_CULLING"] = self.options.backface_culling - self._cmake.definitions["EMBREE_IGNORE_INVALID_RAYS"] = self.options.ignore_invalid_rays - self._cmake.definitions["EMBREE_ISPC_SUPPORT"] = False - self._cmake.definitions["EMBREE_TASKING_SYSTEM"] = "INTERNAL" - self._cmake.definitions["EMBREE_MAX_ISA"] = "NONE" + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EMBREE_STATIC_LIB"] = not self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.variables["EMBREE_TUTORIALS"] = False + tc.variables["EMBREE_GEOMETRY_CURVE"] = self.options.geometry_curve + tc.variables["EMBREE_GEOMETRY_GRID"] = self.options.geometry_grid + tc.variables["EMBREE_GEOMETRY_INSTANCE"] = self.options.geometry_instance + tc.variables["EMBREE_GEOMETRY_QUAD"] = self.options.geometry_quad + tc.variables["EMBREE_GEOMETRY_SUBDIVISION"] = self.options.geometry_subdivision + tc.variables["EMBREE_GEOMETRY_TRIANGLE"] = self.options.geometry_triangle + tc.variables["EMBREE_GEOMETRY_USER"] = self.options.geometry_user + tc.variables["EMBREE_RAY_PACKETS"] = self.options.ray_packets + tc.variables["EMBREE_RAY_MASK"] = self.options.ray_masking + tc.variables["EMBREE_BACKFACE_CULLING"] = self.options.backface_culling + tc.variables["EMBREE_IGNORE_INVALID_RAYS"] = self.options.ignore_invalid_rays + tc.variables["EMBREE_ISPC_SUPPORT"] = False + tc.variables["EMBREE_TASKING_SYSTEM"] = "INTERNAL" + tc.variables["EMBREE_MAX_ISA"] = "NONE" if self._embree_has_neon_support: - self._cmake.definitions["EMBREE_ISA_NEON"] = self._has_neon - self._cmake.definitions["EMBREE_ISA_SSE2"] = self.options.get_safe("sse2", False) - self._cmake.definitions["EMBREE_ISA_SSE42"] = self.options.get_safe("sse42", False) - self._cmake.definitions["EMBREE_ISA_AVX"] = self.options.get_safe("avx", False) - self._cmake.definitions["EMBREE_ISA_AVX2"] = self.options.get_safe("avx2", False) - if tools.Version(self.version) < "3.12.2": + tc.variables["EMBREE_ISA_NEON"] = self._has_neon + tc.variables["EMBREE_ISA_SSE2"] = self.options.get_safe("sse2", False) + tc.variables["EMBREE_ISA_SSE42"] = self.options.get_safe("sse42", False) + tc.variables["EMBREE_ISA_AVX"] = self.options.get_safe("avx", False) + tc.variables["EMBREE_ISA_AVX2"] = self.options.get_safe("avx2", False) + if Version(self.version) < "3.12.2": # TODO: probably broken if avx512 enabled, must cumbersome to add specific options in the recipe - self._cmake.definitions["EMBREE_ISA_AVX512KNL"] = self.options.get_safe("avx512", False) - self._cmake.definitions["EMBREE_ISA_AVX512SKX"] = self.options.get_safe("avx512", False) + tc.variables["EMBREE_ISA_AVX512KNL"] = self.options.get_safe("avx512", False) + tc.variables["EMBREE_ISA_AVX512SKX"] = self.options.get_safe("avx512", False) else: - self._cmake.definitions["EMBREE_ISA_AVX512"] = self.options.get_safe("avx512", False) - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["EMBREE_ISA_AVX512"] = self.options.get_safe("avx512", False) + tc.generate() - def build(self): + def _patch_sources(self): + apply_conandata_patches(self) # some compilers (e.g. clang) do not like UTF-16 sources - rc = os.path.join(self._source_subfolder, "kernels", "embree.rc") + rc = os.path.join(self.source_folder, "kernels", "embree.rc") content = load(self, rc, encoding="utf_16_le") if content[0] == '\ufeff': content = content[1:] content = "#pragma code_page(65001)\n" + content save(self, rc, content) - os.remove(os.path.join(self._source_subfolder, "common", "cmake", "FindTBB.cmake")) - cmake = self._configure_cmake() + os.remove(os.path.join(self.source_folder, "common", "cmake", "FindTBB.cmake")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") - tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder), "*.command") - tools.remove_files_by_mask(os.path.join(self.package_folder), "*.cmake") + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.command", os.path.join(self.package_folder)) + rm(self, "*.cmake", os.path.join(self.package_folder)) if self.settings.os == "Windows" and self.options.shared: for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: - tools.remove_files_by_mask(os.path.join(self.package_folder), dll_pattern_to_remove) + rm(self, dll_pattern_to_remove, os.path.join(self.package_folder, "bin")) else: - tools.rmdir(os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "bin")) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( @@ -204,34 +202,33 @@ def package(self): {"embree": "embree::embree"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "embree") self.cpp_info.set_property("cmake_target_name", "embree") def _lib_exists(name): - return True if glob.glob(os.path.join(self.package_folder, "lib", "*{}.*".format(name))) else False + return True if glob.glob(os.path.join(self.package_folder, "lib", f"*{name}.*")) else False self.cpp_info.libs = ["embree3"] if not self.options.shared: self.cpp_info.libs.extend(["sys", "math", "simd", "lexers", "tasking"]) simd_libs = ["embree_sse42", "embree_avx", "embree_avx2"] - simd_libs.extend(["embree_avx512knl", "embree_avx512skx"] if tools.Version(self.version) < "3.12.2" else ["embree_avx512"]) + simd_libs.extend(["embree_avx512knl", "embree_avx512skx"] if Version(self.version) < "3.12.2" else ["embree_avx512"]) for lib in simd_libs: if _lib_exists(lib): self.cpp_info.libs.append(lib) diff --git a/recipes/embree3/all/patches/3.12.x-0001-cmake-minimum-required.patch b/recipes/embree3/all/patches/3.12.x-0001-cmake-minimum-required.patch new file mode 100644 index 0000000000000..d07ff0aa4e590 --- /dev/null +++ b/recipes/embree3/all/patches/3.12.x-0001-cmake-minimum-required.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,6 @@ + ## Copyright 2009-2020 Intel Corporation + ## SPDX-License-Identifier: Apache-2.0 ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + + SET(EMBREE_VERSION_MAJOR 3) + SET(EMBREE_VERSION_MINOR 12) +@@ -12,7 +13,6 @@ SET(CPACK_RPM_PACKAGE_RELEASE 1) + + PROJECT(embree${EMBREE_VERSION_MAJOR}) + +-CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + + # We use our own strip tool on macOS to sign during install. This is required as CMake modifies RPATH of the binary during install. + IF (APPLE AND EMBREE_SIGN_FILE) diff --git a/recipes/embree3/all/patches/3.13.x-0001-cmake-minimum-required.patch b/recipes/embree3/all/patches/3.13.x-0001-cmake-minimum-required.patch new file mode 100644 index 0000000000000..6208148722846 --- /dev/null +++ b/recipes/embree3/all/patches/3.13.x-0001-cmake-minimum-required.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,6 @@ + ## Copyright 2009-2021 Intel Corporation + ## SPDX-License-Identifier: Apache-2.0 ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + + SET(EMBREE_VERSION_MAJOR 3) + SET(EMBREE_VERSION_MINOR 13) +@@ -12,7 +13,6 @@ SET(CPACK_RPM_PACKAGE_RELEASE 1) + + PROJECT(embree${EMBREE_VERSION_MAJOR}) + +-CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + + # We use our own strip tool on macOS to sign during install. This is required as CMake modifies RPATH of the binary during install. + IF (APPLE AND EMBREE_SIGN_FILE) diff --git a/recipes/embree3/all/test_package/CMakeLists.txt b/recipes/embree3/all/test_package/CMakeLists.txt index 401ddb44db0d5..fe2724327bb76 100644 --- a/recipes/embree3/all/test_package/CMakeLists.txt +++ b/recipes/embree3/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(embree REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} embree) +target_link_libraries(${PROJECT_NAME} PRIVATE embree) diff --git a/recipes/embree3/all/test_package/conanfile.py b/recipes/embree3/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/embree3/all/test_package/conanfile.py +++ b/recipes/embree3/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/embree3/all/test_v1_package/CMakeLists.txt b/recipes/embree3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..42932a8412566 --- /dev/null +++ b/recipes/embree3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(embree REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE embree) diff --git a/recipes/embree3/all/test_v1_package/conanfile.py b/recipes/embree3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/embree3/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From f9ac9d9698c63cad51abdb4a62adfca7f03e555b Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 18 Oct 2022 15:44:44 +0900 Subject: [PATCH 478/561] (#13553) libmaxminddb: add version 1.7.1 * libmaxminddb: add version 1.7.1 * rmdir lib/pkgconfig --- recipes/libmaxminddb/all/conandata.yml | 3 +++ recipes/libmaxminddb/all/conanfile.py | 17 +++++++++-------- recipes/libmaxminddb/config.yml | 2 ++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/recipes/libmaxminddb/all/conandata.yml b/recipes/libmaxminddb/all/conandata.yml index e3c0f80605ee6..83c876364326d 100644 --- a/recipes/libmaxminddb/all/conandata.yml +++ b/recipes/libmaxminddb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.1": + url: "https://github.com/maxmind/libmaxminddb/releases/download/1.7.1/libmaxminddb-1.7.1.tar.gz" + sha256: "e8414f0dedcecbc1f6c31cb65cd81650952ab0677a4d8c49cab603b3b8fb083e" "1.6.0": url: "https://github.com/maxmind/libmaxminddb/releases/download/1.6.0/libmaxminddb-1.6.0.tar.gz" sha256: "7620ac187c591ce21bcd7bf352376a3c56a933e684558a1f6bef4bd4f3f98267" diff --git a/recipes/libmaxminddb/all/conanfile.py b/recipes/libmaxminddb/all/conanfile.py index b892fd003142a..7afd56f70e087 100644 --- a/recipes/libmaxminddb/all/conanfile.py +++ b/recipes/libmaxminddb/all/conanfile.py @@ -1,19 +1,17 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rmdir import os -required_conan_version = ">=1.50.0" - +required_conan_version = ">=1.52.0" class LibmaxminddbConan(ConanFile): name = "libmaxminddb" + description = "C library for the MaxMind DB file format" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "http://maxmind.github.io/libmaxminddb/" - description = "C library for the MaxMind DB file format" topics = ("maxmind", "geoip") - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,8 +23,7 @@ class LibmaxminddbConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -34,7 +31,10 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: del self.settings.compiler.libcxx except Exception: @@ -69,6 +69,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "maxminddb") diff --git a/recipes/libmaxminddb/config.yml b/recipes/libmaxminddb/config.yml index 225152169dbd8..9efd2189b76e9 100644 --- a/recipes/libmaxminddb/config.yml +++ b/recipes/libmaxminddb/config.yml @@ -1,3 +1,5 @@ versions: + "1.7.1": + folder: all "1.6.0": folder: all From 72c835918e33c73a5340d2bb1a765a1e99c606c9 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 18 Oct 2022 10:05:41 +0200 Subject: [PATCH 479/561] (#13185) [yasm/xxx] Conan v2 migration * [yasm/xxx] Conan v2 migration * Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Fix self.package_folder * Remove basic_layout src_folder parameter * Fix sln path * Patch visual studio project * Apply suggestions from code review Co-authored-by: Chris Mc * Switch to vc12 * yasm: use CMake script for MSVC * Use cmake_layout Windows * Remove YAML-VERSION-GEN.bat * Remove unused import and property * Update recipes/yasm/all/test_package/conanfile.py Co-authored-by: Uilian Ries Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: Chris Mc Co-authored-by: Anonymous Maarten Co-authored-by: Uilian Ries --- recipes/yasm/all/conandata.yml | 7 +- recipes/yasm/all/conanfile.py | 117 +++++++++--------- .../yasm/all/patches/0001-cmake-updates.patch | 67 ++++++++++ recipes/yasm/all/test_package/conanfile.py | 14 ++- recipes/yasm/all/test_v1_package/conanfile.py | 10 ++ 5 files changed, 149 insertions(+), 66 deletions(-) create mode 100644 recipes/yasm/all/patches/0001-cmake-updates.patch create mode 100644 recipes/yasm/all/test_v1_package/conanfile.py diff --git a/recipes/yasm/all/conandata.yml b/recipes/yasm/all/conandata.yml index 8513b90d3ac05..54b8e4dfddf30 100644 --- a/recipes/yasm/all/conandata.yml +++ b/recipes/yasm/all/conandata.yml @@ -2,5 +2,8 @@ sources: "1.3.0": - url: "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" sha256: "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f" - - url: "https://raw.githubusercontent.com/yasm/yasm/bcc01c59d8196f857989e6ae718458c296ca20e3/YASM-VERSION-GEN.bat" - sha256: "b976cb97d2f7bb00e78e5db0da0978659acbdd60b52998cd2983145d8d75f141" +patches: + "1.3.0": + - patch_file: "patches/0001-cmake-updates.patch" + patch_description: "CMake 3.0+ compatibility" + patch_type: "conan" diff --git a/recipes/yasm/all/conanfile.py b/recipes/yasm/all/conanfile.py index 7a6b161ce45e8..6ae77d2526617 100644 --- a/recipes/yasm/all/conanfile.py +++ b/recipes/yasm/all/conanfile.py @@ -1,9 +1,14 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout, cmake_layout +from conan.tools.microsoft import is_msvc + import os -import shutil -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class YASMConan(ConanFile): name = "yasm" @@ -14,87 +19,79 @@ class YASMConan(ConanFile): license = "BSD-2-Clause" settings = "os", "arch", "compiler", "build_type" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def export_sources(self): + export_conandata_patches(self) + def configure(self): del self.settings.compiler.libcxx del self.settings.compiler.cppstd - def build_requirements(self): - if self._settings_build.os == "Windows" and self.settings.compiler != "Visual Studio" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + def layout(self): + if is_msvc(self): + cmake_layout(self) + else: + basic_layout(self) def package_id(self): del self.info.settings.compiler def source(self): - tools.get(**self.conan_data["sources"][self.version][0], - destination=self._source_subfolder, strip_root=True) - tools.download(**self.conan_data["sources"][self.version][1], - filename=os.path.join(self._source_subfolder, "YASM-VERSION-GEN.bat")) - - @property - def _msvc_subfolder(self): - return os.path.join(self._source_subfolder, "Mkfiles", "vc10") - - def _build_vs(self): - with tools.chdir(self._msvc_subfolder): - msbuild = MSBuild(self) - if self.settings.arch == "x86": - msbuild.build_env.link_flags.append("/MACHINE:X86") - elif self.settings.arch == "x86_64": - msbuild.build_env.link_flags.append("/SAFESEH:NO /MACHINE:X64") - build_type = "Debug" if self.settings.build_type == "Debug" else "Release" - msbuild.build(project_file="yasm.sln", build_type=build_type, upgrade_project=False, - targets=["yasm"], platforms={"x86": "Win32"}, force_vcvars=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-debug={}".format(yes_no(self.settings.build_type == "Debug")), + get(self, **self.conan_data["sources"][self.version][0], + destination=self.source_folder, strip_root=True) + + def _generate_autotools(self): + tc = AutotoolsToolchain(self) + enable_debug = "yes" if self.settings.build_type == "Debug" else "no" + tc.configure_args.extend([ + f"--enable-debug={enable_debug}", "--disable-rpath", "--disable-nls", - ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + ]) + tc.generate() + + def _generate_cmake(self): + tc = CMakeToolchain(self) + tc.cache_variables["YASM_BUILD_TESTS"] = False + tc.generate() + + def generate(self): + if is_msvc(self): + self._generate_cmake() + else: + self._generate_autotools() def build(self): - if self.settings.compiler == "Visual Studio": - self._build_vs() + apply_conandata_patches(self) + if is_msvc(self): + cmake = CMake(self) + cmake.configure() + cmake.build() else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy(pattern="BSD.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - if self.settings.compiler == "Visual Studio": - arch = { - "x86": "Win32", - "x86_64": "x64", - }[str(self.settings.arch)] - tools.mkdir(os.path.join(self.package_folder, "bin")) - build_type = "Debug" if self.settings.build_type == "Debug" else "Release" - shutil.copy(os.path.join(self._msvc_subfolder, arch, build_type, "yasm.exe"), - os.path.join(self.package_folder, "bin", "yasm.exe")) - self.copy(pattern="yasm.exe*", src=self._source_subfolder, dst="bin", keep_path=False) + copy(self, pattern="BSD.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "include")) + rmdir(self, os.path.join(self.package_folder, "lib")) else: - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/yasm/all/patches/0001-cmake-updates.patch b/recipes/yasm/all/patches/0001-cmake-updates.patch new file mode 100644 index 0000000000000..8f43dacf4f240 --- /dev/null +++ b/recipes/yasm/all/patches/0001-cmake-updates.patch @@ -0,0 +1,67 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ ++CMAKE_MINIMUM_REQUIRED(VERSION 3.0) + PROJECT(yasm) +-CMAKE_MINIMUM_REQUIRED(VERSION 2.4) + if (COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) + endif (COMMAND cmake_policy) +--- a/cmake/modules/YasmMacros.cmake ++++ b/cmake/modules/YasmMacros.cmake +@@ -58,31 +58,31 @@ macro (YASM_ADD_MODULE _module_NAME) + endmacro (YASM_ADD_MODULE) + + macro (YASM_GENPERF _in_NAME _out_NAME) +- get_target_property(_tmp_GENPERF_EXE genperf LOCATION) ++ #get_target_property(_tmp_GENPERF_EXE genperf LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} +- COMMAND ${_tmp_GENPERF_EXE} ${_in_NAME} ${_out_NAME} +- DEPENDS ${_tmp_GENPERF_EXE} ++ COMMAND genperf ${_in_NAME} ${_out_NAME} ++ #DEPENDS ${_tmp_GENPERF_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) + endmacro (YASM_GENPERF) + + macro (YASM_RE2C _in_NAME _out_NAME) +- get_target_property(_tmp_RE2C_EXE re2c LOCATION) ++ #get_target_property(_tmp_RE2C_EXE re2c LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} +- COMMAND ${_tmp_RE2C_EXE} ${ARGN} -o ${_out_NAME} ${_in_NAME} +- DEPENDS ${_tmp_RE2C_EXE} ++ COMMAND re2c ${ARGN} -o ${_out_NAME} ${_in_NAME} ++ #DEPENDS ${_tmp_RE2C_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) + endmacro (YASM_RE2C) + + macro (YASM_GENMACRO _in_NAME _out_NAME _var_NAME) +- get_target_property(_tmp_GENMACRO_EXE genmacro LOCATION) ++ #get_target_property(_tmp_GENMACRO_EXE genmacro LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} +- COMMAND ${_tmp_GENMACRO_EXE} ${_out_NAME} ${_var_NAME} ${_in_NAME} +- DEPENDS ${_tmp_GENMACRO_EXE} ++ COMMAND genmacro ${_out_NAME} ${_var_NAME} ${_in_NAME} ++ #DEPENDS ${_tmp_GENMACRO_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) + endmacro (YASM_GENMACRO) +--- a/modules/preprocs/nasm/CMakeLists.txt ++++ b/modules/preprocs/nasm/CMakeLists.txt +@@ -1,9 +1,9 @@ + add_executable(genversion preprocs/nasm/genversion.c) +-get_target_property(_tmp_GENVERSION_EXE genversion LOCATION) ++#get_target_property(_tmp_GENVERSION_EXE genversion LOCATION) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.mac +- COMMAND ${_tmp_GENVERSION_EXE} ${CMAKE_CURRENT_BINARY_DIR}/version.mac +- DEPENDS ${_tmp_GENVERSION_EXE} ++ COMMAND genversion ${CMAKE_CURRENT_BINARY_DIR}/version.mac ++ #DEPENDS ${_tmp_GENVERSION_EXE} + ) + + YASM_GENMACRO( diff --git a/recipes/yasm/all/test_package/conanfile.py b/recipes/yasm/all/test_package/conanfile.py index 605eba819f594..df63a750624da 100644 --- a/recipes/yasm/all/test_package/conanfile.py +++ b/recipes/yasm/all/test_package/conanfile.py @@ -1,9 +1,15 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run -class TestPackage(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("yasm --help", run_environment=True) + if can_run(self): + self.run("yasm --help", env="conanrun") diff --git a/recipes/yasm/all/test_v1_package/conanfile.py b/recipes/yasm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5992797490cc6 --- /dev/null +++ b/recipes/yasm/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile +from conan.tools.build import cross_building + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not cross_building(self): + self.run("yasm --help", run_environment=True) From 4abc68a16a55f49d48671672baff0c9b84bfc2cb Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 18 Oct 2022 18:44:58 +0900 Subject: [PATCH 480/561] (#13496) aws-c-auth: change dependeant recipe version for aws-c-s3 * aws-c-auth: change dependeant recipe version for aws-c-s3 * fix condition * add TODO for cpp_info.filenames/names --- recipes/aws-c-auth/all/conanfile.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/recipes/aws-c-auth/all/conanfile.py b/recipes/aws-c-auth/all/conanfile.py index 500a62df5407a..98d3c8c463737 100644 --- a/recipes/aws-c-auth/all/conanfile.py +++ b/recipes/aws-c-auth/all/conanfile.py @@ -49,8 +49,12 @@ def layout(self): def requirements(self): self.requires("aws-c-common/0.8.2") self.requires("aws-c-cal/0.5.13") - self.requires("aws-c-io/0.13.4") - self.requires("aws-c-http/0.6.22") + if Version(self.version) < "0.6.17": + self.requires("aws-c-io/0.10.20") + self.requires("aws-c-http/0.6.13") + else: + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") if Version(self.version) >= "0.6.5": self.requires("aws-c-sdkutils/0.1.3") @@ -80,10 +84,6 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-auth") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-auth") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-auth" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-auth" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package"] = "aws-c-auth" self.cpp_info.components["aws-c-auth-lib"].names["cmake_find_package_multi"] = "aws-c-auth" self.cpp_info.components["aws-c-auth-lib"].set_property("cmake_target_name", "AWS::aws-c-auth") @@ -93,7 +93,13 @@ def package_info(self): "aws-c-common::aws-c-common-lib", "aws-c-cal::aws-c-cal-lib", "aws-c-io::aws-c-io-lib", - "aws-c-http::aws-c-http-lib" + "aws-c-http::aws-c-http-lib", ] if Version(self.version) >= "0.6.5": self.cpp_info.components["aws-c-auth-lib"].requires.append("aws-c-sdkutils::aws-c-sdkutils-lib") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "aws-c-auth" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-auth" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" From 2fb7710fca26d0c6a92c7a9bb2d1ad482c983003 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 18 Oct 2022 03:24:34 -0700 Subject: [PATCH 481/561] (#13557) freetype: v2 touchups + use `cmake_layout` and cache variable for cmake policy --- recipes/freetype/all/conanfile.py | 36 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index a9262f44540d7..4138e31ca1536 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -1,16 +1,6 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps -from conan.tools.files import ( - collect_libs, - copy, - load, - get, - rename, - replace_in_file, - rmdir, - save -) -from conan.tools.layout import basic_layout +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import collect_libs, copy, load, get, rename, replace_in_file, rmdir, save from conan.tools.scm import Version import os import re @@ -59,9 +49,18 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass def requirements(self): if self.options.with_png: @@ -74,7 +73,7 @@ def requirements(self): self.requires("brotli/1.0.9") def layout(self): - basic_layout(self, src_folder="src") + cmake_layout(self, src_folder="src") def generate(self): deps = CMakeDeps(self) @@ -103,8 +102,7 @@ def generate(self): if self._has_with_brotli_option: cmake.variables["FT_WITH_BROTLI"] = self.options.with_brotli # Generate a relocatable shared lib on Macos - cmake.variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - + cmake.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" cmake.generate() def source(self): @@ -140,7 +138,7 @@ def _patch_sources(self): config_h = os.path.join(self.source_folder, "include", "freetype", "config", "ftoption.h") if self.options.subpixel: - replace_in_file(self,config_h, "/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */", "#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING") + replace_in_file(self, config_h, "/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */", "#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING") def build(self): self._patch_sources() From 5336e4848ecad44a27778adfebb7c99622bcbd20 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 12:44:26 +0200 Subject: [PATCH 482/561] (#13558) meshoptimizer: conan v2 support --- recipes/meshoptimizer/all/CMakeLists.txt | 8 -- recipes/meshoptimizer/all/conandata.yml | 1 - recipes/meshoptimizer/all/conanfile.py | 85 +++++++++---------- .../all/test_package/CMakeLists.txt | 7 +- .../all/test_package/conanfile.py | 20 +++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../all/test_v1_package/conanfile.py | 17 ++++ 7 files changed, 86 insertions(+), 62 deletions(-) delete mode 100644 recipes/meshoptimizer/all/CMakeLists.txt create mode 100644 recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/meshoptimizer/all/test_v1_package/conanfile.py diff --git a/recipes/meshoptimizer/all/CMakeLists.txt b/recipes/meshoptimizer/all/CMakeLists.txt deleted file mode 100644 index a60992e8dd75d..0000000000000 --- a/recipes/meshoptimizer/all/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") - -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/meshoptimizer/all/conandata.yml b/recipes/meshoptimizer/all/conandata.yml index 3780c1e85f5f8..1132907df3841 100644 --- a/recipes/meshoptimizer/all/conandata.yml +++ b/recipes/meshoptimizer/all/conandata.yml @@ -14,4 +14,3 @@ sources: patches: "0.14": - patch_file: "patches/0.14/0001-fix-build-on-old-AppleClang-versions.patch" - base_path: "source_subfolder" diff --git a/recipes/meshoptimizer/all/conanfile.py b/recipes/meshoptimizer/all/conanfile.py index f20253e331a79..174a3955a5f63 100644 --- a/recipes/meshoptimizer/all/conanfile.py +++ b/recipes/meshoptimizer/all/conanfile.py @@ -1,20 +1,20 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conans import tools as tools_legacy import os -import glob -from conans import ConanFile, CMake, tools - -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class MeshOptimizerConan(ConanFile): name = "meshoptimizer" - description = " Mesh optimization library that makes meshes smaller and faster to render" - topics = ("conan", "mesh", "optimizer", "3d") + description = "Mesh optimization library that makes meshes smaller and faster to render" + topics = ("mesh", "optimizer", "3d") homepage = "https://github.com/zeux/meshoptimizer" url = "https://github.com/conan-io/conan-center-index" license = "MIT" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,60 +25,59 @@ class MeshOptimizerConan(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - 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 _configure_cmake(self): - if self._cmake: - return self._cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - self._cmake = CMake(self) - self._cmake.definitions["MESHOPT_BUILD_SHARED_LIBS"] = self.options.shared - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MESHOPT_BUILD_SHARED_LIBS"] = self.options.shared + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # Don't override warning levels for msvc - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "add_compile_options(/W4 /WX)", "") + apply_conandata_patches(self) + # No warnings as errors + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_compile_options(/W4 /WX)", "") + replace_in_file(self, cmakelists, "-Werror", "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.md", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.md", 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")) - for f in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): - os.remove(f) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) - if not self.options.shared and tools.stdcpp_library(self): - self.cpp_info.system_libs.append(tools.stdcpp_library(self)) + self.cpp_info.set_property("cmake_file_name", "meshoptimizer") + self.cpp_info.set_property("cmake_target_name", "meshoptimizer::meshoptimizer") + self.cpp_info.libs = ["meshoptimizer"] + if not self.options.shared: + libcxx = tools_legacy.stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) if self.options.shared and self.settings.os == "Windows": self.cpp_info.defines = ["MESHOPTIMIZER_API=__declspec(dllimport)"] diff --git a/recipes/meshoptimizer/all/test_package/CMakeLists.txt b/recipes/meshoptimizer/all/test_package/CMakeLists.txt index 541e7b29f6c39..034ae19a0ca08 100644 --- a/recipes/meshoptimizer/all/test_package/CMakeLists.txt +++ b/recipes/meshoptimizer/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES C) find_package(meshoptimizer REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} meshoptimizer::meshoptimizer) +target_link_libraries(${PROJECT_NAME} PRIVATE meshoptimizer::meshoptimizer) diff --git a/recipes/meshoptimizer/all/test_package/conanfile.py b/recipes/meshoptimizer/all/test_package/conanfile.py index f8eeed898d7bd..0a6bc68712d90 100644 --- a/recipes/meshoptimizer/all/test_package/conanfile.py +++ b/recipes/meshoptimizer/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, cmake_layout import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt b/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b49461acc50ec --- /dev/null +++ b/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(meshoptimizer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE meshoptimizer::meshoptimizer) diff --git a/recipes/meshoptimizer/all/test_v1_package/conanfile.py b/recipes/meshoptimizer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/meshoptimizer/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 50945a39a46c8efa1b202de8ac1d98f55b89304e Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 18 Oct 2022 04:04:04 -0700 Subject: [PATCH 483/561] (#13559) conan v2: ignore the files in `test_output/` https://github.com/conan-io/conan/issues/10754 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 13fc7ab5fabfa..4ecc58bbd7d32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Conan specific test_package/build/ +test_package/test_output/ conan.lock conanbuildinfo.txt conaninfo.txt From 583751d39652c88f7cdc6874f3dbbafa961633e8 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 18 Oct 2022 07:05:36 -0700 Subject: [PATCH 484/561] (#13556) fmt: touchup how layout is being used * fmt: touchup how layout is being used * chore: hooks * chore: dont duplicate sources * Delete test_package.cpp * Delete test_ranges.cpp --- recipes/fmt/all/conanfile.py | 13 ++-- .../fmt/all/test_v1_package/CMakeLists.txt | 4 +- recipes/fmt/all/test_v1_package/conanfile.py | 1 - .../fmt/all/test_v1_package/test_package.cpp | 62 ------------------- .../fmt/all/test_v1_package/test_ranges.cpp | 11 ---- 5 files changed, 10 insertions(+), 81 deletions(-) delete mode 100644 recipes/fmt/all/test_v1_package/test_package.cpp delete mode 100644 recipes/fmt/all/test_v1_package/test_ranges.cpp diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index 80b5bdb350725..af95895649da5 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -3,9 +3,10 @@ from conan import ConanFile from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import get, apply_conandata_patches, copy, rmdir +from conan.tools.files import get, apply_conandata_patches, copy, rmdir, export_conandata_patches +from conan.tools.layout import basic_layout -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class FmtConan(ConanFile): @@ -36,8 +37,7 @@ def _has_with_os_api_option(self): return Version(str(self.version)) >= "7.0.0" def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, patch["patch_file"], src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def generate(self): if not self.options.header_only: @@ -51,7 +51,10 @@ def generate(self): tc.generate() def layout(self): - cmake_layout(self, src_folder="src") + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") def config_options(self): if self.settings.os == "Windows": diff --git a/recipes/fmt/all/test_v1_package/CMakeLists.txt b/recipes/fmt/all/test_v1_package/CMakeLists.txt index e4a5b85441935..cd856e0aa456a 100644 --- a/recipes/fmt/all/test_v1_package/CMakeLists.txt +++ b/recipes/fmt/all/test_v1_package/CMakeLists.txt @@ -7,7 +7,7 @@ conan_basic_setup(TARGETS) find_package(fmt REQUIRED CONFIG) # TEST_PACKAGE ################################################################# -add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) +add_executable(${CMAKE_PROJECT_NAME} ../test_package/test_package.cpp) set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 14) if(FMT_HEADER_ONLY) target_link_libraries(${CMAKE_PROJECT_NAME} fmt::fmt-header-only) @@ -16,7 +16,7 @@ else() endif() # TEST_RANGES ################################################################## -add_executable(test_ranges test_ranges.cpp) +add_executable(test_ranges ../test_package/test_ranges.cpp) set_property(TARGET test_ranges PROPERTY CXX_STANDARD 14) if(FMT_HEADER_ONLY) target_link_libraries(test_ranges fmt::fmt-header-only) diff --git a/recipes/fmt/all/test_v1_package/conanfile.py b/recipes/fmt/all/test_v1_package/conanfile.py index 65778c702047d..f99cfc80791d2 100644 --- a/recipes/fmt/all/test_v1_package/conanfile.py +++ b/recipes/fmt/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/fmt/all/test_v1_package/test_package.cpp b/recipes/fmt/all/test_v1_package/test_package.cpp deleted file mode 100644 index bcd009407212d..0000000000000 --- a/recipes/fmt/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include -#include -#include -#include -#include - - -#include -#include -#include -#include - - -void vreport(const char *format, fmt::format_args args) { - fmt::vprint(format, args); -} - -template -void report(const char *format, const Args & ... args) { - vreport(format, fmt::make_format_args(args...)); -} - -class Date { - int year_, month_, day_; - public: - Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} - - friend std::ostream &operator<<(std::ostream &os, const Date &d) { - return os << d.year_ << '-' << d.month_ << '-' << d.day_; - } -}; - -#if FMT_VERSION >= 90000 -namespace fmt { - template <> struct formatter : ostream_formatter {}; -} -#endif - -int main() { - const std::string thing("World"); - fmt::print("PRINT: Hello {}!\n", thing); - fmt::printf("PRINTF: Hello, %s!\n", thing); - - const std::string formatted = fmt::format("{0}{1}{0}", "abra", "cad"); - fmt::print("{}\n", formatted); - - fmt::memory_buffer buf; - fmt::format_to(std::begin(buf), "{}", 2.7182818); - fmt::print("Euler number: {}\n", fmt::to_string(buf)); - - const std::string date = fmt::format("The date is {}\n", Date(2012, 12, 9)); - fmt::print(date); - - report("{} {} {}\n", "Conan", 42, 3.14159); - - fmt::print(std::cout, "{} {}\n", "Magic number", 42); - - fmt::print(fg(fmt::color::aqua), "Bincrafters\n"); - - return EXIT_SUCCESS; -} diff --git a/recipes/fmt/all/test_v1_package/test_ranges.cpp b/recipes/fmt/all/test_v1_package/test_ranges.cpp deleted file mode 100644 index b808d6987b07e..0000000000000 --- a/recipes/fmt/all/test_v1_package/test_ranges.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include -#include "fmt/ranges.h" - -int main() { - std::vector numbers; - fmt::format_to(std::back_inserter(numbers), "{}{}{}", 1, 2, 3); - const std::string str_numbers = fmt::format("{}", numbers); - fmt::print("numbers: {}\n", str_numbers); - return EXIT_SUCCESS; -} From 20fd80631fdf5eb0f9de90357c15dacbcc667727 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 18 Oct 2022 07:44:17 -0700 Subject: [PATCH 485/561] (#13429) strawberryperl: conan v2 * strawberryperl: conan v2 * fix package id for v2 * working v2 but 1.x failing * with from, it now works on both versions * cleanup + test v1 * fix bad python * Update conanfile.py * Update conanfile.py * Update conanfile.py * conditional checks so v2 passes --- recipes/strawberryperl/all/conandata.yml | 12 ++-- recipes/strawberryperl/all/conanfile.py | 59 ++++++++++++------- .../all/test_package/conanfile.py | 20 +++++-- .../all/test_v1_package/conanfile.py | 12 ++++ 4 files changed, 69 insertions(+), 34 deletions(-) create mode 100644 recipes/strawberryperl/all/test_v1_package/conanfile.py diff --git a/recipes/strawberryperl/all/conandata.yml b/recipes/strawberryperl/all/conandata.yml index 9652ba8327657..5d11e843fb992 100644 --- a/recipes/strawberryperl/all/conandata.yml +++ b/recipes/strawberryperl/all/conandata.yml @@ -1,22 +1,22 @@ sources: "5.32.1.1": x86: - url: "http://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit-portable.zip" + url: "https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit-portable.zip" sha256: "d9c5711d12573a0f6d977792caa58364b1d46217521ae5c25cf5cc378a7c23c0" x86_64: - url: "http://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit-portable.zip" + url: "https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit-portable.zip" sha256: "692646105b0f5e058198a852dc52a48f1cebcaf676d63bbdeae12f4eaee9bf5c" "5.30.0.1": x86: - url: "http://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit-portable.zip" + url: "https://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit-portable.zip" sha256: "a1d77821c77b7a3298cf3fe381e57cba43f89b9859204398f36d85f33b287837" x86_64: - url: "http://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-64bit-portable.zip" + url: "https://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-64bit-portable.zip" sha256: "9367a64ac1451b21804a224bb6235fe6848dd42f5fa1871583821ac3dfabf013" "5.28.1.1": x86: - url: "http://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-32bit-portable.zip" + url: "https://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-32bit-portable.zip" sha256: "8b15c7c9574989568254a7859e473b7d5f68a1145d2e4418036600a81b13805c" x86_64: - url: "http://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-64bit-portable.zip" + url: "https://strawberryperl.com/download/5.28.1.1/strawberry-perl-5.28.1.1-64bit-portable.zip" sha256: "935c95ba096fa11c4e1b5188732e3832d330a2a79e9882ab7ba8460ddbca810d" diff --git a/recipes/strawberryperl/all/conanfile.py b/recipes/strawberryperl/all/conanfile.py index 5fd7a34327cc3..b665fe8420bef 100644 --- a/recipes/strawberryperl/all/conanfile.py +++ b/recipes/strawberryperl/all/conanfile.py @@ -1,39 +1,54 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conans import __version__ as conan_version -class StrawberryperlConan(ConanFile): +required_conan_version = ">=1.47.0" + + +class StrawberryPerlConan(ConanFile): name = "strawberryperl" - description = "Strawbery Perl for Windows. Useful as build_require" - license = "GNU Public License or the Artistic License" + description = "Strawberry Perl for Windows. Useful as build_require" + license = ("Artistic-1.0", "GPL-1.0") homepage = "http://strawberryperl.com" url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "installer", "perl", "windows") - settings = "os", "arch" - short_paths = True + topics = ("installer", "perl", "windows") + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + self.folders.build = "build" + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type - def configure(self): - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("Only windows supported for Strawberry Perl.") + def validate(self): + if self.info.settings.os != "Windows": + raise ConanInvalidConfiguration("Strawberry Perl is only intended to be used on Windows.") def build(self): - arch = str(self.settings.arch) - tools.get(**self.conan_data["sources"][self.version][arch]) + get(self, **self.conan_data["sources"][self.version][str(self.settings.arch)], destination=self.build_folder) def package(self): - self.copy(pattern="License.rtf*", dst="licenses", src="licenses") - self.copy(pattern="*", src=os.path.join("perl", "bin"), dst="bin") - self.copy(pattern="*", src=os.path.join("perl", "lib"), dst="lib") - self.copy(pattern="*", src=os.path.join("perl", "vendor", "lib"), dst="lib") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, pattern="License.rtf*", src=os.path.join(self.build_folder, "licenses"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, pattern="*", src=os.path.join(self.build_folder, "perl", "bin"), dst=os.path.join(self.package_folder, "bin")) + copy(self, pattern="*", src=os.path.join(self.build_folder, "perl", "lib"), dst=os.path.join(self.package_folder, "lib")) + copy(self, pattern="*", src=os.path.join(self.build_folder, "perl", "vendor", "lib"), dst=os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: %s" % bin_path) - self.env_info.PATH.append(bin_path) + # TODO remove once conan v2 is the only support and recipes have been migrated + if Version(conan_version) < "2.0.0-beta": + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) - self.user_info.perl = os.path.join(self.package_folder, "bin", "perl.exe").replace("\\", "/") + perl_path = os.path.join(self.package_folder, "bin", "perl.exe").replace("\\", "/") + self.conf_info.define("user.strawberryperl:perl", perl_path) + if Version(conan_version) < "2.0.0-beta": + self.user_info.perl = perl_path diff --git a/recipes/strawberryperl/all/test_package/conanfile.py b/recipes/strawberryperl/all/test_package/conanfile.py index 397a3d181e121..85800c3ed5d5a 100644 --- a/recipes/strawberryperl/all/test_package/conanfile.py +++ b/recipes/strawberryperl/all/test_package/conanfile.py @@ -1,12 +1,20 @@ import os -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.env import VirtualBuildEnv +from conan.tools.scm import Version -class DefaultNameConan(ConanFile): - settings = "os", "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): - if not tools.cross_building(self): - self.run("perl --version", run_environment=True) + if can_run(self): + self.run("perl --version") perl_script = os.path.join(self.source_folder, "list_files.pl") - self.run("perl {}".format(perl_script), run_environment=True) + self.run(f"perl {perl_script}", env="conanbuild") diff --git a/recipes/strawberryperl/all/test_v1_package/conanfile.py b/recipes/strawberryperl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..641d8fdb8a176 --- /dev/null +++ b/recipes/strawberryperl/all/test_v1_package/conanfile.py @@ -0,0 +1,12 @@ +import os +from conans import ConanFile, tools + + +class DefaultNameConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not tools.cross_building(self): + self.run("perl --version", run_environment=True) + perl_script = os.path.join(self.source_folder, os.pardir, "test_package", "list_files.pl") + self.run(f"perl {perl_script}", run_environment=True) From 07419ebb9852664bf32a6ad4ccc366645745bf56 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 17:05:03 +0200 Subject: [PATCH 486/561] (#13565) libudev: allow cross compilation * libudev: allow cross compilation * use new system helper * fixup * Update conanfile.py --- recipes/libudev/all/conanfile.py | 40 +++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/recipes/libudev/all/conanfile.py b/recipes/libudev/all/conanfile.py index 2a3cdc0f95b03..bb1bde611d37b 100644 --- a/recipes/libudev/all/conanfile.py +++ b/recipes/libudev/all/conanfile.py @@ -1,5 +1,9 @@ -from conans import ConanFile, tools -from conans.errors import ConanException, ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.system import package_manager +from conans import tools + +required_conan_version = ">=1.47" class LibUDEVConan(ConanFile): @@ -10,7 +14,7 @@ class LibUDEVConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.freedesktop.org/software/systemd/man/udev.html" license = "GPL-2.0-or-later", "LGPL-2.1-or-later" - settings = "os" + settings = "os", "arch", "compiler", "build_type" def validate(self): if self.settings.os != "Linux": @@ -40,22 +44,20 @@ def _fill_cppinfo_from_pkgconfig(self, name): self.cpp_info.cxxflags = cflags def system_requirements(self): - packages = [] - if tools.os_info.is_linux and self.settings.os == "Linux": - if tools.os_info.with_yum: - packages = ["systemd-devel"] - elif tools.os_info.with_apt: - packages = ["libudev-dev"] - elif tools.os_info.with_pacman: - packages = ["systemd-libs"] - elif tools.os_info.with_zypper: - packages = ["libudev-devel"] - else: - self.output.warn("Don't know how to install %s for your distro." % self.name) - if packages: - package_tool = tools.SystemPackageTool(conanfile=self, default_mode='verify') - for p in packages: - package_tool.install(update=True, packages=p) + dnf = package_manager.Dnf(self) + dnf.install(["systemd-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["systemd-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libudev-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["systemd-libs"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["libudev-devel"], update=True, check=True) def package_info(self): self.cpp_info.includedirs = [] From f6be60d4b0b8cde2143b5d2c75ac51d261ed9fa6 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 17:24:24 +0200 Subject: [PATCH 487/561] (#13566) vdpau: allow cross compilation * vdpau: allow cross compilation * use new system helper * fixup * Update conanfile.py * Update conanfile.py --- recipes/vdpau/all/conanfile.py | 49 +++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/recipes/vdpau/all/conanfile.py b/recipes/vdpau/all/conanfile.py index c13780fe4e482..037314ecd8e20 100644 --- a/recipes/vdpau/all/conanfile.py +++ b/recipes/vdpau/all/conanfile.py @@ -1,5 +1,9 @@ -from conans import ConanFile, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +from conan.tools.system import package_manager +from conans import tools + +required_conan_version = ">=1.47" class SysConfigVDPAUConan(ConanFile): @@ -10,7 +14,11 @@ class SysConfigVDPAUConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.freedesktop.org/wiki/Software/VDPAU/" license = "MIT" - settings = {"os": ["Linux", "FreeBSD"]} + settings = "os", "arch", "compiler", "build_type" + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") def package_id(self): self.info.header_only() @@ -36,24 +44,23 @@ def _fill_cppinfo_from_pkgconfig(self, name): self.cpp_info.cxxflags.extend(cflags) def system_requirements(self): - packages = [] - if tools.os_info.is_linux and self.settings.os == "Linux": - if tools.os_info.with_yum: - packages = ["libvdpau-devel"] - elif tools.os_info.with_apt: - packages = ["libvdpau-dev"] - elif tools.os_info.with_pacman: - packages = ["libvdpau"] - elif tools.os_info.with_zypper: - packages = ["libvdpau-devel"] - else: - self.output.warn("Don't know how to install %s for your distro." % self.name) - elif tools.os_info.is_freebsd and self.settings.os == "FreeBSD": - packages = ["libvdpau"] - if packages: - package_tool = tools.SystemPackageTool(conanfile=self, default_mode='verify') - for p in packages: - package_tool.install(update=True, packages=p) + dnf = package_manager.Dnf(self) + dnf.install(["libvdpau-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["libvdpau-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libvdpau-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libvdpau"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["libvdpau-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libvdpau"], update=True, check=True) def package_info(self): self.cpp_info.includedirs = [] From b6f44a4e8ebea8ce11697c5bac500a5802f85ab9 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 17:45:14 +0200 Subject: [PATCH 488/561] (#13567) vaapi: allow cross compilation * vaapi: allow cross compilation * use new system helper * fixup * fixup * Update conanfile.py * Update conanfile.py --- recipes/vaapi/all/conanfile.py | 49 +++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/recipes/vaapi/all/conanfile.py b/recipes/vaapi/all/conanfile.py index 588e9fe71b361..756d5ef4595be 100644 --- a/recipes/vaapi/all/conanfile.py +++ b/recipes/vaapi/all/conanfile.py @@ -1,5 +1,9 @@ -from conans import ConanFile, tools -from conans.errors import ConanException +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +from conan.tools.system import package_manager +from conans import tools + +required_conan_version = ">=1.47" class SysConfigVAAPIConan(ConanFile): @@ -10,7 +14,11 @@ class SysConfigVAAPIConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://01.org/linuxmedia/vaapi" license = "MIT" - settings = {"os": ["Linux", "FreeBSD"]} + settings = "os", "arch", "compiler", "build_type" + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") def package_id(self): self.info.header_only() @@ -36,24 +44,23 @@ def _fill_cppinfo_from_pkgconfig(self, name): self.cpp_info.cxxflags.extend(cflags) def system_requirements(self): - packages = [] - if tools.os_info.is_linux and self.settings.os == "Linux": - if tools.os_info.with_yum: - packages = ["libva-devel"] - elif tools.os_info.with_apt: - packages = ["libva-dev"] - elif tools.os_info.with_pacman: - packages = ["libva"] - elif tools.os_info.with_zypper: - packages = ["libva-devel"] - else: - self.output.warn("Don't know how to install %s for your distro." % self.name) - elif tools.os_info.is_freebsd and self.settings.os == "FreeBSD": - packages = ["libva"] - if packages: - package_tool = tools.SystemPackageTool(conanfile=self, default_mode='verify') - for p in packages: - package_tool.install(update=True, packages=p) + dnf = package_manager.Dnf(self) + dnf.install(["libva-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["libva-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libva-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libva"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["libva-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libva"], update=True, check=True) def package_info(self): self.cpp_info.includedirs = [] From a3b64518ff42bb7bbbf38bde54ac74bf8a84d861 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 18:04:20 +0200 Subject: [PATCH 489/561] (#13568) gtk/system: allow cross compilation * gtk/system: allow cross compilation * use new system helper * fixup * Update conanfile.py * Update conanfile.py * Update conanfile.py --- recipes/gtk/system/conanfile.py | 55 +++++++++++++++++---------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/recipes/gtk/system/conanfile.py b/recipes/gtk/system/conanfile.py index ef496e60614dd..eaa08c92e96a6 100644 --- a/recipes/gtk/system/conanfile.py +++ b/recipes/gtk/system/conanfile.py @@ -1,5 +1,9 @@ -from conans import ConanFile, tools -from conans.errors import ConanException, ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +from conan.tools.system import package_manager +from conans import tools + +required_conan_version = ">=1.47" class ConanGTK(ConanFile): @@ -8,22 +12,22 @@ class ConanGTK(ConanFile): license = "LGPL-2.1-or-later" homepage = "https://www.gtk.org" description = "A free and open-source cross-platform widget toolkit for creating graphical user interfaces" - settings = "os" + settings = "os", "arch", "compiler", "build_type" options = {"version": [2, 3]} default_options = {"version": 2} topics = ("gui", "widget", "graphical") - def configure(self): + def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") - + def package_id(self): self.info.settings.clear() def _fill_cppinfo_from_pkgconfig(self, name): pkg_config = tools.PkgConfig(name) if not pkg_config.provides: - raise ConanException("GTK-{} development files aren't available, give up.".format(self.options.version)) + raise ConanException(f"GTK-{self.options.version} development files aren't available, give up.") libs = [lib[2:] for lib in pkg_config.libs_only_l] lib_dirs = [lib[2:] for lib in pkg_config.libs_only_L] ldflags = [flag for flag in pkg_config.libs_only_other] @@ -41,27 +45,24 @@ def _fill_cppinfo_from_pkgconfig(self, name): self.cpp_info.components[name].cxxflags = cflags def system_requirements(self): - packages = [] - if tools.os_info.is_linux and self.settings.os == "Linux": - if tools.os_info.with_apt: - packages = ["libgtk2.0-dev"] if self.options.version == 2 else ["libgtk-3-dev"] - elif tools.os_info.with_yum or tools.os_info.with_dnf: - packages = ["gtk{}-devel".format(self.options.version)] - elif tools.os_info.with_pacman: - packages = ["gtk{}".format(self.options.version)] - elif tools.os_info.with_zypper: - packages = ["gtk{}-devel".format(self.options.version)] - else: - self.output.warn("Do not know how to install 'GTK-{}' for {}." - .format(self.options.version, - tools.os_info.linux_distro)) - if tools.os_info.is_freebsd and self.settings.os == "FreeBSD": - packages = ["gtk{}".format(self.options.version)] - if packages: - package_tool = tools.SystemPackageTool(conanfile=self, default_mode="verify") - for p in packages: - package_tool.install(update=True, packages=p) + dnf = package_manager.Dnf(self) + dnf.install([f"gtk{self.options.version}-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install([f"gtk{self.options.version}-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libgtk2.0-dev"] if self.options.version == 2 else ["libgtk-3-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install([f"gtk{self.options.version}"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install([f"gtk{self.options.version}-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install([f"gtk{self.options.version}"], update=True, check=True) def package_info(self): - for name in ["gtk+-{}.0".format(self.options.version)]: + for name in [f"gtk+-{self.options.version}.0"]: self._fill_cppinfo_from_pkgconfig(name) From 356dc0404ec491c083705d8f9e8bec160732aa0a Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 18:24:38 +0200 Subject: [PATCH 490/561] (#13569) glu: allow cross compilation * glu: allow cross compilation * fixup * use new system helper * fixup * fixup * Update conanfile.py --- recipes/glu/all/conanfile.py | 40 +++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/recipes/glu/all/conanfile.py b/recipes/glu/all/conanfile.py index e7bf0072386fe..42fc9acb237e8 100644 --- a/recipes/glu/all/conanfile.py +++ b/recipes/glu/all/conanfile.py @@ -1,7 +1,10 @@ from conan import ConanFile from conan.errors import ConanException +from conan.tools.system import package_manager from conans import tools +required_conan_version = ">=1.47" + class SysConfigGLUConan(ConanFile): name = "glu" @@ -11,28 +14,27 @@ class SysConfigGLUConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://cgit.freedesktop.org/mesa/glu/" license = "SGI-B-2.0" - settings = "os" + settings = "os", "arch", "compiler", "build_type" requires = "opengl/system" def system_requirements(self): - packages = [] - if tools.os_info.is_linux and self.settings.os == "Linux": - if tools.os_info.with_yum or tools.os_info.with_dnf: - packages = ["mesa-libGLU-devel"] - elif tools.os_info.with_apt: - packages = ["libglu1-mesa-dev"] - elif tools.os_info.with_pacman: - packages = ["glu"] - elif tools.os_info.with_zypper: - packages = ["glu-devel"] - else: - self.output.warn("Don't know how to install GLU for your distro") - if tools.os_info.is_freebsd and self.settings.os == "FreeBSD": - packages = ["libGLU"] - if packages: - package_tool = tools.SystemPackageTool(conanfile=self, default_mode='verify') - for p in packages: - package_tool.install(update=True, packages=p) + dnf = package_manager.Dnf(self) + dnf.install(["mesa-libGLU-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["mesa-libGLU-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libglu1-mesa-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["glu"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["glu-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libGLU"], update=True, check=True) def _fill_cppinfo_from_pkgconfig(self, name): pkg_config = tools.PkgConfig(name) From ad92cda1aba7dbd2e51017b200f78e586529d6b4 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 18 Oct 2022 18:44:32 +0200 Subject: [PATCH 491/561] (#13571) egl: use new system helper * egl: use new system helper * fixup * Update conanfile.py * Update conanfile.py --- recipes/egl/system/conanfile.py | 52 +++++++++++++++++---------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/recipes/egl/system/conanfile.py b/recipes/egl/system/conanfile.py index 956446154ca51..2139b499f3f52 100644 --- a/recipes/egl/system/conanfile.py +++ b/recipes/egl/system/conanfile.py @@ -1,7 +1,10 @@ from conan import ConanFile from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.system import package_manager from conans import tools +required_conan_version = ">=1.47" + class SysConfigEGLConan(ConanFile): name = "egl" @@ -16,7 +19,7 @@ class SysConfigEGLConan(ConanFile): def configure(self): if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("This recipes supports only Linux and FreeBSD") - + def package_id(self): self.info.header_only() @@ -41,30 +44,29 @@ def _fill_cppinfo_from_pkgconfig(self, name): self.cpp_info.cxxflags.extend(cflags) def system_requirements(self): - packages = [] - if tools.os_info.is_linux and self.settings.os == "Linux": - if tools.os_info.with_yum: - packages = ["mesa-libEGL-devel"] - elif tools.os_info.with_apt: - ubuntu_20_or_later = tools.os_info.linux_distro == "ubuntu" and tools.os_info.os_version >= "20" - debian_11_or_later = tools.os_info.linux_distro == "debian" and tools.os_info.os_version >= "11" - pop_os_20_or_later = tools.os_info.linux_distro == "pop" and tools.os_info.os_version >= "20" - if ubuntu_20_or_later or debian_11_or_later or pop_os_20_or_later: - packages = ["libegl-dev"] - else: - packages = ["libegl1-mesa-dev"] - elif tools.os_info.with_pacman: - packages = ["libglvnd"] - elif tools.os_info.with_zypper: - packages = ["Mesa-libEGL-devel"] - else: - self.output.warn("Don't know how to install EGL for your distro.") - if tools.os_info.is_freebsd and self.settings.os == "FreeBSD": - packages = ["libglvnd"] - if packages: - package_tool = tools.SystemPackageTool(conanfile=self, default_mode='verify') - for p in packages: - package_tool.install(update=True, packages=p) + dnf = package_manager.Dnf(self) + dnf.install(["mesa-libEGL-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["mesa-libEGL-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + ubuntu_20_or_later = tools.os_info.linux_distro == "ubuntu" and tools.os_info.os_version >= "20" + debian_11_or_later = tools.os_info.linux_distro == "debian" and tools.os_info.os_version >= "11" + pop_os_20_or_later = tools.os_info.linux_distro == "pop" and tools.os_info.os_version >= "20" + if ubuntu_20_or_later or debian_11_or_later or pop_os_20_or_later: + apt.install(["libegl-dev"], update=True, check=True) + else: + apt.install(["libegl1-mesa-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libglvnd"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["Mesa-libEGL-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libglvnd"], update=True, check=True) def package_info(self): # TODO: Workaround for #2311 until a better solution can be found From 7eafaf98dfd0a53f697d9934278f152ea2136dc2 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 19:04:17 +0200 Subject: [PATCH 492/561] (#13573) yasm: fix MinGW --- recipes/yasm/all/conanfile.py | 36 +++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/recipes/yasm/all/conanfile.py b/recipes/yasm/all/conanfile.py index 6ae77d2526617..05721cdf31f90 100644 --- a/recipes/yasm/all/conanfile.py +++ b/recipes/yasm/all/conanfile.py @@ -1,15 +1,15 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain -from conan.tools.layout import basic_layout, cmake_layout -from conan.tools.microsoft import is_msvc - +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path import os - required_conan_version = ">=1.52.0" + class YASMConan(ConanFile): name = "yasm" url = "https://github.com/conan-io/conan-center-index" @@ -27,23 +27,38 @@ def export_sources(self): export_conandata_patches(self) def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass def layout(self): if is_msvc(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") else: - basic_layout(self) + basic_layout(self, src_folder="src") def package_id(self): del self.info.settings.compiler + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + def source(self): get(self, **self.conan_data["sources"][self.version][0], destination=self.source_folder, strip_root=True) def _generate_autotools(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) enable_debug = "yes" if self.settings.build_type == "Debug" else "no" tc.configure_args.extend([ @@ -85,7 +100,8 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib")) else: autotools = Autotools(self) - autotools.install() + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): From 23b694192b14c34292bf7691b0e48b19721ec09c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 19:24:08 +0200 Subject: [PATCH 493/561] (#13576) libevent: build either shared or static --- recipes/libevent/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libevent/all/conanfile.py b/recipes/libevent/all/conanfile.py index a06ee298377ac..0a8f1ba78b504 100644 --- a/recipes/libevent/all/conanfile.py +++ b/recipes/libevent/all/conanfile.py @@ -66,7 +66,7 @@ def generate(self): tc = CMakeToolchain(self) if self.options.with_openssl: tc.variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") - tc.variables["EVENT__LIBRARY_TYPE"] = "SHARED" if self.options.shared else "STATIC" + tc.cache_variables["EVENT__LIBRARY_TYPE"] = "SHARED" if self.options.shared else "STATIC" tc.variables["EVENT__DISABLE_DEBUG_MODE"] = self.settings.build_type == "Release" tc.variables["EVENT__DISABLE_OPENSSL"] = not self.options.with_openssl tc.variables["EVENT__DISABLE_THREAD_SUPPORT"] = self.options.disable_threads From 2ad024ba0e7b4341e45949fc6c15412c9cc37c6a Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 18 Oct 2022 19:44:59 +0200 Subject: [PATCH 494/561] (#13580) [actions] Revert tj-actions/changed-file to version v20 * Add fetch-depth for all files Signed-off-by: Uilian Ries * Fix indentation Signed-off-by: Uilian Ries * Fix indentation Signed-off-by: Uilian Ries * Revert tj-actions/changed-file Signed-off-by: Uilian Ries * Use depth 0 Signed-off-by: Uilian Ries * Revert not needed changes Signed-off-by: Uilian Ries * revert to depth 2 Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- .github/workflows/linter-conan-v2.yml | 6 +++--- .github/workflows/linter-yaml.yml | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linter-conan-v2.yml b/.github/workflows/linter-conan-v2.yml index 618e82492e865..7a00231462537 100644 --- a/.github/workflows/linter-conan-v2.yml +++ b/.github/workflows/linter-conan-v2.yml @@ -18,7 +18,7 @@ jobs: with: fetch-depth: 2 - name: Get changed files - uses: tj-actions/changed-files@v32 + uses: tj-actions/changed-files@v20 id: changed_files with: files: | @@ -87,7 +87,7 @@ jobs: fetch-depth: 2 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v32 + uses: tj-actions/changed-files@v20 with: files: | recipes/*/*/conanfile.py @@ -122,7 +122,7 @@ jobs: fetch-depth: 2 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v32 + uses: tj-actions/changed-files@v20 with: files: | recipes/*/*/test_*/conanfile.py diff --git a/.github/workflows/linter-yaml.yml b/.github/workflows/linter-yaml.yml index be716fffc216a..59e73e83b163c 100644 --- a/.github/workflows/linter-yaml.yml +++ b/.github/workflows/linter-yaml.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 2 - name: Get changed files - uses: tj-actions/changed-files@v32 + uses: tj-actions/changed-files@v20 id: changed_files with: files: | @@ -30,7 +30,7 @@ jobs: if: steps.changed_files.outputs.any_changed == 'true' with: python-version: ${{ env.PYVER }} - + - name: Install dependencies if: steps.changed_files.outputs.any_changed == 'true' run: pip install yamllint @@ -56,7 +56,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ env.PYVER }} - + - name: Install dependencies run: pip install yamllint @@ -64,11 +64,11 @@ jobs: - name: Get changed files (config) id: changed_files_config if: always() - uses: tj-actions/changed-files@v32 + uses: tj-actions/changed-files@v20 with: files: | ${{ env.CONFIG_FILES_PATH }} - + - name: Run linter (config.yml) if: steps.changed_files_config.outputs.any_changed == 'true' && always() run: | @@ -80,11 +80,11 @@ jobs: - name: Get changed files (conandata) id: changed_files_conandata if: always() - uses: tj-actions/changed-files@v32 + uses: tj-actions/changed-files@v20 with: files: | ${{ env.CONANDATA_FILES_PATH }} - + - name: Run linter (conandata.yml) if: steps.changed_files_conandata.outputs.any_changed == 'true' && always() run: | From c4f45d4ddb33e1ec1fed39359f0c53cc90731280 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 18 Oct 2022 20:24:02 +0200 Subject: [PATCH 495/561] (#13579) Revert "Create dependabot.yml" This reverts commit d78fefe0e2116e4d45deff9a02e59d300ebf622d. --- .github/dependabot.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 90e05c40d0459..0000000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "github-actions" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" From fcb0b18fa3b2490b256bebb30c9ab65cafe63cb5 Mon Sep 17 00:00:00 2001 From: System-Arch <33330183+System-Arch@users.noreply.github.com> Date: Tue, 18 Oct 2022 15:26:00 -0400 Subject: [PATCH 496/561] (#13357) Declare package_type and prevent Conan 2 errors with self.env_info * Declare package_type and prevent Conan 2 errors with self.env_info * Update recipes/ninja/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: System-Arch Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/ninja/all/conanfile.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/recipes/ninja/all/conanfile.py b/recipes/ninja/all/conanfile.py index bd89cd7fe4427..881e7efbf37b8 100644 --- a/recipes/ninja/all/conanfile.py +++ b/recipes/ninja/all/conanfile.py @@ -1,13 +1,15 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get +from conan.tools.scm import Version import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.52.0" class NinjaConan(ConanFile): name = "ninja" + package_type = "application" description = "Ninja is a small build system with a focus on speed" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" @@ -47,5 +49,6 @@ def package_info(self): self.conf_info.define("tools.cmake.cmaketoolchain:generator", "Ninja") # TODO: to remove in conan v2 - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) - self.env_info.CONAN_CMAKE_GENERATOR = "Ninja" + if Version(conan_version).major < 2: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.CONAN_CMAKE_GENERATOR = "Ninja" From 42393a606606dfa485d1084300000599fc7367a0 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 19 Oct 2022 04:44:43 +0900 Subject: [PATCH 497/561] (#13563) avcpp: add version 2.1.0 and suppport conan v2 * avcpp: add version 2.1.0 and suppport conan v2 * fix source path * link mvec, mfplat library * fix f-string miss Co-authored-by: Chris Mc * add patch description Co-authored-by: Chris Mc --- recipes/avcpp/all/CMakeLists.txt | 10 -- recipes/avcpp/all/conandata.yml | 12 +- recipes/avcpp/all/conanfile.py | 105 ++++++++++-------- .../avcpp/all/patches/2.1.0-fix-ffmpeg.patch | 46 ++++++++ ...ge.patch => cci.20220301-fix-ffmpeg.patch} | 0 recipes/avcpp/all/test_package/CMakeLists.txt | 11 +- recipes/avcpp/all/test_package/conanfile.py | 22 +++- .../avcpp/all/test_v1_package/CMakeLists.txt | 15 +++ .../avcpp/all/test_v1_package/conanfile.py | 16 +++ recipes/avcpp/config.yml | 2 + 10 files changed, 166 insertions(+), 73 deletions(-) delete mode 100644 recipes/avcpp/all/CMakeLists.txt create mode 100644 recipes/avcpp/all/patches/2.1.0-fix-ffmpeg.patch rename recipes/avcpp/all/patches/{fix-ffmpeg-package.patch => cci.20220301-fix-ffmpeg.patch} (100%) create mode 100644 recipes/avcpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/avcpp/all/test_v1_package/conanfile.py diff --git a/recipes/avcpp/all/CMakeLists.txt b/recipes/avcpp/all/CMakeLists.txt deleted file mode 100644 index fcd2addceeac7..0000000000000 --- a/recipes/avcpp/all/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -set(AVCPP_NOT_SUBPROJECT ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/avcpp/all/conandata.yml b/recipes/avcpp/all/conandata.yml index af831432579cc..1ba5e69f511c2 100644 --- a/recipes/avcpp/all/conandata.yml +++ b/recipes/avcpp/all/conandata.yml @@ -1,9 +1,17 @@ sources: + "2.1.0": + url: "https://github.com/h4tr3d/avcpp/archive/refs/tags/v2.1.0.tar.gz" + sha256: "8398217dccb9f5b4cbb41e5bf4f73f47b461ed3ba8c3aefdda9f9dd714649855" "cci.20220301": url: "https://github.com/h4tr3d/avcpp/archive/fd4bc4662eb39853de8fcac4a663bebd0eea30b8.tar.gz" sha256: "e48eae2ec154bc69aed16159c8b18c9ffb4925ba672b022e94a3c9b96782a4bf" patches: + "2.1.0": + - patch_file: "patches/2.1.0-fix-ffmpeg.patch" + patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" + patch_type: "conan" "cci.20220301": - - base_path: "source_subfolder" - patch_file: "patches/fix-ffmpeg-package.patch" + - patch_file: "patches/cci.20220301-fix-ffmpeg.patch" + patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" + patch_type: "conan" diff --git a/recipes/avcpp/all/conanfile.py b/recipes/avcpp/all/conanfile.py index ca7902bd79a4f..7585987f38a75 100644 --- a/recipes/avcpp/all/conanfile.py +++ b/recipes/avcpp/all/conanfile.py @@ -1,46 +1,45 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class AvcppConan(ConanFile): name = "avcpp" description = "C++ wrapper for FFmpeg" - topics = ("ffmpeg", "cpp") license = "LGPL-2.1", "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/h4tr3d/avcpp/" + topics = ("ffmpeg", "cpp") settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False], + "fPIC": [True, False], "shared": [True, False], } default_options = { - "fPIC": True, + "fPIC": True, "shared": False, } - generators = "cmake", "cmake_find_package_multi" + @property + def _minimum_cpp_standard(self): + return 17 @property - def _compiler_required_cpp17(self): + def _compilers_minimum_version(self): return { - "Visual Studio": "16", "gcc": "8", "clang": "7", "apple-clang": "12.0", } - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -51,56 +50,66 @@ def configure(self): del self.options.fPIC def validate(self): - if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, "17") - - minimum_version = self._compiler_required_cpp17.get(str(self.settings.compiler), False) - if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) - else: - self.output.warn("{0} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("ffmpeg/5.0") 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], destination=self.source_folder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["AV_ENABLE_SHARED"] = self.options.shared - cmake.definitions["AV_ENABLE_STATIC"] = not self.options.shared - cmake.definitions["AV_BUILD_EXAMPLES"] = False - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["AV_ENABLE_SHARED"] = self.options.shared + tc.variables["AV_ENABLE_STATIC"] = not self.options.shared + tc.variables["AV_BUILD_EXAMPLES"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + 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, pattern="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, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): target_name = "avcpp" if self.options.shared else "avcpp-static" self.cpp_info.set_property("cmake_file_name", "avcpp") - self.cpp_info.set_property("cmake_target_name", "avcpp::{}".format(target_name)) - - self.cpp_info.filenames["cmake_find_package"] = "avcpp" - self.cpp_info.filenames["cmake_find_package_multi"] = "avcpp" - self.cpp_info.names["cmake_find_package"] = "avcpp" - self.cpp_info.names["cmake_find_package_multi"] = "avcpp" + self.cpp_info.set_property("cmake_target_name", f"avcpp::{target_name}") self.cpp_info.components["AvCpp"].names["cmake_find_package"] = target_name self.cpp_info.components["AvCpp"].names["cmake_find_package_multi"] = target_name - self.cpp_info.components["AvCpp"].set_property("cmake_target_name", "avcpp::{}".format(target_name)) + self.cpp_info.components["AvCpp"].set_property("cmake_target_name", f"avcpp::{target_name}") self.cpp_info.components["AvCpp"].libs = ["avcpp", ] self.cpp_info.components["AvCpp"].requires = ["ffmpeg::ffmpeg", ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["AvCpp"].system_libs = ["mvec"] + if self.settings.os == "Windows": + self.cpp_info.components["AvCpp"].system_libs = ["mfplat"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "avcpp" + self.cpp_info.filenames["cmake_find_package_multi"] = "avcpp" + self.cpp_info.names["cmake_find_package"] = "avcpp" + self.cpp_info.names["cmake_find_package_multi"] = "avcpp" diff --git a/recipes/avcpp/all/patches/2.1.0-fix-ffmpeg.patch b/recipes/avcpp/all/patches/2.1.0-fix-ffmpeg.patch new file mode 100644 index 0000000000000..38c60a601238c --- /dev/null +++ b/recipes/avcpp/all/patches/2.1.0-fix-ffmpeg.patch @@ -0,0 +1,46 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 95b1a02..0f31197 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,8 +6,6 @@ endif() + + project(AvCpp LANGUAGES CXX VERSION 2.1.0) + +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) +- + set(FFMPEG_PKG_CONFIG_SUFFIX "" CACHE STRING "This suffix uses for FFmpeg component names searches by pkg-config") + set(AV_ENABLE_STATIC On CACHE BOOL "Enable static library build (On)") + set(AV_ENABLE_SHARED On CACHE BOOL "Enable shared library build (On)") +@@ -28,8 +26,8 @@ set (AVCPP_WARNING_OPTIONS + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) + +-find_package(FFmpeg +- COMPONENTS AVCODEC AVFORMAT AVUTIL AVDEVICE AVFILTER SWSCALE SWRESAMPLE REQUIRED) ++find_package(ffmpeg ++ COMPONENTS avcodec avformat avutil avdevice avfilter swscale swresample REQUIRED) + + add_subdirectory(src) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 4c58281..bee779f 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -24,7 +24,7 @@ foreach(TARGET ${AV_TARGETS}) + add_library(${TARGET} ${TYPE} ${AV_SOURCES} ${AV_HEADERS}) + + target_compile_options(${TARGET} PRIVATE ${AVCPP_WARNING_OPTIONS}) +- target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC FFmpeg::FFmpeg) ++ target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC ffmpeg::ffmpeg) + target_include_directories(${TARGET} + PUBLIC + $ +@@ -53,7 +53,7 @@ if (AVCPP_NOT_SUBPROJECT) + # APPEND + # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) + +- install(TARGETS ${AV_TARGETS} FFmpeg ++ install(TARGETS ${AV_TARGETS} + EXPORT avcpp-targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/avcpp/all/patches/fix-ffmpeg-package.patch b/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch similarity index 100% rename from recipes/avcpp/all/patches/fix-ffmpeg-package.patch rename to recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch diff --git a/recipes/avcpp/all/test_package/CMakeLists.txt b/recipes/avcpp/all/test_package/CMakeLists.txt index a52ed1452c0cb..7b07f0b83ed62 100644 --- a/recipes/avcpp/all/test_package/CMakeLists.txt +++ b/recipes/avcpp/all/test_package/CMakeLists.txt @@ -1,15 +1,12 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(avcpp CONFIG REQUIRED) +find_package(avcpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) if (TARGET avcpp::avcpp) - target_link_libraries(${PROJECT_NAME} avcpp::avcpp) + target_link_libraries(${PROJECT_NAME} PRIVATE avcpp::avcpp) else() - target_link_libraries(${PROJECT_NAME} avcpp::avcpp-static) + target_link_libraries(${PROJECT_NAME} PRIVATE avcpp::avcpp-static) endif() target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/avcpp/all/test_package/conanfile.py b/recipes/avcpp/all/test_package/conanfile.py index 6b551939fbde3..a9fb96656f203 100644 --- a/recipes/avcpp/all/test_package/conanfile.py +++ b/recipes/avcpp/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 TestConan(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + 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,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/avcpp/all/test_v1_package/CMakeLists.txt b/recipes/avcpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..053bba6e952b4 --- /dev/null +++ b/recipes/avcpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(avcpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +if (TARGET avcpp::avcpp) + target_link_libraries(${PROJECT_NAME} PRIVATE avcpp::avcpp) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE avcpp::avcpp-static) +endif() +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/avcpp/all/test_v1_package/conanfile.py b/recipes/avcpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6b551939fbde3 --- /dev/null +++ b/recipes/avcpp/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/avcpp/config.yml b/recipes/avcpp/config.yml index 372dcda16cf25..deb0eb011c7ea 100644 --- a/recipes/avcpp/config.yml +++ b/recipes/avcpp/config.yml @@ -1,3 +1,5 @@ versions: + "2.1.0": + folder: all "cci.20220301": folder: all From 85be44d9190033d87dd3502966b9257ab5f4e3df Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 18 Oct 2022 23:04:08 +0200 Subject: [PATCH 498/561] (#13560) lmdb: conan v2 support * conan v2 support * bum required_conan_version Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/lmdb/all/CMakeLists.txt | 21 +++--- recipes/lmdb/all/conanfile.py | 72 ++++++++++--------- recipes/lmdb/all/test_package/CMakeLists.txt | 9 ++- recipes/lmdb/all/test_package/conanfile.py | 22 ++++-- .../lmdb/all/test_v1_package/CMakeLists.txt | 10 +++ recipes/lmdb/all/test_v1_package/conanfile.py | 17 +++++ 6 files changed, 93 insertions(+), 58 deletions(-) create mode 100644 recipes/lmdb/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lmdb/all/test_v1_package/conanfile.py diff --git a/recipes/lmdb/all/CMakeLists.txt b/recipes/lmdb/all/CMakeLists.txt index 679dd60a12c26..888afb35a88e0 100644 --- a/recipes/lmdb/all/CMakeLists.txt +++ b/recipes/lmdb/all/CMakeLists.txt @@ -1,25 +1,24 @@ cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) +project(lmdb LANGUAGES C) -include(conanbuildinfo.cmake) -conan_basic_setup() +include(GNUInstallDirs) # LMDB library: add_library(lmdb - source_subfolder/lmdb.h - source_subfolder/mdb.c - source_subfolder/midl.c - source_subfolder/midl.h + ${LMDB_SRC_DIR}/lmdb.h + ${LMDB_SRC_DIR}/mdb.c + ${LMDB_SRC_DIR}/midl.c + ${LMDB_SRC_DIR}/midl.h ) set_target_properties(lmdb PROPERTIES - PUBLIC_HEADER source_subfolder/lmdb.h + PUBLIC_HEADER ${LMDB_SRC_DIR}/lmdb.h WINDOWS_EXPORT_ALL_SYMBOLS ON ) -include(FindThreads) -target_link_libraries(lmdb PUBLIC ${CMAKE_THREAD_LIBS_INIT}) +find_package(Threads REQUIRED) +target_link_libraries(lmdb PUBLIC Threads::Threads) install(TARGETS lmdb RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -37,7 +36,7 @@ endif (LMDB_ENABLE_ROBUST_MUTEX) if(NOT WIN32) foreach(TOOL mdb_stat mdb_copy mdb_dump mdb_load) - add_executable(${TOOL} source_subfolder/${TOOL}.c) + add_executable(${TOOL} ${LMDB_SRC_DIR}/${TOOL}.c) target_link_libraries(${TOOL} lmdb) install(TARGETS ${TOOL} DESTINATION ${CMAKE_INSTALL_BINDIR}) endforeach() diff --git a/recipes/lmdb/all/conanfile.py b/recipes/lmdb/all/conanfile.py index b90a6bbeb1c7c..7700c885b181c 100644 --- a/recipes/lmdb/all/conanfile.py +++ b/recipes/lmdb/all/conanfile.py @@ -1,7 +1,9 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get import os -from conans import ConanFile, CMake, tools -required_conan_version = ">=1.29.0" +required_conan_version = ">=1.46.0" class lmdbConan(ConanFile): @@ -10,8 +12,9 @@ class lmdbConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://symas.com/lmdb/" description = "Fast and compat memory-mapped key-value database" - topics = ("LMDB", "database", "key-value", "memory-mapped") - settings = "os", "compiler", "build_type", "arch" + topics = ("database", "key-value", "memory-mapped") + + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,18 +25,8 @@ class lmdbConan(ConanFile): "fPIC": True, "enable_robust_mutex": True, } - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + exports_sources = ["CMakeLists.txt"] def config_options(self): if self.settings.os == "Windows": @@ -45,40 +38,49 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - root = "openldap-LMDB_{}".format(self.version) - tools.rename(os.path.join(root, "libraries", "liblmdb"), self._source_subfolder) - tools.rmdir(root) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LMDB_SRC_DIR"] = os.path.join(self.source_folder, "libraries", "liblmdb").replace("\\", "/") + tc.variables["LMDB_ENABLE_ROBUST_MUTEX"] = self.options.enable_robust_mutex + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["LMDB_ENABLE_ROBUST_MUTEX"] = self.options.enable_robust_mutex - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=os.path.join(self.source_folder, "libraries", "liblmdb"), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): + self.cpp_info.set_property("pkg_config_name", "lmdb") self.cpp_info.libs = ["lmdb"] - self.cpp_info.names["pkg_config"] = "lmdb" if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/lmdb/all/test_package/CMakeLists.txt b/recipes/lmdb/all/test_package/CMakeLists.txt index c18f9b2f3fce4..3342cb59e0fea 100644 --- a/recipes/lmdb/all/test_package/CMakeLists.txt +++ b/recipes/lmdb/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.4) -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(lmdb REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE lmdb::lmdb) diff --git a/recipes/lmdb/all/test_package/conanfile.py b/recipes/lmdb/all/test_package/conanfile.py index 2ab7e3a608f12..0a6bc68712d90 100644 --- a/recipes/lmdb/all/test_package/conanfile.py +++ b/recipes/lmdb/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" -class LmdbTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/lmdb/all/test_v1_package/CMakeLists.txt b/recipes/lmdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..20645081348a3 --- /dev/null +++ b/recipes/lmdb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(lmdb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE lmdb::lmdb) diff --git a/recipes/lmdb/all/test_v1_package/conanfile.py b/recipes/lmdb/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/lmdb/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From f39baf77725386941c9affe69f05c827409d83d0 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 19 Oct 2022 14:06:07 +0900 Subject: [PATCH 499/561] (#13494) aws-c-s3: add version 0.1.49 and support conan v2 * aws-c-s3: add version 0.1.49 and support conan v2 * update required recipe version --- recipes/aws-c-s3/all/CMakeLists.txt | 7 -- recipes/aws-c-s3/all/conandata.yml | 3 + recipes/aws-c-s3/all/conanfile.py | 83 +++++++++++-------- .../aws-c-s3/all/test_package/CMakeLists.txt | 5 +- .../aws-c-s3/all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 10 +++ .../aws-c-s3/all/test_v1_package/conanfile.py | 17 ++++ recipes/aws-c-s3/config.yml | 2 + 8 files changed, 95 insertions(+), 53 deletions(-) delete mode 100644 recipes/aws-c-s3/all/CMakeLists.txt create mode 100644 recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-c-s3/all/test_v1_package/conanfile.py diff --git a/recipes/aws-c-s3/all/CMakeLists.txt b/recipes/aws-c-s3/all/CMakeLists.txt deleted file mode 100644 index fe3c5e109c923..0000000000000 --- a/recipes/aws-c-s3/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper LANGUAGES C) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-c-s3/all/conandata.yml b/recipes/aws-c-s3/all/conandata.yml index 4daad0a6b73cc..af6e82a742aa6 100644 --- a/recipes/aws-c-s3/all/conandata.yml +++ b/recipes/aws-c-s3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.49": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.49.tar.gz" + sha256: "71acbba41a02477a6c352172da561bc2138bf239b936490c773d7aaa83afc9ab" "0.1.37": url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.37.tar.gz" sha256: "2c35100c1739300e438d47f49aaa2c374001416a79fe3c6f27d79371fb2ac90b" diff --git a/recipes/aws-c-s3/all/conanfile.py b/recipes/aws-c-s3/all/conanfile.py index 59a016d054869..131627214ba79 100644 --- a/recipes/aws-c-s3/all/conanfile.py +++ b/recipes/aws-c-s3/all/conanfile.py @@ -1,18 +1,18 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.43.0" - +required_conan_version = ">=1.47.0" class AwsCS3(ConanFile): name = "aws-c-s3" description = "C99 implementation of the S3 client" - topics = ("aws", "amazon", "cloud", "s3") + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-c-s3" - license = "Apache-2.0", - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" + topics = ("aws", "amazon", "cloud", "s3") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,51 +23,62 @@ class AwsCS3(ConanFile): "fPIC": True, } - _cmake = None - - @property - def _source_subfolder(self): - return "source_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 - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-common/0.6.19") - self.requires("aws-c-io/0.10.20") - self.requires("aws-c-http/0.6.13") - self.requires("aws-c-auth/0.6.11") - if tools.Version(self.version) >= "0.1.36": - self.requires("aws-checksums/0.1.12") + self.requires("aws-c-common/0.8.2") + if Version(self.version) < "0.1.49": + self.requires("aws-c-io/0.10.20") + self.requires("aws-c-http/0.6.13") + self.requires("aws-c-auth/0.6.11") + else: + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") + self.requires("aws-c-auth/0.6.17") + if Version(self.version) >= "0.1.36": + self.requires("aws-checksums/0.1.13") 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], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure() - return self._cmake + deps = CMakeDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "lib", "aws-c-s3")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-s3")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-s3") @@ -88,5 +99,5 @@ def package_info(self): "aws-c-http::aws-c-http-lib", "aws-c-auth::aws-c-auth-lib" ] - if tools.Version(self.version) >= "0.1.36": + if Version(self.version) >= "0.1.36": self.cpp_info.components["aws-c-s3-lib"].requires.append("aws-checksums::aws-checksums-lib") diff --git a/recipes/aws-c-s3/all/test_package/CMakeLists.txt b/recipes/aws-c-s3/all/test_package/CMakeLists.txt index 4af87d8f6333f..8e0fdd1abc04c 100644 --- a/recipes/aws-c-s3/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-s3/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(aws-c-s3 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-s3) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-s3) diff --git a/recipes/aws-c-s3/all/test_package/conanfile.py b/recipes/aws-c-s3/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/aws-c-s3/all/test_package/conanfile.py +++ b/recipes/aws-c-s3/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0778b2e2c7246 --- /dev/null +++ b/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-c-s3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-s3) diff --git a/recipes/aws-c-s3/all/test_v1_package/conanfile.py b/recipes/aws-c-s3/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/aws-c-s3/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-c-s3/config.yml b/recipes/aws-c-s3/config.yml index 86679f6500b25..182095498622b 100644 --- a/recipes/aws-c-s3/config.yml +++ b/recipes/aws-c-s3/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.49": + folder: all "0.1.37": folder: all "0.1.29": From 843317aed0272023e4be86eb6616c645f8f9ff8e Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 19 Oct 2022 14:43:49 +0900 Subject: [PATCH 500/561] (#13526) lief: support conan v2 and update dependencies * lief: support conan v2 * fix settings order in test_v1_package * fix validation * add filename definition * don't use collect_libs * don't use collect_libs * use cmake_find_package_multi * drop support libstdc++ * drop support clang and libstdc++ * link math lib * add msvc version check --- recipes/lief/all/CMakeLists.txt | 7 - recipes/lief/all/conandata.yml | 6 - recipes/lief/all/conanfile.py | 143 +++++++++++------- .../lief/all/patches/001_link_to_conan.patch | 80 +++++----- recipes/lief/all/test_package/CMakeLists.txt | 13 +- recipes/lief/all/test_package/conanfile.py | 21 ++- .../lief/all/test_v1_package/CMakeLists.txt | 11 ++ recipes/lief/all/test_v1_package/conanfile.py | 20 +++ 8 files changed, 181 insertions(+), 120 deletions(-) delete mode 100644 recipes/lief/all/CMakeLists.txt create mode 100644 recipes/lief/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/lief/all/test_v1_package/conanfile.py diff --git a/recipes/lief/all/CMakeLists.txt b/recipes/lief/all/CMakeLists.txt deleted file mode 100644 index 30c065f03128e..0000000000000 --- a/recipes/lief/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(source_subfolder) diff --git a/recipes/lief/all/conandata.yml b/recipes/lief/all/conandata.yml index 783cb3b5db868..6bb6d4a4c6bc4 100644 --- a/recipes/lief/all/conandata.yml +++ b/recipes/lief/all/conandata.yml @@ -5,14 +5,8 @@ sources: patches: "0.10.1": - patch_file: "patches/001_link_to_conan.patch" - base_path: "source_subfolder" - patch_file: "patches/002_fix_resources_manager.patch" - base_path: "source_subfolder" - patch_file: "patches/003_fix_json_include_path.patch" - base_path: "source_subfolder" - patch_file: "patches/004_fix_elf_parser.patch" - base_path: "source_subfolder" - patch_file: "patches/005_fix_compiler_detection.patch" - base_path: "source_subfolder" - patch_file: "patches/006_fix_binary_cpp.patch" - base_path: "source_subfolder" diff --git a/recipes/lief/all/conanfile.py b/recipes/lief/all/conanfile.py index 94959a4ba4b2a..626cc2d07f9f0 100644 --- a/recipes/lief/all/conanfile.py +++ b/recipes/lief/all/conanfile.py @@ -1,18 +1,23 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + import os -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration +required_conan_version = ">=1.52.0" class LiefConan(ConanFile): name = "lief" description = "Library to Instrument Executable Formats" - topics = ("conan", "lief", "executable", "elf") + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lief-project/LIEF" - license = "Apache-2.0" - exports_sources = "CMakeLists.txt", "patches/*" - generators = "cmake", - settings = "os", "compiler", "build_type", "arch" + topics = ("executable", "elf", "pe", "mach-o") + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -42,80 +47,104 @@ class LiefConan(ConanFile): "with_vdex": True, } - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + return 11 - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version.value) <= 14 and self.options.shared: - raise ConanInvalidConfiguration("{} {} does not support Visual Studio <= 14 with shared:True".format(self.name, self.version)) + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + if ((self.info.settings.compiler == "Visual Studio" and Version(self.info.settings.compiler.version) <= "14") + or + (self.info.settings.compiler == "msvc" and Version(self.info.settings.compiler.version) <= "190")) \ + and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio <= 14 with shared:True") + + if self.info.settings.compiler.get_safe("libcxx") == "libstdc++": + raise ConanInvalidConfiguration(f"{self.ref} does not support libstdc++") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("rang/3.1.0") - self.requires("mbedtls/2.16.3-apache") + self.requires("rang/3.2") + self.requires("mbedtls/3.2.1") if self.options.with_json: - self.requires("nlohmann_json/3.9.1") + self.requires("nlohmann_json/3.11.2") if self.options.with_frozen: - self.requires("frozen/1.0.0") + self.requires("frozen/1.1.1") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "LIEF-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["LIEF_ART"] = self.options.with_art - self._cmake.definitions["LIEF_DEX"] = self.options.with_dex - self._cmake.definitions["LIEF_ELF"] = self.options.with_elf - self._cmake.definitions["LIEF_OAT"] = self.options.with_oat - self._cmake.definitions["LIEF_PE"] = self.options.with_pe - self._cmake.definitions["LIEF_VDEX"] = self.options.with_vdex - self._cmake.definitions["LIEF_MACHO"] = self.options.with_macho - self._cmake.definitions["LIEF_ENABLE_JSON"] = self.options.with_json - self._cmake.definitions["LIEF_DISABLE_FROZEN"] = not self.options.with_frozen - self._cmake.definitions["LIEF_C_API"] = self.options.with_c_api - self._cmake.definitions["LIEF_EXAMPLES"] = False - self._cmake.definitions["LIEF_TESTS"] = False - self._cmake.definitions["LIEF_DOC"] = False - self._cmake.definitions["LIEF_LOGGING"] = False - self._cmake.definitions["LIEF_PYTHON_API"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIEF_ART"] = self.options.with_art + tc.variables["LIEF_DEX"] = self.options.with_dex + tc.variables["LIEF_ELF"] = self.options.with_elf + tc.variables["LIEF_OAT"] = self.options.with_oat + tc.variables["LIEF_PE"] = self.options.with_pe + tc.variables["LIEF_VDEX"] = self.options.with_vdex + tc.variables["LIEF_MACHO"] = self.options.with_macho + tc.variables["LIEF_ENABLE_JSON"] = self.options.with_json + tc.variables["LIEF_DISABLE_FROZEN"] = not self.options.with_frozen + tc.variables["LIEF_C_API"] = self.options.with_c_api + tc.variables["LIEF_EXAMPLES"] = False + tc.variables["LIEF_TESTS"] = False + tc.variables["LIEF_DOC"] = False + tc.variables["LIEF_LOGGING"] = False + tc.variables["LIEF_PYTHON_API"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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): - self.cpp_info.names["pkg_config"] = "lief" - self.cpp_info.names["cmake_find_package"] = "LIEF" - self.cpp_info.names["cmake_find_package_multi"] = "LIEF" - self.cpp_info.libs = tools.collect_libs(self) - self.cpp_info.defines = ["_GLIBCXX_USE_CXX11_ABI=1"] + self.cpp_info.libs = ["LIEF"] + + self.cpp_info.set_property("cmake_file_name", "LIEF") + self.cpp_info.set_property("cmake_target_name", "LIEF::LIEF") + self.cpp_info.set_property("pkg_config_name", "LIEF") + if self.options.shared: self.cpp_info.defines.append("LIEF_IMPORT") - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self.cpp_info.cxxflags += ["/FIiso646.h"] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.system_libs = ["ws2_32"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "LIEF" + self.cpp_info.filenames["cmake_find_package_multi"] = "LIEF" + self.cpp_info.names["cmake_find_package"] = "LIEF" + self.cpp_info.names["cmake_find_package_multi"] = "LIEF" + self.cpp_info.names["pkg_config"] = "LIEF" diff --git a/recipes/lief/all/patches/001_link_to_conan.patch b/recipes/lief/all/patches/001_link_to_conan.patch index c70b6f9ecad22..e999cd3dd9317 100644 --- a/recipes/lief/all/patches/001_link_to_conan.patch +++ b/recipes/lief/all/patches/001_link_to_conan.patch @@ -1,6 +1,8 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -5,7 +5,6 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9b168d9..243bbc2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Modules list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") if (WIN32) @@ -8,8 +10,8 @@ endif() include(CheckCXXCompilerFlag) include(CheckCCompilerFlag) -@@ -49,14 +48,14 @@ - +@@ -49,14 +48,14 @@ endif() + # Dependencies # ============ -set(THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/") @@ -19,17 +21,17 @@ + message(STATUS "Enable Frozen (C++14 support)") + set(LIEF_FROZEN_ENABLED 1) +endif() - + # LIEF Source definition # ====================== -set_source_files_properties(${mbedtls_src_crypto} PROPERTIES GENERATED TRUE) -set_source_files_properties(${mbedtls_src_x509} PROPERTIES GENERATED TRUE) -set_source_files_properties(${mbedtls_src_tls} PROPERTIES GENERATED TRUE) - + if (LIEF_LOGGING) set_source_files_properties(${ELG_SOURCE_DIR}/easylogging++.cc PROPERTIES GENERATED TRUE) -@@ -73,9 +72,6 @@ - +@@ -73,9 +72,6 @@ set(LIEF_PRIVATE_INCLUDE_FILES) + set(LIBLIEF_SOURCE_FILES "${ELG_CC_PATH}" - "${mbedtls_src_crypto}" @@ -38,31 +40,31 @@ "${LIBFUZZER_SRC_FILES}" "${CMAKE_CURRENT_SOURCE_DIR}/src/logging.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/exception.cpp" -@@ -126,13 +122,11 @@ +@@ -126,13 +122,11 @@ set(LIEF_INCLUDE_FILES set(LIEF_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/visitors/json.cpp") set(LIEF_JSON_HDR "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/json.hpp" - "${LIBJSON_SOURCE_DIR}/json.hpp" ) - + if (LIEF_ENABLE_JSON) list(APPEND LIBLIEF_SOURCE_FILES "${LIEF_JSON_SRC}") list(APPEND LIEF_INC_FILES "${LIEF_JSON_HDR}") - list(APPEND LIEF_PUBLIC_INCLUDE_DIR "${LIBJSON_SOURCE_DIR}/") endif() - + source_group("Header Files" FILES ${LIEF_INC_FILES}) -@@ -224,9 +218,6 @@ - +@@ -224,9 +218,6 @@ endif() + # Frozen Configuration # ==================== -if (LIEF_FROZEN_ENABLED) - list(APPEND LIEF_PRIVATE_INCLUDE_DIR "${FROZEN_INCLUDE_DIR}") -endif() - + # OAT part # ======== -@@ -292,19 +283,15 @@ +@@ -292,19 +283,15 @@ list(APPEND LIEF_PUBLIC_INCLUDE_DIR list(APPEND LIEF_PRIVATE_INCLUDE_DIR "${LIEF_PUBLIC_INCLUDE_DIR}" "${LIEF_PUBLIC_INCLUDE_DIR}" @@ -73,8 +75,8 @@ "${ELG_SOURCE_DIR}" - "${MBEDTLS_INCLUDE_DIRS}" ) - - + + # Grouping external projects # ========================== -source_group("mbedtls\\crypto" FILES ${mbedtls_src_crypto}) @@ -83,38 +85,42 @@ if (LIEF_LOGGING) source_group("easylogging" FILES ${ELG_SOURCE_DIR}/easylogging++.cc) endif() -@@ -316,7 +303,7 @@ +@@ -316,7 +303,8 @@ target_include_directories(LIB_LIEF PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") - + if (LIEF_ENABLE_JSON) - add_dependencies(LIB_LIEF lief_libjson) -+ target_link_libraries(LIB_LIEF CONAN_PKG::nlohmann_json) ++ find_package(nlohmann_json REQUIRED CONFIG) ++ target_link_libraries(LIB_LIEF nlohmann_json::nlohmann_json) endif() - + if (LIEF_LOGGING) -@@ -324,18 +311,17 @@ +@@ -324,18 +312,20 @@ if (LIEF_LOGGING) endif() - + if (LIEF_FROZEN_ENABLED) - add_dependencies(LIB_LIEF lief_frozen) -+ target_link_libraries(LIB_LIEF CONAN_PKG::frozen) ++ find_package(frozen REQUIRED CONFIG) ++ target_link_libraries(LIB_LIEF frozen::frozen) endif() - + -add_dependencies(LIB_LIEF lief_rang_cpp_color) -+target_link_libraries(LIB_LIEF CONAN_PKG::rang) - ++find_package(rang REQUIRED CONFIG) ++target_link_libraries(LIB_LIEF rang::rang) + -add_dependencies(LIB_LIEF lief_mbed_tls) -+target_link_libraries(LIB_LIEF CONAN_PKG::mbedtls) - ++find_package(MbedTLS REQUIRED CONFIG) ++target_link_libraries(LIB_LIEF MbedTLS::mbedtls) + # Flags definition # ---------------- set_property(TARGET LIB_LIEF PROPERTY CXX_STANDARD 11) set_property(TARGET LIB_LIEF PROPERTY CXX_STANDARD_REQUIRED ON) -set_property(TARGET LIB_LIEF PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET LIB_LIEF PROPERTY CXX_VISIBILITY_PRESET hidden) - + target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1) -@@ -345,11 +331,6 @@ +@@ -345,11 +335,6 @@ target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1) # with the SpcSpAgencyInfo Critical Extension, which mbed TLS doesn't # support, so set MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION to # have it skip this extension. @@ -123,11 +129,11 @@ - -DMBEDTLS_MD4_C - -DMBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION -) - - + + # ASAN - LSAN - TSAN - USAN -@@ -512,16 +493,16 @@ - +@@ -512,16 +497,16 @@ endif() + install(TARGETS LIB_LIEF ARCHIVE - DESTINATION lib @@ -139,7 +145,7 @@ - DESTINATION lib + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries) - + install( DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} - DESTINATION include diff --git a/recipes/lief/all/test_package/CMakeLists.txt b/recipes/lief/all/test_package/CMakeLists.txt index 2c5505ca7220d..6f9bbaa261abb 100644 --- a/recipes/lief/all/test_package/CMakeLists.txt +++ b/recipes/lief/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.0) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(LIEF REQUIRED CONFIG) -add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE LIEF::LIEF) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lief/all/test_package/conanfile.py b/recipes/lief/all/test_package/conanfile.py index f98baa955fbcd..5bef6136fec8e 100644 --- a/recipes/lief/all/test_package/conanfile.py +++ b/recipes/lief/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" + 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,9 +21,9 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") arg_path = bin_path if self.settings.os == "Windows": arg_path += ".exe" - self.run("{0} {1}".format(bin_path, arg_path), run_environment=True) + self.run(f"{bin_path} {arg_path}", env="conanrun") diff --git a/recipes/lief/all/test_v1_package/CMakeLists.txt b/recipes/lief/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7778f7e7ac904 --- /dev/null +++ b/recipes/lief/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(LIEF REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE LIEF::LIEF) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lief/all/test_v1_package/conanfile.py b/recipes/lief/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..326a291210aff --- /dev/null +++ b/recipes/lief/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + arg_path = bin_path + if self.settings.os == "Windows": + arg_path += ".exe" + self.run(f"{bin_path} {arg_path}", run_environment=True) From e18b9c9364e6e1c946bc78f839d5fade6c5c003b Mon Sep 17 00:00:00 2001 From: theirix Date: Wed, 19 Oct 2022 09:05:26 +0300 Subject: [PATCH 501/561] (#13575) Add libde265/1.0.9 recipe * Add libde265 1.0.9 * Drop pylint skip-file exclusion --- recipes/libde265/all/conandata.yml | 5 +++++ recipes/libde265/all/test_v1_package/conanfile.py | 1 - recipes/libde265/config.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/recipes/libde265/all/conandata.yml b/recipes/libde265/all/conandata.yml index ea045a30196d1..47d525a12ed76 100644 --- a/recipes/libde265/all/conandata.yml +++ b/recipes/libde265/all/conandata.yml @@ -1,8 +1,13 @@ sources: + "1.0.9": + url: "https://github.com/strukturag/libde265/archive/v1.0.9.tar.gz" + sha256: "153554f407718a75f1e0ae197d35b43147ce282118a54f894554dbe27c32163d" "1.0.8": url: "https://github.com/strukturag/libde265/archive/v1.0.8.tar.gz" sha256: "c5ab61185f283f46388c700c43dc08606b0e260cd53f06b967ec0ad7a809ff11" patches: + "1.0.9": + - patch_file: "patches/0002-fix-out-of-source-build.patch" "1.0.8": - patch_file: "patches/0001-optional-sdl.patch" - patch_file: "patches/0002-fix-out-of-source-build.patch" diff --git a/recipes/libde265/all/test_v1_package/conanfile.py b/recipes/libde265/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/libde265/all/test_v1_package/conanfile.py +++ b/recipes/libde265/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/libde265/config.yml b/recipes/libde265/config.yml index 28e3ee22ca8ac..1c656ce0b375f 100644 --- a/recipes/libde265/config.yml +++ b/recipes/libde265/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.9": + folder: all "1.0.8": folder: all From aa8b85a6e230b02a6e21a1a523823cde56d716d5 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 19 Oct 2022 02:44:32 -0500 Subject: [PATCH 502/561] (#13488) wayland: Modernize test package * wayland: Modernize test package Update test package for Conan V2. Test wayland as a build requirement. This is a common use case for wayland-scanner. Use PkgConfigDeps build context to find wayland-scanner. * Add check for build profile --- recipes/wayland/all/test_package/conanfile.py | 53 ++++++++++++++----- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/recipes/wayland/all/test_package/conanfile.py b/recipes/wayland/all/test_package/conanfile.py index bcb69ca93c05f..3752c2672501d 100644 --- a/recipes/wayland/all/test_package/conanfile.py +++ b/recipes/wayland/all/test_package/conanfile.py @@ -1,28 +1,55 @@ import os from conan import ConanFile -from conan.tools.build import cross_building -from conan.tools.cmake import CMake -from conan.tools.gnu import PkgConfig +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import PkgConfig, PkgConfigDeps from conan.tools.layout import cmake_layout class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "CMakeToolchain", "CMakeDeps", "PkgConfigDeps", "VirtualRunEnv" + test_type = "explicit" + + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + self.tool_requires("pkgconf/1.9.3") def layout(self): cmake_layout(self) + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + pkg_config_deps = PkgConfigDeps(self) + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + pkg_config_deps.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + def build(self): - if not cross_building(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - pkg_config = PkgConfig(self, "wayland-scanner", self.generators_folder) - self.run('%s --version' % pkg_config.variables["wayland_scanner"], env="conanrun") + cmake = CMake(self) + cmake.configure() + cmake.build() + + if self._has_build_profile: + pkg_config = PkgConfig(self, "wayland-scanner_BUILD", self.generators_folder) + wayland_scanner = pkg_config.variables["wayland_scanner"] + self.run(f"{wayland_scanner} --version", env="conanrun") def test(self): - if not cross_building(self): - cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(cmd, env="conanrun") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") From d30e231d6a57f9b0a463e9bb42f1b071788cd3ed Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:25:30 +0200 Subject: [PATCH 503/561] (#13581) strawberryperl: few improvements * few improvements * cleanup Co-authored-by: Chris Mc * test user.strawberryperl:perl conf Co-authored-by: Chris Mc * self.conf.get instead of self.conf_info.get * more robust conan version check * revert test of user.strawberryperl:perl it's broken in test package before conan 1.53.0 Co-authored-by: Chris Mc --- recipes/strawberryperl/all/conanfile.py | 26 +++++++++---------- .../all/test_package/conanfile.py | 12 +++------ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/recipes/strawberryperl/all/conanfile.py b/recipes/strawberryperl/all/conanfile.py index b665fe8420bef..e5d600869e82f 100644 --- a/recipes/strawberryperl/all/conanfile.py +++ b/recipes/strawberryperl/all/conanfile.py @@ -1,21 +1,19 @@ -import os -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy, rmdir +from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version +import os -from conans import __version__ as conan_version - -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.52.0" class StrawberryPerlConan(ConanFile): name = "strawberryperl" - description = "Strawberry Perl for Windows. Useful as build_require" + description = "Strawberry Perl for Windows." license = ("Artistic-1.0", "GPL-1.0") homepage = "http://strawberryperl.com" url = "https://github.com/conan-io/conan-center-index" - topics = ("installer", "perl", "windows") + topics = ("perl", "interpreter", "windows") settings = "os", "arch", "compiler", "build_type" def layout(self): @@ -29,6 +27,9 @@ def validate(self): if self.info.settings.os != "Windows": raise ConanInvalidConfiguration("Strawberry Perl is only intended to be used on Windows.") + def source(self): + pass + def build(self): get(self, **self.conan_data["sources"][self.version][str(self.settings.arch)], destination=self.build_folder) @@ -43,12 +44,11 @@ def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] + perl_path = os.path.join(self.package_folder, "bin", "perl.exe").replace("\\", "/") + self.conf_info.define("user.strawberryperl:perl", perl_path) + # TODO remove once conan v2 is the only support and recipes have been migrated - if Version(conan_version) < "2.0.0-beta": + if Version(conan_version).major < 2: bin_path = os.path.join(self.package_folder, "bin") self.env_info.PATH.append(bin_path) - - perl_path = os.path.join(self.package_folder, "bin", "perl.exe").replace("\\", "/") - self.conf_info.define("user.strawberryperl:perl", perl_path) - if Version(conan_version) < "2.0.0-beta": self.user_info.perl = perl_path diff --git a/recipes/strawberryperl/all/test_package/conanfile.py b/recipes/strawberryperl/all/test_package/conanfile.py index 85800c3ed5d5a..8cd67438d10ce 100644 --- a/recipes/strawberryperl/all/test_package/conanfile.py +++ b/recipes/strawberryperl/all/test_package/conanfile.py @@ -1,8 +1,5 @@ -import os from conan import ConanFile -from conan.tools.build import can_run -from conan.tools.env import VirtualBuildEnv -from conan.tools.scm import Version +import os class TestPackageConan(ConanFile): @@ -14,7 +11,6 @@ def build_requirements(self): self.tool_requires(self.tested_reference_str) def test(self): - if can_run(self): - self.run("perl --version") - perl_script = os.path.join(self.source_folder, "list_files.pl") - self.run(f"perl {perl_script}", env="conanbuild") + self.run("perl --version") + perl_script = os.path.join(self.source_folder, "list_files.pl") + self.run(f"perl {perl_script}") From ce26ee8d069c0927829c6d96d595521f7c3c6838 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 19 Oct 2022 17:44:34 +0900 Subject: [PATCH 504/561] (#13299) opentelemetry-cpp: add version 1.6.1 and support conan v2 * opentelemetry-cpp: add version 1.6.1 and support conan v2 * use f-string * delete unused module * use check_min_vs --- recipes/opentelemetry-cpp/all/CMakeLists.txt | 7 - recipes/opentelemetry-cpp/all/conandata.yml | 24 ++- recipes/opentelemetry-cpp/all/conanfile.py | 145 +++++++++--------- .../all/patches/1.0.1-0001-fix-cmake.patch | 28 ++++ .../all/patches/1.2.0-0001-fix-cmake.patch | 15 ++ .../all/patches/1.3.0-0001-fix-cmake.patch | 23 ++- .../all/patches/1.4.0-0001-fix-cmake.patch | 15 ++ .../all/patches/1.6.1-0001-fix-cmake.patch | 27 ++++ .../all/test_package/CMakeLists.txt | 8 +- .../all/test_package/conanfile.py | 22 ++- .../all/test_v1_package/CMakeLists.txt | 12 ++ .../all/test_v1_package/conanfile.py | 18 +++ recipes/opentelemetry-cpp/config.yml | 2 + 13 files changed, 248 insertions(+), 98 deletions(-) delete mode 100644 recipes/opentelemetry-cpp/all/CMakeLists.txt create mode 100644 recipes/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch create mode 100644 recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opentelemetry-cpp/all/test_v1_package/conanfile.py diff --git a/recipes/opentelemetry-cpp/all/CMakeLists.txt b/recipes/opentelemetry-cpp/all/CMakeLists.txt deleted file mode 100644 index c921d02a0d877..0000000000000 --- a/recipes/opentelemetry-cpp/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/opentelemetry-cpp/all/conandata.yml b/recipes/opentelemetry-cpp/all/conandata.yml index d77f0da9d79fd..ff38a16b0e5fe 100644 --- a/recipes/opentelemetry-cpp/all/conandata.yml +++ b/recipes/opentelemetry-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.1": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.6.1.tar.gz" + sha256: "1fc371be049b3220b8b9571c8b713f03e9a84f3c5684363f64ccc814638391a5" "1.4.1": url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.4.1.tar.gz" sha256: "301b1ab74a664723560f46c29f228360aff1e2d63e930b963755ea077ae67524" @@ -16,12 +19,27 @@ sources: sha256: "32f12ff15ec257e3462883f84bc291c2d5dc30055604c12ec4b46a36dfa3f189" patches: + "1.6.1": + - patch_file: "patches/1.6.1-0001-fix-cmake.patch" + patch_description: "fix lack of linking libraries" + patch_type: "backport" "1.4.1": - patch_file: "patches/1.4.0-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "fix lack of linking libraries" + patch_type: "backport" "1.4.0": - patch_file: "patches/1.4.0-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "fix lack of linking libraries" + patch_type: "backport" "1.3.0": - patch_file: "patches/1.3.0-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "fix lack of linking libraries" + patch_type: "backport" + "1.2.0": + - patch_file: "patches/1.2.0-0001-fix-cmake.patch" + patch_description: "fix lack of linking libraries" + patch_type: "backport" + "1.0.1": + - patch_file: "patches/1.0.1-0001-fix-cmake.patch" + patch_description: "fix lack of linking libraries" + patch_type: "backport" diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index 432efd2d1ecde..47723bf6d9c50 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -1,12 +1,15 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, save +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.microsoft import check_min_vs + import os import textwrap -import functools -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration - - -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class OpenTelemetryCppConan(ConanFile): name = "opentelemetry-cpp" @@ -24,13 +27,14 @@ class OpenTelemetryCppConan(ConanFile): "fPIC": True, "shared": False, } - generators = "cmake", "cmake_find_package_multi" short_paths = True + @property + def _minimum_cpp_standard(self): + return 11 + def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -38,33 +42,41 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("abseil/20211102.0") - self.requires("grpc/1.45.2") - self.requires("libcurl/7.83.1") - self.requires("nlohmann_json/3.10.5") - self.requires("openssl/1.1.1o") - self.requires("opentelemetry-proto/0.18.0") - self.requires("protobuf/3.21.1") - self.requires("thrift/0.15.0") - if tools.Version(self.version) >= "1.3.0": - self.requires("boost/1.79.0") + self.requires("abseil/20220623.0") + self.requires("grpc/1.48.0") + self.requires("libcurl/7.85.0") + self.requires("nlohmann_json/3.11.2") + self.requires("openssl/1.1.1q") + if Version(self.version) <= "1.4.1": + self.requires("opentelemetry-proto/0.11.0") + else: + self.requires("opentelemetry-proto/0.19.0") + self.requires("protobuf/3.21.4") + self.requires("thrift/0.17.0") + if Version(self.version) >= "1.3.0": + self.requires("boost/1.80.0") def validate(self): - if self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("Architecture not supported") + if self.info.settings.arch != "x86_64": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support architecture : {self.info.settings.arch}") - if (self.settings.compiler == "Visual Studio" and - tools.Version(self.settings.compiler.version) < "16"): - raise ConanInvalidConfiguration("Visual Studio 2019 or higher required") + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + check_min_vs(self, "192") if self.settings.os != "Linux" and self.options.shared: - raise ConanInvalidConfiguration("Building shared libraries is only supported on Linux") + raise ConanInvalidConfiguration(f"{self.ref} supports building shared libraries only on Linux") - @staticmethod - def _create_cmake_module_variables(module_file): + def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ set(OPENTELEMETRY_CPP_INCLUDE_DIRS ${opentelemetry-cpp_INCLUDE_DIRS} ${opentelemetry-cpp_INCLUDE_DIRS_RELEASE} @@ -73,79 +85,68 @@ def _create_cmake_module_variables(module_file): ${opentelemetry-cpp_INCLUDE_DIRS_DEBUG}) set(OPENTELEMETRY_CPP_LIBRARIES opentelemetry-cpp::opentelemetry-cpp) """) - tools.save(module_file, content) - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + save(self, module_file, content) def source(self): - tools.get( - **self.conan_data["sources"][self.version], - destination=self._source_subfolder, - strip_root=True) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - defs = { - "BUILD_TESTING": False, - "WITH_ABSEIL": True, - "WITH_ETW": True, - "WITH_EXAMPLES": False, - "WITH_JAEGER": True, - "WITH_OTLP": True, - "WITH_ZIPKIN": True, - } - cmake.configure(defs=defs, build_folder=self._build_subfolder) - return cmake + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["WITH_ABSEIL"] = True + tc.variables["WITH_ETW"] = True + tc.variables["WITH_EXAMPLES"] = False + tc.variables["WITH_JAEGER"] = True + tc.variables["WITH_OTLP"] = True + tc.variables["WITH_ZIPKIN"] = True + tc.generate() + + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): protos_path = self.deps_user_info["opentelemetry-proto"].proto_root.replace("\\", "/") protos_cmake_path = os.path.join( - self._source_subfolder, + self.source_folder, "cmake", "opentelemetry-proto.cmake") - if tools.Version(self.version) >= "1.1.0": - tools.replace_in_file( + if Version(self.version) >= "1.1.0": + replace_in_file(self, protos_cmake_path, "if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto/.git)", "if(1)") - tools.replace_in_file( + replace_in_file(self, protos_cmake_path, "set(PROTO_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-proto\")", f"set(PROTO_PATH \"{protos_path}\")") - tools.rmdir(os.path.join(self._source_subfolder, "api", "include", "opentelemetry", "nostd", "absl")) + rmdir(self, os.path.join(self.source_folder, "api", "include", "opentelemetry", "nostd", "absl")) - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) def build(self): self._patch_sources() - cmake = self._configure_cmake() + 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, pattern="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, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) self._create_cmake_module_variables( os.path.join(self.package_folder, self._otel_cmake_variables_path) ) @property def _module_subfolder(self): - return os.path.join("lib", "cmake") + return os.path.join(self.package_folder, "lib", "cmake") @property def _otel_cmake_variables_path(self): return os.path.join(self._module_subfolder, - "conan-official-{}-variables.cmake".format(self.name)) + f"conan-official-{self.name}-variables.cmake") @property def _otel_build_modules(self): @@ -153,7 +154,7 @@ def _otel_build_modules(self): @property def _http_client_name(self): - return "http_client_curl" if tools.Version(self.version) < "1.3.0" else "opentelemetry_http_client_curl" + return "http_client_curl" if Version(self.version) < "1.3.0" else "opentelemetry_http_client_curl" @property def _otel_libraries(self): @@ -206,7 +207,7 @@ def package_info(self): "opentelemetry_resources", "thrift::thrift", ]) - if tools.Version(self.version) >= "1.3.0": + if Version(self.version) >= "1.3.0": self.cpp_info.components["opentelemetry_exporter_jaeger_trace"].requires.extend([ "boost::locale", ]) diff --git a/recipes/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..ecdbb0cf0f9fc --- /dev/null +++ b/recipes/opentelemetry-cpp/all/patches/1.0.1-0001-fix-cmake.patch @@ -0,0 +1,28 @@ +diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake +index 9fb6f49..1f1547e 100644 +--- a/cmake/opentelemetry-proto.cmake ++++ b/cmake/opentelemetry-proto.cmake +@@ -162,6 +162,10 @@ else() # cmake 3.8 or lower + target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) + endif() + ++if(TARGET gRPC::grpc++) ++ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) ++endif() ++ + if(BUILD_SHARED_LIBS) + set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) + endif() +diff --git a/exporters/zipkin/CMakeLists.txt b/exporters/zipkin/CMakeLists.txt +index 2316860..8995b31 100644 +--- a/exporters/zipkin/CMakeLists.txt ++++ b/exporters/zipkin/CMakeLists.txt +@@ -21,7 +21,7 @@ add_library(opentelemetry_exporter_zipkin_trace src/zipkin_exporter.cc + src/recordable.cc) + + target_link_libraries(opentelemetry_exporter_zipkin_trace +- PUBLIC opentelemetry_trace http_client_curl) ++ PUBLIC opentelemetry_trace http_client_curl nlohmann_json::nlohmann_json) + + install( + TARGETS opentelemetry_exporter_zipkin_trace diff --git a/recipes/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..275e2c9b44a66 --- /dev/null +++ b/recipes/opentelemetry-cpp/all/patches/1.2.0-0001-fix-cmake.patch @@ -0,0 +1,15 @@ +diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake +index 8d8f868..2a78f98 100644 +--- a/cmake/opentelemetry-proto.cmake ++++ b/cmake/opentelemetry-proto.cmake +@@ -214,6 +214,10 @@ else() + ${METRICS_SERVICE_PB_CPP_FILE}) + endif() + ++if(TARGET gRPC::grpc++) ++ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) ++endif() ++ + if(needs_proto_download) + add_dependencies(opentelemetry_proto opentelemetry-proto) + endif() diff --git a/recipes/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch index cca97cf74351f..ce868fbedca22 100644 --- a/recipes/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch +++ b/recipes/opentelemetry-cpp/all/patches/1.3.0-0001-fix-cmake.patch @@ -1,7 +1,7 @@ -diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt -index 09c21fd..a8d7d16 100644 ---- a/a/CMakeLists.txt -+++ b/b/CMakeLists.txt +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 09c21fd..a8d7d16 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt @@ -203,7 +203,6 @@ if(WITH_JAEGER) find_package(Thrift QUIET) if(Thrift_FOUND) @@ -10,3 +10,18 @@ index 09c21fd..a8d7d16 100644 else() # Install Thrift and propagate via vcpkg toolchain file if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) +diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake +index 8d8f868..2a78f98 100644 +--- a/cmake/opentelemetry-proto.cmake ++++ b/cmake/opentelemetry-proto.cmake +@@ -214,6 +214,10 @@ else() + ${METRICS_SERVICE_PB_CPP_FILE}) + endif() + ++if(TARGET gRPC::grpc++) ++ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) ++endif() ++ + if(needs_proto_download) + add_dependencies(opentelemetry_proto opentelemetry-proto) + endif() diff --git a/recipes/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch index de56d2c7118c6..1fcf5a0427738 100644 --- a/recipes/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch +++ b/recipes/opentelemetry-cpp/all/patches/1.4.0-0001-fix-cmake.patch @@ -10,3 +10,18 @@ index 6d2b274..4611a6b 100755 else() # Install Thrift and propagate via vcpkg toolchain file if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) +diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake +index 37d45da..89395c0 100644 +--- a/cmake/opentelemetry-proto.cmake ++++ b/cmake/opentelemetry-proto.cmake +@@ -215,6 +215,10 @@ else() + ${METRICS_SERVICE_PB_CPP_FILE}) + endif() + ++if(TARGET gRPC::grpc++) ++ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) ++endif() ++ + if(needs_proto_download) + add_dependencies(opentelemetry_proto opentelemetry-proto) + endif() diff --git a/recipes/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..b3391855652c4 --- /dev/null +++ b/recipes/opentelemetry-cpp/all/patches/1.6.1-0001-fix-cmake.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a1b6934..d4f5251 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -209,7 +209,6 @@ if(WITH_JAEGER) + find_package(Thrift QUIET) + if(Thrift_FOUND) + find_package(Boost REQUIRED) +- include_directories(${Boost_INCLUDE_DIR}) + else() + # Install Thrift and propagate via vcpkg toolchain file + if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE)) +diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake +index 629ea81..3b09b92 100644 +--- a/cmake/opentelemetry-proto.cmake ++++ b/cmake/opentelemetry-proto.cmake +@@ -242,6 +242,10 @@ else() # cmake 3.8 or lower + target_link_libraries(opentelemetry_proto INTERFACE ${Protobuf_LIBRARIES}) + endif() + ++if(TARGET gRPC::grpc++) ++ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) ++endif() ++ + if(BUILD_SHARED_LIBS) + set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON) + endif() diff --git a/recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt b/recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt index 85330da09a2aa..53dd5c5a1c6f7 100644 --- a/recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt +++ b/recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt @@ -1,13 +1,9 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(opentelemetry-cpp REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) -target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${OPENTELEMETRY_CPP_INCLUDE_DIRS}) -target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ${OPENTELEMETRY_CPP_LIBRARIES}) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE opentelemetry-cpp::opentelemetry-cpp) target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/opentelemetry-cpp/all/test_package/conanfile.py b/recipes/opentelemetry-cpp/all/test_package/conanfile.py index 1bf1c7e26255d..a9fb96656f203 100644 --- a/recipes/opentelemetry-cpp/all/test_package/conanfile.py +++ b/recipes/opentelemetry-cpp/all/test_package/conanfile.py @@ -1,9 +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) @@ -11,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt b/recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..432e5d7c64ed4 --- /dev/null +++ b/recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(opentelemetry-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE opentelemetry-cpp::opentelemetry-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/opentelemetry-cpp/all/test_v1_package/conanfile.py b/recipes/opentelemetry-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/opentelemetry-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/opentelemetry-cpp/config.yml b/recipes/opentelemetry-cpp/config.yml index 8a2917f453076..d9469bdd59f64 100644 --- a/recipes/opentelemetry-cpp/config.yml +++ b/recipes/opentelemetry-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.1": + folder: all "1.4.1": folder: all "1.4.0": From 64298d88fc26d2aadcf287f243721898d4debc87 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 19 Oct 2022 04:45:00 -0500 Subject: [PATCH 505/561] (#13487) wayland-protocols: Conan V2 * wayland-protocols: Conan V2 Update for Conan V2. Use build context for PkgConfigDeps in test package. * Update Meson * Add check for build profile --- recipes/wayland-protocols/all/conanfile.py | 71 ++++++++----------- .../all/test_package/conanfile.py | 48 +++++++++---- .../all/test_package/meson.build | 12 +++- .../all/test_package/meson_options.txt | 1 + .../all/test_v1_package/conanfile.py | 27 +++++++ .../all/test_v1_package/meson.build | 30 ++++++++ 6 files changed, 134 insertions(+), 55 deletions(-) create mode 100644 recipes/wayland-protocols/all/test_package/meson_options.txt create mode 100644 recipes/wayland-protocols/all/test_v1_package/conanfile.py create mode 100644 recipes/wayland-protocols/all/test_v1_package/meson.build diff --git a/recipes/wayland-protocols/all/conanfile.py b/recipes/wayland-protocols/all/conanfile.py index ccf5e12a5f5b4..9d4353094f019 100644 --- a/recipes/wayland-protocols/all/conanfile.py +++ b/recipes/wayland-protocols/all/conanfile.py @@ -1,9 +1,13 @@ from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -from conans import Meson, tools import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.50.0" class WaylandProtocolsConan(ConanFile): @@ -13,64 +17,51 @@ class WaylandProtocolsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.freedesktop.org/wayland/wayland-protocols" license = "MIT" - settings = "os", "arch", "compiler", "build_type" - _meson = None - def package_id(self): - self.info.header_only() - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + self.info.clear() def validate(self): if self.settings.os != "Linux": - raise ConanInvalidConfiguration("Wayland-protocols can be built on Linux only") + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): - self.build_requires("meson/0.63.0") + self.tool_requires("meson/0.63.3") + + def layout(self): + basic_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["datadir"] = os.path.join(self.package_folder, "res") + tc.project_options["tests"] = "false" + tc.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() def _patch_sources(self): - if tools.Version(self.version) <= 1.23: + if Version(self.version) <= "1.23": # fixed upstream in https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/113 - tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"), - "dep_scanner = dependency('wayland-scanner', native: true)", - "#dep_scanner = dependency('wayland-scanner', native: true)") - - def _configure_meson(self): - if not self._meson: - defs = { - "tests": "false", - } - self._meson = Meson(self) - self._meson.configure( - source_folder=self._source_subfolder, - build_folder=self._build_subfolder, - defs=defs, - args=[f'--datadir={self.package_folder}/res'], - ) - return self._meson + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "dep_scanner = dependency('wayland-scanner', native: true)", + "#dep_scanner = dependency('wayland-scanner', native: true)") def build(self): self._patch_sources() - meson = self._configure_meson() + meson = Meson(self) + meson.configure() meson.build() def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - meson = self._configure_meson() + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) meson.install() - tools.rmdir(os.path.join(self.package_folder, "res", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "res", "pkgconfig")) def package_info(self): pkgconfig_variables = { diff --git a/recipes/wayland-protocols/all/test_package/conanfile.py b/recipes/wayland-protocols/all/test_package/conanfile.py index 88f036db9bd02..1dc365f849fd5 100644 --- a/recipes/wayland-protocols/all/test_package/conanfile.py +++ b/recipes/wayland-protocols/all/test_package/conanfile.py @@ -1,27 +1,51 @@ -from conans import Meson, tools from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "pkg_config" + test_type = "explicit" - def build_requirements(self): - self.build_requires("wayland/1.21.0") - self.build_requires("meson/0.63.0") + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") def requirements(self): + self.requires(self.tested_reference_str) self.requires("wayland/1.21.0") + def build_requirements(self): + self.tool_requires("meson/0.63.3") + self.tool_requires("pkgconf/1.9.3") + self.tool_requires("wayland/1.21.0") + + def layout(self): + basic_layout(self) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.project_options["has_build_profile"] = self._has_build_profile + tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + pkg_config_deps.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + def build(self): meson = Meson(self) - env_build = tools.RunEnvironment(self) - with tools.environment_append(env_build.vars): - meson.configure() - meson.build() + meson.configure() + meson.build() def test(self): - if not cross_building(self): - self.run(os.path.join(".", "test_package"), run_environment=True) + if can_run(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/wayland-protocols/all/test_package/meson.build b/recipes/wayland-protocols/all/test_package/meson.build index fb3bbdfc77566..a79bb8c0c5c35 100644 --- a/recipes/wayland-protocols/all/test_package/meson.build +++ b/recipes/wayland-protocols/all/test_package/meson.build @@ -4,14 +4,20 @@ wayland_client_dep = dependency('wayland-client', version: '>=1.2.0', required: wayland_protocols_dep = dependency('wayland-protocols', required: true) wayland_protocols_datadir = wayland_protocols_dep.get_pkgconfig_variable('pkgdatadir') -wayland_scanner = find_program('wayland-scanner') +if get_option('has_build_profile') + wayland_scanner_dep = dependency('wayland-scanner_BUILD', native: true) + wayland_scanner_for_build = find_program(wayland_scanner_dep.get_variable(pkgconfig: 'wayland_scanner')) +else + wayland_scanner_for_build = find_program('wayland-scanner') +endif + wayland_scanner_code_gen = generator( - wayland_scanner, + wayland_scanner_for_build, output: '@BASENAME@-protocol.c', arguments: ['code', '@INPUT@', '@OUTPUT@'], ) wayland_scanner_client_header_gen = generator( - wayland_scanner, + wayland_scanner_for_build, output: '@BASENAME@-client-protocol.h', arguments: ['client-header', '@INPUT@', '@OUTPUT@'], ) diff --git a/recipes/wayland-protocols/all/test_package/meson_options.txt b/recipes/wayland-protocols/all/test_package/meson_options.txt new file mode 100644 index 0000000000000..15a4dceff2c0d --- /dev/null +++ b/recipes/wayland-protocols/all/test_package/meson_options.txt @@ -0,0 +1 @@ +option('has_build_profile', type : 'boolean', value : false) diff --git a/recipes/wayland-protocols/all/test_v1_package/conanfile.py b/recipes/wayland-protocols/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..58abdcba1c74d --- /dev/null +++ b/recipes/wayland-protocols/all/test_v1_package/conanfile.py @@ -0,0 +1,27 @@ +from conans import Meson, tools +from conan import ConanFile +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "pkg_config" + + def build_requirements(self): + self.build_requires("wayland/1.21.0") + self.build_requires("meson/0.63.3") + + def requirements(self): + self.requires("wayland/1.21.0") + + def build(self): + meson = Meson(self) + env_build = tools.RunEnvironment(self) + with tools.environment_append(env_build.vars): + meson.configure() + meson.build() + + def test(self): + if not cross_building(self): + self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/wayland-protocols/all/test_v1_package/meson.build b/recipes/wayland-protocols/all/test_v1_package/meson.build new file mode 100644 index 0000000000000..d1776cc1915fd --- /dev/null +++ b/recipes/wayland-protocols/all/test_v1_package/meson.build @@ -0,0 +1,30 @@ +project('test_wayland_protocols', 'c') + +wayland_client_dep = dependency('wayland-client', version: '>=1.2.0', required: true) +wayland_protocols_dep = dependency('wayland-protocols', required: true) +wayland_protocols_datadir = wayland_protocols_dep.get_pkgconfig_variable('pkgdatadir') + +wayland_scanner = find_program('wayland-scanner') +wayland_scanner_code_gen = generator( + wayland_scanner, + output: '@BASENAME@-protocol.c', + arguments: ['code', '@INPUT@', '@OUTPUT@'], +) +wayland_scanner_client_header_gen = generator( + wayland_scanner, + output: '@BASENAME@-client-protocol.h', + arguments: ['client-header', '@INPUT@', '@OUTPUT@'], +) + +xdg_shell_xml = wayland_protocols_datadir/'stable/xdg-shell/xdg-shell.xml' + +xdg_shell_sources = [ + wayland_scanner_code_gen.process(xdg_shell_xml), + wayland_scanner_client_header_gen.process(xdg_shell_xml), +] + +executable('test_package', + '../test_package/test_package.c', + xdg_shell_sources, + dependencies: [wayland_client_dep], + link_args : '-lrt') From ca6b7e7030c4daae77efddb1ad09eb383e1788cc Mon Sep 17 00:00:00 2001 From: sujankota Date: Wed, 19 Oct 2022 08:04:09 -0400 Subject: [PATCH 506/561] (#13598) opentdf-client: add version 1.3.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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/opentdf-client/all/conandata.yml | 3 +++ recipes/opentdf-client/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/opentdf-client/all/conandata.yml b/recipes/opentdf-client/all/conandata.yml index 0cad19d535f11..9fede5e2ebc2d 100644 --- a/recipes/opentdf-client/all/conandata.yml +++ b/recipes/opentdf-client/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.2": + url: "https://github.com/opentdf/client-cpp/archive/1.3.2.tar.gz" + sha256: "d9a38d3aa6114159c90e0c254c78ddda921e2d520851e4def57f3cd26c564b16" "1.2.0": url: "https://github.com/opentdf/client-cpp/archive/1.2.0.tar.gz" sha256: "15828038809ed291ff7881206a675abc5162e1175c8b515363b9c584aebb08f7" diff --git a/recipes/opentdf-client/config.yml b/recipes/opentdf-client/config.yml index a4bdd24b34b43..37ebecaa11ef6 100644 --- a/recipes/opentdf-client/config.yml +++ b/recipes/opentdf-client/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.2": + folder: all "1.2.0": folder: all "1.1.6": From 5253b77d58deb856ec92ad01bf84fb682035d170 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:05:02 +0200 Subject: [PATCH 507/561] (#13597) zlib: fix lib name on windows for other compilers than msvc/clang-cl/mingw * fix lib name on windows if not cl like or mingw * modernize a little bit more --- recipes/zlib/all/conanfile.py | 27 ++++++++++--------- .../all/patches/1.2.13/0001-Fix-cmake.patch | 2 +- .../all/patches/1.2.x/0001-fix-cmake.patch | 2 +- recipes/zlib/all/test_package/conanfile.py | 7 ++--- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/recipes/zlib/all/conanfile.py b/recipes/zlib/all/conanfile.py index 74c193ad9cba7..9ae111c632353 100644 --- a/recipes/zlib/all/conanfile.py +++ b/recipes/zlib/all/conanfile.py @@ -1,11 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, load, replace_in_file, save -from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, load, replace_in_file, save from conan.tools.scm import Version import os -required_conan_version = ">=1.49.0" +required_conan_version = ">=1.52.0" class ZlibConan(ConanFile): @@ -28,12 +27,11 @@ class ZlibConan(ConanFile): } @property - def _is_clang_cl(self): - return self.settings.os == "Windows" and self.settings.compiler == "clang" + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -41,15 +39,18 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: - del self.settings.compiler.libcxx + del self.settings.compiler.libcxx except Exception: - pass + pass try: - del self.settings.compiler.cppstd + del self.settings.compiler.cppstd except Exception: - pass + pass def layout(self): cmake_layout(self, src_folder="src") @@ -103,7 +104,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "ZLIB") self.cpp_info.set_property("cmake_target_name", "ZLIB::ZLIB") self.cpp_info.set_property("pkg_config_name", "zlib") - if is_msvc(self) or self._is_clang_cl: + if self.settings.os == "Windows" and not self._is_mingw: libname = "zdll" if self.options.shared else "zlib" else: libname = "z" diff --git a/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch b/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch index ede4babb2e94c..a0748ec590d90 100644 --- a/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch +++ b/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch @@ -75,7 +75,7 @@ index b412dc7..a5284ed 100644 endif() -if(UNIX) -+if(MSVC) ++if(WIN32 AND NOT MINGW) + if(BUILD_SHARED_LIBS) + set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) + endif() diff --git a/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch b/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch index 9a3627d41b04c..f99f0b5219682 100644 --- a/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch +++ b/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch @@ -64,7 +64,7 @@ endif() -if(UNIX) -+if(MSVC) ++if(WIN32 AND NOT MINGW) + if(BUILD_SHARED_LIBS) + set_target_properties(zlib PROPERTIES ARCHIVE_OUTPUT_NAME zdll) + endif() diff --git a/recipes/zlib/all/test_package/conanfile.py b/recipes/zlib/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/zlib/all/test_package/conanfile.py +++ b/recipes/zlib/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() From 5c33ec9fe0f9beb29bd372dd7517e7c35db03257 Mon Sep 17 00:00:00 2001 From: tuduongquyet <78657396+tuduongquyet@users.noreply.github.com> Date: Wed, 19 Oct 2022 22:44:39 +0700 Subject: [PATCH 508/561] (#11877) add marisa/0.2.6 recipe * add marisa recipe * fix patch * add le * add le * remove pc file * Update recipes/marisa/all/conanfile.py Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/marisa/all/CMakeLists.txt | 7 + recipes/marisa/all/conandata.yml | 8 ++ recipes/marisa/all/conanfile.py | 87 +++++++++++++ .../marisa/all/patches/0001-add-cmake.patch | 120 ++++++++++++++++++ .../marisa/all/test_package/CMakeLists.txt | 10 ++ recipes/marisa/all/test_package/conanfile.py | 18 +++ .../marisa/all/test_package/test_package.cpp | 12 ++ recipes/marisa/config.yml | 3 + 8 files changed, 265 insertions(+) create mode 100644 recipes/marisa/all/CMakeLists.txt create mode 100644 recipes/marisa/all/conandata.yml create mode 100644 recipes/marisa/all/conanfile.py create mode 100644 recipes/marisa/all/patches/0001-add-cmake.patch create mode 100644 recipes/marisa/all/test_package/CMakeLists.txt create mode 100644 recipes/marisa/all/test_package/conanfile.py create mode 100644 recipes/marisa/all/test_package/test_package.cpp create mode 100644 recipes/marisa/config.yml diff --git a/recipes/marisa/all/CMakeLists.txt b/recipes/marisa/all/CMakeLists.txt new file mode 100644 index 0000000000000..84887fbda2ddf --- /dev/null +++ b/recipes/marisa/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(KEEP_RPATHS) + +add_subdirectory(source_subfolder) diff --git a/recipes/marisa/all/conandata.yml b/recipes/marisa/all/conandata.yml new file mode 100644 index 0000000000000..087e45138b499 --- /dev/null +++ b/recipes/marisa/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.2.6": + url: "https://github.com/s-yata/marisa-trie/archive/refs/tags/v0.2.6.tar.gz" + sha256: "1063a27c789e75afa2ee6f1716cc6a5486631dcfcb7f4d56d6485d2462e566de" +patches: + "0.2.6": + - patch_file: "patches/0001-add-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/marisa/all/conanfile.py b/recipes/marisa/all/conanfile.py new file mode 100644 index 0000000000000..13b534d613bd9 --- /dev/null +++ b/recipes/marisa/all/conanfile.py @@ -0,0 +1,87 @@ +import os +from conan import ConanFile, tools +from conan.tools.files import apply_conandata_patches +from conans import CMake + +required_conan_version = ">=1.45.0" + + +class MarisaConan(ConanFile): + name = "marisa" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/s-yata/marisa-trie" + description = "Matching Algorithm with Recursively Implemented StorAge " + license = ("BSD-2-Clause", "LGPL-2.1") + topics = ("algorithm", "dictionary", "marisa") + exports_sources = "patches/**", "CMakeLists.txt" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tools": True, + } + + generators = "cmake" + _cmake = None + + @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 + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.files.get(**self.conan_data["sources"][self.version], + conanfile=self, destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + + self._cmake.definitions["BUILD_TOOLS"] = self.options.tools + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + apply_conandata_patches(self) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="COPYING.md", dst="licenses", + src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.files.rmdir(self, os.path.join( + self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "marisa" + self.cpp_info.names["cmake_find_package_multi"] = "marisa" + self.cpp_info.names["pkgconfig"] = "marisa" + self.cpp_info.libs = ["marisa"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH env var with : '{bin_path}'") + self.env_info.PATH.append(bin_path) diff --git a/recipes/marisa/all/patches/0001-add-cmake.patch b/recipes/marisa/all/patches/0001-add-cmake.patch new file mode 100644 index 0000000000000..4635c52208c27 --- /dev/null +++ b/recipes/marisa/all/patches/0001-add-cmake.patch @@ -0,0 +1,120 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..c7e4c0e +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,114 @@ ++cmake_minimum_required(VERSION 3.1) ++project(marisa CXX) ++ ++include(GNUInstallDirs) ++ ++option(BUILD_SHARED_LIBS "Build as shared library" OFF) ++option(BUILD_TOOLS "Build tools" ON) ++option(ENABLE_TESTS "Build and run tests" ON) ++ ++if(BUILD_SHARED_LIBS) ++ set(MARISA_LIBRARY_TYPE SHARED) ++else() ++ set(MARISA_LIBRARY_TYPE STATIC) ++endif(BUILD_SHARED_LIBS) ++ ++set(CMAKE_CXX_STANDARD 11) ++ ++if(NOT CMAKE_BUILD_TYPE) ++ set(CMAKE_BUILD_TYPE Debug) ++endif() ++ ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") ++ ++if(NOT MSVC) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++ -Wextra -Wconversion") ++endif() ++ ++if(BUILD_SHARED_LIBS AND MSVC) ++ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++endif() ++ ++include_directories("${PROJECT_SOURCE_DIR}/include") ++include_directories("${PROJECT_SOURCE_DIR}/lib") ++ ++set(HDR_COMPAT ++ include/marisa.h) ++ ++set(HDR_PUBLIC ++ include/marisa/agent.h ++ include/marisa/base.h ++ include/marisa/exception.h ++ include/marisa/iostream.h ++ include/marisa/key.h ++ include/marisa/keyset.h ++ include/marisa/query.h ++ include/marisa/scoped-array.h ++ include/marisa/scoped-ptr.h ++ include/marisa/stdio.h ++ include/marisa/trie.h) ++add_library(marisa ${MARISA_LIBRARY_TYPE} ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/mapper.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/reader.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/io/writer.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/trie/tail.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/trie/louds-trie.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/grimoire/vector/bit-vector.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/keyset.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/trie.cc" ++ "${PROJECT_SOURCE_DIR}/lib/marisa/agent.cc") ++ ++install(TARGETS marisa ++ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++if(BUILD_TOOLS) ++ add_library(cmdopt OBJECT "${PROJECT_SOURCE_DIR}/tools/cmdopt.cc") ++ set(TOOLS ++ marisa-benchmark ++ marisa-build ++ marisa-common-prefix-search ++ marisa-dump ++ marisa-lookup ++ marisa-predictive-search ++ marisa-reverse-lookup ++ ) ++ ++ foreach(TOOL ${TOOLS}) ++ add_executable(${TOOL} "${PROJECT_SOURCE_DIR}/tools/${TOOL}.cc") ++ target_link_libraries(${TOOL} PRIVATE marisa cmdopt) ++ install(TARGETS ${TOOL} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) ++ endforeach(TOOL) ++endif() ++ ++if(ENABLE_TESTS) ++ enable_testing() ++ set(TESTS ++ base-test ++ io-test ++ trie-test ++ vector-test ++ marisa-test ++ ) ++ ++ foreach(TEST ${TESTS}) ++ add_executable(${TEST} "${PROJECT_SOURCE_DIR}/tests/${TEST}.cc") ++ target_link_libraries(${TEST} PRIVATE marisa) ++ add_test(${TEST} ${TEST}) ++ endforeach(TEST) ++endif() ++ ++configure_file( ++ ${PROJECT_SOURCE_DIR}/marisa.pc.in ++ ${PROJECT_BINARY_DIR}/marisa.pc ++ @ONLY) ++install(FILES ${PROJECT_BINARY_DIR}/marisa.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ ++install(FILES ${HDR_COMPAT} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ ++install(FILES ${HDR_PUBLIC} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/marisa) diff --git a/recipes/marisa/all/test_package/CMakeLists.txt b/recipes/marisa/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9bae1c0958b76 --- /dev/null +++ b/recipes/marisa/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(marisa REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} marisa::marisa) diff --git a/recipes/marisa/all/test_package/conanfile.py b/recipes/marisa/all/test_package/conanfile.py new file mode 100644 index 0000000000000..251bf8ae3e3dd --- /dev/null +++ b/recipes/marisa/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os +from conans import CMake, ConanFile, tools +from conan.tools.build import cross_building + + +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 cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/marisa/all/test_package/test_package.cpp b/recipes/marisa/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ba90951dd5e1b --- /dev/null +++ b/recipes/marisa/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "marisa.h" + + +int main() { + int x = 100; + int y = 200; + + marisa::swap(x, y); + + return EXIT_SUCCESS; +} diff --git a/recipes/marisa/config.yml b/recipes/marisa/config.yml new file mode 100644 index 0000000000000..070a32463b25e --- /dev/null +++ b/recipes/marisa/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.6": + folder: all From ba368057edf9a82b3d1a136bccbea560fca5a010 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 20 Oct 2022 01:06:20 +0900 Subject: [PATCH 509/561] (#13196) usockets: add version 0.8.2 and support conan v2 * usockets: add version 0.8.2 and support conan v2 * fix import error * fix msbuild error * use require when eventloop == boost * revert conanfile.py * fix ConanInvalidConfiguration path * remove lto * apply msvc patch in 0.8.2 * apply reviews * fix for conan v2 linter * fix cross_building condition --- recipes/usockets/all/conandata.yml | 62 +++++--- recipes/usockets/all/conanfile.py | 133 +++++++++--------- .../all/patches/0001-makefile_0.8.2.patch | 39 +++++ .../usockets/all/test_package/CMakeLists.txt | 11 +- .../usockets/all/test_package/conanfile.py | 10 +- recipes/usockets/config.yml | 8 +- 6 files changed, 168 insertions(+), 95 deletions(-) create mode 100644 recipes/usockets/all/patches/0001-makefile_0.8.2.patch diff --git a/recipes/usockets/all/conandata.yml b/recipes/usockets/all/conandata.yml index 6134ecad920ae..c851ea9d76dea 100644 --- a/recipes/usockets/all/conandata.yml +++ b/recipes/usockets/all/conandata.yml @@ -1,34 +1,62 @@ sources: - "0.4.0": - url: "https://github.com/uNetworking/uSockets/archive/v0.4.0.tar.gz" - sha256: "f9f15b395def578cc79a5b32abc64fa9cff5dac873062911f515b984b90f7cc2" - "0.6.0": - url: "https://github.com/uNetworking/uSockets/archive/v0.6.0.tar.gz" - sha256: "999387d3653b2bc663c34aa7e973358ac4c4897dccd644553a5caab843a978a1" - "0.7.1": - url: "https://github.com/uNetworking/uSockets/archive/v0.7.1.tar.gz" - sha256: "1fdc5376e5ef9acf4fb673fcd5fd191da9b8d59a319e9ec7922872070a3dd21c" + "0.8.2": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.2.tar.gz" + sha256: "c17fc99773a30552cdd7741ff98af177eeecb26b89fc38011b430956b3b2eca5" "0.8.1": url: "https://github.com/uNetworking/uSockets/archive/v0.8.1.tar.gz" sha256: "3b33b5924a92577854e2326b3e2d393849ec00beb865a1271bf24c0f210cc1d6" -patches: + "0.7.1": + url: "https://github.com/uNetworking/uSockets/archive/v0.7.1.tar.gz" + sha256: "1fdc5376e5ef9acf4fb673fcd5fd191da9b8d59a319e9ec7922872070a3dd21c" + "0.6.0": + url: "https://github.com/uNetworking/uSockets/archive/v0.6.0.tar.gz" + sha256: "999387d3653b2bc663c34aa7e973358ac4c4897dccd644553a5caab843a978a1" "0.4.0": - - patch_file: "patches/0001-makefile.patch" + url: "https://github.com/uNetworking/uSockets/archive/v0.4.0.tar.gz" + sha256: "f9f15b395def578cc79a5b32abc64fa9cff5dac873062911f515b984b90f7cc2" +patches: + "0.8.2": + - patch_file: "patches/0001-makefile_0.8.2.patch" base_path: "source_subfolder" - - patch_file: "patches/0002-vcxproj.patch" + patch_description: "remove lto options" + patch_type: "portability" + - patch_file: "patches/0002-vcxproj_0.8.1.patch" base_path: "source_subfolder" - "0.6.0": + patch_description: "build static library" + patch_type: "conan" + "0.8.1": + - patch_file: "patches/0001-makefile_0.8.1.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" + - patch_file: "patches/0002-vcxproj_0.8.1.patch" + base_path: "source_subfolder" + patch_description: "build static library" + patch_type: "conan" + "0.7.1": - patch_file: "patches/0001-makefile_0.6.0.patch" base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" - patch_file: "patches/0002-vcxproj.patch" base_path: "source_subfolder" - "0.7.1": + patch_description: "build static library" + patch_type: "conan" + "0.6.0": - patch_file: "patches/0001-makefile_0.6.0.patch" base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" - patch_file: "patches/0002-vcxproj.patch" base_path: "source_subfolder" - "0.8.1": - - patch_file: "patches/0001-makefile_0.8.1.patch" + patch_description: "build static library" + patch_type: "conan" + "0.4.0": + - patch_file: "patches/0001-makefile.patch" base_path: "source_subfolder" - - patch_file: "patches/0002-vcxproj_0.8.1.patch" + patch_description: "remove lto options" + patch_type: "portability" + - patch_file: "patches/0002-vcxproj.patch" base_path: "source_subfolder" + patch_description: "build static library" + patch_type: "conan" diff --git a/recipes/usockets/all/conanfile.py b/recipes/usockets/all/conanfile.py index 21f31328b479e..9e34c8b2bca1c 100644 --- a/recipes/usockets/all/conanfile.py +++ b/recipes/usockets/all/conanfile.py @@ -1,35 +1,44 @@ -import os +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, chdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conans import MSBuild, AutoToolsBuildEnvironment -from conans import ConanFile, tools, MSBuild, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +import os +required_conan_version = ">=1.52.0" class UsocketsConan(ConanFile): name = "usockets" - url = "https://github.com/conan-io/conan-center-index" description = "Miniscule cross-platform eventing, networking & crypto for async applications" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/uNetworking/uSockets" - topics = ("conan", "socket", "network", "web") + topics = ("socket", "network", "web") settings = "os", "arch", "compiler", "build_type" - options = {"fPIC": [True, False], - "with_ssl": [False, "openssl", "wolfssl"], - "with_libuv": [True, False, "deprecated"], - "eventloop": ["syscall", "libuv", "gcd", "boost"]} - default_options = {"fPIC": True, - "with_ssl": False, - "with_libuv": "deprecated", - "eventloop": "syscall"} - exports_sources = "patches/**" + options = { + "fPIC": [True, False], + "with_ssl": [False, "openssl", "wolfssl"], + "eventloop": ["syscall", "libuv", "gcd", "boost"], + } + default_options = { + "fPIC": True, + "with_ssl": False, + "eventloop": "syscall", + } @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + version = False + if self.options.eventloop == "boost": + version = "14" - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - self.options.eventloop = "libuv" + # OpenSSL wrapper of uSockets uses C++17 features. + if self.options.with_ssl == "openssl": + version = "17" + + return version def _minimum_compilers_version(self, cppstd): standards = { @@ -49,61 +58,57 @@ def _minimum_compilers_version(self, cppstd): return standards.get(cppstd) or {} @property - def _cppstd(self): - version = False - if self.options.eventloop == "boost": - version = "14" + def _source_subfolder(self): + return "source_subfolder" - # OpenSSL wrapper of uSockets uses C++17 features. - if self.options.with_ssl == "openssl": - version = "17" + def export_sources(self): + export_conandata_patches(self) - return version + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + self.options.eventloop = "libuv" def validate(self): - if self.options.eventloop == "syscall" and self.settings.os == "Windows": + if self.options.eventloop == "syscall" and self.info.settings.os == "Windows": raise ConanInvalidConfiguration("syscall is not supported on Windows") - if self.options.eventloop == "gcd" and (self.settings.os != "Linux" or self.settings.compiler != "clang"): + if self.options.eventloop == "gcd" and (self.info.settings.os != "Linux" or self.info.settings.compiler != "clang"): raise ConanInvalidConfiguration("eventloop=gcd is only supported on Linux with clang") - if tools.Version(self.version) < "0.8.0" and self.options.eventloop not in ("syscall", "libuv", "gcd"): + if Version(self.version) < "0.8.0" and self.options.eventloop not in ("syscall", "libuv", "gcd"): raise ConanInvalidConfiguration(f"eventloop={self.options.eventloop} is not supported with {self.name}/{self.version}") - if tools.Version(self.version) >= "0.5.0" and self.options.with_ssl == "wolfssl": + if Version(self.version) >= "0.5.0" and self.options.with_ssl == "wolfssl": raise ConanInvalidConfiguration(f"with_ssl={self.options.with_ssl} is not supported with {self.name}/{self.version}. https://github.com/uNetworking/uSockets/issues/147") if self.options.with_ssl == "wolfssl" and not self.options["wolfssl"].opensslextra: raise ConanInvalidConfiguration("wolfssl needs opensslextra option enabled for usockets") - if not self.options.with_libuv and self.settings.os == "Windows": - raise ConanInvalidConfiguration("uSockets in Windows uses libuv by default. After 0.8.0, you can choose boost.asio by eventloop=boost.") - - cppstd = self._cppstd + cppstd = self._minimum_cpp_standard if not cppstd: return - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, cppstd) + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, cppstd) - minimum_version = self._minimum_compilers_version(cppstd).get(str(self.settings.compiler), False) + minimum_version = self._minimum_compilers_version(cppstd).get(str(self.info.settings.compiler), False) if minimum_version: - if tools.Version(self.settings.compiler.version) < minimum_version: + if Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("{} requires C++{}, which your compiler does not support.".format(self.name, cppstd)) else: self.output.warn("{0} requires C++{1}. Your compiler is unknown. Assuming it supports C++{1}.".format(self.name, cppstd)) def configure(self): - if bool(self._cppstd) == False: - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - - if self.options.with_libuv != "deprecated": - self.output.warn("with_libuv is deprecated, use 'eventloop' instead.") - if self.options.with_libuv == True: - self.options.eventloop = "libuv" - else: - self.options.eventloop = "syscall" + if bool(self._minimum_cpp_standard) == False: + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass def requirements(self): if self.options.with_ssl == "openssl": @@ -116,25 +121,23 @@ def requirements(self): elif self.options.eventloop == "gcd": self.requires("libdispatch/5.3.2") elif self.options.eventloop == "boost": - self.requires("boost/1.79.0") + self.requires("boost/1.80.0") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("uSockets-%s" % self.version, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + apply_conandata_patches(self) def _build_msvc(self): - with tools.chdir(os.path.join(self._source_subfolder)): + with chdir(self, os.path.join(self._source_subfolder)): msbuild = MSBuild(self) msbuild.build(project_file="uSockets.vcxproj", platforms={"x86": "Win32"}) def _build_configure(self): autotools = AutoToolsBuildEnvironment(self) autotools.fpic = self.options.get_safe("fPIC", False) - with tools.chdir(self._source_subfolder): + with chdir(self, self._source_subfolder): args = [] if self.options.with_ssl == "openssl": args.append("WITH_OPENSSL=1") @@ -148,7 +151,7 @@ def _build_configure(self): elif self.options.eventloop == "boost": args.append("WITH_ASIO=1") - args.extend("{}={}".format(key, value) for key, value in autotools.vars.items()) + args.extend(f"{key}={value}" for key, value in autotools.vars.items()) autotools.make(target="default", args=args) def build(self): @@ -159,16 +162,12 @@ def build(self): self._build_configure() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.h", src=os.path.join(self._source_subfolder, "src"), dst="include", keep_path=True) - self.copy(pattern="*.a", src=self._source_subfolder, dst="lib", keep_path=False) - self.copy(pattern="*.lib", src=self._source_subfolder, dst="lib", keep_path=False) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._source_subfolder) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self._source_subfolder, "src"), keep_path=True) + copy(self, pattern="*.a", dst=os.path.join(self.package_folder, "lib"), src=self._source_subfolder, keep_path=False) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self._source_subfolder, keep_path=False) # drop internal headers - tools.rmdir(os.path.join(self.package_folder, "include", "internal")) - - def package_id(self): - # Deprecated options - del self.info.options.with_libuv + rmdir(self, os.path.join(self.package_folder, "include", "internal")) def package_info(self): self.cpp_info.libs = ["uSockets"] diff --git a/recipes/usockets/all/patches/0001-makefile_0.8.2.patch b/recipes/usockets/all/patches/0001-makefile_0.8.2.patch new file mode 100644 index 0000000000000..aafe333e3b357 --- /dev/null +++ b/recipes/usockets/all/patches/0001-makefile_0.8.2.patch @@ -0,0 +1,39 @@ +diff --git a/Makefile b/Makefile +index 8bf11b3..9577ee7 100644 +--- a/Makefile ++++ b/Makefile +@@ -58,20 +58,20 @@ endif + # By default we build the uSockets.a static library + default: + rm -f *.o +- $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c ++ $(CC) $(CFLAGS) $(CPPFLAGS) -O3 -c src/*.c src/eventing/*.c src/crypto/*.c + # Also link in Boost Asio support + ifeq ($(WITH_ASIO),1) +- $(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp ++ $(CXX) $(CXXFLAGS) -Isrc -std=c++14 $(CPPFLAGS) -O3 -c src/eventing/asio.cpp + endif + + # For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11 + ifeq ($(WITH_OPENSSL),1) +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp ++ $(CXX) $(CXXFLAGS) -std=c++17 $(CPPFLAGS) -O3 -c src/crypto/*.cpp + endif + ifeq ($(WITH_BORINGSSL),1) +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp ++ $(CXX) $(CXXFLAGS) -std=c++17 $(CPPFLAGS) -O3 -c src/crypto/*.cpp + endif +- $(AR) rvs uSockets.a *.o ++ $(AR) rvs libuSockets.a *.o + + # BoringSSL needs cmake and golang + .PHONY: boringssl +@@ -81,7 +81,7 @@ boringssl: + # Builds all examples + .PHONY: examples + examples: default +- for f in examples/*.c; do $(CC) -flto -O3 $(CFLAGS) -o $$(basename "$$f" ".c") "$$f" $(LDFLAGS); done ++ for f in examples/*.c; do $(CC) $(CPPFLAGS) -O3 $(CFLAGS) -o $$(basename "$$f" ".c") "$$f" $(LDFLAGS); done + + swift_examples: + swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server diff --git a/recipes/usockets/all/test_package/CMakeLists.txt b/recipes/usockets/all/test_package/CMakeLists.txt index 196188113685c..8502a8260d7ce 100644 --- a/recipes/usockets/all/test_package/CMakeLists.txt +++ b/recipes/usockets/all/test_package/CMakeLists.txt @@ -1,8 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +conan_basic_setup(TARGETS) + +find_package(usockets REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE usockets::usockets) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/usockets/all/test_package/conanfile.py b/recipes/usockets/all/test_package/conanfile.py index bd7165a553cf4..7895db93c24a6 100644 --- a/recipes/usockets/all/test_package/conanfile.py +++ b/recipes/usockets/all/test_package/conanfile.py @@ -1,10 +1,12 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) @@ -12,6 +14,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): + if not cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) diff --git a/recipes/usockets/config.yml b/recipes/usockets/config.yml index ed051b80517fb..76b81d9ebd690 100644 --- a/recipes/usockets/config.yml +++ b/recipes/usockets/config.yml @@ -1,9 +1,11 @@ versions: - "0.4.0": + "0.8.2": folder: all - "0.6.0": + "0.8.1": folder: all "0.7.1": folder: all - "0.8.1": + "0.6.0": + folder: all + "0.4.0": folder: all From fdba1998257b2089b0b0f869a772f211cfbc2485 Mon Sep 17 00:00:00 2001 From: cguentherTUChemnitz Date: Wed, 19 Oct 2022 18:25:18 +0200 Subject: [PATCH 510/561] (#13582) onetbb: Android: workaround for current AndroidNDK builds * onetbb: Android: fix current AndroidNDK builds by patching away the leading emptyspace entry in generated ^Cags.make and link.txt * go for upstream patch backporting * Update recipes/onetbb/all/conanfile.py Co-authored-by: Chris Mc * review-change: update conan version requirement, providing export_conandata_patches Co-authored-by: Chris Mc --- recipes/onetbb/all/conandata.yml | 11 +++++++++++ recipes/onetbb/all/conanfile.py | 8 ++++++-- .../fix-overeager-stripping-of-compile-flag.diff | 13 +++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 recipes/onetbb/all/patches/fix-overeager-stripping-of-compile-flag.diff diff --git a/recipes/onetbb/all/conandata.yml b/recipes/onetbb/all/conandata.yml index 8284437159176..1e589ce6c4948 100644 --- a/recipes/onetbb/all/conandata.yml +++ b/recipes/onetbb/all/conandata.yml @@ -5,3 +5,14 @@ sources: "2021.3.0": url: "https://github.com/oneapi-src/oneTBB/archive/v2021.3.0.tar.gz" sha256: "8f616561603695bbb83871875d2c6051ea28f8187dbe59299961369904d1d49e" +patches: + "2021.6.0": + - patch_description: "cherry-pick upstream patch: avoid android compile errors for current NDKs on releases <= 2021.6.0" + patch_type: "backport" + patch_source: "https://github.com/oneapi-src/oneTBB/pull/716.diff" + patch_file: "patches/fix-overeager-stripping-of-compile-flag.diff" + "2021.3.0": + - patch_description: "cherry-pick upstream patch: avoid android compile errors for current NDKs on releases <= 2021.6.0" + patch_type: "backport" + patch_source: "https://github.com/oneapi-src/oneTBB/pull/716.diff" + patch_file: "patches/fix-overeager-stripping-of-compile-flag.diff" diff --git a/recipes/onetbb/all/conanfile.py b/recipes/onetbb/all/conanfile.py index c0f1359419b8c..240acbbc36f0d 100644 --- a/recipes/onetbb/all/conanfile.py +++ b/recipes/onetbb/all/conanfile.py @@ -2,12 +2,12 @@ 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, load, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, load, rmdir from conan.tools.scm import Version import os import re -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class OneTBBConan(ConanFile): @@ -46,6 +46,9 @@ def config_options(self): del self.options.shared del self.options.fPIC + def export_sources(self): + export_conandata_patches(self) + def configure(self): if self.options.get_safe("shared", True): del self.options.fPIC @@ -97,6 +100,7 @@ def generate(self): toolchain.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/onetbb/all/patches/fix-overeager-stripping-of-compile-flag.diff b/recipes/onetbb/all/patches/fix-overeager-stripping-of-compile-flag.diff new file mode 100644 index 0000000000000..914764c6a369d --- /dev/null +++ b/recipes/onetbb/all/patches/fix-overeager-stripping-of-compile-flag.diff @@ -0,0 +1,13 @@ +diff --git a/cmake/utils.cmake b/cmake/utils.cmake +index f74abfcf9..a090bacbb 100644 +--- a/cmake/utils.cmake ++++ b/cmake/utils.cmake +@@ -18,7 +18,7 @@ macro(tbb_remove_compile_flag flag) + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS ${_tbb_compile_options}) + unset(_tbb_compile_options) + if (CMAKE_CXX_FLAGS) +- string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) ++ string(REGEX REPLACE "(^|[ \t\r\n]+)${flag}($|[ \t\r\n]+)" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + endif() + endmacro() + From c7c4025ff4e19459311015cfeaa21c14dd56f022 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 19 Oct 2022 18:45:00 +0200 Subject: [PATCH 511/561] (#13595) add xtrans/system * add xtrans/system * Update conanfile.py * Update conanfile.py * Update recipes/xtrans/all/test_package/conanfile.py Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- recipes/xtrans/all/conanfile.py | 51 +++++++++++++++++++ recipes/xtrans/all/test_package/conanfile.py | 25 +++++++++ .../xtrans/all/test_v1_package/conanfile.py | 13 +++++ recipes/xtrans/config.yml | 3 ++ 4 files changed, 92 insertions(+) create mode 100644 recipes/xtrans/all/conanfile.py create mode 100644 recipes/xtrans/all/test_package/conanfile.py create mode 100644 recipes/xtrans/all/test_v1_package/conanfile.py create mode 100644 recipes/xtrans/config.yml diff --git a/recipes/xtrans/all/conanfile.py b/recipes/xtrans/all/conanfile.py new file mode 100644 index 0000000000000..a420c87bd7d01 --- /dev/null +++ b/recipes/xtrans/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.47" + + +class XtransConan(ConanFile): + name = "xtrans" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "https://www.x.org/wiki/" + description = "X Network Transport layer shared code" + settings = "os", "compiler", "build_type" # no arch here, because the xtrans system package is arch independant + topics = ("x11", "xorg") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def package_id(self): + self.info.header_only() + + def system_requirements(self): + apt = package_manager.Apt(self) + apt.install(["xtrans-dev"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["xorg-x11-xtrans-devel"], update=True, check=True) + + dnf = package_manager.Dnf(self) + dnf.install(["xorg-x11-xtrans-devel"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["xtrans"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["xtrans"], update=True, check=True) + + package_manager.Pkg(self).install(["xtrans"], update=True, check=True) + + def package_info(self): + pkg_config = PkgConfig(self, "xtrans") + pkg_config.fill_cpp_info( + self.cpp_info, is_system=self.settings.os != "FreeBSD") + self.cpp_info.version = pkg_config.version + self.cpp_info.set_property("pkg_config_name", "xtrans") + self.cpp_info.set_property("component_version", pkg_config.version) + self.cpp_info.set_property("pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkg_config.variables.items() if key not in ["pcfiledir","prefix", "includedir"])) diff --git a/recipes/xtrans/all/test_package/conanfile.py b/recipes/xtrans/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1b04b27a310a7 --- /dev/null +++ b/recipes/xtrans/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def generate(self): + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + + def build(self): + pass + + def test(self): + pkg_config = self.conf_info.get("tools.gnu:pkg_config", default="pkg-config") + self.run(f"{pkg_config} --validate xtrans") diff --git a/recipes/xtrans/all/test_v1_package/conanfile.py b/recipes/xtrans/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c20eb932e465e --- /dev/null +++ b/recipes/xtrans/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "pkg_config" + + def build(self): + pass + + def test(self): + self.run("pkg-config --validate ./xtrans.pc") diff --git a/recipes/xtrans/config.yml b/recipes/xtrans/config.yml new file mode 100644 index 0000000000000..76a338dd54cee --- /dev/null +++ b/recipes/xtrans/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: "all" From 842c55bbf1fe733aed598663b13a68cf2bb01b8d Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 19 Oct 2022 10:05:35 -0700 Subject: [PATCH 512/561] (#13490) docs: v2 migration guidence for `conf_info` * docs: v2 migration guidence for `conf_info` * Update docs/v2_migration.md Co-authored-by: Jordan Williams * example + notes about why to avoid it Co-authored-by: Jordan Williams --- docs/v2_migration.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/v2_migration.md b/docs/v2_migration.md index 700c20b79ae13..f14a69ce855cc 100644 --- a/docs/v2_migration.md +++ b/docs/v2_migration.md @@ -54,6 +54,39 @@ When different build tools are use, at least one layout needs to be set. The `src_folder` must be the same when using different layouts and should not depend on settings or options. +## New conf_info properties + +As described in the documentation `self.user_info` has been depreated and you are now required to use +`self.conf_info` to define individual properties to expose to downstream recipes. +The [2.0 migrations docs](https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#removed-self-user-info) +should cover the technical details, however for ConanCenterIndex we need to make sure there are no collisions +`conf_info` must be named `user.:`. + +For usage options of `conf_info`, the [documenation](https://docs.conan.io/en/latest/reference/config_files/global_conf.html?highlight=conf_info#configuration-in-your-recipes) + +In ConanCenterIndex this will typically looks like: + +- defining a value + ```py + def package_info(self): + tool_path = os.path.join(self.package_folder, "bin", "tool") + self.conf_info.define("user.pkg:tool", tool_path) + ``` +- using a value + ```py + #generators = "VirtualBuildEnv", "VirtualRunEnv" + + def build_requirements(self): + self.tool_requires("tool/0.1") + + def build(self): + tool_path = self.conf_info.get("user.pkg:tool") + self.run(f"{tool_path} --build") + ``` +> **Note**: This should only be used when absolutely required. In the vast majority of cases, the new +> ["Environments"](https://docs.conan.io/en/latest/reference/conanfile/tools/env/environment.html?highlight=Virtual) +> will include the `self.cpp_info.bindirs` which will provide access to the tools in the correct scopes. + ## New cpp_info set_property model New Conan generators like From 3d29d5da2304e22c09b8244dab5d970191e3bbac Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 19 Oct 2022 19:25:11 +0200 Subject: [PATCH 513/561] (#13603) [docs] Add Meson template * Add Meson template Signed-off-by: Uilian Ries * Use only meson Signed-off-by: Uilian Ries * Use only one meson file Signed-off-by: Uilian Ries * rename test package Signed-off-by: Uilian Ries * install pkgconf Signed-off-by: Uilian Ries * Fix tool_requires Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- docs/package_templates/README.md | 4 + .../meson_package/all/conandata.yml | 27 +++ .../meson_package/all/conanfile.py | 164 ++++++++++++++++++ .../all/test_package/conanfile.py | 34 ++++ .../all/test_package/meson.build | 5 + .../all/test_package/test_package.cpp | 18 ++ .../all/test_v1_package/conanfile.py | 24 +++ .../meson_package/config.yml | 6 + 8 files changed, 282 insertions(+) create mode 100644 docs/package_templates/meson_package/all/conandata.yml create mode 100644 docs/package_templates/meson_package/all/conanfile.py create mode 100644 docs/package_templates/meson_package/all/test_package/conanfile.py create mode 100644 docs/package_templates/meson_package/all/test_package/meson.build create mode 100644 docs/package_templates/meson_package/all/test_package/test_package.cpp create mode 100644 docs/package_templates/meson_package/all/test_v1_package/conanfile.py create mode 100644 docs/package_templates/meson_package/config.yml diff --git a/docs/package_templates/README.md b/docs/package_templates/README.md index 635023cac662c..76d696e57b0a0 100644 --- a/docs/package_templates/README.md +++ b/docs/package_templates/README.md @@ -21,3 +21,7 @@ It's listed under [msbuild_package](msbuild_package) folder. It fits projects wh #### Prebuilt tool package It's listed under [prebuilt_tool_package](prebuilt_tool_package) folder. It fits projects which only copy generated binaries (executables and libraries). + +#### Meson package + +It's listed under [meson_package](meson_package) folder. It fits projects which use `Meson` to be built. diff --git a/docs/package_templates/meson_package/all/conandata.yml b/docs/package_templates/meson_package/all/conandata.yml new file mode 100644 index 0000000000000..a5aa8737e0c0a --- /dev/null +++ b/docs/package_templates/meson_package/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + # Newer versions at the top + "1.2.0": + url: [ + "https://mirror1.net/package-1.2.0.tar.gz", + "https://mirror2.net/package-1.2.0.tar.gz", + ] + sha256: "________________________________________________________________" + "1.1.0": + url: [ + "https://mirror1.net/package-1.1.0.tar.gz", + "https://mirror2.net/package-1.1.0.tar.gz", + ] + sha256: "________________________________________________________________" +patches: + # Newer versions at the top + "1.1.0": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "correct the order of cmake min and project" + patch_type: "backport" + patch_source: "https://github.com/owner/package/pulls/42" + sha256: "________________________________________________________________" + - patch_file: "patches/0002-fix-linux.patch" + patch_description: "add missing header to support linux" + patch_type: "portability" + patch_source: "https://github.com/owner/package/issues/0" + sha256: "________________________________________________________________" diff --git a/docs/package_templates/meson_package/all/conanfile.py b/docs/package_templates/meson_package/all/conanfile.py new file mode 100644 index 0000000000000..5305b9ba492e7 --- /dev/null +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -0,0 +1,164 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, 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.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.gnu import PkgConfigDeps +from conan.tools.meson import Meson, MesonToolchain, MesonDeps +from conan.tools.env import VirtualBuildEnv +import os + + +required_conan_version = ">=1.52.0" + +# +# INFO: Please, remove all comments before pushing your PR! +# + + +class PackageConan(ConanFile): + name = "package" + description = "short description" + # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ + # In case not listed there, use "LicenseRef-" + license = "" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + # no "conan" and project name in topics. Use topics from the upstream listed on GH + topics = ("topic1", "topic2", "topic3") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _minimum_cpp_standard(self): + return 17 + + # 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", + } + + # no exports_sources attribute, but export_sources(self) method instead + # this allows finer grain exportation of patches per version + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + # once removed by config_options, need try..except for a second del + del self.options.fPIC + except Exception: + pass + # for plain C projects only + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + # src_folder must use the same source folder name the project + basic_layout(self, src_folder="src") + + def requirements(self): + # prefer self.requires method instead of requires attribute + self.requires("dependency/0.8.1") + + def validate(self): + # validate the minimum cpp standard supported. For C++ projects only + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, 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.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + # if another tool than the compiler or Meson is required to build the project (pkgconf, bison, flex etc) + def build_requirements(self): + # Meson package is no installed by default on ConanCenterIndex CI + self.tool_requires("meson/0.63.3") + # pkgconf is largely used by Meson, in case needed on Windows, it should be added are build requirement + self.tool_requires("pkgconf/1.9.3") + # Meson uses Ninja as backend by default. Ninja package is not installed by default on ConanCenterIndex + if not self.conf.get("tools.meson.mesontoolchain:backend", default=False, check_type=str): + self.tool_requires("ninja/1.11.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + # default_library and b_staticpic are automatically parsed when self.options.shared and self.options.fpic exist + # buildtype is automatically parsed for self.settings + tc = MesonToolchain(self) + # In case need to pass definitions directly to the compiler + tc.preprocessor_definitions["MYDEFINE"] = "MYDEF_VALUE" + # Meson project options may vary their types + tc.project_options["tests"] = False + tc.generate() + # In case there are dependencies listed on requirements, PkgConfigDeps should be used + tc = PkgConfigDeps(self) + tc.generate() + # Sometimes, when PkgConfigDeps is not enough to find requirements, MesonDeps should solve it + tc = MesonDeps(self) + tc.generate() + # In case there are dependencies listed on build_requirements, VirtualBuildEnv should be used + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def _patch_sources(self): + apply_conandata_patches(self) + # remove bundled xxhash + rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "...", "") + + def build(self): + self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + meson = Meson(self) + meson.install() + + # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + # avoid collect_libs(), prefer explicit library name instead + self.cpp_info.libs = ["package_lib"] + # if package provides a pkgconfig file (package.pc, usually installed in /lib/pkgconfig/) + self.cpp_info.set_property("pkg_config_name", "package") + # If they are needed on Linux, m, pthread and dl are usually needed on FreeBSD too + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/docs/package_templates/meson_package/all/test_package/conanfile.py b/docs/package_templates/meson_package/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4738b8f8b2267 --- /dev/null +++ b/docs/package_templates/meson_package/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/0.63.3") + self.tool_requires("pkgconf/1.9.3") + if not self.conf.get("tools.meson.mesontoolchain:backend", default=False, check_type=str): + self.tools_requires("ninja/1.11.1") + + def layout(self): + basic_layout(self) + + def build(self): + cmake = Meson(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/docs/package_templates/meson_package/all/test_package/meson.build b/docs/package_templates/meson_package/all/test_package/meson.build new file mode 100644 index 0000000000000..481f6cfd116c1 --- /dev/null +++ b/docs/package_templates/meson_package/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'cpp') +package_dep = dependency('package') +executable('test_package', + sources : ['test_package.cpp'], + dependencies : [package_dep]) diff --git a/docs/package_templates/meson_package/all/test_package/test_package.cpp b/docs/package_templates/meson_package/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..315875d954777 --- /dev/null +++ b/docs/package_templates/meson_package/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include "package/foobar.hpp" + + +int main(void) { + /* + * Create a minimal usage for the target project here. + * Avoid big examples, bigger than 100 lines. + * Avoid networking connections. + * Avoid background apps or servers. + * The propose is testing the generated artifacts only. + */ + + foobar.print_version(); + + return EXIT_SUCCESS; +} diff --git a/docs/package_templates/meson_package/all/test_v1_package/conanfile.py b/docs/package_templates/meson_package/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c571ed9e8d113 --- /dev/null +++ b/docs/package_templates/meson_package/all/test_v1_package/conanfile.py @@ -0,0 +1,24 @@ +from conans import ConanFile, Meson +from conan.tools.build import cross_building +import os + + +# legacy validation with Conan 1.x +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + self.build_requires("meson/0.63.3") + self.build_requires("ninja/1.11.1") + + def build(self): + meson = Meson(self) + meson.configure(build_folder="bin", source_folder="../test_package") + meson.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/docs/package_templates/meson_package/config.yml b/docs/package_templates/meson_package/config.yml new file mode 100644 index 0000000000000..a885cbf942a74 --- /dev/null +++ b/docs/package_templates/meson_package/config.yml @@ -0,0 +1,6 @@ +versions: + # Newer versions at the top + "1.2.0": + folder: all + "1.1.0": + folder: all From 1bf681de2cf9a5e71eef47c49c01060031fb23a3 Mon Sep 17 00:00:00 2001 From: Ahajha <44127594+Ahajha@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:05:47 -0400 Subject: [PATCH 514/561] (#13591) Add vulkan-headers 1.3.231 --- recipes/vulkan-headers/all/conandata.yml | 3 +++ recipes/vulkan-headers/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/vulkan-headers/all/conandata.yml b/recipes/vulkan-headers/all/conandata.yml index 95d82ebb73d00..d7718cb9466ca 100644 --- a/recipes/vulkan-headers/all/conandata.yml +++ b/recipes/vulkan-headers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.231": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.231.tar.gz" + sha256: "4cb1c0aeb858e1a4955a736b86b0da8511ca8701222e9a252adcf093d40a8d28" "1.3.224.1": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.224.1.tar.gz" sha256: "628bd5943c0d007c192769480e789801a088f892445c80cb336fc9b6d236c5ef" diff --git a/recipes/vulkan-headers/config.yml b/recipes/vulkan-headers/config.yml index 4dd6e6190dc8f..8dff9a0448225 100644 --- a/recipes/vulkan-headers/config.yml +++ b/recipes/vulkan-headers/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.231": + folder: all "1.3.224.1": folder: all "1.3.224.0": From a0cdbcb4a717c863fa5c3a82a5bcef9f1b04aad1 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 19 Oct 2022 21:05:17 +0200 Subject: [PATCH 515/561] (#13570) opengl: use new system helpers * use new system helpers * fixup * Update conanfile.py --- recipes/opengl/all/conanfile.py | 56 +++++++++++++++++---------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/recipes/opengl/all/conanfile.py b/recipes/opengl/all/conanfile.py index 09a72805491de..bff45b4715333 100644 --- a/recipes/opengl/all/conanfile.py +++ b/recipes/opengl/all/conanfile.py @@ -1,7 +1,10 @@ from conan import ConanFile from conan.errors import ConanException +from conan.tools.system import package_manager from conans import tools +required_conan_version = ">=1.47" + class SysConfigOpenGLConan(ConanFile): name = "opengl" @@ -37,33 +40,32 @@ def _fill_cppinfo_from_pkgconfig(self, name): self.cpp_info.cxxflags.extend(cflags) def system_requirements(self): - packages = [] - if tools.os_info.is_linux and self.settings.os == "Linux": - if tools.os_info.with_yum: - if tools.os_info.linux_distro == "fedora" and tools.os_info.os_version >= "32": - packages = ["libglvnd-devel"] - else: - packages = ["mesa-libGL-devel"] - elif tools.os_info.with_apt: - ubuntu_20_or_later = tools.os_info.linux_distro == "ubuntu" and tools.os_info.os_version >= "20" - debian_11_or_later = tools.os_info.linux_distro == "debian" and tools.os_info.os_version >= "11" - pop_os_20_or_later = tools.os_info.linux_distro == "pop" and tools.os_info.os_version >= "20" - if ubuntu_20_or_later or debian_11_or_later or pop_os_20_or_later: - packages = ["libgl-dev"] - else: - packages = ["libgl1-mesa-dev"] - elif tools.os_info.with_pacman: - packages = ["libglvnd"] - elif tools.os_info.with_zypper: - packages = ["Mesa-libGL-devel"] - else: - self.output.warn("Don't know how to install OpenGL for your distro.") - elif tools.os_info.is_freebsd and self.settings.os == "FreeBSD": - packages = ["libglvnd"] - if packages: - package_tool = tools.SystemPackageTool(conanfile=self, default_mode='verify') - for p in packages: - package_tool.install(update=True, packages=p) + dnf = package_manager.Dnf(self) + if tools.os_info.linux_distro == "fedora" and tools.os_info.os_version >= "32": + dnf.install(["libglvnd-devel"], update=True, check=True) + else: + dnf.install(["mesa-libGL-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["mesa-libGL-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + ubuntu_20_or_later = tools.os_info.linux_distro == "ubuntu" and tools.os_info.os_version >= "20" + debian_11_or_later = tools.os_info.linux_distro == "debian" and tools.os_info.os_version >= "11" + pop_os_20_or_later = tools.os_info.linux_distro == "pop" and tools.os_info.os_version >= "20" + if ubuntu_20_or_later or debian_11_or_later or pop_os_20_or_later: + apt.install(["libgl-dev"], update=True, check=True) + else: + apt.install(["libgl1-mesa-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libglvnd"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["Mesa-libGL-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libglvnd"], update=True, check=True) def package_info(self): # TODO: Workaround for #2311 until a better solution can be found From 46a73a7e544dae4f4a78007f3c02a6c14dbe005e Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 19 Oct 2022 21:26:18 +0200 Subject: [PATCH 516/561] (#13592) xorg: remove xkeyboard-config and xtrans * xorg: split system packages according to arch * Update conanfile.py * Update conanfile.py --- recipes/xorg/all/conanfile.py | 38 +++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/recipes/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py index c1f209e672558..6182a83010618 100644 --- a/recipes/xorg/all/conanfile.py +++ b/recipes/xorg/all/conanfile.py @@ -28,52 +28,56 @@ def system_requirements(self): "libxcomposite-dev", "libxcursor-dev", "libxdamage-dev", "libxdmcp-dev", "libxext-dev", "libxfixes-dev", "libxi-dev", "libxinerama-dev", "libxkbfile-dev", "libxmu-dev", "libxmuu-dev", "libxpm-dev", "libxrandr-dev", "libxrender-dev", "libxres-dev", "libxss-dev", "libxt-dev", "libxtst-dev", - "libxv-dev", "libxvmc-dev", "libxxf86vm-dev", "xtrans-dev", "libxcb-render0-dev", + "libxv-dev", "libxvmc-dev", "libxxf86vm-dev", "libxcb-render0-dev", "libxcb-render-util0-dev", "libxcb-xkb-dev", "libxcb-icccm4-dev", "libxcb-image0-dev", "libxcb-keysyms1-dev", "libxcb-randr0-dev", "libxcb-shape0-dev", "libxcb-sync-dev", "libxcb-xfixes0-dev", - "libxcb-xinerama0-dev", "xkb-data", "libxcb-dri3-dev", "uuid-dev"], update=True, check=True) + "libxcb-xinerama0-dev", "libxcb-dri3-dev", "uuid-dev"], update=True, check=True) apt.install_substitutes( ["libxcb-util-dev"], ["libxcb-util0-dev"], update=True, check=True) - package_manager.Yum(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + yum = package_manager.Yum(self) + yum.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", - "xorg-x11-xtrans-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", + "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", - "xcb-util-devel", "libuuid-devel", "xkeyboard-config-devel"], update=True, check=True) + "xcb-util-devel", "libuuid-devel"], update=True, check=True) - package_manager.Dnf(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + dnf = package_manager.Dnf(self) + dnf.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", - "xorg-x11-xtrans-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", + "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", - "xcb-util-devel", "libuuid-devel", "xkeyboard-config-devel"], update=True, check=True) + "xcb-util-devel", "libuuid-devel"], update=True, check=True) - package_manager.Zypper(self).install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", + zypper = package_manager.Zypper(self) + zypper.install(["libxcb-devel", "libfontenc-devel", "libXaw-devel", "libXcomposite-devel", "libXcursor-devel", "libXdmcp-devel", "libXtst-devel", "libXinerama-devel", "libxkbfile-devel", "libXrandr-devel", "libXres-devel", "libXScrnSaver-devel", "libXvMC-devel", - "xorg-x11-xtrans-devel", "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", + "xcb-util-wm-devel", "xcb-util-image-devel", "xcb-util-keysyms-devel", "xcb-util-renderutil-devel", "libXdamage-devel", "libXxf86vm-devel", "libXv-devel", - "xcb-util-devel", "libuuid-devel", "xkeyboard-config"], update=True, check=True) + "xcb-util-devel", "libuuid-devel"], update=True, check=True) - package_manager.PacMan(self).install(["libxcb", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", + pacman = package_manager.PacMan(self) + pacman.install(["libxcb", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", "libxdamage", "libxdmcp", "libxtst", "libxinerama", "libxkbfile", "libxrandr", "libxres", - "libxss", "libxvmc", "xtrans", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", - "libxxf86vm", "libxv", "xkeyboard-config", "xcb-util", "util-linux-libs"], update=True, check=True) + "libxss", "libxvmc", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", + "libxxf86vm", "libxv", "xcb-util", "util-linux-libs"], update=True, check=True) package_manager.Pkg(self).install(["libX11", "libfontenc", "libice", "libsm", "libxaw", "libxcomposite", "libxcursor", "libxdamage", "libxdmcp", "libxtst", "libxinerama", "libxkbfile", "libxrandr", "libxres", - "libXScrnSaver", "libxvmc", "xtrans", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", + "libXScrnSaver", "libxvmc", "xcb-util-wm", "xcb-util-image", "xcb-util-keysyms", "xcb-util-renderutil", "libxxf86vm", "libxv", "xkeyboard-config", "xcb-util"], update=True, check=True) def package_info(self): for name in ["x11", "x11-xcb", "fontenc", "ice", "sm", "xau", "xaw7", "xcomposite", "xcursor", "xdamage", "xdmcp", "xext", "xfixes", "xi", "xinerama", "xkbfile", "xmu", "xmuu", "xpm", "xrandr", "xrender", "xres", - "xscrnsaver", "xt", "xtst", "xv", "xvmc", "xxf86vm", "xtrans", + "xscrnsaver", "xt", "xtst", "xv", "xvmc", "xxf86vm", "xcb-xkb", "xcb-icccm", "xcb-image", "xcb-keysyms", "xcb-randr", "xcb-render", "xcb-renderutil", "xcb-shape", "xcb-shm", "xcb-sync", "xcb-xfixes", - "xcb-xinerama", "xcb", "xkeyboard-config", "xcb-atom", "xcb-aux", "xcb-event", "xcb-util", + "xcb-xinerama", "xcb", "xcb-atom", "xcb-aux", "xcb-event", "xcb-util", "xcb-dri3"] + ([] if self.settings.os == "FreeBSD" else ["uuid"]): pkg_config = PkgConfig(self, name) pkg_config.fill_cpp_info( From 39f4ce873378df145f01b52df0c5ba5592867b87 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 19 Oct 2022 21:44:39 +0200 Subject: [PATCH 517/561] (#13599) alac: improvements for conan 2.x client --- recipes/alac/all/CMakeLists.txt | 8 ++++---- recipes/alac/all/conanfile.py | 17 ++++++++++------- recipes/alac/all/test_package/CMakeLists.txt | 2 +- recipes/alac/all/test_package/conanfile.py | 11 ++++++----- recipes/alac/all/test_v1_package/CMakeLists.txt | 2 +- recipes/alac/all/test_v1_package/conanfile.py | 1 - 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/recipes/alac/all/CMakeLists.txt b/recipes/alac/all/CMakeLists.txt index 824a71b493f3a..fe2d89ad21170 100644 --- a/recipes/alac/all/CMakeLists.txt +++ b/recipes/alac/all/CMakeLists.txt @@ -3,11 +3,11 @@ project(alac LANGUAGES C CXX) include(GNUInstallDirs) -file(GLOB ALAC_LIB_SRCS src/codec/*.c src/codec/*.cpp) -file(GLOB ALAC_LIB_PUBLIC_HDRS src/codec/ALAC*.h) +file(GLOB ALAC_LIB_SRCS ${ALAC_SRC_DIR}/codec/*.c ${ALAC_SRC_DIR}/codec/*.cpp) +file(GLOB ALAC_LIB_PUBLIC_HDRS ${ALAC_SRC_DIR}/codec/ALAC*.h) add_library(alac ${ALAC_LIB_SRCS}) -target_include_directories(alac PUBLIC src/codec) +target_include_directories(alac PUBLIC ${ALAC_SRC_DIR}/codec) set_property(TARGET alac PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS TRUE) target_compile_definitions(alac PRIVATE @@ -21,7 +21,7 @@ install(TARGETS alac ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) if(ALAC_BUILD_UTILITY) - file(GLOB ALAC_CONVERTER_SRCS src/convert-utility/*.cpp) + file(GLOB ALAC_CONVERTER_SRCS ${ALAC_SRC_DIR}/convert-utility/*.cpp) add_executable(alacconvert ${ALAC_CONVERTER_SRCS}) target_link_libraries(alacconvert PRIVATE alac) diff --git a/recipes/alac/all/conanfile.py b/recipes/alac/all/conanfile.py index 1c265220e3e81..03e8814c8b1fd 100644 --- a/recipes/alac/all/conanfile.py +++ b/recipes/alac/all/conanfile.py @@ -1,9 +1,10 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get +from conan.tools.scm import Version import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.52.0" class AlacConan(ConanFile): @@ -35,7 +36,10 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass def layout(self): cmake_layout(self, src_folder="src") @@ -46,6 +50,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["ALAC_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.variables["ALAC_BUILD_UTILITY"] = self.options.utility tc.generate() @@ -62,7 +67,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["alac"] - if self.options.utility: - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) + if Version(conan_version).major < 2 and self.options.utility: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/alac/all/test_package/CMakeLists.txt b/recipes/alac/all/test_package/CMakeLists.txt index 20135a2b359e3..237396b4c3323 100644 --- a/recipes/alac/all/test_package/CMakeLists.txt +++ b/recipes/alac/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) find_package(alac REQUIRED CONFIG) diff --git a/recipes/alac/all/test_package/conanfile.py b/recipes/alac/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/alac/all/test_package/conanfile.py +++ b/recipes/alac/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout import os @@ -7,19 +7,20 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not cross_building(self): + if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/alac/all/test_v1_package/CMakeLists.txt b/recipes/alac/all/test_v1_package/CMakeLists.txt index 00f950dcb21f6..6e042a1c74181 100644 --- a/recipes/alac/all/test_v1_package/CMakeLists.txt +++ b/recipes/alac/all/test_v1_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) diff --git a/recipes/alac/all/test_v1_package/conanfile.py b/recipes/alac/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/alac/all/test_v1_package/conanfile.py +++ b/recipes/alac/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os From 60a4b62b6a09f582ddede0e0b1a894c2b2a887e0 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 20 Oct 2022 05:04:19 +0900 Subject: [PATCH 518/561] (#13610) docs: remove lines to make frameworkdirs and resdirs empty on header_only template --- docs/package_templates/header_only/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index 51cc820f18cfa..a9310252571ff 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -96,9 +96,7 @@ def package(self): def package_info(self): # folders not used for header-only self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # if package has an official FindPACKAGE.cmake listed in https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules # examples: bzip2, freetype, gdal, icu, libcurl, libjpeg, libpng, libtiff, openssl, sqlite3, zlib... From 3906097007c4804eacf7f7ed233a9f7d97049118 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 19 Oct 2022 22:24:44 +0200 Subject: [PATCH 519/561] (#13594) add xkeyboard-config/system * add xkeyboard-config/system * Update conanfile.py * Update conanfile.py * Update conanfile.py * Apply suggestions from code review Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- recipes/xkeyboard-config/all/conanfile.py | 50 +++++++++++++++++++ .../all/test_package/conanfile.py | 23 +++++++++ .../all/test_v1_package/conanfile.py | 13 +++++ recipes/xkeyboard-config/config.yml | 3 ++ 4 files changed, 89 insertions(+) create mode 100644 recipes/xkeyboard-config/all/conanfile.py create mode 100644 recipes/xkeyboard-config/all/test_package/conanfile.py create mode 100644 recipes/xkeyboard-config/all/test_v1_package/conanfile.py create mode 100644 recipes/xkeyboard-config/config.yml diff --git a/recipes/xkeyboard-config/all/conanfile.py b/recipes/xkeyboard-config/all/conanfile.py new file mode 100644 index 0000000000000..a9f2fc053956c --- /dev/null +++ b/recipes/xkeyboard-config/all/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.47" + + +class XkeyboardConfigConan(ConanFile): + name = "xkeyboard-config" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/" + description = "The non-arch keyboard configuration database for X Window." + settings = "os", "compiler", "build_type" # no arch here, because the xkeyboard-config system package is arch independant + topics = ("x11", "xorg", "keyboard") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def package_id(self): + self.info.header_only() + + def system_requirements(self): + apt = package_manager.Apt(self) + apt.install(["xkb-data"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["xkeyboard-config-devel"], update=True, check=True) + + dnf = package_manager.Dnf(self) + dnf.install(["xkeyboard-config-devel"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["xkeyboard-config"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["xkeyboard-config"], update=True, check=True) + + package_manager.Pkg(self).install(["xkeyboard-config"], update=True, check=True) + + def package_info(self): + pkg_config = PkgConfig(self, "xkeyboard-config") + pkg_config.fill_cpp_info( + self.cpp_info, is_system=self.settings.os != "FreeBSD") + self.cpp_info.set_property("pkg_config_name", "xkeyboard-config") + self.cpp_info.set_property("component_version", pkg_config.version) + self.cpp_info.set_property("pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkg_config.variables.items() if key not in ["pcfiledir","prefix", "includedir"])) diff --git a/recipes/xkeyboard-config/all/test_package/conanfile.py b/recipes/xkeyboard-config/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5ce13b9d34b6d --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def generate(self): + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + + def test(self): + pkg_config = self.conf_info.get("tools.gnu:pkg_config", default="pkg-config") + self.run(f"{pkg_config} --validate xkeyboard-config") diff --git a/recipes/xkeyboard-config/all/test_v1_package/conanfile.py b/recipes/xkeyboard-config/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..510f8a1855391 --- /dev/null +++ b/recipes/xkeyboard-config/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "pkg_config" + + def build(self): + pass + + def test(self): + self.run("pkg-config --validate ./xkeyboard-config.pc") diff --git a/recipes/xkeyboard-config/config.yml b/recipes/xkeyboard-config/config.yml new file mode 100644 index 0000000000000..76a338dd54cee --- /dev/null +++ b/recipes/xkeyboard-config/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: "all" From 111b041a4c931581416cd41f20496d735bab3667 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 20 Oct 2022 05:44:34 +0900 Subject: [PATCH 520/561] (#13609) aws-c-mqtt: change dependant recipe version for aws-crt-cpp --- recipes/aws-c-mqtt/all/conanfile.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/recipes/aws-c-mqtt/all/conanfile.py b/recipes/aws-c-mqtt/all/conanfile.py index 6c335e69cc40c..4edb02ac94d9f 100644 --- a/recipes/aws-c-mqtt/all/conanfile.py +++ b/recipes/aws-c-mqtt/all/conanfile.py @@ -1,11 +1,7 @@ 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.files import get, copy, rmdir from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.env import VirtualBuildEnv import os @@ -51,8 +47,12 @@ def configure(self): def requirements(self): self.requires("aws-c-common/0.8.2") self.requires("aws-c-cal/0.5.13") - self.requires("aws-c-io/0.13.4") - self.requires("aws-c-http/0.6.22") + if Version(self.version) < "0.7.12": + self.requires("aws-c-io/0.10.20") + self.requires("aws-c-http/0.6.13") + else: + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") def layout(self): cmake_layout(self, src_folder="src") From 7154dbe7cf2618faeff1804730978c99651ee145 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 19 Oct 2022 23:26:29 +0200 Subject: [PATCH 521/561] (#13600) emsdk: fixes for conan 2.x client --- recipes/emsdk/all/conanfile.py | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/recipes/emsdk/all/conanfile.py b/recipes/emsdk/all/conanfile.py index 8f8aa6a455299..b9f626ca08eef 100644 --- a/recipes/emsdk/all/conanfile.py +++ b/recipes/emsdk/all/conanfile.py @@ -1,12 +1,13 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.build import cross_building from conan.tools.env import Environment from conan.tools.files import chdir, copy, get, replace_in_file from conan.tools.layout import basic_layout +from conan.tools.scm import Version import json import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.52.0" class EmSDKConan(ConanFile): @@ -24,6 +25,9 @@ class EmSDKConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): self.requires("nodejs/16.3.0") # self.requires("python") # FIXME: Not available as Conan package @@ -33,9 +37,6 @@ def package_id(self): del self.info.settings.compiler del self.info.settings.build_type - def layout(self): - basic_layout(self, src_folder="src") - def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -71,8 +72,7 @@ def generate(self): env.define_path("EMSCRIPTEN", self._emscripten) env.define_path("EM_CONFIG", self._em_config) env.define_path("EM_CACHE", self._em_cache) - envvars = env.vars(self, scope="emsdk") - envvars.save_script("emsdk_env_file") + env.vars(self, scope="emsdk").save_script("emsdk_env_file") @staticmethod def _chmod_plus_x(filename): @@ -176,16 +176,16 @@ def package_info(self): os.path.join("bin", "upstream", "lib", "cmake", "llvm"), ] - # TODO: conan v1 stuff, to remove in conan v2? - self.env_info.PATH.extend(self._paths) - self.env_info.CONAN_CMAKE_TOOLCHAIN_FILE = toolchain - self.env_info.EMSDK = self._emsdk - self.env_info.EMSCRIPTEN = self._emscripten - self.env_info.EM_CONFIG = self._em_config - self.env_info.EM_CACHE = self._em_cache - self.env_info.CC = self._define_tool_var("emcc") - self.env_info.CXX = self._define_tool_var("em++") - self.env_info.AR = self._define_tool_var("emar") - self.env_info.NM = self._define_tool_var("emnm") - self.env_info.RANLIB = self._define_tool_var("emranlib") - self.env_info.STRIP = self._define_tool_var("emstrip") + if Version(conan_version).major < 2: + self.env_info.PATH.extend(self._paths) + self.env_info.CONAN_CMAKE_TOOLCHAIN_FILE = toolchain + self.env_info.EMSDK = self._emsdk + self.env_info.EMSCRIPTEN = self._emscripten + self.env_info.EM_CONFIG = self._em_config + self.env_info.EM_CACHE = self._em_cache + self.env_info.CC = self._define_tool_var("emcc") + self.env_info.CXX = self._define_tool_var("em++") + self.env_info.AR = self._define_tool_var("emar") + self.env_info.NM = self._define_tool_var("emnm") + self.env_info.RANLIB = self._define_tool_var("emranlib") + self.env_info.STRIP = self._define_tool_var("emstrip") From a85bc262f961f766ac38949314705715c473cd5a Mon Sep 17 00:00:00 2001 From: Quentin Chateau Date: Thu, 20 Oct 2022 00:24:31 +0100 Subject: [PATCH 522/561] (#13615) amqp-cpp: add version 4.3.18 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/) --- recipes/amqp-cpp/all/conandata.yml | 6 ++++++ recipes/amqp-cpp/config.yml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/recipes/amqp-cpp/all/conandata.yml b/recipes/amqp-cpp/all/conandata.yml index b1762b6aca57f..2543d0dc3e3ba 100644 --- a/recipes/amqp-cpp/all/conandata.yml +++ b/recipes/amqp-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.18": + url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.18.tar.gz" + sha256: "cc2c1fc5da00a1778c2804306e06bdedc782a5f74762b9d9b442d3a498dd0c4f" "4.3.16": url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.16.tar.gz" sha256: "66c96e0db1efec9e7ddcf7240ff59a073d68c09752bd3e94b8bc4c506441fbf7" @@ -21,6 +24,9 @@ sources: url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.1.5.tar.gz" sha256: "9840c7fb17bb0c0b601d269e528b7f9cac5ec008dcf8d66bef22434423b468aa" patches: + "4.3.18": + - patch_file: "patches/0001-cmake-openssl-install-directories.patch" + base_path: "source_subfolder" "4.3.16": - patch_file: "patches/0001-cmake-openssl-install-directories.patch" base_path: "source_subfolder" diff --git a/recipes/amqp-cpp/config.yml b/recipes/amqp-cpp/config.yml index 25894cbf035c2..81db570a6cd83 100644 --- a/recipes/amqp-cpp/config.yml +++ b/recipes/amqp-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.18": + folder: all "4.3.16": folder: all "4.3.11": From caff0f9a73cac6775746f9903fd9d524fb6513d5 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 20 Oct 2022 09:04:58 +0200 Subject: [PATCH 523/561] (#13624) harfbuzz: add version 5.3.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/harfbuzz/all/conandata.yml | 6 ++++++ recipes/harfbuzz/config.yml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml index f77bff879e408..c11b81c2d63a5 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -14,6 +14,9 @@ sources: "5.3.0": url: "https://github.com/harfbuzz/harfbuzz/archive/5.3.0.tar.gz" sha256: "94712b8cdae68f0b585ec8e3cd8c5160fdc241218119572236497a62dae770de" + "5.3.1": + url: "https://github.com/harfbuzz/harfbuzz/archive/5.3.1.tar.gz" + sha256: "77c8c903f4539b050a6d3a5be79705c7ccf7b1cb66d68152a651486e261edbd2" patches: "3.2.0": - patch_file: "patches/icu-3.0.x.patch" @@ -30,3 +33,6 @@ patches: "5.3.0": - patch_file: "patches/icu-5.2.x.patch" base_path: "source_subfolder" + "5.3.1": + - patch_file: "patches/icu-5.2.x.patch" + base_path: "source_subfolder" diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml index 864b963b7b4b1..72fcc32e11537 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -9,3 +9,5 @@ versions: folder: all "5.3.0": folder: all + "5.3.1": + folder: all From c7c1d8fd7d5b69ad8750ee5fcf96176f79f9ef69 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 20 Oct 2022 16:44:06 +0900 Subject: [PATCH 524/561] (#13499) glaze: add recipe * glaze: add recipe * fix license filename * update required gcc version * update required gcc version * update required conan version Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * update to 0.0.7 * update compiler minimum version * drop support apple-clang * only libdirs is set empty Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * fix recipe name Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * update conan version Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * support apple-clang >= 13.1 * use loose_lt_semvar * fix _min_cppstd * try to fix error C2039 * revert test_package Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/glaze/all/conandata.yml | 4 + recipes/glaze/all/conanfile.py | 81 +++++++++++++++++++ recipes/glaze/all/test_package/CMakeLists.txt | 9 +++ recipes/glaze/all/test_package/conanfile.py | 26 ++++++ .../glaze/all/test_package/test_package.cpp | 33 ++++++++ .../glaze/all/test_v1_package/CMakeLists.txt | 12 +++ .../glaze/all/test_v1_package/conanfile.py | 18 +++++ recipes/glaze/config.yml | 3 + 8 files changed, 186 insertions(+) create mode 100644 recipes/glaze/all/conandata.yml create mode 100644 recipes/glaze/all/conanfile.py create mode 100644 recipes/glaze/all/test_package/CMakeLists.txt create mode 100644 recipes/glaze/all/test_package/conanfile.py create mode 100644 recipes/glaze/all/test_package/test_package.cpp create mode 100644 recipes/glaze/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glaze/all/test_v1_package/conanfile.py create mode 100644 recipes/glaze/config.yml diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml new file mode 100644 index 0000000000000..3c9390d824cd8 --- /dev/null +++ b/recipes/glaze/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.7": + url: "https://github.com/stephenberry/glaze/archive/refs/tags/v0.0.7.tar.gz" + sha256: "124f7e8fea58c012b548ba1b643684fe428c7dbfeb8d8a5f701eb7db4356a759" diff --git a/recipes/glaze/all/conanfile.py b/recipes/glaze/all/conanfile.py new file mode 100644 index 0000000000000..48e0bafc31ad8 --- /dev/null +++ b/recipes/glaze/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.1" + +class GlazeConan(ConanFile): + name = "glaze" + description = "Extremely fast, in memory, JSON and interface library for modern C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/stephenberry/glaze" + topics = ("json", "memory", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _minimum_cpp_standard(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "11", + "clang": "12", + "apple-clang": "13.1", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("fmt/9.1.0") + self.requires("fast_float/3.5.1") + self.requires("frozen/1.1.1") + self.requires("nanorange/20200505") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++{self._minimum_cpp_standard}, which your compiler does not support.", + ) + + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/glaze/all/test_package/CMakeLists.txt b/recipes/glaze/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fb31b1bd6ba68 --- /dev/null +++ b/recipes/glaze/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) + +find_package(glaze REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glaze::glaze) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/glaze/all/test_package/conanfile.py b/recipes/glaze/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/glaze/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/glaze/all/test_package/test_package.cpp b/recipes/glaze/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..19dbb41c1ae8f --- /dev/null +++ b/recipes/glaze/all/test_package/test_package.cpp @@ -0,0 +1,33 @@ +#include "glaze/glaze.hpp" +#include "glaze/json/json_ptr.hpp" +#include "glaze/api/impl.hpp" + +struct my_struct +{ + int i = 287; + double d = 3.14; + std::string hello = "Hello World"; + std::array arr = { 1, 2, 3 }; +}; + +template <> +struct glz::meta { + using T = my_struct; + static constexpr auto value = object( + "i", &T::i, + "d", &T::d, + "hello", &T::hello, + "arr", &T::arr + ); +}; + +int main(void) { + std::string buffer = R"({"i":287,"d":3.14,"hello":"Hello World","arr":[1,2,3]})"; + auto s = glz::read_json(buffer); + + (void)s.d; + (void)s.hello; + (void)s.arr; + + return 0; +} diff --git a/recipes/glaze/all/test_v1_package/CMakeLists.txt b/recipes/glaze/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..c8562496a9de8 --- /dev/null +++ b/recipes/glaze/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.12) + +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(glaze REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE glaze::glaze) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/glaze/all/test_v1_package/conanfile.py b/recipes/glaze/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/glaze/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml new file mode 100644 index 0000000000000..3b1adbf0ba92f --- /dev/null +++ b/recipes/glaze/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.7": + folder: all From 9c774bfc60da85e5ae3be4f469f115ef9492ef68 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:24:27 +0200 Subject: [PATCH 525/561] (#13611) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/v2_migration.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/v2_migration.md b/docs/v2_migration.md index f14a69ce855cc..2d2430b246c1f 100644 --- a/docs/v2_migration.md +++ b/docs/v2_migration.md @@ -10,6 +10,7 @@ Conan v2 in pull requests. * [Using Layout](#using-layout) * [With New Generators](#with-new-generators) * [With Multiple Build Helpers](#with-multiple-build-helpers) + * [New conf_info properties](#new-conf_info-properties) * [New cpp_info set_property model](#new-cpp_info-set_property-model) * [CMakeDeps](#cmakedeps) * [Update required_conan_version to ">=1.43.0"](#update-required_conan_version-to-1430) From 1739efa84bd8f198cc1e5b162e16935f5647c0a6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 20 Oct 2022 11:24:00 +0200 Subject: [PATCH 526/561] (#13617) zopfli: fixes for conan v2 client --- recipes/zopfli/all/conanfile.py | 25 +++++++++----------- recipes/zopfli/all/test_package/conanfile.py | 7 +++--- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/recipes/zopfli/all/conanfile.py b/recipes/zopfli/all/conanfile.py index 8427cd77b7996..1f0b88e512435 100644 --- a/recipes/zopfli/all/conanfile.py +++ b/recipes/zopfli/all/conanfile.py @@ -1,9 +1,10 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class ZopfliConan(ConanFile): @@ -33,7 +34,10 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass try: del self.settings.compiler.libcxx except Exception: @@ -82,14 +86,7 @@ def package_info(self): self.cpp_info.components["libzopflipng"].libs = ["zopflipng"] self.cpp_info.components["libzopflipng"].requires = ["libzopfli"] - bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bin_path}") - self.env_info.PATH.append(bin_path) - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "Zopfli" - self.cpp_info.names["cmake_find_package_multi"] = "Zopfli" - self.cpp_info.components["libzopfli"].names["cmake_find_package"] = "libzopfli" - self.cpp_info.components["libzopfli"].names["cmake_find_package_multi"] = "libzopfli" - self.cpp_info.components["libzopflipng"].names["cmake_find_package"] = "libzopflipng" - self.cpp_info.components["libzopflipng"].names["cmake_find_package_multi"] = "libzopflipng" + if Version(conan_version).major < 2: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.cpp_info.names["cmake_find_package"] = "Zopfli" + self.cpp_info.names["cmake_find_package_multi"] = "Zopfli" diff --git a/recipes/zopfli/all/test_package/conanfile.py b/recipes/zopfli/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/zopfli/all/test_package/conanfile.py +++ b/recipes/zopfli/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() From c2c60d9c04c8c0fa8bb80e12796aed967cbb2c98 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 20 Oct 2022 12:24:17 +0200 Subject: [PATCH 527/561] (#13616) xerces-c: hotfix - honor `shared=False` option * honor shared=False option * improve conan v2 client support --- recipes/xerces-c/all/conanfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/xerces-c/all/conanfile.py b/recipes/xerces-c/all/conanfile.py index de59d70169466..30133690332a3 100644 --- a/recipes/xerces-c/all/conanfile.py +++ b/recipes/xerces-c/all/conanfile.py @@ -1,8 +1,9 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration from conan.tools.env import VirtualBuildEnv from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.52.0" @@ -82,11 +83,7 @@ def _validate(self, option, value, os): OS(es) that `value` is valid on """ if self.info.settings.os not in os and getattr(self.info.options, option) == value: - raise ConanInvalidConfiguration( - "Option '{option}={value}' is only supported on {os}".format( - option=option, value=value, os=os - ) - ) + raise ConanInvalidConfiguration(f"Option '{option}={value}' is only supported on {os}") def validate(self): if self.info.settings.os not in ("Windows", "Macos", "Linux"): @@ -113,6 +110,8 @@ def generate(self): env = VirtualBuildEnv(self) env.generate() tc = CMakeToolchain(self) + # Because upstream overrides BUILD_SHARED_LIBS as a CACHE variable + tc.cache_variables["BUILD_SHARED_LIBS"] = "ON" if self.options.shared else "OFF" # https://xerces.apache.org/xerces-c/build-3.html tc.variables["network-accessor"] = self.options.network_accessor tc.variables["transcoder"] = self.options.transcoder @@ -153,5 +152,6 @@ def package_info(self): elif self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") - self.cpp_info.names["cmake_find_package"] = "XercesC" - self.cpp_info.names["cmake_find_package_multi"] = "XercesC" + if Version(conan_version).major < 2: + self.cpp_info.names["cmake_find_package"] = "XercesC" + self.cpp_info.names["cmake_find_package_multi"] = "XercesC" From c50e33ce20fe4436fe57ae0654bb6c7efe660c42 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 20 Oct 2022 13:05:08 +0200 Subject: [PATCH 528/561] (#13604) xkbcommon: finer grain requirements --- recipes/xkbcommon/all/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 633209750e95b..f4a785f15eee6 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -53,7 +53,9 @@ def configure(self): del self.settings.compiler.cppstd def requirements(self): - self.requires("xorg/system") + self.requires("xkeyboard-config/system") + if self.options.with_x11: + self.requires("xorg/system") if self.options.get_safe("xkbregistry"): self.requires("libxml2/2.9.14") if self.options.get_safe("with_wayland"): @@ -121,7 +123,7 @@ def package(self): def package_info(self): self.cpp_info.components["libxkbcommon"].set_property("pkg_config_name", "xkbcommon") self.cpp_info.components["libxkbcommon"].libs = ["xkbcommon"] - self.cpp_info.components["libxkbcommon"].requires = ["xorg::xkeyboard-config"] + self.cpp_info.components["libxkbcommon"].requires = ["xkeyboard-config::xkeyboard-config"] self.cpp_info.components["libxkbcommon"].resdirs = ["res"] if self.options.with_x11: From 7c6b9e4606b22281b00557b6e8ee8e09f6a99c54 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 20 Oct 2022 15:25:10 +0200 Subject: [PATCH 529/561] (#13564) Add libmicrohttpd/0.9.75 recipe * Add libmicrohttpd/0.9.75 recipe * libmicrohttpd: fix test-package directory name * libmicrohttpd: fix test_package + address feedback * libmicrohttpd: 1.52.0 will do * libmicrohttpd: experimental patch to fix VS2017 * libmicrohttpd: fix MSVC MT * libmicrohttpd: use conantoolchain.props * libmicrohttpd: clean-up * Turns out conan knew how to do it after all * Use PkgConfigDeps * catch removing fPIC * Set win_bash attribute * Use conan vs AutotoolsToolchain + Autotools * Apply suggestions from code review Co-authored-by: Uilian Ries Co-authored-by: Jordan Williams * copy LICENSE from source_folder Co-authored-by: Uilian Ries Co-authored-by: Jordan Williams --- recipes/libmicrohttpd/all/conandata.yml | 9 + recipes/libmicrohttpd/all/conanfile.py | 199 ++++++++++++++++++ .../0.9.75-0001-msbuild-RuntimeLibrary.patch | 35 +++ .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 30 +++ .../all/test_package/test_package.c | 74 +++++++ .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 17 ++ recipes/libmicrohttpd/config.yml | 3 + 9 files changed, 384 insertions(+) create mode 100644 recipes/libmicrohttpd/all/conandata.yml create mode 100644 recipes/libmicrohttpd/all/conanfile.py create mode 100644 recipes/libmicrohttpd/all/patches/0.9.75-0001-msbuild-RuntimeLibrary.patch create mode 100644 recipes/libmicrohttpd/all/test_package/CMakeLists.txt create mode 100644 recipes/libmicrohttpd/all/test_package/conanfile.py create mode 100644 recipes/libmicrohttpd/all/test_package/test_package.c create mode 100644 recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmicrohttpd/all/test_v1_package/conanfile.py create mode 100644 recipes/libmicrohttpd/config.yml diff --git a/recipes/libmicrohttpd/all/conandata.yml b/recipes/libmicrohttpd/all/conandata.yml new file mode 100644 index 0000000000000..baf8560b8d3f1 --- /dev/null +++ b/recipes/libmicrohttpd/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.9.75": + url: "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.75.tar.gz" + sha256: "9278907a6f571b391aab9644fd646a5108ed97311ec66f6359cebbedb0a4e3bb" +patches: + "0.9.75": + - patch_file: "patches/0.9.75-0001-msbuild-RuntimeLibrary.patch" + patch_description: "Remove RuntimeLibrary from vcxproject + use conantoolchain.props" + patch_type: "conan" diff --git a/recipes/libmicrohttpd/all/conanfile.py b/recipes/libmicrohttpd/all/conanfile.py new file mode 100644 index 0000000000000..8c7a9d8fa18cb --- /dev/null +++ b/recipes/libmicrohttpd/all/conanfile.py @@ -0,0 +1,199 @@ +from conan import ConanFile, Version +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.microsoft import MSBuild, MSBuildToolchain, is_msvc, vs_layout +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + + +class LibmicrohttpdConan(ConanFile): + name = "libmicrohttpd" + description = "A small C library that is supposed to make it easy to run an HTTP server" + homepage = "https://www.gnu.org/software/libmicrohttpd/" + topics = ("httpd", "server", "service") + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_https": [True, False], + "with_error_messages": [True, False], + "with_postprocessor": [True, False], + "with_digest_authentification": [True, False], + "epoll": [True, False], + "with_zlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_https": False, # FIXME: should be True, but gnutls is not yet available in cci + "with_error_messages": True, + "with_postprocessor": True, + "with_digest_authentification": True, + "epoll": True, + "with_zlib": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def config_options(self): + if self.settings.os != "Linux": + try: + del self.options.fPIC + except Exception: + pass + del self.options.epoll + if is_msvc(self): + del self.options.with_https + del self.options.with_error_messages + del self.options.with_postprocessor + del self.options.with_digest_authentification + del self.options.with_zlib + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def validate(self): + if is_msvc(self): + if self.info.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration("Unsupported architecture (only x86 and x86_64 are supported)") + if self.info.settings.build_type not in ("Release", "Debug"): + raise ConanInvalidConfiguration("Unsupported build type (only Release and Debug are supported)") + + def requirements(self): + if self.options.get_safe("with_zlib", False): + self.requires("zlib/1.2.13") + if self.options.get_safe("with_https", False): + raise ConanInvalidConfiguration("gnutls is not (yet) available in cci") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not is_msvc(self): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + if is_msvc(self): + vs_layout(self) + else: + basic_layout(self) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msvc_configuration + tc.generate() + else: + yes_no = lambda v: "yes" if v else "no" + pkg = PkgConfigDeps(self) + pkg.generate() + autotools = AutotoolsToolchain(self) + autotools.configure_args.extend([ + f"--enable-shared={yes_no(self.options.shared)}", + f"--enable-static={yes_no(not self.options.shared)}", + f"--enable-https={yes_no(self.options.with_https)}", + f"--enable-messages={yes_no(self.options.with_error_messages)}", + f"--enable-postprocessor={yes_no(self.options.with_postprocessor)}", + f"--enable-dauth={yes_no(self.options.with_digest_authentification)}", + f"--enable-epoll={yes_no(self.options.get_safe('epoll'))}", + "--disable-doc", + "--disable-examples", + "--disable-curl", + ]) + if self.settings.os == "Windows": + if self.options.with_zlib: + # This fixes libtool refusing to build a shared library when it sees `-lz` + libdir = self.deps_cpp_info["zlib"].lib_paths[0] + autotools.extra_ldflags.extend([os.path.join(libdir, lib).replace("\\", "/") for lib in os.listdir(libdir)]) + autotools.generate() + + @property + def _msvc_configuration(self): + return f"{self.settings.build_type}-{'dll' if self.options.shared else 'static'}" + + @property + def _msvc_sln_folder(self): + if self.settings.compiler == "Visual Studio": + if Version(self.settings.compiler.version) >= 16: + subdir = "VS-Any-Version" + else: + subdir = "VS2017" + else: + subdir = "VS-Any-Version" + return os.path.join("w32", subdir) + + @property + def _msvc_arch(self): + return { + "x86": "Win32", + "x86_64": "x64", + }[str(self.settings.arch)] + + def _patch_sources(self): + apply_conandata_patches(self) + + def build(self): + self._patch_sources() + if is_msvc(self): + msbuild = MSBuild(self) + msbuild.build_type = self._msvc_configuration + msbuild.build(sln=os.path.join(self._msvc_sln_folder, "libmicrohttpd.sln"), targets=["libmicrohttpd"]) + else: + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", os.path.join(self.source_folder), os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, "*.lib", os.path.join(self.build_folder, self._msvc_sln_folder, "Output", self._msvc_arch), os.path.join(self.package_folder, "lib")) + copy(self, "*.dll", os.path.join(self.build_folder, self._msvc_sln_folder, "Output", self._msvc_arch), os.path.join(self.package_folder, "bin")) + copy(self, "*.h", os.path.join(self.build_folder, self._msvc_sln_folder, "Output", self._msvc_arch), os.path.join(self.package_folder, "include")) + else: + autotools = Autotools(self) + autotools.install() + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libmicrohttps") + libname = "microhttpd" + if is_msvc(self): + libname = "libmicrohttpd" + if self.options.shared: + libname += "-dll" + if self.settings.build_type == "Debug": + libname += "_d" + self.cpp_info.libs = [libname] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread"] + elif self.settings.os == "Windows": + if self.options.shared: + self.cpp_info.defines.append("MHD_W32DLL") + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/libmicrohttpd/all/patches/0.9.75-0001-msbuild-RuntimeLibrary.patch b/recipes/libmicrohttpd/all/patches/0.9.75-0001-msbuild-RuntimeLibrary.patch new file mode 100644 index 0000000000000..b3dc82df26fa9 --- /dev/null +++ b/recipes/libmicrohttpd/all/patches/0.9.75-0001-msbuild-RuntimeLibrary.patch @@ -0,0 +1,35 @@ +--- w32/common/common-build-settings.vcxproj ++++ w32/common/common-build-settings.vcxproj +@@ -5,7 +5,7 @@ + Only 0 and 1 are used currently --> + 0 + 1 +- ++ + + $(SolutionDir);$(MhdW32Common);$(MhdSrc)include;$(IncludePath) + +--- w32/common/libmicrohttpd-build-settings.vcxproj ++++ w32/common/libmicrohttpd-build-settings.vcxproj +@@ -31,8 +31,8 @@ + + + _LIB;MHD_W32LIB;%(PreprocessorDefinitions) +- MultiThreadedDebug +- MultiThreaded ++ + + + Ws2_32.lib +@@ -45,8 +45,8 @@ + + + _USRDLL;MHD_W32DLL;%(PreprocessorDefinitions) +- MultiThreadedDebugDLL +- MultiThreadedDLL ++ + + + Ws2_32.lib;%(AdditionalDependencies) diff --git a/recipes/libmicrohttpd/all/test_package/CMakeLists.txt b/recipes/libmicrohttpd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..534adba0c584f --- /dev/null +++ b/recipes/libmicrohttpd/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmicrohttpd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmicrohttpd::libmicrohttpd) diff --git a/recipes/libmicrohttpd/all/test_package/conanfile.py b/recipes/libmicrohttpd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f72d1f660e19f --- /dev/null +++ b/recipes/libmicrohttpd/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmicrohttpd/all/test_package/test_package.c b/recipes/libmicrohttpd/all/test_package/test_package.c new file mode 100644 index 0000000000000..cb40829c7a43b --- /dev/null +++ b/recipes/libmicrohttpd/all/test_package/test_package.c @@ -0,0 +1,74 @@ +#include +#include +#include +#include + +#define PORT 8888 +#define PAGE \ + "" \ + "" \ + "libmicrohttpd demo" \ + "" \ + "" \ + "libmicrohttpd demo" \ + "" \ + "" + +static enum MHD_Result ahc_echo(void * cls, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + long unsigned int *upload_data_size, + void **con_cls) { + struct MHD_Response *response; + int ret; + + if (strcmp(method, "GET") != 0) { + /** + * unexpected method + */ + return MHD_NO; + } + if (*con_cls == NULL) { + /** + * The first time only the headers are valid, + * do not respond in the first round. + * But accept the connection. + */ + *con_cls = connection; + return MHD_YES; + } + if (*upload_data_size != 0) { + /** + * upload data in a GET!? + */ + return MHD_NO; + } + response = MHD_create_response_from_buffer(strlen(PAGE), (void*)PAGE, MHD_RESPMEM_PERSISTENT); + ret = MHD_queue_response(connection, MHD_HTTP_OK, response); + MHD_destroy_response(response); + return ret; +} + +int main(int argc, char *argv[]) { + struct MHD_Daemon *daemon; + + // Don't open a port and do not block so CI isn't interrupted. +#if 0 + daemon = MHD_start_daemon(MHD_USE_INTERNAL_POLLING_THREAD, + PORT, NULL, NULL, + &ahc_echo, NULL, MHD_OPTION_END); + if (daemon == NULL) { + return 1; + } + + (void)getchar(); +#else + daemon = NULL; +#endif + + MHD_stop_daemon(daemon); + return 0; +} diff --git a/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt b/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b95e58322269 --- /dev/null +++ b/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(libmicrohttpd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmicrohttpd::libmicrohttpd) diff --git a/recipes/libmicrohttpd/all/test_v1_package/conanfile.py b/recipes/libmicrohttpd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libmicrohttpd/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libmicrohttpd/config.yml b/recipes/libmicrohttpd/config.yml new file mode 100644 index 0000000000000..48e6a23d34df6 --- /dev/null +++ b/recipes/libmicrohttpd/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.75": + folder: all From f0cdd767dc5b25acace1b82b22eea3bc3cb3b66c Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 20 Oct 2022 22:44:49 +0900 Subject: [PATCH 530/561] (#13608) aws-c-event-stream: change dependant recipe version for aws-crt-cpp * aws-c-event-stream: change dependant recipe version for aws-crt-cpp * link aws-c-io/0.13.4 on aws-c-event-stream/0.2.12 * fix condition for aws-c-io --- recipes/aws-c-event-stream/all/conanfile.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/recipes/aws-c-event-stream/all/conanfile.py b/recipes/aws-c-event-stream/all/conanfile.py index aa10e76f28262..25bb2fd989f0a 100644 --- a/recipes/aws-c-event-stream/all/conanfile.py +++ b/recipes/aws-c-event-stream/all/conanfile.py @@ -52,7 +52,10 @@ def requirements(self): self.requires("aws-checksums/0.1.13") self.requires("aws-c-common/0.8.2") if Version(self.version) >= "0.2": - self.requires("aws-c-io/0.13.4") + if Version(self.version) < "0.2.11": + self.requires("aws-c-io/0.10.20") + else: + self.requires("aws-c-io/0.13.4") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -83,13 +86,15 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-event-stream") self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-event-stream") - self.cpp_info.filenames["cmake_find_package"] = "aws-c-event-stream" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-event-stream" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package"] = "aws-c-event-stream" self.cpp_info.components["aws-c-event-stream-lib"].names["cmake_find_package_multi"] = "aws-c-event-stream" self.cpp_info.components["aws-c-event-stream-lib"].libs = ["aws-c-event-stream"] self.cpp_info.components["aws-c-event-stream-lib"].requires = ["aws-c-common::aws-c-common-lib", "aws-checksums::aws-checksums"] if Version(self.version) >= "0.2": self.cpp_info.components["aws-c-event-stream-lib"].requires.append("aws-c-io::aws-c-io-lib") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "aws-c-event-stream" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-event-stream" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" From 86de5edf37c74befdcd1a318bee352d15a01e675 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 20 Oct 2022 16:25:52 +0200 Subject: [PATCH 531/561] (#13618) spdlog: several fixes for conan v2 client * several fixes for conan v2 client * remove skip pylint * minor changes in test package * typo --- recipes/spdlog/all/conanfile.py | 83 ++++++++----------- .../spdlog/all/test_package/CMakeLists.txt | 6 +- recipes/spdlog/all/test_package/conanfile.py | 8 +- .../spdlog/all/test_v1_package/CMakeLists.txt | 6 +- .../spdlog/all/test_v1_package/conanfile.py | 1 - 5 files changed, 46 insertions(+), 58 deletions(-) diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py index 587094502d41f..5bafad4b2bab4 100644 --- a/recipes/spdlog/all/conanfile.py +++ b/recipes/spdlog/all/conanfile.py @@ -1,18 +1,13 @@ -from conan import ConanFile +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import get, copy, rmdir, replace_in_file -from conan.tools.scm import Version from conan.tools.microsoft import is_msvc_static_runtime -from conan.tools.build import check_min_cppstd -from conan.errors import ConanInvalidConfiguration - -# TODO: Need to be ported for Conan 2.0 -from conans import __version__ as conan_version - +from conan.tools.scm import Version import os - -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class SpdlogConan(ConanFile): @@ -45,46 +40,45 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: - del self.options.fPIC + if self.options.shared or self.options.header_only: + try: + del self.options.fPIC + except Exception: + pass if self.options.header_only: del self.options.shared - del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - # TODO: Remove in Conan 2.0 - 1.x self.requires does not support transitive_headers - requires = lambda ref: self.requires(ref, transitive_headers=True) if Version(conan_version) >= "2.0.0-beta" else self.requires(ref) if Version(self.version) >= "1.10.0": - requires("fmt/8.1.1") + self.requires("fmt/8.1.1", transitive_headers=True) elif Version(self.version) >= "1.9.0": - requires("fmt/8.0.1") + self.requires("fmt/8.0.1", transitive_headers=True) elif Version(self.version) >= "1.7.0": - requires("fmt/7.1.3") + self.requires("fmt/7.1.3", transitive_headers=True) elif Version(self.version) >= "1.5.0": - requires("fmt/6.2.1") + self.requires("fmt/6.2.1", transitive_headers=True) else: - requires("fmt/6.0.0") + self.requires("fmt/6.0.0", transitive_headers=True) def package_id(self): if self.info.options.header_only: self.info.clear() - def validate(self): + @property + def _info(self): # FIXME: Conan 1.x is not able to parse self.info.xxx as Conan 2.x when is header-only - if Version(conan_version) >= "2.0.0-beta": - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, 11) - if self.info.settings.os != "Windows" and (self.info.options.wchar_support or self.info.options.wchar_filenames): - raise ConanInvalidConfiguration("wchar is only supported under windows") - if not self.info.options.header_only and self.info.options.shared and is_msvc_static_runtime(self): - raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") - else: - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) - if self.settings.os != "Windows" and (self.options.wchar_support or self.options.wchar_filenames): - raise ConanInvalidConfiguration("wchar is only supported under windows") - if self.options.get_safe("shared") and is_msvc_static_runtime(self): - raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") + return self if Version(conan_version).major < 2 else self.info + + def validate(self): + if self._info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self._info.settings.os != "Windows" and (self._info.options.wchar_support or self._info.options.wchar_filenames): + raise ConanInvalidConfiguration("wchar is only supported under windows") + if self._info.options.get_safe("shared") and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -112,9 +106,6 @@ def generate(self): cmake_deps = CMakeDeps(self) cmake_deps.generate() - def layout(self): - cmake_layout(self, src_folder="src") - def _disable_werror(self): replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), "/WX", "") @@ -137,21 +128,13 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "spdlog", "cmake")) def package_info(self): - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "spdlog" - self.cpp_info.names["cmake_find_package_multi"] = "spdlog" - target = "spdlog_header_only" if self.options.header_only else "spdlog" self.cpp_info.set_property("cmake_file_name", "spdlog") self.cpp_info.set_property("cmake_target_name", f"spdlog::{target}") self.cpp_info.set_property("pkg_config_name", "spdlog") - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["libspdlog"].names["cmake_find_package"] = target - self.cpp_info.components["libspdlog"].names["cmake_find_package_multi"] = target - + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["libspdlog"].set_property("cmake_target_name", f"spdlog::{target}") - self.cpp_info.components["libspdlog"].defines.append("SPDLOG_FMT_EXTERNAL") self.cpp_info.components["libspdlog"].requires = ["fmt::fmt"] @@ -169,3 +152,9 @@ def package_info(self): self.cpp_info.components["libspdlog"].system_libs = ["pthread"] if self.options.header_only and self.settings.os in ("iOS", "tvOS", "watchOS"): self.cpp_info.components["libspdlog"].defines.append("SPDLOG_NO_TLS") + + if Version(conan_version).major < 2: + self.cpp_info.names["cmake_find_package"] = "spdlog" + self.cpp_info.names["cmake_find_package_multi"] = "spdlog" + self.cpp_info.components["libspdlog"].names["cmake_find_package"] = target + self.cpp_info.components["libspdlog"].names["cmake_find_package_multi"] = target diff --git a/recipes/spdlog/all/test_package/CMakeLists.txt b/recipes/spdlog/all/test_package/CMakeLists.txt index ea09f0379c1df..d31b151d6390c 100644 --- a/recipes/spdlog/all/test_package/CMakeLists.txt +++ b/recipes/spdlog/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(spdlog REQUIRED CONFIG) @@ -9,4 +9,4 @@ if(SPDLOG_HEADER_ONLY) else() target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog) endif() -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/spdlog/all/test_package/conanfile.py b/recipes/spdlog/all/test_package/conanfile.py index 955c3ad982c55..81d7c956cf9d2 100644 --- a/recipes/spdlog/all/test_package/conanfile.py +++ b/recipes/spdlog/all/test_package/conanfile.py @@ -7,9 +7,12 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" + def layout(self): + cmake_layout(self) + def requirements(self): self.requires(self.tested_reference_str) @@ -18,9 +21,6 @@ def generate(self): tc.variables["SPDLOG_HEADER_ONLY"] = self.dependencies["spdlog"].options.header_only tc.generate() - def layout(self): - cmake_layout(self) - def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/spdlog/all/test_v1_package/CMakeLists.txt b/recipes/spdlog/all/test_v1_package/CMakeLists.txt index cd849cdc0106b..d4c436ff651fb 100644 --- a/recipes/spdlog/all/test_v1_package/CMakeLists.txt +++ b/recipes/spdlog/all/test_v1_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) @@ -12,4 +12,4 @@ if(TARGET spdlog::spdlog_header_only) else() target_link_libraries(${PROJECT_NAME} spdlog::spdlog) endif() -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/spdlog/all/test_v1_package/conanfile.py b/recipes/spdlog/all/test_v1_package/conanfile.py index 7f150735d0b8a..30ca1d12b0933 100644 --- a/recipes/spdlog/all/test_v1_package/conanfile.py +++ b/recipes/spdlog/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os From 26482f91372185694dce3fff8bd2ae0711a49622 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 21 Oct 2022 10:25:16 +0200 Subject: [PATCH 532/561] (#13629) meson-template: several improvements - remove ninja from tool_requires, it's the job of meson recipe to require ninja or not - fix install_name of shared libs on macOS - do not add pkgconf to tool_requires if 'tools.gnu:pkg_config' config is set --- .../meson_package/all/conanfile.py | 34 ++++++++++--------- .../all/test_package/conanfile.py | 17 +++++----- .../all/test_v1_package/conanfile.py | 3 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/package_templates/meson_package/all/conanfile.py b/docs/package_templates/meson_package/all/conanfile.py index 5305b9ba492e7..53a839176b8f2 100644 --- a/docs/package_templates/meson_package/all/conanfile.py +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import check_min_cppstd -from conan.tools.layout import basic_layout -from conan.tools.scm import Version +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.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain, MesonDeps -from conan.tools.env import VirtualBuildEnv +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version import os @@ -39,7 +40,7 @@ class PackageConan(ConanFile): } @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 17 # in case the project requires C++14/17/20/... the minimum compiler version should be listed @@ -87,14 +88,14 @@ def requirements(self): def validate(self): # validate the minimum cpp standard supported. For C++ projects only - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, self._minimum_cpp_standard) + if self.info.settings.compiler.get_safe("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.info.settings.compiler), False) if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + 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.info.options.shared: @@ -102,13 +103,11 @@ 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): - # Meson package is no installed by default on ConanCenterIndex CI + # CCI policy assumes that Meson may not be installed on consumers machine self.tool_requires("meson/0.63.3") - # pkgconf is largely used by Meson, in case needed on Windows, it should be added are build requirement - self.tool_requires("pkgconf/1.9.3") - # Meson uses Ninja as backend by default. Ninja package is not installed by default on ConanCenterIndex - if not self.conf.get("tools.meson.mesontoolchain:backend", default=False, check_type=str): - self.tool_requires("ninja/1.11.1") + # 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/1.9.3") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -130,7 +129,7 @@ def generate(self): tc.generate() # In case there are dependencies listed on build_requirements, VirtualBuildEnv should be used tc = VirtualBuildEnv(self) - tc.generate(scope="build") + tc.generate() def _patch_sources(self): apply_conandata_patches(self) @@ -154,6 +153,9 @@ def package(self): rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + # In shared lib/executable files, meson set install_name (macOS) to lib dir absolute path instead of @rpath, it's not relocatable, so fix it + fix_apple_shared_install_name(self) + def package_info(self): # avoid collect_libs(), prefer explicit library name instead self.cpp_info.libs = ["package_lib"] 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 4738b8f8b2267..287ce44d8a78e 100644 --- a/docs/package_templates/meson_package/all/test_package/conanfile.py +++ b/docs/package_templates/meson_package/all/test_package/conanfile.py @@ -11,22 +11,21 @@ class TestPackageConan(ConanFile): generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" test_type = "explicit" + def layout(self): + basic_layout(self) + def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): self.tool_requires("meson/0.63.3") - self.tool_requires("pkgconf/1.9.3") - if not self.conf.get("tools.meson.mesontoolchain:backend", default=False, check_type=str): - self.tools_requires("ninja/1.11.1") - - def layout(self): - basic_layout(self) + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") def build(self): - cmake = Meson(self) - cmake.configure() - cmake.build() + meson = Meson(self) + meson.configure() + meson.build() def test(self): if can_run(self): diff --git a/docs/package_templates/meson_package/all/test_v1_package/conanfile.py b/docs/package_templates/meson_package/all/test_v1_package/conanfile.py index c571ed9e8d113..c5b074313827d 100644 --- a/docs/package_templates/meson_package/all/test_v1_package/conanfile.py +++ b/docs/package_templates/meson_package/all/test_v1_package/conanfile.py @@ -9,9 +9,8 @@ class TestPackageV1Conan(ConanFile): generators = "pkg_config" def build_requirements(self): - self.build_requires("pkgconf/1.9.3") self.build_requires("meson/0.63.3") - self.build_requires("ninja/1.11.1") + self.build_requires("pkgconf/1.9.3") def build(self): meson = Meson(self) From ee8874d1e0eb68c29474cf5d8115554ba6b91fb0 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 21 Oct 2022 19:04:57 +0900 Subject: [PATCH 533/561] (#13633) aws-crt-cpp: add version 0.18.8 and suppport conan v2 * aws-crt-cpp: add version 0.18.8 and support conan v2 * modify mqtt, event-stream version --- recipes/aws-crt-cpp/all/CMakeLists.txt | 10 -- recipes/aws-crt-cpp/all/conandata.yml | 17 ++- recipes/aws-crt-cpp/all/conanfile.py | 105 ++++++++++-------- .../all/test_package/CMakeLists.txt | 9 +- .../aws-crt-cpp/all/test_package/conanfile.py | 21 +++- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../all/test_v1_package/conanfile.py | 17 +++ recipes/aws-crt-cpp/config.yml | 2 + 8 files changed, 121 insertions(+), 71 deletions(-) delete mode 100644 recipes/aws-crt-cpp/all/CMakeLists.txt create mode 100644 recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/aws-crt-cpp/all/test_v1_package/conanfile.py diff --git a/recipes/aws-crt-cpp/all/CMakeLists.txt b/recipes/aws-crt-cpp/all/CMakeLists.txt deleted file mode 100644 index 38522bd23de5d..0000000000000 --- a/recipes/aws-crt-cpp/all/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/aws-crt-cpp/all/conandata.yml b/recipes/aws-crt-cpp/all/conandata.yml index 723445d104dfe..5615e65f10a0b 100644 --- a/recipes/aws-crt-cpp/all/conandata.yml +++ b/recipes/aws-crt-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.18.8": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.18.8.tar.gz" + sha256: "70ea622cf8c1a7028b24078e909ee5898990444436584178f58d61b50b5b197d" "0.17.23": url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.17.23.tar.gz" sha256: "28061c3efa493519cfae46e4ea96389f03a81eeec7613d7da861dd8c5f4f6598" @@ -9,9 +12,15 @@ sources: url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.14.3.tar.gz" sha256: "3ea16c43e691bab0c373ba1ad072f6535390c516ebda658dfaf4d074d920e0fb" patches: + "0.18.8": + - patch_file: "patches/0.17.23-fix-cast-error.patch" + patch_description: "fix const cast error" + patch_type: "portability" "0.17.23": - - base_path: "source_subfolder" - patch_file: "patches/0.17.23-fix-cast-error.patch" + - patch_file: "patches/0.17.23-fix-cast-error.patch" + patch_description: "fix const cast error" + patch_type: "portability" "0.17.12": - - base_path: "source_subfolder" - patch_file: "patches/0.17.12-fix-cast-error.patch" + - patch_file: "patches/0.17.12-fix-cast-error.patch" + patch_description: "fix const cast error" + patch_type: "portability" diff --git a/recipes/aws-crt-cpp/all/conanfile.py b/recipes/aws-crt-cpp/all/conanfile.py index fb49c50bc21cd..c70a676efc102 100644 --- a/recipes/aws-crt-cpp/all/conanfile.py +++ b/recipes/aws-crt-cpp/all/conanfile.py @@ -1,16 +1,20 @@ -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class AwsCrtCpp(ConanFile): name = "aws-crt-cpp" description = "C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++." - topics = ("aws", "amazon", "cloud", "wrapper") + license = "Apache-2.0", url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-crt-cpp" - license = "Apache-2.0", - generators = "cmake", "cmake_find_package" + topics = ("aws", "amazon", "cloud", "wrapper") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,16 +25,12 @@ class AwsCrtCpp(ConanFile): "fPIC": True, } - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_cpp_standard(self): + return 11 def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -38,55 +38,64 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("aws-c-event-stream/0.2.7") - self.requires("aws-c-common/0.6.19") - self.requires("aws-c-io/0.10.20") - self.requires("aws-c-http/0.6.13") - self.requires("aws-c-auth/0.6.11") - self.requires("aws-c-mqtt/0.7.10") - self.requires("aws-c-s3/0.1.37") - self.requires("aws-checksums/0.1.12") + self.requires("aws-c-common/0.8.2") + self.requires("aws-checksums/0.1.13") + if Version(self.version) < "0.17.29": + self.requires("aws-c-io/0.10.20") + self.requires("aws-c-http/0.6.13") + self.requires("aws-c-auth/0.6.11") + self.requires("aws-c-s3/0.1.37") + self.requires("aws-c-mqtt/0.7.10") + self.requires("aws-c-event-stream/0.2.7") + else: + self.requires("aws-c-io/0.13.4") + self.requires("aws-c-http/0.6.22") + self.requires("aws-c-auth/0.6.17") + self.requires("aws-c-s3/0.1.49") + self.requires("aws-c-mqtt/0.7.12") + self.requires("aws-c-event-stream/0.2.15") + + def validate(self): + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["BUILD_DEPS"] = False - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_DEPS"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="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, "lib", "aws-crt-cpp")) + rmdir(self, os.path.join(self.package_folder, "lib", "aws-crt-cpp")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-crt-cpp") self.cpp_info.set_property("cmake_target_name", "AWS::aws-crt-cpp") - self.cpp_info.filenames["cmake_find_package"] = "aws-crt-cpp" - self.cpp_info.filenames["cmake_find_package_multi"] = "aws-crt-cpp" - self.cpp_info.names["cmake_find_package"] = "AWS" - self.cpp_info.names["cmake_find_package_multi"] = "AWS" self.cpp_info.components["aws-crt-cpp-lib"].names["cmake_find_package"] = "aws-crt-cpp" self.cpp_info.components["aws-crt-cpp-lib"].names["cmake_find_package_multi"] = "aws-crt-cpp" self.cpp_info.components["aws-crt-cpp-lib"].libs = ["aws-crt-cpp"] @@ -100,3 +109,9 @@ def package_info(self): "aws-c-s3::aws-c-s3-lib", "aws-checksums::aws-checksums-lib" ] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "aws-crt-cpp" + self.cpp_info.filenames["cmake_find_package_multi"] = "aws-crt-cpp" + self.cpp_info.names["cmake_find_package"] = "AWS" + self.cpp_info.names["cmake_find_package_multi"] = "AWS" diff --git a/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt b/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt index 74debee402ca9..50b34b056a787 100644 --- a/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt +++ b/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(aws-crt-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} AWS::aws-crt-cpp) -set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/aws-crt-cpp/all/test_package/conanfile.py b/recipes/aws-crt-cpp/all/test_package/conanfile.py index 49a3a66ea5bad..a9fb96656f203 100644 --- a/recipes/aws-crt-cpp/all/test_package/conanfile.py +++ b/recipes/aws-crt-cpp/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,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..31592420f8acc --- /dev/null +++ b/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(aws-crt-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/aws-crt-cpp/all/test_v1_package/conanfile.py b/recipes/aws-crt-cpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/aws-crt-cpp/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +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): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/aws-crt-cpp/config.yml b/recipes/aws-crt-cpp/config.yml index cd074764fbd37..a2a8f6922a602 100644 --- a/recipes/aws-crt-cpp/config.yml +++ b/recipes/aws-crt-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "0.18.8": + folder: all "0.17.23": folder: all "0.17.12": From 4b207085b84b5e3225e6ddbfa81e572d77def087 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 21 Oct 2022 06:07:10 -0500 Subject: [PATCH 534/561] (#13642) wayland-protocols: Check tools.gnu:pkg_config setting --- recipes/wayland-protocols/all/test_package/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/wayland-protocols/all/test_package/conanfile.py b/recipes/wayland-protocols/all/test_package/conanfile.py index 1dc365f849fd5..1466d1f78d85d 100644 --- a/recipes/wayland-protocols/all/test_package/conanfile.py +++ b/recipes/wayland-protocols/all/test_package/conanfile.py @@ -21,7 +21,8 @@ def requirements(self): def build_requirements(self): self.tool_requires("meson/0.63.3") - self.tool_requires("pkgconf/1.9.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") self.tool_requires("wayland/1.21.0") def layout(self): From 5d069ecc4ac10fca7a0eb8336b4fbbb5600d2aa1 Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Fri, 21 Oct 2022 19:46:22 +0800 Subject: [PATCH 535/561] (#13622) libaec: upgrade for conan v2 * libaec - upgrade for conan v2 * Fix licence copy * Fix test_v1_package - use common file * Fix static/shared a better way * Update recipes/libaec/all/conanfile.py Co-authored-by: Uilian Ries * Update recipes/libaec/all/conanfile.py Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/libaec/all/CMakeLists.txt | 9 -- recipes/libaec/all/conandata.yml | 3 - recipes/libaec/all/conanfile.py | 99 +++++++++---------- .../libaec/all/test_package/CMakeLists.txt | 3 - recipes/libaec/all/test_package/conanfile.py | 28 ++++-- .../libaec/all/test_v1_package/CMakeLists.txt | 10 ++ .../libaec/all/test_v1_package/conanfile.py | 19 ++++ 7 files changed, 97 insertions(+), 74 deletions(-) delete mode 100644 recipes/libaec/all/CMakeLists.txt create mode 100644 recipes/libaec/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libaec/all/test_v1_package/conanfile.py diff --git a/recipes/libaec/all/CMakeLists.txt b/recipes/libaec/all/CMakeLists.txt deleted file mode 100644 index 28b6788808412..0000000000000 --- a/recipes/libaec/all/CMakeLists.txt +++ /dev/null @@ -1,9 +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/libaec/all/conandata.yml b/recipes/libaec/all/conandata.yml index 81bd3833b2814..fedb680f0ebb4 100644 --- a/recipes/libaec/all/conandata.yml +++ b/recipes/libaec/all/conandata.yml @@ -8,9 +8,6 @@ sources: patches: "1.0.4": - patch_file: "patches/1.0.4-0001-Fix-static-library-builds.patch" - base_path: "source_subfolder" - patch_file: "patches/1.0.4-0002-fix-install-ios.patch" - base_path: "source_subfolder" "1.0.6": - patch_file: "patches/1.0.6-0001-fix-library-builds.patch" - base_path: "source_subfolder" diff --git a/recipes/libaec/all/conanfile.py b/recipes/libaec/all/conanfile.py index 5f628637c580f..943870cdf6a8a 100644 --- a/recipes/libaec/all/conanfile.py +++ b/recipes/libaec/all/conanfile.py @@ -1,8 +1,12 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class LibaecConan(ConanFile): @@ -11,7 +15,7 @@ class LibaecConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.dkrz.de/k202009/libaec" description = "Adaptive Entropy Coding library" - topics = ("dsp", "libaec", "encoding", "decoding",) + topics = "dsp", "encoding", "decoding" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -21,25 +25,9 @@ class LibaecConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -47,14 +35,26 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if tools.Version(self.version) >= "1.0.6" and self._is_msvc: + if Version(self.version) >= "1.0.6" and is_msvc(self): # libaec/1.0.6 uses "restrict" keyword which seems to be supported since Visual Studio 16. - if tools.Version(self.settings.compiler.version) < "16": + if Version(self.settings.compiler.version) < "16": raise ConanInvalidConfiguration("{} does not support Visual Studio {}".format(self.name, self.settings.compiler.version)) # In libaec/1.0.6, fail to build aec_client command with debug and shared settings in Visual Studio. # Temporary, this recipe doesn't support these settings. @@ -62,46 +62,41 @@ def validate(self): raise ConanInvalidConfiguration("{} does not support debug and shared build in Visual Studio(currently)".format(self.name)) 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], destination=self.source_folder, strip_root=True) - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if tools.Version(self.version) < "1.0.6": - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "add_subdirectory(tests)", "") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + if Version(self.version) < "1.0.6": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_subdirectory(tests)", "") + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - if tools.Version(self.version) < "1.0.6": - self.copy(pattern="Copyright.txt", dst="licenses", src=self._source_subfolder) + if Version(self.version) < "1.0.6": + copy(self, pattern="Copyright.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) else: - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): aec_name = "aec" - if self.settings.os == "Windows" and tools.Version(self.version) >= "1.0.6" and not self.options.shared: + if self.settings.os == "Windows" and Version(self.version) >= "1.0.6" and not self.options.shared: aec_name = "aec_static" szip_name = "sz" if self.settings.os == "Windows": - if tools.Version(self.version) >= "1.0.6": + if Version(self.version) >= "1.0.6": szip_name = "szip" if self.options.shared else "szip_static" elif self.options.shared: szip_name = "szip" diff --git a/recipes/libaec/all/test_package/CMakeLists.txt b/recipes/libaec/all/test_package/CMakeLists.txt index 39f956e39b59c..f87e0b5ca8eb9 100644 --- a/recipes/libaec/all/test_package/CMakeLists.txt +++ b/recipes/libaec/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1.3) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(libaec CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/libaec/all/test_package/conanfile.py b/recipes/libaec/all/test_package/conanfile.py index b07f7e5f677ac..75526b1d02b79 100644 --- a/recipes/libaec/all/test_package/conanfile.py +++ b/recipes/libaec/all/test_package/conanfile.py @@ -1,19 +1,33 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.dependencies["libaec"].ref.version) >= "1.0.6": + tc.variables["CMAKE_C_STANDARD"] = "11" + tc.generate() def build(self): cmake = CMake(self) - if tools.Version(self.deps_cpp_info["libaec"].version) >= "1.0.6": - cmake.definitions["CMAKE_C_STANDARD"] = "11" cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libaec/all/test_v1_package/CMakeLists.txt b/recipes/libaec/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..454ad5fbc6eba --- /dev/null +++ b/recipes/libaec/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1.3) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(libaec CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} libaec::libaec) diff --git a/recipes/libaec/all/test_v1_package/conanfile.py b/recipes/libaec/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..b07f7e5f677ac --- /dev/null +++ b/recipes/libaec/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +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) + if tools.Version(self.deps_cpp_info["libaec"].version) >= "1.0.6": + cmake.definitions["CMAKE_C_STANDARD"] = "11" + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 5170e61963f7d5395244791ef5520e99cc4dc39c Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 21 Oct 2022 21:05:33 +0900 Subject: [PATCH 536/561] (#13654) daw_header_libraries: add version 2.72.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/daw_header_libraries/all/conandata.yml | 3 +++ recipes/daw_header_libraries/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/daw_header_libraries/all/conandata.yml b/recipes/daw_header_libraries/all/conandata.yml index 46964cc5f776f..1096c3719c4e7 100644 --- a/recipes/daw_header_libraries/all/conandata.yml +++ b/recipes/daw_header_libraries/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.72.0": + url: "https://github.com/beached/header_libraries/archive/v2.72.0.tar.gz" + sha256: "f681755183af4af35f4741f3bcb7d99c6707911806e39e3acc982f9532aacc08" "2.71.0": url: "https://github.com/beached/header_libraries/archive/v2.71.0.tar.gz" sha256: "50b9ddebdbc808a5714408a45f686fafe9d1d3b78c988df3973c12c9928828b9" diff --git a/recipes/daw_header_libraries/config.yml b/recipes/daw_header_libraries/config.yml index fddfdcec535bc..2a15faca97b8e 100644 --- a/recipes/daw_header_libraries/config.yml +++ b/recipes/daw_header_libraries/config.yml @@ -1,4 +1,6 @@ versions: + "2.72.0": + folder: all "2.71.0": folder: all "2.68.3": From f862a06c35869ad48eed0dd71b614e9ea7be92e3 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:46:02 +0200 Subject: [PATCH 537/561] (#13601) android-ndk: fix for conan 2.x client * improve support for conan 2.x client * put ndk in bin folder instead of root folder * move update of bindirs after 2 profiles protection * use relative paths in bindirs * add a comment about sysroot * define tools.build:sysroot * cleanup --- recipes/android-ndk/all/conanfile.py | 144 +++++++++++++-------------- 1 file changed, 69 insertions(+), 75 deletions(-) diff --git a/recipes/android-ndk/all/conanfile.py b/recipes/android-ndk/all/conanfile.py index 290a4f0c04da2..cf7fce07c64ba 100644 --- a/recipes/android-ndk/all/conanfile.py +++ b/recipes/android-ndk/all/conanfile.py @@ -1,12 +1,13 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration from conan.tools.files import get, download, unzip, load, copy from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os import re import shutil -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.52.0" class AndroidNDKConan(ConanFile): @@ -38,6 +39,9 @@ def _settings_os_supported(self): def _settings_arch_supported(self): return self.conan_data["sources"][self.version].get(str(self.settings.os), {}).get(str(self._arch)) is not None + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): if self._is_universal2: self.info.settings.arch = "universal:armv8/x86_64" @@ -50,9 +54,6 @@ def validate(self): if not self._settings_arch_supported: raise ConanInvalidConfiguration(f"os,arch={self.settings.os},{self.settings.arch} is not supported by {self.name} (no binaries are available)") - def layout(self): - basic_layout(self, src_folder="src") - def source(self): pass @@ -65,11 +66,11 @@ def build(self): destination=self.source_folder, strip_root=True) def package(self): - copy(self, "*", src=self.source_folder, dst=self.package_folder, keep_path=True) + copy(self, "*", src=self.source_folder, dst=os.path.join(self.package_folder, "bin")) copy(self, "*NOTICE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(self, "*NOTICE.toolchain", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "cmake-wrapper.cmd", src=os.path.join(self.source_folder, os.pardir), dst=self.package_folder) - copy(self, "cmake-wrapper", src=os.path.join(self.source_folder, os.pardir), dst=self.package_folder) + copy(self, "cmake-wrapper.cmd", src=os.path.join(self.source_folder, os.pardir), dst=os.path.join(self.package_folder, "bin")) + copy(self, "cmake-wrapper", src=os.path.join(self.source_folder, os.pardir), dst=os.path.join(self.package_folder, "bin")) self._fix_broken_links() self._fix_permissions() @@ -133,7 +134,7 @@ def _ndk_version_minor(self): def _fix_permissions(self): if os.name != "posix": return - for root, _, files in os.walk(self.package_folder): + for root, _, files in os.walk(os.path.join(self.package_folder, "bin")): for filename in files: filename = os.path.join(root, filename) with open(filename, "rb") as f: @@ -169,7 +170,7 @@ def _fix_broken_links(self): f"toolchains/llvm/prebuilt/{platform}-x86_64/x86_64-linux-android/bin/as": "../../bin/x86_64-linux-android-as", f"toolchains/llvm/prebuilt/{platform}-x86_64/i686-linux-android/bin/as": "../../bin/i686-linux-android-as"} for path, target in links.items(): - path = os.path.join(self.package_folder, path) + path = os.path.join(self.package_folder, "bin", path) os.unlink(path) os.symlink(target, path) @@ -177,9 +178,13 @@ def _fix_broken_links(self): def _host(self): return f"{self._platform}-{self._arch}" + @property + def _ndk_root_rel_path(self): + return os.path.join("bin", "toolchains", "llvm", "prebuilt", self._host) + @property def _ndk_root(self): - return os.path.join(self.package_folder, "toolchains", "llvm", "prebuilt", self._host) + return os.path.join(self.package_folder, self._ndk_root_rel_path) def _wrap_executable(self, tool): suffix = ".exe" if self.settings_build.os == "Windows" else "" @@ -220,7 +225,6 @@ def _define_tool_var(self, name, value, bare = False): if not os.path.isfile(path): self.output.error(f"'Environment variable {name} could not be created: '{path}'") return "UNKNOWN" - self.output.info(f"Creating {name} environment variable: {path}") return path def _define_tool_var_naked(self, name, value): @@ -229,7 +233,6 @@ def _define_tool_var_naked(self, name, value): if not os.path.isfile(path): self.output.error(f"'Environment variable {name} could not be created: '{path}'") return "UNKNOWN" - self.output.info(f"Creating {name} environment variable: {path}") return path @staticmethod @@ -239,17 +242,14 @@ def _chmod_plus_x(filename): def package_info(self): self.cpp_info.includedirs = [] - - # test shall pass, so this runs also in the build as build requirement context - # ndk-build: https://developer.android.com/ndk/guides/ndk-build - self.cpp_info.bindirs.append(".") + self.cpp_info.libdirs = [] # You should use the ANDROID_NDK_ROOT environment variable to indicate where the NDK is located. # That's what most NDK-related scripts use (inside the NDK, and outside of it). # https://groups.google.com/g/android-ndk/c/qZjhOaynHXc - self.buildenv_info.define_path("ANDROID_NDK_ROOT", self.package_folder) + self.buildenv_info.define_path("ANDROID_NDK_ROOT", os.path.join(self.package_folder, "bin")) - self.buildenv_info.define_path("ANDROID_NDK_HOME", self.package_folder) + self.buildenv_info.define_path("ANDROID_NDK_HOME", os.path.join(self.package_folder, "bin")) # this is not enough, I can kill that ..... if not hasattr(self, "settings_target"): @@ -265,31 +265,21 @@ def package_info(self): self.output.warn(f"You've added {self.name}/{self.version} as a build requirement, while os={self.settings_target.os} != Android") return + self.cpp_info.bindirs.append(os.path.join(self._ndk_root_rel_path, "bin")) + self.buildenv_info.define_path("NDK_ROOT", self._ndk_root) self.buildenv_info.define("CHOST", self._llvm_triplet) ndk_sysroot = os.path.join(self._ndk_root, "sysroot") + self.conf_info.define("tools.build:sysroot", ndk_sysroot) self.buildenv_info.define_path("SYSROOT", ndk_sysroot) - self.cpp_info.sysroot = ndk_sysroot - self.buildenv_info.define("ANDROID_NATIVE_API_LEVEL", str(self.settings_target.os.api_level)) - # TODO: It's not clear how this all mechanism of cmake-wrapper should be emulated in conan v2, - # and actually if it matters at all. - # Is it not the purpose of the toolchain defined later to pass all these informations? - self._chmod_plus_x(os.path.join(self.package_folder, "cmake-wrapper")) - cmake_wrapper = "cmake-wrapper.cmd" if self.settings.os == "Windows" else "cmake-wrapper" - cmake_wrapper = os.path.join(self.package_folder, cmake_wrapper) - self.output.info(f"Creating CONAN_CMAKE_PROGRAM environment variable: {cmake_wrapper}") - self.env_info.CONAN_CMAKE_PROGRAM = cmake_wrapper - - toolchain = os.path.join(self.package_folder, "build", "cmake", "android.toolchain.cmake") - - #CMakeToolchain automatically adds the standard Android toolchain file that ships with the NDK - #when `tools.android:ndk_path` is provided, so there's no need to add it as a `user_toolchain` - self.conf_info.define("tools.android:ndk_path", self.package_folder) + # CMakeToolchain automatically adds the standard Android toolchain file that ships with the NDK + # when `tools.android:ndk_path` is provided, so it MUST NOT be manually injected here to `tools.cmake.cmaketoolchain:user_toolchain` conf_info + self.conf_info.define("tools.android:ndk_path", os.path.join(self.package_folder, "bin")) self.buildenv_info.define_path("CC", self._define_tool_var("CC", "clang")) self.buildenv_info.define_path("CXX", self._define_tool_var("CXX", "clang++")) @@ -322,47 +312,51 @@ def package_info(self): libcxx_str = str(self.settings_target.compiler.libcxx) self.buildenv_info.define("ANDROID_STL", libcxx_str if libcxx_str.startswith("c++_") else "c++_shared") - # TODO: conan v1 stuff to remove later - self.env_info.PATH.append(self.package_folder) - self.env_info.ANDROID_NDK_ROOT = self.package_folder - self.env_info.ANDROID_NDK_HOME = self.package_folder - cmake_system_processor = self._cmake_system_processor - if cmake_system_processor: - self.env_info.CONAN_CMAKE_SYSTEM_PROCESSOR = cmake_system_processor - else: - self.output.warn("Could not find a valid CMAKE_SYSTEM_PROCESSOR variable, supported by CMake") - self.env_info.NDK_ROOT = self._ndk_root - self.env_info.CHOST = self._llvm_triplet - self.env_info.CONAN_CMAKE_FIND_ROOT_PATH = ndk_sysroot - self.env_info.SYSROOT = ndk_sysroot - self.env_info.ANDROID_NATIVE_API_LEVEL = str(self.settings_target.os.api_level) - self.env_info.CONAN_CMAKE_TOOLCHAIN_FILE = toolchain - self.env_info.CC = self._define_tool_var("CC", "clang") - self.env_info.CXX = self._define_tool_var("CXX", "clang++") - self.env_info.AR = self._define_tool_var("AR", "ar", bare) - self.env_info.AS = self._define_tool_var("AS", "as", bare) - self.env_info.RANLIB = self._define_tool_var("RANLIB", "ranlib", bare) - self.env_info.STRIP = self._define_tool_var("STRIP", "strip", bare) - self.env_info.ADDR2LINE = self._define_tool_var("ADDR2LINE", "addr2line", bare) - self.env_info.NM = self._define_tool_var("NM", "nm", bare) - self.env_info.OBJCOPY = self._define_tool_var("OBJCOPY", "objcopy", bare) - self.env_info.OBJDUMP = self._define_tool_var("OBJDUMP", "objdump", bare) - self.env_info.READELF = self._define_tool_var("READELF", "readelf", bare) - if self._ndk_version_major < 23: - self.env_info.ELFEDIT = self._define_tool_var("ELFEDIT", "elfedit") - if self._ndk_version_major >= 22: - self.env_info.LD = self._define_tool_var_naked("LD", "ld") - else: - self.env_info.LD = self._define_tool_var("LD", "ld") - self.env_info.ANDROID_PLATFORM = f"android-{self.settings_target.os.api_level}" - self.env_info.ANDROID_TOOLCHAIN = "clang" - self.env_info.ANDROID_ABI = self._android_abi - self.env_info.ANDROID_STL = libcxx_str if libcxx_str.startswith("c++_") else "c++_shared" - self.env_info.CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" - self.env_info.CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = "BOTH" - self.env_info.CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = "BOTH" - self.env_info.CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = "BOTH" + if Version(conan_version).major < 2: + self.env_info.PATH.extend([os.path.join(self.package_folder, "bin"), os.path.join(self._ndk_root, "bin")]) + self.env_info.ANDROID_NDK_ROOT = os.path.join(self.package_folder, "bin") + self.env_info.ANDROID_NDK_HOME = os.path.join(self.package_folder, "bin") + cmake_system_processor = self._cmake_system_processor + if cmake_system_processor: + self.env_info.CONAN_CMAKE_SYSTEM_PROCESSOR = cmake_system_processor + else: + self.output.warn("Could not find a valid CMAKE_SYSTEM_PROCESSOR variable, supported by CMake") + self.env_info.NDK_ROOT = self._ndk_root + self.env_info.CHOST = self._llvm_triplet + self.env_info.CONAN_CMAKE_FIND_ROOT_PATH = ndk_sysroot + self.env_info.SYSROOT = ndk_sysroot + self.env_info.ANDROID_NATIVE_API_LEVEL = str(self.settings_target.os.api_level) + self._chmod_plus_x(os.path.join(self.package_folder, "bin", "cmake-wrapper")) + cmake_wrapper = "cmake-wrapper.cmd" if self.settings.os == "Windows" else "cmake-wrapper" + cmake_wrapper = os.path.join(self.package_folder, "bin", cmake_wrapper) + self.env_info.CONAN_CMAKE_PROGRAM = cmake_wrapper + self.env_info.CONAN_CMAKE_TOOLCHAIN_FILE = os.path.join(self.package_folder, "bin", "build", "cmake", "android.toolchain.cmake") + self.env_info.CC = self._define_tool_var("CC", "clang") + self.env_info.CXX = self._define_tool_var("CXX", "clang++") + self.env_info.AR = self._define_tool_var("AR", "ar", bare) + self.env_info.AS = self._define_tool_var("AS", "as", bare) + self.env_info.RANLIB = self._define_tool_var("RANLIB", "ranlib", bare) + self.env_info.STRIP = self._define_tool_var("STRIP", "strip", bare) + self.env_info.ADDR2LINE = self._define_tool_var("ADDR2LINE", "addr2line", bare) + self.env_info.NM = self._define_tool_var("NM", "nm", bare) + self.env_info.OBJCOPY = self._define_tool_var("OBJCOPY", "objcopy", bare) + self.env_info.OBJDUMP = self._define_tool_var("OBJDUMP", "objdump", bare) + self.env_info.READELF = self._define_tool_var("READELF", "readelf", bare) + if self._ndk_version_major < 23: + self.env_info.ELFEDIT = self._define_tool_var("ELFEDIT", "elfedit") + if self._ndk_version_major >= 22: + self.env_info.LD = self._define_tool_var_naked("LD", "ld") + else: + self.env_info.LD = self._define_tool_var("LD", "ld") + self.env_info.ANDROID_PLATFORM = f"android-{self.settings_target.os.api_level}" + self.env_info.ANDROID_TOOLCHAIN = "clang" + self.env_info.ANDROID_ABI = self._android_abi + self.env_info.ANDROID_STL = libcxx_str if libcxx_str.startswith("c++_") else "c++_shared" + self.env_info.CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" + self.env_info.CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = "BOTH" + self.env_info.CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = "BOTH" + self.env_info.CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = "BOTH" def _unzip_fix_symlinks(self, url, target_folder, sha256): # Python's built-in module 'zipfile' won't handle symlinks (https://bugs.python.org/issue37921) From 027420964e73d9a665968eebca08e53dc601fbd7 Mon Sep 17 00:00:00 2001 From: theirix Date: Fri, 21 Oct 2022 16:29:38 +0300 Subject: [PATCH 538/561] (#13587) libexif: add 0.6.24 + conan v2 support * Add version 0.6.24 * Update to Conan 2.0 * Use compile wrappers for msvc env * Use direct msvc tool names * Replaces slashes * Do not autoreconfigure (fails on Windows) * Use tool requires * Set pkg_config_name * Convert DESTDIR to unix path * Handle msvc and Visual Studio compilers Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- recipes/libexif/all/conandata.yml | 6 +- recipes/libexif/all/conanfile.py | 115 +++++++++++++++--------------- recipes/libexif/config.yml | 2 + 3 files changed, 66 insertions(+), 57 deletions(-) diff --git a/recipes/libexif/all/conandata.yml b/recipes/libexif/all/conandata.yml index b80594e248418..ae774e1c9a024 100644 --- a/recipes/libexif/all/conandata.yml +++ b/recipes/libexif/all/conandata.yml @@ -1,8 +1,12 @@ sources: + "0.6.24": + url: "https://github.com/libexif/libexif/releases/download/v0.6.23/libexif-0.6.23.tar.gz" + sha256: "9271cf58cb46b00f9e2e9b968c7d81c008a69e5457f7d1a50dbf1786eac61b52" "0.6.23": url: "https://github.com/libexif/libexif/releases/download/v0.6.23/libexif-0.6.23.tar.gz" sha256: "9271cf58cb46b00f9e2e9b968c7d81c008a69e5457f7d1a50dbf1786eac61b52" patches: + "0.6.24": + - patch_file: patches/replace_ssize_t_windows.diff "0.6.23": - patch_file: patches/replace_ssize_t_windows.diff - base_path: source_subfolder diff --git a/recipes/libexif/all/conanfile.py b/recipes/libexif/all/conanfile.py index 5c818871ce0c1..8b251e32d1238 100644 --- a/recipes/libexif/all/conanfile.py +++ b/recipes/libexif/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -import contextlib +from conan import ConanFile +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy, rename, rmdir, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.env import VirtualBuildEnv +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc, unix_path import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class LibexifConan(ConanFile): @@ -12,7 +17,6 @@ class LibexifConan(ConanFile): license = "LGPL-2.1" description = "libexif is a library for parsing, editing, and saving EXIF data." topics = ("exif", "metadata", "parse", "edit") - exports_sources = "patches/*" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,29 +26,20 @@ class LibexifConan(ConanFile): "shared": False, "fPIC": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "cl -nologo", - "AR": "lib", - "LD": "link -nologo", - } - with tools.environment_append(env): - yield - else: - yield + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + + def layout(self): + basic_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -57,56 +52,64 @@ def configure(self): del self.settings.compiler.cppstd def build_requirements(self): - self.build_requires("gettext/0.21") - self.build_requires("libtool/2.4.6") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + self.tool_requires("gettext/0.21") + self.tool_requires("libtool/2.4.6") + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + self.tool_requires("msys2/cci.latest") + self.win_bash = True def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows") - self._autotools.libs = [] - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-FS") + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" - args = [ + tc.configure_args.extend([ "--enable-shared={}".format(yes_no(self.options.shared)), "--enable-static={}".format(yes_no(not self.options.shared)), "--disable-docs", "--disable-nls", "--disable-rpath", - ] - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools + ]) + if (self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ + (self.settings.compiler == "msvc" and Version(self.settings.compiler.version) >= "180"): + tc.extra_cflags.append("-FS") + + # env vars + env = tc.environment() + if is_msvc(self): + compile_wrapper = unix_path(self, self._user_info_build["automake"].compile).replace("\\", "/") + ar_wrapper = unix_path(self, self._user_info_build["automake"].ar_lib).replace("\\", "/") + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("LD", f"{compile_wrapper} link -nologo") + + tc.generate(env) + + env = VirtualBuildEnv(self) + env.generate() def build(self): - self._patch_sources() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() - if self.settings.compiler == "Visual Studio" and self.options.shared: - tools.rename(os.path.join(self.package_folder, "lib", "exif.dll.lib"), + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "exif.dll.lib"), os.path.join(self.package_folder, "lib", "exif.lib")) - tools.remove_files_by_mask(self.package_folder, "*.la") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["exif"] self.cpp_info.names["pkg_config"] = "libexif" + self.cpp_info.set_property("pkg_config_name", "libexif") if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["m"] diff --git a/recipes/libexif/config.yml b/recipes/libexif/config.yml index e252661bf796f..d4a99779aab91 100644 --- a/recipes/libexif/config.yml +++ b/recipes/libexif/config.yml @@ -1,3 +1,5 @@ versions: + "0.6.24": + folder: all "0.6.23": folder: all From 0852a3177e09014fe48d2ab9d371039332b11bee Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 21 Oct 2022 16:09:52 +0200 Subject: [PATCH 539/561] (#13632) meson: handle `tools.meson.mesontoolchain:backend` & fix for conan v2 client * do not require ninja if user set another meson backend * fix for conan v2 client * bump ninja Co-authored-by: Jordan Williams Co-authored-by: Jordan Williams --- recipes/meson/all/conanfile.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/recipes/meson/all/conanfile.py b/recipes/meson/all/conanfile.py index dfb05d6d59a9e..8168d4afa4b4f 100644 --- a/recipes/meson/all/conanfile.py +++ b/recipes/meson/all/conanfile.py @@ -1,10 +1,11 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.files import copy, get, rmdir, save from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class MesonConan(ConanFile): @@ -21,15 +22,16 @@ class MesonConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): - self.requires("ninja/1.11.0") + if self.conf.get("tools.meson.mesontoolchain:backend", default=False, check_type=str) in (False, "ninja"): + self.requires("ninja/1.11.1") def package_id(self): self.info.clear() - def layout(self): - basic_layout(self, src_folder="src") - def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -78,15 +80,13 @@ def _chmod_plus_x(filename): def package_info(self): meson_root = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {meson_root}") - self.env_info.PATH.append(meson_root) - self._chmod_plus_x(os.path.join(meson_root, "meson")) self._chmod_plus_x(os.path.join(meson_root, "meson.py")) self.cpp_info.builddirs = [os.path.join("bin", "mesonbuild", "cmake", "data")] - self.cpp_info.frameworkdirs = [] self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] + + if Version(conan_version).major < 2: + self.env_info.PATH.append(meson_root) From 9ac069ddad06209e230e5a1d23eecf85a8c8bba6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:14:42 +0200 Subject: [PATCH 540/561] (#13636) autotools template: several improvements * improve autotools template - handle windows as build machine - handle `tools.gnu:pkg_config` config - handle msvc - fix install_name of shared libs on macOS - call VirtualBuildEnv & VirtualRunEnv first in generate to avoid side effects * typo --- .../autotools_package/all/conanfile.py | 91 ++++++++++++++----- .../all/test_package/CMakeLists.txt | 7 +- .../all/test_package/conanfile.py | 6 +- .../all/test_v1_package/CMakeLists.txt | 7 +- 4 files changed, 76 insertions(+), 35 deletions(-) diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 4bb09b1419198..31cbae159751f 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -1,10 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import check_min_cppstd, cross_building -from conan.tools.files import copy, get, rm, rmdir, apply_conandata_patches, export_conandata_patches +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.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path import os @@ -37,6 +39,14 @@ class PackageConan(ConanFile): "with_foobar": True, } + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _user_info_build(self): + return getattr(self, "user_info_build", self.deps_user_info) + # no exports_sources attribute, but export_sources(self) method instead # this allows finer grain exportation of patches per version def export_sources(self): @@ -75,64 +85,99 @@ def requirements(self): def validate(self): # validate the minimum cpp standard supported. Only for C++ projects - if self.info.settings.compiler.cppstd: + if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) if self.info.settings.os not in ["Linux", "FreeBSD", "MacOS"]: raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.info.settings.os}.") # if another tool than the compiler or autotools is required to build the project (pkgconf, bison, flex etc) def build_requirements(self): + # only if we have to call autoreconf self.tool_requires("libtool/x.y.z") - self.tool_requires("pkgconf/x.y.z") + # only if upstream configure.ac relies on PKG_CHECK_MODULES macro + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/x.y.z") + # required to suppport windows as a build machine + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): + self.tool_requires("msys2/cci.latest") + # for msvc support to get compile & ar-lib scripts (may be avoided if shipped in source code of the library) + if is_msvc(self): + self.tool_requires("automake/x.y.z") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): - # autotools usually uses 'yes' and 'no' to enable/disable options - yes_no = lambda v: "yes" if v else "no" + # inject tools_requires env vars in build scope (not needed if there is no tool_requires) + env = VirtualBuildEnv(self) + env.generate() + # inject requires env vars in build scope + # it's required in case of native build when there is AutotoolsDeps & at least one dependency which might be shared, because configure tries to run a test executable + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") # --fpic is automatically managed when 'fPIC'option is declared # --enable/disable-shared is automatically managed when 'shared' option is declared tc = AutotoolsToolchain(self) - tc.configure_args.append("--with-foobar=%s" % yes_no(self.options.with_foobar)) - tc.configure_args.append("--enable-tools=no") - tc.configure_args.append("--enable-manpages=no") + # autotools usually uses 'yes' and 'no' to enable/disable options + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--with-foobar={yes_no(self.options.with_foobar)}", + "--enable-tools=no", + "--enable-manpages=no", + ]) tc.generate() - # generate dependencies for pkg-config + # generate pkg-config files of dependencies (useless if upstream configure.ac doesn't rely on PKG_CHECK_MODULES macro) tc = PkgConfigDeps(self) tc.generate() # generate dependencies for autotools tc = AutotoolsDeps(self) tc.generate() - # inject tools_requires env vars in build scope (not needed if there is no tool_requires) - env = VirtualBuildEnv(self) - env.generate() - # inject requires env vars in build scope - # it's required in case of native build when there is AutotoolsDeps & at least one dependency which might be shared, because configure tries to run a test executable - if not cross_building(self): - env = VirtualRunEnv(self) - env.generate(scope="build") + + # If Visual Studio is supported + if is_msvc(self): + env = Environment() + # get compile & ar-lib from automake (or eventually lib source code if available) + # it's not always required to wrap CC, CXX & AR with these scripts, it depends on how much love was put in + # upstream build files + compile_wrapper = unix_path(self, self._user_info_build["automake"].compile) + ar_wrapper = unix_path(self, self._user_info_build["automake"].ar_lib) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") def build(self): # apply patches listed in conandata.yml apply_conandata_patches(self) autotools = Autotools(self) - # run autoreconf to generate configure file + # (optional) run autoreconf to regenerate configure file (libtool should be in tool_requires) autotools.autoreconf() # ./configure + toolchain file autotools.configure() autotools.make() def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) - autotools.install() + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) # some files extensions and folders are not allowed. Please, read the FAQs to get informed. rm(self, "*.la", os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) + # In shared lib/executable files, autotools set install_name (macOS) to lib dir absolute path instead of @rpath, it's not relocatable, so fix it + fix_apple_shared_install_name(self) + def package_info(self): self.cpp_info.libs = ["package_lib"] @@ -141,6 +186,4 @@ def package_info(self): # If they are needed on Linux, m, pthread and dl are usually needed on FreeBSD too if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("m") - self.cpp_info.system_libs.append("pthread") - self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) diff --git a/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt b/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt index dcb2919e20597..d5f12b4376cdb 100644 --- a/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt @@ -1,7 +1,6 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) # if the project is pure C -# project(test_package CXX) # if the project uses c++ +cmake_minimum_required(VERSION 3.1) +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/autotools_package/all/test_package/conanfile.py b/docs/package_templates/autotools_package/all/test_package/conanfile.py index 1111583fea732..48499fa0989d9 100644 --- a/docs/package_templates/autotools_package/all/test_package/conanfile.py +++ b/docs/package_templates/autotools_package/all/test_package/conanfile.py @@ -10,12 +10,12 @@ class TestPackageConan(ConanFile): generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" - def requirements(self): - self.requires(self.tested_reference_str) - def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt b/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt index 4af742edc09e7..ac1ad5974dd0f 100644 --- a/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt +++ b/docs/package_templates/autotools_package/all/test_v1_package/CMakeLists.txt @@ -1,7 +1,6 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) # if the project is pure C -# project(test_package CXX) # if the project uses c++ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) # if the project is pure C +# project(test_package LANGUAGES CXX) # if the project uses c++ include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) From f2a80c14068cbd9c8dccfe5e903d6ff4cf79fb91 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:33:02 +0200 Subject: [PATCH 541/561] (#13649) fp16: conan v2 support --- recipes/fp16/all/conandata.yml | 6 ++-- recipes/fp16/all/conanfile.py | 36 +++++++++++-------- recipes/fp16/all/test_package/CMakeLists.txt | 11 +++--- recipes/fp16/all/test_package/conanfile.py | 19 +++++++--- .../fp16/all/test_v1_package/CMakeLists.txt | 11 ++++++ recipes/fp16/all/test_v1_package/conanfile.py | 17 +++++++++ recipes/fp16/config.yml | 4 +-- 7 files changed, 74 insertions(+), 30 deletions(-) create mode 100644 recipes/fp16/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fp16/all/test_v1_package/conanfile.py diff --git a/recipes/fp16/all/conandata.yml b/recipes/fp16/all/conandata.yml index 21f0e1bd08b32..cf80322a4b8bb 100644 --- a/recipes/fp16/all/conandata.yml +++ b/recipes/fp16/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "cci.20200514": - url: "https://github.com/Maratyszcza/FP16/archive/4dfe081cf6bcd15db339cf2680b9281b8451eeb3.zip" - sha256: "d973501a40c55126b31accc2d9f08d931ec3cc190c0430309a5e341d3c0ce32a" "cci.20210320": url: "https://github.com/Maratyszcza/FP16/archive/0a92994d729ff76a58f692d3028ca1b64b145d91.zip" sha256: "e66e65515fa09927b348d3d584c68be4215cfe664100d01c9dbc7655a5716d70" + "cci.20200514": + url: "https://github.com/Maratyszcza/FP16/archive/4dfe081cf6bcd15db339cf2680b9281b8451eeb3.zip" + sha256: "d973501a40c55126b31accc2d9f08d931ec3cc190c0430309a5e341d3c0ce32a" diff --git a/recipes/fp16/all/conanfile.py b/recipes/fp16/all/conanfile.py index 971e7f2d0585d..75666c9f3bd71 100644 --- a/recipes/fp16/all/conanfile.py +++ b/recipes/fp16/all/conanfile.py @@ -1,33 +1,41 @@ -from conans import ConanFile, tools -import glob +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os +required_conan_version = ">=1.52.0" + class Fp16Conan(ConanFile): name = "fp16" description = "Conversion to/from half-precision floating point formats." license = "MIT" - topics = ("conan", "fp16", "half-precision-floating-point") + topics = ("half-precision-floating-point") homepage = "https://github.com/Maratyszcza/FP16" url = "https://github.com/conan-io/conan-center-index" - + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("psimd/cci.20200517") + self.requires("psimd/cci.20200517", transitive_headers=True) def package_id(self): - self.info.header_only() + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("FP16-*")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fp16/all/test_package/CMakeLists.txt b/recipes/fp16/all/test_package/CMakeLists.txt index fd126a732c403..1e502f0857d7c 100644 --- a/recipes/fp16/all/test_package/CMakeLists.txt +++ b/recipes/fp16/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(fp16 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +target_link_libraries(${PROJECT_NAME} PRIVATE fp16::fp16) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fp16/all/test_package/conanfile.py b/recipes/fp16/all/test_package/conanfile.py index 5216332f39f5c..0a6bc68712d90 100644 --- a/recipes/fp16/all/test_package/conanfile.py +++ b/recipes/fp16/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fp16/all/test_v1_package/CMakeLists.txt b/recipes/fp16/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..d609dc2f83e68 --- /dev/null +++ b/recipes/fp16/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(fp16 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE fp16::fp16) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fp16/all/test_v1_package/conanfile.py b/recipes/fp16/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/fp16/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fp16/config.yml b/recipes/fp16/config.yml index 5fda81fa041c9..97367a08f7fea 100644 --- a/recipes/fp16/config.yml +++ b/recipes/fp16/config.yml @@ -1,5 +1,5 @@ versions: - "cci.20200514": - folder: all "cci.20210320": folder: all + "cci.20200514": + folder: all From a7ee4fb2276c90851df16879bb4b2a499abdd3a3 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 21 Oct 2022 11:15:54 -0500 Subject: [PATCH 542/561] (#13612) xkbcommon: Use PkgConfigDeps build context for wayland * xkbcommon: Use PkgConfigDeps build context for wayland * xkbcommon: finer grain requirements * Place build context pkg-config files in a separate directory * Move comment to a better spot * Fix Apple shared install name and pkg-config conf Co-authored-by: ericLemanissier --- recipes/xkbcommon/all/conanfile.py | 100 ++++++++++++------ .../xkbcommon/all/test_package/conanfile.py | 1 + 2 files changed, 67 insertions(+), 34 deletions(-) diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index f4a785f15eee6..40d3c56584b83 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -1,23 +1,27 @@ +import glob import os +import shutil from conan import ConanFile -from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, mkdir, replace_in_file, rmdir +from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class XkbcommonConan(ConanFile): name = "xkbcommon" description = "keymap handling library for toolkits and window systems" - topics = ("xkbcommon", "keyboard") + topics = ("keyboard") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/xkbcommon/libxkbcommon" license = "MIT" - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,7 +38,9 @@ class XkbcommonConan(ConanFile): "xkbregistry": True, } - generators = "PkgConfigDeps", "VirtualBuildEnv" + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") @property def _has_xkbregistry_option(self): @@ -48,9 +54,18 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass def requirements(self): self.requires("xkeyboard-config/system") @@ -60,54 +75,69 @@ def requirements(self): self.requires("libxml2/2.9.14") if self.options.get_safe("with_wayland"): self.requires("wayland/1.21.0") - self.requires("wayland-protocols/1.26") # FIXME: This should be a build-requires + if not self._has_build_profile: + self.requires("wayland-protocols/1.27") def validate(self): - if self.settings.os not in ["Linux", "FreeBSD"]: - raise ConanInvalidConfiguration("This library is only compatible with Linux or FreeBSD") + if self.info.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"{self.ref} is only compatible with Linux and FreeBSD") def build_requirements(self): - self.tool_requires("meson/0.63.1") - self.tool_requires("bison/3.7.6") - self.tool_requires("pkgconf/1.7.4") - if hasattr(self, "settings_build") and self.options.get_safe("with_wayland"): + self.tool_requires("meson/0.63.3") + self.tool_requires("bison/3.8.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.9.3") + if self._has_build_profile and self.options.get_safe("with_wayland"): self.tool_requires("wayland/1.21.0") + self.tool_requires("wayland-protocols/1.27") def layout(self): basic_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) def generate(self): tc = MesonToolchain(self) - - tc.project_options["libexecdir"] = "bin" - tc.project_options["libdir"] = "lib" - tc.project_options["datadir"] = "res" - tc.project_options["enable-docs"] = False tc.project_options["enable-wayland"] = self.options.get_safe("with_wayland", False) tc.project_options["enable-x11"] = self.options.with_x11 - if self._has_xkbregistry_option: tc.project_options["enable-xkbregistry"] = self.options.xkbregistry + if self._has_build_profile: + tc.project_options["build.pkg_config_path"] = os.path.join(self.generators_folder, "build") tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self._has_build_profile and self.options.get_safe("with_wayland"): + pkg_config_deps.build_context_activated = ["wayland", "wayland-protocols"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + pkg_config_deps.generate() + if self._has_build_profile and self.options.get_safe("with_wayland"): + mkdir(self, os.path.join(self.generators_folder, "build")) + for pc in glob.glob(os.path.join(self.generators_folder, "*_BUILD.pc")): + original_pc = os.path.basename(pc)[:-9] + ".pc" + shutil.move(pc, os.path.join(self.generators_folder, "build", original_pc)) + + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + def build(self): # Conan doesn't provide a `wayland-scanner.pc` file for the package in the _build_ context - meson_build_file = os.path.join(self.source_folder, "meson.build") - replace_in_file(self, meson_build_file, - "wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)", - "# wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)") + if self.options.get_safe("with_wayland") and not self._has_build_profile: + meson_build_file = os.path.join(self.source_folder, "meson.build") + replace_in_file(self, meson_build_file, + "wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)", + "# wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)") - replace_in_file(self, meson_build_file, - "if not wayland_client_dep.found() or not wayland_protocols_dep.found() or not wayland_scanner_dep.found()", - "if not wayland_client_dep.found() or not wayland_protocols_dep.found()") + replace_in_file(self, meson_build_file, + "if not wayland_client_dep.found() or not wayland_protocols_dep.found() or not wayland_scanner_dep.found()", + "if not wayland_client_dep.found() or not wayland_protocols_dep.found()") - replace_in_file(self, meson_build_file, - "wayland_scanner = find_program(wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'))", - "wayland_scanner = find_program('wayland-scanner')") + replace_in_file(self, meson_build_file, + "wayland_scanner = find_program(wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'))", + "wayland_scanner = find_program('wayland-scanner')") meson = Meson(self) meson.configure() @@ -117,6 +147,7 @@ def package(self): copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) meson = Meson(self) meson.install() + fix_apple_shared_install_name(self) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) @@ -135,10 +166,11 @@ def package_info(self): self.cpp_info.components["libxkbregistry"].libs = ["xkbregistry"] self.cpp_info.components["libxkbregistry"].requires = ["libxml2::libxml2"] if self.options.get_safe("with_wayland", False): - # FIXME: This generates just executable, but I need to use the requirements to pass Conan checks self.cpp_info.components["xkbcli-interactive-wayland"].libs = [] self.cpp_info.components["xkbcli-interactive-wayland"].includedirs = [] - self.cpp_info.components["xkbcli-interactive-wayland"].requires = ["wayland::wayland", "wayland-protocols::wayland-protocols"] + self.cpp_info.components["xkbcli-interactive-wayland"].requires = ["wayland::wayland-client"] + if not self._has_build_profile: + self.cpp_info.components["xkbcli-interactive-wayland"].requires.append("wayland-protocols::wayland-protocols") if Version(self.version) >= "1.0.0": bindir = os.path.join(self.package_folder, "bin") diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py index 622d31592b6f4..b521c572cd683 100644 --- a/recipes/xkbcommon/all/test_package/conanfile.py +++ b/recipes/xkbcommon/all/test_package/conanfile.py @@ -9,6 +9,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) From 4924cfdf7f385b1ac6b54f3b252381c3876c14ed Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 21 Oct 2022 23:22:04 +0200 Subject: [PATCH 543/561] (#13644) header-only template: several improvements - handle self.info in validate() - transitive headers of direct dependencies - remove build_requirements --- .../header_only/all/conanfile.py | 35 +++++++++---------- .../all/test_package/CMakeLists.txt | 5 ++- .../header_only/all/test_package/conanfile.py | 6 ++-- .../all/test_v1_package/CMakeLists.txt | 5 ++- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index a9310252571ff..99bcc94e5e166 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -1,9 +1,9 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.build import check_min_cppstd -from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os @@ -25,7 +25,7 @@ class PackageConan(ConanFile): no_copy_source = True # do not copy sources to build folder for header only projects, unless, need to apply patches @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 14 # in case the project requires C++14/17/20/... the minimum compiler version should be listed @@ -50,30 +50,31 @@ def layout(self): def requirements(self): # prefer self.requires method instead of requires attribute - self.requires("dependency/0.8.1") + # direct dependencies of header only libs are always transitive since they are included in public headers + self.requires("dependency/0.8.1", transitive_headers=True) # same package ID for any package def package_id(self): self.info.clear() + @property + def _info(self): + return self if Version(conan_version).major < 2 else self.info + def validate(self): # compiler subsettings are not available when building with self.info.clear() - if self.info.settings.get_safe("compiler.cppstd"): + if self._info.settings.compiler.get_safe("cppstd"): # validate the minimum cpp standard supported when installing the package. For C++ projects only - check_min_cppstd(self, self._minimum_cpp_standard) - minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) - if minimum_version and Version(self.info.settings.get_safe("compiler.version")) < minimum_version: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self._info.settings.compiler), False) + if minimum_version and Version(self._info.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + 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 self.info.settings.os == "Windows": + if self._info.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} can not be used on Windows.") - # if another tool than the compiler or CMake is required to build the project (pkgconf, bison, flex etc) - def build_requirements(self): - self.tool_requires("tool/x.y.z") - def source(self): # download source package and extract to source folder get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -110,9 +111,7 @@ def package_info(self): # If they are needed on Linux, m, pthread and dl are usually needed on FreeBSD too if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("m") - self.cpp_info.system_libs.append("pthread") - self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "PACKAGE" diff --git a/docs/package_templates/header_only/all/test_package/CMakeLists.txt b/docs/package_templates/header_only/all/test_package/CMakeLists.txt index d36b7fedf54ae..58ff75575bd54 100644 --- a/docs/package_templates/header_only/all/test_package/CMakeLists.txt +++ b/docs/package_templates/header_only/all/test_package/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.8) - -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/test_package/conanfile.py b/docs/package_templates/header_only/all/test_package/conanfile.py index 1111583fea732..48499fa0989d9 100644 --- a/docs/package_templates/header_only/all/test_package/conanfile.py +++ b/docs/package_templates/header_only/all/test_package/conanfile.py @@ -10,12 +10,12 @@ class TestPackageConan(ConanFile): generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" - def requirements(self): - self.requires(self.tested_reference_str) - def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt b/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt index 5e77e4ac4b188..3c858b5777694 100644 --- a/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt +++ b/docs/package_templates/header_only/all/test_v1_package/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.8) - -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++ include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) From 18dda6ce7770941c603c9503004867d3a60cb3e6 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 21 Oct 2022 23:44:42 +0200 Subject: [PATCH 544/561] (#13647) pcre2: bump zlib * pcre2: bump zlib * no pylint skip for pcre2's test package --- recipes/pcre2/all/conanfile.py | 2 +- recipes/pcre2/all/test_v1_package/conanfile.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/pcre2/all/conanfile.py b/recipes/pcre2/all/conanfile.py index 6b04391177a90..9c0c5f3407f58 100644 --- a/recipes/pcre2/all/conanfile.py +++ b/recipes/pcre2/all/conanfile.py @@ -69,7 +69,7 @@ def configure(self): def requirements(self): if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") if self.options.get_safe("with_bzip2"): self.requires("bzip2/1.0.8") diff --git a/recipes/pcre2/all/test_v1_package/conanfile.py b/recipes/pcre2/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/pcre2/all/test_v1_package/conanfile.py +++ b/recipes/pcre2/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os From 4bff4d2b6f23af11c580252c12a11cf9f247b062 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 22 Oct 2022 00:24:53 +0200 Subject: [PATCH 545/561] (#13659) cpuinfo: conan v2 support * conan v2 support * cast to str for cache_variables --- recipes/cpuinfo/all/CMakeLists.txt | 7 +- recipes/cpuinfo/all/conanfile.py | 94 ++++++++++--------- .../cpuinfo/all/test_package/CMakeLists.txt | 11 +-- recipes/cpuinfo/all/test_package/conanfile.py | 19 +++- .../all/test_v1_package/CMakeLists.txt | 11 +++ .../cpuinfo/all/test_v1_package/conanfile.py | 17 ++++ 6 files changed, 98 insertions(+), 61 deletions(-) create mode 100644 recipes/cpuinfo/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpuinfo/all/test_v1_package/conanfile.py diff --git a/recipes/cpuinfo/all/CMakeLists.txt b/recipes/cpuinfo/all/CMakeLists.txt index b00769ce686e3..e40870cb28701 100644 --- a/recipes/cpuinfo/all/CMakeLists.txt +++ b/recipes/cpuinfo/all/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.1) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -if(NOT CMAKE_SYSTEM_PROCESSOR) +if(NOT CMAKE_SYSTEM_PROCESSOR AND CONAN_CPUINFO_SYSTEM_PROCESSOR) set(CMAKE_SYSTEM_PROCESSOR ${CONAN_CPUINFO_SYSTEM_PROCESSOR}) endif() -add_subdirectory(source_subfolder) +add_subdirectory(src) diff --git a/recipes/cpuinfo/all/conanfile.py b/recipes/cpuinfo/all/conanfile.py index 1e97cdf620d4c..8c665b04ef10e 100644 --- a/recipes/cpuinfo/all/conanfile.py +++ b/recipes/cpuinfo/all/conanfile.py @@ -1,9 +1,11 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir import os -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.51.1" class CpuinfoConan(ConanFile): @@ -11,8 +13,7 @@ class CpuinfoConan(ConanFile): description = "cpuinfo is a library to detect essential for performance " \ "optimization information about host CPU." license = "BSD-2-Clause" - topics = ("cpuinfo", "cpu", "cpuid", "cpu-cache", "cpu-model", - "instruction-set", "cpu-topology") + topics = ("cpu", "cpuid", "cpu-cache", "cpu-model", "instruction-set", "cpu-topology") homepage = "https://github.com/pytorch/cpuinfo" url = "https://github.com/conan-io/conan-center-index" @@ -29,11 +30,6 @@ class CpuinfoConan(ConanFile): } exports_sources = "CMakeLists.txt" - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" def config_options(self): if self.settings.os == "Windows": @@ -41,60 +37,70 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): - if self.settings.os == "Windows" and self.options.shared: + if self.info.settings.os == "Windows" and self.info.options.shared: raise ConanInvalidConfiguration("shared cpuinfo not supported on Windows") 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], + destination=self.source_folder, strip_root=True) - def _patch_sources(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)", - "") - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) # cpuinfo - cmake.definitions["CPUINFO_LIBRARY_TYPE"] = "default" - cmake.definitions["CPUINFO_RUNTIME_TYPE"] = "default" - cmake.definitions["CPUINFO_LOG_LEVEL"] = self.options.log_level - cmake.definitions["CPUINFO_BUILD_TOOLS"] = False - cmake.definitions["CPUINFO_BUILD_UNIT_TESTS"] = False - cmake.definitions["CPUINFO_BUILD_MOCK_TESTS"] = False - cmake.definitions["CPUINFO_BUILD_BENCHMARKS"] = False + tc.cache_variables["CPUINFO_LIBRARY_TYPE"] = "default" + tc.cache_variables["CPUINFO_RUNTIME_TYPE"] = "default" + # TODO: remove str cast in conan 1.53.0 (see https://github.com/conan-io/conan/pull/12086) + tc.cache_variables["CPUINFO_LOG_LEVEL"] = str(self.options.log_level) + tc.variables["CPUINFO_BUILD_TOOLS"] = False + tc.variables["CPUINFO_BUILD_UNIT_TESTS"] = False + tc.variables["CPUINFO_BUILD_MOCK_TESTS"] = False + tc.variables["CPUINFO_BUILD_BENCHMARKS"] = False # clog (always static) - cmake.definitions["CLOG_RUNTIME_TYPE"] = "default" - cmake.definitions["CLOG_BUILD_TESTS"] = False - cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - + tc.cache_variables["CLOG_RUNTIME_TYPE"] = "default" + tc.variables["CLOG_BUILD_TESTS"] = False + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # CMAKE_SYSTEM_PROCESSOR must be manually set if cross-building - if tools.cross_building(self): + if cross_building(self): cmake_system_processor = { "armv8": "arm64", "armv8.3": "arm64", }.get(str(self.settings.arch), str(self.settings.arch)) - cmake.definitions["CONAN_CPUINFO_SYSTEM_PROCESSOR"] = cmake_system_processor + tc.variables["CONAN_CPUINFO_SYSTEM_PROCESSOR"] = cmake_system_processor + tc.generate() - cmake.configure() - return cmake + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)", + "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "libcpuinfo") diff --git a/recipes/cpuinfo/all/test_package/CMakeLists.txt b/recipes/cpuinfo/all/test_package/CMakeLists.txt index adb88fd87c22f..f7fd88969d977 100644 --- a/recipes/cpuinfo/all/test_package/CMakeLists.txt +++ b/recipes/cpuinfo/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) find_package(cpuinfo REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} cpuinfo::cpuinfo) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +target_link_libraries(${PROJECT_NAME} PRIVATE cpuinfo::cpuinfo) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/cpuinfo/all/test_package/conanfile.py b/recipes/cpuinfo/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/cpuinfo/all/test_package/conanfile.py +++ b/recipes/cpuinfo/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ 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): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt b/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7b06d2e30ef81 --- /dev/null +++ b/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(cpuinfo REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE cpuinfo::cpuinfo) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/cpuinfo/all/test_v1_package/conanfile.py b/recipes/cpuinfo/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpuinfo/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 5dad5f6cef31da827db7a059c14b521f3b6cb325 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 22 Oct 2022 00:44:20 +0200 Subject: [PATCH 546/561] (#13663) sfml: conan v2 support --- recipes/sfml/all/CMakeLists.txt | 7 - recipes/sfml/all/conandata.yml | 4 - recipes/sfml/all/conanfile.py | 121 +++++++++--------- .../patches/0001-cmake-robust-find-deps.patch | 14 +- recipes/sfml/all/test_package/CMakeLists.txt | 7 +- recipes/sfml/all/test_package/conanfile.py | 31 +++-- .../sfml/all/test_v1_package/CMakeLists.txt | 33 +++++ recipes/sfml/all/test_v1_package/conanfile.py | 21 +++ 8 files changed, 148 insertions(+), 90 deletions(-) delete mode 100644 recipes/sfml/all/CMakeLists.txt create mode 100644 recipes/sfml/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sfml/all/test_v1_package/conanfile.py diff --git a/recipes/sfml/all/CMakeLists.txt b/recipes/sfml/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/sfml/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/sfml/all/conandata.yml b/recipes/sfml/all/conandata.yml index 64dd59ed97e61..7ee890396d833 100644 --- a/recipes/sfml/all/conandata.yml +++ b/recipes/sfml/all/conandata.yml @@ -5,10 +5,6 @@ sources: patches: "2.5.1": - patch_file: "patches/0001-cmake-robust-find-deps.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-allow-non-x86-64-macos.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-allow-shared-MT.patch" - base_path: "source_subfolder" - patch_file: "patches/0004-fix-ios.patch" - base_path: "source_subfolder" diff --git a/recipes/sfml/all/conanfile.py b/recipes/sfml/all/conanfile.py index 55652e00fcd95..fbbe0cc38f82f 100644 --- a/recipes/sfml/all/conanfile.py +++ b/recipes/sfml/all/conanfile.py @@ -1,18 +1,20 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools import os import textwrap -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.52.0" class SfmlConan(ConanFile): name = "sfml" description = "Simple and Fast Multimedia Library." license = "Zlib" - topics = ("sfml", "multimedia", "games", "graphics", "audio") + topics = ("multimedia", "games", "graphics", "audio") homepage = "https://www.sfml-dev.org" url = "https://github.com/conan-io/conan-center-index" @@ -34,20 +36,8 @@ class SfmlConan(ConanFile): "audio": True, } - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -55,7 +45,13 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.window: @@ -65,73 +61,72 @@ def requirements(self): self.requires("libudev/system") self.requires("xorg/system") if self.options.graphics: - self.requires("freetype/2.11.1") + self.requires("freetype/2.12.1") self.requires("stb/cci.20210910") if self.options.audio: self.requires("flac/1.3.3") - self.requires("openal/1.21.1") + self.requires("openal/1.22.2") self.requires("vorbis/1.3.7") def validate(self): - if self.settings.os not in ["Windows", "Linux", "FreeBSD", "Android", "Macos", "iOS"]: - raise ConanInvalidConfiguration("SFML not supported on {}".format(self.settings.os)) - if self.options.graphics and not self.options.window: + if self.info.settings.os not in ["Windows", "Linux", "FreeBSD", "Android", "Macos", "iOS"]: + raise ConanInvalidConfiguration(f"{self.ref} not supported on {self.info.settings.os}") + if self.info.options.graphics and not self.info.options.window: raise ConanInvalidConfiguration("sfml:graphics=True requires sfml:window=True") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - tools.rmdir(os.path.join(self._source_subfolder, "extlibs")) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["SFML_DEPENDENCIES_INSTALL_PREFIX"] = self.package_folder - cmake.definitions["SFML_MISC_INSTALL_PREFIX"] = os.path.join(self.package_folder, "licenses").replace("\\", "/") - cmake.definitions["SFML_BUILD_WINDOW"] = self.options.window - cmake.definitions["SFML_BUILD_GRAPHICS"] = self.options.graphics - cmake.definitions["SFML_BUILD_NETWORK"] = self.options.network - cmake.definitions["SFML_BUILD_AUDIO"] = self.options.audio - cmake.definitions["SFML_INSTALL_PKGCONFIG_FILES"] = False - cmake.definitions["SFML_GENERATE_PDB"] = False - cmake.definitions["SFML_USE_SYSTEM_DEPS"] = True + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + rmdir(self, os.path.join(self.source_folder, "extlibs")) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["SFML_DEPENDENCIES_INSTALL_PREFIX"] = self.package_folder.replace("\\", "/") + tc.cache_variables["SFML_MISC_INSTALL_PREFIX"] = os.path.join(self.package_folder, "licenses").replace("\\", "/") + tc.variables["SFML_BUILD_WINDOW"] = self.options.window + tc.variables["SFML_BUILD_GRAPHICS"] = self.options.graphics + tc.variables["SFML_BUILD_NETWORK"] = self.options.network + tc.variables["SFML_BUILD_AUDIO"] = self.options.audio + tc.variables["SFML_INSTALL_PKGCONFIG_FILES"] = False + tc.variables["SFML_GENERATE_PDB"] = False + tc.variables["SFML_USE_SYSTEM_DEPS"] = True if is_msvc(self): - cmake.definitions["SFML_USE_STATIC_STD_LIBS"] = is_msvc_static_runtime(self) - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.variables["SFML_USE_STATIC_STD_LIBS"] = is_msvc_static_runtime(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + 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")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), - {values["target"]: "SFML::{}".format(component) for component, values in self._sfml_components.items()} + {values["target"]: f"SFML::{component}" for component, values in self._sfml_components.items()} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") @property def _sfml_components(self): @@ -166,7 +161,7 @@ def log(): return ["log"] if self.settings.os == "Android" else [] def foundation(): - return ["Foundation"] if tools.is_apple_os(self.settings.os) else [] + return ["Foundation"] if is_apple_os(self) else [] def appkit(): return ["AppKit"] if self.settings.os == "Macos" else [] @@ -204,15 +199,15 @@ def opengles_ios(): sfml_components = { "system": { "target": "sfml-system", - "libs": ["sfml-system{}".format(suffix)], + "libs": [f"sfml-system{suffix}"], "system_libs": winmm() + pthread() + rt() + android() + log(), }, } if self.settings.os in ["Windows", "Android", "iOS"]: sfml_main_suffix = "-d" if self.settings.build_type == "Debug" else "" - sfmlmain_libs = ["sfml-main{}".format(sfml_main_suffix)] + sfmlmain_libs = [f"sfml-main{sfml_main_suffix}"] if self.settings.os == "Android": - sfmlmain_libs.append("sfml-activity{}".format(suffix)) + sfmlmain_libs.append(f"sfml-activity{suffix}") sfml_components.update({ "main": { "target": "sfml-main", @@ -224,7 +219,7 @@ def opengles_ios(): sfml_components.update({ "window": { "target": "sfml-window", - "libs": ["sfml-window{}".format(suffix)], + "libs": [f"sfml-window{suffix}"], "requires": ["system"] + opengl() + xorg() + libudev(), "system_libs": gdi32() + winmm() + usbhid() + android() + opengles_android(), "frameworks": foundation() + appkit() + iokit() + carbon() + @@ -236,7 +231,7 @@ def opengles_ios(): sfml_components.update({ "graphics": { "target": "sfml-graphics", - "libs": ["sfml-graphics{}".format(suffix)], + "libs": [f"sfml-graphics{suffix}"], "requires": ["window", "freetype::freetype", "stb::stb"], }, }) @@ -244,7 +239,7 @@ def opengles_ios(): sfml_components.update({ "network": { "target": "sfml-network", - "libs": ["sfml-network{}".format(suffix)], + "libs": [f"sfml-network{suffix}"], "requires": ["system"], "system_libs": ws2_32(), }, @@ -253,7 +248,7 @@ def opengles_ios(): sfml_components.update({ "audio": { "target": "sfml-audio", - "libs": ["sfml-audio{}".format(suffix)], + "libs": [f"sfml-audio{suffix}"], "requires": ["system", "flac::flac", "openal::openal", "vorbis::vorbis"], "system_libs": android(), }, diff --git a/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch index 118af3f23f384..b2a851662076d 100644 --- a/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch +++ b/recipes/sfml/all/patches/0001-cmake-robust-find-deps.patch @@ -66,13 +66,23 @@ set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib") --- a/src/SFML/Graphics/CMakeLists.txt +++ b/src/SFML/Graphics/CMakeLists.txt -@@ -134,8 +134,8 @@ if(SFML_OS_ANDROID) +@@ -97,7 +97,8 @@ sfml_add_library(sfml-graphics + target_link_libraries(sfml-graphics PUBLIC sfml-window) + + # stb_image sources +-target_include_directories(sfml-graphics PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image") ++find_package(stb REQUIRED CONFIG) ++target_link_libraries(sfml-graphics PRIVATE stb::stb) + + # let CMake know about our additional graphics libraries paths + if(SFML_OS_WINDOWS) +@@ -134,8 +135,8 @@ if(SFML_OS_ANDROID) target_link_libraries(sfml-graphics PRIVATE z EGL GLESv1_CM) endif() -sfml_find_package(Freetype INCLUDE "FREETYPE_INCLUDE_DIRS" LINK "FREETYPE_LIBRARY") -target_link_libraries(sfml-graphics PRIVATE Freetype) -+find_package(Freetype REQUIRED) ++find_package(Freetype REQUIRED MODULE) +target_link_libraries(sfml-graphics PRIVATE Freetype::Freetype) # add preprocessor symbols diff --git a/recipes/sfml/all/test_package/CMakeLists.txt b/recipes/sfml/all/test_package/CMakeLists.txt index 4eae723c4335e..b5272094f7cb4 100644 --- a/recipes/sfml/all/test_package/CMakeLists.txt +++ b/recipes/sfml/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) +project(test_package LANGUAGES CXX) add_executable(${PROJECT_NAME} test_package.cpp) @@ -30,4 +27,4 @@ if(SFML_WITH_AUDIO) endif() find_package(SFML REQUIRED ${SFML_COMPONENTS} CONFIG) -target_link_libraries(${PROJECT_NAME} ${SFML_TARGETS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${SFML_TARGETS}) diff --git a/recipes/sfml/all/test_package/conanfile.py b/recipes/sfml/all/test_package/conanfile.py index d431379ec6c21..166801a7f9deb 100644 --- a/recipes/sfml/all/test_package/conanfile.py +++ b/recipes/sfml/all/test_package/conanfile.py @@ -1,21 +1,34 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SFML_WITH_WINDOW"] = self.dependencies["sfml"].options.window + tc.variables["SFML_WITH_GRAPHICS"] = self.dependencies["sfml"].options.graphics + tc.variables["SFML_WITH_NETWORK"] = self.dependencies["sfml"].options.network + tc.variables["SFML_WITH_AUDIO"] = self.dependencies["sfml"].options.audio + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["SFML_WITH_WINDOW"] = self.options["sfml"].window - cmake.definitions["SFML_WITH_GRAPHICS"] = self.options["sfml"].graphics - cmake.definitions["SFML_WITH_NETWORK"] = self.options["sfml"].network - cmake.definitions["SFML_WITH_AUDIO"] = self.options["sfml"].audio cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sfml/all/test_v1_package/CMakeLists.txt b/recipes/sfml/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5ac31c943d9c4 --- /dev/null +++ b/recipes/sfml/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) + +set(SFML_COMPONENTS system) +set(SFML_TARGETS sfml-system) +if(SFML_WITH_WINDOW) + target_compile_definitions(${PROJECT_NAME} PRIVATE SFML_WITH_WINDOW) + list(APPEND SFML_COMPONENTS window) + list(APPEND SFML_TARGETS sfml-window) +endif() +if(SFML_WITH_GRAPHICS) + target_compile_definitions(${PROJECT_NAME} PRIVATE SFML_WITH_GRAPHICS) + list(APPEND SFML_COMPONENTS graphics) + list(APPEND SFML_TARGETS sfml-graphics) +endif() +if(SFML_WITH_NETWORK) + target_compile_definitions(${PROJECT_NAME} PRIVATE SFML_WITH_NETWORK) + list(APPEND SFML_COMPONENTS network) + list(APPEND SFML_TARGETS sfml-network) +endif() +if(SFML_WITH_AUDIO) + target_compile_definitions(${PROJECT_NAME} PRIVATE SFML_WITH_AUDIO) + list(APPEND SFML_COMPONENTS audio) + list(APPEND SFML_TARGETS sfml-audio) +endif() + +find_package(SFML REQUIRED ${SFML_COMPONENTS} CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE ${SFML_TARGETS}) diff --git a/recipes/sfml/all/test_v1_package/conanfile.py b/recipes/sfml/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d431379ec6c21 --- /dev/null +++ b/recipes/sfml/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["SFML_WITH_WINDOW"] = self.options["sfml"].window + cmake.definitions["SFML_WITH_GRAPHICS"] = self.options["sfml"].graphics + cmake.definitions["SFML_WITH_NETWORK"] = self.options["sfml"].network + cmake.definitions["SFML_WITH_AUDIO"] = self.options["sfml"].audio + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From dd9380ffaa9daab3536cb68a304a4f1972c2332b Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Sat, 22 Oct 2022 04:33:50 +0200 Subject: [PATCH 547/561] (#13627) [bot] Add Access Request users (2022-10-20) --- .c3i/authorized_users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index b3998b2377562..b82bcf03f12e7 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -957,3 +957,6 @@ authorized_users: - "jwidauer" - "partiallyderived" - "Ahajha" + - "mjimenofluendo" + - "jiaoew1991" + - "ramin-raeisi" From 60b30ab03a49e74a1e48e746ce468cd6828c6bed Mon Sep 17 00:00:00 2001 From: Vladyslav Usenko Date: Sat, 22 Oct 2022 05:24:45 +0200 Subject: [PATCH 548/561] (#13661) sophus: add version 22.10 * sophus: add version 22.10 * Removed pylint skip-file to fix CI --- recipes/sophus/all/conandata.yml | 3 +++ recipes/sophus/all/conanfile.py | 4 +++- recipes/sophus/all/test_v1_package/conanfile.py | 1 - recipes/sophus/config.yml | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/recipes/sophus/all/conandata.yml b/recipes/sophus/all/conandata.yml index ec1a0a9c4fc2e..cc44a93d24470 100644 --- a/recipes/sophus/all/conandata.yml +++ b/recipes/sophus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "22.10": + url: "https://github.com/strasdat/Sophus/archive/refs/tags/v22.10.tar.gz" + sha256: "270709b83696da179447cf743357e36a8b9bc8eed5ff4b9d66d33fe691010bad" "22.04.1": url: "https://github.com/strasdat/Sophus/archive/refs/tags/v22.04.1.tar.gz" sha256: "635dc536e7768c91e89d537608226b344eef901b51fbc51c9f220c95feaa0b54" diff --git a/recipes/sophus/all/conanfile.py b/recipes/sophus/all/conanfile.py index de0219b9e8d9a..6b71153ca9340 100644 --- a/recipes/sophus/all/conanfile.py +++ b/recipes/sophus/all/conanfile.py @@ -26,7 +26,9 @@ class SophusConan(ConanFile): def requirements(self): self.requires("eigen/3.4.0") - if self.options.with_fmt and Version(self.version) >= Version("22.04.1"): + if self.options.with_fmt and Version(self.version) >= Version("22.10"): + self.requires("fmt/9.1.0") + elif self.options.with_fmt and Version(self.version) >= Version("22.04.1"): self.requires("fmt/8.1.1") def package_id(self): diff --git a/recipes/sophus/all/test_v1_package/conanfile.py b/recipes/sophus/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/sophus/all/test_v1_package/conanfile.py +++ b/recipes/sophus/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os diff --git a/recipes/sophus/config.yml b/recipes/sophus/config.yml index 2994f26022b9b..89d44f82139c3 100644 --- a/recipes/sophus/config.yml +++ b/recipes/sophus/config.yml @@ -1,4 +1,6 @@ versions: + "22.10": + folder: all "22.04.1": folder: all "1.0.0": From 010c142bd05ae6a29667797010ecf70c5040dc85 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 22 Oct 2022 05:44:39 +0200 Subject: [PATCH 549/561] (#13648) xnnpack: conan v2 support * conan v2 support * bump cpuinfo --- recipes/xnnpack/all/CMakeLists.txt | 44 ++++--- recipes/xnnpack/all/conandata.yml | 24 ++-- recipes/xnnpack/all/conanfile.py | 119 ++++++++++-------- .../xnnpack/all/test_package/CMakeLists.txt | 11 +- recipes/xnnpack/all/test_package/conanfile.py | 19 ++- .../all/test_v1_package/CMakeLists.txt | 11 ++ .../xnnpack/all/test_v1_package/conanfile.py | 17 +++ recipes/xnnpack/config.yml | 8 +- 8 files changed, 154 insertions(+), 99 deletions(-) create mode 100644 recipes/xnnpack/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/xnnpack/all/test_v1_package/conanfile.py diff --git a/recipes/xnnpack/all/CMakeLists.txt b/recipes/xnnpack/all/CMakeLists.txt index 297289017d303..cde962d5658e3 100644 --- a/recipes/xnnpack/all/CMakeLists.txt +++ b/recipes/xnnpack/all/CMakeLists.txt @@ -1,25 +1,35 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_library(cpuinfo INTERFACE IMPORTED) -add_library(clog INTERFACE IMPORTED) -set_property(TARGET cpuinfo PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::cpuinfo) -set_property(TARGET clog PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::cpuinfo) +if(NOT CMAKE_SYSTEM_PROCESSOR AND CONAN_XNNPACK_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR ${CONAN_XNNPACK_SYSTEM_PROCESSOR}) +endif() -add_library(pthreadpool INTERFACE IMPORTED) -set_property(TARGET pthreadpool PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::pthreadpool) +find_package(cpuinfo REQUIRED CONFIG) +if(NOT TARGET cpuinfo) + add_library(cpuinfo INTERFACE IMPORTED) + set_property(TARGET cpuinfo PROPERTY INTERFACE_LINK_LIBRARIES cpuinfo::cpuinfo) +endif() +if(NOT TARGET clog) + add_library(clog INTERFACE IMPORTED) + set_property(TARGET clog PROPERTY INTERFACE_LINK_LIBRARIES cpuinfo::cpuinfo) +endif() -add_library(fxdiv INTERFACE IMPORTED) -set_property(TARGET fxdiv PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::fxdiv) +find_package(pthreadpool REQUIRED CONFIG) +if(NOT TARGET pthreadpool) + add_library(pthreadpool INTERFACE IMPORTED) + set_property(TARGET pthreadpool PROPERTY INTERFACE_LINK_LIBRARIES pthreadpool::pthreadpool) +endif() -add_library(fp16 INTERFACE IMPORTED) -set_property(TARGET fp16 PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::fp16) +find_package(fp16 REQUIRED CONFIG) +if(NOT TARGET fp16) + add_library(fp16 INTERFACE IMPORTED) + set_property(TARGET fp16 PROPERTY INTERFACE_LINK_LIBRARIES fp16::fp16) +endif() -if(MSVC AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +# not a direct requirement, but we have to define this target to avoid xnnpack to download it +if(NOT TARGET fxdiv) + add_library(fxdiv INTERFACE IMPORTED) endif() -add_subdirectory(source_subfolder) +add_subdirectory(src) diff --git a/recipes/xnnpack/all/conandata.yml b/recipes/xnnpack/all/conandata.yml index b8350dbe92b09..5168859b5421f 100644 --- a/recipes/xnnpack/all/conandata.yml +++ b/recipes/xnnpack/all/conandata.yml @@ -1,16 +1,16 @@ sources: - "cci.20210310": - url: "https://github.com/google/XNNPACK/archive/24c2dec2c451b7594eb6ef70c538923899bd541c.tar.gz" - sha256: "f049f55d57d6e608dd1125c3d40323763dc842949b31437be7158b7e91687ed8" - "cci.20211026": - url: "https://github.com/google/XNNPACK/archive/ccbaedf11c70a3ff4db0ef17cfeacd710ffc3492.tar.gz" - sha256: "9324aea663d21cea4538095c40928572ddb685e0601853f278b7e5ead697fe81" - "cci.20211210": - url: "https://github.com/google/XNNPACK/archive/113092317754c7dea47bfb3cb49c4f59c3c1fa10.tar.gz" - sha256: "065bb9c85438c453f9300251f263118c4d123d79b21acf8f66582a3124d95fb2" - "cci.20220621": - url: "https://github.com/google/XNNPACK/archive/b725ca1a40b53d8087d1be0c53cb49fa05e2f1bc.tar.gz" - sha256: "a745c629dea5fc76e5a545e412a408fde1a523b71027f07d1b0670ec9ae54819" "cci.20220801": url: "https://github.com/google/XNNPACK/archive/8e3d3359f9bec608e09fac1f7054a2a14b1bd73c.tar.gz" sha256: "c82327543249bd333034bbaa0300ed1fc9c7060fa73673a285042e3f042540e0" + "cci.20220621": + url: "https://github.com/google/XNNPACK/archive/b725ca1a40b53d8087d1be0c53cb49fa05e2f1bc.tar.gz" + sha256: "a745c629dea5fc76e5a545e412a408fde1a523b71027f07d1b0670ec9ae54819" + "cci.20211210": + url: "https://github.com/google/XNNPACK/archive/113092317754c7dea47bfb3cb49c4f59c3c1fa10.tar.gz" + sha256: "065bb9c85438c453f9300251f263118c4d123d79b21acf8f66582a3124d95fb2" + "cci.20211026": + url: "https://github.com/google/XNNPACK/archive/ccbaedf11c70a3ff4db0ef17cfeacd710ffc3492.tar.gz" + sha256: "9324aea663d21cea4538095c40928572ddb685e0601853f278b7e5ead697fe81" + "cci.20210310": + url: "https://github.com/google/XNNPACK/archive/24c2dec2c451b7594eb6ef70c538923899bd541c.tar.gz" + sha256: "f049f55d57d6e608dd1125c3d40323763dc842949b31437be7158b7e91687ed8" diff --git a/recipes/xnnpack/all/conanfile.py b/recipes/xnnpack/all/conanfile.py index 131f20b274b16..b4f316563dd04 100644 --- a/recipes/xnnpack/all/conanfile.py +++ b/recipes/xnnpack/all/conanfile.py @@ -1,8 +1,13 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import glob +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file +from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version import os +required_conan_version = ">=1.51.1" + class XnnpackConan(ConanFile): name = "xnnpack" @@ -10,8 +15,8 @@ class XnnpackConan(ConanFile): "neural network inference operators for ARM, WebAssembly, " \ "and x86 platforms." license = "BSD-3-Clause" - topics = ("conan", "xnnpack", "neural-network", "inference", "multithreading", - "inference-optimization", "matrix-multiplication", "simd") + topics = ("neural-network", "inference", "multithreading", "inference-optimization", + "matrix-multiplication", "simd") homepage = "https://github.com/google/XNNPACK" url = "https://github.com/conan-io/conan-center-index" @@ -32,12 +37,6 @@ class XnnpackConan(ConanFile): } exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" def config_options(self): if self.settings.os == "Windows": @@ -45,72 +44,82 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - compiler = self.settings.compiler - compiler_version = tools.Version(compiler.version) - if (compiler == "gcc" and compiler_version < "6") or \ - (compiler == "clang" and compiler_version < "5") or \ - (compiler == "Visual Studio" and compiler_version < "16"): - raise ConanInvalidConfiguration("xnnpack doesn't support {} {}".format(str(compiler), compiler.version)) + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("cpuinfo/cci.20201217") + self.requires("cpuinfo/cci.20220228") self.requires("fp16/cci.20210320") - # Note: using newer version of pthreadpool compared to reference cci.20201205 self.requires("pthreadpool/cci.20210218") - def _patch_sources(self): - tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "CMakeLists.txt"), - "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}", - "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}") + def validate(self): + check_min_vs(self, 192) + compiler = self.info.settings.compiler + compiler_version = Version(compiler.version) + if (compiler == "gcc" and compiler_version < "6") or \ + (compiler == "clang" and compiler_version < "5"): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support {compiler} {compiler.version}") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("XNNPACK-*")[0] - os.rename(extracted_dir, self._source_subfolder) - self._patch_sources() + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) if self.settings.arch == "armv8": if self.settings.os == "Linux": - self._cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = "aarch64" + tc.variables["CONAN_XNNPACK_SYSTEM_PROCESSOR"] = "aarch64" else: # Not defined by Conan for Apple Silicon. See https://github.com/conan-io/conan/pull/8026 - self._cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = "arm64" - self._cmake.definitions["XNNPACK_LIBRARY_TYPE"] = "shared" if self.options.shared else "static" - self._cmake.definitions["XNNPACK_ENABLE_ASSEMBLY"] = self.options.assembly - self._cmake.definitions["XNNPACK_ENABLE_MEMOPT"] = self.options.memopt - self._cmake.definitions["XNNPACK_ENABLE_SPARSE"] = self.options.sparse - self._cmake.definitions["XNNPACK_BUILD_TESTS"] = False - self._cmake.definitions["XNNPACK_BUILD_BENCHMARKS"] = False - + tc.variables["CONAN_XNNPACK_SYSTEM_PROCESSOR"] = "arm64" + tc.cache_variables["XNNPACK_LIBRARY_TYPE"] = "shared" if self.options.shared else "static" + tc.variables["XNNPACK_ENABLE_ASSEMBLY"] = self.options.assembly + tc.variables["XNNPACK_ENABLE_MEMOPT"] = self.options.memopt + tc.variables["XNNPACK_ENABLE_SPARSE"] = self.options.sparse + tc.variables["XNNPACK_BUILD_TESTS"] = False + tc.variables["XNNPACK_BUILD_BENCHMARKS"] = False + tc.variables["XNNPACK_USE_SYSTEM_LIBS"] = True # Default fPIC on if it doesn't exist (i.e. for shared library builds) - self._cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - - # Use conan dependencies instead of downloading them during configuration - self._cmake.definitions["XNNPACK_USE_SYSTEM_LIBS"] = True - + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # Install only built targets, in this case just the XNNPACK target - self._cmake.definitions["CMAKE_SKIP_INSTALL_ALL_DEPENDENCY"] = True + tc.variables["CMAKE_SKIP_INSTALL_ALL_DEPENDENCY"] = True + # To export symbols for shared msvc + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() - self._cmake.configure() - return self._cmake + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}", + "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}") def build(self): - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build(target="XNNPACK") def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): self.cpp_info.libs = ["XNNPACK"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] diff --git a/recipes/xnnpack/all/test_package/CMakeLists.txt b/recipes/xnnpack/all/test_package/CMakeLists.txt index fd126a732c403..b71bd6e6242c8 100644 --- a/recipes/xnnpack/all/test_package/CMakeLists.txt +++ b/recipes/xnnpack/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(xnnpack REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) +target_link_libraries(${PROJECT_NAME} PRIVATE xnnpack::xnnpack) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/xnnpack/all/test_package/conanfile.py b/recipes/xnnpack/all/test_package/conanfile.py index 5216332f39f5c..0a6bc68712d90 100644 --- a/recipes/xnnpack/all/test_package/conanfile.py +++ b/recipes/xnnpack/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/xnnpack/all/test_v1_package/CMakeLists.txt b/recipes/xnnpack/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..7a503e7fa1a41 --- /dev/null +++ b/recipes/xnnpack/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(xnnpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE xnnpack::xnnpack) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/xnnpack/all/test_v1_package/conanfile.py b/recipes/xnnpack/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/xnnpack/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/xnnpack/config.yml b/recipes/xnnpack/config.yml index 99df439925ce4..48525c3051347 100644 --- a/recipes/xnnpack/config.yml +++ b/recipes/xnnpack/config.yml @@ -1,11 +1,11 @@ versions: - "cci.20210310": + "cci.20220801": folder: all - "cci.20211026": + "cci.20220621": folder: all "cci.20211210": folder: all - "cci.20220621": + "cci.20211026": folder: all - "cci.20220801": + "cci.20210310": folder: all From 923318d88cfbfa475cf6d4ac002f53f13b08aa33 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 22 Oct 2022 06:26:24 +0200 Subject: [PATCH 550/561] (#12657) psimd: conan v2 support * conan v2 support * declarations for gcc & clang only --- recipes/psimd/all/conanfile.py | 34 ++++++++++++------- recipes/psimd/all/test_package/CMakeLists.txt | 7 ++-- recipes/psimd/all/test_package/conanfile.py | 19 ++++++++--- recipes/psimd/all/test_package/test_package.c | 2 ++ .../psimd/all/test_v1_package/CMakeLists.txt | 10 ++++++ .../psimd/all/test_v1_package/conanfile.py | 17 ++++++++++ 6 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 recipes/psimd/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/psimd/all/test_v1_package/conanfile.py diff --git a/recipes/psimd/all/conanfile.py b/recipes/psimd/all/conanfile.py index 99979718ffba1..138520809226b 100644 --- a/recipes/psimd/all/conanfile.py +++ b/recipes/psimd/all/conanfile.py @@ -1,30 +1,38 @@ -from conans import ConanFile, tools -import glob +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout import os +required_conan_version = ">=1.50.0" + class PsimdConan(ConanFile): name = "psimd" description = "Portable 128-bit SIMD intrinsics." license = "MIT" - topics = ("conan", "psimd", "simd") + topics = ("psimd", "simd") homepage = "https://github.com/Maratyszcza/psimd" url = "https://github.com/conan-io/conan-center-index" - + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): - self.info.header_only() + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("psimd-*")[0] - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def build(self): + pass def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/psimd/all/test_package/CMakeLists.txt b/recipes/psimd/all/test_package/CMakeLists.txt index 7b9b613cbb24a..05b88bb3a3986 100644 --- a/recipes/psimd/all/test_package/CMakeLists.txt +++ b/recipes/psimd/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(psimd REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE psimd::psimd) diff --git a/recipes/psimd/all/test_package/conanfile.py b/recipes/psimd/all/test_package/conanfile.py index 5216332f39f5c..0a6bc68712d90 100644 --- a/recipes/psimd/all/test_package/conanfile.py +++ b/recipes/psimd/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, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/psimd/all/test_package/test_package.c b/recipes/psimd/all/test_package/test_package.c index 27f0a6e9339c6..df931cf110b83 100644 --- a/recipes/psimd/all/test_package/test_package.c +++ b/recipes/psimd/all/test_package/test_package.c @@ -3,6 +3,8 @@ #include int main() { +#if defined(__GNUC__) || defined(__clang__) psimd_u32 a = psimd_splat_u32(UINT32_C(0x80000000)); +#endif return 0; } diff --git a/recipes/psimd/all/test_v1_package/CMakeLists.txt b/recipes/psimd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..e8cb47d9d69b7 --- /dev/null +++ b/recipes/psimd/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(psimd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE psimd::psimd) diff --git a/recipes/psimd/all/test_v1_package/conanfile.py b/recipes/psimd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/psimd/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From abf39ae94ea705318603a206f62823a0082dbfe1 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Sat, 22 Oct 2022 06:44:30 +0200 Subject: [PATCH 551/561] (#12956) [libcurl/xxx] Conan v2 migration * [libcurl/xxx] Conan v2 migration * Use VirtualRunEnv * Bump wolfssl and libnghttp2 * Fix linter issues * Use cmake_layout conditionaly * Add test_type and tested_reference_str * Fix test_package * Add basic_layout * Delete compiler in package_id * Fix basic_layout * Update cacert.pem sha256 * Use old syntax for bin path * Revert "Use old syntax for bin path" This reverts commit 3d5aec88c5994b58991613c6f5d873a352c5b5cd. * Use old syntax for test_v1_package bin path * Remove conans.tools.get_env * Use export_conandata_patches * Update recipes/libcurl/all/conanfile.py Co-authored-by: Uilian Ries * Use info.options/settings * Apply suggestions from code review Co-authored-by: Uilian Ries Co-authored-by: Jordan Williams * Fix indentation * Add pkgconf conditionnaly Co-authored-by: Uilian Ries * Fix if condition Co-authored-by: Uilian Ries Co-authored-by: Jordan Williams --- recipes/libcurl/all/CMakeLists.txt | 8 - recipes/libcurl/all/conandata.yml | 1 - recipes/libcurl/all/conanfile.py | 439 +++++++++--------- .../libcurl/all/test_package/CMakeLists.txt | 3 - recipes/libcurl/all/test_package/conanfile.py | 44 +- .../all/test_v1_package/CMakeLists.txt | 10 + .../libcurl/all/test_v1_package/conanfile.py | 43 ++ 7 files changed, 288 insertions(+), 260 deletions(-) delete mode 100644 recipes/libcurl/all/CMakeLists.txt create mode 100644 recipes/libcurl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libcurl/all/test_v1_package/conanfile.py diff --git a/recipes/libcurl/all/CMakeLists.txt b/recipes/libcurl/all/CMakeLists.txt deleted file mode 100644 index 8658c4251a78c..0000000000000 --- a/recipes/libcurl/all/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.0) - -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/libcurl/all/conandata.yml b/recipes/libcurl/all/conandata.yml index 40396d0b0972c..40bf395099661 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -29,4 +29,3 @@ sources: patches: "7.79.0": - patch_file: "patches/004-no-checksrc.patch" - base_path: "source_subfolder" diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index 5d90d94f7a857..5c732a75e757f 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -1,17 +1,19 @@ -import glob -import os -import re -import functools -from conans import ConanFile, AutoToolsBuildEnvironment, CMake, tools +from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, download, export_conandata_patches, get, load, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path from conan.tools.scm import Version -from conan.tools.files import replace_in_file, rmdir, chdir, get, download, save, load, apply_conandata_patches -from conan.tools.apple import is_apple_os +import os +import re -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52.0" class LibcurlConan(ConanFile): @@ -112,28 +114,19 @@ class LibcurlConan(ConanFile): "with_ca_bundle": None, "with_ca_path": None, } - generators = "cmake", "cmake_find_package_multi", "pkg_config", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" - @property - def _is_win_x_android(self): - return self.settings.os == "Android" and tools.os_info.is_windows - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + @property + def _is_win_x_android(self): + return self.settings.os == "Android" and self._settings_build.os == "Windows" + @property def _is_using_cmake_build(self): return is_msvc(self) or self._is_win_x_android @@ -148,10 +141,8 @@ def _has_metalink_option(self): return Version(self.version) < "7.78.0" and not self._is_using_cmake_build def export_sources(self): - self.copy("CMakeLists.txt") - self.copy("lib_Makefile_add.am") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "lib_Makefile_add.am", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if Version(self.version) < "7.10.4": @@ -181,9 +172,9 @@ def requirements(self): if self.options.with_ssl == "openssl": self.requires("openssl/1.1.1q") elif self.options.with_ssl == "wolfssl": - self.requires("wolfssl/5.3.0") + self.requires("wolfssl/5.4.0") if self.options.with_nghttp2: - self.requires("libnghttp2/1.47.0") + self.requires("libnghttp2/1.48.0") if self.options.with_libssh2: self.requires("libssh2/1.10.0") if self.options.with_zlib: @@ -195,15 +186,19 @@ def requirements(self): if self.options.with_c_ares: self.requires("c-ares/1.18.1") + def package_id(self): + del self.info.settings.compiler + def validate(self): - if self.options.with_ssl == "schannel" and self.settings.os != "Windows": + if self.info.options.with_ssl == "schannel" and self.info.settings.os != "Windows": raise ConanInvalidConfiguration("schannel only suppported on Windows.") - if self.options.with_ssl == "darwinssl" and not is_apple_os(self): + if self.info.options.with_ssl == "darwinssl" and not is_apple_os(self): raise ConanInvalidConfiguration("darwinssl only suppported on Apple like OS (Macos, iOS, watchOS or tvOS).") - if self.options.with_ssl == "wolfssl" and self._is_using_cmake_build and Version(self.version) < "7.70.0": + if self.info.options.with_ssl == "wolfssl" and self._is_using_cmake_build and Version(self.version) < "7.70.0": raise ConanInvalidConfiguration("Before 7.70.0, libcurl has no wolfssl support for Visual Studio or \"Windows to Android cross compilation\"") - if self.options.with_ssl == "openssl": - if self.options.with_ntlm and self.options["openssl"].no_des: + if self.info.options.with_ssl == "openssl": + openssl = self.dependencies["openssl"] + if self.info.options.with_ntlm and openssl.options.no_des: raise ConanInvalidConfiguration("option with_ntlm=True requires openssl:no_des=False") def build_requirements(self): @@ -212,14 +207,34 @@ def build_requirements(self): self.tool_requires("ninja/1.11.0") else: self.tool_requires("libtool/2.4.6") - self.tool_requires("pkgconf/1.7.4") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.tool_requires("msys2/cci.latest") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/1.7.4") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): + self.tool_requires("msys2/cci.latest") + + def layout(self): + if self._is_using_cmake_build: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") def source(self): get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - download(self, "https://curl.haxx.se/ca/cacert.pem", "cacert.pem", verify=True) + destination=self.source_folder, strip_root=True) + download(self, "https://curl.haxx.se/ca/cacert.pem", "cacert.pem", verify=True, sha256="2cff03f9efdaf52626bd1b451d700605dc1ea000c5da56bd0fc59f8f43071040") + + def generate(self): + if self._is_using_cmake_build: + self._generate_with_cmake() + else: + self._generate_with_autotools() + ms = VirtualBuildEnv(self) + ms.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") # TODO: remove imports once rpath of shared libs of libcurl dependencies fixed on macOS def imports(self): @@ -231,14 +246,19 @@ def imports(self): # but does not work on OS X 10.11 with SIP) # 2. copying dylib's to the build directory (fortunately works on OS X) if self.settings.os == "Macos": - self.copy("*.dylib*", dst=self._source_subfolder, keep_path=False) + copy(self, "*.dylib*", src=self.build_folder, dst=self.source_folder, keep_path=False) def build(self): self._patch_sources() if self._is_using_cmake_build: - self._build_with_cmake() + cmake = CMake(self) + cmake.configure() + cmake.build() else: - self._build_with_autotools() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def _patch_sources(self): apply_conandata_patches(self) @@ -248,7 +268,7 @@ def _patch_sources(self): def _patch_misc_files(self): if self.options.with_largemaxwritesize: - replace_in_file(self, os.path.join(self._source_subfolder, "include", "curl", "curl.h"), + replace_in_file(self, os.path.join(self.source_folder, "include", "curl", "curl.h"), "define CURL_MAX_WRITE_SIZE 16384", "define CURL_MAX_WRITE_SIZE 10485760") @@ -256,7 +276,7 @@ def _patch_misc_files(self): # for additional info, see this comment https://github.com/conan-io/conan-center-index/pull/1008#discussion_r386122685 if self.settings.compiler == "apple-clang" and self.settings.compiler.version == "9.1": if self.options.with_ssl == "darwinssl": - replace_in_file(self, os.path.join(self._source_subfolder, "lib", "vtls", "sectransp.c"), + replace_in_file(self, os.path.join(self.source_folder, "lib", "vtls", "sectransp.c"), "#define CURL_BUILD_MAC_10_13 MAC_OS_X_VERSION_MAX_ALLOWED >= 101300", "#define CURL_BUILD_MAC_10_13 0") @@ -267,25 +287,25 @@ def _patch_autotools(self): # Disable curl tool for these reasons: # - link errors if mingw shared or iOS/tvOS/watchOS # - it makes recipe consistent with CMake build where we don't build curl tool - top_makefile = os.path.join(self._source_subfolder, "Makefile.am") + top_makefile = os.path.join(self.source_folder, "Makefile.am") replace_in_file(self, top_makefile, "SUBDIRS = lib src", "SUBDIRS = lib") replace_in_file(self, top_makefile, "include src/Makefile.inc", "") if self._is_mingw: # patch for zlib naming in mingw if self.options.with_zlib: - configure_ac = os.path.join(self._source_subfolder, "configure.ac") + configure_ac = os.path.join(self.source_folder, "configure.ac") zlib_name = self.deps_cpp_info["zlib"].libs[0] replace_in_file(self, configure_ac, "AC_CHECK_LIB(z,", - "AC_CHECK_LIB({},".format(zlib_name)) + f"AC_CHECK_LIB({zlib_name}") replace_in_file(self, configure_ac, "-lz ", - "-l{} ".format(zlib_name)) + f"-l{zlib_name}") if self.options.shared: # patch for shared mingw build - lib_makefile = os.path.join(self._source_subfolder, "lib", "Makefile.am") + lib_makefile = os.path.join(self.source_folder, "lib", "Makefile.am") replace_in_file(self, lib_makefile, "noinst_LTLIBRARIES = libcurlu.la", "") @@ -304,10 +324,10 @@ def _patch_autotools(self): def _patch_cmake(self): if not self._is_using_cmake_build: return - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") # Custom findZstd.cmake file relies on pkg-config file, make sure that it's consumed on all platforms if self._has_zstd_option: - replace_in_file(self, os.path.join(self._source_subfolder, "CMake", "FindZstd.cmake"), + replace_in_file(self, os.path.join(self.source_folder, "CMake", "FindZstd.cmake"), "if(UNIX)", "if(TRUE)") # TODO: check this patch, it's suspicious replace_in_file(self, cmakelists, @@ -344,111 +364,143 @@ def _patch_cmake(self): get_target_property(_lib "${_libname}" LOCATION)""", ) - def _get_configure_command_args(self): - yes_no = lambda v: "yes" if v else "no" - params = [ - "--with-libidn2={}".format(yes_no(self.options.with_libidn)), - "--with-librtmp={}".format(yes_no(self.options.with_librtmp)), - "--with-libpsl={}".format(yes_no(self.options.with_libpsl)), - "--with-schannel={}".format(yes_no(self.options.with_ssl == "schannel")), - "--with-secure-transport={}".format(yes_no(self.options.with_ssl == "darwinssl")), - "--with-brotli={}".format(yes_no(self.options.with_brotli)), - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--enable-dict={}".format(yes_no(self.options.with_dict)), - "--enable-file={}".format(yes_no(self.options.with_file)), - "--enable-ftp={}".format(yes_no(self.options.with_ftp)), - "--enable-gopher={}".format(yes_no(self.options.with_gopher)), - "--enable-http={}".format(yes_no(self.options.with_http)), - "--enable-imap={}".format(yes_no(self.options.with_imap)), - "--enable-ldap={}".format(yes_no(self.options.with_ldap)), - "--enable-mqtt={}".format(yes_no(self.options.with_mqtt)), - "--enable-pop3={}".format(yes_no(self.options.with_pop3)), - "--enable-rtsp={}".format(yes_no(self.options.with_rtsp)), - "--enable-smb={}".format(yes_no(self.options.with_smb)), - "--enable-smtp={}".format(yes_no(self.options.with_smtp)), - "--enable-telnet={}".format(yes_no(self.options.with_telnet)), - "--enable-tftp={}".format(yes_no(self.options.with_tftp)), - "--enable-debug={}".format(yes_no(self.settings.build_type == "Debug")), - "--enable-ares={}".format(yes_no(self.options.with_c_ares)), - "--enable-threaded-resolver={}".format(yes_no(self.options.with_threaded_resolver)), - "--enable-cookies={}".format(yes_no(self.options.with_cookies)), - "--enable-ipv6={}".format(yes_no(self.options.with_ipv6)), - "--enable-manual={}".format(yes_no(self.options.with_docs)), - "--enable-verbose={}".format(yes_no(self.options.with_verbose_debug)), - "--enable-symbol-hiding={}".format(yes_no(self.options.with_symbol_hiding)), - "--enable-unix-sockets={}".format(yes_no(self.options.with_unix_sockets)), - ] + def _yes_no(self, value): + return "yes" if value else "no" + + def _generate_with_autotools(self): + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--with-libidn2={self._yes_no(self.options.with_libidn)}", + f"--with-librtmp={self._yes_no(self.options.with_librtmp)}", + f"--with-libpsl={self._yes_no(self.options.with_libpsl)}", + f"--with-schannel={self._yes_no(self.options.with_ssl == 'schannel')}", + f"--with-secure-transport={self._yes_no(self.options.with_ssl == 'darwinssl')}", + f"--with-brotli={self._yes_no(self.options.with_brotli)}", + f"--enable-shared={self._yes_no(self.options.shared)}", + f"--enable-static={self._yes_no(not self.options.shared)}", + f"--enable-dict={self._yes_no(self.options.with_dict)}", + f"--enable-file={self._yes_no(self.options.with_file)}", + f"--enable-ftp={self._yes_no(self.options.with_ftp)}", + f"--enable-gopher={self._yes_no(self.options.with_gopher)}", + f"--enable-http={self._yes_no(self.options.with_http)}", + f"--enable-imap={self._yes_no(self.options.with_imap)}", + f"--enable-ldap={self._yes_no(self.options.with_ldap)}", + f"--enable-mqtt={self._yes_no(self.options.with_mqtt)}", + f"--enable-pop3={self._yes_no(self.options.with_pop3)}", + f"--enable-rtsp={self._yes_no(self.options.with_rtsp)}", + f"--enable-smb={self._yes_no(self.options.with_smb)}", + f"--enable-smtp={self._yes_no(self.options.with_smtp)}", + f"--enable-telnet={self._yes_no(self.options.with_telnet)}", + f"--enable-tftp={self._yes_no(self.options.with_tftp)}", + f"--enable-debug={self._yes_no(self.settings.build_type == 'Debug')}", + f"--enable-ares={self._yes_no(self.options.with_c_ares)}", + f"--enable-threaded-resolver={self._yes_no(self.options.with_threaded_resolver)}", + f"--enable-cookies={self._yes_no(self.options.with_cookies)}", + f"--enable-ipv6={self._yes_no(self.options.with_ipv6)}", + f"--enable-manual={self._yes_no(self.options.with_docs)}", + f"--enable-verbose={self._yes_no(self.options.with_verbose_debug)}", + f"--enable-symbol-hiding={self._yes_no(self.options.with_symbol_hiding)}", + f"--enable-unix-sockets={self._yes_no(self.options.with_unix_sockets)}", + ]) if self.options.with_ssl == "openssl": - params.append("--with-ssl={}".format(tools.unix_path(self.deps_cpp_info["openssl"].rootpath))) + path = unix_path(self, self.deps_cpp_info["openssl"].rootpath) + tc.configure_args.append(f"--with-ssl={path}") else: - params.append("--without-ssl") + tc.configure_args.append("--without-ssl") if self.options.with_ssl == "wolfssl": - params.append("--with-wolfssl={}".format(tools.unix_path(self.deps_cpp_info["wolfssl"].rootpath))) + path = unix_path(self, self.deps_cpp_info["wolfssl"].rootpath) + tc.configure_args.append(f"--with-wolfssl={path}") else: - params.append("--without-wolfssl") + tc.configure_args.append("--without-wolfssl") if self.options.with_libssh2: - params.append("--with-libssh2={}".format(tools.unix_path(self.deps_cpp_info["libssh2"].rootpath))) + path = unix_path(self, self.deps_cpp_info["libssh2"].rootpath) + tc.configure_args.append(f"--with-libssh2={path}") else: - params.append("--without-libssh2") + tc.configure_args.append("--without-libssh2") if self.options.with_nghttp2: - params.append("--with-nghttp2={}".format(tools.unix_path(self.deps_cpp_info["libnghttp2"].rootpath))) + path = unix_path(self, self.deps_cpp_info["libnghttp2"].rootpath) + tc.configure_args.append(f"--with-nghttp2={path}") else: - params.append("--without-nghttp2") + tc.configure_args.append("--without-nghttp2") if self.options.with_zlib: - params.append("--with-zlib={}".format(tools.unix_path(self.deps_cpp_info["zlib"].rootpath))) + path = unix_path(self, self.deps_cpp_info["zlib"].rootpath) + tc.configure_args.append(f"--with-zlib={path}") else: - params.append("--without-zlib") + tc.configure_args.append("--without-zlib") if self._has_zstd_option: - params.append("--with-zstd={}".format(yes_no(self.options.with_zstd))) + tc.configure_args.append(f"--with-zstd={self._yes_no(self.options.with_zstd)}") if self._has_metalink_option: - params.append("--with-libmetalink={}".format(yes_no(self.options.with_libmetalink))) + tc.configure_args.append(f"--with-libmetalink={self._yes_no(self.options.with_libmetalink)}") if not self.options.with_proxy: - params.append("--disable-proxy") + tc.configure_args.append("--disable-proxy") if not self.options.with_rtsp: - params.append("--disable-rtsp") + tc.configure_args.append("--disable-rtsp") if not self.options.with_crypto_auth: - params.append("--disable-crypto-auth") # also disables NTLM in versions of curl prior to 7.78.0 + tc.configure_args.append("--disable-crypto-auth") # also disables NTLM in versions of curl prior to 7.78.0 # ntlm will default to enabled if any SSL options are enabled if not self.options.with_ntlm: if Version(self.version) <= "7.77.0": - params.append("--disable-crypto-auth") + tc.configure_args.append("--disable-crypto-auth") else: - params.append("--disable-ntlm") + tc.configure_args.append("--disable-ntlm") if not self.options.with_ntlm_wb: - params.append("--disable-ntlm-wb") + tc.configure_args.append("--disable-ntlm-wb") - if self.options.with_ca_bundle == False: - params.append("--without-ca-bundle") + if self.options.with_ca_bundle is False: + tc.configure_args.append("--without-ca-bundle") elif self.options.with_ca_bundle: - params.append("--with-ca-bundle=" + str(self.options.with_ca_bundle)) + tc.configure_args.append("--with-ca-bundle=" + str(self.options.with_ca_bundle)) - if self.options.with_ca_path == False: - params.append('--without-ca-path') + if self.options.with_ca_path is False: + tc.configure_args.append('--without-ca-path') elif self.options.with_ca_path: - params.append("--with-ca-path=" + str(self.options.with_ca_path)) + tc.configure_args.append("--with-ca-path=" + str(self.options.with_ca_path)) # Cross building flags if cross_building(self): if self.settings.os == "Linux" and "arm" in self.settings.arch: - params.append("--host=%s" % self._get_linux_arm_host()) + tc.configure_args.append(f"--host={self._get_linux_arm_host()}") elif self.settings.os == "iOS": - params.append("--enable-threaded-resolver") - params.append("--disable-verbose") + tc.configure_args.append("--enable-threaded-resolver") + tc.configure_args.append("--disable-verbose") elif self.settings.os == "Android": pass # this just works, conan is great! - return params + # tweaks for mingw + if self._is_mingw: + rcflags = "-O COFF" + if self.settings.arch == "x86": + rcflags += " --target=pe-i386" + else: + rcflags += " --target=pe-x86-64" + env = tc.environment() + env.define("RCFLAGS", rcflags) + + tc.extra_defines.append("_AMD64_") + + if self.settings.os != "Windows": + tc.fpic = self.options.get_safe("fPIC", True) + + + if cross_building(self) and is_apple_os(self): + tc.extra_defines.extend(['HAVE_SOCKET', 'HAVE_FCNTL_O_NONBLOCK']) + + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + def _get_linux_arm_host(self): arch = None @@ -472,150 +524,89 @@ def _arm_version(self, arch): version = int(match.group(1)) return version - def _build_with_autotools(self): - with chdir(self, self._source_subfolder): - # autoreconf - self.run("{} -fiv".format(tools.get_env("AUTORECONF") or "autoreconf"), win_bash=tools.os_info.is_windows, run_environment=True) - - # fix generated autotools files to have relocatable binaries - if is_apple_os(self): - replace_in_file(self, "configure", "-install_name \\$rpath/", "-install_name @rpath/") - - self.run("chmod +x configure") - - # run configure with *LD_LIBRARY_PATH env vars it allows to pick up shared openssl - with tools.run_environment(self): - autotools, autotools_vars = self._configure_autotools() - autotools.make(vars=autotools_vars) - - def _configure_autotools_vars(self): - autotools_vars = {} - # tweaks for mingw - if self._is_mingw: - autotools_vars["RCFLAGS"] = "-O COFF" - if self.settings.arch == "x86": - autotools_vars["RCFLAGS"] += " --target=pe-i386" - else: - autotools_vars["RCFLAGS"] += " --target=pe-x86-64" - return autotools_vars - - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - - if self.settings.os != "Windows": - autotools.fpic = self.options.get_safe("fPIC", True) - - autotools_vars = self._configure_autotools_vars() - - # tweaks for mingw - if self._is_mingw: - autotools.defines.append("_AMD64_") - - if cross_building(self) and is_apple_os(self): - autotools.defines.extend(['HAVE_SOCKET', 'HAVE_FCNTL_O_NONBLOCK']) - - configure_args = self._get_configure_command_args() - - if self.settings.os == "iOS" and self.settings.arch == "x86_64": - # please do not autodetect --build for the iOS simulator, thanks! - autotools.configure(vars=autotools_vars, args=configure_args, build=False) - else: - autotools.configure(vars=autotools_vars, args=configure_args) - - return autotools, autotools_vars - - @functools.lru_cache(1) - def _configure_cmake(self): + def _generate_with_cmake(self): if self._is_win_x_android: - cmake = CMake(self, generator="Ninja") + tc = CMakeToolchain(self, generator="Ninja") else: - cmake = CMake(self) - cmake.definitions["BUILD_TESTING"] = False - cmake.definitions["BUILD_CURL_EXE"] = False - cmake.definitions["CURL_DISABLE_LDAP"] = not self.options.with_ldap - cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared - cmake.definitions["CURL_STATICLIB"] = not self.options.shared - cmake.definitions["CMAKE_DEBUG_POSTFIX"] = "" + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_CURL_EXE"] = False + tc.variables["CURL_DISABLE_LDAP"] = not self.options.with_ldap + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["CURL_STATICLIB"] = not self.options.shared + tc.variables["CMAKE_DEBUG_POSTFIX"] = "" if Version(self.version) >= "7.81.0": - cmake.definitions["CURL_USE_SCHANNEL"] = self.options.with_ssl == "schannel" + tc.variables["CURL_USE_SCHANNEL"] = self.options.with_ssl == "schannel" elif Version(self.version) >= "7.72.0": - cmake.definitions["CMAKE_USE_SCHANNEL"] = self.options.with_ssl == "schannel" + tc.variables["CMAKE_USE_SCHANNEL"] = self.options.with_ssl == "schannel" else: - cmake.definitions["CMAKE_USE_WINSSL"] = self.options.with_ssl == "schannel" + tc.variables["CMAKE_USE_WINSSL"] = self.options.with_ssl == "schannel" if Version(self.version) >= "7.81.0": - cmake.definitions["CURL_USE_OPENSSL"] = self.options.with_ssl == "openssl" + tc.variables["CURL_USE_OPENSSL"] = self.options.with_ssl == "openssl" else: - cmake.definitions["CMAKE_USE_OPENSSL"] = self.options.with_ssl == "openssl" + tc.variables["CMAKE_USE_OPENSSL"] = self.options.with_ssl == "openssl" if Version(self.version) >= "7.81.0": - cmake.definitions["CURL_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" + tc.variables["CURL_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" elif Version(self.version) >= "7.70.0": - cmake.definitions["CMAKE_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" - cmake.definitions["USE_NGHTTP2"] = self.options.with_nghttp2 - cmake.definitions["CURL_ZLIB"] = self.options.with_zlib - cmake.definitions["CURL_BROTLI"] = self.options.with_brotli + tc.variables["CMAKE_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" + tc.variables["USE_NGHTTP2"] = self.options.with_nghttp2 + tc.variables["CURL_ZLIB"] = self.options.with_zlib + tc.variables["CURL_BROTLI"] = self.options.with_brotli if self._has_zstd_option: - cmake.definitions["CURL_ZSTD"] = self.options.with_zstd + tc.variables["CURL_ZSTD"] = self.options.with_zstd if Version(self.version) >= "7.81.0": - cmake.definitions["CURL_USE_LIBSSH2"] = self.options.with_libssh2 + tc.variables["CURL_USE_LIBSSH2"] = self.options.with_libssh2 else: - cmake.definitions["CMAKE_USE_LIBSSH2"] = self.options.with_libssh2 - cmake.definitions["ENABLE_ARES"] = self.options.with_c_ares + tc.variables["CMAKE_USE_LIBSSH2"] = self.options.with_libssh2 + tc.variables["ENABLE_ARES"] = self.options.with_c_ares if not self.options.with_c_ares: - cmake.definitions["ENABLE_THREADED_RESOLVER"] = self.options.with_threaded_resolver - cmake.definitions["CURL_DISABLE_PROXY"] = not self.options.with_proxy - cmake.definitions["USE_LIBRTMP"] = self.options.with_librtmp + tc.variables["ENABLE_THREADED_RESOLVER"] = self.options.with_threaded_resolver + tc.variables["CURL_DISABLE_PROXY"] = not self.options.with_proxy + tc.variables["USE_LIBRTMP"] = self.options.with_librtmp if Version(self.version) >= "7.75.0": - cmake.definitions["USE_LIBIDN2"] = self.options.with_libidn - cmake.definitions["CURL_DISABLE_RTSP"] = not self.options.with_rtsp - cmake.definitions["CURL_DISABLE_CRYPTO_AUTH"] = not self.options.with_crypto_auth - cmake.definitions["CURL_DISABLE_VERBOSE_STRINGS"] = not self.options.with_verbose_strings + tc.variables["USE_LIBIDN2"] = self.options.with_libidn + tc.variables["CURL_DISABLE_RTSP"] = not self.options.with_rtsp + tc.variables["CURL_DISABLE_CRYPTO_AUTH"] = not self.options.with_crypto_auth + tc.variables["CURL_DISABLE_VERBOSE_STRINGS"] = not self.options.with_verbose_strings # Also disables NTLM_WB if set to false if not self.options.with_ntlm: if Version(self.version) <= "7.77.0": - cmake.definitions["CURL_DISABLE_CRYPTO_AUTH"] = True + tc.variables["CURL_DISABLE_CRYPTO_AUTH"] = True else: - cmake.definitions["CURL_DISABLE_NTLM"] = True - cmake.definitions["NTLM_WB_ENABLED"] = self.options.with_ntlm_wb + tc.variables["CURL_DISABLE_NTLM"] = True + tc.variables["NTLM_WB_ENABLED"] = self.options.with_ntlm_wb - if self.options.with_ca_bundle == False: - cmake.definitions['CURL_CA_BUNDLE'] = 'none' + if self.options.with_ca_bundle is False: + tc.variables['CURL_CA_BUNDLE'] = 'none' elif self.options.with_ca_bundle: - cmake.definitions['CURL_CA_BUNDLE'] = self.options.with_ca_bundle + tc.variables['CURL_CA_BUNDLE'] = self.options.with_ca_bundle - if self.options.with_ca_path == False: - cmake.definitions['CURL_CA_PATH'] = 'none' + if self.options.with_ca_path is False: + tc.variables['CURL_CA_PATH'] = 'none' elif self.options.with_ca_path: - cmake.definitions['CURL_CA_PATH'] = self.options.with_ca_path - - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.variables['CURL_CA_PATH'] = self.options.with_ca_path - def _build_with_cmake(self): - cmake = self._configure_cmake() - cmake.build() + tc.generate() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("cacert.pem", dst="res") + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="cacert.pem", src=self.build_folder, dst="res") if self._is_using_cmake_build: - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) else: - with tools.run_environment(self): - with chdir(self, self._source_subfolder): - autotools, autotools_vars = self._configure_autotools() - autotools.install(vars=autotools_vars) + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) rmdir(self, os.path.join(self.package_folder, "share")) - for la_file in glob.glob(os.path.join(self.package_folder, "lib", "*.la")): - os.remove(la_file) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) if self._is_mingw and self.options.shared: # Handle only mingw libs - self.copy(pattern="*.dll", dst="bin", keep_path=False) - self.copy(pattern="*.dll.a", dst="lib", keep_path=False) - self.copy(pattern="*.lib", dst="lib", keep_path=False) + copy(self, pattern="*.dll", src=self.build_folder, dst="bin", keep_path=False) + copy(self, pattern="*.dll.a", src=self.build_folder, dst="lib", keep_path=False) + copy(self, pattern="*.lib", src=self.build_folder, dst="lib", keep_path=False) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): diff --git a/recipes/libcurl/all/test_package/CMakeLists.txt b/recipes/libcurl/all/test_package/CMakeLists.txt index c1a339c384346..a36a89aea9b2b 100644 --- a/recipes/libcurl/all/test_package/CMakeLists.txt +++ b/recipes/libcurl/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(CURL REQUIRED) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/libcurl/all/test_package/conanfile.py b/recipes/libcurl/all/test_package/conanfile.py index 6221e377a7254..b0f5c0aed58a5 100644 --- a/recipes/libcurl/all/test_package/conanfile.py +++ b/recipes/libcurl/all/test_package/conanfile.py @@ -1,22 +1,21 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os import subprocess import re class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - - def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # Workaround for CMake bug with error message: - # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being - # set. This could be because you are using a Mac OS X version less than 10.5 - # or because CMake's platform configuration is corrupt. - # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + 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) @@ -25,14 +24,11 @@ def build(self): @property def _test_executable(self): - if self.settings.os == "Windows": - return os.path.join("bin", "test_package.exe") - else: - return os.path.join("bin", "test_package") + return os.path.join(self.cpp.build.bindirs[0], "test_package") def test(self): - if not cross_building(self): - self.run(self._test_executable, run_environment=True) + if can_run(self): + self.run(self._test_executable, env="conanrun") else: # We will dump information for the generated executable if self.settings.os in ["Android", "iOS"]: @@ -42,15 +38,15 @@ def test(self): output = subprocess.check_output(["file", self._test_executable]).decode() if self.settings.os == "Macos" and self.settings.arch == "armv8": - assert "Mach-O 64-bit executable arm64" in output, "Not found in output: {}".format(output) + assert "Mach-O 64-bit executable arm64" in output, f"Not found in output: {output}" elif self.settings.os == "Linux": if self.settings.arch == "armv8_32": - assert re.search(r"Machine:\s+ARM", output), "Not found in output: {}".format(output) + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" elif "armv8" in self.settings.arch: - assert re.search(r"Machine:\s+AArch64", output), "Not found in output: {}".format(output) + assert re.search(r"Machine:\s+AArch64", output), f"Not found in output: {output}" elif "arm" in self.settings.arch: - assert re.search(r"Machine:\s+ARM", output), "Not found in output: {}".format(output) + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" elif self.settings.os == "Windows": # FIXME: It satisfies not only MinGW - assert re.search(r"PE32.*executable.*Windows", output), "Not found in output: {}".format(output) + assert re.search(r"PE32.*executable.*Windows", output), f"Not found in output: {output}" diff --git a/recipes/libcurl/all/test_v1_package/CMakeLists.txt b/recipes/libcurl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..87b6e499b5d8e --- /dev/null +++ b/recipes/libcurl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(CURL REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} CURL::libcurl) diff --git a/recipes/libcurl/all/test_v1_package/conanfile.py b/recipes/libcurl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7ebb558a2d5e3 --- /dev/null +++ b/recipes/libcurl/all/test_v1_package/conanfile.py @@ -0,0 +1,43 @@ +from conans import ConanFile, CMake, tools +import os +import subprocess +import re + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _test_executable(self): + return os.path.join("bin", "test_package") + + def test(self): + if not tools.cross_building(self): + self.run(self._test_executable, run_environment=True) + else: + # We will dump information for the generated executable + if self.settings.os in ["Android", "iOS"]: + # FIXME: Check output for these hosts + return + + output = subprocess.check_output(["file", self._test_executable]).decode() + + if self.settings.os == "Macos" and self.settings.arch == "armv8": + assert "Mach-O 64-bit executable arm64" in output, f"Not found in output: {output}" + + elif self.settings.os == "Linux": + if self.settings.arch == "armv8_32": + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + elif "armv8" in self.settings.arch: + assert re.search(r"Machine:\s+AArch64", output), f"Not found in output: {output}" + elif "arm" in self.settings.arch: + assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" + + elif self.settings.os == "Windows": # FIXME: It satisfies not only MinGW + assert re.search(r"PE32.*executable.*Windows", output), f"Not found in output: {output}" From b4c7827a055908feb52e9a9d7da9adf68e68dcd8 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 22 Oct 2022 07:04:19 +0200 Subject: [PATCH 552/561] (#13589) orcania: add orcania/2.3.1 recipe * orcania: add orcania/2.3.1 recipe * orcania: use .variables attribute instead * Create Orcania::Orcania(-static) targets * Prepare for next orcania release that will ship CMake config files * fix name of Orcania config * No m * fix typo * Fix conan v1 support * Fix target for conan v1 * no orcania in topics * Fixes for yder * Address feedback * Update recipes/orcania/all/conanfile.py * Apply suggestions from code review * Think conan 2.0 Co-authored-by: Uilian Ries * orcania: fix mingw@Linux build Co-authored-by: Uilian Ries --- recipes/orcania/all/conandata.yml | 15 ++ recipes/orcania/all/conanfile.py | 144 ++++++++++++++++ ...mingw-fix-Werror=stringop-truncation.patch | 25 +++ .../orcania/all/patches/2.3.1-0002-no-m.patch | 9 + .../2.3.1-0003-shared-static-conan.patch | 156 ++++++++++++++++++ .../orcania/all/test_package/CMakeLists.txt | 13 ++ recipes/orcania/all/test_package/conanfile.py | 31 ++++ .../orcania/all/test_package/test_package.c | 11 ++ .../all/test_v1_package/CMakeLists.txt | 16 ++ .../orcania/all/test_v1_package/conanfile.py | 18 ++ recipes/orcania/config.yml | 3 + 11 files changed, 441 insertions(+) create mode 100644 recipes/orcania/all/conandata.yml create mode 100644 recipes/orcania/all/conanfile.py create mode 100644 recipes/orcania/all/patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch create mode 100644 recipes/orcania/all/patches/2.3.1-0002-no-m.patch create mode 100644 recipes/orcania/all/patches/2.3.1-0003-shared-static-conan.patch create mode 100644 recipes/orcania/all/test_package/CMakeLists.txt create mode 100644 recipes/orcania/all/test_package/conanfile.py create mode 100644 recipes/orcania/all/test_package/test_package.c create mode 100644 recipes/orcania/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/orcania/all/test_v1_package/conanfile.py create mode 100644 recipes/orcania/config.yml diff --git a/recipes/orcania/all/conandata.yml b/recipes/orcania/all/conandata.yml new file mode 100644 index 0000000000000..a6c92d3317bea --- /dev/null +++ b/recipes/orcania/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "2.3.1": + url: "https://github.com/babelouest/orcania/archive/refs/tags/v2.3.1.tar.gz" + sha256: "bbf08d563528b8ab88dd4b0e67aeb4e7c4fc9f19dcd1a0346b773cf492f7612b" +patches: + "2.3.1": + - patch_file: "patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch" + patch_description: "Fixes -Werror=stringop-truncation error when building with MinGW@Linux" + patch_type: "conan" + - patch_file: "patches/2.3.1-0002-no-m.patch" + patch_description: "m math library is not really needed" + patch_type: "conan" + - patch_file: "patches/2.3.1-0003-shared-static-conan.patch" + patch_description: "Build shared and static libraries + fix MSVC support" + patch_type: "conan" diff --git a/recipes/orcania/all/conanfile.py b/recipes/orcania/all/conanfile.py new file mode 100644 index 0000000000000..610d680187019 --- /dev/null +++ b/recipes/orcania/all/conanfile.py @@ -0,0 +1,144 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +import os +import textwrap + +required_conan_version = ">=1.52.0" + + +class OrcaniaConan(ConanFile): + name = "orcania" + description = "Potluck with different functions for different purposes that can be shared among C programs" + homepage = "https://github.com/babelouest/orcania" + topics = ("utility", "functions", ) + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_base64url": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_base64url": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + try: + del self.settings.compiler.libcxx + except Exception: + pass + try: + del self.settings.compiler.cppstd + except Exception: + pass + + def requirements(self): + if is_msvc(self) and self.options.enable_base64url: + self.requires("getopt-for-visual-studio/20200201") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_BASE64URL"] = self.options.enable_base64url + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", os.path.join(self.source_folder), os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + save(self, os.path.join(self.package_folder, self._variable_file_rel_path), + textwrap.dedent(f"""\ + set(ORCANIA_VERSION_STRING "{self.version}") + """)) + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {} if self.options.shared else {"Orcania::Orcania-static": "Orcania::Orcania"} + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent(f"""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @property + def _variable_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + libname = "orcania" + if is_msvc(self) and not self.options.shared: + libname += "-static" + self.cpp_info.libs = [libname] + + target_name = "Orcania::Orcania" if self.options.shared else "Orcania::Orcania-static" + self.cpp_info.set_property("cmake_file_name", "Orcania") + self.cpp_info.set_property("cmake_target_name", target_name) + self.cpp_info.set_property("cmake_module_file_name", "Orcania") + self.cpp_info.set_property("cmake_module_target_name", target_name) + self.cpp_info.set_property("pkg_config_name", "liborcania") + self.cpp_info.set_property("cmake_build_modules", [self._variable_file_rel_path]) + + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "Orcania" + self.cpp_info.filenames["cmake_find_package_multi"] = "Orcania" + self.cpp_info.names["cmake_find_package"] = "Orcania" + self.cpp_info.names["cmake_find_package_multi"] = "Orcania" + self.cpp_info.names["pkg_config"] = "liborcania" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path, self._variable_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path, self._variable_file_rel_path] diff --git a/recipes/orcania/all/patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch b/recipes/orcania/all/patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch new file mode 100644 index 0000000000000..d44e1abf5481a --- /dev/null +++ b/recipes/orcania/all/patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch @@ -0,0 +1,25 @@ +Fixes: +In function 'o_strncpy', + inlined from 'mstrcatf' at /home/maarten/programming/orcania/src/orcania.c:131:11: +/home/maarten/programming/orcania/src/orcania.c:208:12: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] + 208 | return strncpy(p1, p2, n); + | ^~~~~~~~~~~~~~~~~~ +/home/maarten/programming/orcania/src/orcania.c: In function 'mstrcatf': +/home/maarten/programming/orcania/src/orcania.c:343:12: note: length computed here + 343 | return strlen(s); + | ^~~~~~~~~ + + +--- src/orcania.c ++++ src/src/orcania.c +@@ -148,8 +148,8 @@ char * mstrcatf(char * source, const char * message, ...) { + out = o_malloc(source_len+message_formatted_len+sizeof(char)); + vsnprintf(message_formatted, (message_formatted_len+sizeof(char)), message, argp_cpy); + if (out != NULL) { +- o_strncpy(out, source, source_len); +- o_strncpy(out+source_len, message_formatted, message_formatted_len); ++ memcpy(out, source, source_len); ++ memcpy(out+source_len, message_formatted, message_formatted_len); + out[source_len+message_formatted_len] = '\0'; + } + o_free(message_formatted); diff --git a/recipes/orcania/all/patches/2.3.1-0002-no-m.patch b/recipes/orcania/all/patches/2.3.1-0002-no-m.patch new file mode 100644 index 0000000000000..30c401f4a359d --- /dev/null +++ b/recipes/orcania/all/patches/2.3.1-0002-no-m.patch @@ -0,0 +1,9 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -34,1 +34,1 @@ +-set(LIBS "-lm") ++set(LIBS ) +--- src/base64.c ++++ src/base64.c +@@ -10,1 +11,0 @@ +-#include diff --git a/recipes/orcania/all/patches/2.3.1-0003-shared-static-conan.patch b/recipes/orcania/all/patches/2.3.1-0003-shared-static-conan.patch new file mode 100644 index 0000000000000..ff2311a44bd70 --- /dev/null +++ b/recipes/orcania/all/patches/2.3.1-0003-shared-static-conan.patch @@ -0,0 +1,156 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -112,29 +112,47 @@ + + # static library + ++option(BUILD_SHARED "Build shared library." ON) + option(BUILD_STATIC "Build static library." OFF) + ++if (NOT BUILD_STATIC AND NOT BUILD_SHARED) ++ message(FATAL_ERROR "BUILD_SHAREDand BUILD_STATIC cannot be both disabled") ++endif () ++ + if (BUILD_STATIC) + add_library(orcania_static STATIC ${LIB_SRC}) ++ set_target_properties(orcania_static PROPERTIES ++ PUBLIC_HEADER "${INC_DIR}/orcania.h;${PROJECT_BINARY_DIR}/orcania-cfg.h") + target_compile_definitions(orcania_static PUBLIC -DO_STATIC_LIBRARY) + set_target_properties(orcania_static PROPERTIES + OUTPUT_NAME orcania) ++ if (MSVC) ++ set_target_properties(orcania_static PROPERTIES ++ OUTPUT_NAME orcania-static) ++ endif () ++ set(orcania_lib orcania_static) + endif () + + # shared library + +-add_library(orcania SHARED ${LIB_SRC}) +-if (NOT MSVC) ++if (BUILD_SHARED) ++ add_library(orcania SHARED ${LIB_SRC}) + set_target_properties(orcania PROPERTIES +- COMPILE_OPTIONS -Wextra +- PUBLIC_HEADER "${INC_DIR}/orcania.h;${PROJECT_BINARY_DIR}/orcania-cfg.h" +- VERSION "${LIBRARY_VERSION}" +- SOVERSION "${LIBRARY_SOVERSION}") +-endif() +-if (WIN32) +- set_target_properties(orcania PROPERTIES SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll") ++ PUBLIC_HEADER "${INC_DIR}/orcania.h;${PROJECT_BINARY_DIR}/orcania-cfg.h") ++ if (NOT MSVC) ++ set_target_properties(orcania PROPERTIES ++ COMPILE_OPTIONS -Wextra ++ VERSION "${LIBRARY_VERSION}" ++ SOVERSION "${LIBRARY_SOVERSION}") ++ endif() ++ if (WIN32) ++ set_target_properties(orcania PROPERTIES ++ SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll" ++ WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ++ endif () ++ target_link_libraries(orcania ${LIBS}) ++ set(orcania_lib orcania) + endif () +-target_link_libraries(orcania ${LIBS}) + + # documentation + +@@ -165,10 +183,14 @@ + if (BUILD_BASE64URL) + add_executable(base64url ${BASE64URL_DIR}/base64url.c ${INC_DIR}/orcania.h ${PROJECT_BINARY_DIR}/orcania-cfg.h) + set_target_properties(base64url PROPERTIES SKIP_BUILD_RPATH TRUE) +- add_dependencies(base64url orcania) +- target_link_libraries(base64url orcania ${LIBS}) ++ add_dependencies(base64url ${orcania_lib}) ++ target_link_libraries(base64url ${orcania_lib} ${LIBS}) + install(TARGETS base64url RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES ${BASE64URL_DIR}/base64url.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT runtime) ++ if(MSVC) ++ find_package(getopt-for-visual-studio REQUIRED) ++ target_link_libraries(base64url getopt-for-visual-studio::getopt-for-visual-studio) ++ endif() + endif () + + # tests +@@ -244,9 +266,12 @@ + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liborcania.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +-set(TARGETS orcania) ++set(TARGETS ) ++if (BUILD_SHARED) ++ list(APPEND TARGETS orcania) ++endif () + if (BUILD_STATIC) +- set(TARGETS ${TARGETS} orcania_static) ++ list(APPEND TARGETS orcania_static) + endif () + + if (INSTALL_HEADER) +@@ -320,6 +345,7 @@ + COMMAND ${CMAKE_MAKE_PROGRAM} package_source) + + message(STATUS "Force inline implementation of strstr: ${WITH_STRSTR}") ++message(STATUS "Build shared library: ${BUILD_SHARED}") + message(STATUS "Build static library: ${BUILD_STATIC}") + message(STATUS "Build testing tree: ${BUILD_ORCANIA_TESTING}") + message(STATUS "Install the header files: ${INSTALL_HEADER}") +--- src/orcania.c ++++ src/orcania.c +@@ -38,6 +38,13 @@ + #define strcasecmp _stricmp + #endif + ++#ifdef _MSC_VER ++#include ++typedef SSIZE_T ssize_t; ++#else ++#include ++#endif ++ + /** + * + * Orcania library +--- tools/base64url/base64url.c ++++ tools/base64url/base64url.c +@@ -19,13 +19,20 @@ + * + */ + +-#include + #include + #include + #include + #include + #include + ++#ifdef _MSC_VER ++#include ++#include ++typedef SSIZE_T ssize_t; ++#else ++#include ++#endif ++ + #define _BASE64URL_VERSION "0.9" + + #define ACTION_ENCODE 0 +@@ -98,12 +105,12 @@ + } + + static unsigned char * get_stdin_content(size_t * length) { +- int size = 100; +- unsigned char * out = NULL, buffer[size]; ++#define SIZE 100 ++ unsigned char * out = NULL, buffer[SIZE]; + ssize_t read_length; + + *length = 0; +- while ((read_length = read(0, buffer, size)) > 0) { ++ while ((read_length = read(0, buffer, SIZE)) > 0) { + out = o_realloc(out, (*length)+read_length+1); + memcpy(out+(*length), buffer, read_length); + (*length) += read_length; diff --git a/recipes/orcania/all/test_package/CMakeLists.txt b/recipes/orcania/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3fa9c9d5af35f --- /dev/null +++ b/recipes/orcania/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(Orcania REQUIRED CONFIG) + +option(ORCANIA_SHARED "Orcania is built as a shared library") + +add_executable(${PROJECT_NAME} test_package.c) +if(ORCANIA_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania-static) +endif() diff --git a/recipes/orcania/all/test_package/conanfile.py b/recipes/orcania/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0fc1e7b663eaf --- /dev/null +++ b/recipes/orcania/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ORCANIA_SHARED"] = self.dependencies["orcania"].options.shared + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/orcania/all/test_package/test_package.c b/recipes/orcania/all/test_package/test_package.c new file mode 100644 index 0000000000000..f8bd394a51f33 --- /dev/null +++ b/recipes/orcania/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include +#include + +int main() { + const char *mystring = "Hello world!"; + char* str2 = o_strdup(mystring); + puts(str2); + free(str2); + return 0; +} diff --git a/recipes/orcania/all/test_v1_package/CMakeLists.txt b/recipes/orcania/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..08501e6ccb845 --- /dev/null +++ b/recipes/orcania/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(Orcania REQUIRED CONFIG) + +option(ORCANIA_SHARED "Orcania is built as a shared library") + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +if(ORCANIA_SHARED) + target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania-static) +endif() diff --git a/recipes/orcania/all/test_v1_package/conanfile.py b/recipes/orcania/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..79db5a07b9c06 --- /dev/null +++ b/recipes/orcania/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["ORCANIA_SHARED"] = self.options["orcania"].shared + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/orcania/config.yml b/recipes/orcania/config.yml new file mode 100644 index 0000000000000..215bc57fe4993 --- /dev/null +++ b/recipes/orcania/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.1": + folder: all From b485b94ba4530f1176243794b8019008222ff477 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Sat, 22 Oct 2022 07:24:23 +0200 Subject: [PATCH 553/561] (#13656) [cmake-template] Simplify test_v1_package CMakeLists.txt * Simplify test_v1_package cmake Signed-off-by: Uilian Ries * Update docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt Signed-off-by: Uilian Ries --- .../all/test_v1_package/CMakeLists.txt | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt b/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt index 9be7f293be0fc..925ecbe19e448 100644 --- a/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt +++ b/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt @@ -1,16 +1,8 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) # if the project is pure C -project(test_package CXX) # if the project uses c++ +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(package REQUIRED CONFIG) - -# Re-use the same source file from test_package folder -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package -target_link_libraries(${PROJECT_NAME} PRIVATE package::package) -# in case the target project requires a C++ standard -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From a3d69d46868bafbe4e75bbc16703ab1071234b13 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 21 Oct 2022 22:44:14 -0700 Subject: [PATCH 554/561] (#13675) cli11: add version 2.3.0 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/cli11/all/conandata.yml | 3 +++ recipes/cli11/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cli11/all/conandata.yml b/recipes/cli11/all/conandata.yml index efda5e7b144a2..4464cb8b06e9d 100644 --- a/recipes/cli11/all/conandata.yml +++ b/recipes/cli11/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.3.0.tar.gz" + sha256: "b6e116ca1555e2b7f2743fd41e3bd18149baae791acd98eb653e5b07e0f20561" "2.2.0": url: "https://github.com/CLIUtils/CLI11/archive/v2.2.0.tar.gz" sha256: "d60440dc4d43255f872d174e416705f56ba40589f6eb07727f76376fb8378fd6" diff --git a/recipes/cli11/config.yml b/recipes/cli11/config.yml index 5e0bf50730232..ee8945176ae5b 100644 --- a/recipes/cli11/config.yml +++ b/recipes/cli11/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.0": + folder: all "2.2.0": folder: all "2.1.2": From 9fb6fea910fc755a598ef3a6e53b38a45d7c047a Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Fri, 21 Oct 2022 23:04:16 -0700 Subject: [PATCH 555/561] (#13676) wolfssl: add version 5.5.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/wolfssl/all/conandata.yml | 3 +++ recipes/wolfssl/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml index 18d51db251a4a..6fec683102ea7 100644 --- a/recipes/wolfssl/all/conandata.yml +++ b/recipes/wolfssl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.5.1": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.5.1-stable.tar.gz" + sha256: "97339e6956c90e7c881ba5c748dd04f7c30e5dbe0c06da765418c51375a6dee3" "5.4.0": url: "https://github.com/wolfSSL/wolfssl/archive/v5.4.0-stable.tar.gz" sha256: "dc36cc19dad197253e5c2ecaa490c7eef579ad448706e55d73d79396e814098b" diff --git a/recipes/wolfssl/config.yml b/recipes/wolfssl/config.yml index b5e6c7b8e93a2..84cd9530404f8 100644 --- a/recipes/wolfssl/config.yml +++ b/recipes/wolfssl/config.yml @@ -1,4 +1,6 @@ versions: + "5.5.1": + folder: all "5.4.0": folder: all "5.3.0": From 4e412b1285ca3dfed45872e026a8043b73ecaa5c Mon Sep 17 00:00:00 2001 From: Dennis Date: Sat, 22 Oct 2022 17:04:25 +0200 Subject: [PATCH 556/561] (#13643) asio-grpc: Add 2.2.0 * asio-grpc: Add 2.2.0 * asio-grpc: Revert to required_conan_version 1.50.0 --- recipes/asio-grpc/all/conandata.yml | 3 +++ recipes/asio-grpc/all/conanfile.py | 2 +- recipes/asio-grpc/config.yml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/asio-grpc/all/conandata.yml b/recipes/asio-grpc/all/conandata.yml index f6696b1252f27..60518d226bd20 100644 --- a/recipes/asio-grpc/all/conandata.yml +++ b/recipes/asio-grpc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.2.0.tar.gz" + sha256: "a820e48681bc66834f7e6dbc326e245416f4ef009769f45826b3d09079afad4c" "2.1.0": url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.1.0.tar.gz" sha256: "51da699eb442db3ec3af1caae5a29d78733ebbd9d1b781f75abe6ce2802fc7c1" diff --git a/recipes/asio-grpc/all/conanfile.py b/recipes/asio-grpc/all/conanfile.py index ada4cb6ee238a..7d8cde5489396 100644 --- a/recipes/asio-grpc/all/conanfile.py +++ b/recipes/asio-grpc/all/conanfile.py @@ -61,7 +61,7 @@ def configure(self): def requirements(self): self.requires("grpc/1.48.0") if self.options.use_boost_container or self.options.backend == "boost": - self.requires("boost/1.79.0") + self.requires("boost/1.80.0") if self.options.backend == "asio": self.requires("asio/1.24.0") if self.options.backend == "unifex": diff --git a/recipes/asio-grpc/config.yml b/recipes/asio-grpc/config.yml index f551acd515309..1b1afefa695a0 100644 --- a/recipes/asio-grpc/config.yml +++ b/recipes/asio-grpc/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: all "2.1.0": folder: all "2.0.0": From 075c6149950531eaf0d87d84dde2170b678a391e Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 22 Oct 2022 19:24:27 +0200 Subject: [PATCH 557/561] (#13561) restbed: add restbed/4.8 recipe * restbed: add restbed/4.8 recipe * restbed: add old-school test package * restbed: allow static Windows build + address feedback * restbed: require at least gcc 5 * restbed: fix conan v2 warning * restbed: use self.info in validate * restbed: set CMAKE_CXX_STANDARD if not already set * Apply suggestions from code review * Add 'm' tot system libraries * Update recipes/restbed/all/conanfile.py Co-authored-by: Uilian Ries * Address feedback * Address feedback * restbed: expand minimum compiler conformance testing * Use LicenseRef- prefix for license file Co-authored-by: Uilian Ries --- recipes/restbed/all/conandata.yml | 12 ++ recipes/restbed/all/conanfile.py | 128 ++++++++++++++++++ .../all/patches/4.8-0001-cmake-conan.patch | 84 ++++++++++++ .../4.8-0002-mingw-deprecated-fix.patch | 12 ++ .../restbed/all/test_package/CMakeLists.txt | 8 ++ recipes/restbed/all/test_package/conanfile.py | 30 ++++ .../restbed/all/test_package/test_package.cpp | 40 ++++++ .../all/test_v1_package/CMakeLists.txt | 11 ++ .../restbed/all/test_v1_package/conanfile.py | 17 +++ recipes/restbed/config.yml | 3 + 10 files changed, 345 insertions(+) create mode 100644 recipes/restbed/all/conandata.yml create mode 100644 recipes/restbed/all/conanfile.py create mode 100644 recipes/restbed/all/patches/4.8-0001-cmake-conan.patch create mode 100644 recipes/restbed/all/patches/4.8-0002-mingw-deprecated-fix.patch create mode 100644 recipes/restbed/all/test_package/CMakeLists.txt create mode 100644 recipes/restbed/all/test_package/conanfile.py create mode 100644 recipes/restbed/all/test_package/test_package.cpp create mode 100644 recipes/restbed/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/restbed/all/test_v1_package/conanfile.py create mode 100644 recipes/restbed/config.yml diff --git a/recipes/restbed/all/conandata.yml b/recipes/restbed/all/conandata.yml new file mode 100644 index 0000000000000..6e0b42fcccc44 --- /dev/null +++ b/recipes/restbed/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "4.8": + url: "https://github.com/Corvusoft/restbed/archive/refs/tags/4.8.tar.gz" + sha256: "4801833f86a67b8a123c2c01203e259eb81157e1e9ef144a3b6395cb2d838a42" +patches: + "4.8": + - patch_file: "patches/4.8-0001-cmake-conan.patch" + patch_description: "Use CMake targets + separate static/shared" + patch_type: "conan" + - patch_file: "patches/4.8-0002-mingw-deprecated-fix.patch" + patch_description: "MinGW apparently does not support deprecated and __declspec in the same line" + patch_type: "portability" diff --git a/recipes/restbed/all/conanfile.py b/recipes/restbed/all/conanfile.py new file mode 100644 index 0000000000000..0a5e2d6cfc925 --- /dev/null +++ b/recipes/restbed/all/conanfile.py @@ -0,0 +1,128 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, rm, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os +import re + +required_conan_version = ">=1.52.0" + + +class RestbedConan(ConanFile): + name = "restbed" + homepage = "https://github.com/Corvusoft/restbed" + description = "Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++14 applications." + topics = ("restful", "server", "client", "json", "http", "ssl", "tls") + url = "https://github.com/conan-io/conan-center-index" + license = "AGPL-3.0-or-later", "LicenseRef-CPL" # Corvusoft Permissive License (CPL) + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "ipc": [True, False], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "ipc": False, + "with_openssl": True, + } + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + try: + del self.options.fPIC + except Exception: + pass + if self.settings.os in ("Windows", ): + del self.options.ipc + + def validate(self): + if getattr(self.info.settings.compiler, "cppstd"): + check_min_cppstd(self, self._minimum_cpp_standard) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("asio/1.24.0") + if self.options.with_openssl: + self.requires("openssl/3.0.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_SSL"] = self.options.with_openssl + tc.variables["BUILD_IPC"] = self.options.get_safe("ipc", False) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if not self.options.shared: + # Remove __declspec(dllexport) and __declspec(dllimport) + for root, _, files in os.walk(self.source_folder): + for file in files: + if os.path.splitext(file)[1] in (".hpp", ".h"): + full_path = os.path.join(root, file) + data = load(self, full_path) + data, _ = re.subn(r"__declspec\((dllexport|dllimport)\)", "", data) + save(self, full_path, data) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + libname = "restbed" + if self.settings.os in ("Windows", ) and self.options.shared: + libname += "-shared" + self.cpp_info.libs = [libname] + + if self.settings.os in ("FreeBSD", "Linux", ): + self.cpp_info.system_libs.extend(["dl", "m"]) + elif self.settings.os in ("Windows", ): + self.cpp_info.system_libs.append("mswsock") diff --git a/recipes/restbed/all/patches/4.8-0001-cmake-conan.patch b/recipes/restbed/all/patches/4.8-0001-cmake-conan.patch new file mode 100644 index 0000000000000..e239976a0dfce --- /dev/null +++ b/recipes/restbed/all/patches/4.8-0001-cmake-conan.patch @@ -0,0 +1,84 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -19,7 +19,7 @@ + option( BUILD_TESTS "Build unit tests." ON ) + option( BUILD_SSL "Build secure socket layer support." ON ) + option( BUILD_IPC "Build unix domain socket layer support." OFF ) +- ++set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + # + # Configuration + # +@@ -57,7 +57,7 @@ find_package( asio REQUIRED ) + + if ( BUILD_SSL ) + add_definitions( "-DBUILD_SSL" ) +- find_package( openssl REQUIRED ) ++ find_package( OpenSSL REQUIRED ) + endif ( ) + + include_directories( ${INCLUDE_DIR} SYSTEM ${asio_INCLUDE} ${ssl_INCLUDE} ) +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -68,7 +68,7 @@ + + if ( WIN32 ) + add_definitions( -DWIN_DLL_EXPORT ) +- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251" ) ++ #set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251" ) + endif ( ) + + # +@@ -75,13 +75,14 @@ + # Build + # + file( GLOB_RECURSE MANIFEST "${SOURCE_DIR}/*.cpp" ) +- ++if(NOT BUILD_SHARED_LIBS) + set( STATIC_LIBRARY_NAME "${PROJECT_NAME}-static" ) + add_library( ${STATIC_LIBRARY_NAME} STATIC ${MANIFEST} ) + set_property( TARGET ${STATIC_LIBRARY_NAME} PROPERTY CXX_STANDARD 14 ) + set_property( TARGET ${STATIC_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON ) + set_target_properties( ${STATIC_LIBRARY_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} ) +- ++target_link_libraries( ${STATIC_LIBRARY_NAME} LINK_PRIVATE asio::asio ) ++else() + set( SHARED_LIBRARY_NAME "${PROJECT_NAME}-shared" ) + add_library( ${SHARED_LIBRARY_NAME} SHARED ${MANIFEST} ) + set_property( TARGET ${SHARED_LIBRARY_NAME} PROPERTY CXX_STANDARD 14 ) +@@ -93,13 +94,20 @@ + set_target_properties( ${SHARED_LIBRARY_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} ) + endif ( ) + set_target_properties( ${SHARED_LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} ) +- ++target_link_libraries( ${SHARED_LIBRARY_NAME} LINK_PRIVATE asio::asio ) ++endif() + if ( BUILD_SSL ) +- target_link_libraries( ${SHARED_LIBRARY_NAME} LINK_PRIVATE ${ssl_LIBRARY_SHARED} ${crypto_LIBRARY_SHARED} ) +- target_link_libraries( ${STATIC_LIBRARY_NAME} LINK_PRIVATE ${ssl_LIBRARY_STATIC} ${crypto_LIBRARY_STATIC} ${CMAKE_DL_LIBS} ) ++if(BUILD_SHARED_LIBS) ++ target_link_libraries( ${SHARED_LIBRARY_NAME} LINK_PRIVATE OpenSSL::SSL $<$:mswsock>) ++else() ++ target_link_libraries( ${STATIC_LIBRARY_NAME} LINK_PRIVATE OpenSSL::SSL ${CMAKE_DL_LIBS} $<$:mswsock>) ++endif() + else ( ) ++if(BUILD_SHARED_LIBS) +- target_link_libraries( ${SHARED_LIBRARY_NAME} ) ++ target_link_libraries( ${SHARED_LIBRARY_NAME} OpenSSL::SSL $<$:mswsock>) ++else() +- target_link_libraries( ${STATIC_LIBRARY_NAME} ${CMAKE_DL_LIBS} ) ++ target_link_libraries( ${STATIC_LIBRARY_NAME} ${CMAKE_DL_LIBS} OpenSSL::SSL $<$:mswsock>) ++endif() + endif ( ) + + if ( BUILD_TESTS ) +@@ -119,5 +127,8 @@ + + install( FILES "${INCLUDE_DIR}/${PROJECT_NAME}" DESTINATION "${CMAKE_INSTALL_PREFIX}/include" ) + install( FILES ${ARTIFACTS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/corvusoft/${PROJECT_NAME}" ) ++if(NOT BUILD_SHARED_LIBS) + install( TARGETS ${STATIC_LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library ) ++else() +-install( TARGETS ${SHARED_LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library ) ++install( TARGETS ${SHARED_LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT library ) ++endif() diff --git a/recipes/restbed/all/patches/4.8-0002-mingw-deprecated-fix.patch b/recipes/restbed/all/patches/4.8-0002-mingw-deprecated-fix.patch new file mode 100644 index 0000000000000..98f35027afdd1 --- /dev/null +++ b/recipes/restbed/all/patches/4.8-0002-mingw-deprecated-fix.patch @@ -0,0 +1,12 @@ +--- source/corvusoft/restbed/http.hpp ++++ source/corvusoft/restbed/http.hpp +@@ -40,7 +40,7 @@ + class Response; + class Settings; +- +- class [[deprecated("HTTP client is deprecated; we will release a complimentary client framework at a future date.")]] HTTP_EXPORT Http ++ class HTTP_EXPORT Http; ++ class [[deprecated("HTTP client is deprecated; we will release a complimentary client framework at a future date.")]] Http + { + public: + //Friends diff --git a/recipes/restbed/all/test_package/CMakeLists.txt b/recipes/restbed/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3bad6b5f5053d --- /dev/null +++ b/recipes/restbed/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(restbed REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE restbed::restbed) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/restbed/all/test_package/conanfile.py b/recipes/restbed/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f72d1f660e19f --- /dev/null +++ b/recipes/restbed/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/restbed/all/test_package/test_package.cpp b/recipes/restbed/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d4731f4f97f74 --- /dev/null +++ b/recipes/restbed/all/test_package/test_package.cpp @@ -0,0 +1,40 @@ +#include + +#include +#include +#include +#include + +static void post_method_handler( const std::shared_ptr< restbed::Session > session ) +{ + const auto request = session->get_request( ); + + int content_length = request->get_header( "Content-Length", 0 ); + + session->fetch( content_length, [ ]( const std::shared_ptr< restbed::Session > session, const restbed::Bytes & body ) + { + fprintf( stdout, "%.*s\n", ( int ) body.size( ), body.data( ) ); + session->close( restbed::OK, "Hello, World!", { { "Content-Length", "13" } } ); + } ); +} + +int main(int argc, char *argv[]) +{ + auto resource = std::make_shared< restbed::Resource >( ); + resource->set_path( "/resource" ); + resource->set_method_handler( "POST", post_method_handler ); + + auto settings = std::make_shared< restbed::Settings >( ); + settings->set_port( 1984 ); + settings->set_default_header( "Connection", "close" ); + + restbed::Service service; + service.publish( resource ); + + if (argc > 1 && strcmp(argv[1], "run") == 0) { + // Don't start the service to avoid blocking + service.start( settings ); + } + + return EXIT_SUCCESS; +} diff --git a/recipes/restbed/all/test_v1_package/CMakeLists.txt b/recipes/restbed/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..87b1318ff1676 --- /dev/null +++ b/recipes/restbed/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(TARGETS) + +find_package(restbed REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE restbed::restbed) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/restbed/all/test_v1_package/conanfile.py b/recipes/restbed/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/restbed/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/restbed/config.yml b/recipes/restbed/config.yml new file mode 100644 index 0000000000000..5a6e56bf2599d --- /dev/null +++ b/recipes/restbed/config.yml @@ -0,0 +1,3 @@ +versions: + "4.8": + folder: all From 03c38024938acca8b24fa3a37e7458417ec530c1 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 23 Oct 2022 11:44:58 +0900 Subject: [PATCH 558/561] (#13692) daw_json_link: add version 3.1.1 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/) Co-authored-by: Quentin Chateau via Conan Center Bot --- recipes/daw_json_link/all/conandata.yml | 3 +++ recipes/daw_json_link/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/daw_json_link/all/conandata.yml b/recipes/daw_json_link/all/conandata.yml index 9c2d497ce2b1b..33e4220a0ef53 100644 --- a/recipes/daw_json_link/all/conandata.yml +++ b/recipes/daw_json_link/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.1": + url: "https://github.com/beached/daw_json_link/archive/v3.1.1.tar.gz" + sha256: "7d340886898b2ea3c595f0f871c81e4c7382fe53d22d80edc5629768e49fa634" "3.1.0": url: "https://github.com/beached/daw_json_link/archive/v3.1.0.tar.gz" sha256: "c1134fed24794cda598306d23d23c393a0df8ee13d0019cae6ed46b939dad190" diff --git a/recipes/daw_json_link/config.yml b/recipes/daw_json_link/config.yml index e7355da02f8ab..fd13a438a6f48 100644 --- a/recipes/daw_json_link/config.yml +++ b/recipes/daw_json_link/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.1": + folder: "all" "3.1.0": folder: "all" "3.0.5": From 7fcccd10ad9c7c77e29293b87c929120f2764de3 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Sun, 23 Oct 2022 10:08:23 +0200 Subject: [PATCH 559/561] use export_conandata_patches --- recipes/automake/all/conanfile.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 60d978743f1fc..519d42d87033c 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -2,13 +2,13 @@ from conan import ConanFile from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir, export_conandata_patches from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, unix_path from conan.tools.scm import Version -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.52" class AutomakeConan(ConanFile): @@ -26,8 +26,7 @@ def _settings_build(self): return getattr(self, "settings_build", self.settings) def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def configure(self): self.win_bash = self._settings_build.os == "Windows" From 303355e4bc8b0aab56a76b4079708ee0a70a4d0d Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Sun, 23 Oct 2022 10:08:53 +0200 Subject: [PATCH 560/561] Use src folder as name for consistency --- recipes/automake/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 519d42d87033c..973d5219e6ba6 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -40,7 +40,7 @@ def configure(self): pass def layout(self): - basic_layout(self, src_folder="automake") + basic_layout(self, src_folder="src") def requirements(self): self.requires("autoconf/2.71") From 070119f5e342e3cf4fabd2e18410ff0c3bbedd51 Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Sun, 23 Oct 2022 10:13:39 +0200 Subject: [PATCH 561/561] Removed unused conf_info values As described in https://github.com/conan-io/conan-center-index/pull/13490 Added a fixme note to the user_info entries, I also kept these conf_info, Such that downstream projects which relied on the `user_info` can migrate to `conf_info`. --- recipes/automake/all/conanfile.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 973d5219e6ba6..614f14f92d29c 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -143,36 +143,28 @@ def package_info(self): self.env_info.ACLOCAL = aclocal_bin self.buildenv_info.define_path("ACLOCAL", aclocal_bin) - aclocal_bin_conf_key = "user.automake:aclocal" - self.output.info(f"Defining path to aclocal binary in configuration as `{aclocal_bin_conf_key}` with value: {aclocal_bin}") - self.conf_info.define(aclocal_bin_conf_key, aclocal_bin) - automake_bin = path.join(bin_path, "automake") self.output.info(f"Defining AUTOMAKE environment variable: {automake_bin}") self.env_info.AUTOMAKE = automake_bin self.buildenv_info.define_path("AUTOMAKE", automake_bin) - automake_bin_conf_key = "user.automake:automake" - self.output.info(f"Defining path to automake binary in configuration as `{automake_bin_conf_key}` with value: {automake_bin}") - self.conf_info.define(automake_bin_conf_key, automake_bin) - compile_bin = path.join(automake_dataroot_path, "compile") self.output.info(f"Define path to `compile` binary in user_info as: {compile_bin}") - self.user_info.compile = compile_bin + self.user_info.compile = compile_bin # FIXME: Conan V2 will use conf_key instead of user_info compile_conf_key = "user.automake:compile" self.output.info(f"Defining path to `compile` binary in configuration as `{compile_conf_key}` with value: {compile_bin}") self.conf_info.define(compile_conf_key, compile_bin) ar_lib_bin = path.join(automake_dataroot_path, "ar-lib") self.output.info(f"Define path to ar_lib binary in user_info as: {ar_lib_bin}") - self.user_info.ar_lib = ar_lib_bin + self.user_info.ar_lib = ar_lib_bin # FIXME: Conan V2 will use conf_key instead of user_info ar_lib_conf_key = "user.automake:ar-lib" self.output.info(f"Defining path to ar-lib binary in configuration as `{ar_lib_conf_key}` with value: {ar_lib_bin}") self.conf_info.define(ar_lib_conf_key, ar_lib_bin) install_sh_bin = path.join(automake_dataroot_path, "install-sh") self.output.info(f"Define path to install_sh binary in user_info as: {install_sh_bin}") - self.user_info.install_sh = install_sh_bin + self.user_info.install_sh = install_sh_bin # FIXME: Conan V2 will use conf_key instead of user_info install_sh_conf_key = "user.automake:install-sh" self.output.info(f"Defining path to install_sh binary in configuration as `{install_sh_conf_key}` with value: {install_sh_bin}") self.conf_info.define(install_sh_conf_key, install_sh_bin)